
Patrick B. answered 04/03/21
Math and computer tutor/teacher
#include <stdio.h>
int main()
{
double x,y,z;
double sum;
printf(" Please input the 1st number :>");
scanf("%lf",&x);
printf(" Please input the 2nd number :>");
scanf("%lf",&y);
printf(" Please input the 3rd number :>");
scanf("%lf",&z);
sum = x + y + z;
printf(" the sum is %lf \n",sum);
}
/******************************************************************************************
'-------------------------------------------------------------------------------------------------------
.LC0:
.ascii " Please input the 1st number :>\0"
.LC1:
.ascii "%lf\0"
.align 8
.LC2:
.ascii " Please input the 2nd number :>\0"
.align 8
.LC3:
.ascii " Please input the 3rd number :>\0"
.LC4:
.ascii " the sum is %lf \12\0"
.text
.globl main
.def main; .scl 2; .type 32; .endef
.seh_proc main
main:
.LFB15:
pushq %rbp
.seh_pushreg %rbp
movq %rsp, %rbp
.seh_setframe %rbp, 0
subq $80, %rsp
.seh_stackalloc 80
.seh_endprologue
call __main
leaq .LC0(%rip), %rcx
call printf
leaq -16(%rbp), %rax
movq %rax, %rdx
leaq .LC1(%rip), %rcx
call scanf
leaq .LC2(%rip), %rcx
call printf
leaq -24(%rbp), %rax
movq %rax, %rdx
leaq .LC1(%rip), %rcx
call scanf
leaq .LC3(%rip), %rcx
call printf
leaq -32(%rbp), %rax
movq %rax, %rdx
leaq .LC1(%rip), %rcx
call scanf
movsd -16(%rbp), %xmm1
movsd -24(%rbp), %xmm0
addsd %xmm1, %xmm0
movsd -32(%rbp), %xmm1
addsd %xmm1, %xmm0
movq %xmm0, %rax
movq %rax, -8(%rbp)
movq -8(%rbp), %rdx
movq -8(%rbp), %rax
movq %rdx, -40(%rbp)
movsd -40(%rbp), %xmm1
movq %rax, %rdx
leaq .LC4(%rip), %rcx
call printf
movl $0, %eax
addq $80, %rsp
popq %rbp
ret
.seh_endproc
.ident "GCC: (tdm64-1) 4.9.2"
.def printf; .scl 2; .type 32; .endef
.def scanf; .scl 2; .type 32; .endef