xunge/DecIR huggingface dataset:
void _dbxfStrNCpy(char *dst, const char *src, int len) {
  char ch;
  while ((--len) > 0) {
    ch = *(dst++) = *(src++);
    if (ch == '\0')
      return;
  }
  *dst = '\0';
}


x86 assembly (clang, -O0):
<_dbxfStrNCpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jle    115d <_dbxfStrNCpy+0x5d>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
mov    %al,-0x15(%rbp)
movsbl -0x15(%rbp),%eax
cmp    $0x0,%eax
jne    1158 <_dbxfStrNCpy+0x58>
jmp    1164 <_dbxfStrNCpy+0x64>
jmp    110f <_dbxfStrNCpy+0xf>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<_dbxfStrNCpy>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmp    $0x2,%edx
jl     1128 <_dbxfStrNCpy+0x28>
add    $0xffffffff,%edx
movzbl (%rsi,%rax,1),%ecx
mov    %cl,(%rdi,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <_dbxfStrNCpy+0x10>
ret
movb   $0x0,(%rdi,%rax,1)
ret

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

LLVM IR (-O2):
define void @_dbxfStrNCpy(i8* nocapture writeonly %0, i8* nocapture %1, i32 %2) {
br label %4
4: ; preds = %9, %3
%5 = phi i8* [ %1, %3 ], [ %11, %9 ]
%6 = phi i32 [ %2, %3 ], [ %10, %9 ]
%7 = phi i8* [ %0, %3 ], [ %13, %9 ]
%8 = icmp sgt i32 %6, 1
br i1 %8, label %9, label %15
9: ; preds = %4
%10 = add nsw i32 %6, -1
%11 = getelementptr inbounds i8, i8* %5, i64 1
%12 = load i8, i8* %5
%13 = getelementptr inbounds i8, i8* %7, i64 1
store i8 %12, i8* %7
%14 = icmp eq i8 %12, 0
br i1 %14, label %16, label %4
15: ; preds = %4
store i8 0, i8* %7
br label %16
16: ; preds = %9, %15
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ task();
int main() {
  printf("Main started\n");
  task();
  printf("Main completed\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <task@plt>
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [14 x i8] c"Main started\0A\00"
@.str.1 = [16 x i8] c"Main completed\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @task()
%3 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [13 x i8] c"Main started\00"
@str.2 = [15 x i8] c"Main completed\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @task()
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
int cleanReal1D(double *vector, int dim) {
  register int i;
  if (dim < 1)
    return 1;
  if (!vector)
    return 2;
  for (i = 0; i < dim; i++)
    vector[i] = 0.0;
  return 0;
}


x86 assembly (clang, -O0):
<cleanReal1D>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x1,-0x14(%rbp)
jge    1121 <cleanReal1D+0x21>
movl   $0x1,-0x4(%rbp)
jmp    1170 <cleanReal1D+0x70>
cmpq   $0x0,-0x10(%rbp)
jne    1138 <cleanReal1D+0x38>
movl   $0x2,-0x4(%rbp)
jmp    1170 <cleanReal1D+0x70>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1169 <cleanReal1D+0x69>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    113f <cleanReal1D+0x3f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cleanReal1D>:
push   %rbx
test   %esi,%esi
jle    112b <cleanReal1D+0x1b>
test   %rdi,%rdi
je     1132 <cleanReal1D+0x22>
mov    %esi,%edx
shl    $0x3,%rdx
xor    %ebx,%ebx
xor    %esi,%esi
call   1030 <memset@plt>
jmp    1137 <cleanReal1D+0x27>
mov    $0x1,%ebx
jmp    1137 <cleanReal1D+0x27>
mov    $0x2,%ebx
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @cleanReal1D(double* writeonly %0, i32 %1) {
%3 = bitcast double* %0 to i8*
%4 = icmp slt i32 %1, 1
br i1 %4, label %10, label %5
5: ; preds = %2
%6 = icmp eq double* %0, null
br i1 %6, label %10, label %7
7: ; preds = %5
%8 = zext i32 %1 to i64
%9 = shl nuw nsw i64 %8, 3
br label %10
10: ; preds = %7, %5, %2
%11 = phi i32 [ 1, %2 ], [ 2, %5 ], [ 0, %7 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ fork();
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello, ");
  fork();
  printf("world!\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"Hello, \00"
@str = [7 x i8] c"world!\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @fork()
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void ARGBUnattenuateRow_Any_SSE2() {}


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

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

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

LLVM IR (-O2):
define void @ARGBUnattenuateRow_Any_SSE2() {
ret void
}
long fun_b(unsigned long x) {
  long val = 0;
  long i;
  for (i = 64; i != 0; i--) {
    val = (val << 1) | (x & 0x1);
    x >>= 1;
  }
  return val;
}


x86 assembly (clang, -O0):
<fun_b>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x40,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1157 <fun_b+0x57>
mov    -0x10(%rbp),%rax
shl    $0x1,%rax
mov    -0x8(%rbp),%rcx
and    $0x1,%rcx
or     %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x18(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
jmp    1118 <fun_b+0x18>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun_b>:
mov    $0xffffffffffffffc0,%rcx
xor    %eax,%eax
nopl   0x0(%rax)
mov    %edi,%edx
and    $0x1,%edx
shl    $0x2,%rdx
lea    (%rdx,%rax,8),%rax
mov    %edi,%edx
and    $0x2,%edx
or     %rax,%rdx
mov    %edi,%eax
shr    $0x2,%eax
and    $0x1,%eax
or     %rdx,%rax
mov    %edi,%edx
shr    $0x3,%edx
and    $0x1,%edx
lea    (%rdx,%rax,2),%rax
shr    $0x4,%rdi
add    $0x4,%rcx
jne    1110 <fun_b+0x10>
ret

LLVM IR (-O0):
define i64 @fun_b(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %2
store i64 0, i64* %3
store i64 64, i64* %4
br label %5
5: ; preds = %16, %1
%6 = load i64, i64* %4
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %19
8: ; preds = %5
%9 = load i64, i64* %3
%10 = shl i64 %9, 1
%11 = load i64, i64* %2
%12 = and i64 %11, 1
%13 = or i64 %10, %12
store i64 %13, i64* %3
%14 = load i64, i64* %2
%15 = lshr i64 %14, 1
store i64 %15, i64* %2
br label %16
16: ; preds = %8
%17 = load i64, i64* %4
%18 = add nsw i64 %17, -1
store i64 %18, i64* %4
br label %5
19: ; preds = %5
%20 = load i64, i64* %3
ret i64 %20
}

LLVM IR (-O2):
define i64 @fun_b(i64 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 64, %1 ], [ %20, %2 ]
%4 = phi i64 [ 0, %1 ], [ %18, %2 ]
%5 = phi i64 [ %0, %1 ], [ %19, %2 ]
%6 = shl i64 %4, 3
%7 = shl i64 %5, 2
%8 = and i64 %7, 4
%9 = or i64 %6, %8
%10 = and i64 %5, 2
%11 = or i64 %9, %10
%12 = lshr i64 %5, 2
%13 = and i64 %12, 1
%14 = or i64 %11, %13
%15 = lshr i64 %5, 3
%16 = shl i64 %14, 1
%17 = and i64 %15, 1
%18 = or i64 %16, %17
%19 = lshr i64 %5, 4
%20 = add nsw i64 %3, -4
%21 = icmp eq i64 %20, 0
br i1 %21, label %22, label %2
22: ; preds = %2
ret i64 %18
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isprint(int);
void t_isprint_0x08() {
  Assert_real((isprint(8) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isprint.c",
              45, ("isprint should be 0 for 0x08"));
}


x86 assembly (clang, -O0):
<t_isprint_0x08>:
push   %rbp
mov    %rsp,%rbp
mov    $0x8,%edi
call   1030 <isprint@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x2d,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isprint_0x08>:
push   %rax
mov    $0x8,%edi
call   1030 <isprint@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2d,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0x08\00"
define void @t_isprint_0x08() {
%1 = call i64 @isprint(i32 8)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 45, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0x08\00"
define void @t_isprint_0x08() {
%1 = tail call i64 @isprint(i32 8)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 45, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int XChangeActivePointerGrab() {
  printf("XChangeActivePointerGrab called\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [32 x i8] c"XChangeActivePointerGrab called\00"
define i32 @XChangeActivePointerGrab() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
ret i32 0
}
double topocentric_azimuth_angle_zero_360(double azimuth180) {
  return azimuth180 + 180.0;
}


x86 assembly (clang, -O0):
<topocentric_azimuth_angle_zero_360>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<topocentric_azimuth_angle_zero_360>:
addsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @topocentric_azimuth_angle_zero_360(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fadd double %3, 1.800000e+02
ret double %4
}

LLVM IR (-O2):
define double @topocentric_azimuth_angle_zero_360(double %0) {
%2 = fadd double %0, 1.800000e+02
ret double %2
}
/* Type definitions */
struct mat4 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mat4_perspective_infinite(float *, float, float, float);
__attribute__((always_)) struct mat4 *
psmat4_perspective_infinite(struct mat4 *result, float fov_y, float aspect,
                            float n) {
  mat4_perspective_infinite((float *)result, fov_y, aspect, n);
  return result;
}


x86 assembly (clang, -O0):
<psmat4_perspective_infinite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
movss  %xmm2,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
movss  -0xc(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
movss  -0x14(%rbp),%xmm2
call   1030 <mat4_perspective_infinite@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<psmat4_perspective_infinite>:
push   %rbx
mov    %rdi,%rbx
call   1030 <mat4_perspective_infinite@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.mat4 = type { i32 }
define %struct.mat4* @psmat4_perspective_infinite(%struct.mat4* %0, float %1, float %2, float %3) {
%5 = alloca %struct.mat4*
%6 = alloca float
%7 = alloca float
%8 = alloca float
store %struct.mat4* %0, %struct.mat4** %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%9 = load %struct.mat4*, %struct.mat4** %5
%10 = bitcast %struct.mat4* %9 to float*
%11 = load float, float* %6
%12 = load float, float* %7
%13 = load float, float* %8
%14 = call i32 @mat4_perspective_infinite(float* %10, float %11, float %12, float %13)
%15 = load %struct.mat4*, %struct.mat4** %5
ret %struct.mat4* %15
}

LLVM IR (-O2):
%struct.mat4 = type { i32 }
define %struct.mat4* @psmat4_perspective_infinite(%struct.mat4* returned %0, float %1, float %2, float %3) {
%5 = bitcast %struct.mat4* %0 to float*
%6 = tail call i32 @mat4_perspective_infinite(float* %5, float %1, float %2, float %3)
ret %struct.mat4* %0
}
/* Variables and functions */
int /*<<< orphan*/ itoa(int, unsigned int, char *);
void itoa_s(int i, unsigned base, char *buf) {
  if (base > 16)
    return;
  if (i < 0) {
    *buf++ = '-';
    i *= -1;
  }
  itoa(i, base, buf);
}


x86 assembly (clang, -O0):
<itoa_s>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
cmpl   $0x10,-0x8(%rbp)
jbe    1131 <itoa_s+0x21>
jmp    1163 <itoa_s+0x53>
cmpl   $0x0,-0x4(%rbp)
jge    1154 <itoa_s+0x44>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movb   $0x2d,(%rax)
imul   $0xffffffff,-0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1030 <itoa@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<itoa_s>:
cmp    $0x10,%esi
jbe    1116 <itoa_s+0x6>
ret
test   %edi,%edi
js     111f <itoa_s+0xf>
jmp    1030 <itoa@plt>
movb   $0x2d,(%rdx)
add    $0x1,%rdx
neg    %edi
jmp    1030 <itoa@plt>

LLVM IR (-O0):
define void @itoa_s(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %5
%8 = icmp ugt i32 %7, 16
br i1 %8, label %9, label %10
9: ; preds = %3
br label %23
10: ; preds = %3
%11 = load i32, i32* %4
%12 = icmp slt i32 %11, 0
br i1 %12, label %13, label %18
13: ; preds = %10
%14 = load i8*, i8** %6
%15 = getelementptr inbounds i8, i8* %14, i32 1
store i8* %15, i8** %6
store i8 45, i8* %14
%16 = load i32, i32* %4
%17 = mul nsw i32 %16, -1
store i32 %17, i32* %4
br label %18
18: ; preds = %13, %10
%19 = load i32, i32* %4
%20 = load i32, i32* %5
%21 = load i8*, i8** %6
%22 = call i32 @itoa(i32 %19, i32 %20, i8* %21)
br label %23
23: ; preds = %18, %9
ret void
}

LLVM IR (-O2):
define void @itoa_s(i32 %0, i32 %1, i8* %2) {
%4 = icmp ugt i32 %1, 16
br i1 %4, label %14, label %5
5: ; preds = %3
%6 = icmp slt i32 %0, 0
br i1 %6, label %7, label %10
7: ; preds = %5
%8 = getelementptr inbounds i8, i8* %2, i64 1
store i8 45, i8* %2
%9 = sub nsw i32 0, %0
br label %10
10: ; preds = %7, %5
%11 = phi i32 [ %9, %7 ], [ %0, %5 ]
%12 = phi i8* [ %8, %7 ], [ %2, %5 ]
%13 = tail call i32 @itoa(i32 %11, i32 %1, i8* %12)
br label %14
14: ; preds = %3, %10
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_endswith() {
  printf("NOT IMPLEMENTED:"
         "pa_endswith"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [28 x i8] c"NOT IMPLEMENTED:pa_endswith\00"
define i32 @pa_endswith() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
__attribute__((weak)) void SUPC_IrqHandler(void) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<SUPC_IrqHandler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <SUPC_IrqHandler+0x9>
jmp    1109 <SUPC_IrqHandler+0x9>

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

LLVM IR (-O0):
define weak void @SUPC_IrqHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define weak void @SUPC_IrqHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int calculate_gcd(int, int);
void simplify_fraction(int *n, int *d) {
  int gcd = calculate_gcd(*n, *d);
  *n /= gcd;
  *d /= gcd;
}


x86 assembly (clang, -O0):
<simplify_fraction>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
call   1030 <calculate_gcd@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    (%rax),%eax
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    (%rax),%eax
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<simplify_fraction>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdi),%edi
mov    (%rsi),%esi
call   1030 <calculate_gcd@plt>
mov    %eax,%ecx
mov    (%rbx),%eax
cltd
idiv   %ecx
mov    %eax,(%rbx)
mov    (%r14),%eax
cltd
idiv   %ecx
mov    %eax,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @simplify_fraction(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = tail call i32 @calculate_gcd(i32 %3, i32 %4)
%6 = load i32, i32* %0
%7 = sdiv i32 %6, %5
store i32 %7, i32* %0
%8 = load i32, i32* %1
%9 = sdiv i32 %8, %5
store i32 %9, i32* %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int /*<<< orphan*/ wcstok(int /*<<< orphan*/ *, int /*<<< orphan*/ const *,
                          int /*<<< orphan*/ **);
void uninivar_wcstok(void) {
  wchar_t *s;
  const wchar_t *ct;
  wchar_t **ptr;
  (void)wcstok(s, ct, ptr);
}


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

x86 assembly (clang, -O2):
<uninivar_wcstok>:
jmp    1030 <wcstok@plt>

LLVM IR (-O0):
define void @uninivar_wcstok() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32**
%4 = load i32*, i32** %1
%5 = load i32*, i32** %2
%6 = load i32**, i32*** %3
%7 = call i32 @wcstok(i32* %4, i32* %5, i32** %6)
ret void
}

LLVM IR (-O2):
define void @uninivar_wcstok() {
%1 = tail call i32 @wcstok(i32* undef, i32* undef, i32** undef)
ret void
}
/* Type definitions */
struct mat4 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mat4_zero(float *);
__attribute__((always_)) struct mat4 *psmat4_zero(struct mat4 *result) {
  mat4_zero((float *)result);
  return result;
}


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

x86 assembly (clang, -O2):
<psmat4_zero>:
push   %rbx
mov    %rdi,%rbx
call   1030 <mat4_zero@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.mat4 = type { i32 }
define %struct.mat4* @psmat4_zero(%struct.mat4* %0) {
%2 = alloca %struct.mat4*
store %struct.mat4* %0, %struct.mat4** %2
%3 = load %struct.mat4*, %struct.mat4** %2
%4 = bitcast %struct.mat4* %3 to float*
%5 = call i32 @mat4_zero(float* %4)
%6 = load %struct.mat4*, %struct.mat4** %2
ret %struct.mat4* %6
}

LLVM IR (-O2):
%struct.mat4 = type { i32 }
define %struct.mat4* @psmat4_zero(%struct.mat4* returned %0) {
%2 = bitcast %struct.mat4* %0 to float*
%3 = tail call i32 @mat4_zero(float* %2)
ret %struct.mat4* %0
}
/* Variables and functions */
int /*<<< orphan*/ imConvertRGB2Map(int, int, unsigned char *, unsigned char *,
                                    unsigned char *, unsigned char *, long *,
                                    int *);
void imRGB2Map(int width, int height, unsigned char *red, unsigned char *green,
               unsigned char *blue, unsigned char *map, int palette_count,
               long *palette) {
  imConvertRGB2Map(width, height, red, green, blue, map, palette,
                   &palette_count);
}


x86 assembly (clang, -O0):
<imRGB2Map>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9
mov    0x18(%rbp),%r10
lea    0x10(%rbp),%rax
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1030 <imConvertRGB2Map@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<imRGB2Map>:
push   %rax
lea    0x10(%rsp),%rax
push   %rax
push   0x20(%rsp)
call   1030 <imConvertRGB2Map@plt>
add    $0x10,%rsp
pop    %rax
ret

LLVM IR (-O0):
define void @imRGB2Map(i32 %0, i32 %1, i8* %2, i8* %3, i8* %4, i8* %5, i32 %6, i64* %7) {
%9 = alloca i32
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i8*
%15 = alloca i32
%16 = alloca i64*
store i32 %0, i32* %9
store i32 %1, i32* %10
store i8* %2, i8** %11
store i8* %3, i8** %12
store i8* %4, i8** %13
store i8* %5, i8** %14
store i32 %6, i32* %15
store i64* %7, i64** %16
%17 = load i32, i32* %9
%18 = load i32, i32* %10
%19 = load i8*, i8** %11
%20 = load i8*, i8** %12
%21 = load i8*, i8** %13
%22 = load i8*, i8** %14
%23 = load i64*, i64** %16
%24 = call i32 @imConvertRGB2Map(i32 %17, i32 %18, i8* %19, i8* %20, i8* %21, i8* %22, i64* %23, i32* %15)
ret void
}

LLVM IR (-O2):
define void @imRGB2Map(i32 %0, i32 %1, i8* %2, i8* %3, i8* %4, i8* %5, i32 %6, i64* %7) {
%9 = alloca i32
store i32 %6, i32* %9
%10 = call i32 @imConvertRGB2Map(i32 %0, i32 %1, i8* %2, i8* %3, i8* %4, i8* %5, i64* %7, i32* %9)
ret void
}
/* Variables and functions */
int incluido(int *, int *, int /*<<< orphan*/, int /*<<< orphan*/, int, int);
int incluido0(int a[], int b[]) { return incluido(a, b, 0, 0, 5, 3); }


x86 assembly (clang, -O0):
<incluido0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
xor    %ecx,%ecx
mov    $0x5,%r8d
mov    $0x3,%r9d
mov    %ecx,%edx
call   1030 <incluido@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<incluido0>:
xor    %edx,%edx
xor    %ecx,%ecx
mov    $0x5,%r8d
mov    $0x3,%r9d
jmp    1030 <incluido@plt>

LLVM IR (-O0):
define i32 @incluido0(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 @incluido(i32* %5, i32* %6, i32 0, i32 0, i32 5, i32 3)
ret i32 %7
}

LLVM IR (-O2):
define i32 @incluido0(i32* %0, i32* %1) {
%3 = tail call i32 @incluido(i32* %0, i32* %1, i32 0, i32 0, i32 5, i32 3)
ret i32 %3
}
void RTStrToInt8Ex(void) {}


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

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

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

LLVM IR (-O2):
define void @RTStrToInt8Ex() {
ret void
}
/* Variables and functions */
scalar_t__ cosf(float);
int /*<<< orphan*/ link_failure_cosf();
void test_cosf(float f) {
  if (cosf(f) != cosf(f))
    link_failure_cosf();
}


x86 assembly (clang, -O0):
<test_cosf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <cosf@plt>
mov    %rax,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <cosf@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
je     115c <test_cosf+0x3c>
mov    $0x0,%al
call   1040 <link_failure_cosf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_cosf>:
push   %rbx
sub    $0x10,%rsp
movss  %xmm0,0xc(%rsp)
call   1030 <cosf@plt>
mov    %rax,%rbx
movss  0xc(%rsp),%xmm0
call   1030 <cosf@plt>
cmp    %rax,%rbx
jne    1149 <test_cosf+0x29>
add    $0x10,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1040 <link_failure_cosf@plt>

LLVM IR (-O0):
define void @test_cosf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i64 @cosf(float %3)
%5 = load float, float* %2
%6 = call i64 @cosf(float %5)
%7 = icmp ne i64 %4, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @link_failure_cosf()
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
define void @test_cosf(float %0) {
%2 = tail call i64 @cosf(float %0)
%3 = tail call i64 @cosf(float %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_cosf()
br label %7
7: ; preds = %5, %1
ret void
}
int tkn_inpt_length(char **input) {
  int length = 0;
  while (input[length])
    length++;
  return length;
}


x86 assembly (clang, -O0):
<tkn_inpt_length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1130 <tkn_inpt_length+0x30>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <tkn_inpt_length+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @tkn_inpt_length(i8** %0) {
%2 = alloca i8**
%3 = alloca i32
store i8** %0, i8*** %2
store i32 0, i32* %3
br label %4
4: ; preds = %11, %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 = icmp ne i8* %9, null
br i1 %10, label %11, label %14
11: ; preds = %4
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 1
store i32 %13, i32* %3
br label %4
14: ; preds = %4
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @tkn_inpt_length(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, null
%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
}
char *dcngettext(const char *domainname, const char *msgid1, const char *msgid2,
                 unsigned long n, int category) {
  (void)domainname;
  (void)category;
  return (char *)((n == 1) ? msgid1 : msgid2);
}


x86 assembly (clang, -O0):
<dcngettext>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
cmpq   $0x1,-0x20(%rbp)
jne    1130 <dcngettext+0x30>
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
jmp    1138 <dcngettext+0x38>
mov    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dcngettext>:
mov    %rsi,%rax
cmp    $0x1,%rcx
cmovne %rdx,%rax
ret

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

LLVM IR (-O2):
define i8* @dcngettext(i8* nocapture readnone %0, i8* readnone %1, i8* readnone %2, i64 %3, i32 %4) {
%6 = icmp eq i64 %3, 1
%7 = select i1 %6, i8* %1, i8* %2
ret i8* %7
}
void glutInitDisplayMode(int a) {}


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

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

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

LLVM IR (-O2):
define void @glutInitDisplayMode(i32 %0) {
ret void
}
int BYPASS_target(void *param, void *priv) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @BYPASS_target(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ updateMode(int, unsigned int *);
void tube_EnterOS(unsigned int *reg) { updateMode(0x13, reg); }


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

x86 assembly (clang, -O2):
<tube_EnterOS>:
mov    %rdi,%rsi
mov    $0x13,%edi
jmp    1030 <updateMode@plt>

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

LLVM IR (-O2):
define void @tube_EnterOS(i32* %0) {
%2 = tail call i32 @updateMode(i32 19, i32* %0)
ret void
}
/* Type definitions */
struct altera_i2c_dev {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ i2c_indirect_write(struct altera_i2c_dev *, int,
                                      unsigned long);
void altera_i2c_stop(struct altera_i2c_dev *dev) {
  i2c_indirect_write(dev, 0x00, (1UL << (8)));
}


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

x86 assembly (clang, -O2):
<altera_i2c_stop>:
mov    $0x100,%edx
xor    %esi,%esi
jmp    1030 <i2c_indirect_write@plt>

LLVM IR (-O0):
%struct.altera_i2c_dev = type { i32 }
define void @altera_i2c_stop(%struct.altera_i2c_dev* %0) {
%2 = alloca %struct.altera_i2c_dev*
store %struct.altera_i2c_dev* %0, %struct.altera_i2c_dev** %2
%3 = load %struct.altera_i2c_dev*, %struct.altera_i2c_dev** %2
%4 = call i32 @i2c_indirect_write(%struct.altera_i2c_dev* %3, i32 0, i64 256)
ret void
}

LLVM IR (-O2):
%struct.altera_i2c_dev = type { i32 }
define void @altera_i2c_stop(%struct.altera_i2c_dev* %0) {
%2 = tail call i32 @i2c_indirect_write(%struct.altera_i2c_dev* %0, i32 0, i64 256)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void *calloc(size_t, size_t);
int /*<<< orphan*/ write_log(char *, size_t);
void *xcalloc(size_t n, size_t size) {
  void *a = calloc(n, size);
  if (a == NULL) {
    write_log("xcalloc(%d): virtual memory exhausted\n", n * size);
    abort();
  }
  return a;
}


x86 assembly (clang, -O0):
<xcalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1178 <xcalloc+0x48>
mov    -0x8(%rbp),%rsi
imul   -0x10(%rbp),%rsi
lea    0xe94(%rip),%rdi
call   1050 <write_log@plt>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <calloc@plt>
test   %rax,%rax
je     114c <xcalloc+0x1c>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
imul   %rbx,%r14
lea    0xea9(%rip),%rdi
mov    %r14,%rsi
call   1050 <write_log@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [39 x i8] c"xcalloc(%d): virtual memory exhausted\0A\00"
define i8* @xcalloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = call i8* @calloc(i64 %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %17
11: ; preds = %2
%12 = load i64, i64* %3
%13 = load i64, i64* %4
%14 = mul i64 %12, %13
%15 = call i32 @write_log(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i64 %14)
%16 = call i32 (...) @abort()
unreachable
17: ; preds = %2
%18 = load i8*, i8** %5
ret i8* %18
}

LLVM IR (-O2):
@.str = [39 x i8] c"xcalloc(%d): virtual memory exhausted\0A\00"
define noalias i8* @xcalloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = mul i64 %1, %0
%7 = tail call i32 @write_log(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i64 %6)
%8 = tail call i32 (...) @abort()
unreachable
9: ; preds = %2
ret i8* %3
}
int KeycodeToKey(int Keycode) {
  return (Keycode & (1 << 30)) ? Keycode - (1 << 30) + 0x80 : Keycode;
}


x86 assembly (clang, -O0):
<KeycodeToKey>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x40000000,%eax
cmp    $0x0,%eax
je     112d <KeycodeToKey+0x2d>
mov    -0x4(%rbp),%eax
sub    $0x40000000,%eax
add    $0x80,%eax
mov    %eax,-0x8(%rbp)
jmp    1133 <KeycodeToKey+0x33>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<KeycodeToKey>:
lea    -0x3fffff80(%rdi),%eax
test   $0x40000000,%edi
cmove  %edi,%eax
ret

LLVM IR (-O0):
define i32 @KeycodeToKey(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 1073741824
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %2
%8 = sub nsw i32 %7, 1073741824
%9 = add nsw i32 %8, 128
br label %12
10: ; preds = %1
%11 = load i32, i32* %2
br label %12
12: ; preds = %10, %6
%13 = phi i32 [ %9, %6 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @KeycodeToKey(i32 %0) {
%2 = and i32 %0, 1073741824
%3 = icmp eq i32 %2, 0
%4 = add nsw i32 %0, -1073741696
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ F_GETFL;
int /*<<< orphan*/ F_SETFL;
int O_NONBLOCK;
int fcntl(int, int /*<<< orphan*/, ...);
void fd_setnonblock(int fd) {
  int flags;
  flags = fcntl(fd, F_GETFL);
  flags |= O_NONBLOCK;
  fcntl(fd, F_SETFL, flags);
}


x86 assembly (clang, -O0):
<fd_setnonblock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
mov    $0x0,%al
call   1030 <fcntl@plt>
mov    %eax,-0x8(%rbp)
mov    0x2eb0(%rip),%rax
mov    (%rax),%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e8e(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%edx
mov    $0x0,%al
call   1030 <fcntl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fd_setnonblock>:
push   %rbx
mov    %edi,%ebx
mov    0x2eb6(%rip),%rax
mov    (%rax),%esi
xor    %eax,%eax
call   1030 <fcntl@plt>
mov    0x2ebe(%rip),%rcx
or     (%rcx),%eax
mov    0x2ea5(%rip),%rcx
mov    (%rcx),%esi
mov    %ebx,%edi
mov    %eax,%edx
xor    %eax,%eax
pop    %rbx
jmp    1030 <fcntl@plt>

LLVM IR (-O0):
@F_GETFL = global i32 0
@O_NONBLOCK = global i32 0
@F_SETFL = global i32 0
define void @fd_setnonblock(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* @F_GETFL
%6 = call i32 (i32, i32, ...) @fcntl(i32 %4, i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* @O_NONBLOCK
%8 = load i32, i32* %3
%9 = or i32 %8, %7
store i32 %9, i32* %3
%10 = load i32, i32* %2
%11 = load i32, i32* @F_SETFL
%12 = load i32, i32* %3
%13 = call i32 (i32, i32, ...) @fcntl(i32 %10, i32 %11, i32 %12)
ret void
}

LLVM IR (-O2):
@F_GETFL = global i32 0
@O_NONBLOCK = global i32 0
@F_SETFL = global i32 0
define void @fd_setnonblock(i32 %0) {
%2 = load i32, i32* @F_GETFL
%3 = tail call i32 (i32, i32, ...) @fcntl(i32 %0, i32 %2)
%4 = load i32, i32* @O_NONBLOCK
%5 = or i32 %4, %3
%6 = load i32, i32* @F_SETFL
%7 = tail call i32 (i32, i32, ...) @fcntl(i32 %0, i32 %6, i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void sysex(char **a) {
  char *save = *a;
  printf("sysex\n");
  while (*(*a)++ != 0xF7) {
    printf("sysex offset: %d\n", (int)(*a - save));
  }
}


x86 assembly (clang, -O0):
<sysex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
lea    0xed2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rcx
mov    (%rcx),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,(%rcx)
movsbl (%rax),%eax
cmp    $0xf7,%eax
je     1177 <sysex+0x67>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,%esi
lea    0xe9c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1135 <sysex+0x25>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sysex>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%r15
lea    0xee0(%rip),%rdi
call   1030 <puts@plt>
lea    0xec2(%rip),%r14
xchg   %ax,%ax
mov    (%rbx),%rsi
add    $0x1,%rsi
mov    %rsi,(%rbx)
sub    %r15d,%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1140 <sysex+0x20>

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

LLVM IR (-O2):
@.str.1 = [18 x i8] c"sysex offset: %d\0A\00"
@str = [6 x i8] c"sysex\00"
define void @sysex(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
%4 = ptrtoint i8* %2 to i64
br label %5
5: ; preds = %5, %1
%6 = load i8*, i8** %0
%7 = getelementptr inbounds i8, i8* %6, i64 1
store i8* %7, i8** %0
%8 = ptrtoint i8* %7 to i64
%9 = sub i64 %8, %4
%10 = trunc i64 %9 to i32
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %10)
br label %5
}
long long get_nth_fibonacci(long long n) {
  if (n < 2) {
    return n;
  }
  return get_nth_fibonacci(n - 2) + get_nth_fibonacci(n - 1);
}


x86 assembly (clang, -O0):
<get_nth_fibonacci>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x2,-0x10(%rbp)
jge    1134 <get_nth_fibonacci+0x24>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1160 <get_nth_fibonacci+0x50>
mov    -0x10(%rbp),%rdi
sub    $0x2,%rdi
call   1030 <get_nth_fibonacci@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
sub    $0x1,%rdi
call   1030 <get_nth_fibonacci@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_nth_fibonacci>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
cmp    $0x2,%rdi
jge    1122 <get_nth_fibonacci+0x12>
xor    %r14d,%r14d
jmp    114b <get_nth_fibonacci+0x3b>
add    $0x1,%rbx
xor    %r14d,%r14d
nopl   0x0(%rax)
lea    -0x3(%rbx),%rdi
call   1030 <get_nth_fibonacci@plt>
add    %rax,%r14
add    $0xffffffffffffffff,%rbx
cmp    $0x2,%rbx
ja     1130 <get_nth_fibonacci+0x20>
mov    $0x1,%ebx
add    %rbx,%r14
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i64 @get_nth_fibonacci(i64 %0) {
%2 = icmp slt i64 %0, 2
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %8, %3 ], [ %0, %1 ]
%5 = phi i64 [ %9, %3 ], [ 0, %1 ]
%6 = add nsw i64 %4, -2
%7 = tail call i64 @get_nth_fibonacci(i64 %6)
%8 = add nsw i64 %4, -1
%9 = add nsw i64 %7, %5
%10 = icmp ult i64 %4, 3
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i64 [ 0, %1 ], [ %9, %3 ]
%13 = phi i64 [ %0, %1 ], [ 1, %3 ]
%14 = add nsw i64 %13, %12
ret i64 %14
}
/* Variables and functions */
int process_proxy_cond_adders(unsigned int *, char const *, char const **,
                              int *, int);
int process_proxy_cond(unsigned int letters[26], const char *cond,
                       const char **cond_end) {
  int pos = 1;
  return process_proxy_cond_adders(letters, cond, cond_end, &pos, 1);
}


x86 assembly (clang, -O0):
<process_proxy_cond>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x1,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    -0x1c(%rbp),%rcx
mov    $0x1,%r8d
call   1030 <process_proxy_cond_adders@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<process_proxy_cond>:
push   %rax
movl   $0x1,0x4(%rsp)
lea    0x4(%rsp),%rcx
mov    $0x1,%r8d
call   1030 <process_proxy_cond_adders@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @process_proxy_cond(i32* %0, i8* %1, i8** %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
store i32 1, i32* %4
%6 = call i32 @process_proxy_cond_adders(i32* %0, i8* %1, i8** %2, i32* %4, i32 1)
ret i32 %6
}
void isr_int_NMI() {}


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

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

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

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