xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ blinkdash();
int /*<<< orphan*/ blinkdot();
int /*<<< orphan*/ sleep(double);
int blinkP() {
  blinkdot();
  blinkdash();
  blinkdash();
  blinkdot();
  sleep(1.5);
  return 0;
}


x86 assembly (clang, -O0):
<blinkP>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <blinkdot@plt>
mov    $0x0,%al
call   1040 <blinkdash@plt>
mov    $0x0,%al
call   1040 <blinkdash@plt>
mov    $0x0,%al
call   1030 <blinkdot@plt>
movsd  0xea8(%rip),%xmm0
call   1050 <sleep@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<blinkP>:
push   %rax
xor    %eax,%eax
call   1030 <blinkdot@plt>
xor    %eax,%eax
call   1040 <blinkdash@plt>
xor    %eax,%eax
call   1040 <blinkdash@plt>
xor    %eax,%eax
call   1030 <blinkdot@plt>
movsd  0xeab(%rip),%xmm0
call   1050 <sleep@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @blinkP() {
%1 = call i32 (...) @blinkdot()
%2 = call i32 (...) @blinkdash()
%3 = call i32 (...) @blinkdash()
%4 = call i32 (...) @blinkdot()
%5 = call i32 @sleep(double 1.500000e+00)
ret i32 0
}

