xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ putchar(int);
int /*<<< orphan*/ test(int *, int);
int output(void) {
  int i = 0;
  int j = 97;
  int k = 97;
  i++;
  putchar('a' + (0));
  putchar(j);
  test(&j, k);
  putchar(j);
  return 0;
}


x86 assembly (clang, -O0):
<output>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x61,-0x8(%rbp)
movl   $0x61,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    $0x61,%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
mov    -0xc(%rbp),%esi
lea    -0x8(%rbp),%rdi
call   1040 <test@plt>
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<output>:
push   %rax
movl   $0x61,0x4(%rsp)
mov    $0x61,%edi
call   1030 <putchar@plt>
mov    $0x61,%edi
call   1030 <putchar@plt>
lea    0x4(%rsp),%rdi
mov    $0x61,%esi
call   1040 <test@plt>
mov    0x4(%rsp),%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @output() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 97, i32* %2
store i32 97, i32* %3
%4 = load i32, i32* %1
%5 = add nsw i32 %4, 1
store i32 %5, i32* %1
%6 = call i32 @putchar(i32 97)
%7 = load i32, i32* %2
%8 = call i32 @putchar(i32 %7)
%9 = load i32, i32* %3
%10 = call i32 @test(i32* %2, i32 %9)
%11 = load i32, i32* %2
%12 = call i32 @putchar(i32 %11)
ret i32 0
}

LLVM IR (-O2):
define i32 @output() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 97, i32* %1
%3 = tail call i32 @putchar(i32 97)
%4 = tail call i32 @putchar(i32 97)
%5 = call i32 @test(i32* %1, i32 97)
%6 = load i32, i32* %1
%7 = call i32 @putchar(i32 %6)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
unsigned int fwrite(unsigned char *, int, unsigned int, int /*<<< orphan*/ *);
int send_data(unsigned char *data, unsigned int length, FILE *midiport) {
  return (fwrite(data, sizeof(unsigned char), length, midiport) == length);
}


