xunge/DecIR huggingface dataset:
unsigned char tobcd(int input) {
  unsigned char output_char = 0;
  unsigned char aux = input / 10;
  aux = aux * 16;
  aux = aux & 0xF0;
  output_char += aux;
  aux = input % 10;
  aux = aux & 0x0F;
  output_char += aux;
  return output_char;
}


x86 assembly (clang, -O0):
<tobcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movb   $0x0,-0x5(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %al,-0x6(%rbp)
movzbl -0x6(%rbp),%eax
shl    $0x4,%eax
mov    %al,-0x6(%rbp)
movzbl -0x6(%rbp),%eax
and    $0xf0,%eax
mov    %al,-0x6(%rbp)
movzbl -0x6(%rbp),%ecx
movzbl -0x5(%rbp),%eax
add    %ecx,%eax
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %dl,%al
mov    %al,-0x6(%rbp)
movzbl -0x6(%rbp),%eax
and    $0xf,%eax
mov    %al,-0x6(%rbp)
movzbl -0x6(%rbp),%ecx
movzbl -0x5(%rbp),%eax
add    %ecx,%eax
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tobcd>:
movslq %edi,%rax
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
mov    %ecx,%edx
shl    $0x4,%edx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
and    $0xf,%eax
or     %edx,%eax
ret

LLVM IR (-O0):
define zeroext i8 @tobcd(i32 %0) {
%2 = alloca i32
%3 = alloca i8
%4 = alloca i8
store i32 %0, i32* %2
store i8 0, i8* %3
%5 = load i32, i32* %2
%6 = sdiv i32 %5, 10
%7 = trunc i32 %6 to i8
store i8 %7, i8* %4
%8 = load i8, i8* %4
%9 = zext i8 %8 to i32
%10 = mul nsw i32 %9, 16
%11 = trunc i32 %10 to i8
store i8 %11, i8* %4
%12 = load i8, i8* %4
%13 = zext i8 %12 to i32
%14 = and i32 %13, 240
%15 = trunc i32 %14 to i8
store i8 %15, i8* %4
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = load i8, i8* %3
%19 = zext i8 %18 to i32
%20 = add nsw i32 %19, %17
%21 = trunc i32 %20 to i8
store i8 %21, i8* %3
%22 = load i32, i32* %2
%23 = srem i32 %22, 10
%24 = trunc i32 %23 to i8
store i8 %24, i8* %4
%25 = load i8, i8* %4
%26 = zext i8 %25 to i32
%27 = and i32 %26, 15
%28 = trunc i32 %27 to i8
store i8 %28, i8* %4
%29 = load i8, i8* %4
%30 = zext i8 %29 to i32
%31 = load i8, i8* %3
%32 = zext i8 %31 to i32
%33 = add nsw i32 %32, %30
%34 = trunc i32 %33 to i8
store i8 %34, i8* %3
%35 = load i8, i8* %3
ret i8 %35
}

LLVM IR (-O2):
define zeroext i8 @tobcd(i32 %0) {
%2 = sdiv i32 %0, 10
%3 = shl i32 %2, 4
%4 = srem i32 %0, 10
%5 = and i32 %4, 15
%6 = or i32 %3, %5
%7 = trunc i32 %6 to i8
ret i8 %7
}
int socket_bind_to_device(int sock, const char *iface) { return 0; }


x86 assembly (clang, -O0):
<socket_bind_to_device>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @socket_bind_to_device(i32 %0, i8* nocapture readnone %1) {
ret i32 0
}
double _max_d(double d1, double d2) { return (d2 > d1) ? d2 : d1; }


x86 assembly (clang, -O0):
<_max_d>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    112d <_max_d+0x2d>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1137 <_max_d+0x37>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<_max_d>:
maxsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @_max_d(double %0, double %1) {
%3 = fcmp ogt double %1, %0
%4 = select i1 %3, double %1, double %0
ret double %4
}
int do_467() { return 467; }


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

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

LLVM IR (-O0):
define i32 @do_467() {
ret i32 467
}

LLVM IR (-O2):
define i32 @do_467() {
ret i32 467
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_usage(void) {
  printf("Usage: ioulive86 -i <interface> [-n NETMAP] <instance ID>\n");
}


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

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

LLVM IR (-O0):
@.str = [59 x i8] c"Usage: ioulive86 -i <interface> [-n NETMAP] <instance ID>\0A\00"
define void @print_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [58 x i8] c"Usage: ioulive86 -i <interface> [-n NETMAP] <instance ID>\00"
define void @print_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *strcpy(char *, char *);
__attribute__((always_)) char *strcpy_utf8(char *Dest, char *Sorc) {
  return strcpy(Dest, Sorc);
}


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

x86 assembly (clang, -O2):
<strcpy_utf8>:
jmp    1030 <strcpy@plt>

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

LLVM IR (-O2):
define i8* @strcpy_utf8(i8* returned %0, i8* nocapture %1) {
%3 = tail call i8* @strcpy(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, int, char const *, int, char const *);
void CheckSuccess(int err, const char *filename, int lineno, const char *expr) {
  if (err != 0) {
    printf("pthread/sem function failed with errno %i at %s:%i: %s\n", err,
           filename, lineno, expr);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<CheckSuccess>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1164 <CheckSuccess+0x44>
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%r8
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CheckSuccess>:
test   %edi,%edi
jne    1125 <CheckSuccess+0x5>
ret
push   %rax
mov    %rcx,%r8
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %edi,%esi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [56 x i8] c"pthread/sem function failed with errno %i at %s:%i: %s\0A\00"
define void @CheckSuccess(i32 %0, i8* %1, i32 %2, i8* %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
store i32 %0, i32* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = load i32, i32* %5
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %18
11: ; preds = %4
%12 = load i32, i32* %5
%13 = load i8*, i8** %6
%14 = load i32, i32* %7
%15 = load i8*, i8** %8
%16 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i32 %12, i8* %13, i32 %14, i8* %15)
%17 = call i32 @exit(i32 1)
unreachable
18: ; preds = %4
ret void
}

LLVM IR (-O2):
@.str = [56 x i8] c"pthread/sem function failed with errno %i at %s:%i: %s\0A\00"
define void @CheckSuccess(i32 %0, i8* %1, i32 %2, i8* %3) {
%5 = icmp eq i32 %0, 0
br i1 %5, label %9, label %6
6: ; preds = %4
%7 = tail call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %1, i32 %2, i8* %3)
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %4
ret void
}
/* Variables and functions */
double RAND_MAX;
scalar_t__ rand();
int gen_rand_int(int lo, int hi) {
  return ((int)(((double)(rand())) * (++hi - lo) / RAND_MAX)) + lo;
}


x86 assembly (clang, -O0):
<gen_rand_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
sub    -0x4(%rbp),%eax
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
mov    0x2ea3(%rip),%rax
divsd  (%rax),%xmm0
cvttsd2si %xmm0,%eax
add    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define i32 @gen_rand_int(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i64 (...) @rand()
%6 = sitofp i64 %5 to double
%7 = load i32, i32* %4
%8 = add nsw i32 %7, 1
store i32 %8, i32* %4
%9 = load i32, i32* %3
%10 = sub nsw i32 %8, %9
%11 = sitofp i32 %10 to double
%12 = fmul double %6, %11
%13 = load double, double* @RAND_MAX
%14 = fdiv double %12, %13
%15 = fptosi double %14 to i32
%16 = load i32, i32* %3
%17 = add nsw i32 %15, %16
ret i32 %17
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define i32 @gen_rand_int(i32 %0, i32 %1) {
%3 = tail call i64 (...) @rand()
%4 = sitofp i64 %3 to double
%5 = sub i32 1, %0
%6 = add i32 %5, %1
%7 = sitofp i32 %6 to double
%8 = fmul double %7, %4
%9 = load double, double* @RAND_MAX
%10 = fdiv double %8, %9
%11 = fptosi double %10 to i32
%12 = add nsw i32 %11, %0
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ errorPrint(char *);
double compute_sqrt(double x) {
  if (x < 0) {
    errorPrint("Caramba");
  }
  return x;
}


x86 assembly (clang, -O0):
<compute_sqrt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1137 <compute_sqrt+0x27>
lea    0xece(%rip),%rdi
call   1030 <errorPrint@plt>
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compute_sqrt>:
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
jbe    1135 <compute_sqrt+0x25>
push   %rax
lea    0xede(%rip),%rdi
movsd  %xmm0,(%rsp)
call   1030 <errorPrint@plt>
movsd  (%rsp),%xmm0
add    $0x8,%rsp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"Caramba\00"
define double @compute_sqrt(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp olt double %3, 0.000000e+00
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @errorPrint(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
%8 = load double, double* %2
ret double %8
}

LLVM IR (-O2):
@.str = [8 x i8] c"Caramba\00"
define double @compute_sqrt(double returned %0) {
%2 = fcmp olt double %0, 0.000000e+00
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @errorPrint(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %1
ret double %0
}
/* Variables and functions */
int /*<<< orphan*/ put8(int);
void or_reg32_reg32(unsigned int reg1, unsigned int reg2) {
  put8(0x09);
  put8(0xC0 | (reg2 << 3) | reg1);
}


x86 assembly (clang, -O0):
<or_reg32_reg32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x9,%edi
call   1030 <put8@plt>
mov    -0x8(%rbp),%edi
shl    $0x3,%edi
or     $0xc0,%edi
or     -0x4(%rbp),%edi
call   1030 <put8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<or_reg32_reg32>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x9,%edi
call   1030 <put8@plt>
shl    $0x3,%ebx
or     %ebp,%ebx
or     $0xc0,%ebx
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @or_reg32_reg32(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @put8(i32 9)
%6 = load i32, i32* %4
%7 = shl i32 %6, 3
%8 = or i32 192, %7
%9 = load i32, i32* %3
%10 = or i32 %8, %9
%11 = call i32 @put8(i32 %10)
ret void
}

LLVM IR (-O2):
define void @or_reg32_reg32(i32 %0, i32 %1) {
%3 = tail call i32 @put8(i32 9)
%4 = shl i32 %1, 3
%5 = or i32 %4, %0
%6 = or i32 %5, 192
%7 = tail call i32 @put8(i32 %6)
ret void
}
/* Variables and functions */
char *getenv(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
void config_path(char path[512]) {
  char *homedir;
  homedir = getenv("HOME");
  sprintf(path, "%s/.tetriminos", homedir);
}


x86 assembly (clang, -O0):
<config_path>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xeba(%rip),%rsi
call   1040 <sprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<config_path>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <getenv@plt>
lea    0xece(%rip),%rsi
mov    %rbx,%rdi
mov    %rax,%rdx
pop    %rbx
jmp    1040 <sprintf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"HOME\00"
@.str.1 = [15 x i8] c"%s/.tetriminos\00"
define void @config_path(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i8* %4, i8** %3
%5 = load i8*, i8** %2
%6 = load i8*, i8** %3
%7 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"HOME\00"
@.str.1 = [15 x i8] c"%s/.tetriminos\00"
define void @config_path(i8* nocapture writeonly %0) {
%2 = tail call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ towerSolution(int, char, char, char);
int main() {
  int numDisks;
  printf("Please enter the number of disks to use: ");
  scanf("%d", &numDisks);
  printf("Tower of Hanoi involved the moves :\n\n");
  towerSolution(numDisks, 'A', 'B', 'C');
  printf("\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xea8(%rip),%rdi
call   1050 <printf@plt>
lea    0xec6(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
lea    0xeb8(%rip),%rdi
call   1040 <puts@plt>
mov    0x4(%rsp),%edi
mov    $0x41,%esi
mov    $0x42,%edx
mov    $0x43,%ecx
call   1070 <towerSolution@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [42 x i8] c"Please enter the number of disks to use: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [38 x i8] c"Tower of Hanoi involved the moves :\0A\0A\00"
@.str.3 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0))
%6 = load i32, i32* %2
%7 = call i32 @towerSolution(i32 %6, i8 signext 65, i8 signext 66, i8 signext 67)
%8 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [42 x i8] c"Please enter the number of disks to use: \00"
@.str.1 = [3 x i8] c"%d\00"
@str = [37 x i8] c"Tower of Hanoi involved the moves :\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
%6 = load i32, i32* %1
%7 = call i32 @towerSolution(i32 %6, i8 signext 65, i8 signext 66, i8 signext 67)
%8 = call i32 @putchar(i32 10)
ret i32 0
}
/* Variables and functions */
scalar_t__ strchr(char const *, char);
int is_keyval_pair(const char *s) { return strchr(s, '=') && s[0] != '$'; }


x86 assembly (clang, -O0):
<is_keyval_pair>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x3d,%esi
call   1030 <strchr@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
je     114c <is_keyval_pair+0x3c>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x24,%eax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_keyval_pair>:
push   %rbx
mov    %rdi,%rbx
mov    $0x3d,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     112d <is_keyval_pair+0x1d>
xor    %eax,%eax
cmpb   $0x24,(%rbx)
setne  %al
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @is_keyval_pair(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strchr(i8* %3, i8 signext 61)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 0
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 36
br label %12
12: ; preds = %6, %1
%13 = phi i1 [ false, %1 ], [ %11, %6 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @is_keyval_pair(i8* %0) {
%2 = tail call i64 @strchr(i8* %0, i8 signext 61)
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = load i8, i8* %0
%6 = icmp ne i8 %5, 36
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
char *timlib_ora_date_to_yyyy_mm_dd(char *);
char *timlib_oracle_date2mysql(char *s) {
  return timlib_ora_date_to_yyyy_mm_dd(s);
}


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

x86 assembly (clang, -O2):
<timlib_oracle_date2mysql>:
jmp    1030 <timlib_ora_date_to_yyyy_mm_dd@plt>

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

LLVM IR (-O2):
define i8* @timlib_oracle_date2mysql(i8* %0) {
%2 = tail call i8* @timlib_ora_date_to_yyyy_mm_dd(i8* %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ foo(float *);
int main() {
  float *a;
  foo(a);
  foo(a);
#pragma omp taskwait
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca float*
store i32 0, i32* %1
%3 = load float*, float** %2
%4 = call i32 @foo(float* %3)
%5 = load float*, float** %2
%6 = call i32 @foo(float* %5)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(float* undef)
%2 = tail call i32 @foo(float* undef)
ret i32 0
}
void task_wait_abort(void) {}


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

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

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

LLVM IR (-O2):
define void @task_wait_abort() {
ret void
}
void anetEnableTcpNoDelay(void) {
  _serverPanic("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/"
               "heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c",
               39, "Function '%s' is disabled.", __func__);
}


x86 assembly (clang, -O0):
<anetEnableTcpNoDelay>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x27,%esi
lea    0xf79(%rip),%rdx
lea    0xf8d(%rip),%rcx
mov    $0x0,%al
call   1030 <_serverPanic@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<anetEnableTcpNoDelay>:
lea    0xee9(%rip),%rdi
lea    0xf82(%rip),%rdx
lea    0xf96(%rip),%rcx
mov    $0x27,%esi
xor    %eax,%eax
jmp    1030 <_serverPanic@plt>

LLVM IR (-O0):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.anetEnableTcpNoDelay = [21 x i8] c"anetEnableTcpNoDelay\00"
define void @anetEnableTcpNoDelay() {
%1 = call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 39, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @__func__.anetEnableTcpNoDelay, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.anetEnableTcpNoDelay = [21 x i8] c"anetEnableTcpNoDelay\00"
define void @anetEnableTcpNoDelay() {
%1 = tail call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 39, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @__func__.anetEnableTcpNoDelay, i64 0, i64 0))
ret void
}
/* Variables and functions */
void *mellow_allocString(char *, int);
int /*<<< orphan*/ mellow_freeString(void *);
int /*<<< orphan*/ printMellowStringInfo(void *);
int /*<<< orphan*/ writeln(void *);
int main(int argc, char **argv) {
  void *testString = mellow_allocString("Hello, world!", 13);
  printMellowStringInfo(testString);
  writeln(testString);
  mellow_freeString(testString);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xea3(%rip),%rdi
mov    $0xd,%esi
call   1060 <mellow_allocString@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <printMellowStringInfo@plt>
mov    -0x18(%rbp),%rdi
call   1050 <writeln@plt>
mov    -0x18(%rbp),%rdi
call   1030 <mellow_freeString@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xeb8(%rip),%rdi
mov    $0xd,%esi
call   1060 <mellow_allocString@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <printMellowStringInfo@plt>
mov    %rbx,%rdi
call   1050 <writeln@plt>
mov    %rbx,%rdi
call   1030 <mellow_freeString@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Hello, world!\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i8* @mellow_allocString(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 13)
store i8* %7, i8** %6
%8 = load i8*, i8** %6
%9 = call i32 @printMellowStringInfo(i8* %8)
%10 = load i8*, i8** %6
%11 = call i32 @writeln(i8* %10)
%12 = load i8*, i8** %6
%13 = call i32 @mellow_freeString(i8* %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"Hello, world!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i8* @mellow_allocString(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 13)
%4 = tail call i32 @printMellowStringInfo(i8* %3)
%5 = tail call i32 @writeln(i8* %3)
%6 = tail call i32 @mellow_freeString(i8* %3)
ret i32 0
}
void ARGB4444ToARGBRow_NEON() {}


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

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

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

LLVM IR (-O2):
define void @ARGB4444ToARGBRow_NEON() {
ret void
}
void mmxoverlay() {}


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

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

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

LLVM IR (-O2):
define void @mmxoverlay() {
ret void
}
/* Variables and functions */
size_t c_list_max_size(void) { return (-1); }


x86 assembly (clang, -O0):
<c_list_max_size>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffffffffffffff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_list_max_size>:
mov    $0xffffffffffffffff,%rax
ret

LLVM IR (-O0):
define i64 @c_list_max_size() {
ret i64 -1
}

LLVM IR (-O2):
define i64 @c_list_max_size() {
ret i64 -1
}
void RTAvlroGCPtrGetBestFit(void) {}


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

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

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

LLVM IR (-O2):
define void @RTAvlroGCPtrGetBestFit() {
ret void
}
void moveBlocks(int *xp, int *yp) {
  int a = *xp;
  *xp = *yp;
  *yp = a;
}


x86 assembly (clang, -O0):
<moveBlocks>:
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),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @moveBlocks(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ O_RDWR;
int rw_test(char const *, int, int, int /*<<< orphan*/, int);
int test_rw_short_exist(const char *file) {
  return rw_test(file, 7, 26, O_RDWR, 0777);
}


x86 assembly (clang, -O0):
<test_rw_short_exist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ec1(%rip),%rax
mov    (%rax),%ecx
mov    $0x7,%esi
mov    $0x1a,%edx
mov    $0x1ff,%r8d
call   1030 <rw_test@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_rw_short_exist>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%ecx
mov    $0x7,%esi
mov    $0x1a,%edx
mov    $0x1ff,%r8d
jmp    1030 <rw_test@plt>

LLVM IR (-O0):
@O_RDWR = global i32 0
define i32 @test_rw_short_exist(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @O_RDWR
%5 = call i32 @rw_test(i8* %3, i32 7, i32 26, i32 %4, i32 511)
ret i32 %5
}

LLVM IR (-O2):
@O_RDWR = global i32 0
define i32 @test_rw_short_exist(i8* %0) {
%2 = load i32, i32* @O_RDWR
%3 = tail call i32 @rw_test(i8* %0, i32 7, i32 26, i32 %2, i32 511)
ret i32 %3
}
int test_imm_34int16_mem(short *val) {
  return ((*val) & (0x34 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_34int16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%edx
and    $0x34,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_34int16_mem>:
testb  $0x34,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_34int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 52
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
void *malloc(int);
void *stb__temp(void *b, int b_sz, int want_sz) {
  if (b_sz >= want_sz)
    return b;
  else
    return malloc(want_sz);
}


x86 assembly (clang, -O0):
<stb__temp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jl     113b <stb__temp+0x2b>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1147 <stb__temp+0x37>
mov    -0x18(%rbp),%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stb__temp>:
cmp    %edx,%esi
jge    111b <stb__temp+0xb>
mov    %edx,%edi
jmp    1030 <malloc@plt>
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @stb__temp(i8* readnone %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i8* @malloc(i32 %2)
br label %7
7: ; preds = %3, %5
%8 = phi i8* [ %6, %5 ], [ %0, %3 ]
ret i8* %8
}
float *search(float (*pointer)[4], int i) {
  float *pt;
  pt = *(pointer + i);
  return pt;
}


x86 assembly (clang, -O0):
<search>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
shl    $0x4,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<search>:
movslq %esi,%rax
shl    $0x4,%rax
add    %rdi,%rax
ret

LLVM IR (-O0):
define float* @search([4 x float]* %0, i32 %1) {
%3 = alloca [4 x float]*
%4 = alloca i32
%5 = alloca float*
store [4 x float]* %0, [4 x float]** %3
store i32 %1, i32* %4
%6 = load [4 x float]*, [4 x float]** %3
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds [4 x float], [4 x float]* %6, i64 %8
%10 = getelementptr inbounds [4 x float], [4 x float]* %9, i64 0, i64 0
store float* %10, float** %5
%11 = load float*, float** %5
ret float* %11
}

LLVM IR (-O2):
define float* @search([4 x float]* readnone %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds [4 x float], [4 x float]* %0, i64 %3, i64 0
ret float* %4
}
void PREFSUnload(void) {}


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

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

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

LLVM IR (-O2):
define void @PREFSUnload() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SyntaxError(char const *);
void yyerror(const char *msg) { SyntaxError(msg); }


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

x86 assembly (clang, -O2):
<yyerror>:
jmp    1030 <SyntaxError@plt>

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

LLVM IR (-O2):
define void @yyerror(i8* %0) {
%2 = tail call i32 @SyntaxError(i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int request(pid_t tid) {
  (void)tid;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @request(i32 %0) {
ret i32 0
}
/* Variables and functions */
unsigned int time(int /*<<< orphan*/ *);
int my_rand(unsigned int m) {
  unsigned int a;
  unsigned int b;
  unsigned int nombre = time(NULL);
  a = 3;
  b = 3;
  nombre = (a * nombre + b) % m;
  return (nombre);
}


x86 assembly (clang, -O0):
<my_rand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1030 <time@plt>
mov    %eax,-0x10(%rbp)
movl   $0x3,-0x8(%rbp)
movl   $0x3,-0xc(%rbp)
mov    -0x8(%rbp),%eax
imul   -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
xor    %edx,%edx
divl   -0x4(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_rand>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
call   1030 <time@plt>
lea    (%rax,%rax,2),%eax
add    $0x3,%eax
xor    %edx,%edx
div    %ebx
mov    %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @my_rand(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
%6 = call i32 @time(i32* null)
store i32 %6, i32* %5
store i32 3, i32* %3
store i32 3, i32* %4
%7 = load i32, i32* %3
%8 = load i32, i32* %5
%9 = mul i32 %7, %8
%10 = load i32, i32* %4
%11 = add i32 %9, %10
%12 = load i32, i32* %2
%13 = urem i32 %11, %12
store i32 %13, i32* %5
%14 = load i32, i32* %5
ret i32 %14
}

LLVM IR (-O2):
define i32 @my_rand(i32 %0) {
%2 = tail call i32 @time(i32* null)
%3 = mul i32 %2, 3
%4 = add i32 %3, 3
%5 = urem i32 %4, %0
ret i32 %5
}
/* Type definitions */
struct iio_context {
  int dummy;
};

/* Variables and functions */
struct iio_context *local_create_context();
struct iio_context *local_clone(const struct iio_context *ctx
                                __attribute__((unused))) {
  return local_create_context();
}


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

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

LLVM IR (-O0):
%struct.iio_context = type { i32 }
define %struct.iio_context* @local_clone(%struct.iio_context* %0) {
%2 = alloca %struct.iio_context*
store %struct.iio_context* %0, %struct.iio_context** %2
%3 = call %struct.iio_context* (...) @local_create_context()
ret %struct.iio_context* %3
}

LLVM IR (-O2):
%struct.iio_context = type { i32 }
define %struct.iio_context* @local_clone(%struct.iio_context* nocapture readnone %0) {
%2 = tail call %struct.iio_context* (...) @local_create_context()
ret %struct.iio_context* %2
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_error();
int __VERIFIER_nondet_int();
int fibonacci(int);
int main() {
  int x = __VERIFIER_nondet_int();
  if (x > 46 || x == -2147483648) {
    return 0;
  }
  int result = fibonacci(x);
  if (result >= x - 1) {
    return 0;
  } else {
  ERROR:
    __VERIFIER_error();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x2e,-0x8(%rbp)
jg     1163 <main+0x33>
movslq -0x8(%rbp),%rax
cmp    $0xffffffff80000000,%rax
jne    116f <main+0x3f>
movl   $0x0,-0x4(%rbp)
jmp    11a3 <main+0x73>
mov    -0x8(%rbp),%edi
call   1040 <fibonacci@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jl     1197 <main+0x67>
movl   $0x0,-0x4(%rbp)
jmp    11a3 <main+0x73>
jmp    119c <main+0x6c>
mov    $0x0,%al
call   1050 <__VERIFIER_error@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,%ebx
lea    -0x2f(%rbx),%eax
cmp    $0x7fffffd2,%eax
jb     1159 <main+0x29>
mov    %ebx,%edi
call   1040 <fibonacci@plt>
add    $0xffffffff,%ebx
cmp    %ebx,%eax
jge    1159 <main+0x29>
xor    %eax,%eax
call   1050 <__VERIFIER_error@plt>
xor    %eax,%eax
pop    %rbx
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_int()
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp sgt i32 %5, 46
br i1 %6, label %11, label %7
7: ; preds = %0
%8 = load i32, i32* %2
%9 = sext i32 %8 to i64
%10 = icmp eq i64 %9, -2147483648
br i1 %10, label %11, label %12
11: ; preds = %7, %0
store i32 0, i32* %1
br label %23
12: ; preds = %7
%13 = load i32, i32* %2
%14 = call i32 @fibonacci(i32 %13)
store i32 %14, i32* %3
%15 = load i32, i32* %3
%16 = load i32, i32* %2
%17 = sub nsw i32 %16, 1
%18 = icmp sge i32 %15, %17
br i1 %18, label %19, label %20
19: ; preds = %12
store i32 0, i32* %1
br label %23
20: ; preds = %12
br label %21
21: ; preds = %20
%22 = call i32 (...) @__VERIFIER_error()
br label %23
23: ; preds = %11, %19, %21
%24 = load i32, i32* %1
ret i32 %24
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = add i32 %1, -47
%3 = icmp ult i32 %2, 2147483602
br i1 %3, label %10, label %4
4: ; preds = %0
%5 = tail call i32 @fibonacci(i32 %1)
%6 = add nsw i32 %1, -1
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %4
%9 = tail call i32 (...) @__VERIFIER_error()
br label %10
10: ; preds = %8, %4, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int *active_processes();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ free(int *);
int /*<<< orphan*/ print_process_tree(int *);
int main(int argc, char *argv[]) {
  int *proc_list;
  proc_list = active_processes();
  print_process_tree(proc_list);
  free(proc_list);
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <active_processes@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <print_process_tree@plt>
mov    -0x18(%rbp),%rdi
call   1040 <free@plt>
mov    0x2e66(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <active_processes@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <print_process_tree@plt>
mov    %rbx,%rdi
call   1040 <free@plt>
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32* (...) @active_processes()
store i32* %7, i32** %6
%8 = load i32*, i32** %6
%9 = call i32 @print_process_tree(i32* %8)
%10 = load i32*, i32** %6
%11 = call i32 @free(i32* %10)
%12 = load i32, i32* @EXIT_SUCCESS
%13 = call i32 @exit(i32 %12)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32* (...) @active_processes()
%4 = tail call i32 @print_process_tree(i32* %3)
%5 = tail call i32 @free(i32* %3)
%6 = load i32, i32* @EXIT_SUCCESS
%7 = tail call i32 @exit(i32 %6)
unreachable
}
void init_mem() {}


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

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

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

LLVM IR (-O2):
define void @init_mem() {
ret void
}
void g_value_array_sort() {}


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

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

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

LLVM IR (-O2):
define void @g_value_array_sort() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dcopy_(int *, double *, int *, double *, int *);
void wcc_dcopy_(int *n, char *dx, int *incx, char *dy, int *incy) {
  dcopy_(n, (double *)dx, incx, (double *)dy, incy);
}


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

x86 assembly (clang, -O2):
<wcc_dcopy_>:
jmp    1030 <dcopy_@plt>

LLVM IR (-O0):
define void @wcc_dcopy_(i32* %0, i8* %1, i32* %2, i8* %3, i32* %4) {
%6 = alloca i32*
%7 = alloca i8*
%8 = alloca i32*
%9 = alloca i8*
%10 = alloca i32*
store i32* %0, i32** %6
store i8* %1, i8** %7
store i32* %2, i32** %8
store i8* %3, i8** %9
store i32* %4, i32** %10
%11 = load i32*, i32** %6
%12 = load i8*, i8** %7
%13 = bitcast i8* %12 to double*
%14 = load i32*, i32** %8
%15 = load i8*, i8** %9
%16 = bitcast i8* %15 to double*
%17 = load i32*, i32** %10
%18 = call i32 @dcopy_(i32* %11, double* %13, i32* %14, double* %16, i32* %17)
ret void
}

LLVM IR (-O2):
define void @wcc_dcopy_(i32* %0, i8* %1, i32* %2, i8* %3, i32* %4) {
%6 = bitcast i8* %1 to double*
%7 = bitcast i8* %3 to double*
%8 = tail call i32 @dcopy_(i32* %0, double* %6, i32* %2, double* %7, i32* %4)
ret void
}
void capturingName2capturingNameAdd_capturingName() {}


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

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

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

LLVM IR (-O2):
define void @capturingName2capturingNameAdd_capturingName() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ evil_exception(char *, int);
int /*<<< orphan*/ finish_exception();
void do_software_interrupt(void) {
  evil_exception("software interrupt", 2);
  finish_exception();
}


x86 assembly (clang, -O0):
<do_software_interrupt>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
mov    $0x2,%esi
call   1030 <evil_exception@plt>
mov    $0x0,%al
call   1040 <finish_exception@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_software_interrupt>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x2,%esi
call   1030 <evil_exception@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <finish_exception@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"software interrupt\00"
define void @do_software_interrupt() {
%1 = call i32 @evil_exception(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 2)
%2 = call i32 (...) @finish_exception()
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"software interrupt\00"
define void @do_software_interrupt() {
%1 = tail call i32 @evil_exception(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 2)
%2 = tail call i32 (...) @finish_exception()
ret void
}
void __attribute__((weak)) i2c3_er_isr() { debug_handler(__FUNCTION__); }


x86 assembly (clang, -O0):
<i2c3_er_isr>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <debug_handler@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2c3_er_isr>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <debug_handler@plt>

LLVM IR (-O0):
@__FUNCTION__.i2c3_er_isr = [12 x i8] c"i2c3_er_isr\00"
define weak void @i2c3_er_isr() {
%1 = call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__FUNCTION__.i2c3_er_isr, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__FUNCTION__.i2c3_er_isr = [12 x i8] c"i2c3_er_isr\00"
define weak void @i2c3_er_isr() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__FUNCTION__.i2c3_er_isr, i64 0, i64 0))
ret void
}
short min(short a, short b) {
  if (a < b)
    return a;
  else
    return b;
}


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
movswl -0x4(%rbp),%eax
movswl -0x6(%rbp),%ecx
cmp    %ecx,%eax
jge    112f <min+0x2f>
mov    -0x4(%rbp),%ax
mov    %ax,-0x2(%rbp)
jmp    1137 <min+0x37>
mov    -0x6(%rbp),%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
mov    %esi,%eax
cmp    %ax,%di
cmovl  %edi,%eax
ret

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

LLVM IR (-O2):
define signext i16 @min(i16 signext %0, i16 signext %1) {
%3 = icmp slt i16 %0, %1
%4 = select i1 %3, i16 %0, i16 %1
ret i16 %4
}
int foo_constant() {
  int i, j;
  i = 17;
  j = 31;
  return i + j + 3 + 7;
}


x86 assembly (clang, -O0):
<foo_constant>:
push   %rbp
mov    %rsp,%rbp
movl   $0x11,-0x4(%rbp)
movl   $0x1f,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    $0x3,%eax
add    $0x7,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @foo_constant() {
%1 = alloca i32
%2 = alloca i32
store i32 17, i32* %1
store i32 31, i32* %2
%3 = load i32, i32* %1
%4 = load i32, i32* %2
%5 = add nsw i32 %3, %4
%6 = add nsw i32 %5, 3
%7 = add nsw i32 %6, 7
ret i32 %7
}

LLVM IR (-O2):
define i32 @foo_constant() {
ret i32 58
}