Advertisement
_takumi

7main.s

Nov 26th, 2022
1,317
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     .file   "7.c"
  2.     .section    .rodata
  3.     .align 8
  4. .LC1:
  5.     .string "Incrorrect input, check README.md"
  6. .LC2:
  7.     .string "r"
  8. .LC3:
  9.     .string "w"
  10. .LC4:
  11.     .string "incorrect file"
  12. .LC5:
  13.     .string "%lf"
  14. .LC6:
  15.     .string "%d"
  16. .LC7:
  17.     .string "integral = %lf\n"
  18.     .text
  19.     .globl  main
  20.     .type   main, @function
  21. main:
  22. .LFB7:
  23.     .cfi_startproc
  24.     pushq   %rbp
  25.     .cfi_def_cfa_offset 16
  26.     .cfi_offset 6, -16
  27.     movq    %rsp, %rbp
  28.     .cfi_def_cfa_register 6
  29.     subq    $96, %rsp
  30.     movl    %edi, -68(%rbp)     #argc
  31.     movq    %rsi, -80(%rbp)     #argv
  32.     movq    %fs:40, %rax
  33.     movq    %rax, -8(%rbp)
  34.     xorl    %eax, %eax
  35.     cmpl    $3, -68(%rbp)
  36.     je  .L8
  37.     leaq    .LC1(%rip), %rdi
  38.     call    puts@PLT
  39.     movl    $0, %eax
  40.     jmp .L12
  41. .L8:
  42.     movq    -80(%rbp), %rax
  43.     addq    $8, %rax
  44.     movq    (%rax), %rax
  45.     leaq    .LC2(%rip), %rsi
  46.     movq    %rax, %rdi
  47.     call    fopen@PLT       #input
  48.     movq    %rax, -32(%rbp)
  49.     movq    -80(%rbp), %rax
  50.     addq    $16, %rax
  51.     movq    (%rax), %rax
  52.     leaq    .LC3(%rip), %rsi
  53.     movq    %rax, %rdi
  54.     call    fopen@PLT       #output
  55.     movq    %rax, -24(%rbp)
  56.     cmpq    $0, -32(%rbp)
  57.     je  .L10
  58.     cmpq    $0, -24(%rbp)
  59.     jne .L11
  60. .L10:
  61.     leaq    .LC4(%rip), %rdi
  62.     call    puts@PLT
  63.     movl    $0, %eax
  64.     jmp .L12
  65. .L11:
  66.     leaq    -48(%rbp), %rdx
  67.     movq    -32(%rbp), %rax
  68.     leaq    .LC5(%rip), %rsi
  69.     movq    %rax, %rdi
  70.     movl    $0, %eax
  71.     call    __isoc99_fscanf@PLT
  72.     leaq    -40(%rbp), %rdx
  73.     movq    -32(%rbp), %rax     #a
  74.     leaq    .LC5(%rip), %rsi
  75.     movq    %rax, %rdi
  76.     movl    $0, %eax
  77.     call    __isoc99_fscanf@PLT
  78.     leaq    -56(%rbp), %rdx    
  79.     movq    -32(%rbp), %rax     #b
  80.     leaq    .LC6(%rip), %rsi
  81.     movq    %rax, %rdi
  82.     movl    $0, %eax
  83.     call    __isoc99_fscanf@PLT
  84.     leaq    -52(%rbp), %rdx
  85.     movq    -32(%rbp), %rax     #A
  86.     leaq    .LC6(%rip), %rsi
  87.     movq    %rax, %rdi
  88.     movl    $0, %eax
  89.     call    __isoc99_fscanf@PLT
  90.     movl    -52(%rbp), %ecx     #a to func S
  91.     movl    -56(%rbp), %edx     #b to func S
  92.     movsd   -40(%rbp), %xmm0    #A to func S
  93.     movq    -48(%rbp), %rax     #B to func S
  94.     movl    %ecx, %esi
  95.     movl    %edx, %edi
  96.     movapd  %xmm0, %xmm1
  97.     movq    %rax, -88(%rbp)    
  98.     movsd   -88(%rbp), %xmm0   
  99.     call    S
  100.     movq    %xmm0, %rax     #save s from func S
  101.     movq    %rax, -16(%rbp)
  102.     movq    -16(%rbp), %rdx
  103.     movq    -24(%rbp), %rax
  104.     movq    %rdx, -88(%rbp)
  105.     movsd   -88(%rbp), %xmm0    #s
  106.     leaq    .LC7(%rip), %rsi    #" "
  107.     movq    %rax, %rdi      #out
  108.     movl    $1, %eax
  109.     call    fprintf@PLT
  110.     movq    -32(%rbp), %rax
  111.     movq    %rax, %rdi
  112.     call    fclose@PLT      #close input
  113.     movq    -24(%rbp), %rax
  114.     movq    %rax, %rdi
  115.     call    fclose@PLT      #close out
  116.     movl    $0, %eax
  117. .L12:
  118.     movq    -8(%rbp), %rcx
  119.     xorq    %fs:40, %rcx
  120.     je  .L13
  121.     call    __stack_chk_fail@PLT
  122. .L13:
  123.     leave
  124.     .cfi_def_cfa 7, 8
  125.     ret
  126.     .cfi_endproc
  127. .LFE7:
  128.     .size   main, .-main
  129.     .ident  "GCC: (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0"
  130.     .section    .note.GNU-stack,"",@progbits
  131.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement