#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
double plus(double, double);
int /*<<< orphan*/ printf(char *, double, char *);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ scanf(char *, double *, double *);
int main() {
  double d1, d2;
  puts("请输入两个数字，以一个空格隔开:");
  scanf("%lf %lf", &d1, &d2);
  double sum = plus(d1, d2);
  puts("两个数之和为:");
  printf("%lf%s", sum, "\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
call   1040 <puts@plt>
lea    0xecd(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1060 <scanf@plt>
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
call   1030 <plus@plt>
movsd  %xmm0,-0x20(%rbp)
lea    0xead(%rip),%rdi
call   1040 <puts@plt>
movsd  -0x20(%rbp),%xmm0
lea    0xeb0(%rip),%rdi
lea    0xeaf(%rip),%rsi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xeb5(%rip),%rdi
call   1040 <puts@plt>
lea    0xed8(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1060 <scanf@plt>
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
call   1030 <plus@plt>
movsd  %xmm0,(%rsp)
lea    0xeb4(%rip),%rdi
call   1040 <puts@plt>
lea    0xebc(%rip),%rdi
lea    0xebb(%rip),%rsi
movsd  (%rsp),%xmm0
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [47 x i8] c"\E8\AF\B7\E8\BE\93\E5\85\A5\E4\B8\A4\E4\B8\AA\E6\95\B0\E5\AD\97\EF\BC\8C\E4\BB\A5\E4\B8\80\E4\B8\AA\E7\A9\BA\E6\A0\BC\E9\9A\94\E5\BC\80:\00"
@.str.1 = [8 x i8] c"%lf %lf\00"
@.str.2 = [20 x i8] c"\E4\B8\A4\E4\B8\AA\E6\95\B0\E4\B9\8B\E5\92\8C\E4\B8\BA:\00"
@.str.3 = [6 x i8] c"%lf%s\00"
@.str.4 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
store i32 0, i32* %1
%5 = call i32 @puts(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), double* %2, double* %3)
%7 = load double, double* %2
%8 = load double, double* %3
%9 = call double @plus(double %7, double %8)
store double %9, double* %4
%10 = call i32 @puts(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
%11 = load double, double* %4
%12 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), double %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [47 x i8] c"\E8\AF\B7\E8\BE\93\E5\85\A5\E4\B8\A4\E4\B8\AA\E6\95\B0\E5\AD\97\EF\BC\8C\E4\BB\A5\E4\B8\80\E4\B8\AA\E7\A9\BA\E6\A0\BC\E9\9A\94\E5\BC\80:\00"
@.str.1 = [8 x i8] c"%lf %lf\00"
@.str.2 = [20 x i8] c"\E4\B8\A4\E4\B8\AA\E6\95\B0\E4\B9\8B\E5\92\8C\E4\B8\BA:\00"
@.str.3 = [6 x i8] c"%lf%s\00"
@.str.4 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = bitcast double* %1 to i8*
%4 = bitcast double* %2 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), double* %1, double* %2)
%7 = load double, double* %1
%8 = load double, double* %2
%9 = call double @plus(double %7, double %8)
%10 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
%11 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), double %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}