xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ output(char *);
int /*<<< orphan*/ printClassName(int);
int /*<<< orphan*/ showClassInheritance(int);
int /*<<< orphan*/ sprintf(char *, char *, int);
void listClass(int c) {
  char str[80];
  sprintf(str, "%3d: ", c);
  output(str);
  printClassName(c);
  showClassInheritance(c);
}


x86 assembly (clang, -O0):
<listClass>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x60(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xea7(%rip),%rsi
call   1050 <sprintf@plt>
lea    -0x60(%rbp),%rdi
call   1030 <output@plt>
mov    -0x4(%rbp),%edi
call   1040 <printClassName@plt>
mov    -0x4(%rbp),%edi
call   1060 <showClassInheritance@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<listClass>:
push   %r14
push   %rbx
sub    $0x58,%rsp
mov    %edi,%ebx
lea    0xeb0(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
mov    %ebx,%edx
call   1050 <sprintf@plt>
mov    %r14,%rdi
call   1030 <output@plt>
mov    %ebx,%edi
call   1040 <printClassName@plt>
mov    %ebx,%edi
call   1060 <showClassInheritance@plt>
add    $0x58,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%3d: \00"
define void @listClass(i32 %0) {
%2 = alloca i32
%3 = alloca [80 x i8]
store i32 %0, i32* %2
%4 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%5 = load i32, i32* %2
%6 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%8 = call i32 @output(i8* %7)
%9 = load i32, i32* %2
%10 = call i32 @printClassName(i32 %9)
%11 = load i32, i32* %2
%12 = call i32 @showClassInheritance(i32 %11)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%3d: \00"
define void @listClass(i32 %0) {
%2 = alloca [80 x i8]
%3 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %0)
%5 = call i32 @output(i8* %3)
%6 = call i32 @printClassName(i32 %0)
%7 = call i32 @showClassInheritance(i32 %0)
ret void
}
int installuserdriver(char *name, int *detect) { return 0; }


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

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

LLVM IR (-O0):
define i32 @installuserdriver(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 @installuserdriver(i8* nocapture readnone %0, i32* nocapture readnone %1) {
ret i32 0
}
int main(int argc, char **argv) { return argv[0] == __func__; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
lea    0xee3(%rip),%rcx
cmp    %rcx,(%rax)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
lea    0xef9(%rip),%rcx
xor    %eax,%eax
cmp    %rcx,(%rsi)
sete   %al
ret

LLVM IR (-O0):
@__func__.main = [5 x i8] c"main\00"
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 i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 0
%8 = load i8*, i8** %7
%9 = icmp eq i8* %8, getelementptr inbounds ([5 x i8], [5 x i8]* @__func__.main, i64 0, i64 0)
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
@__func__.main = [5 x i8] c"main\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = icmp eq i8* %3, getelementptr inbounds ([5 x i8], [5 x i8]* @__func__.main, i64 0, i64 0)
%5 = zext i1 %4 to i32
ret i32 %5
}
void foo_1_1_1_1_2_2_2_2_1() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @__mp_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int /*<<< orphan*/);
void genLabel(char *label) {
  static int labelNum = 0;
  sprintf(label, "$$%d", labelNum++);
}


x86 assembly (clang, -O0):
<genLabel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2f06(%rip),%edx
mov    %edx,%eax
add    $0x1,%eax
mov    %eax,0x2efb(%rip)
lea    0xec8(%rip),%rsi
call   1030 <sprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<genLabel>:
mov    0x2f16(%rip),%edx
lea    0x1(%rdx),%eax
mov    %eax,0x2f0d(%rip)
lea    0xeda(%rip),%rsi
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
@genLabel.labelNum = internal global i32 0
@.str = [5 x i8] c"$$%d\00"
define void @genLabel(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @genLabel.labelNum
%5 = add nsw i32 %4, 1
store i32 %5, i32* @genLabel.labelNum
%6 = call i32 @sprintf(i8* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@genLabel.labelNum = internal unnamed_addr global i32 0
@.str = [5 x i8] c"$$%d\00"
define void @genLabel(i8* nocapture writeonly %0) {
%2 = load i32, i32* @genLabel.labelNum
%3 = add nsw i32 %2, 1
store i32 %3, i32* @genLabel.labelNum
%4 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
void check_CMM_type_signature(struct mem_source *src) {}


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

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

LLVM IR (-O0):
%struct.mem_source = type opaque
define void @check_CMM_type_signature(%struct.mem_source* %0) {
%2 = alloca %struct.mem_source*
store %struct.mem_source* %0, %struct.mem_source** %2
ret void
}

LLVM IR (-O2):
%struct.mem_source = type opaque
define void @check_CMM_type_signature(%struct.mem_source* nocapture %0) {
ret void
}
int intcompare(void *k1, void *k2) {
  int key1 = *(int *)k1;
  int key2 = *(int *)k2;
  return key1 == key2;
}


x86 assembly (clang, -O0):
<intcompare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<intcompare>:
mov    (%rdi),%ecx
xor    %eax,%eax
cmp    (%rsi),%ecx
sete   %al
ret

LLVM IR (-O0):
define i32 @intcompare(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
%9 = load i32, i32* %8
store i32 %9, i32* %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i32*
%12 = load i32, i32* %11
store i32 %12, i32* %6
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = icmp eq i32 %13, %14
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @intcompare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp eq i32 %4, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ zero_vect(double *, unsigned long);
void zero_mat(double **mat, unsigned long len_i, unsigned long len_j) {
  unsigned long i;
  for (i = 0; i < len_i; ++i)
    zero_vect(mat[i], len_j);
}


x86 assembly (clang, -O0):
<zero_mat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1160 <zero_mat+0x50>
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <zero_vect@plt>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    112c <zero_mat+0x1c>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zero_mat>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %rsi,%rsi
je     1145 <zero_mat+0x35>
mov    %rdx,%r14
mov    %rsi,%r12
mov    %rdi,%r15
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,8),%rdi
mov    %r14,%rsi
call   1030 <zero_vect@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <zero_mat+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @zero_mat(double** nocapture %0, i64 %1, i64 %2) {
%4 = icmp eq i64 %1, 0
br i1 %4, label %12, label %5
5: ; preds = %3, %5
%6 = phi i64 [ %10, %5 ], [ 0, %3 ]
%7 = getelementptr inbounds double*, double** %0, i64 %6
%8 = load double*, double** %7
%9 = tail call i32 @zero_vect(double* %8, i64 %2)
%10 = add nuw i64 %6, 1
%11 = icmp eq i64 %10, %1
br i1 %11, label %12, label %5
12: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dmmu_disable();
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ immu_disable();
int /*<<< orphan*/ printf(char *, char *, int);
int /*<<< orphan*/ report(int);
void fail(char *func, int line) {
  immu_disable();
  dmmu_disable();
  printf("Test failed in %s:%i\n", func, line);
  report(0xeeeeeeee);
  exit(1);
}


x86 assembly (clang, -O0):
<fail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <immu_disable@plt>
mov    $0x0,%al
call   1040 <dmmu_disable@plt>
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
lea    0xe85(%rip),%rdi
call   1050 <printf@plt>
mov    $0xeeeeeeee,%edi
call   1070 <report@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<fail>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <immu_disable@plt>
xor    %eax,%eax
call   1040 <dmmu_disable@plt>
lea    0xe93(%rip),%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
call   1050 <printf@plt>
mov    $0xeeeeeeee,%edi
call   1070 <report@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"Test failed in %s:%i\0A\00"
define void @fail(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = call i32 (...) @immu_disable()
%6 = call i32 (...) @dmmu_disable()
%7 = load i8*, i8** %3
%8 = load i32, i32* %4
%9 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %7, i32 %8)
%10 = call i32 @report(i32 -286331154)
%11 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [22 x i8] c"Test failed in %s:%i\0A\00"
define void @fail(i8* %0, i32 %1) {
%3 = tail call i32 (...) @immu_disable()
%4 = tail call i32 (...) @dmmu_disable()
%5 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
%6 = tail call i32 @report(i32 -286331154)
%7 = tail call i32 @exit(i32 1)
unreachable
}
__attribute__((always_)) void ftrace_nmi_exit(void) {}


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

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

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

LLVM IR (-O2):
define void @ftrace_nmi_exit() {
ret void
}
int randomi(min, max)
int min, max;
{ return (rand() / (2147483647 / (max - min + .5)) + min); }


x86 assembly (clang, -O0):
<randomi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2sd %eax,%xmm0
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
cvtsi2sd %eax,%xmm2
movsd  0xecd(%rip),%xmm1
addsd  %xmm1,%xmm2
movsd  0xeb9(%rip),%xmm1
divsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
cvtsi2sdl -0x4(%rbp),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randomi>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2sd %eax,%xmm0
sub    %ebp,%ebx
cvtsi2sd %ebx,%xmm1
addsd  0xed0(%rip),%xmm1
movsd  0xed0(%rip),%xmm2
divsd  %xmm1,%xmm2
xorps  %xmm1,%xmm1
cvtsi2sd %ebp,%xmm1
divsd  %xmm2,%xmm0
addsd  %xmm0,%xmm1
cvttsd2si %xmm1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @randomi(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (...) @rand()
%6 = sitofp i32 %5 to double
%7 = load i32, i32* %4
%8 = load i32, i32* %3
%9 = sub nsw i32 %7, %8
%10 = sitofp i32 %9 to double
%11 = fadd double %10, 5.000000e-01
%12 = fdiv double 0x41DFFFFFFFC00000, %11
%13 = fdiv double %6, %12
%14 = load i32, i32* %3
%15 = sitofp i32 %14 to double
%16 = fadd double %13, %15
%17 = fptosi double %16 to i32
ret i32 %17
}

LLVM IR (-O2):
define i32 @randomi(i32 %0, i32 %1) {
%3 = tail call i32 (...) @rand()
%4 = sitofp i32 %3 to double
%5 = sub nsw i32 %1, %0
%6 = sitofp i32 %5 to double
%7 = fadd double %6, 5.000000e-01
%8 = fdiv double 0x41DFFFFFFFC00000, %7
%9 = fdiv double %4, %8
%10 = sitofp i32 %0 to double
%11 = fadd double %9, %10
%12 = fptosi double %11 to i32
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void bdos_f_readrand(void) {
  fprintf(stderr, "BDOS F_READRAND not yet implemented\n");
}


x86 assembly (clang, -O0):
<bdos_f_readrand>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [37 x i8] c"BDOS F_READRAND not yet implemented\0A\00"
define void @bdos_f_readrand() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [37 x i8] c"BDOS F_READRAND not yet implemented\0A\00"
define void @bdos_f_readrand() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct _reent {
  int dummy;
};

/* Variables and functions */
void *calloc(size_t, size_t);
void *_calloc_r(struct _reent *r, size_t num, size_t size) {
  return calloc(num, size);
}


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

x86 assembly (clang, -O2):
<_calloc_r>:
mov    %rsi,%rdi
mov    %rdx,%rsi
jmp    1030 <calloc@plt>

LLVM IR (-O0):
%struct._reent = type { i32 }
define i8* @_calloc_r(%struct._reent* %0, i64 %1, i64 %2) {
%4 = alloca %struct._reent*
%5 = alloca i64
%6 = alloca i64
store %struct._reent* %0, %struct._reent** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64, i64* %5
%8 = load i64, i64* %6
%9 = call i8* @calloc(i64 %7, i64 %8)
ret i8* %9
}

LLVM IR (-O2):
%struct._reent = type { i32 }
define noalias i8* @_calloc_r(%struct._reent* nocapture readnone %0, i64 %1, i64 %2) {
%4 = tail call i8* @calloc(i64 %1, i64 %2)
ret i8* %4
}
/* Type definitions */
struct sigaction {
  void (*sa_handler)(int);
  scalar_t__ sa_flags;
  int /*<<< orphan*/ sa_mask;
};

/* Variables and functions */
int sigaction(int, struct sigaction *, int /*<<< orphan*/);
int /*<<< orphan*/ sigemptyset(int /*<<< orphan*/ *);
int mysignal(int sig, void (*f)(int)) {
  struct sigaction act;
  act.sa_handler = f;
  sigemptyset(&act.sa_mask);
  act.sa_flags = 0;
  return sigaction(sig, &act, 0);
}


x86 assembly (clang, -O0):
<mysignal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
lea    -0x28(%rbp),%rdi
add    $0x10,%rdi
call   1040 <sigemptyset@plt>
movq   $0x0,-0x20(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x28(%rbp),%rsi
xor    %edx,%edx
call   1030 <sigaction@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mysignal>:
push   %rbx
sub    $0x20,%rsp
mov    %edi,%ebx
mov    %rsi,0x8(%rsp)
lea    0x18(%rsp),%rdi
call   1040 <sigemptyset@plt>
movq   $0x0,0x10(%rsp)
lea    0x8(%rsp),%rsi
mov    %ebx,%edi
xor    %edx,%edx
call   1030 <sigaction@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.sigaction = type { void (i32)*, i64, i32 }
define i32 @mysignal(i32 %0, void (i32)* %1) {
%3 = alloca i32
%4 = alloca void (i32)*
%5 = alloca %struct.sigaction
store i32 %0, i32* %3
store void (i32)* %1, void (i32)** %4
%6 = load void (i32)*, void (i32)** %4
%7 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %5, i32 0, i32 0
store void (i32)* %6, void (i32)** %7
%8 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %5, i32 0, i32 2
%9 = call i32 @sigemptyset(i32* %8)
%10 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %5, i32 0, i32 1
store i64 0, i64* %10
%11 = load i32, i32* %3
%12 = call i32 @sigaction(i32 %11, %struct.sigaction* %5, i32 0)
ret i32 %12
}

LLVM IR (-O2):
%struct.sigaction = type { void (i32)*, i64, i32 }
define i32 @mysignal(i32 %0, void (i32)* %1) {
%3 = alloca %struct.sigaction
%4 = bitcast %struct.sigaction* %3 to i8*
%5 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %3, i64 0, i32 0
store void (i32)* %1, void (i32)** %5
%6 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %3, i64 0, i32 2
%7 = call i32 @sigemptyset(i32* %6)
%8 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %3, i64 0, i32 1
store i64 0, i64* %8
%9 = call i32 @sigaction(i32 %0, %struct.sigaction* %3, i32 0)
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ print(char *);
int /*<<< orphan*/ printid(float *);
int main() {
  float a[2] = {2, 3};
  a[1] /= a[0];
  print("a 2.000000 1.500000");
  printid(a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0xc(%rbp)
movss  -0xc(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
divss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
lea    0xeb4(%rip),%rdi
call   1030 <print@plt>
lea    -0xc(%rbp),%rdi
call   1040 <printid@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movabs $0x4040000040000000,%rax
mov    %rax,(%rsp)
movl   $0x3fc00000,0x4(%rsp)
3f
lea    0xec2(%rip),%rdi
call   1030 <print@plt>
mov    %rsp,%rdi
call   1040 <printid@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.a = [2 x float] [float 2.000000e+00, float 3.000000e+00]
@.str = [20 x i8] c"a 2.000000 1.500000\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [2 x float]
store i32 0, i32* %1
%3 = bitcast [2 x float]* %2 to i8*
%4 = getelementptr inbounds [2 x float], [2 x float]* %2, i64 0, i64 0
%5 = load float, float* %4
%6 = getelementptr inbounds [2 x float], [2 x float]* %2, i64 0, i64 1
%7 = load float, float* %6
%8 = fdiv float %7, %5
store float %8, float* %6
%9 = call i32 @print(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%10 = getelementptr inbounds [2 x float], [2 x float]* %2, i64 0, i64 0
%11 = call i32 @printid(float* %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"a 2.000000 1.500000\00"
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to [2 x float]*
%3 = bitcast i64* %1 to i8*
store i64 4629700418010611712, i64* %1
%4 = bitcast i64* %1 to float*
%5 = getelementptr inbounds [2 x float], [2 x float]* %2, i64 0, i64 1
store float 1.500000e+00, float* %5
%6 = tail call i32 @print(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @printid(float* %4)
ret i32 0
}
/* Variables and functions */
int getpid();
int snprintf(char *, size_t, char *, int, unsigned long, size_t);
int loghead_build_libc_malloc(char *str, size_t str_size, const void *addr,
                              size_t size) {
  return snprintf(str, str_size, "%d\tmalloc\t0x%08lx\t%zu", getpid(),
                  (unsigned long)addr, size);
}


x86 assembly (clang, -O0):
<loghead_build_libc_malloc>:
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    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    -0x30(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    %eax,%ecx
mov    -0x18(%rbp),%r8
mov    -0x20(%rbp),%r9
lea    0xe98(%rip),%rdx
call   1040 <snprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<loghead_build_libc_malloc>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%r12
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xebe(%rip),%rdx
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %eax,%ecx
mov    %r15,%r8
mov    %r14,%r9
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1040 <snprintf@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"%d\09malloc\090x%08lx\09%zu\00"
define i32 @loghead_build_libc_malloc(i8* %0, i64 %1, i8* %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i64
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = call i32 (...) @getpid()
%12 = load i8*, i8** %7
%13 = ptrtoint i8* %12 to i64
%14 = load i64, i64* %8
%15 = call i32 @snprintf(i8* %9, i64 %10, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %11, i64 %13, i64 %14)
ret i32 %15
}

LLVM IR (-O2):
@.str = [22 x i8] c"%d\09malloc\090x%08lx\09%zu\00"
define i32 @loghead_build_libc_malloc(i8* %0, i64 %1, i8* %2, i64 %3) {
%5 = tail call i32 (...) @getpid()
%6 = ptrtoint i8* %2 to i64
%7 = tail call i32 @snprintf(i8* %0, i64 %1, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %5, i64 %6, i64 %3)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ str_printf(char *, int *, char *, unsigned int);
void write_uint(char *out, int *written, void *u) {
  str_printf(out, written, "%u", (unsigned)(long)u);
}


x86 assembly (clang, -O0):
<write_uint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rax
mov    %eax,%ecx
lea    0xec7(%rip),%rdx
call   1030 <str_printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_uint>:
mov    %rdx,%rcx
lea    0xee6(%rip),%rdx
jmp    1030 <str_printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%u\00"
define void @write_uint(i8* %0, i32* %1, i8* %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 i32*, i32** %5
%9 = load i8*, i8** %6
%10 = ptrtoint i8* %9 to i64
%11 = trunc i64 %10 to i32
%12 = call i32 @str_printf(i8* %7, i32* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %11)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%u\00"
define void @write_uint(i8* %0, i32* %1, i8* %2) {
%4 = ptrtoint i8* %2 to i64
%5 = trunc i64 %4 to i32
%6 = tail call i32 @str_printf(i8* %0, i32* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ analyze(char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int main(int argc, char **argv) {
  if (argc != 2) {
    fprintf(stderr, "Usage: analyze <file>\n");
    return 1;
  } else {
    analyze(argv[1]);
  }
  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)
cmpl   $0x2,-0x8(%rbp)
je     1161 <main+0x41>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    0xeb0(%rip),%rsi
call   1040 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1175 <main+0x55>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <analyze@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jne    1133 <main+0x13>
mov    0x8(%rsi),%rdi
call   1030 <analyze@plt>
xor    %eax,%eax
pop    %rcx
ret
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
lea    0xebd(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [23 x i8] c"Usage: analyze <file>\0A\00"
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 = icmp ne i32 %6, 2
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %17
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
%15 = call i32 @analyze(i8* %14)
br label %16
16: ; preds = %11
store i32 0, i32* %3
br label %17
17: ; preds = %16, %8
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [23 x i8] c"Usage: analyze <file>\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %11
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i32 @analyze(i8* %9)
br label %11
11: ; preds = %7, %4
%12 = phi i32 [ 1, %4 ], [ 0, %7 ]
ret i32 %12
}
/* Variables and functions */
int exact_square(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int number;
  scanf("%d", &number);
  printf("%d", exact_square(number));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1040 <exact_square@plt>
mov    %eax,%esi
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    0xc(%rsp),%edi
call   1040 <exact_square@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @exact_square(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M23_f(char *s) {
  debug("M23_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M23_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    0xef9(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [46 x i8] c"M23_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M23_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([46 x i8], [46 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 = [46 x i8] c"M23_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M23_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([46 x i8], [46 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
}
/* Variables and functions */
scalar_t__ pow(int, int);
int rand();
int randomSens() {
  int s;
  if ((rand() % 2 + 1) == 1) {
    return (int)pow((-1), 1);
  } else {
    return (int)pow((-1), 2);
  }
}


x86 assembly (clang, -O0):
<randomSens>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <rand@plt>
mov    $0x2,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
cmp    $0x1,%edx
jne    115a <randomSens+0x3a>
mov    $0xffffffff,%edi
mov    $0x1,%esi
call   1030 <pow@plt>
mov    %eax,-0x4(%rbp)
jmp    116c <randomSens+0x4c>
mov    $0xffffffff,%edi
mov    $0x2,%esi
call   1030 <pow@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randomSens>:
push   %rax
xor    %eax,%eax
call   1040 <rand@plt>
and    $0x1,%eax
lea    0x1(%rax),%esi
mov    $0xffffffff,%edi
pop    %rax
jmp    1030 <pow@plt>

LLVM IR (-O0):
define i32 @randomSens() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @rand()
%4 = srem i32 %3, 2
%5 = add nsw i32 %4, 1
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %10
7: ; preds = %0
%8 = call i64 @pow(i32 -1, i32 1)
%9 = trunc i64 %8 to i32
store i32 %9, i32* %1
br label %13
10: ; preds = %0
%11 = call i64 @pow(i32 -1, i32 2)
%12 = trunc i64 %11 to i32
store i32 %12, i32* %1
br label %13
13: ; preds = %10, %7
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
define i32 @randomSens() {
%1 = tail call i32 (...) @rand()
%2 = and i32 %1, 1
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 1, i32 2
%5 = tail call i64 @pow(i32 -1, i32 %4)
%6 = trunc i64 %5 to i32
ret i32 %6
}
/* Variables and functions */
int ssds_get_gen_num(int, char *, char *, char *);
int ssds_get_item_num(int pcfd, char *class_def) {
  return ssds_get_gen_num(pcfd, class_def, "gi", "i_num");
}


x86 assembly (clang, -O0):
<ssds_get_item_num>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xed3(%rip),%rdx
lea    0xecf(%rip),%rcx
call   1030 <ssds_get_gen_num@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ssds_get_item_num>:
lea    0xee9(%rip),%rdx
lea    0xee5(%rip),%rcx
jmp    1030 <ssds_get_gen_num@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"gi\00"
@.str.1 = [6 x i8] c"i_num\00"
define i32 @ssds_get_item_num(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 = load i8*, i8** %4
%7 = call i32 @ssds_get_gen_num(i32 %5, i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 %7
}

LLVM IR (-O2):
@.str = [3 x i8] c"gi\00"
@.str.1 = [6 x i8] c"i_num\00"
define i32 @ssds_get_item_num(i32 %0, i8* %1) {
%3 = tail call i32 @ssds_get_gen_num(i32 %0, i8* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ ASN1_VALUE;
typedef int /*<<< orphan*/ ASN1_NULL;

/* Variables and functions */
int /*<<< orphan*/ ASN1_NULL_it;
int ASN1_item_i2d(int /*<<< orphan*/ *, unsigned char **, int /*<<< orphan*/ *);
int i2d_ASN1_NULL(ASN1_NULL *a, unsigned char **out) {
  return ASN1_item_i2d((ASN1_VALUE *)a, out, &ASN1_NULL_it);
}


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

x86 assembly (clang, -O2):
<i2d_ASN1_NULL>:
mov    0x2ed1(%rip),%rdx
jmp    1030 <ASN1_item_i2d@plt>

LLVM IR (-O0):
@ASN1_NULL_it = global i32 0
define i32 @i2d_ASN1_NULL(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 = load i8**, i8*** %4
%7 = call i32 @ASN1_item_i2d(i32* %5, i8** %6, i32* @ASN1_NULL_it)
ret i32 %7
}

LLVM IR (-O2):
@ASN1_NULL_it = global i32 0
define i32 @i2d_ASN1_NULL(i32* %0, i8** %1) {
%3 = tail call i32 @ASN1_item_i2d(i32* %0, i8** %1, i32* @ASN1_NULL_it)
ret i32 %3
}
/* Type definitions */
struct type {
  int dummy;
};
struct pointer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int);
struct type const *type_get_or_create(int /*<<< orphan*/);
int /*<<< orphan*/ type_new_pointer_type(struct pointer const *,
                                         struct type const *);
const struct type *type_get_pointer_type(const struct pointer *ptr,
                                         const struct type *type) {
  assert(NULL != ptr);
  return type_get_or_create(type_new_pointer_type(ptr, type));
}


x86 assembly (clang, -O0):
<type_get_pointer_type>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%rax
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <type_new_pointer_type@plt>
mov    %eax,%edi
call   1030 <type_get_or_create@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<type_get_pointer_type>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1040 <assert@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <type_new_pointer_type@plt>
mov    %eax,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <type_get_or_create@plt>

LLVM IR (-O0):
%struct.pointer = type { i32 }
%struct.type = type { i32 }
define %struct.type* @type_get_pointer_type(%struct.pointer* %0, %struct.type* %1) {
%3 = alloca %struct.pointer*
%4 = alloca %struct.type*
store %struct.pointer* %0, %struct.pointer** %3
store %struct.type* %1, %struct.type** %4
%5 = load %struct.pointer*, %struct.pointer** %3
%6 = icmp ne %struct.pointer* null, %5
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load %struct.pointer*, %struct.pointer** %3
%10 = load %struct.type*, %struct.type** %4
%11 = call i32 @type_new_pointer_type(%struct.pointer* %9, %struct.type* %10)
%12 = call %struct.type* @type_get_or_create(i32 %11)
ret %struct.type* %12
}

LLVM IR (-O2):
%struct.pointer = type { i32 }
%struct.type = type { i32 }
define %struct.type* @type_get_pointer_type(%struct.pointer* %0, %struct.type* %1) {
%3 = icmp ne %struct.pointer* %0, null
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = tail call i32 @type_new_pointer_type(%struct.pointer* %0, %struct.type* %1)
%7 = tail call %struct.type* @type_get_or_create(i32 %6)
ret %struct.type* %7
}
/* Variables and functions */
int /*<<< orphan*/ eset(int);
int Mexit(int nargs, int *args) {
  eset(98);
  return 0;
}


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

x86 assembly (clang, -O2):
<Mexit>:
push   %rax
mov    $0x62,%edi
call   1030 <eset@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @Mexit(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
store i32* %1, i32** %4
%5 = call i32 @eset(i32 98)
ret i32 0
}

LLVM IR (-O2):
define i32 @Mexit(i32 %0, i32* nocapture readnone %1) {
%3 = tail call i32 @eset(i32 98)
ret i32 0
}
void INT_FL(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_FL() {
ret void
}
void bar_float(void) { foo_float(2.0f - 2.5fi); }


x86 assembly (clang, -O0):
<bar_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x40000000,-0x8(%rbp)
movl   $0xc0200000,-0x4(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x1,%al
call   1030 <foo_float@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar_float>:
movaps 0xee9(%rip),%xmm0
mov    $0x1,%al
jmp    1030 <foo_float@plt>

LLVM IR (-O0):
define void @bar_float() {
%1 = alloca { float, float }
%2 = getelementptr inbounds { float, float }, { float, float }* %1, i32 0, i32 0
%3 = getelementptr inbounds { float, float }, { float, float }* %1, i32 0, i32 1
store float 2.000000e+00, float* %2
store float -2.500000e+00, float* %3
%4 = bitcast { float, float }* %1 to <2 x float>*
%5 = load <2 x float>, <2 x float>* %4
%6 = call i32 (<2 x float>, ...) bitcast (i32 (...)* @foo_float to i32 (<2 x float>, ...)*)(<2 x float> %5)
ret void
}

LLVM IR (-O2):
define void @bar_float() {
%1 = tail call i32 (<2 x float>, ...) bitcast (i32 (...)* @foo_float to i32 (<2 x float>, ...)*)(<2 x float> <float 2.000000e+00, float -2.500000e+00>)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ RegWriteA_lc898122_sharp(int, int);
void AfDrvSw_lc898122_sharp(unsigned char UcDrvSw_lc898122_sharp) {
  if (UcDrvSw_lc898122_sharp == 0x01) {
    RegWriteA_lc898122_sharp(0x0081, 0x20);
    RegWriteA_lc898122_sharp(0x00A0, 0x80);
  } else {
    RegWriteA_lc898122_sharp(0x00A0, 0x00);
  }
}


x86 assembly (clang, -O0):
<AfDrvSw_lc898122_sharp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0x1,%eax
jne    114e <AfDrvSw_lc898122_sharp+0x3e>
mov    $0x81,%edi
mov    $0x20,%esi
call   1030 <RegWriteA_lc898122_sharp@plt>
mov    $0xa0,%edi
mov    $0x80,%esi
call   1030 <RegWriteA_lc898122_sharp@plt>
jmp    115a <AfDrvSw_lc898122_sharp+0x4a>
mov    $0xa0,%edi
xor    %esi,%esi
call   1030 <RegWriteA_lc898122_sharp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AfDrvSw_lc898122_sharp>:
xor    %esi,%esi
cmp    $0x1,%dil
jne    1131 <AfDrvSw_lc898122_sharp+0x21>
push   %rax
mov    $0x81,%edi
mov    $0x20,%esi
call   1030 <RegWriteA_lc898122_sharp@plt>
mov    $0x80,%esi
add    $0x8,%rsp
mov    $0xa0,%edi
jmp    1030 <RegWriteA_lc898122_sharp@plt>

LLVM IR (-O0):
define void @AfDrvSw_lc898122_sharp(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = call i32 @RegWriteA_lc898122_sharp(i32 129, i32 32)
%8 = call i32 @RegWriteA_lc898122_sharp(i32 160, i32 128)
br label %11
9: ; preds = %1
%10 = call i32 @RegWriteA_lc898122_sharp(i32 160, i32 0)
br label %11
11: ; preds = %9, %6
ret void
}

LLVM IR (-O2):
define void @AfDrvSw_lc898122_sharp(i8 zeroext %0) {
%2 = icmp eq i8 %0, 1
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @RegWriteA_lc898122_sharp(i32 129, i32 32)
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ 128, %3 ], [ 0, %1 ]
%7 = tail call i32 @RegWriteA_lc898122_sharp(i32 160, i32 %6)
ret void
}
int ziparchive_czlib_anchor() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ziparchive_czlib_anchor() {
ret i32 0
}
void foo160() {}


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

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

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

LLVM IR (-O2):
define void @foo160() {
ret void
}
long decstrtol(cp, cpp)
char *cp, **cpp;
{
  long l;
  l = strtol(cp, cpp, 10);
  if (cp != *cpp) {
    *cpp = skip_space(*cpp);
  }
  return l;
}


x86 assembly (clang, -O0):
<decstrtol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0xa,%edx
call   1040 <strtol@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%rax
je     116f <decstrtol+0x4f>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    $0x0,%al
call   1030 <skip_space@plt>
movslq %eax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decstrtol>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%rbx
mov    $0xa,%edx
call   1040 <strtol@plt>
mov    %rax,%r14
mov    (%r15),%rdi
cmp    %rbx,%rdi
je     114c <decstrtol+0x2c>
xor    %eax,%eax
call   1030 <skip_space@plt>
cltq
mov    %rax,(%r15)
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i64 @decstrtol(i8* %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i8**
%5 = alloca i64
store i8* %0, i8** %3
store i8** %1, i8*** %4
%6 = load i8*, i8** %3
%7 = load i8**, i8*** %4
%8 = call i64 @strtol(i8* %6, i8** %7, i32 10)
store i64 %8, i64* %5
%9 = load i8*, i8** %3
%10 = load i8**, i8*** %4
%11 = load i8*, i8** %10
%12 = icmp ne i8* %9, %11
br i1 %12, label %13, label %20
13: ; preds = %2
%14 = load i8**, i8*** %4
%15 = load i8*, i8** %14
%16 = call i32 (i8*, ...) bitcast (i32 (...)* @skip_space to i32 (i8*, ...)*)(i8* %15)
%17 = sext i32 %16 to i64
%18 = inttoptr i64 %17 to i8*
%19 = load i8**, i8*** %4
store i8* %18, i8** %19
br label %20
20: ; preds = %13, %2
%21 = load i64, i64* %5
ret i64 %21
}

LLVM IR (-O2):
define i64 @decstrtol(i8* %0, i8** nocapture %1) {
%3 = tail call i64 @strtol(i8* %0, i8** %1, i32 10)
%4 = load i8*, i8** %1
%5 = icmp eq i8* %4, %0
br i1 %5, label %10, label %6
6: ; preds = %2
%7 = tail call i32 (i8*, ...) bitcast (i32 (...)* @skip_space to i32 (i8*, ...)*)(i8* %4)
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %1
br label %10
10: ; preds = %6, %2
ret i64 %3
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ strncpy(char *, char *, int);
char *get_cmd(char *pack) {
  char *cmd = (char *)malloc(4);
  strncpy(cmd, pack, 3);
  cmd[3] = '\0';
  return cmd;
}


x86 assembly (clang, -O0):
<get_cmd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x3,%edx
call   1030 <strncpy@plt>
mov    -0x10(%rbp),%rax
movb   $0x0,0x3(%rax)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_cmd>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    $0x3,%edx
call   1030 <strncpy@plt>
movb   $0x0,0x3(%rbx)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @get_cmd(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = call i64 @malloc(i32 4)
%5 = inttoptr i64 %4 to i8*
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = load i8*, i8** %2
%8 = call i32 @strncpy(i8* %6, i8* %7, i32 3)
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 3
store i8 0, i8* %10
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define i8* @get_cmd(i8* %0) {
%2 = tail call i64 @malloc(i32 4)
%3 = inttoptr i64 %2 to i8*
%4 = tail call i32 @strncpy(i8* %3, i8* %0, i32 3)
%5 = getelementptr inbounds i8, i8* %3, i64 3
store i8 0, i8* %5
ret i8* %3
}
/* Variables and functions */
int close(int);
int iw_close(int fd) { return close(fd); }


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

x86 assembly (clang, -O2):
<iw_close>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define i32 @iw_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 %2
}
/* Variables and functions */
int errno;
int unlink(char const *);
int unlinkat(int, char const *, int);
int unlink_helper(int dirfd, const char *name, int flags) {
  int ret;
  if (dirfd >= 0) {
    ret = unlinkat(dirfd, name, flags);
  } else {
    ret = unlink(name);
  }
  if (ret >= 0) {
    return 0;
  }
  return errno;
}


x86 assembly (clang, -O0):
<unlink_helper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1153 <unlink_helper+0x33>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <unlinkat@plt>
mov    %eax,-0x18(%rbp)
jmp    115f <unlink_helper+0x3f>
mov    -0x10(%rbp),%rdi
call   1030 <unlink@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jl     1175 <unlink_helper+0x55>
movl   $0x0,-0x4(%rbp)
jmp    1181 <unlink_helper+0x61>
mov    0x2e64(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unlink_helper>:
push   %rax
test   %edi,%edi
js     112c <unlink_helper+0xc>
call   1040 <unlinkat@plt>
jmp    1134 <unlink_helper+0x14>
mov    %rsi,%rdi
call   1030 <unlink@plt>
mov    0x2ea5(%rip),%rcx
sar    $0x1f,%eax
and    (%rcx),%eax
pop    %rcx
ret

LLVM IR (-O0):
@errno = global i32 0
define i32 @unlink_helper(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%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
%9 = load i32, i32* %5
%10 = icmp sge i32 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %3
%12 = load i32, i32* %5
%13 = load i8*, i8** %6
%14 = load i32, i32* %7
%15 = call i32 @unlinkat(i32 %12, i8* %13, i32 %14)
store i32 %15, i32* %8
br label %19
16: ; preds = %3
%17 = load i8*, i8** %6
%18 = call i32 @unlink(i8* %17)
store i32 %18, i32* %8
br label %19
19: ; preds = %16, %11
%20 = load i32, i32* %8
%21 = icmp sge i32 %20, 0
br i1 %21, label %22, label %23
22: ; preds = %19
store i32 0, i32* %4
br label %25
23: ; preds = %19
%24 = load i32, i32* @errno
store i32 %24, i32* %4
br label %25
25: ; preds = %23, %22
%26 = load i32, i32* %4
ret i32 %26
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @unlink_helper(i32 %0, i8* %1, i32 %2) {
%4 = icmp sgt i32 %0, -1
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @unlinkat(i32 %0, i8* %1, i32 %2)
br label %9
7: ; preds = %3
%8 = tail call i32 @unlink(i8* %1)
br label %9
9: ; preds = %7, %5
%10 = phi i32 [ %6, %5 ], [ %8, %7 ]
%11 = load i32, i32* @errno
%12 = icmp slt i32 %10, 0
%13 = select i1 %12, i32 %11, i32 0
ret i32 %13
}