xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("Usage: tmtest [OPTION]... [DLDIR]\n"
         "  -o: output the test file with the new output.\n"
         "  -d: output a diff between the expected and actual outputs.\n"
         "  -q --quiet: be quiet when running tests\n"
         "  -v --verbose: print more when running tests\n"
         "  -V --version: print the version of this program.\n"
         "  -h --help: prints this help text\n"
         "Run tmtest with no arguments to run all tests in the current "
         "directory.\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [390 x i8] c"Usage: tmtest [OPTION]... [DLDIR]\0A -o: output the test file with the new output.\0A -d: output a diff between the expected and actual outputs.\0A -q --quiet: be quiet when running tests\0A -v --verbose: print more when running tests\0A -V --version: print the version of this program.\0A -h --help: prints this help text\0ARun tmtest with no arguments to run all tests in the current directory.\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([390 x i8], [390 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [389 x i8] c"Usage: tmtest [OPTION]... [DLDIR]\0A -o: output the test file with the new output.\0A -d: output a diff between the expected and actual outputs.\0A -q --quiet: be quiet when running tests\0A -v --verbose: print more when running tests\0A -V --version: print the version of this program.\0A -h --help: prints this help text\0ARun tmtest with no arguments to run all tests in the current directory.\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([389 x i8], [389 x i8]* @str, i64 0, i64 0))
ret void
}
int fun864() { return 864; }


x86 assembly (clang, -O0):
<fun864>:
push   %rbp
mov    %rsp,%rbp
mov    $0x360,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun864>:
mov    $0x360,%eax
ret

LLVM IR (-O0):
define i32 @fun864() {
ret i32 864
}

LLVM IR (-O2):
define i32 @fun864() {
ret i32 864
}
void fn0484() { return; }


x86 assembly (clang, -O0):
<fn0484>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn0484>:
ret

LLVM IR (-O0):
define void @fn0484() {
ret void
}

LLVM IR (-O2):
define void @fn0484() {
ret void
}
int test_imm_7Dint32_reg(int val) { return ((val) & (0x7D << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_7Dint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x7d,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_7Dint32_reg>:
test   $0x7d,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_7Dint32_reg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 125
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 -20, i32 -40
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_imm_7Dint32_reg(i32 %0) {
%2 = and i32 %0, 125
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ jump(int /*<<< orphan*/);
int /*<<< orphan*/ pop();
void jump_handler(void) { jump(pop()); }


x86 assembly (clang, -O0):
<jump_handler>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <pop@plt>
mov    %eax,%edi
call   1040 <jump@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<jump_handler>:
push   %rax
xor    %eax,%eax
call   1030 <pop@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <jump@plt>

LLVM IR (-O0):
define void @jump_handler() {
%1 = call i32 (...) @pop()
%2 = call i32 @jump(i32 %1)
ret void
}

LLVM IR (-O2):
define void @jump_handler() {
%1 = tail call i32 (...) @pop()
%2 = tail call i32 @jump(i32 %1)
ret void
}
int is_opt_stub(int options) { return options & 0x2; }


x86 assembly (clang, -O0):
<is_opt_stub>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_opt_stub>:
mov    %edi,%eax
and    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @is_opt_stub(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 2
ret i32 %4
}

LLVM IR (-O2):
define i32 @is_opt_stub(i32 %0) {
%2 = and i32 %0, 2
ret i32 %2
}
/* Variables and functions */
char getchar();
int /*<<< orphan*/ printf(char *, char const *);
int get_response(const char *question) {
  char answer;
  printf("%s", question);
  answer = getchar();
  while (getchar() != '\n') {
  }
  if (answer == 'y' || answer == 'Y') {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<get_response>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x11(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
movsbl %al,%eax
cmp    $0xa,%eax
je     115e <get_response+0x3e>
jmp    1146 <get_response+0x26>
movsbl -0x11(%rbp),%eax
cmp    $0x79,%eax
je     1178 <get_response+0x58>
movsbl -0x11(%rbp),%eax
cmp    $0x59,%eax
jne    1184 <get_response+0x64>
movl   $0x1,-0x4(%rbp)
jmp    118b <get_response+0x6b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_response>:
push   %rbx
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,%ebx
nopl   0x0(%rax)
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0xa,%al
jne    1140 <get_response+0x20>
and    $0xdf,%bl
xor    %eax,%eax
cmp    $0x59,%bl
sete   %al
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define i32 @get_response(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = call signext i8 (...) @getchar()
store i8 %7, i8* %4
br label %8
8: ; preds = %12, %1
%9 = call signext i8 (...) @getchar()
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 10
br i1 %11, label %12, label %13
12: ; preds = %8
br label %8
13: ; preds = %8
%14 = load i8, i8* %4
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 121
br i1 %16, label %21, label %17
17: ; preds = %13
%18 = load i8, i8* %4
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %19, 89
br i1 %20, label %21, label %22
21: ; preds = %17, %13
store i32 1, i32* %2
br label %23
22: ; preds = %17
store i32 0, i32* %2
br label %23
23: ; preds = %22, %21
%24 = load i32, i32* %2
ret i32 %24
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @get_response(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call signext i8 (...) @getchar()
br label %4
4: ; preds = %4, %1
%5 = tail call signext i8 (...) @getchar()
%6 = icmp eq i8 %5, 10
br i1 %6, label %7, label %4
7: ; preds = %4
%8 = and i8 %3, -33
%9 = icmp eq i8 %8, 89
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gm_time_t(unsigned long, int);
struct tm *gmtime(int /*<<< orphan*/ *);
struct tm *time_to_tm(unsigned long time, int tz) {
  time_t t = gm_time_t(time, tz);
  return gmtime(&t);
}


x86 assembly (clang, -O0):
<time_to_tm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <gm_time_t@plt>
mov    %eax,-0x10(%rbp)
lea    -0x10(%rbp),%rdi
call   1040 <gmtime@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_to_tm>:
push   %rax
call   1030 <gm_time_t@plt>
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1040 <gmtime@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
define %struct.tm* @time_to_tm(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
%5 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%6 = load i64, i64* %3
%7 = load i32, i32* %4
%8 = call i32 @gm_time_t(i64 %6, i32 %7)
store i32 %8, i32* %5
%9 = call %struct.tm* @gmtime(i32* %5)
ret %struct.tm* %9
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define %struct.tm* @time_to_tm(i64 %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 @gm_time_t(i64 %0, i32 %1)
store i32 %5, i32* %3
%6 = call %struct.tm* @gmtime(i32* %3)
ret %struct.tm* %6
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ hq4x_32_rb(int *, int, int *, int, int, int);
void hq4x_32(uint32_t *sp, uint32_t *dp, int Xres, int Yres) {
  uint32_t rowBytesL = Xres * 4;
  hq4x_32_rb(sp, rowBytesL, dp, rowBytesL * 4, Xres, Yres);
}


x86 assembly (clang, -O0):
<hq4x_32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x14(%rbp),%eax
shl    $0x2,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
shl    $0x2,%ecx
mov    -0x14(%rbp),%r8d
mov    -0x18(%rbp),%r9d
call   1030 <hq4x_32_rb@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hq4x_32>:
mov    %ecx,%r9d
mov    %rsi,%rax
lea    0x0(,%rdx,4),%esi
mov    %edx,%ecx
shl    $0x4,%ecx
mov    %edx,%r8d
mov    %rax,%rdx
jmp    1030 <hq4x_32_rb@plt>

LLVM IR (-O0):
define void @hq4x_32(i32* %0, i32* %1, i32 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i32, i32* %7
%11 = mul nsw i32 %10, 4
store i32 %11, i32* %9
%12 = load i32*, i32** %5
%13 = load i32, i32* %9
%14 = load i32*, i32** %6
%15 = load i32, i32* %9
%16 = mul nsw i32 %15, 4
%17 = load i32, i32* %7
%18 = load i32, i32* %8
%19 = call i32 @hq4x_32_rb(i32* %12, i32 %13, i32* %14, i32 %16, i32 %17, i32 %18)
ret void
}

LLVM IR (-O2):
define void @hq4x_32(i32* %0, i32* %1, i32 %2, i32 %3) {
%5 = shl nsw i32 %2, 2
%6 = shl nsw i32 %2, 4
%7 = tail call i32 @hq4x_32_rb(i32* %0, i32 %5, i32* %1, i32 %6, i32 %2, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ test_file(char *);
bool test_files(char *in, char *out) {
  if (!test_file(in)) {
    fprintf(stderr, "Error: Unavailable file '%s'\n", in);
    return false;
  }
  return true;
}


x86 assembly (clang, -O0):
<test_files>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <test_file@plt>
cmp    $0x0,%eax
jne    1167 <test_files+0x47>
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xeaa(%rip),%rsi
call   1040 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    116e <test_files+0x4e>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_files>:
push   %rbx
mov    %rdi,%rbx
call   1030 <test_file@plt>
mov    %eax,%ecx
mov    $0x1,%eax
test   %ecx,%ecx
je     1136 <test_files+0x16>
pop    %rbx
ret
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
lea    0xeba(%rip),%rsi
mov    %rbx,%rdx
call   1040 <fprintf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [30 x i8] c"Error: Unavailable file '%s'\0A\00"
define i32 @test_files(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = call i32 @test_file(i8* %6)
%8 = icmp ne i32 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %2
%10 = load i32, i32* @stderr
%11 = load i8*, i8** %4
%12 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %11)
store i32 0, i32* %3
br label %14
13: ; preds = %2
store i32 1, i32* %3
br label %14
14: ; preds = %13, %9
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [30 x i8] c"Error: Unavailable file '%s'\0A\00"
define i32 @test_files(i8* %0, i8* nocapture readnone %1) {
%3 = tail call i32 @test_file(i8* %0)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %8
8: ; preds = %2, %5
%9 = phi i32 [ 0, %5 ], [ 1, %2 ]
ret i32 %9
}
double dabs(double n) { return (n < 0.0) ? -n : n; }


x86 assembly (clang, -O0):
<dabs>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    113d <dabs+0x3d>
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1147 <dabs+0x47>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dabs>:
movapd 0xef8(%rip),%xmm2
xorpd  %xmm0,%xmm2
xorpd  %xmm3,%xmm3
movapd %xmm0,%xmm1
cmpltsd %xmm3,%xmm1
andpd  %xmm1,%xmm2
andnpd %xmm0,%xmm1
orpd   %xmm2,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @dabs(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp olt double %3, 0.000000e+00
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load double, double* %2
%7 = fneg double %6
br label %10
8: ; preds = %1
%9 = load double, double* %2
br label %10
10: ; preds = %8, %5
%11 = phi double [ %7, %5 ], [ %9, %8 ]
ret double %11
}

LLVM IR (-O2):
define double @dabs(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %3, double %0
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int);
int /*<<< orphan*/ scanf(char *, char *);
int spec_string_to_integer(char *);
int main() {
  char s[256];
  scanf("%s", s);
  printf("%s,%d\n", s, spec_string_to_integer(s));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x110(%rbp),%rsi
lea    0xeb0(%rip),%rdi
call   1040 <scanf@plt>
lea    -0x110(%rbp),%rax
mov    %rax,-0x118(%rbp)
lea    -0x110(%rbp),%rdi
call   1050 <spec_string_to_integer@plt>
mov    -0x118(%rbp),%rsi
mov    %eax,%edx
lea    0xe84(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x100,%rsp
lea    0xec1(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    %rbx,%rdi
call   1050 <spec_string_to_integer@plt>
lea    0xeaa(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [7 x i8] c"%s,%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [256 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%7 = call i32 @spec_string_to_integer(i8* %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %5, i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [7 x i8] c"%s,%d\0A\00"
define i32 @main() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @spec_string_to_integer(i8* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %2, i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ bubble_sort(int *, int);
int /*<<< orphan*/ create_array(int **, int);
int /*<<< orphan*/ print_array(int *, int);
int main() {
  int *arr = NULL, size = 16;
  create_array(&arr, size);
  print_array(arr, size);
  bubble_sort(arr, size);
  print_array(arr, size);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
movl   $0x10,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    -0x8(%rbp),%rdi
call   1040 <create_array@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <print_array@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1050 <bubble_sort@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <print_array@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movq   $0x0,(%rsp)
mov    %rsp,%rdi
mov    $0x10,%esi
call   1040 <create_array@plt>
mov    (%rsp),%rdi
mov    $0x10,%esi
call   1030 <print_array@plt>
mov    (%rsp),%rdi
mov    $0x10,%esi
call   1050 <bubble_sort@plt>
mov    (%rsp),%rdi
mov    $0x10,%esi
call   1030 <print_array@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32*
%2 = alloca i32
store i32* null, i32** %1
store i32 16, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @create_array(i32** %1, i32 %3)
%5 = load i32*, i32** %1
%6 = load i32, i32* %2
%7 = call i32 @print_array(i32* %5, i32 %6)
%8 = load i32*, i32** %1
%9 = load i32, i32* %2
%10 = call i32 @bubble_sort(i32* %8, i32 %9)
%11 = load i32*, i32** %1
%12 = load i32, i32* %2
%13 = call i32 @print_array(i32* %11, i32 %12)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32*
%2 = bitcast i32** %1 to i8*
store i32* null, i32** %1
%3 = call i32 @create_array(i32** %1, i32 16)
%4 = load i32*, i32** %1
%5 = call i32 @print_array(i32* %4, i32 16)
%6 = load i32*, i32** %1
%7 = call i32 @bubble_sort(i32* %6, i32 16)
%8 = load i32*, i32** %1
%9 = call i32 @print_array(i32* %8, i32 16)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
char *getwd(char *buf) {
  errno = ENOSYS;
  return NULL;
}


x86 assembly (clang, -O0):
<getwd>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    0x2ed9(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec0(%rip),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getwd>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
xor    %eax,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i8* @getwd(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret i8* null
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define noalias i8* @getwd(i8* nocapture readnone %0) {
%2 = load i32, i32* @ENOSYS
store i32 %2, i32* @errno
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_assert(int);
int /*<<< orphan*/ __VERIFIER_assume(int);
int __VERIFIER_nondet_int();
void main() {
  int n = __VERIFIER_nondet_int();
  __VERIFIER_assume(n >= 0);
  int x = n, y = 0;
  while (x > 0) {
    x--;
    y++;
  }
  __VERIFIER_assert(y == n);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <__VERIFIER_assume@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1181 <main+0x51>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1160 <main+0x30>
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <__VERIFIER_assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,%ebx
not    %ebx
shr    $0x1f,%ebx
mov    %ebx,%edi
call   1050 <__VERIFIER_assume@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <__VERIFIER_assert@plt>

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %4, i32* %1
%5 = load i32, i32* %1
%6 = icmp sge i32 %5, 0
%7 = zext i1 %6 to i32
%8 = call i32 @__VERIFIER_assume(i32 %7)
%9 = load i32, i32* %1
store i32 %9, i32* %2
store i32 0, i32* %3
br label %10
10: ; preds = %13, %0
%11 = load i32, i32* %2
%12 = icmp sgt i32 %11, 0
br i1 %12, label %13, label %18
13: ; preds = %10
%14 = load i32, i32* %2
%15 = add nsw i32 %14, -1
store i32 %15, i32* %2
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 1
store i32 %17, i32* %3
br label %10
18: ; preds = %10
%19 = load i32, i32* %3
%20 = load i32, i32* %1
%21 = icmp eq i32 %19, %20
%22 = zext i1 %21 to i32
%23 = call i32 @__VERIFIER_assert(i32 %22)
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = xor i32 %1, -1
%3 = lshr i32 %2, 31
%4 = tail call i32 @__VERIFIER_assume(i32 %3)
%5 = xor i32 %1, -1
%6 = lshr i32 %5, 31
%7 = tail call i32 @__VERIFIER_assert(i32 %6)
ret void
}
void bar(const char *p1) {
  if (__builtin_strcmp(p1, "hello") != 0)
    __builtin_abort();
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
je     114a <bar+0x2a>
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
push   %rax
lea    0xed8(%rip),%rsi
call   1040 <strcmp@plt>
test   %eax,%eax
jne    1133 <bar+0x13>
pop    %rax
ret
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"hello\00"
define void @bar(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strcmp(i8* %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
unreachable
7: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"hello\00"
define void @bar(i8* nocapture %0) {
%2 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
br i1 %3, label %5, label %4
4: ; preds = %1
tail call void @abort()
unreachable
5: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *,
                           unsigned int, char const *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
void mps_lib_assert_fail_default(const char *file, unsigned line,
                                 const char *condition) {
  fflush(stdout);
  fprintf(stderr, "%s:%u: MPS ASSERTION FAILED: %s\n", file, line, condition);
  fflush(stderr);
  do {
  } while (0);
}


x86 assembly (clang, -O0):
<mps_lib_assert_fail_default>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%r8
lea    0xea4(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
jmp    1174 <mps_lib_assert_fail_default+0x54>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mps_lib_assert_fail_default>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %esi,%ebp
mov    %rdi,%rbx
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    0x2e9c(%rip),%r15
mov    (%r15),%edi
lea    0xeb2(%rip),%rsi
mov    %rbx,%rdx
mov    %ebp,%ecx
mov    %r14,%r8
call   1030 <fprintf@plt>
mov    (%r15),%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@stdout = global i32 0
@stderr = global i32 0
@.str = [33 x i8] c"%s:%u: MPS ASSERTION FAILED: %s\0A\00"
define void @mps_lib_assert_fail_default(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* @stdout
%8 = call i32 @fflush(i32 %7)
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %4
%11 = load i32, i32* %5
%12 = load i8*, i8** %6
%13 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %10, i32 %11, i8* %12)
%14 = load i32, i32* @stderr
%15 = call i32 @fflush(i32 %14)
br label %16
16: ; preds = %3
br label %17
17: ; preds = %16
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@stderr = global i32 0
@.str = [33 x i8] c"%s:%u: MPS ASSERTION FAILED: %s\0A\00"
define void @mps_lib_assert_fail_default(i8* %0, i32 %1, i8* %2) {
%4 = load i32, i32* @stdout
%5 = tail call i32 @fflush(i32 %4)
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1, i8* %2)
%8 = load i32, i32* @stderr
%9 = tail call i32 @fflush(i32 %8)
ret void
}
void avcodec_receive_frame() {}


x86 assembly (clang, -O0):
<avcodec_receive_frame>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<avcodec_receive_frame>:
ret

LLVM IR (-O0):
define void @avcodec_receive_frame() {
ret void
}

LLVM IR (-O2):
define void @avcodec_receive_frame() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ char_array();
void array() { char_array(); }


x86 assembly (clang, -O0):
<array>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <char_array@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<array>:
xor    %eax,%eax
jmp    1030 <char_array@plt>

LLVM IR (-O0):
define void @array() {
%1 = call i32 (...) @char_array()
ret void
}

LLVM IR (-O2):
define void @array() {
%1 = tail call i32 (...) @char_array()
ret void
}
/* Variables and functions */
scalar_t__ random(int);
int random_sign() {
  if (random(1) > 0) {
    return 1;
  }
  return -1;
}


x86 assembly (clang, -O0):
<random_sign>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
call   1030 <random@plt>
cmp    $0x0,%rax
jle    1138 <random_sign+0x28>
movl   $0x1,-0x4(%rbp)
jmp    113f <random_sign+0x2f>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_sign>:
push   %rax
mov    $0x1,%edi
call   1030 <random@plt>
xor    %ecx,%ecx
test   %rax,%rax
setg   %cl
lea    (%rcx,%rcx,1),%eax
add    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @random_sign() {
%1 = alloca i32
%2 = call i64 @random(i32 1)
%3 = icmp sgt i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 1, i32* %1
br label %6
5: ; preds = %0
store i32 -1, i32* %1
br label %6
6: ; preds = %5, %4
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
define i32 @random_sign() {
%1 = tail call i64 @random(i32 1)
%2 = icmp sgt i64 %1, 0
%3 = select i1 %2, i32 1, i32 -1
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ NETSCAPE_SPKI;

/* Variables and functions */
scalar_t__ ASN1_item_new(int /*<<< orphan*/ *);
int /*<<< orphan*/ NETSCAPE_SPKI_it;
NETSCAPE_SPKI *NETSCAPE_SPKI_new(void) {
  return (NETSCAPE_SPKI *)ASN1_item_new(&NETSCAPE_SPKI_it);
}


x86 assembly (clang, -O0):
<NETSCAPE_SPKI_new>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rdi
call   1030 <ASN1_item_new@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<NETSCAPE_SPKI_new>:
mov    0x2ec9(%rip),%rdi
jmp    1030 <ASN1_item_new@plt>

LLVM IR (-O0):
@NETSCAPE_SPKI_it = global i32 0
define i32* @NETSCAPE_SPKI_new() {
%1 = call i64 @ASN1_item_new(i32* @NETSCAPE_SPKI_it)
%2 = inttoptr i64 %1 to i32*
ret i32* %2
}

LLVM IR (-O2):
@NETSCAPE_SPKI_it = global i32 0
define i32* @NETSCAPE_SPKI_new() {
%1 = tail call i64 @ASN1_item_new(i32* @NETSCAPE_SPKI_it)
%2 = inttoptr i64 %1 to i32*
ret i32* %2
}
/* Variables and functions */
double RAND_MAX;
scalar_t__ rand();
int random_int(int d, int f) {
  double r = (double)rand();
  return (int)d + ((r / RAND_MAX) * (f - d - 1)) + 1;
}


x86 assembly (clang, -O0):
<random_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x10(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
mov    0x2ea8(%rip),%rax
divsd  (%rax),%xmm0
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
sub    $0x1,%eax
cvtsi2sd %eax,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xe9f(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_int>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
cvtsi2sd %ebp,%xmm1
mov    0x2eba(%rip),%rax
divsd  (%rax),%xmm0
not    %ebp
add    %ebx,%ebp
cvtsi2sd %ebp,%xmm2
mulsd  %xmm0,%xmm2
addsd  %xmm1,%xmm2
addsd  0xeb6(%rip),%xmm2
cvttsd2si %xmm2,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define i32 @random_int(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca double
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = call i64 (...) @rand()
%7 = sitofp i64 %6 to double
store double %7, double* %5
%8 = load i32, i32* %3
%9 = sitofp i32 %8 to double
%10 = load double, double* %5
%11 = load double, double* @RAND_MAX
%12 = fdiv double %10, %11
%13 = load i32, i32* %4
%14 = load i32, i32* %3
%15 = sub nsw i32 %13, %14
%16 = sub nsw i32 %15, 1
%17 = sitofp i32 %16 to double
%18 = call double @llvm.fmuladd.f64(double %12, double %17, double %9)
%19 = fadd double %18, 1.000000e+00
%20 = fptosi double %19 to i32
ret i32 %20
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define i32 @random_int(i32 %0, i32 %1) {
%3 = tail call i64 (...) @rand()
%4 = sitofp i64 %3 to double
%5 = sitofp i32 %0 to double
%6 = load double, double* @RAND_MAX
%7 = fdiv double %4, %6
%8 = xor i32 %0, -1
%9 = add i32 %8, %1
%10 = sitofp i32 %9 to double
%11 = tail call double @llvm.fmuladd.f64(double %7, double %10, double %5)
%12 = fadd double %11, 1.000000e+00
%13 = fptosi double %12 to i32
ret i32 %13
}
/* Variables and functions */
char *calloc(int, int);
int /*<<< orphan*/ memset(char *, int, int);
int /*<<< orphan*/ write(int, char *, int);
int main(int argc, char **argv) {
  char *x;
  for (;;) {
    if ((x = calloc(2, 1 << 20)) == 0) {
      write(1, "X\n", 2);
      return 1;
    }
    memset(x, 0xff, 2 * (1 << 20));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x2,%edi
mov    $0x100000,%esi
call   1050 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1184 <main+0x54>
mov    $0x1,%edi
lea    0xe91(%rip),%rsi
mov    $0x2,%edx
call   1030 <write@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret
mov    -0x18(%rbp),%rdi
mov    $0xff,%esi
mov    $0x200000,%edx
call   1040 <memset@plt>
jmp    1146 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x2,%edi
mov    $0x100000,%esi
call   1050 <calloc@plt>
test   %rax,%rax
je     1168 <main+0x38>
mov    %rax,%rdi
mov    $0xff,%esi
mov    $0x200000,%edx
call   1040 <memset@plt>
jmp    1140 <main+0x10>
lea    0xe91(%rip),%rsi
mov    $0x1,%edi
mov    $0x2,%edx
call   1030 <write@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"X\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
br label %7
7: ; preds = %12, %2
%8 = call i8* @calloc(i32 2, i32 1048576)
store i8* %8, i8** %6
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = call i32 @write(i32 1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
ret i32 1
12: ; preds = %7
%13 = load i8*, i8** %6
%14 = call i32 @memset(i8* %13, i32 255, i32 2097152)
br label %7
}

LLVM IR (-O2):
@.str = [3 x i8] c"X\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call dereferenceable_or_null(2097152) i8* @calloc(i32 2, i32 1048576)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %7, %2
%6 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
ret i32 1
7: ; preds = %2, %7
%8 = phi i8* [ %10, %7 ], [ %3, %2 ]
%9 = tail call i32 @memset(i8* %8, i32 255, i32 2097152)
%10 = tail call dereferenceable_or_null(2097152) i8* @calloc(i32 2, i32 1048576)
%11 = icmp eq i8* %10, null
br i1 %11, label %5, label %7
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};
struct event_base {
  int dummy;
};

/* Variables and functions */
int event_loopexit(struct timeval *);
int event_loopbreak_missing(struct event_base *event_base) {
  struct timeval missing;
  if (event_base == NULL)
    return (-1);
  missing.tv_sec = 0;
  missing.tv_usec = 0;
  return event_loopexit(&missing);
}


x86 assembly (clang, -O0):
<event_loopbreak_missing>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1133 <event_loopbreak_missing+0x23>
movl   $0xffffffff,-0x4(%rbp)
jmp    114f <event_loopbreak_missing+0x3f>
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
lea    -0x20(%rbp),%rdi
call   1030 <event_loopexit@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<event_loopbreak_missing>:
test   %rdi,%rdi
je     112d <event_loopbreak_missing+0x1d>
sub    $0x18,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
call   1030 <event_loopexit@plt>
add    $0x18,%rsp
ret
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
%struct.event_base = type { i32 }
%struct.timeval = type { i64, i64 }
define i32 @event_loopbreak_missing(%struct.event_base* %0) {
%2 = alloca i32
%3 = alloca %struct.event_base*
%4 = alloca %struct.timeval
store %struct.event_base* %0, %struct.event_base** %3
%5 = load %struct.event_base*, %struct.event_base** %3
%6 = icmp eq %struct.event_base* %5, null
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 -1, i32* %2
br label %12
8: ; preds = %1
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i32 0, i32 1
store i64 0, i64* %9
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i32 0, i32 0
store i64 0, i64* %10
%11 = call i32 @event_loopexit(%struct.timeval* %4)
store i32 %11, i32* %2
br label %12
12: ; preds = %8, %7
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
%struct.event_base = type { i32 }
%struct.timeval = type { i64, i64 }
define i32 @event_loopbreak_missing(%struct.event_base* readnone %0) {
%2 = alloca %struct.timeval
%3 = bitcast %struct.timeval* %2 to i8*
%4 = icmp eq %struct.event_base* %0, null
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = bitcast %struct.timeval* %2 to i8*
%7 = call i32 @event_loopexit(%struct.timeval* %2)
br label %8
8: ; preds = %1, %5
%9 = phi i32 [ %7, %5 ], [ -1, %1 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() { printf("=> '\c' <= \n"); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"=> 'c' <= \0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [11 x i8] c"=> 'c' <= \00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int /*<<< orphan*/);
int /*<<< orphan*/ I2CSlaveBaseValid(unsigned long);
unsigned long I2CSlaveStatus(unsigned long ulBase) {
  DEBUG_ASSERT(I2CSlaveBaseValid(ulBase));
  return ((*((volatile unsigned long *)(ulBase + 0x00000004))));
}


x86 assembly (clang, -O0):
<I2CSlaveStatus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <I2CSlaveBaseValid@plt>
mov    %eax,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CSlaveStatus>:
push   %rbx
mov    %rdi,%rbx
call   1040 <I2CSlaveBaseValid@plt>
mov    %eax,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    0x4(%rbx),%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @I2CSlaveStatus(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @I2CSlaveBaseValid(i64 %3)
%5 = call i32 @DEBUG_ASSERT(i32 %4)
%6 = load i64, i64* %2
%7 = add i64 %6, 4
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
ret i64 %9
}

LLVM IR (-O2):
define i64 @I2CSlaveStatus(i64 %0) {
%2 = tail call i32 @I2CSlaveBaseValid(i64 %0)
%3 = tail call i32 @DEBUG_ASSERT(i32 %2)
%4 = add i64 %0, 4
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
ret i64 %6
}
int joystick_init_cmdline_options(void) { return 0; }


x86 assembly (clang, -O0):
<joystick_init_cmdline_options>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<joystick_init_cmdline_options>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @joystick_init_cmdline_options() {
ret i32 0
}

LLVM IR (-O2):
define i32 @joystick_init_cmdline_options() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ sem_t;

/* Variables and functions */
int /*<<< orphan*/ die(char *);
int sem_wait(int /*<<< orphan*/ *);
void p(sem_t *sem) {
  if (sem_wait(sem) == -1) {
    die("sem_wait");
  }
}


x86 assembly (clang, -O0):
<p>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <sem_wait@plt>
cmp    $0xffffffff,%eax
jne    114a <p+0x2a>
lea    0xebb(%rip),%rdi
call   1040 <die@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<p>:
push   %rax
call   1030 <sem_wait@plt>
cmp    $0xffffffff,%eax
je     112d <p+0xd>
pop    %rax
ret
lea    0xecc(%rip),%rdi
pop    %rax
jmp    1040 <die@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"sem_wait\00"
define void @p(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @sem_wait(i32* %3)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @die(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"sem_wait\00"
define void @p(i32* %0) {
%2 = tail call i32 @sem_wait(i32* %0)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @die(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ ihex_set_end(int /*<<< orphan*/ *);
int ihex_save_done(FILE *fp) {
  ihex_set_end(fp);
  return (0);
}


x86 assembly (clang, -O0):
<ihex_save_done>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <ihex_set_end@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ihex_save_done>:
push   %rax
call   1030 <ihex_set_end@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ihex_save_done(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @ihex_set_end(i32* %3)
ret i32 0
}

LLVM IR (-O2):
define i32 @ihex_save_done(i32* %0) {
%2 = tail call i32 @ihex_set_end(i32* %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void help(void) {
  printf(
      "unical1 prool mod\n\nusage: unical1 inputfile outputfile\nor\nunical1 "
      "-f inputfile outputfile\n\nProol: http://prool.kharkov.org\n\n");
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<help>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [125 x i8] c"unical1 prool mod\0A\0Ausage: unical1 inputfile outputfile\0Aor\0Aunical1 -f inputfile outputfile\0A\0AProol: http://prool.kharkov.org\0A\0A\00"
define void @help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([125 x i8], [125 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [124 x i8] c"unical1 prool mod\0A\0Ausage: unical1 inputfile outputfile\0Aor\0Aunical1 -f inputfile outputfile\0A\0AProol: http://prool.kharkov.org\0A\00"
define void @help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([124 x i8], [124 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void usage(char *argv0) {
  printf("USAGE: %s [height] [half|full]\n", argv0);
  exit(-1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"USAGE: %s [height] [half|full]\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@.str = [32 x i8] c"USAGE: %s [height] [half|full]\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
int lseek(int, int /*<<< orphan*/, int /*<<< orphan*/);
int File_forward(int fd) { return lseek(fd, 0, SEEK_END); }


x86 assembly (clang, -O0):
<File_forward>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ec3(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1030 <lseek@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<File_forward>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
jmp    1030 <lseek@plt>

LLVM IR (-O0):
@SEEK_END = global i32 0
define i32 @File_forward(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SEEK_END
%5 = call i32 @lseek(i32 %3, i32 0, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
@SEEK_END = global i32 0
define i32 @File_forward(i32 %0) {
%2 = load i32, i32* @SEEK_END
%3 = tail call i32 @lseek(i32 %0, i32 0, i32 %2)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ nums;

/* Variables and functions */
int /*<<< orphan*/ bubble_sort(int *, int);
int /*<<< orphan*/ print(int *, int);
int main() {
  int nums[] = {2, 10, 3, 14, 15, 6, 3, 9};
  int n = sizeof(nums) / sizeof(nums[0]);
  bubble_sort(nums, n);
  print(nums, n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec1(%rip),%rax
mov    %rax,-0x18(%rbp)
movl   $0x8,-0x34(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%esi
call   1040 <bubble_sort@plt>
lea    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%esi
call   1030 <print@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movaps 0xee4(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec8(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x8,%esi
call   1040 <bubble_sort@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
call   1030 <print@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.nums = [8 x i32] [i32 2, i32 10, i32 3, i32 14, i32 15, i32 6, i32 3, i32 9]
define i32 @main() {
%1 = alloca i32
%2 = alloca [8 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [8 x i32]* %2 to i8*
store i32 8, i32* %3
%5 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 0
%6 = load i32, i32* %3
%7 = call i32 @bubble_sort(i32* %5, i32 %6)
%8 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 0
%9 = load i32, i32* %3
%10 = call i32 @print(i32* %8, i32 %9)
ret i32 0
}

LLVM IR (-O2):
@__const.main.nums = [8 x i32] [i32 2, i32 10, i32 3, i32 14, i32 15, i32 6, i32 3, i32 9]
define i32 @main() {
%1 = alloca [8 x i32]
%2 = bitcast [8 x i32]* %1 to i8*
%3 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 0
%4 = call i32 @bubble_sort(i32* %3, i32 8)
%5 = call i32 @print(i32* %3, i32 8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
scalar_t__ ftruncate(int, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
void lif_truncate_img_file(int lif_file) {
  if (ftruncate(lif_file, 0)) {
    fprintf(stderr, "Error truncating file (%s)\n", strerror(errno));
    exit(1);
  }
}


x86 assembly (clang, -O0):
<lif_truncate_img_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1030 <ftruncate@plt>
cmp    $0x0,%rax
je     1195 <lif_truncate_img_file+0x55>
mov    0x2e7a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    0x2e66(%rip),%rax
mov    (%rax),%edi
call   1060 <strerror@plt>
mov    -0x8(%rbp),%edi
mov    %rax,%rdx
lea    0xe7a(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lif_truncate_img_file>:
push   %rbx
xor    %esi,%esi
call   1030 <ftruncate@plt>
test   %rax,%rax
jne    114f <lif_truncate_img_file+0xf>
pop    %rbx
ret
mov    0x2e8a(%rip),%rax
mov    (%rax),%ebx
mov    0x2e79(%rip),%rax
mov    (%rax),%edi
call   1060 <strerror@plt>
lea    0xe93(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [28 x i8] c"Error truncating file (%s)\0A\00"
@errno = global i32 0
define void @lif_truncate_img_file(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @ftruncate(i32 %3, i32 0)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i32, i32* @stderr
%8 = load i32, i32* @errno
%9 = call i8* @strerror(i32 %8)
%10 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %1
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [28 x i8] c"Error truncating file (%s)\0A\00"
@errno = global i32 0
define void @lif_truncate_img_file(i32 %0) {
%2 = tail call i64 @ftruncate(i32 %0, i32 0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %10, label %4
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = load i32, i32* @errno
%7 = tail call i8* @strerror(i32 %6)
%8 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %1
ret void
}