x86 assembly (clang, -O0):
<send_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    $0x1,%esi
call   1030 <fwrite@plt>
cmp    -0xc(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_data>:
push   %rbx
mov    %rdx,%rcx
mov    %esi,%ebx
mov    $0x1,%esi
mov    %ebx,%edx
call   1030 <fwrite@plt>
xor    %ecx,%ecx
cmp    %ebx,%eax
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @send_data(i8* %0, i32 %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i32*, i32** %6
%10 = call i32 @fwrite(i8* %7, i32 1, i32 %8, i32* %9)
%11 = load i32, i32* %5
%12 = icmp eq i32 %10, %11
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @send_data(i8* nocapture %0, i32 %1, i32* nocapture %2) {
%4 = tail call i32 @fwrite(i8* %0, i32 1, i32 %1, i32* %2)
%5 = icmp eq i32 %4, %1
%6 = zext i1 %5 to i32
ret i32 %6
}
int min(int i, int j) { return i > j ? j : i; }


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <min+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <min+0x27>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
mov    %edi,%eax
cmp    %esi,%edi
cmovg  %esi,%eax
ret

LLVM IR (-O0):
define i32 @min(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 = load i32, i32* %4
%7 = icmp sgt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %4
br label %12
10: ; preds = %2
%11 = load i32, i32* %3
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @min(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ ngen(char *, char *, int);
void cgdeclw(int a) { ngen("%s\t%d(%%rbp)", "decq", a); }


x86 assembly (clang, -O0):
<cgdeclw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0xedb(%rip),%rdi
lea    0xee1(%rip),%rsi
call   1030 <ngen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgdeclw>:
mov    %edi,%edx
lea    0xee7(%rip),%rdi
lea    0xeed(%rip),%rsi
jmp    1030 <ngen@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"%s\09%d(%%rbp)\00"
@.str.1 = [5 x i8] c"decq\00"
define void @cgdeclw(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @ngen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"%s\09%d(%%rbp)\00"
@.str.1 = [5 x i8] c"decq\00"
define void @cgdeclw(i32 %0) {
%2 = tail call i32 @ngen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %0)
ret void
}
const char *f_engine_version() {
  return "0"
         "."
         "2"
         "."
         "0";
}


x86 assembly (clang, -O0):
<f_engine_version>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_engine_version>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [6 x i8] c"0.2.0\00"
define i8* @f_engine_version() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [6 x i8] c"0.2.0\00"
define i8* @f_engine_version() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
void foo() {
  static int test;
  int dummy;
  asm volatile("" : "=m"(test), "=r"(dummy) : "m"(test));
}


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

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

LLVM IR (-O0):
@foo.test = internal global i32 0
define void @foo() {
%1 = alloca i32
%2 = call i32 asm sideeffect "", "=*m,=r,*m,~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) @foo.test, i32* elementtype(i32) @foo.test)
store i32 %2, i32* %1
ret void
}

LLVM IR (-O2):
@foo.test = internal global i32 0
define void @foo() {
%1 = tail call i32 asm sideeffect "", "=*m,=r,*m,~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) @foo.test, i32* elementtype(i32) @foo.test)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_optional_plus_symbol(void) {
  static int flag = 0;
  if (flag == 0)
    flag = 1;
  else
    printf(" + ");
  return;
}


x86 assembly (clang, -O0):
<print_optional_plus_symbol>:
push   %rbp
mov    %rsp,%rbp
cmpl   $0x0,0x2f11(%rip)
jne    1130 <print_optional_plus_symbol+0x20>
movl   $0x1,0x2f01(%rip)
jmp    113c <print_optional_plus_symbol+0x2c>
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_optional_plus_symbol>:
cmpb   $0x0,0x2f15(%rip)
je     1125 <print_optional_plus_symbol+0x15>
lea    0xee0(%rip),%rdi
jmp    1030 <printf@plt>
movb   $0x1,0x2f00(%rip)
ret

LLVM IR (-O0):
@print_optional_plus_symbol.flag = internal global i32 0
@.str = [4 x i8] c" + \00"
define void @print_optional_plus_symbol() {
%1 = load i32, i32* @print_optional_plus_symbol.flag
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %4
3: ; preds = %0
store i32 1, i32* @print_optional_plus_symbol.flag
br label %6
4: ; preds = %0
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %3
ret void
}

LLVM IR (-O2):
@print_optional_plus_symbol.flag = internal unnamed_addr global i1 false
@.str = [4 x i8] c" + \00"
define void @print_optional_plus_symbol() {
%1 = load i1, i1* @print_optional_plus_symbol.flag
br i1 %1, label %3, label %2
2: ; preds = %0
store i1 true, i1* @print_optional_plus_symbol.flag
br label %5
3: ; preds = %0
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "usage: armdsp-mkais infile outfile\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [36 x i8] c"usage: armdsp-mkais infile outfile\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [36 x i8] c"usage: armdsp-mkais infile outfile\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int open(char *, int);
int fpui_open_config_window(int flags) { return (open("/dev/sci", flags)); }


x86 assembly (clang, -O0):
<fpui_open_config_window>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <open@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fpui_open_config_window>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <open@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"/dev/sci\00"
define i32 @fpui_open_config_window(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @open(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 %4
}

LLVM IR (-O2):
@.str = [9 x i8] c"/dev/sci\00"
define i32 @fpui_open_config_window(i32 %0) {
%2 = tail call i32 @open(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i32 %2
}
int comp(const void *a, const void *b) { return ((int *)a)[0] - ((int *)b)[0]; }


x86 assembly (clang, -O0):
<comp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<comp>:
mov    (%rdi),%eax
sub    (%rsi),%eax
ret

LLVM IR (-O0):
define i32 @comp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
%7 = getelementptr inbounds i32, i32* %6, i64 0
%8 = load i32, i32* %7
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i32*
%11 = getelementptr inbounds i32, i32* %10, i64 0
%12 = load i32, i32* %11
%13 = sub nsw i32 %8, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @comp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
void rop3_253_0_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = ~*D;
  stk2 = S | stk3;
  stk1 = T | stk2;
  *D = (stk1 & S) | (stk1 & (~T)) | (T & (~S) & *D);
}


x86 assembly (clang, -O0):
<rop3_253_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
xor    $0xffffffff,%eax
mov    %al,-0xd(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xd(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xc(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
movzbl -0xb(%rbp),%ecx
movzbl -0xa(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
movzbl -0xa(%rbp),%ecx
movzbl -0x9(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
mov    -0x8(%rbp),%rdx
movzbl (%rdx),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_253_0_1>:
mov    (%rdi),%r8b
mov    %r8d,%ecx
not    %cl
or     %sil,%cl
mov    %edx,%eax
not    %al
and    %cl,%al
or     %dl,%cl
and    %sil,%cl
not    %sil
and    %dl,%sil
and    %r8b,%sil
or     %al,%sil
or     %cl,%sil
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_253_0_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8*, i8** %4
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = xor i32 %12, -1
%14 = trunc i32 %13 to i8
store i8 %14, i8* %9
%15 = load i8, i8* %5
%16 = zext i8 %15 to i32
%17 = load i8, i8* %9
%18 = zext i8 %17 to i32
%19 = or i32 %16, %18
%20 = trunc i32 %19 to i8
store i8 %20, i8* %8
%21 = load i8, i8* %6
%22 = zext i8 %21 to i32
%23 = load i8, i8* %8
%24 = zext i8 %23 to i32
%25 = or i32 %22, %24
%26 = trunc i32 %25 to i8
store i8 %26, i8* %7
%27 = load i8, i8* %7
%28 = zext i8 %27 to i32
%29 = load i8, i8* %5
%30 = zext i8 %29 to i32
%31 = and i32 %28, %30
%32 = load i8, i8* %7
%33 = zext i8 %32 to i32
%34 = load i8, i8* %6
%35 = zext i8 %34 to i32
%36 = xor i32 %35, -1
%37 = and i32 %33, %36
%38 = or i32 %31, %37
%39 = load i8, i8* %6
%40 = zext i8 %39 to i32
%41 = load i8, i8* %5
%42 = zext i8 %41 to i32
%43 = xor i32 %42, -1
%44 = and i32 %40, %43
%45 = load i8*, i8** %4
%46 = load i8, i8* %45
%47 = zext i8 %46 to i32
%48 = and i32 %44, %47
%49 = or i32 %38, %48
%50 = trunc i32 %49 to i8
%51 = load i8*, i8** %4
store i8 %50, i8* %51
ret void
}

LLVM IR (-O2):
define void @rop3_253_0_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %4, -1
%6 = or i8 %5, %1
%7 = or i8 %6, %2
%8 = and i8 %7, %1
%9 = xor i8 %2, -1
%10 = and i8 %6, %9
%11 = xor i8 %1, -1
%12 = and i8 %11, %2
%13 = and i8 %12, %4
%14 = or i8 %10, %13
%15 = or i8 %14, %8
store i8 %15, i8* %0
ret void
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int c;
  int x, y, z;
  x = __VERIFIER_nondet_int();
  y = __VERIFIER_nondet_int();
  z = __VERIFIER_nondet_int();
  c = 0;
  while ((x > y) && (x > z)) {
    y = y + 1;
    z = z + 1;
    c = c + 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0xc(%rbp),%ecx
xor    %eax,%eax
cmp    -0x10(%rbp),%ecx
mov    %al,-0x15(%rbp)
jle    1161 <main+0x51>
mov    -0xc(%rbp),%eax
cmp    -0x14(%rbp),%eax
setg   %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    1171 <main+0x61>
jmp    1191 <main+0x81>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1144 <main+0x34>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
%3 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ EINVAL;
int /*<<< orphan*/ ENOSYS;
int WNOHANG;
int WUNTRACED;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
pid_t __libc_waitpid(pid_t pid, int *stat_loc, int options) {
  if ((options & ~(WNOHANG | WUNTRACED)) != 0) {
    __set_errno(EINVAL);
    return (pid_t)-1;
  }
  __set_errno(ENOSYS);
  return (pid_t)-1;
}


x86 assembly (clang, -O0):
<__libc_waitpid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    0x2eb4(%rip),%rcx
mov    (%rcx),%ecx
mov    0x2e9b(%rip),%rdx
or     (%rdx),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     115f <__libc_waitpid+0x4f>
mov    0x2e7c(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1174 <__libc_waitpid+0x64>
mov    0x2e82(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__libc_waitpid>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    0x2eb1(%rip),%rcx
mov    (%rcx),%ecx
or     (%rax),%ecx
not    %ecx
test   %edx,%ecx
jne    1132 <__libc_waitpid+0x22>
mov    0x2eb8(%rip),%rax
jmp    1139 <__libc_waitpid+0x29>
mov    0x2e8f(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@WNOHANG = global i32 0
@WUNTRACED = global i32 0
@EINVAL = global i32 0
@ENOSYS = global i32 0
define i32 @__libc_waitpid(i32 %0, i32* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32
store i32 %0, i32* %5
store i32* %1, i32** %6
store i32 %2, i32* %7
%8 = load i32, i32* %7
%9 = load i32, i32* @WNOHANG
%10 = load i32, i32* @WUNTRACED
%11 = or i32 %9, %10
%12 = xor i32 %11, -1
%13 = and i32 %8, %12
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %3
%16 = load i32, i32* @EINVAL
%17 = call i32 @__set_errno(i32 %16)
store i32 -1, i32* %4
br label %21
18: ; preds = %3
%19 = load i32, i32* @ENOSYS
%20 = call i32 @__set_errno(i32 %19)
store i32 -1, i32* %4
br label %21
21: ; preds = %18, %15
%22 = load i32, i32* %4
ret i32 %22
}

LLVM IR (-O2):
@WNOHANG = global i32 0
@WUNTRACED = global i32 0
@EINVAL = global i32 0
@ENOSYS = global i32 0
define i32 @__libc_waitpid(i32 %0, i32* nocapture readnone %1, i32 %2) {
%4 = load i32, i32* @WNOHANG
%5 = load i32, i32* @WUNTRACED
%6 = or i32 %5, %4
%7 = xor i32 %6, -1
%8 = and i32 %7, %2
%9 = icmp eq i32 %8, 0
%10 = load i32, i32* @ENOSYS
%11 = load i32, i32* @EINVAL
%12 = select i1 %9, i32 %10, i32 %11
%13 = tail call i32 @__set_errno(i32 %12)
ret i32 -1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
uint8_t dac_read_status(void *p) { return 0; }


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

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

LLVM IR (-O0):
define i32 @dac_read_status(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret i32 0
}

LLVM IR (-O2):
define i32 @dac_read_status(i8* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int ulong;

/* Variables and functions */
ulong div_ulong(ulong arg1, ulong arg2) { return arg1 / arg2; }


x86 assembly (clang, -O0):
<div_ulong>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<div_ulong>:
mov    %edi,%eax
cltd
idiv   %esi
ret

LLVM IR (-O0):
define i32 @div_ulong(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 = load i32, i32* %4
%7 = sdiv i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @div_ulong(i32 %0, i32 %1) {
%3 = sdiv i32 %0, %1
ret i32 %3
}
double calculate_something(int a, float b) { return a + b; }


x86 assembly (clang, -O0):
<calculate_something>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
cvtsi2ssl -0x4(%rbp),%xmm0
addss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculate_something>:
cvtsi2ss %edi,%xmm1
addss  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @calculate_something(i32 %0, float %1) {
%3 = alloca i32
%4 = alloca float
store i32 %0, i32* %3
store float %1, float* %4
%5 = load i32, i32* %3
%6 = sitofp i32 %5 to float
%7 = load float, float* %4
%8 = fadd float %6, %7
%9 = fpext float %8 to double
ret double %9
}

LLVM IR (-O2):
define double @calculate_something(i32 %0, float %1) {
%3 = sitofp i32 %0 to float
%4 = fadd float %3, %1
%5 = fpext float %4 to double
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ strlen2(char const *);
int strnset(char **, char const *, int /*<<< orphan*/);
bool strset(char **str_field, const char *str) {
  return strnset(str_field, str, strlen2(str));
}


x86 assembly (clang, -O0):
<strset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen2@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <strnset@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strset>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <strlen2@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <strnset@plt>

LLVM IR (-O0):
define i32 @strset(i8** %0, i8* %1) {
%3 = alloca i8**
%4 = alloca i8*
store i8** %0, i8*** %3
store i8* %1, i8** %4
%5 = load i8**, i8*** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen2(i8* %7)
%9 = call i32 @strnset(i8** %5, i8* %6, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @strset(i8** %0, i8* %1) {
%3 = tail call i32 @strlen2(i8* %1)
%4 = tail call i32 @strnset(i8** %0, i8* %1, i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ __NR_seccomp;
int syscall(int /*<<< orphan*/, unsigned int, unsigned int, void *);
int seccomp(unsigned int operation, unsigned int flags, void *arg) {
  return syscall(__NR_seccomp, operation, flags, arg);
}


x86 assembly (clang, -O0):
<seccomp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    0x2eb7(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x10(%rbp),%rcx
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<seccomp>:
mov    %rdx,%rcx
mov    %esi,%edx
mov    %edi,%esi
mov    0x2ec2(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@__NR_seccomp = global i32 0
define i32 @seccomp(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* @__NR_seccomp
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = load i8*, i8** %6
%11 = call i32 @syscall(i32 %7, i32 %8, i32 %9, i8* %10)
ret i32 %11
}

LLVM IR (-O2):
@__NR_seccomp = global i32 0
define i32 @seccomp(i32 %0, i32 %1, i8* %2) {
%4 = load i32, i32* @__NR_seccomp
%5 = tail call i32 @syscall(i32 %4, i32 %0, i32 %1, i8* %2)
ret i32 %5
}
void stop_here() {}


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

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

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

LLVM IR (-O2):
define void @stop_here() {
ret void
}
void foo72() {}


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

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

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

LLVM IR (-O2):
define void @foo72() {
ret void
}
int xdddefault_delete_host_downtime(unsigned long downtime_id) {}


x86 assembly (clang, -O0):
<xdddefault_delete_host_downtime>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @xdddefault_delete_host_downtime(i64 %0) {
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fread(char *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
void get_cmdline(char *data, int size) {
  FILE *fp;
  fp = fopen("/proc/self/cmdline", "r");
  assert(NULL != fp);
  memset(data, 0, size);
  fread(data, size, 1, fp);
}


x86 assembly (clang, -O0):
<get_cmdline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    0xeaa(%rip),%rdi
lea    0xeb6(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
cmp    -0x18(%rbp),%rax
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
xor    %esi,%esi
call   1040 <memset@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rcx
mov    $0x1,%edx
call   1030 <fread@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_cmdline>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %rdi,%rbx
lea    0xeaf(%rip),%rdi
lea    0xebb(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,%rbp
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   1050 <assert@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r14d,%edx
call   1040 <memset@plt>
mov    %rbx,%rdi
mov    %r14d,%esi
mov    $0x1,%edx
mov    %rbp,%rcx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <fread@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"/proc/self/cmdline\00"
@.str.1 = [2 x i8] c"r\00"
define void @get_cmdline(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = call i32* @fopen(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %6, i32** %5
%7 = load i32*, i32** %5
%8 = icmp ne i32* null, %7
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = load i8*, i8** %3
%12 = load i32, i32* %4
%13 = call i32 @memset(i8* %11, i32 0, i32 %12)
%14 = load i8*, i8** %3
%15 = load i32, i32* %4
%16 = load i32*, i32** %5
%17 = call i32 @fread(i8* %14, i32 %15, i32 1, i32* %16)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"/proc/self/cmdline\00"
@.str.1 = [2 x i8] c"r\00"
define void @get_cmdline(i8* %0, i32 %1) {
%3 = tail call i32* @fopen(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%4 = icmp ne i32* %3, null
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = tail call i32 @memset(i8* %0, i32 0, i32 %1)
%8 = tail call i32 @fread(i8* %0, i32 %1, i32 1, i32* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int OLE_print_string(char *string, size_t char_count) {
  while (char_count--) {
    printf("%c", *string);
    string += 2;
  }
  return 0;
}


x86 assembly (clang, -O0):
<OLE_print_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x10(%rbp)
cmp    $0x0,%rax
je     115d <OLE_print_string+0x4d>
mov    -0x8(%rbp),%rax
lea    0xebc(%rip),%rdi
movsbl (%rax),%esi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x8(%rbp)
jmp    1120 <OLE_print_string+0x10>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OLE_print_string>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %rsi,%rsi
je     1146 <OLE_print_string+0x36>
mov    %rsi,%r12
mov    %rdi,%r14
xor    %ebx,%ebx
lea    0xed4(%rip),%r15
nopl   0x0(%rax)
movsbl (%r14,%rbx,2),%esi
mov    %r15,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <OLE_print_string+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define i32 @OLE_print_string(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
br label %5
5: ; preds = %9, %2
%6 = load i64, i64* %4
%7 = add i64 %6, -1
store i64 %7, i64* %4
%8 = icmp ne i64 %6, 0
br i1 %8, label %9, label %15
9: ; preds = %5
%10 = load i8*, i8** %3
%11 = load i8, i8* %10
%12 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %11)
%13 = load i8*, i8** %3
%14 = getelementptr inbounds i8, i8* %13, i64 2
store i8* %14, i8** %3
br label %5
15: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define i32 @OLE_print_string(i8* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %12, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %7, %4 ], [ %1, %2 ]
%6 = phi i8* [ %10, %4 ], [ %0, %2 ]
%7 = add i64 %5, -1
%8 = load i8, i8* %6
%9 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %8)
%10 = getelementptr inbounds i8, i8* %6, i64 2
%11 = icmp eq i64 %7, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %2
ret i32 0
}
int memfd_create(const char *__name, unsigned int __flags) {
  int retval = -1;
  __asm__("movl $356, %eax");
  __asm__("movl 8(%ebp), %ebx");
  __asm__("movl 12(%ebp),%ecx");
  __asm__("int $0x80");
  __asm__("movl %%eax, %0" : "=q"(retval));
  __flags = (unsigned int)__name;
  ++__flags;
  return retval;
}


x86 assembly (clang, -O0):
<memfd_create>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0xffffffff,-0x10(%rbp)
mov    $0x164,%eax
mov    0x8(%ebp),%ebx
mov    0xc(%ebp),%ecx
int    $0x80
mov    %eax,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<memfd_create>:
mov    $0x164,%eax
mov    0x8(%ebp),%ebx
mov    0xc(%ebp),%ecx
int    $0x80
mov    %eax,%eax
ret

LLVM IR (-O0):
define i32 @memfd_create(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32 -1, i32* %5
%6 = call i32 asm "movl %eax, $0", "=q,~{dirflag},~{fpsr},~{flags}"()
store i32 %6, i32* %5
%7 = load i8*, i8** %3
%8 = ptrtoint i8* %7 to i32
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = add i32 %9, 1
store i32 %10, i32* %4
%11 = load i32, i32* %5
ret i32 %11
}

LLVM IR (-O2):
define i32 @memfd_create(i8* nocapture readnone %0, i32 %1) {
tail call void asm sideeffect "movl $$356, %eax", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "movl 8(%ebp), %ebx", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "movl 12(%ebp),%ecx", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "int $$0x80", "~{dirflag},~{fpsr},~{flags}"()
%3 = tail call i32 asm "movl %eax, $0", "=q,~{dirflag},~{fpsr},~{flags}"()
ret i32 %3
}
int search(int *tab, int n) {
  int i = 0;
  while (tab[i] != '\0') {
    if (tab[i] == n) {
      return i;
    }
    i++;
  }
  return -1;
}


x86 assembly (clang, -O0):
<search>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     1151 <search+0x51>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x14(%rbp),%eax
jne    1143 <search+0x43>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1158 <search+0x58>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1112 <search+0x12>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<search>:
mov    (%rdi),%edx
mov    $0xffffffff,%eax
test   %edx,%edx
je     1120 <search+0x20>
xor    %ecx,%ecx
nopl   (%rax)
cmp    %esi,%edx
je     1121 <search+0x21>
mov    0x4(%rdi,%rcx,4),%edx
add    $0x1,%rcx
test   %edx,%edx
jne    1110 <search+0x10>
ret
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @search(i32* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 0, i32* %6
br label %7
7: ; preds = %24, %2
%8 = load i32*, i32** %4
%9 = load i32, i32* %6
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = load i32, i32* %11
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %27
14: ; preds = %7
%15 = load i32*, i32** %4
%16 = load i32, i32* %6
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i32, i32* %15, i64 %17
%19 = load i32, i32* %18
%20 = load i32, i32* %5
%21 = icmp eq i32 %19, %20
br i1 %21, label %22, label %24
22: ; preds = %14
%23 = load i32, i32* %6
store i32 %23, i32* %3
br label %28
24: ; preds = %14
%25 = load i32, i32* %6
%26 = add nsw i32 %25, 1
store i32 %26, i32* %6
br label %7
27: ; preds = %7
store i32 -1, i32* %3
br label %28
28: ; preds = %27, %22
%29 = load i32, i32* %3
ret i32 %29
}

LLVM IR (-O2):
define i32 @search(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = icmp eq i32 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2, %9
%6 = phi i64 [ %10, %9 ], [ 0, %2 ]
%7 = phi i32 [ %12, %9 ], [ %3, %2 ]
%8 = icmp eq i32 %7, %1
br i1 %8, label %14, label %9
9: ; preds = %5
%10 = add nuw i64 %6, 1
%11 = getelementptr inbounds i32, i32* %0, i64 %10
%12 = load i32, i32* %11
%13 = icmp eq i32 %12, 0
br i1 %13, label %16, label %5
14: ; preds = %5
%15 = trunc i64 %6 to i32
br label %16
16: ; preds = %9, %14, %2
%17 = phi i32 [ -1, %2 ], [ %15, %14 ], [ -1, %9 ]
ret i32 %17
}
/* Variables and functions */
char *strrchr(char const *, char);
char *__basename(const char *filename) {
  char *p = strrchr(filename, '/');
  return p ? p + 1 : (char *)filename;
}


x86 assembly (clang, -O0):
<__basename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114a <__basename+0x3a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1152 <__basename+0x42>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__basename>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @__basename(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strrchr(i8* %4, i8 signext 47)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 1
br label %13
11: ; preds = %1
%12 = load i8*, i8** %2
br label %13
13: ; preds = %11, %8
%14 = phi i8* [ %10, %8 ], [ %12, %11 ]
ret i8* %14
}

LLVM IR (-O2):
define i8* @__basename(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ wait(int);
wait_for_http_get() { wait(2000); }


x86 assembly (clang, -O0):
<wait_for_http_get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x7d0,%edi
call   1030 <wait@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait_for_http_get>:
mov    $0x7d0,%edi
jmp    1030 <wait@plt>

LLVM IR (-O0):
define i32 @wait_for_http_get() {
%1 = alloca i32
%2 = call i32 @wait(i32 2000)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @wait_for_http_get() {
%1 = tail call i32 @wait(i32 2000)
ret i32 undef
}
double quadrat(double x) { return x * x; }


x86 assembly (clang, -O0):
<quadrat>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<quadrat>:
mulsd  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @quadrat(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fmul double %3, %4
ret double %5
}

LLVM IR (-O2):
define double @quadrat(double %0) {
%2 = fmul double %0, %0
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ changeVars(int *, int);
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int x = 2;
  int y = 5;
  printf("before changeVars():\n x:%d y:%d \n", x, y);
  changeVars(&x, y);
  printf("after changeVars():\n x:%d y:%d \n", x, y);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
movl   $0x5,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xeb6(%rip),%rdi
call   1040 <printf@plt>
mov    -0xc(%rbp),%esi
lea    -0x8(%rbp),%rdi
call   1030 <changeVars@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xeba(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x2,0x4(%rsp)
lea    0xed0(%rip),%rdi
mov    $0x2,%esi
mov    $0x5,%edx
call   1040 <printf@plt>
lea    0x4(%rsp),%rdi
mov    $0x5,%esi
call   1030 <changeVars@plt>
mov    0x4(%rsp),%esi
lea    0xec9(%rip),%rdi
mov    $0x5,%edx
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [34 x i8] c"before changeVars():\0A x:%d y:%d \0A\00"
@.str.1 = [33 x i8] c"after changeVars():\0A x:%d y:%d \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 2, i32* %2
store i32 5, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %5)
%7 = load i32, i32* %3
%8 = call i32 @changeVars(i32* %2, i32 %7)
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i32 %9, i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [34 x i8] c"before changeVars():\0A x:%d y:%d \0A\00"
@.str.1 = [33 x i8] c"after changeVars():\0A x:%d y:%d \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 2, i32* %1
%3 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 2, i32 5)
%4 = call i32 @changeVars(i32* %1, i32 5)
%5 = load i32, i32* %1
%6 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i32 %5, i32 5)
ret i32 0
}
void gdk_window_hints_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gdk_window_hints_get_type() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int sum(int, int);
int main() {
  int x = sum(5, 7);
  printf("5 + 7 = %d\n", x);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x5,%edi
mov    $0x7,%esi
call   1040 <sum@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
mov    $0x7,%esi
call   1040 <sum@plt>
lea    0xec9(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [12 x i8] c"5 + 7 = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @sum(i32 5, i32 7)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void loop3(void) {
  int x;
  x = 0;
  do {
    printf("Hello, World!\n");
  } while (x != 0);
}


x86 assembly (clang, -O0):
<loop3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x0,-0x4(%rbp)
jne    111f <loop3+0xf>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [14 x i8] c"Hello, World!\00"
define void @loop3() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret void
}
void answer_time(void) {}


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

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

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

LLVM IR (-O2):
define void @answer_time() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ HplMsp430GeneralIOP__46__IO__selectIOFunc();
void Msp430Adc12ImplP__Port66__selectIOFunc(void) {
  HplMsp430GeneralIOP__46__IO__selectIOFunc();
}


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

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

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

LLVM IR (-O2):
define void @Msp430Adc12ImplP__Port66__selectIOFunc() {
%1 = tail call i32 (...) @HplMsp430GeneralIOP__46__IO__selectIOFunc()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ check_unsigned_ints(int, int, char *);
void check_int(int actual, int expected) {
  check_unsigned_ints(actual, expected, "");
}


x86 assembly (clang, -O0):
<check_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
lea    0xed5(%rip),%rdx
call   1030 <check_unsigned_ints@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_int>:
lea    0xee9(%rip),%rdx
jmp    1030 <check_unsigned_ints@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define void @check_int(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 = load i32, i32* %4
%7 = call i32 @check_unsigned_ints(i32 %5, i32 %6, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define void @check_int(i32 %0, i32 %1) {
%3 = tail call i32 @check_unsigned_ints(i32 %0, i32 %1, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ strncmp(char *, char *, int);
void strncmp_constant_and_var_0() {
  char *x = "123";
  if (strncmp(x, "123", 3) != 0)
    (void)*(char *)0;
}


x86 assembly (clang, -O0):
<strncmp_constant_and_var_0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed2(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
je     1142 <strncmp_constant_and_var_0+0x32>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncmp_constant_and_var_0>:
lea    0xee9(%rip),%rdi
mov    %rdi,%rsi
mov    $0x3,%edx
jmp    1030 <strncmp@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"123\00"
define void @strncmp_constant_and_var_0() {
%1 = tail call i64 @strncmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
ret void
}
extern void impl_flush(void) {}


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

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

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

LLVM IR (-O2):
define void @impl_flush() {
ret void
}
unsigned int rgb_to_pixel15(unsigned int r, unsigned int g, unsigned int b) {
  return ((r >> 3) << 10) | ((g >> 3) << 5) | (b >> 3);
}


x86 assembly (clang, -O0):
<rgb_to_pixel15>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x3,%eax
shl    $0xa,%eax
mov    -0x8(%rbp),%ecx
shr    $0x3,%ecx
shl    $0x5,%ecx
or     %ecx,%eax
mov    -0xc(%rbp),%ecx
shr    $0x3,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rgb_to_pixel15>:
and    $0xfffffff8,%edi
shl    $0x7,%edi
lea    0x0(,%rsi,4),%eax
and    $0xffffffe0,%eax
or     %edi,%eax
shr    $0x3,%edx
or     %edx,%eax
ret

LLVM IR (-O0):
define i32 @rgb_to_pixel15(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = lshr i32 %7, 3
%9 = shl i32 %8, 10
%10 = load i32, i32* %5
%11 = lshr i32 %10, 3
%12 = shl i32 %11, 5
%13 = or i32 %9, %12
%14 = load i32, i32* %6
%15 = lshr i32 %14, 3
%16 = or i32 %13, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @rgb_to_pixel15(i32 %0, i32 %1, i32 %2) {
%4 = shl i32 %0, 7
%5 = and i32 %4, -1024
%6 = shl i32 %1, 2
%7 = and i32 %6, -32
%8 = or i32 %7, %5
%9 = lshr i32 %2, 3
%10 = or i32 %8, %9
ret i32 %10
}
void hvm_msr_write_summary(struct hvm_data *h) {}


x86 assembly (clang, -O0):
<hvm_msr_write_summary>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.hvm_data = type opaque
define void @hvm_msr_write_summary(%struct.hvm_data* %0) {
%2 = alloca %struct.hvm_data*
store %struct.hvm_data* %0, %struct.hvm_data** %2
ret void
}

LLVM IR (-O2):
%struct.hvm_data = type opaque
define void @hvm_msr_write_summary(%struct.hvm_data* nocapture %0) {
ret void
}