xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
char *sfm_malloc(size_t);
char *sfm_strndup(const char *str, size_t siz) {
  char *dst;
  dst = sfm_malloc(siz);
  memcpy(dst, str, siz);
  return dst;
}


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

x86 assembly (clang, -O2):
<sfm_strndup>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <sfm_malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @sfm_strndup(i8* %0, i64 %1) {
%3 = tail call i8* @sfm_malloc(i64 %1)
%4 = tail call i32 @memcpy(i8* %3, i8* %0, i64 %1)
ret i8* %3
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  long root_input_mask;
};
typedef TYPE_1__ Screen;

/* Variables and functions */
void set_Screen_root_input_mask(void *_p, long _v) {
  ((Screen *)_p)->root_input_mask = (long)_v;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define void @set_Screen_root_input_mask(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @set_Screen_root_input_mask(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
void dummy_(void) {}


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

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

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

LLVM IR (-O2):
define void @dummy_() {
ret void
}
/* Variables and functions */
scalar_t__ halt3();
scalar_t__ unknown();
int test13() { (void)(halt3() && unknown()); }


x86 assembly (clang, -O0):
<test13>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <halt3@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
je     1152 <test13+0x32>
mov    $0x0,%al
call   1040 <unknown@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test13>:
push   %rax
xor    %eax,%eax
call   1030 <halt3@plt>
test   %rax,%rax
je     1134 <test13+0x14>
xor    %eax,%eax
call   1040 <unknown@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @test13() {
%1 = alloca i32
%2 = call i64 (...) @halt3()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = call i64 (...) @unknown()
%6 = icmp ne i64 %5, 0
br label %7
7: ; preds = %4, %0
%8 = phi i1 [ false, %0 ], [ %6, %4 ]
%9 = zext i1 %8 to i32
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
define i32 @test13() {
%1 = tail call i64 (...) @halt3()
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i64 (...) @unknown()
br label %5
5: ; preds = %3, %0
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a;
  scanf("%d", &a);
  if (a % 2 != 0) {
    printf("%d\n", a + 1);
  } else {
    printf("%d\n", a);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     116a <main+0x4a>
mov    -0x8(%rbp),%esi
add    $0x1,%esi
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
jmp    1179 <main+0x59>
mov    -0x8(%rbp),%esi
lea    0xe8f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
mov    %eax,%esi
and    $0x1,%esi
add    %eax,%esi
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = and i32 %4, 1
%6 = add nsw i32 %4, %5
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ place;
};
typedef TYPE_1__ XCirculateEvent;

/* Variables and functions */
int get_XCirculateEvent_place(void *_p) {
  return (int)((XCirculateEvent *)_p)->place;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XCirculateEvent_place(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XCirculateEvent_place(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
void write32(unsigned long BASE, unsigned long reg1, signed long val) {
  unsigned long val_to_write, val32, temp;
  unsigned long bitmask[1] = {0x00000000};
  int byte;
  *((unsigned int *)(BASE + reg1)) = val;
}


x86 assembly (clang, -O0):
<write32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x38(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1030 <memset@plt>
mov    -0x18(%rbp),%rax
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %ecx,(%rax)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write32>:
mov    %edx,(%rsi,%rdi,1)
ret

LLVM IR (-O0):
define void @write32(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca [1 x i64]
%11 = alloca i32
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%12 = bitcast [1 x i64]* %10 to i8*
%13 = load i64, i64* %6
%14 = trunc i64 %13 to i32
%15 = load i64, i64* %4
%16 = load i64, i64* %5
%17 = add i64 %15, %16
%18 = inttoptr i64 %17 to i32*
store i32 %14, i32* %18
ret void
}

LLVM IR (-O2):
define void @write32(i64 %0, i64 %1, i64 %2) {
%4 = trunc i64 %2 to i32
%5 = add i64 %1, %0
%6 = inttoptr i64 %5 to i32*
store i32 %4, i32* %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
int f(int *x, int *y, int *z, int *z2) {
  if (3 > 4) {
    free(x);
  }
  while (3 < 4) {
    free(y);
  }
  if (3 > 4) {
    free(z);
  } else {
    free(z2);
  }
  return 3;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
jmp    1128 <f+0x18>

x86 assembly (clang, -O2):
<f>:
push   %rbx
mov    %rsi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
call   1030 <free@plt>
jmp    1120 <f+0x10>

LLVM IR (-O0):
define i32 @f(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
br label %9
9: ; preds = %4, %9
%10 = load i32*, i32** %6
%11 = call i32 @free(i32* %10)
br label %9
}

LLVM IR (-O2):
define i32 @f(i32* nocapture readnone %0, i32* nocapture %1, i32* nocapture readnone %2, i32* nocapture readnone %3) {
br label %5
5: ; preds = %4, %5
%6 = tail call i32 @free(i32* %1)
br label %5
}
/* Variables and functions */
double acos(int /*<<< orphan*/);
int /*<<< orphan*/ luaL_check_number(int);
int /*<<< orphan*/ lua_pushnumber(double);
void math_acos(void) {
  lua_pushnumber(((acos(luaL_check_number(1))) *
                  (180.0 / ((double)3.14159265358979323846))));
}


x86 assembly (clang, -O0):
<math_acos>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <luaL_check_number@plt>
mov    %eax,%edi
call   1040 <acos@plt>
movsd  0xeb3(%rip),%xmm1
mulsd  %xmm1,%xmm0
call   1050 <lua_pushnumber@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<math_acos>:
push   %rax
mov    $0x1,%edi
call   1030 <luaL_check_number@plt>
mov    %eax,%edi
call   1040 <acos@plt>
mulsd  0xeb6(%rip),%xmm0
pop    %rax
jmp    1050 <lua_pushnumber@plt>

LLVM IR (-O0):
define void @math_acos() {
%1 = call i32 @luaL_check_number(i32 1)
%2 = call double @acos(i32 %1)
%3 = fmul double %2, 0x404CA5DC1A63C1F8
%4 = call i32 @lua_pushnumber(double %3)
ret void
}

LLVM IR (-O2):
define void @math_acos() {
%1 = tail call i32 @luaL_check_number(i32 1)
%2 = tail call double @acos(i32 %1)
%3 = fmul double %2, 0x404CA5DC1A63C1F8
%4 = tail call i32 @lua_pushnumber(double %3)
ret void
}
/* Variables and functions */
scalar_t__ floor(double);
long lrint(double s) { return (long)floor(s); }


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

x86 assembly (clang, -O2):
<lrint>:
jmp    1030 <floor@plt>

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

LLVM IR (-O2):
define i64 @lrint(double %0) {
%2 = tail call i64 @floor(double %0)
ret i64 %2
}
extern __attribute__((simd)) int simd_attr2(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @simd_attr2() {
ret i32 0
}
int cairo_code_draw_infamousLogoTiny_get_width() { return 15; }


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

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

LLVM IR (-O0):
define i32 @cairo_code_draw_infamousLogoTiny_get_width() {
ret i32 15
}

LLVM IR (-O2):
define i32 @cairo_code_draw_infamousLogoTiny_get_width() {
ret i32 15
}
/* Variables and functions */
double pow(double, double);
double rohair(double dem, double tempk, double dtair) {
  double a, b, result;
  a = tempk - dtair;
  b = ((a - 0.00627 * dem) / a);
  result = 349.467 * pow(b, 5.26) / a;
  return result;
}


x86 assembly (clang, -O0):
<rohair>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm0
movsd  0xec8(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
divsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  0xea1(%rip),%xmm1
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xe89(%rip),%xmm0
mulsd  %xmm1,%xmm0
divsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rohair>:
push   %rax
subsd  %xmm2,%xmm1
movsd  %xmm1,(%rsp)
mulsd  0xede(%rip),%xmm0
addsd  %xmm1,%xmm0
divsd  %xmm1,%xmm0
movsd  0xed6(%rip),%xmm1
call   1030 <pow@plt>
mulsd  0xed1(%rip),%xmm0
divsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @rohair(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%10 = load double, double* %5
%11 = load double, double* %6
%12 = fsub double %10, %11
store double %12, double* %7
%13 = load double, double* %7
%14 = load double, double* %4
%15 = call double @llvm.fmuladd.f64(double -6.270000e-03, double %14, double %13)
%16 = load double, double* %7
%17 = fdiv double %15, %16
store double %17, double* %8
%18 = load double, double* %8
%19 = call double @pow(double %18, double 5.260000e+00)
%20 = fmul double 3.494670e+02, %19
%21 = load double, double* %7
%22 = fdiv double %20, %21
store double %22, double* %9
%23 = load double, double* %9
ret double %23
}

LLVM IR (-O2):
define double @rohair(double %0, double %1, double %2) {
%4 = fsub double %1, %2
%5 = tail call double @llvm.fmuladd.f64(double %0, double -6.270000e-03, double %4)
%6 = fdiv double %5, %4
%7 = tail call double @pow(double %6, double 5.260000e+00)
%8 = fmul double %7, 3.494670e+02
%9 = fdiv double %8, %4
ret double %9
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ putc(char, int /*<<< orphan*/ *);
void bf_indent(FILE *out, int level) {
  while (level--) {
    putc(' ', out);
    putc(' ', out);
  }
}


x86 assembly (clang, -O0):
<bf_indent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
je     1154 <bf_indent+0x44>
mov    -0x8(%rbp),%rsi
mov    $0x20,%edi
call   1030 <putc@plt>
mov    -0x8(%rbp),%rsi
mov    $0x20,%edi
call   1030 <putc@plt>
jmp    111f <bf_indent+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bf_indent>:
push   %r14
push   %rbx
push   %rax
test   %esi,%esi
je     113f <bf_indent+0x2f>
mov    %esi,%ebx
mov    %rdi,%r14
nopl   (%rax)
mov    $0x20,%edi
mov    %r14,%rsi
call   1030 <putc@plt>
mov    $0x20,%edi
mov    %r14,%rsi
call   1030 <putc@plt>
add    $0xffffffff,%ebx
jne    1120 <bf_indent+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @bf_indent(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
br label %5
5: ; preds = %9, %2
%6 = load i32, i32* %4
%7 = add nsw i32 %6, -1
store i32 %7, i32* %4
%8 = icmp ne i32 %6, 0
br i1 %8, label %9, label %14
9: ; preds = %5
%10 = load i32*, i32** %3
%11 = call i32 @putc(i8 signext 32, i32* %10)
%12 = load i32*, i32** %3
%13 = call i32 @putc(i8 signext 32, i32* %12)
br label %5
14: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @bf_indent(i32* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %10, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %6, %4 ], [ %1, %2 ]
%6 = add nsw i32 %5, -1
%7 = tail call i32 @putc(i8 signext 32, i32* %0)
%8 = tail call i32 @putc(i8 signext 32, i32* %0)
%9 = icmp eq i32 %6, 0
br i1 %9, label %10, label %4
10: ; preds = %4, %2
ret void
}
/* Variables and functions */
int rename(char const *, char const *);
int c_rename(const char *arg0, const char *arg1) { return rename(arg0, arg1); }


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

x86 assembly (clang, -O2):
<c_rename>:
jmp    1030 <rename@plt>

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

LLVM IR (-O2):
define i32 @c_rename(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @rename(i8* %0, i8* %1)
ret i32 %3
}
/* Type definitions */
struct cache_mp_read_session_ {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ free(struct cache_mp_read_session_ *);
void destroy_cache_mp_read_session(struct cache_mp_read_session_ *rs) {
  (void)0;
  assert(rs != NULL);
  free(rs);
  (void)0;
}


x86 assembly (clang, -O0):
<destroy_cache_mp_read_session>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<destroy_cache_mp_read_session>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1040 <assert@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.cache_mp_read_session_ = type { i32 }
define void @destroy_cache_mp_read_session(%struct.cache_mp_read_session_* %0) {
%2 = alloca %struct.cache_mp_read_session_*
store %struct.cache_mp_read_session_* %0, %struct.cache_mp_read_session_** %2
%3 = load %struct.cache_mp_read_session_*, %struct.cache_mp_read_session_** %2
%4 = icmp ne %struct.cache_mp_read_session_* %3, null
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = load %struct.cache_mp_read_session_*, %struct.cache_mp_read_session_** %2
%8 = call i32 @free(%struct.cache_mp_read_session_* %7)
ret void
}

LLVM IR (-O2):
%struct.cache_mp_read_session_ = type { i32 }
define void @destroy_cache_mp_read_session(%struct.cache_mp_read_session_* %0) {
%2 = icmp ne %struct.cache_mp_read_session_* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 @free(%struct.cache_mp_read_session_* %0)
ret void
}
int test_table(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @test_table() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, double *);
int main() {
  int distanceTraveled;
  double fuelSpent;
  scanf("%d %lf", &distanceTraveled, &fuelSpent);
  printf("%.3lf km/l\n", distanceTraveled / fuelSpent);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0x10(%rbp),%rdx
call   1040 <scanf@plt>
cvtsi2sdl -0x8(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
cvttsd2si %xmm0,%esi
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xed5(%rip),%rdi
lea    0xc(%rsp),%rsi
lea    0x10(%rsp),%rdx
call   1040 <scanf@plt>
cvtsi2sdl 0xc(%rsp),%xmm0
divsd  0x10(%rsp),%xmm0
cvttsd2si %xmm0,%esi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%d %lf\00"
@.str.1 = [12 x i8] c"%.3lf km/l\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca double
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %2, double* %3)
%5 = load i32, i32* %2
%6 = sitofp i32 %5 to double
%7 = load double, double* %3
%8 = fdiv double %6, %7
%9 = fptosi double %8 to i32
%10 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%d %lf\00"
@.str.1 = [12 x i8] c"%.3lf km/l\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = bitcast i32* %1 to i8*
%4 = bitcast double* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %1, double* %2)
%6 = load i32, i32* %1
%7 = sitofp i32 %6 to double
%8 = load double, double* %2
%9 = fdiv double %7, %8
%10 = fptosi double %9 to i32
%11 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %10)
ret i32 0
}
/* Variables and functions */
int y2d(int);
int ymd2dn(int, int, int);
int ymd2ds(int yr, int mo, int dy) {
  return (yr >= 0 ? y2d(yr - 1) : y2d(yr) - 366) + ymd2dn(yr, mo, dy);
}


x86 assembly (clang, -O0):
<ymd2ds>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     114e <ymd2ds+0x2e>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
call   1040 <y2d@plt>
mov    %eax,-0x10(%rbp)
jmp    115e <ymd2ds+0x3e>
mov    -0x4(%rbp),%edi
call   1040 <y2d@plt>
sub    $0x16e,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <ymd2dn@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ymd2ds>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %esi,%r15d
mov    %edi,%ebx
test   %edi,%edi
js     113f <ymd2ds+0x1f>
lea    -0x1(%rbx),%edi
call   1040 <y2d@plt>
mov    %eax,%ebp
jmp    114e <ymd2ds+0x2e>
mov    %ebx,%edi
call   1040 <y2d@plt>
mov    %eax,%ebp
add    $0xfffffe92,%ebp
mov    %ebx,%edi
mov    %r15d,%esi
mov    %r14d,%edx
call   1030 <ymd2dn@plt>
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @ymd2ds(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 = icmp sge i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %3
%10 = load i32, i32* %4
%11 = sub nsw i32 %10, 1
%12 = call i32 @y2d(i32 %11)
br label %17
13: ; preds = %3
%14 = load i32, i32* %4
%15 = call i32 @y2d(i32 %14)
%16 = sub nsw i32 %15, 366
br label %17
17: ; preds = %13, %9
%18 = phi i32 [ %12, %9 ], [ %16, %13 ]
%19 = load i32, i32* %4
%20 = load i32, i32* %5
%21 = load i32, i32* %6
%22 = call i32 @ymd2dn(i32 %19, i32 %20, i32 %21)
%23 = add nsw i32 %18, %22
ret i32 %23
}

LLVM IR (-O2):
define i32 @ymd2ds(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %0, -1
br i1 %4, label %5, label %8
5: ; preds = %3
%6 = add nsw i32 %0, -1
%7 = tail call i32 @y2d(i32 %6)
br label %11
8: ; preds = %3
%9 = tail call i32 @y2d(i32 %0)
%10 = add nsw i32 %9, -366
br label %11
11: ; preds = %8, %5
%12 = phi i32 [ %7, %5 ], [ %10, %8 ]
%13 = tail call i32 @ymd2dn(i32 %0, i32 %1, i32 %2)
%14 = add nsw i32 %13, %12
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ echo(char *, ...);
main() {
  echo("Hello"
       " "
       "World");
  echo("Hello"
       "World");
  echo("Hello", "sdg ");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <echo@plt>
lea    0xee3(%rip),%rdi
mov    $0x0,%al
call   1030 <echo@plt>
lea    0xee0(%rip),%rdi
lea    0xedf(%rip),%rsi
mov    $0x0,%al
call   1030 <echo@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [12 x i8] c"Hello World\00"
@.str.1 = [11 x i8] c"HelloWorld\00"
@.str.2 = [6 x i8] c"Hello\00"
@.str.3 = [5 x i8] c"sdg \00"
define i32 @main() {
%1 = call i32 (i8*, ...) @echo(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (i8*, ...) @echo(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 (i8*, ...) @echo(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"Hello World\00"
@.str.1 = [11 x i8] c"HelloWorld\00"
@.str.2 = [6 x i8] c"Hello\00"
@.str.3 = [5 x i8] c"sdg \00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @echo(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @echo(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @echo(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}
char *adi_api_get_error_string(int error_code) { return ""; }


x86 assembly (clang, -O0):
<adi_api_get_error_string>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    0xef2(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @adi_api_get_error_string(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @adi_api_get_error_string(i32 %0) {
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ bit_start;
typedef unsigned int bit_end;

/* Variables and functions */
int CHAR_BIT;
unsigned long long max_3(unsigned bit_start, unsigned bit_end) {
  unsigned bits = (bit_end) - (bit_start) + 1;
  return (bits < (sizeof(0ULL) * CHAR_BIT)) ? ((1ULL << bits) - 1ULL) : ~0ULL;
}


x86 assembly (clang, -O0):
<max_3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    0x2ec0(%rip),%rcx
movslq (%rcx),%rcx
shl    $0x3,%rcx
cmp    %rcx,%rax
jae    114a <max_3+0x4a>
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%rax
sub    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    115a <max_3+0x5a>
mov    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
jmp    115a <max_3+0x5a>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max_3>:
sub    %edi,%esi
lea    0x1(%rsi),%ecx
mov    0x2ed4(%rip),%rax
movslq (%rax),%rdx
shl    $0x3,%rdx
mov    $0xffffffffffffffff,%rsi
mov    $0xffffffffffffffff,%rax
shl    %cl,%rax
cmp    %rcx,%rdx
not    %rax
cmovbe %rsi,%rax
ret

LLVM IR (-O0):
@CHAR_BIT = global i32 0
define i64 @max_3(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* %4
%7 = load i32, i32* %3
%8 = sub i32 %6, %7
%9 = add i32 %8, 1
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = zext i32 %10 to i64
%12 = load i32, i32* @CHAR_BIT
%13 = sext i32 %12 to i64
%14 = mul i64 8, %13
%15 = icmp ult i64 %11, %14
br i1 %15, label %16, label %21
16: ; preds = %2
%17 = load i32, i32* %5
%18 = zext i32 %17 to i64
%19 = shl i64 1, %18
%20 = sub i64 %19, 1
br label %22
21: ; preds = %2
br label %22
22: ; preds = %21, %16
%23 = phi i64 [ %20, %16 ], [ -1, %21 ]
ret i64 %23
}

LLVM IR (-O2):
@CHAR_BIT = global i32 0
define i64 @max_3(i32 %0, i32 %1) {
%3 = sub i32 1, %0
%4 = add i32 %3, %1
%5 = zext i32 %4 to i64
%6 = load i32, i32* @CHAR_BIT
%7 = sext i32 %6 to i64
%8 = shl nsw i64 %7, 3
%9 = icmp ugt i64 %8, %5
%10 = shl nsw i64 -1, %5
%11 = xor i64 %10, -1
%12 = select i1 %9, i64 %11, i64 -1
ret i64 %12
}
/* Variables and functions */
int /*<<< orphan*/ fb_hTermOut(int, int /*<<< orphan*/, int /*<<< orphan*/);
void fb_Beep(void) { fb_hTermOut(6, 0, 0); }


x86 assembly (clang, -O0):
<fb_Beep>:
push   %rbp
mov    %rsp,%rbp
mov    $0x6,%edi
xor    %edx,%edx
mov    %edx,%esi
call   1030 <fb_hTermOut@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fb_Beep>:
mov    $0x6,%edi
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <fb_hTermOut@plt>

LLVM IR (-O0):
define void @fb_Beep() {
%1 = call i32 @fb_hTermOut(i32 6, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
define void @fb_Beep() {
%1 = tail call i32 @fb_hTermOut(i32 6, i32 0, i32 0)
ret void
}
void cliopt_debug(void *bleh, ...) {}


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

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

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

LLVM IR (-O2):
define void @cliopt_debug(i8* nocapture %0, ...) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __console_tx_char(unsigned char);
void print_debug_char(unsigned char byte) { __console_tx_char(byte); }


x86 assembly (clang, -O0):
<print_debug_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1030 <__console_tx_char@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_debug_char>:
jmp    1030 <__console_tx_char@plt>

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

LLVM IR (-O2):
define void @print_debug_char(i8 zeroext %0) {
%2 = tail call i32 @__console_tx_char(i8 zeroext %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ swerr1(char *);
int /*<<< orphan*/ swerr_SetPos(char *, int);
int os_SetLock(char const *path, int perms, int left_open) {
  do {
    swerr_SetPos("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                 "outputs/2022-01-22/02-19-57/repos/stden/ejudge/refs/heads/"
                 "master/win32/reuse_setlock.c",
                 36);
    swerr1("Not implemented");
  } while (0);
}


x86 assembly (clang, -O0):
<os_SetLock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
lea    0xec7(%rip),%rdi
mov    $0x24,%esi
call   1030 <swerr_SetPos@plt>
lea    0xf45(%rip),%rdi
call   1040 <swerr1@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<os_SetLock>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x24,%esi
call   1030 <swerr_SetPos@plt>
lea    0xf56(%rip),%rdi
pop    %rax
jmp    1040 <swerr1@plt>

LLVM IR (-O0):
@.str = [143 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/stden/ejudge/refs/heads/master/win32/reuse_setlock.c\00"
@.str.1 = [16 x i8] c"Not implemented\00"
define i32 @os_SetLock(i8* %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
br label %8
8: ; preds = %3
%9 = call i32 @swerr_SetPos(i8* getelementptr inbounds ([143 x i8], [143 x i8]* @.str, i64 0, i64 0), i32 36)
%10 = call i32 @swerr1(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %8
%12 = load i32, i32* %4
ret i32 %12
}

LLVM IR (-O2):
@.str = [143 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/stden/ejudge/refs/heads/master/win32/reuse_setlock.c\00"
@.str.1 = [16 x i8] c"Not implemented\00"
define i32 @os_SetLock(i8* nocapture readnone %0, i32 %1, i32 %2) {
%4 = tail call i32 @swerr_SetPos(i8* getelementptr inbounds ([143 x i8], [143 x i8]* @.str, i64 0, i64 0), i32 36)
%5 = tail call i32 @swerr1(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
ret i32 undef
}
double exp(double n) { return 0.0; }


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

x86 assembly (clang, -O2):
<exp>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @exp(double %0) {
%2 = alloca double
store double %0, double* %2
ret double 0.000000e+00
}

LLVM IR (-O2):
define double @exp(double %0) {
ret double 0.000000e+00
}
/* Variables and functions */
int PPCMMU(int, int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int MmuUnitTest() { return PPCMMU(0x106, 0, 0, 0); }


x86 assembly (clang, -O0):
<MmuUnitTest>:
push   %rbp
mov    %rsp,%rbp
mov    $0x106,%edi
xor    %ecx,%ecx
mov    %ecx,%esi
mov    %ecx,%edx
call   1030 <PPCMMU@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<MmuUnitTest>:
mov    $0x106,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <PPCMMU@plt>

LLVM IR (-O0):
define i32 @MmuUnitTest() {
%1 = call i32 @PPCMMU(i32 262, i32 0, i32 0, i32 0)
ret i32 %1
}

LLVM IR (-O2):
define i32 @MmuUnitTest() {
%1 = tail call i32 @PPCMMU(i32 262, i32 0, i32 0, i32 0)
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint64_t;
typedef int int64_t;

/* Variables and functions */
int varint_encode(int, int /*<<< orphan*/ *);
int tbx_zigzag_encode(int64_t value, uint8_t *buffer) {
  uint64_t zz;
  zz = (value < 0) ? 2 * (-value) - 1 : 2 * value;
  return (varint_encode(zz, buffer));
}


x86 assembly (clang, -O0):
<tbx_zigzag_encode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    113c <tbx_zigzag_encode+0x2c>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
shl    $0x1,%eax
sub    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1145 <tbx_zigzag_encode+0x35>
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <varint_encode@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tbx_zigzag_encode>:
lea    (%rdi,%rdi,1),%eax
test   %edi,%edi
mov    %eax,%edi
not    %edi
cmovns %eax,%edi
jmp    1030 <varint_encode@plt>

LLVM IR (-O0):
define i32 @tbx_zigzag_encode(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 = icmp slt i32 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i32, i32* %3
%10 = sub nsw i32 0, %9
%11 = mul nsw i32 2, %10
%12 = sub nsw i32 %11, 1
br label %16
13: ; preds = %2
%14 = load i32, i32* %3
%15 = mul nsw i32 2, %14
br label %16
16: ; preds = %13, %8
%17 = phi i32 [ %12, %8 ], [ %15, %13 ]
store i32 %17, i32* %5
%18 = load i32, i32* %5
%19 = load i32*, i32** %4
%20 = call i32 @varint_encode(i32 %18, i32* %19)
ret i32 %20
}

LLVM IR (-O2):
define i32 @tbx_zigzag_encode(i32 %0, i32* %1) {
%3 = icmp slt i32 %0, 0
%4 = mul i32 %0, -2
%5 = add nsw i32 %4, -1
%6 = shl nsw i32 %0, 1
%7 = select i1 %3, i32 %5, i32 %6
%8 = tail call i32 @varint_encode(i32 %7, i32* %1)
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
scalar_t__ xmalloc(scalar_t__);
char *xstrdup(const char *str) {
  register char *nstr = (char *)xmalloc(strlen(str) + 1);
  strcpy(nstr, str);
  return nstr;
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <xmalloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <xmalloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @xstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i64 @xmalloc(i64 %6)
%8 = inttoptr i64 %7 to i8*
store i8* %8, i8** %3
%9 = load i8*, i8** %3
%10 = load i8*, i8** %2
%11 = call i32 @strcpy(i8* %9, i8* %10)
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
define i8* @xstrdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i64 @xmalloc(i64 %3)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @strcpy(i8* %5, i8* %0)
ret i8* %5
}
double cmp(long a, long b) {
  double result;
  __asm__ volatile("cmpq %2, %1; seta %b1; sbb $0, %k1; cvtsi2sd %k1, %0"
                   : "=x"(result), "+r"(a)
                   : "r"(b));
  return result;
}


x86 assembly (clang, -O0):
<cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
cmp    %rcx,%rax
seta   %al
sbb    $0x0,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    %rax,-0x8(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp>:
cmp    %rsi,%rdi
seta   %dil
sbb    $0x0,%edi
cvtsi2sd %edi,%xmm0
ret

LLVM IR (-O0):
define double @cmp(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca double
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = call { double, i64 } asm sideeffect "cmpq $2, $1; seta ${1:b}; sbb $$0, ${1:k}; cvtsi2sd ${1:k}, $0", "=x,=r,r,1,~{dirflag},~{fpsr},~{flags}"(i64 %7, i64 %6)
%9 = extractvalue { double, i64 } %8, 0
%10 = extractvalue { double, i64 } %8, 1
store double %9, double* %5
store i64 %10, i64* %3
%11 = load double, double* %5
ret double %11
}

LLVM IR (-O2):
define double @cmp(i64 %0, i64 %1) {
%3 = tail call { double, i64 } asm sideeffect "cmpq $2, $1; seta ${1:b}; sbb $$0, ${1:k}; cvtsi2sd ${1:k}, $0", "=x,=r,r,1,~{dirflag},~{fpsr},~{flags}"(i64 %1, i64 %0)
%4 = extractvalue { double, i64 } %3, 0
ret double %4
}
void delay() {
  for (int i = 0; i < 10000000; i++) {
  }
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x989680,-0x4(%rbp)
jge    112b <delay+0x2b>
jmp    111d <delay+0x1d>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <delay+0xb>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @delay() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %6, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 10000000
br i1 %4, label %5, label %9
5: ; preds = %2
br label %6
6: ; preds = %5
%7 = load i32, i32* %1
%8 = add nsw i32 %7, 1
store i32 %8, i32* %1
br label %2
9: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @delay() {
ret void
}
/* Variables and functions */
double tensor_dot(double const *, double const *, unsigned int);
double tensor_i1(const double *Jr, unsigned int nr, const double *u) {
  return tensor_dot(Jr, u, nr);
}


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

x86 assembly (clang, -O2):
<tensor_i1>:
mov    %esi,%eax
mov    %rdx,%rsi
mov    %eax,%edx
jmp    1030 <tensor_dot@plt>

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

LLVM IR (-O2):
define double @tensor_i1(double* %0, i32 %1, double* %2) {
%4 = tail call double @tensor_dot(double* %0, double* %2, i32 %1)
ret double %4
}
int do_055() { return 55; }


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

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

LLVM IR (-O0):
define i32 @do_055() {
ret i32 55
}

LLVM IR (-O2):
define i32 @do_055() {
ret i32 55
}
/* Variables and functions */
int /*<<< orphan*/ add_word(char *);
void cm_equiv(int arg) {
  if (arg == 1)
    add_word("==");
}


x86 assembly (clang, -O0):
<cm_equiv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    1131 <cm_equiv+0x21>
lea    0xed4(%rip),%rdi
call   1030 <add_word@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cm_equiv>:
cmp    $0x1,%edi
jne    1121 <cm_equiv+0x11>
lea    0xee4(%rip),%rdi
jmp    1030 <add_word@plt>
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"==\00"
define void @cm_equiv(i32 %0) {
%2 = icmp eq i32 %0, 1
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @add_word(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fsemu_option_read_bool_default(char const *, int *, int);
bool fsemu_option_enabled(const char *name) {
  bool result;
  fsemu_option_read_bool_default(name, &result, false);
  return result == true;
}


x86 assembly (clang, -O0):
<fsemu_option_enabled>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
xor    %edx,%edx
call   1030 <fsemu_option_read_bool_default@plt>
cmpl   $0x1,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fsemu_option_enabled>:
push   %rax
lea    0x4(%rsp),%rsi
xor    %edx,%edx
call   1030 <fsemu_option_read_bool_default@plt>
xor    %eax,%eax
cmpl   $0x1,0x4(%rsp)
sete   %al
pop    %rcx
ret

LLVM IR (-O0):
define i32 @fsemu_option_enabled(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @fsemu_option_read_bool_default(i8* %4, i32* %3, i32 0)
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, 1
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @fsemu_option_enabled(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @fsemu_option_read_bool_default(i8* %0, i32* %2, i32 0)
%5 = load i32, i32* %2
%6 = icmp eq i32 %5, 1
%7 = zext i1 %6 to i32
ret i32 %7
}
void ls_cost_nm10_decref(void) {}


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

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

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

LLVM IR (-O2):
define void @ls_cost_nm10_decref() {
ret void
}
reg0imm1(r0, r1, x0, x1, p0, p1) int r0, r1;
int *p0, *p1;
{
  if (r0 <= 33)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<reg0imm1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
cmpl   $0x21,-0x8(%rbp)
jg     112e <reg0imm1+0x2e>
movl   $0x1,-0x4(%rbp)
jmp    1135 <reg0imm1+0x35>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reg0imm1>:
xor    %eax,%eax
cmp    $0x22,%edi
setl   %al
ret

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

LLVM IR (-O2):
define i32 @reg0imm1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture readnone %4, i32* nocapture readnone %5) {
%7 = icmp slt i32 %0, 34
%8 = zext i1 %7 to i32
ret i32 %8
}
int is_delim(char c, char delim) {
  if (c == delim)
    return (1);
  else
    return (0);
}


x86 assembly (clang, -O0):
<is_delim>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x5(%rbp)
mov    %al,-0x6(%rbp)
movsbl -0x5(%rbp),%eax
movsbl -0x6(%rbp),%ecx
cmp    %ecx,%eax
jne    112c <is_delim+0x2c>
movl   $0x1,-0x4(%rbp)
jmp    1133 <is_delim+0x33>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_delim>:
xor    %eax,%eax
cmp    %sil,%dil
sete   %al
ret

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

LLVM IR (-O2):
define i32 @is_delim(i8 signext %0, i8 signext %1) {
%3 = icmp eq i8 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
int times2(int x) { return x * 2; }


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

x86 assembly (clang, -O2):
<times2>:
lea    (%rdi,%rdi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @times2(i32 %0) {
%2 = shl nsw i32 %0, 1
ret i32 %2
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void swap_xor(uint32_t *x, uint32_t *y) {
  *x = *x ^ *y;
  *x = *x ^ *y;
  *y = *x ^ *y;
}


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

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

LLVM IR (-O0):
define void @swap_xor(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* %5
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = xor i32 %6, %8
%10 = load i32*, i32** %3
store i32 %9, i32* %10
%11 = load i32*, i32** %3
%12 = load i32, i32* %11
%13 = load i32*, i32** %4
%14 = load i32, i32* %13
%15 = xor i32 %12, %14
%16 = load i32*, i32** %3
store i32 %15, i32* %16
%17 = load i32*, i32** %3
%18 = load i32, i32* %17
%19 = load i32*, i32** %4
%20 = load i32, i32* %19
%21 = xor i32 %18, %20
%22 = load i32*, i32** %4
store i32 %21, i32* %22
ret void
}

LLVM IR (-O2):
define void @swap_xor(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = xor i32 %4, %3
store i32 %5, i32* %0
%6 = load i32, i32* %1
%7 = xor i32 %6, %5
store i32 %7, i32* %0
%8 = load i32, i32* %1
%9 = xor i32 %8, %7
store i32 %9, i32* %1
ret void
}