#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*/ abort();
int test1(int);
int test2(int);
int test3(int);
int test4(int);
int test5(int);
int test6(int);
void test(int a, int b) {
  if (test1(a) != b)
    abort();
  if (test2(a) != b)
    abort();
  if (test3(a) != b)
    abort();
  if (test4(a) != b)
    abort();
  if (test5(a) != b)
    abort();
  if (test6(a) != b)
    abort();
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1060 <test1@plt>
cmp    -0x8(%rbp),%eax
je     1196 <test+0x26>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x4(%rbp),%edi
call   1090 <test2@plt>
cmp    -0x8(%rbp),%eax
je     11ae <test+0x3e>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x4(%rbp),%edi
call   1050 <test3@plt>
cmp    -0x8(%rbp),%eax
je     11c6 <test+0x56>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x4(%rbp),%edi
call   1080 <test4@plt>
cmp    -0x8(%rbp),%eax
je     11de <test+0x6e>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x4(%rbp),%edi
call   1040 <test5@plt>
cmp    -0x8(%rbp),%eax
je     11f6 <test+0x86>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x4(%rbp),%edi
call   1070 <test6@plt>
cmp    -0x8(%rbp),%eax
je     120e <test+0x9e>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1060 <test1@plt>
cmp    %ebx,%eax
jne    11be <test+0x4e>
mov    %ebp,%edi
call   1090 <test2@plt>
cmp    %ebx,%eax
jne    11be <test+0x4e>
mov    %ebp,%edi
call   1050 <test3@plt>
cmp    %ebx,%eax
jne    11be <test+0x4e>
mov    %ebp,%edi
call   1080 <test4@plt>
cmp    %ebx,%eax
jne    11be <test+0x4e>
mov    %ebp,%edi
call   1040 <test5@plt>
cmp    %ebx,%eax
jne    11be <test+0x4e>
mov    %ebp,%edi
call   1070 <test6@plt>
cmp    %ebx,%eax
jne    11be <test+0x4e>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @test(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = call i32 @test1(i32 %5)
%7 = load i32, i32* %4
%8 = icmp ne i32 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 (...) @abort()
unreachable
11: ; preds = %2
%12 = load i32, i32* %3
%13 = call i32 @test2(i32 %12)
%14 = load i32, i32* %4
%15 = icmp ne i32 %13, %14
br i1 %15, label %16, label %18
16: ; preds = %11
%17 = call i32 (...) @abort()
unreachable
18: ; preds = %11
%19 = load i32, i32* %3
%20 = call i32 @test3(i32 %19)
%21 = load i32, i32* %4
%22 = icmp ne i32 %20, %21
br i1 %22, label %23, label %25
23: ; preds = %18
%24 = call i32 (...) @abort()
unreachable
25: ; preds = %18
%26 = load i32, i32* %3
%27 = call i32 @test4(i32 %26)
%28 = load i32, i32* %4
%29 = icmp ne i32 %27, %28
br i1 %29, label %30, label %32
30: ; preds = %25
%31 = call i32 (...) @abort()
unreachable
32: ; preds = %25
%33 = load i32, i32* %3
%34 = call i32 @test5(i32 %33)
%35 = load i32, i32* %4
%36 = icmp ne i32 %34, %35
br i1 %36, label %37, label %39
37: ; preds = %32
%38 = call i32 (...) @abort()
unreachable
39: ; preds = %32
%40 = load i32, i32* %3
%41 = call i32 @test6(i32 %40)
%42 = load i32, i32* %4
%43 = icmp ne i32 %41, %42
br i1 %43, label %44, label %46
44: ; preds = %39
%45 = call i32 (...) @abort()
unreachable
46: ; preds = %39
ret void
}

LLVM IR (-O2):
define void @test(i32 %0, i32 %1) {
%3 = tail call i32 @test1(i32 %0)
%4 = icmp eq i32 %3, %1
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 (...) @abort()
unreachable
7: ; preds = %2
%8 = tail call i32 @test2(i32 %0)
%9 = icmp eq i32 %8, %1
br i1 %9, label %12, label %10
10: ; preds = %7
%11 = tail call i32 (...) @abort()
unreachable
12: ; preds = %7
%13 = tail call i32 @test3(i32 %0)
%14 = icmp eq i32 %13, %1
br i1 %14, label %17, label %15
15: ; preds = %12
%16 = tail call i32 (...) @abort()
unreachable
17: ; preds = %12
%18 = tail call i32 @test4(i32 %0)
%19 = icmp eq i32 %18, %1
br i1 %19, label %22, label %20
20: ; preds = %17
%21 = tail call i32 (...) @abort()
unreachable
22: ; preds = %17
%23 = tail call i32 @test5(i32 %0)
%24 = icmp eq i32 %23, %1
br i1 %24, label %27, label %25
25: ; preds = %22
%26 = tail call i32 (...) @abort()
unreachable
27: ; preds = %22
%28 = tail call i32 @test6(i32 %0)
%29 = icmp eq i32 %28, %1
br i1 %29, label %32, label %30
30: ; preds = %27
%31 = tail call i32 (...) @abort()
unreachable
32: ; preds = %27
ret void
}