Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .file "7.c"
- .text
- .globl f
- .type f, @function
- f:
- .LFB5:
- .cfi_startproc
- pushq %rbp
- .cfi_def_cfa_offset 16
- .cfi_offset 6, -16
- movq %rsp, %rbp
- .cfi_def_cfa_register 6
- movsd %xmm0, -8(%rbp) #a
- movsd %xmm1, -16(%rbp) #b
- movsd %xmm2, -24(%rbp) #x
- movsd -16(%rbp), %xmm0
- mulsd -24(%rbp), %xmm0
- mulsd -24(%rbp), %xmm0
- mulsd -24(%rbp), %xmm0
- mulsd -24(%rbp), %xmm0
- addsd -8(%rbp), %xmm0
- popq %rbp
- .cfi_def_cfa 7, 8
- ret
- .cfi_endproc
- .LFE5:
- .size f, .-f
- .globl S
- .type S, @function
- S:
- .LFB6:
- .cfi_startproc
- pushq %rbp
- .cfi_def_cfa_offset 16
- .cfi_offset 6, -16
- movq %rsp, %rbp
- .cfi_def_cfa_register 6
- subq $64, %rsp
- movsd %xmm0, -40(%rbp) #a
- movsd %xmm1, -48(%rbp) #b
- movl %edi, -52(%rbp) #A
- movl %esi, -56(%rbp) #B
- movl $100000000, -20(%rbp) # n
- movl -56(%rbp), %eax
- subl -52(%rbp), %eax #(B - A)
- cvtsi2ss %eax, %xmm0
- cvtsi2ss -20(%rbp), %xmm1
- divss %xmm1, %xmm0 #(B - A) / n
- cvtss2sd %xmm0, %xmm0
- movsd %xmm0, -8(%rbp) #save h
- pxor %xmm0, %xmm0
- movsd %xmm0, -16(%rbp) #sum
- movl $0, -24(%rbp) #int i = 0
- jmp .L4
- .L5:
- cvtsi2sd -52(%rbp), %xmm1 #A
- cvtsi2sd -24(%rbp), %xmm0 # h
- mulsd -8(%rbp), %xmm0 # i * h
- addsd %xmm1, %xmm0 #A + i * h
- movsd -48(%rbp), %xmm1 #A + i *h to f
- movq -40(%rbp), %rax #a to f
- movapd %xmm0, %xmm2
- movq %rax, -64(%rbp) #b to f
- movsd -64(%rbp), %xmm0
- call f
- movapd %xmm0, %xmm1
- movsd -16(%rbp), %xmm0
- addsd %xmm1, %xmm0
- movsd %xmm0, -16(%rbp)
- addl $1, -24(%rbp)
- .L4:
- movl -24(%rbp), %eax
- cmpl -20(%rbp), %eax
- jl .L5
- movsd -8(%rbp), %xmm0
- mulsd -16(%rbp), %xmm0 #return h * sum
- leave
- .cfi_def_cfa 7, 8
- ret
- .cfi_endproc
- .LFE6:
- .size S, .-S
- .section .rodata
- .align 8
- .LC1:
- .string "Incrorrect input, check README.md"
- .LC2:
- .string "r"
- .LC3:
- .string "w"
- .LC4:
- .string "incorrect file"
- .LC5:
- .string "%lf"
- .LC6:
- .string "%d"
- .LC7:
- .string "integral = %lf\n"
- .text
- .ident "GCC: (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0"
- .section .note.GNU-stack,"",@progbits
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement