xunge/DecIR huggingface dataset:
/* Type definitions */
struct per_cpu_info {
  int dummy;
};
struct blk_io_trace {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ process_fmt(char *, struct per_cpu_info *,
                               struct blk_io_trace *, unsigned long long,
                               int /*<<< orphan*/, int /*<<< orphan*/ *);
void log_action(struct per_cpu_info *pci, struct blk_io_trace *t, char *act) {
  process_fmt(act, pci, t, -1ULL, 0, NULL);
}


x86 assembly (clang, -O0):
<log_action>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0xffffffffffffffff,%rcx
xor    %r8d,%r8d
xor    %eax,%eax
mov    %eax,%r9d
call   1030 <process_fmt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_action>:
mov    %rdx,%rax
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    %rax,%rdi
mov    $0xffffffffffffffff,%rcx
xor    %r8d,%r8d
xor    %r9d,%r9d
jmp    1030 <process_fmt@plt>

LLVM IR (-O0):
%struct.per_cpu_info = type { i32 }
%struct.blk_io_trace = type { i32 }
define void @log_action(%struct.per_cpu_info* %0, %struct.blk_io_trace* %1, i8* %2) {
%4 = alloca %struct.per_cpu_info*
%5 = alloca %struct.blk_io_trace*
%6 = alloca i8*
store %struct.per_cpu_info* %0, %struct.per_cpu_info** %4
store %struct.blk_io_trace* %1, %struct.blk_io_trace** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %6
%8 = load %struct.per_cpu_info*, %struct.per_cpu_info** %4
%9 = load %struct.blk_io_trace*, %struct.blk_io_trace** %5
%10 = call i32 @process_fmt(i8* %7, %struct.per_cpu_info* %8, %struct.blk_io_trace* %9, i64 -1, i32 0, i32* null)
ret void
}

LLVM IR (-O2):
%struct.per_cpu_info = type { i32 }
%struct.blk_io_trace = type { i32 }
define void @log_action(%struct.per_cpu_info* %0, %struct.blk_io_trace* %1, i8* %2) {
%4 = tail call i32 @process_fmt(i8* %2, %struct.per_cpu_info* %0, %struct.blk_io_trace* %1, i64 -1, i32 0, i32* null)
ret void
}
void __test__myutil__util__test__() {}


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

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

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

LLVM IR (-O2):
define void @__test__myutil__util__test__() {
ret void
}
int poramni(int a) {
  if (a <= 0)
    return 0;
  int retval = a % 10;
  if (retval == 9)
    retval = 7;
  return poramni(a / 10) * 10 + retval;
}


x86 assembly (clang, -O0):
<poramni>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jg     1131 <poramni+0x21>
movl   $0x0,-0x4(%rbp)
jmp    116b <poramni+0x5b>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
cmpl   $0x9,-0xc(%rbp)
jne    1150 <poramni+0x40>
movl   $0x7,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <poramni@plt>
imul   $0xa,%eax,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<poramni>:
test   %edi,%edi
jle    1146 <poramni+0x36>
push   %rbx
mov    %edi,%ecx
mov    $0xcccccccd,%eax
imul   %rcx,%rax
shr    $0x23,%rax
lea    (%rax,%rax,1),%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%edi
cmp    $0x9,%edi
mov    $0x7,%ebx
cmovne %edi,%ebx
mov    %eax,%edi
call   1030 <poramni@plt>
lea    (%rax,%rax,4),%eax
lea    (%rbx,%rax,2),%eax
pop    %rbx
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @poramni(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %3, label %5
3: ; preds = %1, %5
%4 = phi i32 [ %12, %5 ], [ 0, %1 ]
ret i32 %4
5: ; preds = %1
%6 = urem i32 %0, 10
%7 = icmp eq i32 %6, 9
%8 = select i1 %7, i32 7, i32 %6
%9 = udiv i32 %0, 10
%10 = tail call i32 @poramni(i32 %9)
%11 = mul nsw i32 %10, 10
%12 = add nsw i32 %11, %8
br label %3
}
void computeVariables(double voi, double *states, double *rates,
                      double *variables) {
  variables[0] = states[0] + states[0];
  variables[1] = 0.001 * states[0] + 0.001 * states[0];
}


x86 assembly (clang, -O0):
<computeVariables>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
addsd  (%rax),%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  0xebf(%rip),%xmm1
mulsd  (%rax),%xmm1
movsd  0xeb3(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<computeVariables>:
movsd  (%rdi),%xmm0
addsd  %xmm0,%xmm0
movsd  %xmm0,(%rdx)
movsd  (%rdi),%xmm0
mulsd  0xee8(%rip),%xmm0
addsd  %xmm0,%xmm0
movsd  %xmm0,0x8(%rdx)
ret

LLVM IR (-O0):
define void @computeVariables(double %0, double* %1, double* %2, double* %3) {
%5 = alloca double
%6 = alloca double*
%7 = alloca double*
%8 = alloca double*
store double %0, double* %5
store double* %1, double** %6
store double* %2, double** %7
store double* %3, double** %8
%9 = load double*, double** %6
%10 = getelementptr inbounds double, double* %9, i64 0
%11 = load double, double* %10
%12 = load double*, double** %6
%13 = getelementptr inbounds double, double* %12, i64 0
%14 = load double, double* %13
%15 = fadd double %11, %14
%16 = load double*, double** %8
%17 = getelementptr inbounds double, double* %16, i64 0
store double %15, double* %17
%18 = load double*, double** %6
%19 = getelementptr inbounds double, double* %18, i64 0
%20 = load double, double* %19
%21 = load double*, double** %6
%22 = getelementptr inbounds double, double* %21, i64 0
%23 = load double, double* %22
%24 = fmul double 1.000000e-03, %23
%25 = call double @llvm.fmuladd.f64(double 1.000000e-03, double %20, double %24)
%26 = load double*, double** %8
%27 = getelementptr inbounds double, double* %26, i64 1
store double %25, double* %27
ret void
}

LLVM IR (-O2):
define void @computeVariables(double %0, double* nocapture %1, double* nocapture readnone %2, double* nocapture writeonly %3) {
%5 = load double, double* %1
%6 = fadd double %5, %5
store double %6, double* %3
%7 = load double, double* %1
%8 = fmul double %7, 1.000000e-03
%9 = tail call double @llvm.fmuladd.f64(double %7, double 1.000000e-03, double %8)
%10 = getelementptr inbounds double, double* %3, i64 1
store double %9, double* %10
ret void
}
int configurableLibraryResult() { return 42; }


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

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

LLVM IR (-O0):
define i32 @configurableLibraryResult() {
ret i32 42
}

LLVM IR (-O2):
define i32 @configurableLibraryResult() {
ret i32 42
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void printedge(const void *data) { printf("%02d ", *(int *)data); }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"%02d \00"
define void @printedge(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
void VecSelfSubtract3fv(float v[3], const float a[3]) {
  v[0] -= a[0];
  v[1] -= a[1];
  v[2] -= a[2];
}


x86 assembly (clang, -O0):
<VecSelfSubtract3fv>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm1
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
subss  %xmm1,%xmm0
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm1
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
subss  %xmm1,%xmm0
movss  %xmm0,0x4(%rax)
mov    -0x10(%rbp),%rax
movss  0x8(%rax),%xmm1
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm0
subss  %xmm1,%xmm0
movss  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<VecSelfSubtract3fv>:
movss  (%rdi),%xmm0
movss  0x4(%rdi),%xmm1
subss  (%rsi),%xmm0
movss  %xmm0,(%rdi)
subss  0x4(%rsi),%xmm1
movss  %xmm1,0x4(%rdi)
movss  0x8(%rdi),%xmm0
subss  0x8(%rsi),%xmm0
movss  %xmm0,0x8(%rdi)
ret

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

LLVM IR (-O2):
define void @VecSelfSubtract3fv(float* nocapture %0, float* nocapture %1) {
%3 = load float, float* %1
%4 = load float, float* %0
%5 = fsub float %4, %3
store float %5, float* %0
%6 = getelementptr inbounds float, float* %1, i64 1
%7 = load float, float* %6
%8 = getelementptr inbounds float, float* %0, i64 1
%9 = load float, float* %8
%10 = fsub float %9, %7
store float %10, float* %8
%11 = getelementptr inbounds float, float* %1, i64 2
%12 = load float, float* %11
%13 = getelementptr inbounds float, float* %0, i64 2
%14 = load float, float* %13
%15 = fsub float %14, %12
store float %15, float* %13
ret void
}
int addring(int i) { return (i + 1) == 32 ? 0 : i + 1; }


x86 assembly (clang, -O0):
<addring>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
cmp    $0x20,%eax
jne    1120 <addring+0x20>
xor    %eax,%eax
mov    %eax,-0x8(%rbp)
jmp    1129 <addring+0x29>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<addring>:
lea    0x1(%rdi),%ecx
xor    %eax,%eax
cmp    $0x20,%ecx
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define i32 @addring(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
%5 = icmp eq i32 %4, 32
br i1 %5, label %6, label %7
6: ; preds = %1
br label %10
7: ; preds = %1
%8 = load i32, i32* %2
%9 = add nsw i32 %8, 1
br label %10
10: ; preds = %7, %6
%11 = phi i32 [ 0, %6 ], [ %9, %7 ]
ret i32 %11
}

LLVM IR (-O2):
define i32 @addring(i32 %0) {
%2 = add nsw i32 %0, 1
%3 = icmp eq i32 %2, 32
%4 = select i1 %3, i32 0, i32 %2
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ eembed_exit(int /*<<< orphan*/);
void eembed_exit_failure(void) { eembed_exit(EXIT_FAILURE); }


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

x86 assembly (clang, -O2):
<eembed_exit_failure>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <eembed_exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define void @eembed_exit_failure() {
%1 = load i32, i32* @EXIT_FAILURE
%2 = call i32 @eembed_exit(i32 %1)
ret void
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define void @eembed_exit_failure() {
%1 = load i32, i32* @EXIT_FAILURE
%2 = tail call i32 @eembed_exit(i32 %1)
ret void
}
/* Variables and functions */
double RAND_MAX;
scalar_t__ rand();
float ct_normrandf() { return (float)rand() * (float)(2.0 / RAND_MAX) - 1.0f; }


x86 assembly (clang, -O0):
<ct_normrandf>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2ss %rax,%xmm0
movsd  0xee0(%rip),%xmm1
mov    0x2eb9(%rip),%rax
divsd  (%rax),%xmm1
cvtsd2ss %xmm1,%xmm1
mulss  %xmm1,%xmm0
movss  0xebd(%rip),%xmm1
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ct_normrandf>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2ss %rax,%xmm1
mov    0x2ec4(%rip),%rax
movsd  0xed4(%rip),%xmm0
divsd  (%rax),%xmm0
cvtsd2ss %xmm0,%xmm0
mulss  %xmm1,%xmm0
addss  0xec8(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define float @ct_normrandf() {
%1 = call i64 (...) @rand()
%2 = sitofp i64 %1 to float
%3 = load double, double* @RAND_MAX
%4 = fdiv double 2.000000e+00, %3
%5 = fptrunc double %4 to float
%6 = call float @llvm.fmuladd.f32(float %2, float %5, float -1.000000e+00)
ret float %6
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define float @ct_normrandf() {
%1 = tail call i64 (...) @rand()
%2 = sitofp i64 %1 to float
%3 = load double, double* @RAND_MAX
%4 = fdiv double 2.000000e+00, %3
%5 = fptrunc double %4 to float
%6 = tail call float @llvm.fmuladd.f32(float %2, float %5, float -1.000000e+00)
ret float %6
}
/* Variables and functions */
int sea_platform_buffer_is_valid(void *buffer) { return buffer != NULL; }


x86 assembly (clang, -O0):
<sea_platform_buffer_is_valid>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sea_platform_buffer_is_valid>:
xor    %eax,%eax
test   %rdi,%rdi
setne  %al
ret

LLVM IR (-O0):
define i32 @sea_platform_buffer_is_valid(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @sea_platform_buffer_is_valid(i8* readnone %0) {
%2 = icmp ne i8* %0, null
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int nondet();
int main() {
  int i, z, n;
  n = nondet();
  z = 0;
  for (i = 0; i < n; i++) {
    z += i;
  }
  assert(z >= 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <nondet@plt>
mov    %eax,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    116a <main+0x4a>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1147 <main+0x27>
cmpl   $0x0,-0xc(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <nondet@plt>
mov    $0x1,%edi
call   1040 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @nondet()
%2 = tail call i32 @assert(i32 1)
ret i32 0
}
int length(char *p) {
  int i = 0;
  while (p[i] != '\0')
    i++;
  return i;
}


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

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

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

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


x86 assembly (clang, -O0):
<am_big_endian>:
push   %rbp
mov    %rsp,%rbp
movq   $0x1,-0x8(%rbp)
cmpb   $0x0,-0x8(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @am_big_endian() {
%1 = alloca i64
store i64 1, i64* %1
%2 = bitcast i64* %1 to i8*
%3 = load i8, i8* %2
%4 = icmp ne i8 %3, 0
%5 = xor i1 %4, true
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @am_big_endian() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void bit_array_destroy(void *array) {
  if (array)
    free(array);
}


x86 assembly (clang, -O0):
<bit_array_destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <bit_array_destroy+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_array_destroy>:
test   %rdi,%rdi
je     111a <bit_array_destroy+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @bit_array_destroy(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @free(i8* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @bit_array_destroy(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
void UKF_Wind_Estimator_initialize(void) {}


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

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

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

LLVM IR (-O2):
define void @UKF_Wind_Estimator_initialize() {
ret void
}
/* Variables and functions */
scalar_t__ arc4random_uniform(int);
int nrand(int n) { return (int)arc4random_uniform(n); }


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

x86 assembly (clang, -O2):
<nrand>:
jmp    1030 <arc4random_uniform@plt>

LLVM IR (-O0):
define i32 @nrand(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @arc4random_uniform(i32 %3)
%5 = trunc i64 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @nrand(i32 %0) {
%2 = tail call i64 @arc4random_uniform(i32 %0)
%3 = trunc i64 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void sig_alarm(int signo) { printf("sig_alarm\n"); }


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

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

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

LLVM IR (-O2):
@str = [10 x i8] c"sig_alarm\00"
define void @sig_alarm(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int /*<<< orphan*/ umask(int /*<<< orphan*/);
mode_t get_umask(void) {
  mode_t current_umask;
  current_umask = umask((mode_t)022);
  umask(current_umask);
  return current_umask;
}


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

x86 assembly (clang, -O2):
<get_umask>:
push   %rbx
mov    $0x12,%edi
call   1030 <umask@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1030 <umask@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @get_umask() {
%1 = alloca i32
%2 = call i32 @umask(i32 18)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = call i32 @umask(i32 %3)
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
define i32 @get_umask() {
%1 = tail call i32 @umask(i32 18)
%2 = tail call i32 @umask(i32 %1)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRNOTIMPLEMENTED_swap(char *, int);
void U_WMRA0_swap(char *record, int torev) {
  U_WMRNOTIMPLEMENTED_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_WMRA0_swap>:
jmp    1030 <U_WMRNOTIMPLEMENTED_swap@plt>

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

LLVM IR (-O2):
define void @U_WMRA0_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %0, i32 %1)
ret void
}
extern int gui_ksys_get_mouse_buttons_state(void) {
  int value;
  __asm__ __volatile__("int $0x40" : "=a"(value) : "a"(37), "b"(2));
  return (value);
}


x86 assembly (clang, -O0):
<gui_ksys_get_mouse_buttons_state>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    $0x25,%eax
mov    $0x2,%ebx
int    $0x40
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<gui_ksys_get_mouse_buttons_state>:
push   %rbx
mov    $0x25,%eax
mov    $0x2,%ebx
int    $0x40
pop    %rbx
ret

LLVM IR (-O0):
define i32 @gui_ksys_get_mouse_buttons_state() {
%1 = alloca i32
%2 = call i32 asm sideeffect "int $$0x40", "={ax},{ax},{bx},~{dirflag},~{fpsr},~{flags}"(i32 37, i32 2)
store i32 %2, i32* %1
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @gui_ksys_get_mouse_buttons_state() {
%1 = tail call i32 asm sideeffect "int $$0x40", "={ax},{ax},{bx},~{dirflag},~{fpsr},~{flags}"(i32 37, i32 2)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int, int, int, int);
int main() {
  char c;
  int i;
  short s;
  long l;
  float f;
  double d;
  printf("size of char is %d, int is %d\n"
         "short int is %d, long int is %d\n"
         "float is %d, double is %d\n",
         (int)sizeof c, (int)sizeof i, (int)sizeof s, (int)sizeof l,
         (int)sizeof f, (int)sizeof d);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x1,%esi
mov    $0x4,%r9d
mov    $0x2,%ecx
mov    $0x8,%r8d
mov    %r9d,%edx
movl   $0x8,(%rsp)
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x8,(%rsp)
lea    0xee1(%rip),%rdi
mov    $0x1,%esi
mov    $0x4,%edx
mov    $0x2,%ecx
mov    $0x8,%r8d
mov    $0x4,%r9d
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [89 x i8] c"size of char is %d, int is %d\0Ashort int is %d, long int is %d\0Afloat is %d, double is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i32
%4 = alloca i16
%5 = alloca i64
%6 = alloca float
%7 = alloca double
store i32 0, i32* %1
%8 = call i32 @printf(i8* getelementptr inbounds ([89 x i8], [89 x i8]* @.str, i64 0, i64 0), i32 1, i32 4, i32 2, i32 8, i32 4, i32 8)
ret i32 0
}

LLVM IR (-O2):
@.str = [89 x i8] c"size of char is %d, int is %d\0Ashort int is %d, long int is %d\0Afloat is %d, double is %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([89 x i8], [89 x i8]* @.str, i64 0, i64 0), i32 1, i32 4, i32 2, i32 8, i32 4, i32 8)
ret i32 0
}
void bc_error(const int mesg) {
  if (mesg >= 0)
    while (1) {
    }
}


x86 assembly (clang, -O0):
<bc_error>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     111b <bc_error+0x1b>
jmp    1116 <bc_error+0x16>
jmp    1116 <bc_error+0x16>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bc_error>:
test   %edi,%edi
js     1112 <bc_error+0x12>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
jmp    1110 <bc_error+0x10>
ret

LLVM IR (-O0):
define void @bc_error(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
br label %6
6: ; preds = %5, %6
br label %6
7: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @bc_error(i32 %0) {
%2 = icmp sgt i32 %0, -1
br i1 %2, label %3, label %4
3: ; preds = %1, %3
br label %3
4: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void *calloc(size_t, size_t);
int /*<<< orphan*/ printf(char *, long, long);
void *checkedCalloc(size_t nmemb, size_t size) {
  void *retVal = calloc(nmemb, size);
  if ((!retVal) && nmemb && size) {
    printf("calloc failed nmemb %ld size %ld\n", (long)nmemb, (long)size);
    abort();
  }
  return retVal;
}


x86 assembly (clang, -O0):
<checkedCalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    118d <checkedCalloc+0x5d>
cmpq   $0x0,-0x8(%rbp)
je     118d <checkedCalloc+0x5d>
cmpq   $0x0,-0x10(%rbp)
je     118d <checkedCalloc+0x5d>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xe7f(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkedCalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
call   1050 <calloc@plt>
test   %rbx,%rbx
je     114e <checkedCalloc+0x1e>
test   %r14,%r14
je     114e <checkedCalloc+0x1e>
test   %rax,%rax
je     1156 <checkedCalloc+0x26>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
lea    0xea3(%rip),%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"calloc failed nmemb %ld size %ld\0A\00"
define i8* @checkedCalloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = call i8* @calloc(i64 %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %22, label %11
11: ; preds = %2
%12 = load i64, i64* %3
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %22
14: ; preds = %11
%15 = load i64, i64* %4
%16 = icmp ne i64 %15, 0
br i1 %16, label %17, label %22
17: ; preds = %14
%18 = load i64, i64* %3
%19 = load i64, i64* %4
%20 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i64 %18, i64 %19)
%21 = call i32 (...) @abort()
unreachable
22: ; preds = %14, %11, %2
%23 = load i8*, i8** %5
ret i8* %23
}

LLVM IR (-O2):
@.str = [34 x i8] c"calloc failed nmemb %ld size %ld\0A\00"
define noalias i8* @checkedCalloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp eq i8* %3, null
%5 = icmp ne i64 %0, 0
%6 = and i1 %5, %4
%7 = icmp ne i64 %1, 0
%8 = and i1 %7, %6
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i64 %0, i64 %1)
%11 = tail call i32 (...) @abort()
unreachable
12: ; preds = %2
ret i8* %3
}
int operateSum(int (*sum)(int, int), int x, int y) { return sum(x, y); }


x86 assembly (clang, -O0):
<operateSum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<operateSum>:
mov    %rdi,%rax
mov    %esi,%edi
mov    %edx,%esi
jmp    *%rax

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

LLVM IR (-O2):
define i32 @operateSum(i32 (i32, i32)* nocapture %0, i32 %1, i32 %2) {
%4 = tail call i32 %0(i32 %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long);
void print_long(long n) { printf("%ld", n); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%ld\00"
define void @print_long(i64 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %0)
ret void
}
char compatibleEdgeLabels(int l1, int l2) { return (l1 == l2); }


x86 assembly (clang, -O0):
<compatibleEdgeLabels>:
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
movsbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i8 @compatibleEdgeLabels(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
%9 = trunc i32 %8 to i8
ret i8 %9
}

LLVM IR (-O2):
define signext i8 @compatibleEdgeLabels(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
%4 = zext i1 %3 to i8
ret i8 %4
}
long long bit13() { return 0x0000000000002000LL; }


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

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

LLVM IR (-O0):
define i64 @bit13() {
ret i64 8192
}

LLVM IR (-O2):
define i64 @bit13() {
ret i64 8192
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int y_root;
};
typedef TYPE_1__ XKeyReleasedEvent;

/* Variables and functions */
void set_XKeyReleasedEvent_y_root(void *_p, int _v) {
  ((XKeyReleasedEvent *)_p)->y_root = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XKeyReleasedEvent_y_root>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XKeyReleasedEvent_y_root(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %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 i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XKeyReleasedEvent_y_root(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ execute();
int /*<<< orphan*/ parseargs(int, char **);
int main(int argc, char **argv) {
  parseargs(argc, argv);
  execute();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @parseargs(i32 %6, i8** %7)
%9 = call i32 (...) @execute()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @parseargs(i32 %0, i8** %1)
%4 = tail call i32 (...) @execute()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/
kpt_get_dense_BZ_grid_points_by_rotations(size_t *, int const *, int ***,
                                          int const, int const *, int const *,
                                          size_t const *);
void spg_get_dense_BZ_grid_points_by_rotations(
    size_t rot_grid_points[], const int address_orig[3], const int num_rot,
    int rot_reciprocal[][3][3], const int mesh[3], const int is_shift[3],
    const size_t bz_map[]) {
  kpt_get_dense_BZ_grid_points_by_rotations(rot_grid_points, address_orig,
                                            rot_reciprocal, num_rot, mesh,
                                            is_shift, bz_map);
}


x86 assembly (clang, -O0):
<spg_get_dense_BZ_grid_points_by_rotations>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
mov    0x10(%rbp),%rax
mov    %rax,(%rsp)
call   1030 <kpt_get_dense_BZ_grid_points_by_rotations@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spg_get_dense_BZ_grid_points_by_rotations>:
mov    %edx,%eax
mov    %rcx,%rdx
mov    %eax,%ecx
jmp    1030 <kpt_get_dense_BZ_grid_points_by_rotations@plt>

LLVM IR (-O0):
define void @spg_get_dense_BZ_grid_points_by_rotations(i64* %0, i32* %1, i32 %2, [3 x [3 x i32]]* %3, i32* %4, i32* %5, i64* %6) {
%8 = alloca i64*
%9 = alloca i32*
%10 = alloca i32
%11 = alloca [3 x [3 x i32]]*
%12 = alloca i32*
%13 = alloca i32*
%14 = alloca i64*
store i64* %0, i64** %8
store i32* %1, i32** %9
store i32 %2, i32* %10
store [3 x [3 x i32]]* %3, [3 x [3 x i32]]** %11
store i32* %4, i32** %12
store i32* %5, i32** %13
store i64* %6, i64** %14
%15 = load i64*, i64** %8
%16 = load i32*, i32** %9
%17 = load [3 x [3 x i32]]*, [3 x [3 x i32]]** %11
%18 = bitcast [3 x [3 x i32]]* %17 to i32***
%19 = load i32, i32* %10
%20 = load i32*, i32** %12
%21 = load i32*, i32** %13
%22 = load i64*, i64** %14
%23 = call i32 @kpt_get_dense_BZ_grid_points_by_rotations(i64* %15, i32* %16, i32*** %18, i32 %19, i32* %20, i32* %21, i64* %22)
ret void
}

LLVM IR (-O2):
define void @spg_get_dense_BZ_grid_points_by_rotations(i64* %0, i32* %1, i32 %2, [3 x [3 x i32]]* %3, i32* %4, i32* %5, i64* %6) {
%8 = bitcast [3 x [3 x i32]]* %3 to i32***
%9 = tail call i32 @kpt_get_dense_BZ_grid_points_by_rotations(i64* %0, i32* %1, i32*** %8, i32 %2, i32* %4, i32* %5, i64* %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_command(int);
void test_le_rand(const void *test_data) { test_command(0x2018); }


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

x86 assembly (clang, -O2):
<test_le_rand>:
mov    $0x2018,%edi
jmp    1030 <test_command@plt>

LLVM IR (-O0):
define void @test_le_rand(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @test_command(i32 8216)
ret void
}

LLVM IR (-O2):
define void @test_le_rand(i8* nocapture readnone %0) {
%2 = tail call i32 @test_command(i32 8216)
ret void
}
/* Variables and functions */
int syscall(int, int, char const *, int, int);
int faccessat(int fd, const char *filename, int amode, int flag) {
  return syscall(307, fd, filename, amode, flag);
}


x86 assembly (clang, -O0):
<faccessat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
mov    $0x133,%edi
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<faccessat>:
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0x133,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i32 @faccessat(i32 %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i8*, i8** %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i32 @syscall(i32 307, i32 %9, i8* %10, i32 %11, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @faccessat(i32 %0, i8* %1, i32 %2, i32 %3) {
%5 = tail call i32 @syscall(i32 307, i32 %0, i8* %1, i32 %2, i32 %3)
ret i32 %5
}
void free_dmatrix(m, nrl, nrh, ncl, nch) double **m;
long nch, ncl, nrh, nrl;
{
  free((char *)(m[nrl] + ncl - 1));
  free((char *)(m + nrl - 1));
}


x86 assembly (clang, -O0):
<free_dmatrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x20(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
add    $0xfffffffffffffff8,%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
add    $0xfffffffffffffff8,%rdi
call   1030 <free@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_dmatrix>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdi,%rsi,8),%rax
lea    (%rax,%rcx,8),%rdi
add    $0xfffffffffffffff8,%rdi
call   1030 <free@plt>
lea    (%rbx,%r14,8),%rdi
add    $0xfffffffffffffff8,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_dmatrix(double** nocapture %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = getelementptr inbounds double*, double** %0, i64 %1
%7 = load double*, double** %6
%8 = getelementptr inbounds double, double* %7, i64 %3
%9 = getelementptr inbounds double, double* %8, i64 -1
%10 = bitcast double* %9 to i8*
tail call void @free(i8* %10)
%11 = getelementptr inbounds double*, double** %6, i64 -1
%12 = bitcast double** %11 to i8*
tail call void @free(i8* %12)
ret void
}
/* Type definitions */
struct darr {
  int dummy;
};

/* Variables and functions */
void const *darr_element(struct darr *, size_t);
const void *darr_element_const(const struct darr *d, size_t i) {
  return darr_element((struct darr *)d, i);
}


x86 assembly (clang, -O0):
<darr_element_const>:
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 <darr_element@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<darr_element_const>:
jmp    1030 <darr_element@plt>

LLVM IR (-O0):
%struct.darr = type { i32 }
define i8* @darr_element_const(%struct.darr* %0, i64 %1) {
%3 = alloca %struct.darr*
%4 = alloca i64
store %struct.darr* %0, %struct.darr** %3
store i64 %1, i64* %4
%5 = load %struct.darr*, %struct.darr** %3
%6 = load i64, i64* %4
%7 = call i8* @darr_element(%struct.darr* %5, i64 %6)
ret i8* %7
}

LLVM IR (-O2):
%struct.darr = type { i32 }
define i8* @darr_element_const(%struct.darr* %0, i64 %1) {
%3 = tail call i8* @darr_element(%struct.darr* %0, i64 %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_buffer(int size, char buffer[]) {
  for (int x = 0; x < size; x++) {
    printf("%c", buffer[x]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<print_buffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    115a <print_buffer+0x4a>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <print_buffer+0x16>
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_buffer>:
push   %r15
push   %r14
push   %rbx
test   %edi,%edi
jle    1143 <print_buffer+0x33>
mov    %rsi,%r14
mov    %edi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl (%r14,%rbx,1),%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <print_buffer+0x20>
mov    $0xa,%edi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @print_buffer(i32 %0, i8* nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %8
6: ; preds = %8, %2
%7 = tail call i32 @putchar(i32 10)
ret void
8: ; preds = %4, %8
%9 = phi i64 [ 0, %4 ], [ %14, %8 ]
%10 = getelementptr inbounds i8, i8* %1, i64 %9
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = tail call i32 @putchar(i32 %12)
%14 = add nuw nsw i64 %9, 1
%15 = icmp eq i64 %14, %5
br i1 %15, label %6, label %8
}
/* Variables and functions */
int /*<<< orphan*/ errx(int, char *, char const *, char *);
void rule_addch(char *buf, int ch, size_t pos, const char *what) {
  if (pos >= 256 - 1)
    errx(1, "%s too long: %s", what, buf);
  buf[pos] = ch;
  buf[pos + 1] = '\0';
}


x86 assembly (clang, -O0):
<rule_addch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpq   $0xff,-0x18(%rbp)
jb     114e <rule_addch+0x3e>
mov    -0x20(%rbp),%rdx
mov    -0x8(%rbp),%rcx
mov    $0x1,%edi
lea    0xeb7(%rip),%rsi
call   1030 <errx@plt>
mov    -0xc(%rbp),%eax
mov    %al,%dl
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movb   $0x0,0x1(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rule_addch>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %esi,%ebp
mov    %rdi,%r14
cmp    $0xff,%rdx
jb     113c <rule_addch+0x2c>
lea    0xed4(%rip),%rsi
mov    $0x1,%edi
mov    %rcx,%rdx
mov    %r14,%rcx
call   1030 <errx@plt>
mov    %bpl,(%r14,%rbx,1)
movb   $0x0,0x1(%r14,%rbx,1)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [16 x i8] c"%s too long: %s\00"
define void @rule_addch(i8* %0, i32 %1, i64 %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i64
%8 = alloca i8*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i64 %2, i64* %7
store i8* %3, i8** %8
%9 = load i64, i64* %7
%10 = icmp uge i64 %9, 255
br i1 %10, label %11, label %15
11: ; preds = %4
%12 = load i8*, i8** %8
%13 = load i8*, i8** %5
%14 = call i32 @errx(i32 1, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %12, i8* %13)
br label %15
15: ; preds = %11, %4
%16 = load i32, i32* %6
%17 = trunc i32 %16 to i8
%18 = load i8*, i8** %5
%19 = load i64, i64* %7
%20 = getelementptr inbounds i8, i8* %18, i64 %19
store i8 %17, i8* %20
%21 = load i8*, i8** %5
%22 = load i64, i64* %7
%23 = add i64 %22, 1
%24 = getelementptr inbounds i8, i8* %21, i64 %23
store i8 0, i8* %24
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"%s too long: %s\00"
define void @rule_addch(i8* %0, i32 %1, i64 %2, i8* %3) {
%5 = icmp ugt i64 %2, 254
br i1 %5, label %6, label %8
6: ; preds = %4
%7 = tail call i32 @errx(i32 1, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %0)
br label %8
8: ; preds = %6, %4
%9 = trunc i32 %1 to i8
%10 = getelementptr inbounds i8, i8* %0, i64 %2
store i8 %9, i8* %10
%11 = add i64 %2, 1
%12 = getelementptr inbounds i8, i8* %0, i64 %11
store i8 0, i8* %12
ret void
}