xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ strcmp(char const *, char const *);
int wsock_str_eq(const char *s1, const char *s2) {
  if (!s1 && !s2)
    return 1;
  if (!s1 || !s2)
    return 0;
  return strcmp(s1, s2) ? 0 : 1;
}


x86 assembly (clang, -O0):
<wsock_str_eq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1142 <wsock_str_eq+0x32>
cmpq   $0x0,-0x18(%rbp)
jne    1142 <wsock_str_eq+0x32>
movl   $0x1,-0x4(%rbp)
jmp    1185 <wsock_str_eq+0x75>
cmpq   $0x0,-0x10(%rbp)
je     1158 <wsock_str_eq+0x48>
cmpq   $0x0,-0x18(%rbp)
jne    1164 <wsock_str_eq+0x54>
movl   $0x0,-0x4(%rbp)
jmp    1185 <wsock_str_eq+0x75>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp@plt>
mov    %rax,%rdx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wsock_str_eq>:
mov    $0x1,%eax
mov    %rdi,%rcx
or     %rsi,%rcx
je     113e <wsock_str_eq+0x2e>
xor    %eax,%eax
test   %rdi,%rdi
je     113e <wsock_str_eq+0x2e>
test   %rsi,%rsi
je     113e <wsock_str_eq+0x2e>
push   %rax
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32 @wsock_str_eq(i8* %0, i8* %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 = icmp ne i8* %6, null
br i1 %7, label %12, label %8
8: ; preds = %2
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %12, label %11
11: ; preds = %8
store i32 1, i32* %3
br label %26
12: ; preds = %8, %2
%13 = load i8*, i8** %4
%14 = icmp ne i8* %13, null
br i1 %14, label %15, label %18
15: ; preds = %12
%16 = load i8*, i8** %5
%17 = icmp ne i8* %16, null
br i1 %17, label %19, label %18
18: ; preds = %15, %12
store i32 0, i32* %3
br label %26
19: ; preds = %15
%20 = load i8*, i8** %4
%21 = load i8*, i8** %5
%22 = call i64 @strcmp(i8* %20, i8* %21)
%23 = icmp ne i64 %22, 0
%24 = zext i1 %23 to i64
%25 = select i1 %23, i32 0, i32 1
store i32 %25, i32* %3
br label %26
26: ; preds = %19, %18, %11
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
define i32 @wsock_str_eq(i8* %0, i8* %1) {
%3 = icmp ne i8* %0, null
%4 = icmp ne i8* %1, null
%5 = or i1 %3, %4
br i1 %5, label %6, label %12
6: ; preds = %2
%7 = and i1 %3, %4
br i1 %7, label %8, label %12
8: ; preds = %6
%9 = tail call i64 @strcmp(i8* %0, i8* %1)
%10 = icmp eq i64 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %6, %2, %8
%13 = phi i32 [ %11, %8 ], [ 1, %2 ], [ 0, %6 ]
ret i32 %13
}
void set_mouse_shape(void *new_shape) {}


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

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

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

LLVM IR (-O2):
define void @set_mouse_shape(i8* nocapture %0) {
ret void
}
int test_imm_26int8_reg(signed char val) {
  return ((val) & (0x26 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_26int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0x26,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_26int8_reg>:
test   $0x26,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_26int8_reg(i8 signext %0) {
%2 = and i8 %0, 38
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ pb(int);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int number;
  scanf("%d", &number);
  pb(number);
  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),%edi
call   1030 <pb@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),%edi
call   1030 <pb@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\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 = call i32 @pb(i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\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 = call i32 @pb(i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  do {
    printf("Hello there\n");
  } while (4 < 1);
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [12 x i8] c"Hello there\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(void) { printf("Usage: lstat <file1> <file2> ...\n"); }


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

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

LLVM IR (-O0):
@.str = [34 x i8] c"Usage: lstat <file1> <file2> ...\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [33 x i8] c"Usage: lstat <file1> <file2> ...\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
ret void
}
int xmlUCSIsTagbanwa(int code) {
  return (((code >= 0x1760) && (code <= 0x177F)));
}


x86 assembly (clang, -O0):
<xmlUCSIsTagbanwa>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x1760,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1126 <xmlUCSIsTagbanwa+0x26>
cmpl   $0x177f,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmlUCSIsTagbanwa>:
and    $0xffffffe0,%edi
xor    %eax,%eax
cmp    $0x1760,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @xmlUCSIsTagbanwa(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 5984
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 6015
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @xmlUCSIsTagbanwa(i32 %0) {
%2 = and i32 %0, -32
%3 = icmp eq i32 %2, 5984
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
void ts_set_pid(uint8_t *p_ts, uint16_t i_pid) {
  p_ts[1] &= ~0x1f;
  p_ts[1] |= (i_pid >> 8) & 0x1f;
  p_ts[2] = i_pid & 0xff;
}


x86 assembly (clang, -O0):
<ts_set_pid>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%ecx
and    $0xffffffe0,%ecx
mov    %ecx,0x4(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
and    $0x1f,%ecx
mov    -0x8(%rbp),%rax
or     0x4(%rax),%ecx
mov    %ecx,0x4(%rax)
mov    -0xc(%rbp),%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ts_set_pid>:
mov    0x4(%rdi),%eax
and    $0xffffffe0,%eax
movzbl %sil,%ecx
shr    $0x8,%esi
and    $0x1f,%esi
or     %eax,%esi
mov    %esi,0x4(%rdi)
mov    %ecx,0x8(%rdi)
ret

LLVM IR (-O0):
define void @ts_set_pid(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 = getelementptr inbounds i32, i32* %5, i64 1
%7 = load i32, i32* %6
%8 = and i32 %7, -32
store i32 %8, i32* %6
%9 = load i32, i32* %4
%10 = ashr i32 %9, 8
%11 = and i32 %10, 31
%12 = load i32*, i32** %3
%13 = getelementptr inbounds i32, i32* %12, i64 1
%14 = load i32, i32* %13
%15 = or i32 %14, %11
store i32 %15, i32* %13
%16 = load i32, i32* %4
%17 = and i32 %16, 255
%18 = load i32*, i32** %3
%19 = getelementptr inbounds i32, i32* %18, i64 2
store i32 %17, i32* %19
ret void
}

LLVM IR (-O2):
define void @ts_set_pid(i32* nocapture %0, i32 %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = load i32, i32* %3
%5 = and i32 %4, -32
%6 = lshr i32 %1, 8
%7 = and i32 %6, 31
%8 = or i32 %5, %7
store i32 %8, i32* %3
%9 = and i32 %1, 255
%10 = getelementptr inbounds i32, i32* %0, i64 2
store i32 %9, i32* %10
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ pthread_mutex_destroy(int /*<<< orphan*/ *);
int /*<<< orphan*/ shm_unlink(char *);
int delete_mutex(pthread_mutex_t *mutex) {
  pthread_mutex_destroy(mutex);
  shm_unlink("/ainod_mutex_lock");
  return 0;
}


x86 assembly (clang, -O0):
<delete_mutex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <pthread_mutex_destroy@plt>
lea    0xec4(%rip),%rdi
call   1040 <shm_unlink@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delete_mutex>:
push   %rax
call   1030 <pthread_mutex_destroy@plt>
lea    0xed3(%rip),%rdi
call   1040 <shm_unlink@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"/ainod_mutex_lock\00"
define i32 @delete_mutex(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @pthread_mutex_destroy(i32* %3)
%5 = call i32 @shm_unlink(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"/ainod_mutex_lock\00"
define i32 @delete_mutex(i32* %0) {
%2 = tail call i32 @pthread_mutex_destroy(i32* %0)
%3 = tail call i32 @shm_unlink(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int fun1011() { return 1011; }


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

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

LLVM IR (-O0):
define i32 @fun1011() {
ret i32 1011
}

LLVM IR (-O2):
define i32 @fun1011() {
ret i32 1011
}
double fahrenheitToCelsius(double fahrenheit) {
  return (fahrenheit - 32) / 1.8;
}


x86 assembly (clang, -O0):
<fahrenheitToCelsius>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xef2(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xede(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @fahrenheitToCelsius(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fsub double %3, 3.200000e+01
%5 = fdiv double %4, 1.800000e+00
ret double %5
}

LLVM IR (-O2):
define double @fahrenheitToCelsius(double %0) {
%2 = fadd double %0, -3.200000e+01
%3 = fdiv double %2, 1.800000e+00
ret double %3
}
void foo_1_1_2_2_2_1_2_1_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_1_2_2_2_1_2_1_1() {
ret void
}
int doubleSize() {
  double doubArray[10];
  double *doubPtr1;
  double *doubPtr2;
  return (long)(doubArray + 1) + (~(long)doubArray + 1);
}


x86 assembly (clang, -O0):
<doubleSize>:
push   %rbp
mov    %rsp,%rbp
lea    -0x50(%rbp),%rax
add    $0x8,%rax
lea    -0x50(%rbp),%rcx
xor    $0xffffffffffffffff,%rcx
add    $0x1,%rcx
add    %rcx,%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @doubleSize() {
%1 = alloca [10 x double]
%2 = alloca double*
%3 = alloca double*
%4 = getelementptr inbounds [10 x double], [10 x double]* %1, i64 0, i64 0
%5 = getelementptr inbounds double, double* %4, i64 1
%6 = ptrtoint double* %5 to i64
%7 = getelementptr inbounds [10 x double], [10 x double]* %1, i64 0, i64 0
%8 = ptrtoint double* %7 to i64
%9 = xor i64 %8, -1
%10 = add nsw i64 %9, 1
%11 = add nsw i64 %6, %10
%12 = trunc i64 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @doubleSize() {
ret i32 8
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
void do_nothing(time_t t) {}


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

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

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

LLVM IR (-O2):
define void @do_nothing(i32 %0) {
ret void
}
int main(void) {
  hello_world();
  hello_world(20);
  hello_world(20, 30.54);
  hello_world(20, 30.45, 'c');
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <hello_world@plt>
mov    $0x14,%edi
mov    $0x0,%al
call   1030 <hello_world@plt>
mov    $0x14,%edi
movsd  0xec9(%rip),%xmm0
mov    $0x1,%al
call   1030 <hello_world@plt>
mov    $0x14,%edi
movsd  0xead(%rip),%xmm0
mov    $0x63,%esi
mov    $0x1,%al
call   1030 <hello_world@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <hello_world@plt>
mov    $0x14,%edi
xor    %eax,%eax
call   1030 <hello_world@plt>
movsd  0xed4(%rip),%xmm0
mov    $0x14,%edi
mov    $0x1,%al
call   1030 <hello_world@plt>
movsd  0xec8(%rip),%xmm0
mov    $0x14,%edi
mov    $0x63,%esi
mov    $0x1,%al
call   1030 <hello_world@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @hello_world()
%3 = call i32 (i32, ...) bitcast (i32 (...)* @hello_world to i32 (i32, ...)*)(i32 20)
%4 = call i32 (i32, double, ...) bitcast (i32 (...)* @hello_world to i32 (i32, double, ...)*)(i32 20, double 3.054000e+01)
%5 = call i32 (i32, double, i32, ...) bitcast (i32 (...)* @hello_world to i32 (i32, double, i32, ...)*)(i32 20, double 3.045000e+01, i32 99)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @hello_world()
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @hello_world to i32 (i32, ...)*)(i32 20)
%3 = tail call i32 (i32, double, ...) bitcast (i32 (...)* @hello_world to i32 (i32, double, ...)*)(i32 20, double 3.054000e+01)
%4 = tail call i32 (i32, double, i32, ...) bitcast (i32 (...)* @hello_world to i32 (i32, double, i32, ...)*)(i32 20, double 3.045000e+01, i32 99)
ret i32 0
}
/* Variables and functions */
int getpid();
int foo() { return getpid(); }


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

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

LLVM IR (-O0):
define i32 @foo() {
%1 = call i32 (...) @getpid()
ret i32 %1
}

LLVM IR (-O2):
define i32 @foo() {
%1 = tail call i32 (...) @getpid()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void lil_freemem(void *ptr) { free(ptr); }


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

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

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

LLVM IR (-O2):
define void @lil_freemem(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EOI(int /*<<< orphan*/);
void timer_handler() { EOI(0); }


x86 assembly (clang, -O0):
<timer_handler>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <EOI@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<timer_handler>:
xor    %edi,%edi
jmp    1030 <EOI@plt>

LLVM IR (-O0):
define void @timer_handler() {
%1 = call i32 @EOI(i32 0)
ret void
}

LLVM IR (-O2):
define void @timer_handler() {
%1 = tail call i32 @EOI(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Print(char *);
void PrintLine(char text[]) {
  Print(text);
  Print("\n");
}


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

x86 assembly (clang, -O2):
<PrintLine>:
push   %rax
call   1030 <Print@plt>
lea    0xee3(%rip),%rdi
pop    %rax
jmp    1030 <Print@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define void @PrintLine(i8* %0) {
%2 = tail call i32 @Print(i8* %0)
%3 = tail call i32 @Print(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
int equalequal(int a, unsigned int b) { return ((unsigned int)a) == b; }


x86 assembly (clang, -O0):
<equalequal>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<equalequal>:
xor    %eax,%eax
cmp    %esi,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @equalequal(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ glob_t;

/* Variables and functions */
int /*<<< orphan*/ globfree(int /*<<< orphan*/ *);
void octave_globfree_wrapper(void *glob_info) { globfree((glob_t *)glob_info); }


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

x86 assembly (clang, -O2):
<octave_globfree_wrapper>:
jmp    1030 <globfree@plt>

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

LLVM IR (-O2):
define void @octave_globfree_wrapper(i8* %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 @globfree(i32* %2)
ret void
}
/* Type definitions */
struct stat {
  int st_mode;
};

/* Variables and functions */
int S_ISGID;
scalar_t__ stat(char *, struct stat *);
int _is_file_sgid(char *pathname) {
  struct stat st;
  if (stat(pathname, &st) != 0)
    return 0;
  return (st.st_mode & S_ISGID) ? 1 : 0;
}


x86 assembly (clang, -O0):
<_is_file_sgid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
je     113f <_is_file_sgid+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    115b <_is_file_sgid+0x4b>
mov    -0x18(%rbp),%edx
mov    0x2e97(%rip),%rax
and    (%rax),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_is_file_sgid>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     1125 <_is_file_sgid+0x15>
pop    %rcx
ret
mov    0x2eb4(%rip),%rax
mov    (%rax),%ecx
xor    %eax,%eax
test   %ecx,(%rsp)
setne  %al
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@S_ISGID = global i32 0
define i32 @_is_file_sgid(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @stat(i8* %5, %struct.stat* %4)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 0, i32* %2
br label %17
9: ; preds = %1
%10 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%11 = load i32, i32* %10
%12 = load i32, i32* @S_ISGID
%13 = and i32 %11, %12
%14 = icmp ne i32 %13, 0
%15 = zext i1 %14 to i64
%16 = select i1 %14, i32 1, i32 0
store i32 %16, i32* %2
br label %17
17: ; preds = %9, %8
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@S_ISGID = global i32 0
define i32 @_is_file_sgid(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %13
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = load i32, i32* @S_ISGID
%10 = and i32 %9, %8
%11 = icmp ne i32 %10, 0
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %1, %6
%14 = phi i32 [ %12, %6 ], [ 0, %1 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ crypt(char *, char *);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strncmp(char *, int /*<<< orphan*/, int);
int check_pwd(char *src, char *encd) {
  if (strcmp(encd, "") == 0)
    return (1);
  return (!strncmp(encd, crypt(src, encd), 16));
}


x86 assembly (clang, -O0):
<check_pwd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xeb5(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    1166 <check_pwd+0x36>
movl   $0x1,-0x4(%rbp)
jmp    119b <check_pwd+0x6b>
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <crypt@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%esi
mov    $0x10,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_pwd>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
lea    0xebf(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %rax,%rax
je     1173 <check_pwd+0x43>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <crypt@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    $0x10,%edx
call   1030 <strncmp@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
jmp    1178 <check_pwd+0x48>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i32 @check_pwd(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %5
%7 = call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 1, i32* %3
br label %19
10: ; preds = %2
%11 = load i8*, i8** %5
%12 = load i8*, i8** %4
%13 = load i8*, i8** %5
%14 = call i32 @crypt(i8* %12, i8* %13)
%15 = call i32 @strncmp(i8* %11, i32 %14, i32 16)
%16 = icmp ne i32 %15, 0
%17 = xor i1 %16, true
%18 = zext i1 %17 to i32
store i32 %18, i32* %3
br label %19
19: ; preds = %10, %9
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i32 @check_pwd(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %1, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i64 %3, 0
br i1 %4, label %10, label %5
5: ; preds = %2
%6 = tail call i32 @crypt(i8* %0, i8* %1)
%7 = tail call i32 @strncmp(i8* %1, i32 %6, i32 16)
%8 = icmp eq i32 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %2, %5
%11 = phi i32 [ %9, %5 ], [ 1, %2 ]
ret i32 %11
}
/* Variables and functions */
char *read_proc_line(char *);
char *readcpustat() { return read_proc_line("/proc/stat"); }


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"/proc/stat\00"
define i8* @readcpustat() {
%1 = call i8* @read_proc_line(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [11 x i8] c"/proc/stat\00"
define i8* @readcpustat() {
%1 = tail call i8* @read_proc_line(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ NQUEENS(int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  scanf("%d", &n);
  NQUEENS(n);
  return 1;
}


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

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

LLVM IR (-O0):
@.str = [3 x i8] c"%d\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 = call i32 @NQUEENS(i32 %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\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 = call i32 @NQUEENS(i32 %4)
ret i32 1
}
/* Variables and functions */
unsigned char inportb(int);
int /*<<< orphan*/ outportb(int, int);
int /*<<< orphan*/ printf(char *);
void main() {
  unsigned char Result;
  outportb(0x80, 0xFF);
  Result = inportb(0xE9);
  if (Result == 0xE9) {
    printf("Bochs detected.\n");
  } else {
    printf("Bochs not detected.\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x80,%edi
mov    $0xff,%esi
call   1050 <outportb@plt>
mov    $0xe9,%edi
call   1040 <inportb@plt>
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0xe9,%eax
jne    1174 <main+0x44>
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
jmp    1180 <main+0x50>
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x80,%edi
mov    $0xff,%esi
call   1050 <outportb@plt>
mov    $0xe9,%edi
call   1040 <inportb@plt>
cmp    $0xe9,%al
lea    0xec1(%rip),%rax
lea    0xea6(%rip),%rdi
cmove  %rax,%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"Bochs detected.\0A\00"
@.str.1 = [21 x i8] c"Bochs not detected.\0A\00"
define void @main() {
%1 = alloca i8
%2 = call i32 @outportb(i32 128, i32 255)
%3 = call zeroext i8 @inportb(i32 233)
store i8 %3, i8* %1
%4 = load i8, i8* %1
%5 = zext i8 %4 to i32
%6 = icmp eq i32 %5, 233
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %11
9: ; preds = %0
%10 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %9, %7
ret void
}

LLVM IR (-O2):
@str = [20 x i8] c"Bochs not detected.\00"
@str.2 = [16 x i8] c"Bochs detected.\00"
define void @main() {
%1 = tail call i32 @outportb(i32 128, i32 255)
%2 = tail call zeroext i8 @inportb(i32 233)
%3 = icmp eq i8 %2, -23
%4 = select i1 %3, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @str.2, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0)
%5 = tail call i32 @puts(i8* dereferenceable(1) %4)
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char const *);
int equals_to(const char *str1, const char *str2) {
  return strcmp(str1, str2) == 0;
}


x86 assembly (clang, -O0):
<equals_to>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<equals_to>:
push   %rax
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @equals_to(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 i64 @strcmp(i8* %5, i8* %6)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @equals_to(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
unsigned char frame_getseq(unsigned char *f) {
  if ((f[7] == 0x23) && (f[6] >= 0x21) && (f[6] <= 0x7E))
    return (f[6]);
  else
    return (0);
}


x86 assembly (clang, -O0):
<frame_getseq>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl 0x7(%rax),%eax
cmp    $0x23,%eax
jne    114a <frame_getseq+0x4a>
mov    -0x10(%rbp),%rax
movzbl 0x6(%rax),%eax
cmp    $0x21,%eax
jl     114a <frame_getseq+0x4a>
mov    -0x10(%rbp),%rax
movzbl 0x6(%rax),%eax
cmp    $0x7e,%eax
jg     114a <frame_getseq+0x4a>
mov    -0x10(%rbp),%rax
mov    0x6(%rax),%al
mov    %al,-0x1(%rbp)
jmp    114e <frame_getseq+0x4e>
movb   $0x0,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<frame_getseq>:
cmpb   $0x23,0x7(%rdi)
jne    1111 <frame_getseq+0x11>
mov    0x6(%rdi),%al
lea    -0x21(%rax),%ecx
cmp    $0x5e,%cl
jb     1113 <frame_getseq+0x13>
xor    %eax,%eax
ret

LLVM IR (-O0):
define zeroext i8 @frame_getseq(i8* %0) {
%2 = alloca i8
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = getelementptr inbounds i8, i8* %4, i64 7
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = icmp eq i32 %7, 35
br i1 %8, label %9, label %25
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 6
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = icmp sge i32 %13, 33
br i1 %14, label %15, label %25
15: ; preds = %9
%16 = load i8*, i8** %3
%17 = getelementptr inbounds i8, i8* %16, i64 6
%18 = load i8, i8* %17
%19 = zext i8 %18 to i32
%20 = icmp sle i32 %19, 126
br i1 %20, label %21, label %25
21: ; preds = %15
%22 = load i8*, i8** %3
%23 = getelementptr inbounds i8, i8* %22, i64 6
%24 = load i8, i8* %23
store i8 %24, i8* %2
br label %26
25: ; preds = %15, %9, %1
store i8 0, i8* %2
br label %26
26: ; preds = %25, %21
%27 = load i8, i8* %2
ret i8 %27
}

LLVM IR (-O2):
define zeroext i8 @frame_getseq(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 7
%3 = load i8, i8* %2
%4 = icmp eq i8 %3, 35
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = getelementptr inbounds i8, i8* %0, i64 6
%7 = load i8, i8* %6
%8 = add i8 %7, -33
%9 = icmp ult i8 %8, 94
br i1 %9, label %11, label %10
10: ; preds = %5, %1
br label %11
11: ; preds = %5, %10
%12 = phi i8 [ 0, %10 ], [ %7, %5 ]
ret i8 %12
}
void free_matrix(double ***M) {
  free(M[0][0]);
  free(M[0]);
  free(M);
}


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

x86 assembly (clang, -O2):
<free_matrix>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    (%rbx),%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_matrix(double*** %0) {
%2 = alloca double***
store double*** %0, double**** %2
%3 = load double***, double**** %2
%4 = getelementptr inbounds double**, double*** %3, i64 0
%5 = load double**, double*** %4
%6 = getelementptr inbounds double*, double** %5, i64 0
%7 = load double*, double** %6
%8 = bitcast double* %7 to i8*
%9 = load double***, double**** %2
%10 = getelementptr inbounds double**, double*** %9, i64 0
%11 = load double**, double*** %10
%12 = bitcast double** %11 to i8*
%13 = load double***, double**** %2
%14 = bitcast double*** %13 to i8*
ret void
}

LLVM IR (-O2):
define void @free_matrix(double*** nocapture %0) {
%2 = bitcast double*** %0 to i8***
%3 = load i8**, i8*** %2
%4 = load i8*, i8** %3
tail call void @free(i8* %4)
%5 = bitcast double*** %0 to i8**
%6 = load i8*, i8** %5
tail call void @free(i8* %6)
%7 = bitcast double*** %0 to i8*
tail call void @free(i8* %7)
ret void
}
/* Variables and functions */
char *GNU_getcwd();
char *getcwd(char *, unsigned int);
char *Getcwd(char *buffer, unsigned int size) {
  if (size == 0)
    return (GNU_getcwd());
  return (getcwd(buffer, size));
}


x86 assembly (clang, -O0):
<Getcwd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1149 <Getcwd+0x29>
mov    $0x0,%al
call   1030 <GNU_getcwd@plt>
mov    %rax,-0x8(%rbp)
jmp    1159 <Getcwd+0x39>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <getcwd@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Getcwd>:
test   %esi,%esi
je     1129 <Getcwd+0x9>
jmp    1040 <getcwd@plt>
xor    %eax,%eax
jmp    1030 <GNU_getcwd@plt>

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

LLVM IR (-O2):
define i8* @Getcwd(i8* %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i8* (...) @GNU_getcwd()
br label %8
6: ; preds = %2
%7 = tail call i8* @getcwd(i8* %0, i32 %1)
br label %8
8: ; preds = %6, %4
%9 = phi i8* [ %5, %4 ], [ %7, %6 ]
ret i8* %9
}
/* Variables and functions */
char *config_get(char const *);
char *nvram_get(const char *name) { return config_get(name); }


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

x86 assembly (clang, -O2):
<nvram_get>:
jmp    1030 <config_get@plt>

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

LLVM IR (-O2):
define i8* @nvram_get(i8* %0) {
%2 = tail call i8* @config_get(i8* %0)
ret i8* %2
}
void freeProbabilityArrays(double *unpaired, double **conditional_unpaired,
                           int length) {
  int i;
  free(unpaired);
  for (i = 1; i <= length; ++i)
    free(conditional_unpaired[i]);
  free(conditional_unpaired);
}


x86 assembly (clang, -O0):
<freeProbabilityArrays>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jg     115e <freeProbabilityArrays+0x4e>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1133 <freeProbabilityArrays+0x23>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freeProbabilityArrays>:
push   %r15
push   %r14
push   %rbx
mov    %edx,%r15d
mov    %rsi,%r14
call   1030 <free@plt>
test   %r15d,%r15d
jle    1142 <freeProbabilityArrays+0x32>
add    $0x1,%r15d
mov    $0x1,%ebx
xchg   %ax,%ax
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <freeProbabilityArrays+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @freeProbabilityArrays(double* nocapture %0, double** nocapture %1, i32 %2) {
%4 = bitcast double* %0 to i8*
tail call void @free(i8* %4)
%5 = icmp slt i32 %2, 1
br i1 %5, label %16, label %6
6: ; preds = %3
%7 = add nuw i32 %2, 1
%8 = zext i32 %7 to i64
br label %9
9: ; preds = %6, %9
%10 = phi i64 [ 1, %6 ], [ %14, %9 ]
%11 = getelementptr inbounds double*, double** %1, i64 %10
%12 = bitcast double** %11 to i8**
%13 = load i8*, i8** %12
tail call void @free(i8* %13)
%14 = add nuw nsw i64 %10, 1
%15 = icmp eq i64 %14, %8
br i1 %15, label %16, label %9
16: ; preds = %9, %3
%17 = bitcast double** %1 to i8*
tail call void @free(i8* %17)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int putc(int, int /*<<< orphan*/ *);
int fputc(int c, FILE *fp) { return putc(c, fp); }


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

x86 assembly (clang, -O2):
<fputc>:
jmp    1030 <putc@plt>

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

LLVM IR (-O2):
define i32 @fputc(i32 %0, i32* nocapture %1) {
%3 = tail call i32 @putc(i32 %0, i32* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ PF_INET;
int /*<<< orphan*/ SOCK_STREAM;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int socket_() {
  int sockfd = socket(PF_INET, SOCK_STREAM, 0);
  if (-1 == sockfd) {
    perror("socket");
    exit(1);
  }
  return sockfd;
}


x86 assembly (clang, -O0):
<socket_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
mov    0x2e98(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1050 <socket@plt>
mov    %eax,-0x4(%rbp)
mov    $0xffffffff,%eax
cmp    -0x4(%rbp),%eax
jne    1178 <socket_+0x48>
lea    0xe97(%rip),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<socket_>:
push   %rax
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
mov    0x2e9f(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1050 <socket@plt>
cmp    $0xffffffff,%eax
je     1151 <socket_+0x21>
pop    %rcx
ret
lea    0xea8(%rip),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@PF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str = [7 x i8] c"socket\00"
define i32 @socket_() {
%1 = alloca i32
%2 = load i32, i32* @PF_INET
%3 = load i32, i32* @SOCK_STREAM
%4 = call i32 @socket(i32 %2, i32 %3, i32 0)
store i32 %4, i32* %1
%5 = load i32, i32* %1
%6 = icmp eq i32 -1, %5
br i1 %6, label %7, label %10
7: ; preds = %0
%8 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @exit(i32 1)
unreachable
10: ; preds = %0
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
@PF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str = [7 x i8] c"socket\00"
define i32 @socket_() {
%1 = load i32, i32* @PF_INET
%2 = load i32, i32* @SOCK_STREAM
%3 = tail call i32 @socket(i32 %1, i32 %2, i32 0)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void jsPrint() {
  fprintf(stderr, "Unimplemented Javascript primitive myPrint!\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [45 x i8] c"Unimplemented Javascript primitive myPrint!\0A\00"
define void @jsPrint() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [45 x i8] c"Unimplemented Javascript primitive myPrint!\0A\00"
define void @jsPrint() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int *ptr = (int *)malloc(4 * sizeof(int));
  printf("%d\n", *(ptr + 3));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x10,%edi
call   1040 <malloc@plt>
mov    0xc(%rax),%esi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i64 @malloc(i32 16)
%2 = inttoptr i64 %1 to i32*
%3 = getelementptr inbounds i32, i32* %2, i64 3
%4 = load i32, i32* %3
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int keyzen_process_has_keys(int /*<<< orphan*/, char const **, int);
int keyzen_process_has_key(pid_t pid, const char *key) {
  return keyzen_process_has_keys(pid, &key, 1);
}


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

x86 assembly (clang, -O2):
<keyzen_process_has_key>:
push   %rax
mov    %rsi,(%rsp)
mov    %rsp,%rsi
mov    $0x1,%edx
call   1030 <keyzen_process_has_keys@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @keyzen_process_has_key(i32 %0, i8* %1) {
%3 = alloca i8*
store i8* %1, i8** %3
%4 = call i32 @keyzen_process_has_keys(i32 %0, i8** %3, i32 1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int main(int argc) {
  char c = (argc > 1) ? 1 : 0;
  printf("Result is %d\n", c);
  return c;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x1,%edx
cmovg  %ecx,%eax
mov    %al,-0x9(%rbp)
lea    0xec4(%rip),%rdi
movsbl -0x9(%rbp),%esi
call   1030 <printf@plt>
movsbl -0x9(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %ebx,%ebx
cmp    $0x2,%edi
setge  %bl
lea    0xee0(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Result is %d\0A\00"
define i32 @main(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8
store i32 0, i32* %2
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = icmp sgt i32 %5, 1
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 1, i32 0
%9 = trunc i32 %8 to i8
store i8 %9, i8* %4
%10 = load i8, i8* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8 signext %10)
%12 = load i8, i8* %4
%13 = sext i8 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
@.str = [14 x i8] c"Result is %d\0A\00"
define i32 @main(i32 %0) {
%2 = icmp sgt i32 %0, 1
%3 = zext i1 %2 to i8
%4 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8 signext %3)
%5 = zext i1 %2 to i32
ret i32 %5
}