xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ uint;

/* Variables and functions */
int *fillArrayI_rand(int /*<<< orphan*/, int /*<<< orphan*/, int, int);
int /*<<< orphan*/ newArrayI_uninit(int /*<<< orphan*/);
int *newArrayI_rand(uint sz, int lo, int hi) {
  return fillArrayI_rand(newArrayI_uninit(sz), sz, lo, hi);
}


x86 assembly (clang, -O0):
<newArrayI_rand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <newArrayI_uninit@plt>
mov    %eax,%edi
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
call   1030 <fillArrayI_rand@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<newArrayI_rand>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
call   1040 <newArrayI_uninit@plt>
mov    %eax,%edi
mov    %ebx,%esi
mov    %ebp,%edx
mov    %r14d,%ecx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <fillArrayI_rand@plt>

LLVM IR (-O0):
define i32* @newArrayI_rand(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = call i32 @newArrayI_uninit(i32 %7)
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = call i32* @fillArrayI_rand(i32 %8, i32 %9, i32 %10, i32 %11)
ret i32* %12
}

LLVM IR (-O2):
define i32* @newArrayI_rand(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @newArrayI_uninit(i32 %0)
%5 = tail call i32* @fillArrayI_rand(i32 %4, i32 %0, i32 %1, i32 %2)
ret i32* %5
}
/* Variables and functions */
double __nv_remainder(double, double);
double remainder(double __a, double __b) { return __nv_remainder(__a, __b); }


x86 assembly (clang, -O0):
<remainder>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <__nv_remainder@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remainder>:
jmp    1030 <__nv_remainder@plt>

LLVM IR (-O0):
define double @remainder(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 = load double, double* %4
%7 = call double @__nv_remainder(double %5, double %6)
ret double %7
}

