xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ int80(int, int, int /*<<< orphan*/, int /*<<< orphan*/,
                         int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ nextLine();
int /*<<< orphan*/ printf(char *);
void sleep() {
  int time = 5000000000;
  int80(6, time, 0, 0, 0, 0);
  nextLine();
  printf("Dormi 13 segundos");
}


x86 assembly (clang, -O0):
<sleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x2a05f200,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x6,%edi
xor    %r9d,%r9d
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %r9d,%r8d
call   1040 <int80@plt>
mov    $0x0,%al
call   1050 <nextLine@plt>
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sleep>:
push   %rax
mov    $0x6,%edi
mov    $0x2a05f200,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1040 <int80@plt>
xor    %eax,%eax
call   1050 <nextLine@plt>
lea    0xea8(%rip),%rdi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"Dormi 13 segundos\00"
define void @sleep() {
%1 = alloca i32
store i32 705032704, i32* %1
%2 = load i32, i32* %1
%3 = call i32 @int80(i32 6, i32 %2, i32 0, i32 0, i32 0, i32 0)
%4 = call i32 (...) @nextLine()
%5 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"Dormi 13 segundos\00"
define void @sleep() {
%1 = tail call i32 @int80(i32 6, i32 705032704, i32 0, i32 0, i32 0, i32 0)
%2 = tail call i32 (...) @nextLine()
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret void
}
void link_print(struct STU *head) { return; }


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

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

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

LLVM IR (-O2):
%struct.STU = type opaque
define void @link_print(%struct.STU* nocapture %0) {
ret void
}
/* Variables and functions */
int fn_a(int, int);
int main(int argc, char *argv[]) {
  const char *message = "Hello, world";
  return fn_a(11, 12);
}


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)
lea    0xed3(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    $0xb,%edi
mov    $0xc,%esi
call   1030 <fn_a@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0xb,%edi
mov    $0xc,%esi
jmp    1030 <fn_a@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"Hello, world\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
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8** %6
%7 = call i32 @fn_a(i32 11, i32 12)
ret i32 %7
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @fn_a(i32 11, i32 12)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("hello, world");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"hello, world\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"hello, world\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int test_imm_27uint32_mem(unsigned int *val) {
  return ((*val) & (0x27 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_27uint32_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
and    $0x27,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_27uint32_mem>:
testb  $0x27,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_27uint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 39
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void RandomFunc(unsigned char input[1], unsigned char output[1]) {
  unsigned char state[1];
  unsigned char local1;
  {
    state[0UL] = (input[0UL] | 51238316UL) >> (unsigned char)3;
    local1 = 0UL;
    while (local1 < (unsigned char)0) {
      state[0UL] <<=
          ((state[0UL] >> (unsigned char)3) & (unsigned char)7) | 1UL;
      local1 += 2UL;
    }
    output[0UL] = (state[0UL] ^ 784608736UL) >> (unsigned char)3;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
or     $0x30dd5ac,%rax
shr    $0x3,%rax
mov    %al,-0x11(%rbp)
movb   $0x0,-0x12(%rbp)
movzbl -0x12(%rbp),%eax
cmp    $0x0,%eax
jge    115b <RandomFunc+0x5b>
movzbl -0x11(%rbp),%eax
sar    $0x3,%eax
and    $0x7,%eax
movslq %eax,%rcx
or     $0x1,%rcx
movzbl -0x11(%rbp),%eax
shl    %cl,%eax
mov    %al,-0x11(%rbp)
movzbl -0x12(%rbp),%eax
add    $0x2,%rax
mov    %al,-0x12(%rbp)
jmp    1124 <RandomFunc+0x24>
movzbl -0x11(%rbp),%eax
xor    $0x2ec42de0,%rax
shr    $0x3,%rax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
mov    (%rdi),%al
shr    $0x6,%al
or     $0x16,%al
xor    $0xbc,%al
mov    %al,(%rsi)
ret

LLVM IR (-O0):
define void @RandomFunc(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [1 x i8]
%6 = alloca i8
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8, i8* %7, i64 0
%9 = load i8, i8* %8
%10 = zext i8 %9 to i64
%11 = or i64 %10, 51238316
%12 = lshr i64 %11, 3
%13 = trunc i64 %12 to i8
%14 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 0
store i8 %13, i8* %14
store i8 0, i8* %6
br label %15
15: ; preds = %19, %2
%16 = load i8, i8* %6
%17 = zext i8 %16 to i32
%18 = icmp slt i32 %17, 0
br i1 %18, label %19, label %37
19: ; preds = %15
%20 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 0
%21 = load i8, i8* %20
%22 = zext i8 %21 to i32
%23 = ashr i32 %22, 3
%24 = and i32 %23, 7
%25 = sext i32 %24 to i64
%26 = or i64 %25, 1
%27 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 0
%28 = load i8, i8* %27
%29 = zext i8 %28 to i32
%30 = trunc i64 %26 to i32
%31 = shl i32 %29, %30
%32 = trunc i32 %31 to i8
store i8 %32, i8* %27
%33 = load i8, i8* %6
%34 = zext i8 %33 to i64
%35 = add i64 %34, 2
%36 = trunc i64 %35 to i8
store i8 %36, i8* %6
br label %15
37: ; preds = %15
%38 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 0
%39 = load i8, i8* %38
%40 = zext i8 %39 to i64
%41 = xor i64 %40, 784608736
%42 = lshr i64 %41, 3
%43 = trunc i64 %42 to i8
%44 = load i8*, i8** %4
%45 = getelementptr inbounds i8, i8* %44, i64 0
store i8 %43, i8* %45
ret void
}

LLVM IR (-O2):
define void @RandomFunc(i8* nocapture %0, i8* nocapture writeonly %1) {
%3 = load i8, i8* %0
%4 = lshr i8 %3, 6
%5 = or i8 %4, 22
%6 = xor i8 %5, -68
store i8 %6, i8* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ load_xmm(int, void *);
int /*<<< orphan*/ printf(char *, int, float, float, float, float);
void print_xmm_float(int i) {
  static float v[4];
  load_xmm(i, (void *)v);
  printf("xmm%d = {%12.4f, %12.4f, %12.4f, %12.4f}\n", i, v[0], v[1], v[2],
         v[3]);
}


x86 assembly (clang, -O0):
<print_xmm_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    0x2f0b(%rip),%rsi
call   1040 <load_xmm@plt>
mov    -0x4(%rbp),%esi
movss  0x2efb(%rip),%xmm0
movss  0x2ef7(%rip),%xmm1
movss  0x2ef3(%rip),%xmm2
movss  0x2eef(%rip),%xmm3
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_xmm_float>:
push   %rbx
mov    %edi,%ebx
lea    0x2f16(%rip),%rsi
call   1040 <load_xmm@plt>
movss  0x2f09(%rip),%xmm0
movss  0x2f05(%rip),%xmm1
movss  0x2f01(%rip),%xmm2
movss  0x2efd(%rip),%xmm3
lea    0xeaa(%rip),%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@print_xmm_float.v = internal global [4 x float] zeroinitializer
@.str = [42 x i8] c"xmm%d = {%12.4f, %12.4f, %12.4f, %12.4f}\0A\00"
define void @print_xmm_float(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @load_xmm(i32 %3, i8* bitcast ([4 x float]* @print_xmm_float.v to i8*))
%5 = load i32, i32* %2
%6 = load float, float* getelementptr inbounds ([4 x float], [4 x float]* @print_xmm_float.v, i64 0, i64 0)
%7 = load float, float* getelementptr inbounds ([4 x float], [4 x float]* @print_xmm_float.v, i64 0, i64 1)
%8 = load float, float* getelementptr inbounds ([4 x float], [4 x float]* @print_xmm_float.v, i64 0, i64 2)
%9 = load float, float* getelementptr inbounds ([4 x float], [4 x float]* @print_xmm_float.v, i64 0, i64 3)
%10 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 %5, float %6, float %7, float %8, float %9)
ret void
}

LLVM IR (-O2):
@print_xmm_float.v = internal global [4 x float] zeroinitializer
@.str = [42 x i8] c"xmm%d = {%12.4f, %12.4f, %12.4f, %12.4f}\0A\00"
define void @print_xmm_float(i32 %0) {
%2 = tail call i32 @load_xmm(i32 %0, i8* bitcast ([4 x float]* @print_xmm_float.v to i8*))
%3 = load float, float* getelementptr inbounds ([4 x float], [4 x float]* @print_xmm_float.v, i64 0, i64 0)
%4 = load float, float* getelementptr inbounds ([4 x float], [4 x float]* @print_xmm_float.v, i64 0, i64 1)
%5 = load float, float* getelementptr inbounds ([4 x float], [4 x float]* @print_xmm_float.v, i64 0, i64 2)
%6 = load float, float* getelementptr inbounds ([4 x float], [4 x float]* @print_xmm_float.v, i64 0, i64 3)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 %0, float %3, float %4, float %5, float %6)
ret void
}
/* Type definitions */
struct pthread {
  int dummy;
};

/* Variables and functions */
struct pthread *pthread_self();
struct pthread *__pthread_self(void) {
  return pthread_self();
}


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

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

LLVM IR (-O0):
%struct.pthread = type { i32 }
define %struct.pthread* @__pthread_self() {
%1 = call %struct.pthread* (...) @pthread_self()
ret %struct.pthread* %1
}

LLVM IR (-O2):
%struct.pthread = type { i32 }
define %struct.pthread* @__pthread_self() {
%1 = tail call %struct.pthread* (...) @pthread_self()
ret %struct.pthread* %1
}
/* Variables and functions */
int /*<<< orphan*/ rul___emit_decr_indent();
int /*<<< orphan*/ rul___emit_newline();
int /*<<< orphan*/ rul___emit_string(char *);
int /*<<< orphan*/ rul___emit_verify_newline();
void rul__emit_end_loop(void) {
  rul___emit_verify_newline();
  rul___emit_decr_indent();
  rul___emit_string("}");
  rul___emit_newline();
}


x86 assembly (clang, -O0):
<rul__emit_end_loop>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <rul___emit_verify_newline@plt>
mov    $0x0,%al
call   1050 <rul___emit_decr_indent@plt>
lea    0xea7(%rip),%rdi
call   1030 <rul___emit_string@plt>
mov    $0x0,%al
call   1060 <rul___emit_newline@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<rul__emit_end_loop>:
push   %rax
xor    %eax,%eax
call   1040 <rul___emit_verify_newline@plt>
xor    %eax,%eax
call   1050 <rul___emit_decr_indent@plt>
lea    0xeaa(%rip),%rdi
call   1030 <rul___emit_string@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <rul___emit_newline@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"}\00"
define void @rul__emit_end_loop() {
%1 = call i32 (...) @rul___emit_verify_newline()
%2 = call i32 (...) @rul___emit_decr_indent()
%3 = call i32 @rul___emit_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @rul___emit_newline()
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"}\00"
define void @rul__emit_end_loop() {
%1 = tail call i32 (...) @rul___emit_verify_newline()
%2 = tail call i32 (...) @rul___emit_decr_indent()
%3 = tail call i32 @rul___emit_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 (...) @rul___emit_newline()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SIGFPE;
int /*<<< orphan*/ raise(int /*<<< orphan*/);
int random();
int /*<<< orphan*/ srandom(unsigned int);
scalar_t__ time(int /*<<< orphan*/ *);
int randrange(int start, int end) {
  if (start > end) {
    raise(SIGFPE);
  }
  srandom((unsigned)time(NULL));
  return random() % (end - start + 1) + start;
}


x86 assembly (clang, -O0):
<randrange>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1168 <randrange+0x28>
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
call   1030 <raise@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srandom@plt>
mov    $0x0,%al
call   1060 <random@plt>
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
add    $0x1,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randrange>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %edi,%ebx
sub    %edi,%ebp
jge    1159 <randrange+0x19>
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
call   1030 <raise@plt>
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srandom@plt>
xor    %eax,%eax
call   1060 <random@plt>
add    $0x1,%ebp
cltd
idiv   %ebp
add    %edx,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@SIGFPE = global i32 0
define i32 @randrange(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 %11
8: ; preds = %2
%9 = load i32, i32* @SIGFPE
%10 = call i32 @raise(i32 %9)
br label %11
11: ; preds = %8, %2
%12 = call i64 @time(i32* null)
%13 = trunc i64 %12 to i32
%14 = call i32 @srandom(i32 %13)
%15 = call i32 (...) @random()
%16 = load i32, i32* %4
%17 = load i32, i32* %3
%18 = sub nsw i32 %16, %17
%19 = add nsw i32 %18, 1
%20 = srem i32 %15, %19
%21 = load i32, i32* %3
%22 = add nsw i32 %20, %21
ret i32 %22
}

LLVM IR (-O2):
@SIGFPE = global i32 0
define i32 @randrange(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, %0
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = load i32, i32* @SIGFPE
%6 = tail call i32 @raise(i32 %5)
br label %7
7: ; preds = %4, %2
%8 = tail call i64 @time(i32* null)
%9 = trunc i64 %8 to i32
%10 = tail call i32 @srandom(i32 %9)
%11 = tail call i32 (...) @random()
%12 = sub i32 1, %0
%13 = add i32 %12, %1
%14 = srem i32 %11, %13
%15 = add nsw i32 %14, %0
ret i32 %15
}
int increment(int x) { return x + 1; }


x86 assembly (clang, -O0):
<increment>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<increment>:
lea    0x1(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @increment(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
/* Variables and functions */
int free_image_share_buff();
int malloc_image_share_buff();
int realloc_image_share_buff() {
  int ret;
  ret = free_image_share_buff();
  ret = malloc_image_share_buff();
  return ret;
}


x86 assembly (clang, -O0):
<realloc_image_share_buff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <free_image_share_buff@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <malloc_image_share_buff@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<realloc_image_share_buff>:
push   %rax
xor    %eax,%eax
call   1040 <free_image_share_buff@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <malloc_image_share_buff@plt>

LLVM IR (-O0):
define i32 @realloc_image_share_buff() {
%1 = alloca i32
%2 = call i32 (...) @free_image_share_buff()
store i32 %2, i32* %1
%3 = call i32 (...) @malloc_image_share_buff()
store i32 %3, i32* %1
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
define i32 @realloc_image_share_buff() {
%1 = tail call i32 (...) @free_image_share_buff()
%2 = tail call i32 (...) @malloc_image_share_buff()
ret i32 %2
}
void kissSimEnablePause() {}


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

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

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

LLVM IR (-O2):
define void @kissSimEnablePause() {
ret void
}
int main(void) { -1 << 5; }


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
typedef char uint8_t;

/* Variables and functions */
bool is_valid_hex_char(uint8_t c) {
  if ((c >= '0') && (c <= '9'))
    return true;
  if ((c >= 'A') && (c <= 'F'))
    return true;
  if ((c >= 'a') && (c <= 'f'))
    return true;
  return false;
}


x86 assembly (clang, -O0):
<is_valid_hex_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jl     1130 <is_valid_hex_char+0x30>
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jg     1130 <is_valid_hex_char+0x30>
movl   $0x1,-0x4(%rbp)
jmp    1183 <is_valid_hex_char+0x83>
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
jl     1156 <is_valid_hex_char+0x56>
movsbl -0x5(%rbp),%eax
cmp    $0x46,%eax
jg     1156 <is_valid_hex_char+0x56>
movl   $0x1,-0x4(%rbp)
jmp    1183 <is_valid_hex_char+0x83>
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jl     117c <is_valid_hex_char+0x7c>
movsbl -0x5(%rbp),%eax
cmp    $0x66,%eax
jg     117c <is_valid_hex_char+0x7c>
movl   $0x1,-0x4(%rbp)
jmp    1183 <is_valid_hex_char+0x83>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_valid_hex_char>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%al
setb   %al
and    $0xdf,%dil
add    $0xbf,%dil
cmp    $0x6,%dil
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @is_valid_hex_char(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 48
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 57
br i1 %10, label %11, label %12
11: ; preds = %7
store i32 1, i32* %2
br label %31
12: ; preds = %7, %1
%13 = load i8, i8* %3
%14 = sext i8 %13 to i32
%15 = icmp sge i32 %14, 65
br i1 %15, label %16, label %21
16: ; preds = %12
%17 = load i8, i8* %3
%18 = sext i8 %17 to i32
%19 = icmp sle i32 %18, 70
br i1 %19, label %20, label %21
20: ; preds = %16
store i32 1, i32* %2
br label %31
21: ; preds = %16, %12
%22 = load i8, i8* %3
%23 = sext i8 %22 to i32
%24 = icmp sge i32 %23, 97
br i1 %24, label %25, label %30
25: ; preds = %21
%26 = load i8, i8* %3
%27 = sext i8 %26 to i32
%28 = icmp sle i32 %27, 102
br i1 %28, label %29, label %30
29: ; preds = %25
store i32 1, i32* %2
br label %31
30: ; preds = %25, %21
store i32 0, i32* %2
br label %31
31: ; preds = %30, %29, %20, %11
%32 = load i32, i32* %2
ret i32 %32
}

LLVM IR (-O2):
define i32 @is_valid_hex_char(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = and i8 %0, -33
%5 = add i8 %4, -65
%6 = icmp ult i8 %5, 6
%7 = or i1 %3, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
int check(int a) {
  int i;
  for (i = 2; i * i < a; i++) {
    if (a % (i * i) == 0) {
      return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<check>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1153 <check+0x53>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
imul   -0xc(%rbp),%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1140 <check+0x40>
movl   $0x1,-0x4(%rbp)
jmp    115a <check+0x5a>
jmp    1145 <check+0x45>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <check+0xe>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check>:
xor    %r8d,%r8d
cmp    $0x5,%edi
jl     1135 <check+0x35>
mov    $0x4,%esi
mov    $0x3,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
je     1139 <check+0x39>
mov    %ecx,%esi
imul   %ecx,%esi
add    $0x1,%ecx
cmp    %edi,%esi
jl     1120 <check+0x20>
mov    %r8d,%eax
ret
mov    $0x1,%r8d
mov    %r8d,%eax
ret

LLVM IR (-O0):
define i32 @check(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 2, i32* %4
br label %5
5: ; preds = %20, %1
%6 = load i32, i32* %4
%7 = load i32, i32* %4
%8 = mul nsw i32 %6, %7
%9 = load i32, i32* %3
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %23
11: ; preds = %5
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = load i32, i32* %4
%15 = mul nsw i32 %13, %14
%16 = srem i32 %12, %15
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %19
18: ; preds = %11
store i32 1, i32* %2
br label %24
19: ; preds = %11
br label %20
20: ; preds = %19
%21 = load i32, i32* %4
%22 = add nsw i32 %21, 1
store i32 %22, i32* %4
br label %5
23: ; preds = %5
store i32 0, i32* %2
br label %24
24: ; preds = %23, %18
%25 = load i32, i32* %2
ret i32 %25
}

LLVM IR (-O2):
define i32 @check(i32 %0) {
%2 = icmp sgt i32 %0, 4
br i1 %2, label %6, label %12
3: ; preds = %6
%4 = mul nsw i32 %11, %11
%5 = icmp slt i32 %4, %0
br i1 %5, label %6, label %12
6: ; preds = %1, %3
%7 = phi i32 [ %4, %3 ], [ 4, %1 ]
%8 = phi i32 [ %11, %3 ], [ 2, %1 ]
%9 = srem i32 %0, %7
%10 = icmp eq i32 %9, 0
%11 = add nuw nsw i32 %8, 1
br i1 %10, label %12, label %3
12: ; preds = %6, %3, %1
%13 = phi i32 [ 0, %1 ], [ 0, %3 ], [ 1, %6 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ ConvertString(char *);
char *getBraceParam();
int /*<<< orphan*/ safe_free(char *);
void CmdAcroExtra(int code) {
  char *ac = getBraceParam();
  if (ac != NULL) {
    ConvertString(ac);
  }
  safe_free(ac);
}


x86 assembly (clang, -O0):
<CmdAcroExtra>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getBraceParam@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     115a <CmdAcroExtra+0x2a>
mov    -0x10(%rbp),%rdi
call   1040 <ConvertString@plt>
mov    -0x10(%rbp),%rdi
call   1050 <safe_free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CmdAcroExtra>:
push   %rbx
xor    %eax,%eax
call   1030 <getBraceParam@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1148 <CmdAcroExtra+0x18>
mov    %rbx,%rdi
call   1040 <ConvertString@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <safe_free@plt>

LLVM IR (-O0):
define void @CmdAcroExtra(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = call i8* (...) @getBraceParam()
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = call i32 @ConvertString(i8* %8)
br label %10
10: ; preds = %7, %1
%11 = load i8*, i8** %3
%12 = call i32 @safe_free(i8* %11)
ret void
}

LLVM IR (-O2):
define void @CmdAcroExtra(i32 %0) {
%2 = tail call i8* (...) @getBraceParam()
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @ConvertString(i8* %2)
br label %6
6: ; preds = %4, %1
%7 = tail call i32 @safe_free(i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_one();
int /*<<< orphan*/ test_three();
int /*<<< orphan*/ test_two();
int main(int argc, char *argv[]) {
  test_one();
  test_two();
  test_three();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <test_one@plt>
mov    $0x0,%al
call   1030 <test_two@plt>
mov    $0x0,%al
call   1050 <test_three@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @test_one()
%7 = call i32 (...) @test_two()
%8 = call i32 (...) @test_three()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_one()
%4 = tail call i32 (...) @test_two()
%5 = tail call i32 (...) @test_three()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ send_int_to_srv(int const);
void jump_to(const int sec) {
  send_int_to_srv(0x3a);
  send_int_to_srv(sec);
}


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

x86 assembly (clang, -O2):
<jump_to>:
push   %rbx
mov    %edi,%ebx
mov    $0x3a,%edi
call   1030 <send_int_to_srv@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <send_int_to_srv@plt>

LLVM IR (-O0):
define void @jump_to(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @send_int_to_srv(i32 58)
%4 = load i32, i32* %2
%5 = call i32 @send_int_to_srv(i32 %4)
ret void
}

LLVM IR (-O2):
define void @jump_to(i32 %0) {
%2 = tail call i32 @send_int_to_srv(i32 58)
%3 = tail call i32 @send_int_to_srv(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int echo(char *s) {
  printf("%s\n", s);
  return 0;
}


x86 assembly (clang, -O0):
<echo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<echo>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @echo(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ENOENT;
int /*<<< orphan*/ errno;
int /*<<< orphan*/ perror(char *);
int main() {
  perror(0);
  errno = ENOENT;
  perror("open()");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1030 <perror@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%ecx
mov    0x2eb3(%rip),%rax
mov    %ecx,(%rax)
lea    0xeca(%rip),%rdi
call   1030 <perror@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <perror@plt>
mov    0x2eb1(%rip),%rax
mov    (%rax),%eax
mov    0x2eb8(%rip),%rcx
mov    %eax,(%rcx)
lea    0xecf(%rip),%rdi
call   1030 <perror@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@ENOENT = global i32 0
@errno = global i32 0
@.str = [7 x i8] c"open()\00"
define i32 @main() {
%1 = call i32 @perror(i8* null)
%2 = load i32, i32* @ENOENT
store i32 %2, i32* @errno
%3 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@ENOENT = global i32 0
@errno = global i32 0
@.str = [7 x i8] c"open()\00"
define i32 @main() {
%1 = tail call i32 @perror(i8* null)
%2 = load i32, i32* @ENOENT
store i32 %2, i32* @errno
%3 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ft_bzero(void *, size_t);
void *malloc(size_t);
void *ft_memalloc(size_t size) {
  void *d;
  d = malloc(size);
  if (!d)
    return (NULL);
  ft_bzero(d, size);
  return (d);
}


x86 assembly (clang, -O0):
<ft_memalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1151 <ft_memalloc+0x31>
movq   $0x0,-0x8(%rbp)
jmp    1166 <ft_memalloc+0x46>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <ft_bzero@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_memalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     113f <ft_memalloc+0x1f>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <ft_bzero@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @ft_memalloc(i64 %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i64 %0, i64* %3
%5 = load i64, i64* %3
%6 = call i8* @malloc(i64 %5)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %10, label %9
9: ; preds = %1
store i8* null, i8** %2
br label %15
10: ; preds = %1
%11 = load i8*, i8** %4
%12 = load i64, i64* %3
%13 = call i32 @ft_bzero(i8* %11, i64 %12)
%14 = load i8*, i8** %4
store i8* %14, i8** %2
br label %15
15: ; preds = %10, %9
%16 = load i8*, i8** %2
ret i8* %16
}

LLVM IR (-O2):
define i8* @ft_memalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @ft_bzero(i8* %2, i64 %0)
br label %6
6: ; preds = %1, %4
ret i8* %2
}
int find(char const *s, char c) {
  int i;
  for (i = 0; s[i]; i++) {
    if (s[i] == c) {
      return i;
    }
  }
  return -1;
}


x86 assembly (clang, -O0):
<find>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     115d <find+0x5d>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
jne    114a <find+0x4a>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1164 <find+0x64>
jmp    114f <find+0x4f>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1115 <find+0x15>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<find>:
mov    (%rdi),%dl
mov    $0xffffffff,%eax
test   %dl,%dl
je     1122 <find+0x22>
xor    %ecx,%ecx
nopl   (%rax)
cmp    %sil,%dl
je     1123 <find+0x23>
movzbl 0x1(%rdi,%rcx,1),%edx
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <find+0x10>
ret
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @find(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2, %9
%6 = phi i64 [ %10, %9 ], [ 0, %2 ]
%7 = phi i8 [ %12, %9 ], [ %3, %2 ]
%8 = icmp eq i8 %7, %1
br i1 %8, label %14, label %9
9: ; preds = %5
%10 = add nuw i64 %6, 1
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = load i8, i8* %11
%13 = icmp eq i8 %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
}
/* Type definitions */
struct poker_hand {
  int dummy;
};

/* Variables and functions */
int flush(struct poker_hand const *);
int straight(struct poker_hand const *);
int straight_flush(const struct poker_hand *h) {
  int val = straight(h);
  if (val < 0)
    return val;
  int val2 = flush(h);
  if (val2 < 0)
    return -1;
  return val * 0x100000;
}


x86 assembly (clang, -O0):
<straight_flush>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <straight@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    114d <straight_flush+0x2d>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1178 <straight_flush+0x58>
mov    -0x10(%rbp),%rdi
call   1030 <flush@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jge    116f <straight_flush+0x4f>
movl   $0xffffffff,-0x4(%rbp)
jmp    1178 <straight_flush+0x58>
mov    -0x14(%rbp),%eax
shl    $0x14,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<straight_flush>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <straight@plt>
mov    %eax,%ebx
test   %eax,%eax
js     1147 <straight_flush+0x27>
mov    %r14,%rdi
call   1030 <flush@plt>
shl    $0x14,%ebx
test   %eax,%eax
mov    $0xffffffff,%eax
cmovs  %eax,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.poker_hand = type { i32 }
define i32 @straight_flush(%struct.poker_hand* %0) {
%2 = alloca i32
%3 = alloca %struct.poker_hand*
%4 = alloca i32
%5 = alloca i32
store %struct.poker_hand* %0, %struct.poker_hand** %3
%6 = load %struct.poker_hand*, %struct.poker_hand** %3
%7 = call i32 @straight(%struct.poker_hand* %6)
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = load i32, i32* %4
store i32 %11, i32* %2
br label %21
12: ; preds = %1
%13 = load %struct.poker_hand*, %struct.poker_hand** %3
%14 = call i32 @flush(%struct.poker_hand* %13)
store i32 %14, i32* %5
%15 = load i32, i32* %5
%16 = icmp slt i32 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %12
store i32 -1, i32* %2
br label %21
18: ; preds = %12
%19 = load i32, i32* %4
%20 = mul nsw i32 %19, 1048576
store i32 %20, i32* %2
br label %21
21: ; preds = %18, %17, %10
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
%struct.poker_hand = type { i32 }
define i32 @straight_flush(%struct.poker_hand* %0) {
%2 = tail call i32 @straight(%struct.poker_hand* %0)
%3 = icmp slt i32 %2, 0
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = tail call i32 @flush(%struct.poker_hand* %0)
%6 = shl nsw i32 %2, 20
%7 = icmp sgt i32 %5, -1
%8 = select i1 %7, i32 %6, i32 -1
br label %9
9: ; preds = %1, %4
%10 = phi i32 [ %8, %4 ], [ %2, %1 ]
ret i32 %10
}
void rop3_5_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  stk1 = *D | T;
  stk1 = ~stk1;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_5_0_0>:
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
movzbl -0xa(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_5_0_0>:
or     (%rdi),%dl
not    %dl
mov    %dl,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_5_0_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%8 = load i8*, i8** %4
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = load i8, i8* %6
%12 = zext i8 %11 to i32
%13 = or i32 %10, %12
%14 = trunc i32 %13 to i8
store i8 %14, i8* %7
%15 = load i8, i8* %7
%16 = zext i8 %15 to i32
%17 = xor i32 %16, -1
%18 = trunc i32 %17 to i8
store i8 %18, i8* %7
%19 = load i8, i8* %7
%20 = load i8*, i8** %4
store i8 %19, i8* %20
ret void
}

LLVM IR (-O2):
define void @rop3_5_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = or i8 %4, %2
%6 = xor i8 %5, -1
store i8 %6, i8* %0
ret void
}
void zero(int arr[], int len) {
  int i;
  for (i = 0; i < len; i++) {
    *(arr + i) = 0;
  }
}


x86 assembly (clang, -O0):
<zero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    113b <zero+0x3b>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <zero+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<zero>:
test   %esi,%esi
jle    1126 <zero+0x16>
push   %rax
mov    %esi,%edx
shl    $0x2,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define void @zero(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %15, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %18
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
store i32 0, i32* %14
br label %15
15: ; preds = %10
%16 = load i32, i32* %5
%17 = add nsw i32 %16, 1
store i32 %17, i32* %5
br label %6
18: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @zero(i32* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = bitcast i32* %0 to i8*
%6 = zext i32 %1 to i64
%7 = shl nuw nsw i64 %6, 2
br label %8
8: ; preds = %4, %2
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char **argv) {
  int i;
  for (i = 0; i < argc; i++) {
    printf("%s\n", argv[i]);
  }
  return EXIT_SUCCESS;
}


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)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    115f <main+0x4f>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
mov    0x2e7a(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edi,%edi
jle    1145 <main+0x35>
mov    %rsi,%r15
mov    %edi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,8),%rsi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <main+0x20>
mov    0x2e94(%rip),%rax
mov    (%rax),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = load i32, i32* @EXIT_SUCCESS
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int stacked(int);
int main() {
  int i;
  for (i = 1; i < 4; i++)
    printf("%d %d\n", i, stacked(i));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x4,-0x8(%rbp)
jge    116d <main+0x4d>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <stacked@plt>
mov    -0xc(%rbp),%esi
mov    %eax,%edx
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x1,%edi
call   1040 <stacked@plt>
lea    0xece(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
mov    %eax,%edx
call   1030 <printf@plt>
mov    $0x2,%edi
call   1040 <stacked@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    %eax,%edx
call   1030 <printf@plt>
mov    $0x3,%edi
call   1040 <stacked@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"%d %d\0A\00"
define i32 @main() {
%1 = tail call i32 @stacked(i32 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 1, i32 %1)
%3 = tail call i32 @stacked(i32 2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 2, i32 %3)
%5 = tail call i32 @stacked(i32 3)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 3, i32 %5)
ret i32 0
}
void glCurrentPaletteMatrixOES(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glCurrentPaletteMatrixOES() {
ret void
}
/* Variables and functions */
char *next_alpha_double(char *);
char *next_alpha_single(char *);
int strlen(char *);
char *next_alpha(char *alpha) {
  if (strlen(alpha) == 1)
    return next_alpha_single(alpha);
  else
    return next_alpha_double(alpha);
}


x86 assembly (clang, -O0):
<next_alpha>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x1,%eax
jne    1160 <next_alpha+0x30>
mov    -0x10(%rbp),%rdi
call   1040 <next_alpha_single@plt>
mov    %rax,-0x8(%rbp)
jmp    116d <next_alpha+0x3d>
mov    -0x10(%rbp),%rdi
call   1050 <next_alpha_double@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_alpha>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
cmp    $0x1,%eax
jne    1147 <next_alpha+0x17>
pop    %rbx
jmp    1040 <next_alpha_single@plt>
pop    %rbx
jmp    1050 <next_alpha_double@plt>

LLVM IR (-O0):
define i8* @next_alpha(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 @strlen(i8* %4)
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = call i8* @next_alpha_single(i8* %8)
store i8* %9, i8** %2
br label %13
10: ; preds = %1
%11 = load i8*, i8** %3
%12 = call i8* @next_alpha_double(i8* %11)
store i8* %12, i8** %2
br label %13
13: ; preds = %10, %7
%14 = load i8*, i8** %2
ret i8* %14
}

LLVM IR (-O2):
define i8* @next_alpha(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp eq i32 %2, 1
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i8* @next_alpha_single(i8* %0)
br label %8
6: ; preds = %1
%7 = tail call i8* @next_alpha_double(i8* %0)
br label %8
8: ; preds = %6, %4
%9 = phi i8* [ %5, %4 ], [ %7, %6 ]
ret i8* %9
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ strcmp(char *, char *);
int64_t symbol_compare(void *keyA, void *keyB) {
  return strcmp((char *)keyA, (char *)keyB);
}


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

x86 assembly (clang, -O2):
<symbol_compare>:
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @symbol_compare(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 = call i32 @strcmp(i8* %5, i8* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @symbol_compare(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}