xunge/DecIR huggingface dataset:
void scale_out(int *in[], int *out[], int *rel[]) {}


x86 assembly (clang, -O0):
<scale_out>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @scale_out(i32** %0, i32** %1, i32** %2) {
%4 = alloca i32**
%5 = alloca i32**
%6 = alloca i32**
store i32** %0, i32*** %4
store i32** %1, i32*** %5
store i32** %2, i32*** %6
ret void
}

LLVM IR (-O2):
define void @scale_out(i32** nocapture %0, i32** nocapture %1, i32** nocapture %2) {
ret void
}
int decode(char *code, int nlag, int offset) {
  return code[offset] * code[offset + nlag];
}


x86 assembly (clang, -O0):
<decode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%edx
add    -0xc(%rbp),%edx
movslq %edx,%rdx
movsbl (%rcx,%rdx,1),%ecx
imul   %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<decode>:
movslq %edx,%rax
movsbl (%rdi,%rax,1),%ecx
add    %esi,%eax
cltq
movsbl (%rdi,%rax,1),%eax
imul   %ecx,%eax
ret

LLVM IR (-O0):
define i32 @decode(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %6
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %7, i64 %9
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = load i8*, i8** %4
%14 = load i32, i32* %6
%15 = load i32, i32* %5
%16 = add nsw i32 %14, %15
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %13, i64 %17
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = mul nsw i32 %12, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @decode(i8* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %2 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = add nsw i32 %2, %1
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = mul nsw i32 %12, %7
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ bar();
void func3(void) { bar(); }


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

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

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

LLVM IR (-O2):
define void @func3() {
%1 = tail call i32 (...) @bar()
ret void
}
void slvsml(double **u, double **rhs) {
  void fill0(double **u, int n);
  double h = 0.5;
  fill0(u, 3);
  u[2][2] = -h * h * rhs[2][2] / 4.0;
}


x86 assembly (clang, -O0):
<slvsml>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  0xee0(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x3,%esi
call   1030 <fill0@plt>
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x18(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mulsd  0x10(%rax),%xmm0
movsd  0xe8f(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%rax
movsd  %xmm0,0x10(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<slvsml>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    $0x3,%esi
call   1030 <fill0@plt>
mov    0x10(%r14),%rax
movsd  0x10(%rax),%xmm0
mulsd  0xecb(%rip),%xmm0
mulsd  0xecb(%rip),%xmm0
mov    0x10(%rbx),%rax
movsd  %xmm0,0x10(%rax)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @slvsml(double** %0, double** %1) {
%3 = alloca double**
%4 = alloca double**
%5 = alloca double
store double** %0, double*** %3
store double** %1, double*** %4
store double 5.000000e-01, double* %5
%6 = load double**, double*** %3
%7 = load double, double* %5
%8 = fneg double %7
%9 = load double, double* %5
%10 = fmul double %8, %9
%11 = load double**, double*** %4
%12 = getelementptr inbounds double*, double** %11, i64 2
%13 = load double*, double** %12
%14 = getelementptr inbounds double, double* %13, i64 2
%15 = load double, double* %14
%16 = fmul double %10, %15
%17 = fdiv double %16, 4.000000e+00
%18 = load double**, double*** %3
%19 = getelementptr inbounds double*, double** %18, i64 2
%20 = load double*, double** %19
%21 = getelementptr inbounds double, double* %20, i64 2
store double %17, double* %21
ret void
}

LLVM IR (-O2):
define void @slvsml(double** %0, double** nocapture %1) {
tail call void @fill0(double** %0, i32 3)
%3 = getelementptr inbounds double*, double** %1, i64 2
%4 = load double*, double** %3
%5 = getelementptr inbounds double, double* %4, i64 2
%6 = load double, double* %5
%7 = fmul double %6, -2.500000e-01
%8 = fmul double %7, 2.500000e-01
%9 = getelementptr inbounds double*, double** %0, i64 2
%10 = load double*, double** %9
%11 = getelementptr inbounds double, double* %10, i64 2
store double %8, double* %11
ret void
}
void freeDDArr(char **DDArr, int n) {
  for (int i = 0; i < n; i++) {
    free(DDArr[i]);
  }
  free(DDArr);
}


x86 assembly (clang, -O0):
<freeDDArr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1151 <freeDDArr+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <freeDDArr+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freeDDArr>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1142 <freeDDArr+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <freeDDArr+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @freeDDArr(i8** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %8
6: ; preds = %8, %2
%7 = bitcast i8** %0 to i8*
tail call void @free(i8* %7)
ret void
8: ; preds = %4, %8
%9 = phi i64 [ 0, %4 ], [ %12, %8 ]
%10 = getelementptr inbounds i8*, i8** %0, i64 %9
%11 = load i8*, i8** %10
tail call void @free(i8* %11)
%12 = add nuw nsw i64 %9, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %6, label %8
}
void f_acc_routine(void) {
#pragma omp target
  ;
}


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

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

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

LLVM IR (-O2):
define void @f_acc_routine() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M370_f(char *s) {
  debug("M370_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M370_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M370_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M370_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M370_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M370_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M370_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
int __attribute__((no, noclone)) f3(float a, float b) { return a < b || a > b; }


x86 assembly (clang, -O0):
<f3>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
mov    $0x1,%al
ucomiss %xmm1,%xmm0
mov    %al,-0x9(%rbp)
ja     1135 <f3+0x35>
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
seta   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f3>:
xor    %eax,%eax
ucomiss %xmm1,%xmm0
setne  %al
ret

LLVM IR (-O0):
define i32 @f3(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fcmp olt float %5, %6
br i1 %7, label %12, label %8
8: ; preds = %2
%9 = load float, float* %3
%10 = load float, float* %4
%11 = fcmp ogt float %9, %10
br label %12
12: ; preds = %8, %2
%13 = phi i1 [ true, %2 ], [ %11, %8 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @f3(float %0, float %1) {
%3 = fcmp one float %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
void *malloc(int);
void *mymalloc(int);
int /*<<< orphan*/ printf(char *, void *, void *);
int /*<<< orphan*/ showcur();
int main() {
  showcur();
  void *k = malloc(409600000);
  showcur();
  void *p = mymalloc(5);
  printf(" %p %p\n", k, p);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <showcur@plt>
mov    $0x186a0000,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1060 <showcur@plt>
mov    $0x5,%edi
call   1050 <mymalloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xe78(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1060 <showcur@plt>
mov    $0x186a0000,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1060 <showcur@plt>
mov    $0x5,%edi
call   1050 <mymalloc@plt>
lea    0xe93(%rip),%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c" %p %p\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @showcur()
%2 = tail call dereferenceable_or_null(409600000) i8* @malloc(i32 409600000)
%3 = tail call i32 (...) @showcur()
%4 = tail call i8* @mymalloc(i32 5)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %2, i8* %4)
ret i32 0
}
void XRemoveHost() {}


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

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

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

LLVM IR (-O2):
define void @XRemoveHost() {
ret void
}
int get_most_significant_byte(int num) {
  int shift_val = (sizeof(int) - 1) << 3;
  int num_right = num >> shift_val;
  return num_right & 0xFF;
}


x86 assembly (clang, -O0):
<get_most_significant_byte>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x18,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0xff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_most_significant_byte>:
mov    %edi,%eax
shr    $0x18,%eax
ret

LLVM IR (-O0):
define i32 @get_most_significant_byte(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 24, i32* %3
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = ashr i32 %5, %6
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = and i32 %8, 255
ret i32 %9
}

LLVM IR (-O2):
define i32 @get_most_significant_byte(i32 %0) {
%2 = lshr i32 %0, 24
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int hash32_n(char *, int);
void example__hash32_n(void) {
  assert(hash32_n("", 0) == (2860486313));
  assert(hash32_n("abc", 3) == 2407100781);
}


x86 assembly (clang, -O0):
<example__hash32_n>:
push   %rbp
mov    %rsp,%rbp
lea    0xed8(%rip),%rdi
xor    %esi,%esi
call   1040 <hash32_n@plt>
cltq
mov    $0xaa7f8ea9,%ecx
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
lea    0xeb0(%rip),%rdi
mov    $0x3,%esi
call   1040 <hash32_n@plt>
cltq
mov    $0x8f79716d,%ecx
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<example__hash32_n>:
push   %rax
lea    0xedb(%rip),%rdi
xor    %esi,%esi
call   1040 <hash32_n@plt>
xor    %edi,%edi
call   1030 <assert@plt>
lea    0xec3(%rip),%rdi
mov    $0x3,%esi
call   1040 <hash32_n@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <assert@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [4 x i8] c"abc\00"
define void @example__hash32_n() {
%1 = call i32 @hash32_n(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 0)
%2 = sext i32 %1 to i64
%3 = icmp eq i64 %2, 2860486313
%4 = zext i1 %3 to i32
%5 = call i32 @assert(i32 %4)
%6 = call i32 @hash32_n(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 3)
%7 = sext i32 %6 to i64
%8 = icmp eq i64 %7, 2407100781
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [4 x i8] c"abc\00"
define void @example__hash32_n() {
%1 = tail call i32 @hash32_n(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 0)
%2 = tail call i32 @assert(i32 0)
%3 = tail call i32 @hash32_n(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 3)
%4 = tail call i32 @assert(i32 0)
ret void
}
int chmod(char *name, int mode) { return 0; }


x86 assembly (clang, -O0):
<chmod>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @chmod(i8* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ do_af();
int /*<<< orphan*/ set_pzs(int);
void set_apzs(int bits) {
  set_pzs(bits);
  do_af();
}


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

x86 assembly (clang, -O2):
<set_apzs>:
push   %rax
call   1040 <set_pzs@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <do_af@plt>

LLVM IR (-O0):
define void @set_apzs(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @set_pzs(i32 %3)
%5 = call i32 (...) @do_af()
ret void
}

LLVM IR (-O2):
define void @set_apzs(i32 %0) {
%2 = tail call i32 @set_pzs(i32 %0)
%3 = tail call i32 (...) @do_af()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ double_t;

/* Variables and functions */
int /*<<< orphan*/ hw_register_events(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ register_fueling();
int /*<<< orphan*/ setup_HW_interface();
int /*<<< orphan*/ setup_dash();
int /*<<< orphan*/ setup_fueling();
int main() {
  double_t pulse_width;
  setup_dash();
  setup_HW_interface();
  setup_fueling();
  while (1 == 1) {
    pulse_width = register_fueling();
    hw_register_events(pulse_width, 0);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <setup_dash@plt>
mov    $0x0,%al
call   1050 <setup_HW_interface@plt>
mov    $0x0,%al
call   1040 <setup_fueling@plt>
mov    $0x0,%al
call   1030 <register_fueling@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
xor    %esi,%esi
call   1070 <hw_register_events@plt>
jmp    1174 <main+0x24>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <setup_dash@plt>
xor    %eax,%eax
call   1050 <setup_HW_interface@plt>
xor    %eax,%eax
call   1040 <setup_fueling@plt>
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <register_fueling@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1070 <hw_register_events@plt>
jmp    1170 <main+0x20>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @setup_dash()
%4 = call i32 (...) @setup_HW_interface()
%5 = call i32 (...) @setup_fueling()
br label %6
6: ; preds = %0, %6
%7 = call i32 (...) @register_fueling()
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = call i32 @hw_register_events(i32 %8, i32 0)
br label %6
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @setup_dash()
%2 = tail call i32 (...) @setup_HW_interface()
%3 = tail call i32 (...) @setup_fueling()
br label %4
4: ; preds = %4, %0
%5 = tail call i32 (...) @register_fueling()
%6 = tail call i32 @hw_register_events(i32 %5, i32 0)
br label %4
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *slice_str(int, int /*<<< orphan*/, char const *);
int /*<<< orphan*/ strlen(char const *);
char *trim_str(char *);
char *upto_char(char *, char);
char *test_name_from_signature(const char *s) {
  char *slice = slice_str(4, strlen(s), s);
  char *fn = upto_char(slice, '(');
  char *fn_tr = trim_str(fn);
  free(slice);
  free(fn);
  return fn_tr;
}


x86 assembly (clang, -O0):
<test_name_from_signature>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <strlen@plt>
mov    %eax,%esi
mov    -0x8(%rbp),%rdx
mov    $0x4,%edi
call   1050 <slice_str@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x28,%esi
call   1040 <upto_char@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1070 <trim_str@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_name_from_signature>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%rbx
call   1060 <strlen@plt>
mov    $0x4,%edi
mov    %eax,%esi
mov    %rbx,%rdx
call   1050 <slice_str@plt>
mov    %rax,%r14
mov    %rax,%rdi
mov    $0x28,%esi
call   1040 <upto_char@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1070 <trim_str@plt>
mov    %rax,%r15
mov    %r14,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @test_name_from_signature(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %2
%6 = load i8*, i8** %2
%7 = call i32 @strlen(i8* %6)
%8 = load i8*, i8** %2
%9 = call i8* @slice_str(i32 4, i32 %7, i8* %8)
store i8* %9, i8** %3
%10 = load i8*, i8** %3
%11 = call i8* @upto_char(i8* %10, i8 signext 40)
store i8* %11, i8** %4
%12 = load i8*, i8** %4
%13 = call i8* @trim_str(i8* %12)
store i8* %13, i8** %5
%14 = load i8*, i8** %3
%15 = call i32 @free(i8* %14)
%16 = load i8*, i8** %4
%17 = call i32 @free(i8* %16)
%18 = load i8*, i8** %5
ret i8* %18
}

LLVM IR (-O2):
define i8* @test_name_from_signature(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i8* @slice_str(i32 4, i32 %2, i8* %0)
%4 = tail call i8* @upto_char(i8* %3, i8 signext 40)
%5 = tail call i8* @trim_str(i8* %4)
%6 = tail call i32 @free(i8* %3)
%7 = tail call i32 @free(i8* %4)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ strcpy(char *, char *);
void func(char *argv) {
  int authenticated = 0;
  char buffer[4];
  strcpy(buffer, argv);
  if (authenticated) {
    printf("you are logged in!\n");
  } else {
    printf("wrong user name or password!\n");
  }
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
lea    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
cmpl   $0x0,-0xc(%rbp)
je     115b <func+0x3b>
lea    0xeaf(%rip),%rdi
call   1040 <printf@plt>
jmp    1167 <func+0x47>
lea    0xeb2(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
push   %rax
mov    %rdi,%rsi
lea    0x4(%rsp),%rdi
call   1030 <strcpy@plt>
lea    0xecb(%rip),%rdi
call   1040 <puts@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [20 x i8] c"you are logged in!\0A\00"
@.str.1 = [30 x i8] c"wrong user name or password!\0A\00"
define void @func(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca [4 x i8]
store i8* %0, i8** %2
store i32 0, i32* %3
%5 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 0
%6 = load i8*, i8** %2
%7 = call i32 @strcpy(i8* %5, i8* %6)
%8 = load i32, i32* %3
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %14
12: ; preds = %1
%13 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
br label %14
14: ; preds = %12, %10
ret void
}

LLVM IR (-O2):
@str = [29 x i8] c"wrong user name or password!\00"
define void @func(i8* %0) {
%2 = alloca [4 x i8]
%3 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%4 = call i32 @strcpy(i8* %3, i8* %0)
%5 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
ret void
}
void Irc_Connect_f(void) {}


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

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

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

LLVM IR (-O2):
define void @Irc_Connect_f() {
ret void
}
/* Type definitions */
struct __sk_buff {
  int dummy;
};
typedef int /*<<< orphan*/ __u8;
typedef int /*<<< orphan*/ __u32;

/* Variables and functions */
void cilium_dbg(struct __sk_buff *skb, __u8 type, __u32 arg1, __u32 arg2) {}


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

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

LLVM IR (-O0):
%struct.__sk_buff = type { i32 }
define void @cilium_dbg(%struct.__sk_buff* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca %struct.__sk_buff*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store %struct.__sk_buff* %0, %struct.__sk_buff** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
ret void
}

LLVM IR (-O2):
%struct.__sk_buff = type { i32 }
define void @cilium_dbg(%struct.__sk_buff* nocapture %0, i32 %1, i32 %2, i32 %3) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void printHelpAndQuitConverter() {
  printf("Usage: ezparse <filename> <outputname>\n");
  exit(0);
}


x86 assembly (clang, -O0):
<printHelpAndQuitConverter>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<printHelpAndQuitConverter>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [40 x i8] c"Usage: ezparse <filename> <outputname>\0A\00"
define void @printHelpAndQuitConverter() {
%1 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [39 x i8] c"Usage: ezparse <filename> <outputname>\00"
define void @printHelpAndQuitConverter() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
int main(void) {
  const char code[] = "\x6a\x29\x58\x99\x6a\x01\x5e\x6a\x02\x5f"
                      "\x0f\x05\x97\xb0\x32\x0f\x05\x96\xb0\x2b"
                      "\x0f\x05\x97\x96\xff\xce\x6a\x21\x58\x0f"
                      "\x05\x75\xf7\x52\x48\xbf\x2f\x2f\x62\x69"
                      "\x6e\x2f\x73\x68\x57\x54\x5f\xb0\x3b\x0f"
                      "\x05";
  printf("Shellcode Length:  %ld\n", strlen(code));
  __asm__("lea %[code], %%r15\n\t"
          "mov $0xffffffffffffffff, %%rax\n\t"
          "mov %%rax, %%rbx\n\t"
          "mov %%rax, %%rcx\n\t"
          "mov %%rax, %%rdx\n\t"
          "mov %%rax, %%rsi\n\t"
          "mov %%rax, %%rdi\n\t"
          "mov %%rax, %%rbp\n\t"
          "call *%%r15\n\t"
          :
          : [code] "m"(code));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x40(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x34,%edx
call   1050 <memcpy@plt>
lea    -0x40(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%rsi
lea    0xed4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x40(%rbp),%r15
mov    $0xffffffffffffffff,%rax
mov    %rax,%rbx
mov    %rax,%rcx
mov    %rax,%rdx
mov    %rax,%rsi
mov    %rax,%rdi
mov    %rax,%rbp
call   *%r15
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
movaps 0xef5(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebd(%rip),%xmm0
movaps %xmm0,(%rsp)
movl   $0x50f3b,0x30(%rsp)
mov    %rsp,%rdi
call   1030 <strlen@plt>
lea    0xed6(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    (%rsp),%r15
mov    $0xffffffffffffffff,%rax
mov    %rax,%rbx
mov    %rax,%rcx
mov    %rax,%rdx
mov    %rax,%rsi
mov    %rax,%rdi
mov    %rax,%rbp
call   *%r15
xor    %eax,%eax
add    $0x38,%rsp
ret

LLVM IR (-O0):
@__const.main.code = [52 x i8] c"j)X\99j\01^j\02_\0F\05\97\B02\0F\05\96\B0+\0F\05\97\96\FF\CEj!X\0F\05u\F7RH\BF//bin/shWT_\B0;\0F\05\00"
@.str = [24 x i8] c"Shellcode Length: %ld\0A\00"
define i32 @main() {
%1 = alloca [52 x i8]
%2 = bitcast [52 x i8]* %1 to i8*
%3 = getelementptr inbounds [52 x i8], [52 x i8]* %1, i64 0, i64 0
%4 = call i64 @strlen(i8* %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i64 %4)
ret i32 0
}

LLVM IR (-O2):
@__const.main.code = [52 x i8] c"j)X\99j\01^j\02_\0F\05\97\B02\0F\05\96\B0+\0F\05\97\96\FF\CEj!X\0F\05u\F7RH\BF//bin/shWT_\B0;\0F\05\00"
@.str = [24 x i8] c"Shellcode Length: %ld\0A\00"
define i32 @main() {
%1 = alloca [52 x i8]
%2 = getelementptr inbounds [52 x i8], [52 x i8]* %1, i64 0, i64 0
%3 = call i64 @strlen(i8* %2)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i64 %3)
ret i32 0
}
void input_uninit() {}


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

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

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

LLVM IR (-O2):
define void @input_uninit() {
ret void
}
int test_imm_1Dint64_lowword_reg(long long val) {
  return ((val) & (0x1D << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_1Dint64_lowword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
and    $0x1d,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_1Dint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 29
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ DoOverflow(char *);
void main(int argc, char *argv[]) {
  if (argc == 2)
    DoOverflow(argv[1]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x4(%rbp)
jne    1136 <main+0x26>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <DoOverflow@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
cmp    $0x2,%edi
jne    111e <main+0xe>
mov    0x8(%rsi),%rdi
jmp    1030 <DoOverflow@plt>
ret

LLVM IR (-O0):
define void @main(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 = icmp eq i32 %5, 2
br i1 %6, label %7, label %12
7: ; preds = %2
%8 = load i8**, i8*** %4
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = load i8*, i8** %9
%11 = call i32 @DoOverflow(i8* %10)
br label %12
12: ; preds = %7, %2
ret void
}

LLVM IR (-O2):
define void @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @DoOverflow(i8* %6)
br label %8
8: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stdout;
void yyerror(void *parse_arg, void *scanner, char *errstr) {
  fprintf(stdout, "%s!\n", errstr);
}


x86 assembly (clang, -O0):
<yyerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
lea    0xec8(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yyerror>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [5 x i8] c"%s!\0A\00"
define void @yyerror(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i32, i32* @stdout
%8 = load i8*, i8** %6
%9 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %8)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [5 x i8] c"%s!\0A\00"
define void @yyerror(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* %2) {
%4 = load i32, i32* @stdout
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ UpdateDACchip(int);
void UpdateAllDAC(void) {
  int chip_no;
  for (chip_no = 0; chip_no <= 3; chip_no++)
    UpdateDACchip(chip_no);
}


x86 assembly (clang, -O0):
<UpdateAllDAC>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x3,-0x4(%rbp)
jg     113f <UpdateAllDAC+0x2f>
mov    -0x4(%rbp),%edi
call   1030 <UpdateDACchip@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <UpdateAllDAC+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UpdateAllDAC>:
push   %rax
xor    %edi,%edi
call   1030 <UpdateDACchip@plt>
mov    $0x1,%edi
call   1030 <UpdateDACchip@plt>
mov    $0x2,%edi
call   1030 <UpdateDACchip@plt>
mov    $0x3,%edi
pop    %rax
jmp    1030 <UpdateDACchip@plt>

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

LLVM IR (-O2):
define void @UpdateAllDAC() {
%1 = tail call i32 @UpdateDACchip(i32 0)
%2 = tail call i32 @UpdateDACchip(i32 1)
%3 = tail call i32 @UpdateDACchip(i32 2)
%4 = tail call i32 @UpdateDACchip(i32 3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ execl(char *, char *, char *, char const *,
                         int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void execl_test(const char *cmd) {
  execl("/bin/bash", "/bin/bash", "-c", cmd, NULL);
  fprintf(stderr, "execl failed\n");
}


x86 assembly (clang, -O0):
<execl_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
lea    0xec9(%rip),%rsi
lea    0xecc(%rip),%rdx
xor    %eax,%eax
mov    %eax,%r8d
mov    %rsi,%rdi
call   1040 <execl@plt>
mov    0x2e8e(%rip),%rax
mov    (%rax),%edi
lea    0xeb2(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<execl_test>:
push   %rax
mov    %rdi,%rcx
lea    0xed5(%rip),%rdi
lea    0xed8(%rip),%rdx
mov    %rdi,%rsi
xor    %r8d,%r8d
call   1040 <execl@plt>
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xec0(%rip),%rsi
pop    %rax
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"/bin/bash\00"
@.str.1 = [3 x i8] c"-c\00"
@stderr = global i32 0
@.str.2 = [14 x i8] c"execl failed\0A\00"
define void @execl_test(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @execl(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %3, i32* null)
%5 = load i32, i32* @stderr
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"/bin/bash\00"
@.str.1 = [3 x i8] c"-c\00"
@stderr = global i32 0
@.str.2 = [14 x i8] c"execl failed\0A\00"
define void @execl_test(i8* %0) {
%2 = tail call i32 @execl(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %0, i32* null)
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void Version(void) {
  printf("csv"
         " v"
         "2.6.0"
         "\n"
         "Written by Maximilian Eul <maximilian@eul.cc>, "
         "January 2020"
         ".\n"
         "MIT License <https://opensource.org/licenses/MIT>.\n"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [125 x i8] c"csv v2.6.0\0AWritten by Maximilian Eul <maximilian@eul.cc>, January 2020.\0AMIT License <https://opensource.org/licenses/MIT>.\0A\0A\00"
define void @Version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([125 x i8], [125 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [124 x i8] c"csv v2.6.0\0AWritten by Maximilian Eul <maximilian@eul.cc>, January 2020.\0AMIT License <https://opensource.org/licenses/MIT>.\0A\00"
define void @Version() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([124 x i8], [124 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ malloc(size_t);
double *dvector(long nl, long nh) {
  double *v;
  v = (double *)malloc((size_t)((nh - nl + 1 + 1) * sizeof(double)));
  return v - nl + 1;
}


x86 assembly (clang, -O0):
<dvector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
sub    -0x8(%rbp),%rdi
add    $0x1,%rdi
add    $0x1,%rdi
shl    $0x3,%rdi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
xor    %ecx,%ecx
sub    -0x8(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
add    $0x8,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dvector>:
push   %rbx
mov    %rdi,%rbx
sub    %rdi,%rsi
lea    0x10(,%rsi,8),%rdi
call   1030 <malloc@plt>
shl    $0x3,%rbx
neg    %rbx
add    %rbx,%rax
add    $0x8,%rax
pop    %rbx
ret

LLVM IR (-O0):
define double* @dvector(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca double*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = load i64, i64* %3
%8 = sub nsw i64 %6, %7
%9 = add nsw i64 %8, 1
%10 = add nsw i64 %9, 1
%11 = mul i64 %10, 8
%12 = call i64 @malloc(i64 %11)
%13 = inttoptr i64 %12 to double*
store double* %13, double** %5
%14 = load double*, double** %5
%15 = load i64, i64* %3
%16 = sub i64 0, %15
%17 = getelementptr inbounds double, double* %14, i64 %16
%18 = getelementptr inbounds double, double* %17, i64 1
ret double* %18
}

LLVM IR (-O2):
define double* @dvector(i64 %0, i64 %1) {
%3 = sub nsw i64 %1, %0
%4 = shl i64 %3, 3
%5 = add i64 %4, 16
%6 = tail call i64 @malloc(i64 %5)
%7 = inttoptr i64 %6 to double*
%8 = sub i64 0, %0
%9 = getelementptr inbounds double, double* %7, i64 %8
%10 = getelementptr inbounds double, double* %9, i64 1
ret double* %10
}
/* Variables and functions */
int __VERIFIER_nondet_bool();
int /*<<< orphan*/ free(int *);
int *malloc(int);
int main() {
  bool selector = __VERIFIER_nondet_bool();
  int *ptr;
  if (!selector) {
    ptr = malloc(sizeof(int));
  }
  if (selector) {
    *ptr = 666;
    free(ptr);
    ptr = NULL;
  }
  free(ptr);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <__VERIFIER_nondet_bool@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1161 <main+0x31>
mov    $0x4,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1186 <main+0x56>
mov    -0x10(%rbp),%rax
movl   $0x29a,(%rax)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <__VERIFIER_nondet_bool@plt>
mov    $0x4,%edi
call   1050 <malloc@plt>
mov    %rax,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
store i32 0, i32* %1
%4 = call i32 (...) @__VERIFIER_nondet_bool()
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %0
%8 = call i32* @malloc(i32 4)
store i32* %8, i32** %3
br label %9
9: ; preds = %7, %0
%10 = load i32, i32* %2
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %16
12: ; preds = %9
%13 = load i32*, i32** %3
store i32 666, i32* %13
%14 = load i32*, i32** %3
%15 = call i32 @free(i32* %14)
store i32* null, i32** %3
br label %16
16: ; preds = %12, %9
%17 = load i32*, i32** %3
%18 = call i32 @free(i32* %17)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_bool()
%2 = icmp eq i32 %1, 0
tail call void @llvm.assume(i1 %2)
%3 = tail call i32* @malloc(i32 4)
%4 = tail call i32 @free(i32* %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ KeccakP400_AddByte(void *, int, int);
int /*<<< orphan*/ keccakP400NRounds(void *, int);
void Ket_Step(void *state, unsigned int size,
              unsigned char frameAndPaddingBits) {
  KeccakP400_AddByte(state, frameAndPaddingBits, size);
  KeccakP400_AddByte(state, 0x08, (2 * 400 / 8 / 25));
  keccakP400NRounds(state, 1);
}


x86 assembly (clang, -O0):
<Ket_Step>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rdi
movzbl -0xd(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1040 <KeccakP400_AddByte@plt>
mov    -0x8(%rbp),%rdi
mov    $0x8,%esi
mov    $0x4,%edx
call   1040 <KeccakP400_AddByte@plt>
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1030 <keccakP400NRounds@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Ket_Step>:
push   %rbx
mov    %esi,%eax
mov    %rdi,%rbx
mov    %edx,%esi
mov    %eax,%edx
call   1040 <KeccakP400_AddByte@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
mov    $0x4,%edx
call   1040 <KeccakP400_AddByte@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
pop    %rbx
jmp    1030 <keccakP400NRounds@plt>

LLVM IR (-O0):
define void @Ket_Step(i8* %0, i32 %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8 %2, i8* %6
%7 = load i8*, i8** %4
%8 = load i8, i8* %6
%9 = zext i8 %8 to i32
%10 = load i32, i32* %5
%11 = call i32 @KeccakP400_AddByte(i8* %7, i32 %9, i32 %10)
%12 = load i8*, i8** %4
%13 = call i32 @KeccakP400_AddByte(i8* %12, i32 8, i32 4)
%14 = load i8*, i8** %4
%15 = call i32 @keccakP400NRounds(i8* %14, i32 1)
ret void
}

LLVM IR (-O2):
define void @Ket_Step(i8* %0, i32 %1, i8 zeroext %2) {
%4 = zext i8 %2 to i32
%5 = tail call i32 @KeccakP400_AddByte(i8* %0, i32 %4, i32 %1)
%6 = tail call i32 @KeccakP400_AddByte(i8* %0, i32 8, i32 4)
%7 = tail call i32 @keccakP400NRounds(i8* %0, i32 1)
ret void
}
void RTLogWriteStdOut(void) {}


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

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

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

LLVM IR (-O2):
define void @RTLogWriteStdOut() {
ret void
}
/* Variables and functions */
scalar_t__ Rand_div(int);
int mass_roll(int num, int max) {
  int i, t = 0;
  for (i = 0; i < num; i++)
    t += (Rand_div(max));
  return (t);
}


x86 assembly (clang, -O0):
<mass_roll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    115b <mass_roll+0x4b>
mov    -0x8(%rbp),%edi
call   1030 <Rand_div@plt>
mov    %rax,%rcx
movslq -0x10(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112c <mass_roll+0x1c>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mass_roll>:
push   %rbp
push   %r14
push   %rbx
test   %edi,%edi
jle    1131 <mass_roll+0x21>
mov    %esi,%r14d
mov    %edi,%ebx
xor    %ebp,%ebp
nop
mov    %r14d,%edi
call   1030 <Rand_div@plt>
add    %eax,%ebp
add    $0xffffffff,%ebx
jne    1120 <mass_roll+0x10>
jmp    1133 <mass_roll+0x23>
xor    %ebp,%ebp
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @mass_roll(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %12
4: ; preds = %2, %4
%5 = phi i32 [ %9, %4 ], [ 0, %2 ]
%6 = phi i32 [ %10, %4 ], [ 0, %2 ]
%7 = tail call i64 @Rand_div(i32 %1)
%8 = trunc i64 %7 to i32
%9 = add i32 %5, %8
%10 = add nuw nsw i32 %6, 1
%11 = icmp eq i32 %10, %0
br i1 %11, label %12, label %4
12: ; preds = %4, %2
%13 = phi i32 [ 0, %2 ], [ %9, %4 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void jam_free(void *ptr) { free(ptr); }


x86 assembly (clang, -O0):
<jam_free>:
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):
<jam_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @jam_free(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 @jam_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
void kmemleak_not_leak(const void *ptr) {}


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

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

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

LLVM IR (-O2):
define void @kmemleak_not_leak(i8* nocapture %0) {
ret void
}
int main(int argc, const char *argv[]) {
  int array[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
  int i;
  int min = array[0];
  for (i = 1; i < 10; ++i) {
    if (array[i] < min) {
      min = array[i];
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xecf(%rip),%rsi
mov    $0x28,%edx
call   1030 <memcpy@plt>
mov    -0x40(%rbp),%eax
mov    %eax,-0x48(%rbp)
movl   $0x1,-0x44(%rbp)
cmpl   $0xa,-0x44(%rbp)
jge    1181 <main+0x71>
movslq -0x44(%rbp),%rax
mov    -0x40(%rbp,%rax,4),%eax
cmp    -0x48(%rbp),%eax
jge    116e <main+0x5e>
movslq -0x44(%rbp),%rax
mov    -0x40(%rbp,%rax,4),%eax
mov    %eax,-0x48(%rbp)
jmp    1173 <main+0x63>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    1148 <main+0x38>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.array = [10 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9]
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [10 x i32]
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = bitcast [10 x i32]* %6 to i8*
%10 = getelementptr inbounds [10 x i32], [10 x i32]* %6, i64 0, i64 0
%11 = load i32, i32* %10
store i32 %11, i32* %8
store i32 1, i32* %7
br label %12
12: ; preds = %28, %2
%13 = load i32, i32* %7
%14 = icmp slt i32 %13, 10
br i1 %14, label %15, label %31
15: ; preds = %12
%16 = load i32, i32* %7
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [10 x i32], [10 x i32]* %6, i64 0, i64 %17
%19 = load i32, i32* %18
%20 = load i32, i32* %8
%21 = icmp slt i32 %19, %20
br i1 %21, label %22, label %27
22: ; preds = %15
%23 = load i32, i32* %7
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [10 x i32], [10 x i32]* %6, i64 0, i64 %24
%26 = load i32, i32* %25
store i32 %26, i32* %8
br label %27
27: ; preds = %22, %15
br label %28
28: ; preds = %27
%29 = load i32, i32* %7
%30 = add nsw i32 %29, 1
store i32 %30, i32* %7
br label %12
31: ; preds = %12
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}