LLVM IR (-O2):
define double @remainder(double %0, double %1) {
%3 = tail call double @__nv_remainder(double %0, double %1)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("hahaaha	asdfasdf	3433r\n");
  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 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"hahaaha\09asdfasdf\093433r\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [23 x i8] c"hahaaha\09asdfasdf\093433r\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void end_prog(void *data) {
  int *end_ptr = (int *)data;
  *end_ptr = 1;
}


x86 assembly (clang, -O0):
<end_prog>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<end_prog>:
movl   $0x1,(%rdi)
ret

LLVM IR (-O0):
define void @end_prog(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
store i32 1, i32* %6
ret void
}

LLVM IR (-O2):
define void @end_prog(i8* nocapture writeonly %0) {
%2 = bitcast i8* %0 to i32*
store i32 1, i32* %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ tmp;
typedef int /*<<< orphan*/ int32_t;
typedef scalar_t__ caddr_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, scalar_t__, int);
int32_t ptr_ret_int32_t(void *arg1, int offset) {
  int32_t tmp;
  memcpy(&tmp, (caddr_t)arg1 + offset, sizeof(tmp));
  return tmp;
}


x86 assembly (clang, -O0):
<ptr_ret_int32_t>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
movslq -0xc(%rbp),%rax
add    %rax,%rsi
lea    -0x10(%rbp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ptr_ret_int32_t>:
push   %rax
movslq %esi,%rsi
add    %rdi,%rsi
lea    0x4(%rsp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ptr_ret_int32_t(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = ptrtoint i8* %6 to i64
%8 = load i32, i32* %4
%9 = sext i32 %8 to i64
%10 = add nsw i64 %7, %9
%11 = call i32 @memcpy(i32* %5, i64 %10, i32 4)
%12 = load i32, i32* %5
ret i32 %12
}

LLVM IR (-O2):
define i32 @ptr_ret_int32_t(i8* %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = ptrtoint i8* %0 to i64
%6 = sext i32 %1 to i64
%7 = add nsw i64 %6, %5
%8 = call i32 @memcpy(i32* %3, i64 %7, i32 4)
%9 = load i32, i32* %3
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ fibonacciInc(int, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int lim = 0;
  printf("\nEnter limit: ");
  scanf("%d", &lim);
  fibonacciInc(lim, 0, 1);
  printf("\n\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xeb3(%rip),%rdi
call   1040 <printf@plt>
lea    0xeb6(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
xor    %esi,%esi
mov    $0x1,%edx
call   1030 <fibonacciInc@plt>
lea    0xe9a(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xeb0(%rip),%rdi
call   1050 <printf@plt>
lea    0xeb3(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
mov    0x4(%rsp),%edi
xor    %esi,%esi
mov    $0x1,%edx
call   1030 <fibonacciInc@plt>
lea    0xe95(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [15 x i8] c"\0AEnter limit: \00"
@.str.1 = [3 x i8] c"%d\00"
@str = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @fibonacciInc(i32 %5, i32 0, i32 1)
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void ioctl_exit(void) {}


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

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

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

LLVM IR (-O2):
define void @ioctl_exit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strip_special_char();
int /*<<< orphan*/ wywiwyg();
int main() {
  wywiwyg();
  strip_special_char();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @wywiwyg()
%3 = call i32 (...) @strip_special_char()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @wywiwyg()
%2 = tail call i32 (...) @strip_special_char()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ light_update();
void com_update_callback(void) { light_update(); }


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

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

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

LLVM IR (-O2):
define void @com_update_callback() {
%1 = tail call i32 (...) @light_update()
ret void
}
long func_ref(long from) {
  long i, j;
  for (i = 1L; j; ++i) {
    for (j = from; j > 0L; --j)
      if (i % j)
        break;
  }
  return --i;
}


x86 assembly (clang, -O0):
<func_ref>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1,-0x10(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1173 <func_ref+0x73>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jle    115d <func_ref+0x5d>
mov    -0x10(%rbp),%rax
cqto
idivq  -0x18(%rbp)
cmp    $0x0,%rdx
je     1147 <func_ref+0x47>
jmp    115d <func_ref+0x5d>
jmp    114c <func_ref+0x4c>
mov    -0x18(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
jmp    1123 <func_ref+0x23>
jmp    1162 <func_ref+0x62>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <func_ref+0x10>
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<func_ref>:
mov    $0x1,%eax
jmp    1119 <func_ref+0x19>
nopw   0x0(%rax,%rax,1)
lea    0x1(%rcx),%rax
test   %rsi,%rsi
je     1168 <func_ref+0x68>
mov    %rax,%rcx
mov    %rdi,%rsi
test   %rdi,%rdi
jle    1110 <func_ref+0x10>
mov    %rdi,%rsi
nopw   0x0(%rax,%rax,1)
mov    %rcx,%rax
or     %rsi,%rax
shr    $0x20,%rax
je     1150 <func_ref+0x50>
mov    %rcx,%rax
cqto
idiv   %rsi
test   %rdx,%rdx
je     115b <func_ref+0x5b>
jmp    1110 <func_ref+0x10>
nopl   0x0(%rax,%rax,1)
mov    %ecx,%eax
xor    %edx,%edx
div    %esi
test   %rdx,%rdx
jne    1110 <func_ref+0x10>
lea    -0x1(%rsi),%rax
cmp    $0x1,%rsi
mov    %rax,%rsi
jg     1130 <func_ref+0x30>
mov    %rcx,%rax
ret

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

LLVM IR (-O2):
define i64 @func_ref(i64 %0) {
%2 = icmp sgt i64 %0, 0
br label %3
3: ; preds = %1, %12
%4 = phi i64 [ 1, %1 ], [ %14, %12 ]
br i1 %2, label %5, label %12
5: ; preds = %3, %9
%6 = phi i64 [ %10, %9 ], [ %0, %3 ]
%7 = srem i64 %4, %6
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %5
%10 = add nsw i64 %6, -1
%11 = icmp sgt i64 %6, 1
br i1 %11, label %5, label %16
12: ; preds = %5, %3
%13 = phi i64 [ %0, %3 ], [ %6, %5 ]
%14 = add nuw nsw i64 %4, 1
%15 = icmp eq i64 %13, 0
br i1 %15, label %16, label %3
16: ; preds = %12, %9
ret i64 %4
}
unsigned dcache_get_size(unsigned config) {
  unsigned sz = (config >> 18) & 0xF;
  if (sz == 0) {
    return 0;
  }
  return 0x200 << sz;
}


x86 assembly (clang, -O0):
<dcache_get_size>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shr    $0x12,%eax
and    $0xf,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1129 <dcache_get_size+0x29>
movl   $0x0,-0x4(%rbp)
jmp    1136 <dcache_get_size+0x36>
mov    -0xc(%rbp),%ecx
mov    $0x200,%eax
shl    %cl,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dcache_get_size>:
mov    %edi,%ecx
shr    $0x12,%ecx
and    $0xf,%ecx
mov    $0x200,%eax
shl    %cl,%eax
test   %ecx,%ecx
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @dcache_get_size(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = lshr i32 %5, 18
%7 = and i32 %6, 15
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %1
store i32 0, i32* %2
br label %14
11: ; preds = %1
%12 = load i32, i32* %4
%13 = shl i32 512, %12
store i32 %13, i32* %2
br label %14
14: ; preds = %11, %10
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @dcache_get_size(i32 %0) {
%2 = lshr i32 %0, 18
%3 = and i32 %2, 15
%4 = icmp eq i32 %3, 0
%5 = shl nuw nsw i32 512, %3
%6 = select i1 %4, i32 0, i32 %5
ret i32 %6
}
int IsWhiteSpace(c)
char c;
{ return ((c == ' ') || (c == '\t') || (c == '\n')); }


x86 assembly (clang, -O0):
<IsWhiteSpace>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x2(%rbp)
je     113b <IsWhiteSpace+0x3b>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x9,%ecx
mov    %al,-0x2(%rbp)
je     113b <IsWhiteSpace+0x3b>
movsbl -0x1(%rbp),%eax
cmp    $0xa,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsWhiteSpace>:
shl    $0x18,%edi
mov    $0x1,%eax
cmp    $0x9000000,%edi
je     1118 <IsWhiteSpace+0x18>
cmp    $0x20000000,%edi
jne    1119 <IsWhiteSpace+0x19>
ret
xor    %eax,%eax
cmp    $0xa000000,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @IsWhiteSpace(i32 %0) {
%2 = alloca i8
%3 = trunc i32 %0 to i8
store i8 %3, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 32
br i1 %6, label %15, label %7
7: ; preds = %1
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 9
br i1 %10, label %15, label %11
11: ; preds = %7
%12 = load i8, i8* %2
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 10
br label %15
15: ; preds = %11, %7, %1
%16 = phi i1 [ true, %7 ], [ true, %1 ], [ %14, %11 ]
%17 = zext i1 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
define i32 @IsWhiteSpace(i32 %0) {
%2 = shl i32 %0, 24
switch i32 %2, label %3 [
i32 536870912, label %6
i32 150994944, label %6
]
3: ; preds = %1
%4 = icmp eq i32 %2, 167772160
%5 = zext i1 %4 to i32
br label %6
6: ; preds = %1, %1, %3
%7 = phi i32 [ 1, %1 ], [ %5, %3 ], [ 1, %1 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ sem_post(int *, int /*<<< orphan*/);
void sem_mutex_post(int *semid) { sem_post(semid, 0); }


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

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

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

LLVM IR (-O2):
define void @sem_mutex_post(i32* %0) {
%2 = tail call i32 @sem_post(i32* %0, i32 0)
ret void
}
/* Variables and functions */
int mainskel(int, char **, int);
int main(int argc, char *argv[]) { return mainskel(argc, argv, 1); }


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    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x1,%edx
call   1030 <mainskel@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x1,%edx
jmp    1030 <mainskel@plt>

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 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @mainskel(i32 %6, i8** %7, i32 1)
ret i32 %8
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @mainskel(i32 %0, i8** %1, i32 1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ con_gotoXY(int, int);
int /*<<< orphan*/ con_outTxt(char *, int);
int /*<<< orphan*/ con_setColor(int);
void con_charAt(int ch, int color, int x, int y) {
  con_gotoXY(x, y);
  con_setColor(color);
  con_outTxt("%c", ch);
}


x86 assembly (clang, -O0):
<con_charAt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1050 <con_gotoXY@plt>
mov    -0x8(%rbp),%edi
call   1040 <con_setColor@plt>
mov    -0x4(%rbp),%esi
lea    0xe9f(%rip),%rdi
call   1030 <con_outTxt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<con_charAt>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    %edx,%edi
mov    %ecx,%esi
call   1050 <con_gotoXY@plt>
mov    %ebx,%edi
call   1040 <con_setColor@plt>
lea    0xeb2(%rip),%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <con_outTxt@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define void @con_charAt(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %7
%10 = load i32, i32* %8
%11 = call i32 @con_gotoXY(i32 %9, i32 %10)
%12 = load i32, i32* %6
%13 = call i32 @con_setColor(i32 %12)
%14 = load i32, i32* %5
%15 = call i32 @con_outTxt(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %14)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @con_charAt(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @con_gotoXY(i32 %2, i32 %3)
%6 = tail call i32 @con_setColor(i32 %1)
%7 = tail call i32 @con_outTxt(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
fillchar(src, length, ch) register char *src, ch;
register int length;
{
  while (--length >= 0)
    *(src++) = ch;
}


x86 assembly (clang, -O0):
<fillchar>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %al,-0x15(%rbp)
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jl     113b <fillchar+0x3b>
mov    -0x15(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,(%rax)
jmp    1110 <fillchar+0x10>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fillchar>:
test   %esi,%esi
jle    1125 <fillchar+0x15>
push   %rax
mov    %esi,%eax
mov    %edx,%esi
mov    %rax,%rdx
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define i32 @fillchar(i8* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %8
5: ; preds = %3
%6 = trunc i32 %2 to i8
%7 = zext i32 %1 to i64
br label %8
8: ; preds = %5, %3
ret i32 undef
}
/* Variables and functions */
void *realloc(void *, size_t);
int /*<<< orphan*/ sysdie(char *, unsigned long, char const *, int);
void *x_realloc(void *p, size_t size, const char *file, int line) {
  p = realloc(p, size);
  if (p == NULL)
    sysdie("failed to realloc %lu bytes at %s line %d", (unsigned long)size,
           file, line);
  return p;
}


x86 assembly (clang, -O0):
<x_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    116a <x_realloc+0x4a>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
lea    0xe9b(%rip),%rdi
call   1030 <sysdie@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x_realloc>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %rdx,%r15
mov    %rsi,%rbp
call   1040 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1152 <x_realloc+0x32>
lea    0xebc(%rip),%rdi
mov    %rbp,%rsi
mov    %r15,%rdx
mov    %r14d,%ecx
call   1030 <sysdie@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [42 x i8] c"failed to realloc %lu bytes at %s line %d\00"
define i8* @x_realloc(i8* %0, i64 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = call i8* @realloc(i8* %9, i64 %10)
store i8* %11, i8** %5
%12 = load i8*, i8** %5
%13 = icmp eq i8* %12, null
br i1 %13, label %14, label %19
14: ; preds = %4
%15 = load i64, i64* %6
%16 = load i8*, i8** %7
%17 = load i32, i32* %8
%18 = call i32 @sysdie(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i64 %15, i8* %16, i32 %17)
br label %19
19: ; preds = %14, %4
%20 = load i8*, i8** %5
ret i8* %20
}

LLVM IR (-O2):
@.str = [42 x i8] c"failed to realloc %lu bytes at %s line %d\00"
define noalias i8* @x_realloc(i8* nocapture %0, i64 %1, i8* %2, i32 %3) {
%5 = tail call i8* @realloc(i8* %0, i64 %1)
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i32 @sysdie(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i64 %1, i8* %2, i32 %3)
br label %9
9: ; preds = %7, %4
ret i8* %5
}
void NEOMOTE_1_isr_RX_RTSn_Interrupt(void) {}


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

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

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

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

/* Variables and functions */
int nios_32x32_masked_read(struct bladerf *, int, int, int /*<<< orphan*/ *);
int nios_expansion_gpio_dir_read(struct bladerf *dev, uint32_t *val) {
  int status = nios_32x32_masked_read(dev, 0x01, 0xffffffff, val);
  if (status == 0) {
    do {
      do {
      } while (0);
    } while (0);
  }
  return status;
}


x86 assembly (clang, -O0):
<nios_expansion_gpio_dir_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x1,%esi
mov    $0xffffffff,%edx
call   1030 <nios_32x32_masked_read@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    115d <nios_expansion_gpio_dir_read+0x4d>
jmp    1149 <nios_expansion_gpio_dir_read+0x39>
jmp    114e <nios_expansion_gpio_dir_read+0x3e>
jmp    1153 <nios_expansion_gpio_dir_read+0x43>
jmp    1158 <nios_expansion_gpio_dir_read+0x48>
jmp    115d <nios_expansion_gpio_dir_read+0x4d>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nios_expansion_gpio_dir_read>:
mov    %rsi,%rcx
mov    $0x1,%esi
mov    $0xffffffff,%edx
jmp    1030 <nios_32x32_masked_read@plt>

LLVM IR (-O0):
%struct.bladerf = type { i32 }
define i32 @nios_expansion_gpio_dir_read(%struct.bladerf* %0, i32* %1) {
%3 = alloca %struct.bladerf*
%4 = alloca i32*
%5 = alloca i32
store %struct.bladerf* %0, %struct.bladerf** %3
store i32* %1, i32** %4
%6 = load %struct.bladerf*, %struct.bladerf** %3
%7 = load i32*, i32** %4
%8 = call i32 @nios_32x32_masked_read(%struct.bladerf* %6, i32 1, i32 -1, i32* %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %2
br label %12
12: ; preds = %11
br label %13
13: ; preds = %12
br label %14
14: ; preds = %13
br label %15
15: ; preds = %14
br label %16
16: ; preds = %15, %2
%17 = load i32, i32* %5
ret i32 %17
}

LLVM IR (-O2):
%struct.bladerf = type { i32 }
define i32 @nios_expansion_gpio_dir_read(%struct.bladerf* %0, i32* %1) {
%3 = tail call i32 @nios_32x32_masked_read(%struct.bladerf* %0, i32 1, i32 -1, i32* %1)
ret i32 %3
}
void call2b(float f1, short s, double d1, int i, float f2, long l, double d2,
            char c) {
  c = 'a';
  f1 = 0.0;
  s = 5;
  d1 = 0.0;
  i = 6;
  f2 = 0.1;
  l = 7;
  d2 = 0.2;
}


x86 assembly (clang, -O0):
<call2b>:
push   %rbp
mov    %rsp,%rbp
mov    %cl,%al
mov    %di,%cx
movss  %xmm0,-0x4(%rbp)
mov    %cx,-0x6(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movss  %xmm2,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
movsd  %xmm3,-0x28(%rbp)
mov    %al,-0x29(%rbp)
movb   $0x61,-0x29(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movw   $0x5,-0x6(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movl   $0x6,-0x14(%rbp)
movss  0xeb4(%rip),%xmm0
movss  %xmm0,-0x18(%rbp)
movq   $0x7,-0x20(%rbp)
movsd  0xe97(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @call2b(float %0, i16 signext %1, double %2, i32 %3, float %4, i64 %5, double %6, i8 signext %7) {
%9 = alloca float
%10 = alloca i16
%11 = alloca double
%12 = alloca i32
%13 = alloca float
%14 = alloca i64
%15 = alloca double
%16 = alloca i8
store float %0, float* %9
store i16 %1, i16* %10
store double %2, double* %11
store i32 %3, i32* %12
store float %4, float* %13
store i64 %5, i64* %14
store double %6, double* %15
store i8 %7, i8* %16
store i8 97, i8* %16
store float 0.000000e+00, float* %9
store i16 5, i16* %10
store double 0.000000e+00, double* %11
store i32 6, i32* %12
store float 0x3FB99999A0000000, float* %13
store i64 7, i64* %14
store double 2.000000e-01, double* %15
ret void
}

LLVM IR (-O2):
define void @call2b(float %0, i16 signext %1, double %2, i32 %3, float %4, i64 %5, double %6, i8 signext %7) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage: symbols [--all-symbols] [--symbol-prefix=<prefix "
                  "char>] < in.map > out.S\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [81 x i8] c"Usage: symbols [--all-symbols] [--symbol-prefix=<prefix char>] < in.map > out.S\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [81 x i8] c"Usage: symbols [--all-symbols] [--symbol-prefix=<prefix char>] < in.map > out.S\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int alu_tgt(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ op_pop();
int op_tgt() { return alu_tgt(op_pop(), op_pop()); }


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

x86 assembly (clang, -O2):
<op_tgt>:
push   %rbx
xor    %eax,%eax
call   1040 <op_pop@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <op_pop@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1030 <alu_tgt@plt>

LLVM IR (-O0):
define i32 @op_tgt() {
%1 = call i32 (...) @op_pop()
%2 = call i32 (...) @op_pop()
%3 = call i32 @alu_tgt(i32 %1, i32 %2)
ret i32 %3
}

LLVM IR (-O2):
define i32 @op_tgt() {
%1 = tail call i32 (...) @op_pop()
%2 = tail call i32 (...) @op_pop()
%3 = tail call i32 @alu_tgt(i32 %1, i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ _hmt_register_covercase(char *, char *);
void _hmt_covercase_HMM_Slerp_init(void) {
  _hmt_register_covercase("HMM_Slerp", "1");
}


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

x86 assembly (clang, -O2):
<_hmt_covercase_HMM_Slerp_init>:
lea    0xee9(%rip),%rdi
lea    0xeec(%rip),%rsi
jmp    1030 <_hmt_register_covercase@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"HMM_Slerp\00"
@.str.1 = [2 x i8] c"1\00"
define void @_hmt_covercase_HMM_Slerp_init() {
%1 = call i32 @_hmt_register_covercase(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"HMM_Slerp\00"
@.str.1 = [2 x i8] c"1\00"
define void @_hmt_covercase_HMM_Slerp_init() {
%1 = tail call i32 @_hmt_register_covercase(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void scoped(int *pvar) { printf("variable (%d) goes out of scope\n", *pvar); }


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

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

LLVM IR (-O0):
@.str = [33 x i8] c"variable (%d) goes out of scope\0A\00"
define void @scoped(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"variable (%d) goes out of scope\0A\00"
define void @scoped(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
/* Variables and functions */
int f358(int *);
int f359(int *p) { return f358(p); }


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

x86 assembly (clang, -O2):
<f359>:
jmp    1030 <f358@plt>

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

LLVM IR (-O2):
define i32 @f359(i32* %0) {
%2 = tail call i32 @f358(i32* %0)
ret i32 %2
}
int kacharf(char kelime[]) {
  int i;
  for (i = 0; kelime[i] != '\0'; ++i)
    ;
  return i;
}


x86 assembly (clang, -O0):
<kacharf>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1137 <kacharf+0x37>
jmp    1129 <kacharf+0x29>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <kacharf+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<kacharf>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <kacharf+0x10>
ret

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

LLVM IR (-O2):
define i32 @kacharf(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
void ARGBColorMatrixRow_C() {}


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

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

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

LLVM IR (-O2):
define void @ARGBColorMatrixRow_C() {
ret void
}
/* Variables and functions */
size_t TF_align16(size_t i) { return (i + 0xF) & ~0xF; }


x86 assembly (clang, -O0):
<TF_align16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<TF_align16>:
lea    0xf(%rdi),%rax
and    $0xfffffffffffffff0,%rax
ret

LLVM IR (-O0):
define i64 @TF_align16(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 15
%5 = and i64 %4, -16
ret i64 %5
}

LLVM IR (-O2):
define i64 @TF_align16(i64 %0) {
%2 = add i64 %0, 15
%3 = and i64 %2, -16
ret i64 %3
}
int sqr(x)
int x;
{ return (x * x); }


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

x86 assembly (clang, -O2):
<sqr>:
mov    %edi,%eax
imul   %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @sqr(i32 %0) {
%2 = mul nsw i32 %0, %0
ret i32 %2
}
void foo255(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo255(i32 %0) {
ret void
}
extern void cset_gate_Enter(volatile int *gate, volatile int *pass) {
  asm volatile("jmp cset_gate_Enter_check\n"
               "cset_gate_Enter_wait:\n"
               "pause\n"
               "cset_gate_Enter_check:\n"
               "cmp %[lock], %[pass]\n"
               "jge cset_gate_Enter_skip\n"
               "mov %[lock], %%eax\n"
               "cmp %[gate], %%eax\n"
               "je cset_gate_Enter_wait\n"
               "lock xchg %%eax, %[gate]\n"
               "test %%eax, %%eax\n"
               "jnz cset_gate_Enter_wait\n"
               "cset_gate_Enter_skip:\n"
               "add %[lock], %[pass]\n"
               : [gate] "=m"(*gate), [pass] "=m"(*pass)
               : [lock] "r"(1)
               : "eax");
}


x86 assembly (clang, -O0):
<cset_gate_Enter>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%rdx
mov    $0x1,%esi
jmp    1120 <cset_gate_Enter_check>

x86 assembly (clang, -O2):
<cset_gate_Enter>:
mov    $0x1,%ecx
jmp    1109 <cset_gate_Enter_check>

LLVM IR (-O0):
define void @cset_gate_Enter(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
ret void
}

LLVM IR (-O2):
define void @cset_gate_Enter(i32* %0, i32* %1) {
tail call void asm sideeffect "jmp cset_gate_Enter_check\0Acset_gate_Enter_wait:\0Apause\0Acset_gate_Enter_check:\0Acmp $2, $1\0Ajge cset_gate_Enter_skip\0Amov $2, %eax\0Acmp $0, %eax\0Aje cset_gate_Enter_wait\0Alock xchg %eax, $0\0Atest %eax, %eax\0Ajnz cset_gate_Enter_wait\0Acset_gate_Enter_skip:\0Aadd $2, $1\0A", "=*m,=*m,r,~{eax},~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %0, i32* elementtype(i32) %1, i32 1)
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
int compare_u32(const void *a, const void *b) {
  uint32_t ia;
  uint32_t ib;
  ia = *(uint32_t *)a;
  ib = *(uint32_t *)b;
  if (ia > ib)
    return 1;
  if (ia == ib)
    return 0;
  return -1;
}


x86 assembly (clang, -O0):
<compare_u32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jle    113c <compare_u32+0x3c>
movl   $0x1,-0x4(%rbp)
jmp    115d <compare_u32+0x5d>
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jne    1156 <compare_u32+0x56>
movl   $0x0,-0x4(%rbp)
jmp    115d <compare_u32+0x5d>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_u32>:
mov    (%rdi),%rax
mov    (%rsi),%rcx
xor    %edx,%edx
cmp    %rcx,%rax
setne  %dl
neg    %edx
cmp    %rcx,%rax
mov    $0x1,%eax
cmovle %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @compare_u32(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %5
%7 = icmp sgt i64 %4, %6
%8 = icmp ne i64 %4, %6
%9 = sext i1 %8 to i32
%10 = select i1 %7, i32 1, i32 %9
ret i32 %10
}
void fn0000000000401000() { return; }


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
define void @fn0000000000401000() {
ret void
}
/* Type definitions */
struct RNALfold_args_info {
  int dummy;
};

/* Variables and functions */
int EXIT_SUCCESS;
int RNALfold_cmdline_parser_required(struct RNALfold_args_info *args_info,
                                     const char *prog_name) {
  (void)(args_info);
  (void)(prog_name);
  return EXIT_SUCCESS;
}


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

x86 assembly (clang, -O2):
<RNALfold_cmdline_parser_required>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
%struct.RNALfold_args_info = type { i32 }
@EXIT_SUCCESS = global i32 0
define i32 @RNALfold_cmdline_parser_required(%struct.RNALfold_args_info* %0, i8* %1) {
%3 = alloca %struct.RNALfold_args_info*
%4 = alloca i8*
store %struct.RNALfold_args_info* %0, %struct.RNALfold_args_info** %3
store i8* %1, i8** %4
%5 = load %struct.RNALfold_args_info*, %struct.RNALfold_args_info** %3
%6 = load i8*, i8** %4
%7 = load i32, i32* @EXIT_SUCCESS
ret i32 %7
}

LLVM IR (-O2):
%struct.RNALfold_args_info = type { i32 }
@EXIT_SUCCESS = global i32 0
define i32 @RNALfold_cmdline_parser_required(%struct.RNALfold_args_info* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}
void REMR3Step(void) {}


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

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

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

LLVM IR (-O2):
define void @REMR3Step() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int pthread_mutex_lock(int /*<<< orphan*/ *);
int Thread_lock_mutex(pthread_mutex_t *mutex) {
  int rc = -1;
  rc = pthread_mutex_lock(mutex);
  return rc;
}


x86 assembly (clang, -O0):
<Thread_lock_mutex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0xffffffff,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <pthread_mutex_lock@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Thread_lock_mutex>:
jmp    1030 <pthread_mutex_lock@plt>

LLVM IR (-O0):
define i32 @Thread_lock_mutex(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
store i32 -1, i32* %3
%4 = load i32*, i32** %2
%5 = call i32 @pthread_mutex_lock(i32* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @Thread_lock_mutex(i32* %0) {
%2 = tail call i32 @pthread_mutex_lock(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int s1 = 1;
  int s2 = 1;
  int tmp;
  printf("1\n");
  while (s1 < 10000) {
    printf("%d\n", s1);
    tmp = s1;
    s1 = s2 + s1;
    s2 = tmp;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
lea    0xecc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x2710,-0x8(%rbp)
jge    1173 <main+0x63>
mov    -0x8(%rbp),%esi
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    113b <main+0x2b>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
lea    0xed9(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
lea    0xec4(%rip),%r14
mov    $0x1,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %eax,%ebx
mov    %r14,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
add    %ebx,%ebp
mov    %ebp,%eax
cmp    $0x2710,%ebp
mov    %ebx,%ebp
jl     1150 <main+0x30>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str.1 = [4 x i8] c"%d\0A\00"
@str = [2 x i8] c"1\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
%3 = phi i32 [ 1, %0 ], [ %6, %2 ]
%4 = phi i32 [ 1, %0 ], [ %3, %2 ]
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%6 = add nsw i32 %3, %4
%7 = icmp slt i32 %6, 10000
br i1 %7, label %2, label %8
8: ; preds = %2
ret i32 0
}
int level_to_pers(int level) {
  switch (level) {
  case (-5):
    return 10UL;
  case (-4):
    return 7UL;
  case -3:
    return 6UL;
  case -2:
    return 5UL;
  case (-1):
    return 1UL;
  case 0:
    return 2UL;
  case 1:
    return 3UL;
  case 4:
  case 5:
    return 4UL;
  case 6:
    return 8UL;
  case 10:
    return 9UL;
  }
  return 0UL;
}


x86 assembly (clang, -O0):
<level_to_pers>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x5,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0xf,%eax
ja     11a8 <level_to_pers+0xa8>
mov    -0x10(%rbp),%rax
lea    0xed9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0xa,-0x4(%rbp)
jmp    11af <level_to_pers+0xaf>
movl   $0x7,-0x4(%rbp)
jmp    11af <level_to_pers+0xaf>
movl   $0x6,-0x4(%rbp)
jmp    11af <level_to_pers+0xaf>
movl   $0x5,-0x4(%rbp)
jmp    11af <level_to_pers+0xaf>
movl   $0x1,-0x4(%rbp)
jmp    11af <level_to_pers+0xaf>
movl   $0x2,-0x4(%rbp)
jmp    11af <level_to_pers+0xaf>
movl   $0x3,-0x4(%rbp)
jmp    11af <level_to_pers+0xaf>
movl   $0x4,-0x4(%rbp)
jmp    11af <level_to_pers+0xaf>
movl   $0x8,-0x4(%rbp)
jmp    11af <level_to_pers+0xaf>
movl   $0x9,-0x4(%rbp)
jmp    11af <level_to_pers+0xaf>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<level_to_pers>:
add    $0x5,%edi
xor    %eax,%eax
cmp    $0xf,%edi
ja     1117 <level_to_pers+0x17>
movslq %edi,%rax
lea    0xeec(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @level_to_pers(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %15 [
i32 -5, label %5
i32 -4, label %6
i32 -3, label %7
i32 -2, label %8
i32 -1, label %9
i32 0, label %10
i32 1, label %11
i32 4, label %12
i32 5, label %12
i32 6, label %13
i32 10, label %14
]
5: ; preds = %1
store i32 10, i32* %2
br label %16
6: ; preds = %1
store i32 7, i32* %2
br label %16
7: ; preds = %1
store i32 6, i32* %2
br label %16
8: ; preds = %1
store i32 5, i32* %2
br label %16
9: ; preds = %1
store i32 1, i32* %2
br label %16
10: ; preds = %1
store i32 2, i32* %2
br label %16
11: ; preds = %1
store i32 3, i32* %2
br label %16
12: ; preds = %1, %1
store i32 4, i32* %2
br label %16
13: ; preds = %1
store i32 8, i32* %2
br label %16
14: ; preds = %1
store i32 9, i32* %2
br label %16
15: ; preds = %1
store i32 0, i32* %2
br label %16
16: ; preds = %15, %14, %13, %12, %11, %10, %9, %8, %7, %6, %5
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
@switch.table.level_to_pers = [16 x i32] [i32 10, i32 7, i32 6, i32 5, i32 1, i32 2, i32 3, i32 0, i32 0, i32 4, i32 4, i32 8, i32 0, i32 0, i32 0, i32 9]
define i32 @level_to_pers(i32 %0) {
%2 = add i32 %0, 5
%3 = icmp ult i32 %2, 16
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [16 x i32], [16 x i32]* @switch.table.level_to_pers, 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
}