#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 */
int /*<<< orphan*/ print_done(int);
int rand();
float randf();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ test_add_sub_32(int, float, float);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main() {
  srand(time(NULL));
  test_add_sub_32(0, 2.718281, 3.141592);
  test_add_sub_32(1, 2.718281, 3.141592);
  test_add_sub_32(0, 3.141592, 2.718281);
  test_add_sub_32(1, 3.141592, 2.718281);
  test_add_sub_32(0, 17.4237741, 0.009842);
  test_add_sub_32(0, 7777771.42341, 0.09842);
  test_add_sub_32(0, 14444.42341, 0.00009842);
  test_add_sub_32(0, 63751.42341, 1424.02359842);
  test_add_sub_32(0, 134.13111111, 2222.0229842);
  test_add_sub_32(0, 0.000042341, 505.0955842);
  for (int i = 0; i < 2500; i++) {
    int add_or_sub = rand() % 2;
    float a = randf();
    float b = randf();
    test_add_sub_32(add_or_sub, a, b);
  }
  print_done(65);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
xor    %edi,%edi
movss  0xeab(%rip),%xmm0
movss  0xe9f(%rip),%xmm1
call   1070 <test_add_sub_32@plt>
mov    $0x1,%edi
movss  0xe91(%rip),%xmm0
movss  0xe85(%rip),%xmm1
call   1070 <test_add_sub_32@plt>
xor    %edi,%edi
movss  0xe76(%rip),%xmm0
movss  0xe72(%rip),%xmm1
call   1070 <test_add_sub_32@plt>
mov    $0x1,%edi
movss  0xe5c(%rip),%xmm0
movss  0xe58(%rip),%xmm1
call   1070 <test_add_sub_32@plt>
xor    %edi,%edi
movss  0xe3d(%rip),%xmm0
movss  0xe39(%rip),%xmm1
call   1070 <test_add_sub_32@plt>
xor    %edi,%edi
movss  0xe1e(%rip),%xmm0
movss  0xe1a(%rip),%xmm1
call   1070 <test_add_sub_32@plt>
xor    %edi,%edi
movss  0xdff(%rip),%xmm0
movss  0xdfb(%rip),%xmm1
call   1070 <test_add_sub_32@plt>
xor    %edi,%edi
movss  0xde0(%rip),%xmm0
movss  0xddc(%rip),%xmm1
call   1070 <test_add_sub_32@plt>
xor    %edi,%edi
movss  0xdc1(%rip),%xmm0
movss  0xdbd(%rip),%xmm1
call   1070 <test_add_sub_32@plt>
xor    %edi,%edi
movss  0xda2(%rip),%xmm0
movss  0xd9e(%rip),%xmm1
call   1070 <test_add_sub_32@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x9c4,-0x8(%rbp)
jge    12c9 <main+0x169>
mov    $0x0,%al
call   1080 <rand@plt>
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
mov    $0x0,%al
call   1060 <randf@plt>
movss  %xmm0,-0x10(%rbp)
mov    $0x0,%al
call   1060 <randf@plt>
movss  %xmm0,-0x14(%rbp)
mov    -0xc(%rbp),%edi
movss  -0x10(%rbp),%xmm0
movss  -0x14(%rbp),%xmm1
call   1070 <test_add_sub_32@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1272 <main+0x112>
mov    $0x41,%edi
call   1050 <print_done@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
movss  0xe87(%rip),%xmm0
movss  0xe83(%rip),%xmm1
xor    %edi,%edi
call   1070 <test_add_sub_32@plt>
mov    $0x1,%edi
movss  0xe6b(%rip),%xmm0
movss  0xe67(%rip),%xmm1
call   1070 <test_add_sub_32@plt>
xor    %edi,%edi
movss  0xe58(%rip),%xmm0
movss  0xe4c(%rip),%xmm1
call   1070 <test_add_sub_32@plt>
mov    $0x1,%edi
movss  0xe3e(%rip),%xmm0
movss  0xe32(%rip),%xmm1
call   1070 <test_add_sub_32@plt>
movss  0xe2d(%rip),%xmm0
movss  0xe29(%rip),%xmm1
xor    %edi,%edi
call   1070 <test_add_sub_32@plt>
movss  0xe1e(%rip),%xmm0
movss  0xe1a(%rip),%xmm1
xor    %edi,%edi
call   1070 <test_add_sub_32@plt>
movss  0xe0f(%rip),%xmm0
movss  0xe0b(%rip),%xmm1
xor    %edi,%edi
call   1070 <test_add_sub_32@plt>
movss  0xe00(%rip),%xmm0
movss  0xdfc(%rip),%xmm1
xor    %edi,%edi
call   1070 <test_add_sub_32@plt>
movss  0xdf1(%rip),%xmm0
movss  0xded(%rip),%xmm1
xor    %edi,%edi
call   1070 <test_add_sub_32@plt>
movss  0xde2(%rip),%xmm0
movss  0xdde(%rip),%xmm1
xor    %edi,%edi
call   1070 <test_add_sub_32@plt>
mov    $0x9c4,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1080 <rand@plt>
mov    %eax,%ebx
shr    $0x1f,%eax
add    %ebx,%eax
and    $0xfffffffe,%eax
sub    %eax,%ebx
xor    %eax,%eax
call   1060 <randf@plt>
movss  %xmm0,0x4(%rsp)
xor    %eax,%eax
call   1060 <randf@plt>
movaps %xmm0,%xmm1
mov    %ebx,%edi
movss  0x4(%rsp),%xmm0
call   1070 <test_add_sub_32@plt>
add    $0xffffffff,%ebp
jne    1270 <main+0x110>
mov    $0x41,%edi
call   1050 <print_done@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = alloca float
store i32 0, i32* %1
%6 = call i32 @time(i32* null)
%7 = call i32 @srand(i32 %6)
%8 = call i32 @test_add_sub_32(i32 0, float 0x4005BF0A20000000, float 0x400921FB00000000)
%9 = call i32 @test_add_sub_32(i32 1, float 0x4005BF0A20000000, float 0x400921FB00000000)
%10 = call i32 @test_add_sub_32(i32 0, float 0x400921FB00000000, float 0x4005BF0A20000000)
%11 = call i32 @test_add_sub_32(i32 1, float 0x400921FB00000000, float 0x4005BF0A20000000)
%12 = call i32 @test_add_sub_32(i32 0, float 0x40316C7C80000000, float 0x3F84280AE0000000)
%13 = call i32 @test_add_sub_32(i32 0, float 0x415DAB7AE0000000, float 0x3FB9320DA0000000)
%14 = call i32 @test_add_sub_32(i32 0, float 0x40CC363640000000, float 0x3F19CCDAC0000000)
%15 = call i32 @test_add_sub_32(i32 0, float 0x40EF20ED80000000, float 0x4096401820000000)
%16 = call i32 @test_add_sub_32(i32 0, float 0x4060C43200000000, float 0x40A15C0BC0000000)
%17 = call i32 @test_add_sub_32(i32 0, float 0x3F0632E9A0000000, float 0x407F918780000000)
store i32 0, i32* %2
br label %18
18: ; preds = %30, %0
%19 = load i32, i32* %2
%20 = icmp slt i32 %19, 2500
br i1 %20, label %21, label %33
21: ; preds = %18
%22 = call i32 (...) @rand()
%23 = srem i32 %22, 2
store i32 %23, i32* %3
%24 = call float (...) @randf()
store float %24, float* %4
%25 = call float (...) @randf()
store float %25, float* %5
%26 = load i32, i32* %3
%27 = load float, float* %4
%28 = load float, float* %5
%29 = call i32 @test_add_sub_32(i32 %26, float %27, float %28)
br label %30
30: ; preds = %21
%31 = load i32, i32* %2
%32 = add nsw i32 %31, 1
store i32 %32, i32* %2
br label %18
33: ; preds = %18
%34 = call i32 @print_done(i32 65)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
%3 = tail call i32 @test_add_sub_32(i32 0, float 0x4005BF0A20000000, float 0x400921FB00000000)
%4 = tail call i32 @test_add_sub_32(i32 1, float 0x4005BF0A20000000, float 0x400921FB00000000)
%5 = tail call i32 @test_add_sub_32(i32 0, float 0x400921FB00000000, float 0x4005BF0A20000000)
%6 = tail call i32 @test_add_sub_32(i32 1, float 0x400921FB00000000, float 0x4005BF0A20000000)
%7 = tail call i32 @test_add_sub_32(i32 0, float 0x40316C7C80000000, float 0x3F84280AE0000000)
%8 = tail call i32 @test_add_sub_32(i32 0, float 0x415DAB7AE0000000, float 0x3FB9320DA0000000)
%9 = tail call i32 @test_add_sub_32(i32 0, float 0x40CC363640000000, float 0x3F19CCDAC0000000)
%10 = tail call i32 @test_add_sub_32(i32 0, float 0x40EF20ED80000000, float 0x4096401820000000)
%11 = tail call i32 @test_add_sub_32(i32 0, float 0x4060C43200000000, float 0x40A15C0BC0000000)
%12 = tail call i32 @test_add_sub_32(i32 0, float 0x3F0632E9A0000000, float 0x407F918780000000)
br label %15
13: ; preds = %15
%14 = tail call i32 @print_done(i32 65)
ret i32 0
15: ; preds = %0, %15
%16 = phi i32 [ 0, %0 ], [ %22, %15 ]
%17 = tail call i32 (...) @rand()
%18 = srem i32 %17, 2
%19 = tail call float (...) @randf()
%20 = tail call float (...) @randf()
%21 = tail call i32 @test_add_sub_32(i32 %18, float %19, float %20)
%22 = add nuw nsw i32 %16, 1
%23 = icmp eq i32 %22, 2500
br i1 %23, label %13, label %15
}