LLVM IR (-O2):
define i32 @blinkP() {
%1 = tail call i32 (...) @blinkdot()
%2 = tail call i32 (...) @blinkdash()
%3 = tail call i32 (...) @blinkdash()
%4 = tail call i32 (...) @blinkdot()
%5 = tail call i32 @sleep(double 1.500000e+00)
ret i32 0
}
void main() {
  int i, j;
  while (1) {
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
jmp    1104 <main+0x4>

x86 assembly (clang, -O2):
<main>:
jmp    1100 <main>

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
%2 = alloca i32
br label %3
3: ; preds = %0, %3
br label %3
}

LLVM IR (-O2):
define void @main() {
br label %1
1: ; preds = %1, %0
br label %1
}
double max(double x, double y) { return x > y ? x : y; }


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

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

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

LLVM IR (-O2):
define double @max(double %0, double %1) {
%3 = fcmp ogt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ error_msg(char *);
void *malloc(size_t);
void *xmalloc(size_t n) {
  void *p;
  if (!(p = malloc(n))) {
    error_msg("OUT OF MEMORY");
  }
  return p;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    114f <xmalloc+0x2f>
lea    0xeb6(%rip),%rdi
call   1030 <error_msg@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <xmalloc+0x1a>
lea    0xecb(%rip),%rdi
call   1030 <error_msg@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"OUT OF MEMORY\00"
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = call i32 @error_msg(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %1
%10 = load i8*, i8** %3
ret i8* %10
}

LLVM IR (-O2):
@.str = [14 x i8] c"OUT OF MEMORY\00"
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @error_msg(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
int data_in(char *c) {
  while (*c == ' ')
    c++;
  return (*c != '\0');
}


x86 assembly (clang, -O0):
<data_in>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jne    1129 <data_in+0x29>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <data_in+0x8>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<data_in>:
movzbl (%rdi),%ecx
add    $0x1,%rdi
cmp    $0x20,%cl
je     1100 <data_in>
xor    %eax,%eax
test   %cl,%cl
setne  %al
ret

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

LLVM IR (-O2):
define i32 @data_in(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 32
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %2, label %7
7: ; preds = %2
%8 = icmp ne i8 %4, 0
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ _my_log(char *, int, char *, char *, int, char const *);
void log_err(const char *errstr) {
  do {
    _my_log("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/zhongliangkang/twemproxy41/refs/heads/"
            "master/transfer/fix.c",
            382, "[ ERROR ] at %s:%d ,err info: %s\n",
            "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/zhongliangkang/twemproxy41/refs/heads/"
            "master/transfer/fix.c",
            382, errstr);
  } while (0);
}


x86 assembly (clang, -O0):
<log_err>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%r9
lea    0xed9(%rip),%rcx
mov    $0x17e,%r8d
lea    0xf62(%rip),%rdx
mov    %rcx,%rdi
mov    %r8d,%esi
call   1030 <_my_log@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_err>:
mov    %rdi,%r9
lea    0xf7c(%rip),%rdx
lea    0xedf(%rip),%rcx
mov    %rcx,%rdi
mov    $0x17e,%esi
mov    $0x17e,%r8d
jmp    1030 <_my_log@plt>

LLVM IR (-O0):
@.str = [150 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/zhongliangkang/twemproxy41/refs/heads/master/transfer/fix.c\00"
@.str.1 = [34 x i8] c"[ ERROR ] at %s:%d ,err info: %s\0A\00"
define void @log_err(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %1
%4 = load i8*, i8** %2
%5 = call i32 @_my_log(i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str, i64 0, i64 0), i32 382, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str, i64 0, i64 0), i32 382, i8* %4)
br label %6
6: ; preds = %3
ret void
}

LLVM IR (-O2):
@.str = [150 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/zhongliangkang/twemproxy41/refs/heads/master/transfer/fix.c\00"
@.str.1 = [34 x i8] c"[ ERROR ] at %s:%d ,err info: %s\0A\00"
define void @log_err(i8* %0) {
%2 = tail call i32 @_my_log(i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str, i64 0, i64 0), i32 382, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str, i64 0, i64 0), i32 382, i8* %0)
ret void
}
int builtin_test(int x) {
  if (__builtin_expect(++x == 0, 1))
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<builtin_test>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
cltq
cmp    $0x0,%rax
je     1133 <builtin_test+0x33>
movl   $0x0,-0x4(%rbp)
jmp    113a <builtin_test+0x3a>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<builtin_test>:
xor    %eax,%eax
cmp    $0xffffffff,%edi
setne  %al
ret

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

LLVM IR (-O2):
define i32 @builtin_test(i32 %0) {
%2 = icmp ne i32 %0, -1
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
double pow(double, double);
double curt(double a) { return pow(a, 1.0 / 3); }


x86 assembly (clang, -O0):
<curt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
call   1030 <pow@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<curt>:
movsd  0xee8(%rip),%xmm1
jmp    1030 <pow@plt>

LLVM IR (-O0):
define double @curt(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @pow(double %3, double 0x3FD5555555555555)
ret double %4
}

LLVM IR (-O2):
define double @curt(double %0) {
%2 = tail call double @pow(double %0, double 0x3FD5555555555555)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ dumpsys_gen_wbinv_all();
void dumpsys_wbinv_all(void) { dumpsys_gen_wbinv_all(); }


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

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

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

LLVM IR (-O2):
define void @dumpsys_wbinv_all() {
%1 = tail call i32 (...) @dumpsys_gen_wbinv_all()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fgetc(int /*<<< orphan*/ *);
unsigned int getle16(FILE *f) {
  unsigned int res;
  res = fgetc(f);
  res |= fgetc(f) << 8;
  return res;
}


x86 assembly (clang, -O0):
<getle16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
shl    $0x8,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getle16>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <fgetc@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <fgetc@plt>
shl    $0x8,%eax
or     %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @getle16(i32* nocapture %0) {
%2 = tail call i32 @fgetc(i32* %0)
%3 = tail call i32 @fgetc(i32* %0)
%4 = shl i32 %3, 8
%5 = or i32 %4, %2
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar(char);
void ft_print_middle(int x) {
  ft_putchar('*');
  while (x > 2) {
    ft_putchar(' ');
    x--;
  }
  if (x > 1) {
    ft_putchar('*');
  }
  ft_putchar('\n');
}


x86 assembly (clang, -O0):
<ft_print_middle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x2a,%edi
call   1030 <ft_putchar@plt>
cmpl   $0x2,-0x4(%rbp)
jle    1147 <ft_print_middle+0x37>
mov    $0x20,%edi
call   1030 <ft_putchar@plt>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    1125 <ft_print_middle+0x15>
cmpl   $0x1,-0x4(%rbp)
jle    115b <ft_print_middle+0x4b>
mov    $0x2a,%edi
call   1030 <ft_putchar@plt>
mov    $0xa,%edi
call   1030 <ft_putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_print_middle>:
push   %rbx
mov    %edi,%ebx
mov    $0x2a,%edi
call   1030 <ft_putchar@plt>
cmp    $0x3,%ebx
jl     1144 <ft_print_middle+0x34>
add    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0x20,%edi
call   1030 <ft_putchar@plt>
add    $0xffffffff,%ebx
cmp    $0x3,%ebx
ja     1130 <ft_print_middle+0x20>
jmp    1149 <ft_print_middle+0x39>
cmp    $0x2,%ebx
jne    1153 <ft_print_middle+0x43>
mov    $0x2a,%edi
call   1030 <ft_putchar@plt>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <ft_putchar@plt>

LLVM IR (-O0):
define void @ft_print_middle(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @ft_putchar(i8 signext 42)
br label %4
4: ; preds = %7, %1
%5 = load i32, i32* %2
%6 = icmp sgt i32 %5, 2
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = call i32 @ft_putchar(i8 signext 32)
%9 = load i32, i32* %2
%10 = add nsw i32 %9, -1
store i32 %10, i32* %2
br label %4
11: ; preds = %4
%12 = load i32, i32* %2
%13 = icmp sgt i32 %12, 1
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = call i32 @ft_putchar(i8 signext 42)
br label %16
16: ; preds = %14, %11
%17 = call i32 @ft_putchar(i8 signext 10)
ret void
}

LLVM IR (-O2):
define void @ft_print_middle(i32 %0) {
%2 = tail call i32 @ft_putchar(i8 signext 42)
%3 = icmp sgt i32 %0, 2
br i1 %3, label %4, label %9
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ %0, %1 ]
%6 = tail call i32 @ft_putchar(i8 signext 32)
%7 = add nsw i32 %5, -1
%8 = icmp ugt i32 %5, 3
br i1 %8, label %4, label %11
9: ; preds = %1
%10 = icmp eq i32 %0, 2
br i1 %10, label %11, label %13
11: ; preds = %4, %9
%12 = tail call i32 @ft_putchar(i8 signext 42)
br label %13
13: ; preds = %11, %9
%14 = tail call i32 @ft_putchar(i8 signext 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void T2() {
  printf("J\n");
  printf("Q\n");
  printf("K\n");
}


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

x86 assembly (clang, -O2):
<T2>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xede(%rip),%rdi
call   1030 <puts@plt>
lea    0xed4(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str = [2 x i8] c"J\00"
@str.3 = [2 x i8] c"Q\00"
@str.4 = [2 x i8] c"K\00"
define void @T2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.4, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sti();
void interrupt_enable() { sti(); }


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

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

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

LLVM IR (-O2):
define void @interrupt_enable() {
%1 = tail call i32 (...) @sti()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fun(char *);
int /*<<< orphan*/ puts(char *);
void main() {
  char a[] = "123456789", *p, *q;
  fun(a);
  puts(a);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0xa(%rbp)
mov    0xece(%rip),%ax
mov    %ax,-0x2(%rbp)
lea    -0xa(%rbp),%rdi
call   1040 <fun@plt>
lea    -0xa(%rbp),%rdi
call   1030 <puts@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movabs $0x3837363534333231,%rax
36 37 38
mov    %rax,(%rsp)
movw   $0x39,0x8(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <fun@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.a = [10 x i8] c"123456789\00"
define void @main() {
%1 = alloca [10 x i8]
%2 = alloca i8*
%3 = alloca i8*
%4 = bitcast [10 x i8]* %1 to i8*
%5 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%6 = call i32 @fun(i8* %5)
%7 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%8 = call i32 @puts(i8* %7)
ret void
}

LLVM IR (-O2):
@__const.main.a = [10 x i8] c"123456789\00"
define void @main() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = call i32 @fun(i8* %2)
%4 = call i32 @puts(i8* %2)
ret void
}
/* Variables and functions */
scalar_t__ isalnum(char);
int is_revchar(char c) {
  return isalnum(c) || (c == '+') || (c == '.') || (c == '~');
}


x86 assembly (clang, -O0):
<is_revchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <isalnum@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
jne    116a <is_revchar+0x5a>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x2b,%ecx
mov    %al,-0x2(%rbp)
je     116a <is_revchar+0x5a>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x2e,%ecx
mov    %al,-0x2(%rbp)
je     116a <is_revchar+0x5a>
movsbl -0x1(%rbp),%eax
cmp    $0x7e,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_revchar>:
push   %rbx
mov    %edi,%ebx
call   1030 <isalnum@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1127 <is_revchar+0x17>
pop    %rbx
ret
cmp    $0x2b,%bl
je     1125 <is_revchar+0x15>
cmp    $0x2e,%bl
je     1125 <is_revchar+0x15>
xor    %eax,%eax
cmp    $0x7e,%bl
sete   %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @is_revchar(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @isalnum(i8 signext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %18, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 43
br i1 %9, label %18, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 46
br i1 %13, label %18, label %14
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 126
br label %18
18: ; preds = %14, %10, %6, %1
%19 = phi i1 [ true, %10 ], [ true, %6 ], [ true, %1 ], [ %17, %14 ]
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @is_revchar(i8 signext %0) {
%2 = tail call i64 @isalnum(i8 signext %0)
%3 = freeze i64 %2
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %1
switch i8 %0, label %6 [
i8 46, label %9
i8 43, label %9
]
6: ; preds = %5
%7 = icmp eq i8 %0, 126
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %5, %5, %1, %6
%10 = phi i32 [ 1, %5 ], [ %8, %6 ], [ 1, %1 ], [ 1, %5 ]
ret i32 %10
}
/* Variables and functions */
char *must_malloc(size_t);
int /*<<< orphan*/ strcpy(char *, char *);
size_t strlen(char *);
char *must_strcat(char *a, char *b) {
  size_t al;
  size_t bl;
  char *answer;
  al = strlen(a);
  bl = strlen(b);
  answer = must_malloc(al + bl + 1);
  strcpy(answer, a);
  strcpy(answer + al, b);
  return answer;
}


x86 assembly (clang, -O0):
<must_strcat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
add    -0x20(%rbp),%rdi
add    $0x1,%rdi
call   1050 <must_malloc@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x28(%rbp),%rdi
add    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<must_strcat>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r15
call   1040 <strlen@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1040 <strlen@plt>
lea    (%rbx,%rax,1),%rdi
add    $0x1,%rdi
call   1050 <must_malloc@plt>
mov    %rax,%r12
mov    %rax,%rdi
mov    %r15,%rsi
call   1030 <strcpy@plt>
add    %r12,%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %r12,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @must_strcat(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
%7 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%8 = load i8*, i8** %3
%9 = call i64 @strlen(i8* %8)
store i64 %9, i64* %5
%10 = load i8*, i8** %4
%11 = call i64 @strlen(i8* %10)
store i64 %11, i64* %6
%12 = load i64, i64* %5
%13 = load i64, i64* %6
%14 = add i64 %12, %13
%15 = add i64 %14, 1
%16 = call i8* @must_malloc(i64 %15)
store i8* %16, i8** %7
%17 = load i8*, i8** %7
%18 = load i8*, i8** %3
%19 = call i32 @strcpy(i8* %17, i8* %18)
%20 = load i8*, i8** %7
%21 = load i64, i64* %5
%22 = getelementptr inbounds i8, i8* %20, i64 %21
%23 = load i8*, i8** %4
%24 = call i32 @strcpy(i8* %22, i8* %23)
%25 = load i8*, i8** %7
ret i8* %25
}

LLVM IR (-O2):
define i8* @must_strcat(i8* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = add i64 %3, 1
%6 = add i64 %5, %4
%7 = tail call i8* @must_malloc(i64 %6)
%8 = tail call i32 @strcpy(i8* %7, i8* %0)
%9 = getelementptr inbounds i8, i8* %7, i64 %3
%10 = tail call i32 @strcpy(i8* %9, i8* %1)
ret i8* %7
}
int main(void) {
  int twentyone = 21;
  return twentyone << 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x15,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 21, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 1
ret i32 %4
}

LLVM IR (-O2):
define i32 @main() {
ret i32 42
}
void gtk_message_dialog_new_with_markup() {}


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

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

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

LLVM IR (-O2):
define void @gtk_message_dialog_new_with_markup() {
ret void
}
/* Variables and functions */
scalar_t__ malloc(size_t);
size_t strlen(char const *);
int /*<<< orphan*/ strncpy(char *, char const *, size_t);
char *chaz_Util_strdup(const char *string) {
  size_t len = strlen(string);
  char *copy = (char *)malloc(len + 1);
  strncpy(copy, string, len);
  copy[len] = '\0';
  return copy;
}


x86 assembly (clang, -O0):
<chaz_Util_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <strncpy@plt>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chaz_Util_strdup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1040 <strlen@plt>
mov    %rax,%r15
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1030 <strncpy@plt>
movb   $0x0,(%rbx,%r15,1)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @chaz_Util_strdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add i64 %2, 1
%4 = tail call i64 @malloc(i64 %3)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @strncpy(i8* %5, i8* %0, i64 %2)
%7 = getelementptr inbounds i8, i8* %5, i64 %2
store i8 0, i8* %7
ret i8* %5
}
int i_am_a_dummy_function() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @i_am_a_dummy_function() {
ret i32 0
}
void av_reallocp_array() {}


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

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

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

LLVM IR (-O2):
define void @av_reallocp_array() {
ret void
}
/* Type definitions */
struct iovec {
  int dummy;
};
typedef int ssize_t;

/* Variables and functions */
int writev(int /*<<< orphan*/, struct iovec *, int);
int main(void) {
  struct iovec iov;
  int count = 4;
  ssize_t ret;
  ret = writev(0, &iov, count);
  return ret;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %rsp,%rsi
xor    %edi,%edi
mov    $0x4,%edx
call   1030 <writev@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.iovec = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.iovec
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 4, i32* %3
%5 = load i32, i32* %3
%6 = call i32 @writev(i32 0, %struct.iovec* %2, i32 %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
ret i32 %7
}

LLVM IR (-O2):
%struct.iovec = type { i32 }
define i32 @main() {
%1 = alloca %struct.iovec
%2 = bitcast %struct.iovec* %1 to i8*
%3 = call i32 @writev(i32 0, %struct.iovec* %1, i32 4)
ret i32 %3
}
int fib(int n) {
  if (n > 1)
    return fib(n - 1) + fib(n - 2);
  else if (n == 0)
    return 0;
  else if (n == 1)
    return 1;
}


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    114d <fib+0x3d>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fib@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fib@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    1183 <fib+0x73>
cmpl   $0x0,-0x8(%rbp)
jne    1163 <fib+0x53>
movl   $0x0,-0x4(%rbp)
jmp    1183 <fib+0x73>
cmpl   $0x1,-0x8(%rbp)
jne    1179 <fib+0x69>
movl   $0x1,-0x4(%rbp)
jmp    1183 <fib+0x73>
jmp    117e <fib+0x6e>
jmp    1183 <fib+0x73>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %ebp,%ebp
cmp    $0x2,%edi
jl     1136 <fib+0x26>
xor    %ebp,%ebp
xchg   %ax,%ax
lea    -0x1(%rbx),%edi
call   1030 <fib@plt>
lea    -0x2(%rbx),%ecx
add    %eax,%ebp
cmp    $0x3,%ebx
mov    %ecx,%ebx
ja     1120 <fib+0x10>
jmp    1138 <fib+0x28>
mov    %ebx,%ecx
xor    %eax,%eax
cmp    $0x1,%ecx
sete   %al
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fib(i32 %0) {
%2 = icmp sgt i32 %0, 1
br i1 %2, label %3, label %11
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = add nsw i32 %4, -1
%7 = tail call i32 @fib(i32 %6)
%8 = add nsw i32 %4, -2
%9 = add nsw i32 %7, %5
%10 = icmp ugt i32 %4, 3
br i1 %10, label %3, label %11
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %9, %3 ]
%13 = phi i32 [ %0, %1 ], [ %8, %3 ]
%14 = icmp eq i32 %13, 1
%15 = zext i1 %14 to i32
%16 = add nsw i32 %12, %15
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0xc5() {
  Assert_real((isalpha(197) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isalpha.c",
              990, ("isalpha should be 0 for 0xc5"));
}


x86 assembly (clang, -O0):
<t_isalpha_0xc5>:
push   %rbp
mov    %rsp,%rbp
mov    $0xc5,%edi
call   1030 <isalpha@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x3de,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isalpha_0xc5>:
push   %rax
mov    $0xc5,%edi
call   1030 <isalpha@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x3de,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0xc5\00"
define void @t_isalpha_0xc5() {
%1 = call i64 @isalpha(i32 197)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 990, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0xc5\00"
define void @t_isalpha_0xc5() {
%1 = tail call i64 @isalpha(i32 197)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 990, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
XSetSizeHints() {}


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

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

LLVM IR (-O0):
define i32 @XSetSizeHints() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @XSetSizeHints() {
ret i32 undef
}
/* Variables and functions */
char *malloc(int);
int rand();
char *realloc(char *, int);
int /*<<< orphan*/ strcpy(char *, char *);
char *fn38() {
  char *result;
  result = malloc(20 + rand() % 20);
  result = realloc(result, 30 + rand() % 20);
  strcpy((char *)result, "fn38");
  return result;
}


x86 assembly (clang, -O0):
<fn38>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <rand@plt>
mov    $0x14,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
add    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1060 <rand@plt>
mov    -0x10(%rbp),%rdi
mov    $0x14,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
add    $0x1e,%esi
call   1050 <realloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe67(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn38>:
push   %rbx
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%edi
add    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%esi
add    $0x1e,%esi
mov    %rbx,%rdi
call   1050 <realloc@plt>
mov    %rax,%rbx
lea    0xe4f(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"fn38\00"
define i8* @fn38() {
%1 = alloca i8*
%2 = call i32 (...) @rand()
%3 = srem i32 %2, 20
%4 = add nsw i32 20, %3
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %1
%6 = load i8*, i8** %1
%7 = call i32 (...) @rand()
%8 = srem i32 %7, 20
%9 = add nsw i32 30, %8
%10 = call i8* @realloc(i8* %6, i32 %9)
store i8* %10, i8** %1
%11 = load i8*, i8** %1
%12 = call i32 @strcpy(i8* %11, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%13 = load i8*, i8** %1
ret i8* %13
}

LLVM IR (-O2):
@.str = [5 x i8] c"fn38\00"
define i8* @fn38() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 20
%3 = add nsw i32 %2, 20
%4 = tail call i8* @malloc(i32 %3)
%5 = tail call i32 (...) @rand()
%6 = srem i32 %5, 20
%7 = add nsw i32 %6, 30
%8 = tail call i8* @realloc(i8* %4, i32 %7)
%9 = tail call i32 @strcpy(i8* %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i8* %8
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
scalar_t__ S_ISDIR(int /*<<< orphan*/);
scalar_t__ stat(char const *, struct stat *);
int isdir(const char *path) {
  int bOK = 0;
  struct stat buf;
  if (path == NULL)
    return 0;
  if (stat(path, &buf) == 0 && S_ISDIR(buf.st_mode))
    bOK = 1;
  return bOK;
}


x86 assembly (clang, -O0):
<isdir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114a <isdir+0x2a>
movl   $0x0,-0x4(%rbp)
jmp    1180 <isdir+0x60>
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <stat@plt>
cmp    $0x0,%rax
jne    117a <isdir+0x5a>
mov    -0x18(%rbp),%edi
call   1030 <S_ISDIR@plt>
cmp    $0x0,%rax
je     117a <isdir+0x5a>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isdir>:
push   %rbx
sub    $0x10,%rsp
xor    %ebx,%ebx
test   %rdi,%rdi
je     114c <isdir+0x2c>
lea    0x8(%rsp),%rsi
call   1040 <stat@plt>
test   %rax,%rax
jne    114c <isdir+0x2c>
mov    0x8(%rsp),%edi
call   1030 <S_ISDIR@plt>
xor    %ebx,%ebx
test   %rax,%rax
setne  %bl
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @isdir(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
%5 = alloca %struct.stat
store i8* %0, i8** %3
store i32 0, i32* %4
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 0, i32* %2
br label %21
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = call i64 @stat(i8* %10, %struct.stat* %5)
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %19
13: ; preds = %9
%14 = getelementptr inbounds %struct.stat, %struct.stat* %5, i32 0, i32 0
%15 = load i32, i32* %14
%16 = call i64 @S_ISDIR(i32 %15)
%17 = icmp ne i64 %16, 0
br i1 %17, label %18, label %19
18: ; preds = %13
store i32 1, i32* %4
br label %19
19: ; preds = %18, %13, %9
%20 = load i32, i32* %4
store i32 %20, i32* %2
br label %21
21: ; preds = %19, %8
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @isdir(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = icmp eq i8* %0, null
br i1 %4, label %14, label %5
5: ; preds = %1
%6 = call i64 @stat(i8* %0, %struct.stat* %2)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %5
%9 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%10 = load i32, i32* %9
%11 = call i64 @S_ISDIR(i32 %10)
%12 = icmp ne i64 %11, 0
%13 = zext i1 %12 to i32
br label %14
14: ; preds = %8, %5, %1
%15 = phi i32 [ 0, %1 ], [ 0, %5 ], [ %13, %8 ]
ret i32 %15
}
int qsort_aux(const void *a, const void *b) {
  unsigned long *x1 = (unsigned long *)a;
  unsigned long *x2 = (unsigned long *)b;
  if (*x1 > *x2)
    return 1;
  if (*x1 < *x2)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<qsort_aux>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%rax
jbe    113c <qsort_aux+0x3c>
movl   $0x1,-0x4(%rbp)
jmp    1163 <qsort_aux+0x63>
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%rax
jae    115c <qsort_aux+0x5c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1163 <qsort_aux+0x63>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<qsort_aux>:
mov    (%rdi),%rax
mov    (%rsi),%rcx
cmp    %rcx,%rax
sbb    %edx,%edx
cmp    %rcx,%rax
mov    $0x1,%eax
cmovbe %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @qsort_aux(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = bitcast i8* %1 to i64*
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp ugt i64 %5, %6
%8 = icmp ult i64 %5, %6
%9 = sext i1 %8 to i32
%10 = select i1 %7, i32 1, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ glUseProgram(int /*<<< orphan*/);
void Teapot_LowLevel_UnbindShaderProgram(void) { glUseProgram(0); }


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

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

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

LLVM IR (-O2):
define void @Teapot_LowLevel_UnbindShaderProgram() {
%1 = tail call i32 @glUseProgram(i32 0)
ret void
}
void pcm8_close_devs(void) {}


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

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

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

LLVM IR (-O2):
define void @pcm8_close_devs() {
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t ece_read_uint32_be(const uint8_t *bytes) {
  uint32_t value = bytes[3];
  value |= (uint32_t)bytes[2] << 8;
  value |= (uint32_t)bytes[1] << 16;
  value |= (uint32_t)bytes[0] << 24;
  return value;
}


x86 assembly (clang, -O0):
<ece_read_uint32_be>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%eax
shl    $0x8,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
shl    $0x10,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
shl    $0x18,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ece_read_uint32_be>:
mov    0x8(%rdi),%ecx
shl    $0x8,%ecx
or     0xc(%rdi),%ecx
mov    (%rdi),%eax
mov    0x4(%rdi),%edx
shl    $0x10,%edx
shl    $0x18,%eax
or     %edx,%eax
or     %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @ece_read_uint32_be(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 3
%3 = load i32, i32* %2
%4 = getelementptr inbounds i32, i32* %0, i64 2
%5 = load i32, i32* %4
%6 = shl i32 %5, 8
%7 = or i32 %6, %3
%8 = getelementptr inbounds i32, i32* %0, i64 1
%9 = load i32, i32* %8
%10 = shl i32 %9, 16
%11 = or i32 %7, %10
%12 = load i32, i32* %0
%13 = shl i32 %12, 24
%14 = or i32 %11, %13
ret i32 %14
}
void **foo(void **x, int y, void *z) {
  switch (y) {
  case 162:
    *x = z;
    break;
  case 164:
    *x = z;
    break;
  case 165:
    *x = z;
    break;
  case 166:
    *x = z;
    break;
  case 163:
    *x = z;
    break;
  default:
    goto out;
  }
  return x;
out:
  return (void **)0;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x14(%rbp),%eax
add    $0xffffff5e,%eax
mov    %eax,%ecx
mov    %rcx,-0x28(%rbp)
sub    $0x4,%eax
ja     118a <foo+0x8a>
mov    -0x28(%rbp),%rax
lea    0xecf(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x20(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
jmp    118f <foo+0x8f>
mov    -0x20(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
jmp    118f <foo+0x8f>
mov    -0x20(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
jmp    118f <foo+0x8f>
mov    -0x20(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
jmp    118f <foo+0x8f>
mov    -0x20(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
jmp    118f <foo+0x8f>
jmp    119c <foo+0x9c>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    11a4 <foo+0xa4>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
add    $0xffffff5e,%esi
cmp    $0x4,%esi
ja     1112 <foo+0x12>
mov    %rdi,%rax
mov    %rdx,(%rdi)
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8** @foo(i8** %0, i32 %1, i8* %2) {
%4 = alloca i8**
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8*
store i8** %0, i8*** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
%8 = load i32, i32* %6
switch i32 %8, label %24 [
i32 162, label %9
i32 164, label %12
i32 165, label %15
i32 166, label %18
i32 163, label %21
]
9: ; preds = %3
%10 = load i8*, i8** %7
%11 = load i8**, i8*** %5
store i8* %10, i8** %11
br label %25
12: ; preds = %3
%13 = load i8*, i8** %7
%14 = load i8**, i8*** %5
store i8* %13, i8** %14
br label %25
15: ; preds = %3
%16 = load i8*, i8** %7
%17 = load i8**, i8*** %5
store i8* %16, i8** %17
br label %25
18: ; preds = %3
%19 = load i8*, i8** %7
%20 = load i8**, i8*** %5
store i8* %19, i8** %20
br label %25
21: ; preds = %3
%22 = load i8*, i8** %7
%23 = load i8**, i8*** %5
store i8* %22, i8** %23
br label %25
24: ; preds = %3
br label %27
25: ; preds = %21, %18, %15, %12, %9
%26 = load i8**, i8*** %5
store i8** %26, i8*** %4
br label %28
27: ; preds = %24
store i8** null, i8*** %4
br label %28
28: ; preds = %27, %25
%29 = load i8**, i8*** %4
ret i8** %29
}

LLVM IR (-O2):
define i8** @foo(i8** writeonly %0, i32 %1, i8* %2) {
%4 = add i32 %1, -162
%5 = icmp ult i32 %4, 5
br i1 %5, label %6, label %7
6: ; preds = %3
store i8* %2, i8** %0
br label %7
7: ; preds = %3, %6
%8 = phi i8** [ null, %3 ], [ %0, %6 ]
ret i8** %8
}
void monotonic_to_bootbased(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<monotonic_to_bootbased>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<monotonic_to_bootbased>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
@__func__.monotonic_to_bootbased = [23 x i8] c"monotonic_to_bootbased\00"
define void @monotonic_to_bootbased() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @__func__.monotonic_to_bootbased, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.monotonic_to_bootbased = [23 x i8] c"monotonic_to_bootbased\00"
define void @monotonic_to_bootbased() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @__func__.monotonic_to_bootbased, i64 0, i64 0))
ret void
}
/* Type definitions */
struct port_info {
  int dummy;
};

/* Variables and functions */
int old_get_port_info(char const *, char const *, struct port_info *);
int br_get_port_info(const char *brname, const char *port,
                     struct port_info *info) {
  return old_get_port_info(brname, port, info);
}


x86 assembly (clang, -O0):
<br_get_port_info>:
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),%rdx
call   1030 <old_get_port_info@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<br_get_port_info>:
jmp    1030 <old_get_port_info@plt>

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

LLVM IR (-O2):
%struct.port_info = type { i32 }
define i32 @br_get_port_info(i8* %0, i8* %1, %struct.port_info* %2) {
%4 = tail call i32 @old_get_port_info(i8* %0, i8* %1, %struct.port_info* %2)
ret i32 %4
}