#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 float_add(double, double);
double float_div(int, double);
double float_mul(int, int);
double float_sub(double, double);
int main(int argc, char *argv[]) {
  double a, b, c, d;
  a = float_add(-0.1, 0.2);
  b = float_sub(0.1, 0.2);
  c = float_mul(300, 400);
  d = float_div(4e10, -0.02);
  return (a + b + c + d) ? 0 : 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  0xeba(%rip),%xmm0
movsd  0xeaa(%rip),%xmm1
call   1040 <float_add@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  0xe90(%rip),%xmm0
movsd  0xe90(%rip),%xmm1
call   1060 <float_sub@plt>
movsd  %xmm0,-0x20(%rbp)
mov    $0x12c,%edi
mov    $0x190,%esi
call   1050 <float_mul@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  0xe5a(%rip),%xmm0
call   1030 <float_div@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x18(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
addsd  -0x28(%rbp),%xmm0
addsd  -0x30(%rbp),%xmm0
xorps  %xmm1,%xmm1
mov    $0x1,%eax
xor    %ecx,%ecx
ucomisd %xmm1,%xmm0
setp   %sil
setne  %dl
or     %sil,%dl
cmovne %ecx,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movsd  0xeb4(%rip),%xmm0
movsd  0xeb4(%rip),%xmm1
call   1040 <float_add@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0xea9(%rip),%xmm0
movsd  0xe99(%rip),%xmm1
call   1060 <float_sub@plt>
movsd  %xmm0,0x8(%rsp)
mov    $0x12c,%edi
mov    $0x190,%esi
call   1050 <float_mul@plt>
movsd  %xmm0,(%rsp)
movsd  0xe82(%rip),%xmm0
call   1030 <float_div@plt>
movsd  0x8(%rsp),%xmm1
addsd  0x10(%rsp),%xmm1
addsd  (%rsp),%xmm1
addsd  %xmm0,%xmm1
xorpd  %xmm0,%xmm0
cmpeqsd %xmm1,%xmm0
movq   %xmm0,%rax
and    $0x1,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = call double @float_add(double -1.000000e-01, double 2.000000e-01)
store double %10, double* %6
%11 = call double @float_sub(double 1.000000e-01, double 2.000000e-01)
store double %11, double* %7
%12 = call double @float_mul(i32 300, i32 400)
store double %12, double* %8
%13 = call double @float_div(i32 poison, double -2.000000e-02)
store double %13, double* %9
%14 = load double, double* %6
%15 = load double, double* %7
%16 = fadd double %14, %15
%17 = load double, double* %8
%18 = fadd double %16, %17
%19 = load double, double* %9
%20 = fadd double %18, %19
%21 = fcmp une double %20, 0.000000e+00
%22 = zext i1 %21 to i64
%23 = select i1 %21, i32 0, i32 1
ret i32 %23
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call double @float_add(double -1.000000e-01, double 2.000000e-01)
%4 = tail call double @float_sub(double 1.000000e-01, double 2.000000e-01)
%5 = tail call double @float_mul(i32 300, i32 400)
%6 = tail call double @float_div(i32 poison, double -2.000000e-02)
%7 = fadd double %3, %4
%8 = fadd double %7, %5
%9 = fadd double %8, %6
%10 = fcmp oeq double %9, 0.000000e+00
%11 = zext i1 %10 to i32
ret i32 %11
}