xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void printlnString(char *data) { printf("%s\n", data); }


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

x86 assembly (clang, -O2):
<printlnString>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define void @printlnString(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 void
}

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


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

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

LLVM IR (-O0):
@.str = [26 x i8] c"\0A ---- Constructor ---- \0A\00"
define void @init_fun() {
%1 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [25 x i8] c"\0A ---- Constructor ---- \00"
define void @init_fun() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
ret void
}
void PRCMAudioClockDisable(void) {
  (*((volatile unsigned long
          *)(((unsigned long)(0x40082000 + 0x000000D0) & 0xF0000000) |
             0x02000000 |
             (((unsigned long)(0x40082000 + 0x000000D0) & 0x000FFFFF) << 5) |
             ((0) << 2)))) = 0;
}


x86 assembly (clang, -O0):
<PRCMAudioClockDisable>:
push   %rbp
mov    %rsp,%rbp
mov    $0x43041a00,%eax
movq   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<PRCMAudioClockDisable>:
movq   $0x0,0x43041a00
ret

LLVM IR (-O0):
define void @PRCMAudioClockDisable() {
store volatile i64 0, i64* inttoptr (i64 1124342272 to i64*)
ret void
}

LLVM IR (-O2):
define void @PRCMAudioClockDisable() {
store volatile i64 0, i64* inttoptr (i64 1124342272 to i64*)
ret void
}
/* Variables and functions */
char *malloc(int);
int main(void) {
  char *x = malloc(4096 * 4096);
  int i;
  for (i = 0; i < 4096 * 4097; i++) {
    x[i];
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1000000,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x1001000,-0x14(%rbp)
jge    114f <main+0x3f>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1134 <main+0x24>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_assert(int);
int __VERIFIER_nondet_int();
void main() {
  int i, j;
  i = __VERIFIER_nondet_int();
  j = __VERIFIER_nondet_int();
  int x = i;
  int y = j;
  while (x != 0) {
    x--;
    y--;
  }
  if (i == j) {
    __VERIFIER_assert(y == 0);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1169 <main+0x49>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1148 <main+0x28>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    1186 <main+0x66>
cmpl   $0x0,-0x10(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <__VERIFIER_assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
cmp    %ebx,%eax
jne    1140 <main+0x20>
mov    $0x1,%edi
pop    %rbx
jmp    1040 <__VERIFIER_assert@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
%3 = icmp eq i32 %2, %1
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = tail call i32 @__VERIFIER_assert(i32 1)
br label %6
6: ; preds = %4, %0
ret void
}
void __DELETE_java_lang_AbstractStringBuilder(void *me, void *client_data) {}


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

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

LLVM IR (-O0):
define void @__DELETE_java_lang_AbstractStringBuilder(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
define void @__DELETE_java_lang_AbstractStringBuilder(i8* nocapture %0, i8* nocapture %1) {
ret void
}
void bar(void) {
  int i;
  for (i = 0; i < 50000; i++)
    asm volatile("" ::: "memory");
  usleep(10000);
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0xc350,-0x4(%rbp)
jge    113a <bar+0x2a>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <bar+0xf>
mov    $0x2710,%edi
mov    $0x0,%al
call   1030 <usleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
mov    $0xc350,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0xffffffff,%eax
jne    1120 <bar+0x10>
mov    $0x2710,%edi
xor    %eax,%eax
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @bar() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %6, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 50000
br i1 %4, label %5, label %9
5: ; preds = %2
br label %6
6: ; preds = %5
%7 = load i32, i32* %1
%8 = add nsw i32 %7, 1
store i32 %8, i32* %1
br label %2
9: ; preds = %2
%10 = call i32 (i32, ...) bitcast (i32 (...)* @usleep to i32 (i32, ...)*)(i32 10000)
ret void
}

LLVM IR (-O2):
define void @bar() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %3, %1 ]
tail call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"()
%3 = add nuw nsw i32 %2, 1
%4 = icmp eq i32 %3, 50000
br i1 %4, label %5, label %1
5: ; preds = %1
%6 = tail call i32 (i32, ...) bitcast (i32 (...)* @usleep to i32 (i32, ...)*)(i32 10000)
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint16_t;

/* Variables and functions */
void TtlMarshal_uint16_t(uint8_t **cursor, const uint16_t *x) {
  uint8_t *buffer = *cursor;
  uint16_t y = *x;
  buffer[0] = (uint8_t)(y >> 8);
  buffer[1] = (uint8_t)((y >> 0) & 0xff);
  *cursor += 2;
}


x86 assembly (clang, -O0):
<TtlMarshal_uint16_t>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
sar    $0x8,%eax
movslq %eax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x1c(%rbp),%eax
sar    $0x0,%eax
and    $0xff,%eax
movslq %eax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,0x8(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x10,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<TtlMarshal_uint16_t>:
mov    (%rdi),%rax
mov    (%rsi),%ecx
movzbl %cl,%edx
sar    $0x8,%ecx
movslq %ecx,%rcx
mov    %rcx,(%rax)
mov    %rdx,0x8(%rax)
add    $0x10,%rax
mov    %rax,(%rdi)
ret

LLVM IR (-O0):
define void @TtlMarshal_uint16_t(i64** %0, i32* %1) {
%3 = alloca i64**
%4 = alloca i32*
%5 = alloca i64*
%6 = alloca i32
store i64** %0, i64*** %3
store i32* %1, i32** %4
%7 = load i64**, i64*** %3
%8 = load i64*, i64** %7
store i64* %8, i64** %5
%9 = load i32*, i32** %4
%10 = load i32, i32* %9
store i32 %10, i32* %6
%11 = load i32, i32* %6
%12 = ashr i32 %11, 8
%13 = sext i32 %12 to i64
%14 = load i64*, i64** %5
%15 = getelementptr inbounds i64, i64* %14, i64 0
store i64 %13, i64* %15
%16 = load i32, i32* %6
%17 = ashr i32 %16, 0
%18 = and i32 %17, 255
%19 = sext i32 %18 to i64
%20 = load i64*, i64** %5
%21 = getelementptr inbounds i64, i64* %20, i64 1
store i64 %19, i64* %21
%22 = load i64**, i64*** %3
%23 = load i64*, i64** %22
%24 = getelementptr inbounds i64, i64* %23, i64 2
store i64* %24, i64** %22
ret void
}

LLVM IR (-O2):
define void @TtlMarshal_uint16_t(i64** nocapture %0, i32* nocapture %1) {
%3 = load i64*, i64** %0
%4 = load i32, i32* %1
%5 = ashr i32 %4, 8
%6 = sext i32 %5 to i64
store i64 %6, i64* %3
%7 = and i32 %4, 255
%8 = zext i32 %7 to i64
%9 = getelementptr inbounds i64, i64* %3, i64 1
store i64 %8, i64* %9
%10 = getelementptr inbounds i64, i64* %3, i64 2
store i64* %10, i64** %0
ret void
}
int main() {
  int i = 1;
  while (1)
    i = 888 * 88 * 8 * 8;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x4c5000,-0x8(%rbp)
jmp    1112 <main+0x12>

x86 assembly (clang, -O2):
<main>:
jmp    1100 <main>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
br label %3
3: ; preds = %0, %3
store i32 5001216, i32* %2
br label %3
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
br label %1
}
unsigned int f2(unsigned int x, unsigned int y) { return x & ((1U << y) - 1); }


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
sub    $0x1,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
mov    %esi,%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
not    %eax
and    %edi,%eax
ret

LLVM IR (-O0):
define i32 @f2(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 = shl i32 1, %6
%8 = sub i32 %7, 1
%9 = and i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @f2(i32 %0, i32 %1) {
%3 = shl nsw i32 -1, %1
%4 = xor i32 %3, -1
%5 = and i32 %4, %0
ret i32 %5
}
int __attribute__((target("sse4.2"))) redecl4(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @redecl4() {
ret i32 1
}

LLVM IR (-O2):
define i32 @redecl4() {
ret i32 1
}
/* Variables and functions */
void *malloc(int);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, int);
void *sqlite_malloc_and_zero(int n) {
  void *p = malloc(n);
  if (p) {
    memset(p, 0, n);
  }
  return p;
}


x86 assembly (clang, -O0):
<sqlite_malloc_and_zero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1150 <sqlite_malloc_and_zero+0x30>
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqlite_malloc_and_zero>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     113e <sqlite_malloc_and_zero+0x1e>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %ebp,%edx
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @sqlite_malloc_and_zero(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @memset(i8* %2, i32 0, i32 %0)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ gpio_function_select(int, int);
int32_t gpio_direction_input(int which_one) {
  return gpio_function_select(which_one, 0x0);
}


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

x86 assembly (clang, -O2):
<gpio_direction_input>:
xor    %esi,%esi
jmp    1030 <gpio_function_select@plt>

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

LLVM IR (-O2):
define i32 @gpio_direction_input(i32 %0) {
%2 = tail call i32 @gpio_function_select(i32 %0, i32 0)
ret i32 %2
}
void glLightModelxv(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glLightModelxv() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
struct jit_state {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ emit1(struct jit_state *, int);
int /*<<< orphan*/ emit_jump_offset(struct jit_state *, int /*<<< orphan*/);
void emit_jmp(struct jit_state *state, uint32_t target_pc) {
  emit1(state, 0xe9);
  emit_jump_offset(state, target_pc);
}


x86 assembly (clang, -O0):
<emit_jmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xe9,%esi
call   1030 <emit1@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <emit_jump_offset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_jmp>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    $0xe9,%esi
call   1030 <emit1@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <emit_jump_offset@plt>

LLVM IR (-O0):
%struct.jit_state = type { i32 }
define void @emit_jmp(%struct.jit_state* %0, i32 %1) {
%3 = alloca %struct.jit_state*
%4 = alloca i32
store %struct.jit_state* %0, %struct.jit_state** %3
store i32 %1, i32* %4
%5 = load %struct.jit_state*, %struct.jit_state** %3
%6 = call i32 @emit1(%struct.jit_state* %5, i32 233)
%7 = load %struct.jit_state*, %struct.jit_state** %3
%8 = load i32, i32* %4
%9 = call i32 @emit_jump_offset(%struct.jit_state* %7, i32 %8)
ret void
}

LLVM IR (-O2):
%struct.jit_state = type { i32 }
define void @emit_jmp(%struct.jit_state* %0, i32 %1) {
%3 = tail call i32 @emit1(%struct.jit_state* %0, i32 233)
%4 = tail call i32 @emit_jump_offset(%struct.jit_state* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void func2(void) { printf("Hello from func2.c\n"); }


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

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

LLVM IR (-O0):
@.str = [20 x i8] c"Hello from func2.c\0A\00"
define void @func2() {
%1 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [19 x i8] c"Hello from func2.c\00"
define void @func2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
ret void
}
const char *get_bob(void) { return "bob"; }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"bob\00"
define i8* @get_bob() {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}
float nsvg__minf(float a, float b) { return a < b ? a : b; }


x86 assembly (clang, -O0):
<nsvg__minf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1130 <nsvg__minf+0x30>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    113a <nsvg__minf+0x3a>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<nsvg__minf>:
minss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @nsvg__minf(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fcmp olt float %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load float, float* %3
br label %12
10: ; preds = %2
%11 = load float, float* %4
br label %12
12: ; preds = %10, %8
%13 = phi float [ %9, %8 ], [ %11, %10 ]
ret float %13
}

LLVM IR (-O2):
define float @nsvg__minf(float %0, float %1) {
%3 = fcmp olt float %0, %1
%4 = select i1 %3, float %0, float %1
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int trackerclient_release(void *bto) {
  free(bto);
  return 1;
}


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

x86 assembly (clang, -O2):
<trackerclient_release>:
push   %rax
call   1030 <free@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @trackerclient_release(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret i32 1
}
int test_imm_6Dint32_mem(int *val) {
  return ((*val) & (0x6D << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_6Dint32_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, 109
%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_6Dint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 109
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
double stdlib_strided_dsnanmeanpn(int /*<<< orphan*/ const, float const *,
                                  int /*<<< orphan*/ const);
double stdlib_strided_dsnanmean(const int64_t N, const float *X,
                                const int64_t stride) {
  return stdlib_strided_dsnanmeanpn(N, X, stride);
}


x86 assembly (clang, -O0):
<stdlib_strided_dsnanmean>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <stdlib_strided_dsnanmeanpn@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stdlib_strided_dsnanmean>:
jmp    1030 <stdlib_strided_dsnanmeanpn@plt>

LLVM IR (-O0):
define double @stdlib_strided_dsnanmean(i32 %0, float* %1, i32 %2) {
%4 = alloca i32
%5 = alloca float*
%6 = alloca i32
store i32 %0, i32* %4
store float* %1, float** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load float*, float** %5
%9 = load i32, i32* %6
%10 = call double @stdlib_strided_dsnanmeanpn(i32 %7, float* %8, i32 %9)
ret double %10
}

LLVM IR (-O2):
define double @stdlib_strided_dsnanmean(i32 %0, float* %1, i32 %2) {
%4 = tail call double @stdlib_strided_dsnanmeanpn(i32 %0, float* %1, i32 %2)
ret double %4
}
void foo(void) { extern double a; }


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

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

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

LLVM IR (-O2):
define void @foo() {
ret void
}
/* Variables and functions */
char *colon(char *cp) {
  for (; *cp; ++cp) {
    if (*cp == ':')
      return (cp);
    if (*cp == '/')
      return NULL;
  }
  return NULL;
}


x86 assembly (clang, -O0):
<colon>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1165 <colon+0x65>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3a,%eax
jne    1132 <colon+0x32>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    116d <colon+0x6d>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
jne    114f <colon+0x4f>
movq   $0x0,-0x8(%rbp)
jmp    116d <colon+0x6d>
jmp    1154 <colon+0x54>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1108 <colon+0x8>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<colon>:
mov    %rdi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl (%rax),%ecx
test   %cl,%cl
je     1127 <colon+0x27>
cmp    $0x2f,%cl
je     1127 <colon+0x27>
cmp    $0x3a,%cl
je     1129 <colon+0x29>
add    $0x1,%rax
jmp    1110 <colon+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @colon(i8* %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %5 [
i8 0, label %8
i8 58, label %7
i8 47, label %8
]
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2
br label %8
8: ; preds = %2, %2, %7
%9 = phi i8* [ %3, %7 ], [ null, %2 ], [ null, %2 ]
ret i8* %9
}
/* Variables and functions */
int /*<<< orphan*/ f_seal_DegreesToRadians(double const);
double const sin(int /*<<< orphan*/);
double f_seal_XComponentOfVector(const double p_direction,
                                 const double p_magnitude) {
  return sin(f_seal_DegreesToRadians(p_direction)) * p_magnitude;
}


x86 assembly (clang, -O0):
<f_seal_XComponentOfVector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <f_seal_DegreesToRadians@plt>
mov    %eax,%edi
call   1040 <sin@plt>
mulsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_seal_XComponentOfVector>:
push   %rax
movsd  %xmm1,(%rsp)
call   1030 <f_seal_DegreesToRadians@plt>
mov    %eax,%edi
call   1040 <sin@plt>
mulsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @f_seal_XComponentOfVector(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = call i32 @f_seal_DegreesToRadians(double %5)
%7 = call double @sin(i32 %6)
%8 = load double, double* %4
%9 = fmul double %7, %8
ret double %9
}

LLVM IR (-O2):
define double @f_seal_XComponentOfVector(double %0, double %1) {
%3 = tail call i32 @f_seal_DegreesToRadians(double %0)
%4 = tail call double @sin(i32 %3)
%5 = fmul double %4, %1
ret double %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
unsigned int __builtin_arm_cls(int /*<<< orphan*/);
unsigned int cls(uint32_t v) { return __builtin_arm_cls(v); }


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

x86 assembly (clang, -O2):
<cls>:
jmp    1030 <__builtin_arm_cls@plt>

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

LLVM IR (-O2):
define i32 @cls(i32 %0) {
%2 = tail call i32 @__builtin_arm_cls(i32 %0)
ret i32 %2
}
int isOperator(char ch) {
  if (ch == '+' || ch == '-' || ch == '*' || ch == '/' || ch == '%')
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isOperator>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x2b,%eax
je     114b <isOperator+0x4b>
movsbl -0x5(%rbp),%eax
cmp    $0x2d,%eax
je     114b <isOperator+0x4b>
movsbl -0x5(%rbp),%eax
cmp    $0x2a,%eax
je     114b <isOperator+0x4b>
movsbl -0x5(%rbp),%eax
cmp    $0x2f,%eax
je     114b <isOperator+0x4b>
movsbl -0x5(%rbp),%eax
cmp    $0x25,%eax
jne    1157 <isOperator+0x57>
movl   $0x1,-0x4(%rbp)
jmp    115e <isOperator+0x5e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isOperator>:
add    $0xdb,%dil
xor    %eax,%eax
cmp    $0xa,%dil
ja     111a <isOperator+0x1a>
movsbq %dil,%rax
lea    0xee9(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @isOperator(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 eq i32 %5, 43
br i1 %6, label %23, label %7
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 45
br i1 %10, label %23, label %11
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 42
br i1 %14, label %23, label %15
15: ; preds = %11
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 47
br i1 %18, label %23, label %19
19: ; preds = %15
%20 = load i8, i8* %3
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %21, 37
br i1 %22, label %23, label %24
23: ; preds = %19, %15, %11, %7, %1
store i32 1, i32* %2
br label %25
24: ; preds = %19
store i32 0, i32* %2
br label %25
25: ; preds = %24, %23
%26 = load i32, i32* %2
ret i32 %26
}

LLVM IR (-O2):
@switch.table.isOperator = [11 x i32] [i32 1, i32 0, i32 0, i32 0, i32 0, i32 1, i32 1, i32 0, i32 1, i32 0, i32 1]
define i32 @isOperator(i8 signext %0) {
%2 = add i8 %0, -37
%3 = icmp ult i8 %2, 11
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i8 %2 to i64
%6 = getelementptr inbounds [11 x i32], [11 x i32]* @switch.table.isOperator, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ 0, %1 ]
ret i32 %9
}
void glmGenerateReverseVector3d(double result[3], const double v[3]) {
  result[0] = -v[0];
  result[1] = -v[1];
  result[2] = -v[2];
}


x86 assembly (clang, -O0):
<glmGenerateReverseVector3d>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x10(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmGenerateReverseVector3d>:
movsd  (%rsi),%xmm0
movaps 0xef5(%rip),%xmm1
xorps  %xmm1,%xmm0
movlps %xmm0,(%rdi)
movsd  0x8(%rsi),%xmm0
xorps  %xmm1,%xmm0
movlps %xmm0,0x8(%rdi)
movsd  0x10(%rsi),%xmm0
xorps  %xmm1,%xmm0
movlps %xmm0,0x10(%rdi)
ret

LLVM IR (-O0):
define void @glmGenerateReverseVector3d(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %4
%6 = getelementptr inbounds double, double* %5, i64 0
%7 = load double, double* %6
%8 = fneg double %7
%9 = load double*, double** %3
%10 = getelementptr inbounds double, double* %9, i64 0
store double %8, double* %10
%11 = load double*, double** %4
%12 = getelementptr inbounds double, double* %11, i64 1
%13 = load double, double* %12
%14 = fneg double %13
%15 = load double*, double** %3
%16 = getelementptr inbounds double, double* %15, i64 1
store double %14, double* %16
%17 = load double*, double** %4
%18 = getelementptr inbounds double, double* %17, i64 2
%19 = load double, double* %18
%20 = fneg double %19
%21 = load double*, double** %3
%22 = getelementptr inbounds double, double* %21, i64 2
store double %20, double* %22
ret void
}

LLVM IR (-O2):
define void @glmGenerateReverseVector3d(double* nocapture writeonly %0, double* nocapture %1) {
%3 = load double, double* %1
%4 = fneg double %3
store double %4, double* %0
%5 = getelementptr inbounds double, double* %1, i64 1
%6 = load double, double* %5
%7 = fneg double %6
%8 = getelementptr inbounds double, double* %0, i64 1
store double %7, double* %8
%9 = getelementptr inbounds double, double* %1, i64 2
%10 = load double, double* %9
%11 = fneg double %10
%12 = getelementptr inbounds double, double* %0, i64 2
store double %11, double* %12
ret void
}
/* Type definitions */
struct SortedArray {
  int dummy;
};

/* Variables and functions */
int SortedArray_binarySearch(struct SortedArray const *, void const *,
                             int /*<<< orphan*/, scalar_t__);
scalar_t__ SortedArray_length(struct SortedArray const *);
int SortedArray_contains(const struct SortedArray *this, const void *item) {
  return SortedArray_binarySearch(this, item, 0, SortedArray_length(this) - 1) >
         -1;
}


x86 assembly (clang, -O0):
<SortedArray_contains>:
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    -0x8(%rbp),%rdi
call   1040 <SortedArray_length@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %rax,%rcx
sub    $0x1,%rcx
xor    %edx,%edx
call   1030 <SortedArray_binarySearch@plt>
cmp    $0xffffffff,%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SortedArray_contains>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <SortedArray_length@plt>
lea    -0x1(%rax),%rcx
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %edx,%edx
call   1030 <SortedArray_binarySearch@plt>
not    %eax
shr    $0x1f,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.SortedArray = type { i32 }
define i32 @SortedArray_contains(%struct.SortedArray* %0, i8* %1) {
%3 = alloca %struct.SortedArray*
%4 = alloca i8*
store %struct.SortedArray* %0, %struct.SortedArray** %3
store i8* %1, i8** %4
%5 = load %struct.SortedArray*, %struct.SortedArray** %3
%6 = load i8*, i8** %4
%7 = load %struct.SortedArray*, %struct.SortedArray** %3
%8 = call i64 @SortedArray_length(%struct.SortedArray* %7)
%9 = sub nsw i64 %8, 1
%10 = call i32 @SortedArray_binarySearch(%struct.SortedArray* %5, i8* %6, i32 0, i64 %9)
%11 = icmp sgt i32 %10, -1
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
%struct.SortedArray = type { i32 }
define i32 @SortedArray_contains(%struct.SortedArray* %0, i8* %1) {
%3 = tail call i64 @SortedArray_length(%struct.SortedArray* %0)
%4 = add nsw i64 %3, -1
%5 = tail call i32 @SortedArray_binarySearch(%struct.SortedArray* %0, i8* %1, i32 0, i64 %4)
%6 = xor i32 %5, -1
%7 = lshr i32 %6, 31
ret i32 %7
}
void reset() {}


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

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

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

LLVM IR (-O2):
define void @reset() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ munmap(void *, int);
void sys_free(void *ptr, int size) { munmap(ptr, size); }


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

x86 assembly (clang, -O2):
<sys_free>:
jmp    1030 <munmap@plt>

LLVM IR (-O0):
define void @sys_free(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @munmap(i8* %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @sys_free(i8* %0, i32 %1) {
%3 = tail call i32 @munmap(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int pow(unsigned char, int);
unsigned char gamma_correct(unsigned char color) {
  int corrected = pow(color, 3) / (255 * 255);
  return (unsigned char)corrected;
}


x86 assembly (clang, -O0):
<gamma_correct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x3,%esi
movzbl -0x1(%rbp),%edi
call   1030 <pow@plt>
mov    $0xfe01,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gamma_correct>:
push   %rax
mov    $0x3,%esi
call   1030 <pow@plt>
cltq
imul   $0xffffffff81018203,%rax,%rcx
shr    $0x20,%rcx
add    %ecx,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
shr    $0xf,%eax
add    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i8 @gamma_correct(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = call i32 @pow(i8 zeroext %4, i32 3)
%6 = sdiv i32 %5, 65025
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = trunc i32 %7 to i8
ret i8 %8
}

LLVM IR (-O2):
define zeroext i8 @gamma_correct(i8 zeroext %0) {
%2 = tail call i32 @pow(i8 zeroext %0, i32 3)
%3 = sdiv i32 %2, 65025
%4 = trunc i32 %3 to i8
ret i8 %4
}
/* Variables and functions */
void initNullArr(char *arr[], int size) {
  for (int i = 0; i < size; ++i) {
    arr[i] = NULL;
  }
}


x86 assembly (clang, -O0):
<initNullArr>:
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    113c <initNullArr+0x3c>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movq   $0x0,(%rax,%rcx,8)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <initNullArr+0x12>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @initNullArr(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 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 i8**, i8*** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8*, i8** %11, i64 %13
store i8* null, i8** %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 @initNullArr(i8** nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = bitcast i8** %0 to i8*
%6 = zext i32 %1 to i64
%7 = shl nuw nsw i64 %6, 3
br label %8
8: ; preds = %4, %2
ret void
}
/* Variables and functions */
int getparx(int /*<<< orphan*/);
int /*<<< orphan*/ stdscr;
int t_getparx() { return getparx(stdscr); }


x86 assembly (clang, -O0):
<t_getparx>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <getparx@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_getparx>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <getparx@plt>

LLVM IR (-O0):
@stdscr = global i32 0
define i32 @t_getparx() {
%1 = load i32, i32* @stdscr
%2 = call i32 @getparx(i32 %1)
ret i32 %2
}

LLVM IR (-O2):
@stdscr = global i32 0
define i32 @t_getparx() {
%1 = load i32, i32* @stdscr
%2 = tail call i32 @getparx(i32 %1)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ GLint;
typedef int /*<<< orphan*/ GLenum;

/* Variables and functions */
int /*<<< orphan*/ glGetIntegerv(int /*<<< orphan*/, int /*<<< orphan*/ *);
void GetIntegerv(GLenum pname, GLint *params) { glGetIntegerv(pname, params); }


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

x86 assembly (clang, -O2):
<GetIntegerv>:
jmp    1030 <glGetIntegerv@plt>

LLVM IR (-O0):
define void @GetIntegerv(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 @glGetIntegerv(i32 %5, i32* %6)
ret void
}

LLVM IR (-O2):
define void @GetIntegerv(i32 %0, i32* %1) {
%3 = tail call i32 @glGetIntegerv(i32 %0, i32* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ is_addressable(int, int);
int main(int argc, char **argv) {
  is_addressable(0x0, 1);
  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)
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <is_addressable@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <is_addressable@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 @is_addressable(i32 0, i32 1)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @is_addressable(i32 0, i32 1)
ret i32 0
}
int cas(volatile int *addr, int expected, int newval) {
  unsigned char result;
  asm volatile("lock; cmpxchg %3, %1\n"
               "sete %b0\n"
               : "=r"(result), "+m"(*addr), "+a"(expected)
               : "r"(newval)
               : "memory", "cc");
  return result;
}


x86 assembly (clang, -O0):
<cas>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%edx
lock cmpxchg %edx,(%rcx)
sete   %cl
mov    %cl,-0x11(%rbp)
mov    %eax,-0xc(%rbp)
movzbl -0x11(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cas>:
mov    %esi,%eax
lock cmpxchg %edx,(%rdi)
sete   %cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @cas(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32*, i32** %4
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = call { i8, i32 } asm sideeffect "lock; cmpxchg $3, $1\0Asete ${0:b}\0A", "=r,=*m,={ax},r,*m,2,~{memory},~{cc},~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %8, i32 %10, i32* elementtype(i32) %8, i32 %9)
%12 = extractvalue { i8, i32 } %11, 0
%13 = extractvalue { i8, i32 } %11, 1
store i8 %12, i8* %7
store i32 %13, i32* %5
%14 = load i8, i8* %7
%15 = zext i8 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
define i32 @cas(i32* %0, i32 %1, i32 %2) {
%4 = tail call { i8, i32 } asm sideeffect "lock; cmpxchg $3, $1\0Asete ${0:b}\0A", "=r,=*m,={ax},r,*m,2,~{memory},~{cc},~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %0, i32 %2, i32* elementtype(i32) %0, i32 %1)
%5 = extractvalue { i8, i32 } %4, 0
%6 = zext i8 %5 to i32
ret i32 %6
}
void io_wait() { __asm__ volatile("outb %%al, $0x80" : : "a"(0)); }


x86 assembly (clang, -O0):
<io_wait>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
out    %al,$0x80
pop    %rbp
ret

x86 assembly (clang, -O2):
<io_wait>:
xor    %eax,%eax
out    %al,$0x80
ret

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

LLVM IR (-O2):
define void @io_wait() {
tail call void asm sideeffect "outb %al, $$0x80", "{ax},~{dirflag},~{fpsr},~{flags}"(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strlcpy(char *, char *, int);
int main(void) {
  char dst[10];
  strlcpy(dst, "hello", 10);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xee5(%rip),%rsi
lea    0xe(%rsp),%rdi
mov    $0xa,%edx
call   1030 <strlcpy@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"hello\00"
define i32 @main() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = call i32 @strlcpy(i8* %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 10)
ret i32 0
}
void tabto(void) {}


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

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

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

LLVM IR (-O2):
define void @tabto() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int i;
  if (!(i < 10 && i > -10))
    return 0;
  while (i * i < 100) {
    i = i + 1;
  }
  assert(i == 10);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1133 <main+0x23>
cmpl   $0xfffffff6,-0x8(%rbp)
jg     113f <main+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    117a <main+0x6a>
jmp    1144 <main+0x34>
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
cmp    $0x64,%eax
jge    1162 <main+0x52>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1144 <main+0x34>
cmpl   $0xa,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
void free(void *);
void lwm2m_free(void *p) { return free(p); }


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

x86 assembly (clang, -O2):
<lwm2m_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @lwm2m_free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
ret void
}

LLVM IR (-O2):
define void @lwm2m_free(i8* nocapture %0) {
tail call void @free(i8* %0)
ret void
}
int WITH_symlink() { return 1; }


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

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

LLVM IR (-O0):
define i32 @WITH_symlink() {
ret i32 1
}

LLVM IR (-O2):
define i32 @WITH_symlink() {
ret i32 1
}
int isend(char c) { return '\0' == c ? 1 : 0; }


x86 assembly (clang, -O0):
<isend>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %edx,%eax
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isend>:
xor    %eax,%eax
test   %dil,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @isend(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 0, %4
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 1, i32 0
ret i32 %7
}

LLVM IR (-O2):
define i32 @isend(i8 signext %0) {
%2 = icmp eq i8 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}