Advertisement
_takumi

unedited

Nov 27th, 2022
1,594
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     .file   "main.c"
  2.     .intel_syntax noprefix
  3.     .text
  4.     .globl  f
  5.     .type   f, @function
  6. f:
  7.     push    rbp
  8.     mov rbp, rsp
  9.     movsd   QWORD PTR -40[rbp], xmm0
  10.     movsd   QWORD PTR -48[rbp], xmm1
  11.     movsd   QWORD PTR -56[rbp], xmm2
  12.     movsd   xmm0, QWORD PTR .LC0[rip]
  13.     movsd   QWORD PTR -24[rbp], xmm0
  14.     movsd   xmm0, QWORD PTR .LC0[rip]
  15.     movsd   QWORD PTR -16[rbp], xmm0
  16.     pxor    xmm0, xmm0
  17.     movsd   QWORD PTR -8[rbp], xmm0
  18.     jmp .L2
  19. .L3:
  20.     movsd   xmm0, QWORD PTR -48[rbp]
  21.     subsd   xmm0, QWORD PTR -8[rbp]
  22.     mulsd   xmm0, QWORD PTR -40[rbp]
  23.     movsd   xmm2, QWORD PTR -8[rbp]
  24.     movsd   xmm1, QWORD PTR .LC0[rip]
  25.     addsd   xmm1, xmm2
  26.     divsd   xmm0, xmm1
  27.     movsd   xmm1, QWORD PTR -16[rbp]
  28.     mulsd   xmm0, xmm1
  29.     movsd   QWORD PTR -16[rbp], xmm0
  30.     movsd   xmm0, QWORD PTR -24[rbp]
  31.     addsd   xmm0, QWORD PTR -16[rbp]
  32.     movsd   QWORD PTR -24[rbp], xmm0
  33.     movsd   xmm1, QWORD PTR -8[rbp]
  34.     movsd   xmm0, QWORD PTR .LC0[rip]
  35.     addsd   xmm0, xmm1
  36.     movsd   QWORD PTR -8[rbp], xmm0
  37. .L2:
  38.     movsd   xmm0, QWORD PTR -56[rbp]
  39.     comisd  xmm0, QWORD PTR -8[rbp]
  40.     ja  .L3
  41.     movsd   xmm0, QWORD PTR -24[rbp]
  42.     pop rbp
  43.     ret
  44.     .size   f, .-f
  45.     .section    .rodata
  46.     .align 8
  47. .LC2:
  48.     .string "Incorrect input, check README.md"
  49. .LC3:
  50.     .string "r"
  51. .LC4:
  52.     .string "w"
  53. .LC5:
  54.     .string "Incorrect file"
  55. .LC6:
  56.     .string "%lf"
  57. .LC8:
  58.     .string "|x| must be less than 1"
  59. .LC10:
  60.     .string "Answer = %lf\n"
  61.     .text
  62.     .globl  main
  63.     .type   main, @function
  64. main:
  65.     push    rbp
  66.     mov rbp, rsp
  67.     sub rsp, 64
  68.     mov DWORD PTR -52[rbp], edi
  69.     mov QWORD PTR -64[rbp], rsi
  70.     mov rax, QWORD PTR fs:40
  71.     mov QWORD PTR -8[rbp], rax
  72.     xor eax, eax
  73.     cmp DWORD PTR -52[rbp], 3
  74.     je  .L6
  75.     lea rdi, .LC2[rip]
  76.     call    puts@PLT
  77.     mov eax, 0
  78.     jmp .L13
  79. .L6:
  80.     mov rax, QWORD PTR -64[rbp]
  81.     add rax, 8
  82.     mov rax, QWORD PTR [rax]
  83.     lea rsi, .LC3[rip]
  84.     mov rdi, rax
  85.     call    fopen@PLT
  86.     mov QWORD PTR -32[rbp], rax
  87.     mov rax, QWORD PTR -64[rbp]
  88.     add rax, 16
  89.     mov rax, QWORD PTR [rax]
  90.     lea rsi, .LC4[rip]
  91.     mov rdi, rax
  92.     call    fopen@PLT
  93.     mov QWORD PTR -24[rbp], rax
  94.     cmp QWORD PTR -32[rbp], 0
  95.     je  .L8
  96.     cmp QWORD PTR -24[rbp], 0
  97.     jne .L9
  98. .L8:
  99.     lea rdi, .LC5[rip]
  100.     call    puts@PLT
  101.     mov eax, 0
  102.     jmp .L13
  103. .L9:
  104.     lea rdx, -48[rbp]
  105.     mov rax, QWORD PTR -32[rbp]
  106.     lea rsi, .LC6[rip]
  107.     mov rdi, rax
  108.     mov eax, 0
  109.     call    __isoc99_fscanf@PLT
  110.     lea rdx, -40[rbp]
  111.     mov rax, QWORD PTR -32[rbp]
  112.     lea rsi, .LC6[rip]
  113.     mov rdi, rax
  114.     mov eax, 0
  115.     call    __isoc99_fscanf@PLT
  116.     movsd   xmm0, QWORD PTR -48[rbp]
  117.     movsd   xmm1, QWORD PTR .LC0[rip]
  118.     comisd  xmm0, xmm1
  119.     ja  .L10
  120.     movsd   xmm1, QWORD PTR -48[rbp]
  121.     movsd   xmm0, QWORD PTR .LC7[rip]
  122.     comisd  xmm0, xmm1
  123.     jbe .L15
  124. .L10:
  125.     lea rdi, .LC8[rip]
  126.     call    puts@PLT
  127.     mov eax, 0
  128.     jmp .L13
  129. .L15:
  130.     movsd   xmm0, QWORD PTR -40[rbp]
  131.     mov rax, QWORD PTR -48[rbp]
  132.     movsd   xmm1, QWORD PTR .LC9[rip]
  133.     movapd  xmm2, xmm1
  134.     movapd  xmm1, xmm0
  135.     movq    xmm0, rax
  136.     call    f
  137.     movq    rax, xmm0
  138.     mov QWORD PTR -16[rbp], rax
  139.     mov rdx, QWORD PTR -16[rbp]
  140.     mov rax, QWORD PTR -24[rbp]
  141.     movq    xmm0, rdx
  142.     lea rsi, .LC10[rip]
  143.     mov rdi, rax
  144.     mov eax, 1
  145.     call    fprintf@PLT
  146.     mov rax, QWORD PTR -32[rbp]
  147.     mov rdi, rax
  148.     call    fclose@PLT
  149.     mov rax, QWORD PTR -24[rbp]
  150.     mov rdi, rax
  151.     call    fclose@PLT
  152.     mov eax, 0
  153. .L13:
  154.     mov rcx, QWORD PTR -8[rbp]
  155.     xor rcx, QWORD PTR fs:40
  156.     je  .L14
  157.     call    __stack_chk_fail@PLT
  158. .L14:
  159.     leave
  160.     ret
  161.     .size   main, .-main
  162.     .section    .rodata
  163.     .align 8
  164. .LC0:
  165.     .long   0
  166.     .long   1072693248
  167.     .align 8
  168. .LC7:
  169.     .long   0
  170.     .long   -1074790400
  171.     .align 8
  172. .LC9:
  173.     .long   0
  174.     .long   1078525952
  175.     .ident  "GCC: (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0"
  176.     .section    .note.GNU-stack,"",@progbits
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement