#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 *, ...);
void test_int(int expected, int actual, const char *testname) {
  if (actual != expected) {
    printf("Test %s FAILED:\n", testname);
    printf("Expected result %d, but got %d instead\n", expected, actual);
  } else {
    printf("Test %s SUCCEEDED\n", testname);
  }
}


x86 assembly (clang, -O0):
<test_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
je     1159 <test_int+0x49>
mov    -0x10(%rbp),%rsi
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xec4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    116b <test_int+0x5b>
mov    -0x10(%rbp),%rsi
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_int>:
cmp    %edi,%esi
jne    1125 <test_int+0x15>
lea    0xf1e(%rip),%rdi
mov    %rdx,%rsi
xor    %eax,%eax
jmp    1030 <printf@plt>
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xecd(%rip),%rdi
mov    %rdx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xecd(%rip),%rdi
mov    %ebp,%esi
mov    %ebx,%edx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"Test %s FAILED:\0A\00"
@.str.1 = [40 x i8] c"Expected result %d, but got %d instead\0A\00"
@.str.2 = [19 x i8] c"Test %s SUCCEEDED\0A\00"
define void @test_int(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp ne i32 %7, %8
br i1 %9, label %10, label %16
10: ; preds = %3
%11 = load i8*, i8** %6
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %11)
%13 = load i32, i32* %4
%14 = load i32, i32* %5
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0), i32 %13, i32 %14)
br label %19
16: ; preds = %3
%17 = load i8*, i8** %6
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i8* %17)
br label %19
19: ; preds = %16, %10
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"Test %s FAILED:\0A\00"
@.str.1 = [40 x i8] c"Expected result %d, but got %d instead\0A\00"
@.str.2 = [19 x i8] c"Test %s SUCCEEDED\0A\00"
define void @test_int(i32 %0, i32 %1, i8* %2) {
%4 = icmp eq i32 %1, %0
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %2)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0), i32 %0, i32 %1)
br label %10
8: ; preds = %3
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i8* %2)
br label %10
10: ; preds = %8, %5
ret void
}