#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 add(double, double);
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ printf(char *, double);
int main() {
  double a, b, c;
  a = 1000;
  b = 2000;
  c = 0;
  assert(c != a + b);
  c = add(a, b);
  assert(c == a + b);
  printf("Hello world! \n%le \n", c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xec1(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xeac(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
addsd  -0x18(%rbp),%xmm1
ucomisd %xmm1,%xmm0
setne  %al
setp   %cl
or     %cl,%al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
call   1030 <add@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
addsd  -0x18(%rbp),%xmm1
ucomisd %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
movsd  -0x20(%rbp),%xmm0
lea    0xe45(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1050 <assert@plt>
movsd  0xebd(%rip),%xmm0
movsd  0xebd(%rip),%xmm1
call   1030 <add@plt>
movsd  %xmm0,(%rsp)
movsd  0xeb3(%rip),%xmm1
cmpeqsd %xmm0,%xmm1
movq   %xmm1,%rdi
and    $0x1,%edi
call   1050 <assert@plt>
lea    0xea2(%rip),%rdi
movsd  (%rsp),%xmm0
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Hello world! \0A%le \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
store i32 0, i32* %1
store double 1.000000e+03, double* %2
store double 2.000000e+03, double* %3
store double 0.000000e+00, double* %4
%5 = load double, double* %4
%6 = load double, double* %2
%7 = load double, double* %3
%8 = fadd double %6, %7
%9 = fcmp une double %5, %8
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = load double, double* %2
%13 = load double, double* %3
%14 = call double @add(double %12, double %13)
store double %14, double* %4
%15 = load double, double* %4
%16 = load double, double* %2
%17 = load double, double* %3
%18 = fadd double %16, %17
%19 = fcmp oeq double %15, %18
%20 = zext i1 %19 to i32
%21 = call i32 @assert(i32 %20)
%22 = load double, double* %4
%23 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), double %22)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"Hello world! \0A%le \0A\00"
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
%2 = tail call double @add(double 1.000000e+03, double 2.000000e+03)
%3 = fcmp oeq double %2, 3.000000e+03
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), double %2)
ret i32 0
}