#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*/ printf(char *);
int test_double();
int test_modulo();
int test_single();
int main(void) {
  int i, j, k;
  if ((i = test_single()))
    printf("WARNING: Single-precision "
           "floating point math might be broken\n");
  if ((j = test_double()))
    printf("WARNING: Double-precision "
           "floating point math might be broken\n");
  if ((k = test_modulo()))
    printf("WARNING: Modular arithmetic is broken\n");
  i += j;
  i += k;
  if (i == 0)
    printf("floating point and modular math appears to work\n");
  return i;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <test_single@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
je     116e <main+0x2e>
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <test_double@plt>
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
je     118d <main+0x4d>
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <test_modulo@plt>
mov    %eax,-0x10(%rbp)
cmp    $0x0,%eax
je     11ac <main+0x6c>
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    11d4 <main+0x94>
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
xor    %eax,%eax
call   1060 <test_single@plt>
mov    %eax,%r14d
test   %eax,%eax
je     115e <main+0x1e>
lea    0xf3b(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <test_double@plt>
mov    %eax,%ebp
test   %eax,%eax
je     1177 <main+0x37>
lea    0xee4(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <test_modulo@plt>
mov    %eax,%ebx
test   %eax,%eax
je     1190 <main+0x50>
lea    0xea5(%rip),%rdi
call   1030 <puts@plt>
add    %r14d,%ebp
add    %ebx,%ebp
jne    11a3 <main+0x63>
lea    0xe62(%rip),%rdi
call   1030 <puts@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [63 x i8] c"WARNING: Single-precision floating point math might be broken\0A\00"
@.str.1 = [63 x i8] c"WARNING: Double-precision floating point math might be broken\0A\00"
@.str.2 = [39 x i8] c"WARNING: Modular arithmetic is broken\0A\00"
@.str.3 = [49 x i8] c"floating point and modular math appears to work\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 (...) @test_single()
store i32 %5, i32* %2
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %0
%10 = call i32 (...) @test_double()
store i32 %10, i32* %3
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %9
%13 = call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.1, i64 0, i64 0))
br label %14
14: ; preds = %12, %9
%15 = call i32 (...) @test_modulo()
store i32 %15, i32* %4
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %14
%18 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0))
br label %19
19: ; preds = %17, %14
%20 = load i32, i32* %3
%21 = load i32, i32* %2
%22 = add nsw i32 %21, %20
store i32 %22, i32* %2
%23 = load i32, i32* %4
%24 = load i32, i32* %2
%25 = add nsw i32 %24, %23
store i32 %25, i32* %2
%26 = load i32, i32* %2
%27 = icmp eq i32 %26, 0
br i1 %27, label %28, label %30
28: ; preds = %19
%29 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.3, i64 0, i64 0))
br label %30
30: ; preds = %28, %19
%31 = load i32, i32* %2
ret i32 %31
}

LLVM IR (-O2):
@str = [48 x i8] c"floating point and modular math appears to work\00"
@str.4 = [38 x i8] c"WARNING: Modular arithmetic is broken\00"
@str.5 = [62 x i8] c"WARNING: Double-precision floating point math might be broken\00"
@str.6 = [62 x i8] c"WARNING: Single-precision floating point math might be broken\00"
define i32 @main() {
%1 = tail call i32 (...) @test_single()
%2 = icmp eq i32 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @str.6, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
%6 = tail call i32 (...) @test_double()
%7 = icmp eq i32 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @str.5, i64 0, i64 0))
br label %10
10: ; preds = %8, %5
%11 = tail call i32 (...) @test_modulo()
%12 = icmp eq i32 %11, 0
br i1 %12, label %15, label %13
13: ; preds = %10
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str.4, i64 0, i64 0))
br label %15
15: ; preds = %13, %10
%16 = add nsw i32 %6, %1
%17 = add nsw i32 %16, %11
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %15
%20 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str, i64 0, i64 0))
br label %21
21: ; preds = %19, %15
ret i32 %17
}