xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ acos(double);
long double acosl(long double x) { return (long double)acos((double)x); }


x86 assembly (clang, -O0):
<acosl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fstpl  -0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1030 <acos@plt>
mov    %rax,-0x18(%rbp)
fildll -0x18(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<acosl>:
sub    $0x18,%rsp
fldt   0x20(%rsp)
fstpl  0x8(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <acos@plt>
mov    %rax,0x10(%rsp)
fildll 0x10(%rsp)
add    $0x18,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @acosl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fptrunc x86_fp80 %3 to double
%5 = call i64 @acos(double %4)
%6 = sitofp i64 %5 to x86_fp80
ret x86_fp80 %6
}

LLVM IR (-O2):
define x86_fp80 @acosl(x86_fp80 %0) {
%2 = fptrunc x86_fp80 %0 to double
%3 = tail call i64 @acos(double %2)
%4 = sitofp i64 %3 to x86_fp80
ret x86_fp80 %4
}
/* Type definitions */
struct stat {
  int dummy;
};
struct FTW {
  int dummy;
};

/* Variables and functions */
int remove(char const *);
int remove_callback(const char *file,
                    const struct stat *UNUSED_stat __attribute__((unused)),
                    int UNUSED_typeflag __attribute__((unused)),
                    struct FTW *UNUSED_ftwbuf __attribute__((unused))) {
  return remove(file);
}


x86 assembly (clang, -O0):
<remove_callback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <remove@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_callback>:
jmp    1030 <remove@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
%struct.FTW = type { i32 }
define i32 @remove_callback(i8* %0, %struct.stat* %1, i32 %2, %struct.FTW* %3) {
%5 = alloca i8*
%6 = alloca %struct.stat*
%7 = alloca i32
%8 = alloca %struct.FTW*
store i8* %0, i8** %5
store %struct.stat* %1, %struct.stat** %6
store i32 %2, i32* %7
store %struct.FTW* %3, %struct.FTW** %8
%9 = load i8*, i8** %5
%10 = call i32 @remove(i8* %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.stat = type { i32 }
%struct.FTW = type { i32 }
define i32 @remove_callback(i8* nocapture %0, %struct.stat* nocapture readnone %1, i32 %2, %struct.FTW* nocapture readnone %3) {
%5 = tail call i32 @remove(i8* %0)
ret i32 %5
}
int Emptied(int i, float **delta) { return ((int)delta[i][0]); }


x86 assembly (clang, -O0):
<Emptied>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
cvttss2si (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Emptied>:
movslq %edi,%rax
mov    (%rsi,%rax,8),%rax
cvttss2si (%rax),%eax
ret

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

LLVM IR (-O2):
define i32 @Emptied(i32 %0, float** nocapture %1) {
%3 = sext i32 %0 to i64
%4 = getelementptr inbounds float*, float** %1, i64 %3
%5 = load float*, float** %4
%6 = load float, float* %5
%7 = fptosi float %6 to i32
ret i32 %7
}
int iMax(int a, int b) { return a > b ? a : b; }


x86 assembly (clang, -O0):
<iMax>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <iMax+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <iMax+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iMax>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @iMax(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int M_PI;
int /*<<< orphan*/ piecesOfPie(int);
int main() {
  piecesOfPie(1);
  piecesOfPie(2);
  piecesOfPie(3);
  piecesOfPie(4);
  piecesOfPie(5);
  piecesOfPie(6);
  piecesOfPie(7);
  piecesOfPie(8);
  piecesOfPie(M_PI);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <piecesOfPie@plt>
mov    $0x2,%edi
call   1030 <piecesOfPie@plt>
mov    $0x3,%edi
call   1030 <piecesOfPie@plt>
mov    $0x4,%edi
call   1030 <piecesOfPie@plt>
mov    $0x5,%edi
call   1030 <piecesOfPie@plt>
mov    $0x6,%edi
call   1030 <piecesOfPie@plt>
mov    $0x7,%edi
call   1030 <piecesOfPie@plt>
mov    $0x8,%edi
call   1030 <piecesOfPie@plt>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
call   1030 <piecesOfPie@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <piecesOfPie@plt>
mov    $0x2,%edi
call   1030 <piecesOfPie@plt>
mov    $0x3,%edi
call   1030 <piecesOfPie@plt>
mov    $0x4,%edi
call   1030 <piecesOfPie@plt>
mov    $0x5,%edi
call   1030 <piecesOfPie@plt>
mov    $0x6,%edi
call   1030 <piecesOfPie@plt>
mov    $0x7,%edi
call   1030 <piecesOfPie@plt>
mov    $0x8,%edi
call   1030 <piecesOfPie@plt>
mov    0x2e80(%rip),%rax
mov    (%rax),%edi
call   1030 <piecesOfPie@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@M_PI = global i32 0
define i32 @main() {
%1 = call i32 @piecesOfPie(i32 1)
%2 = call i32 @piecesOfPie(i32 2)
%3 = call i32 @piecesOfPie(i32 3)
%4 = call i32 @piecesOfPie(i32 4)
%5 = call i32 @piecesOfPie(i32 5)
%6 = call i32 @piecesOfPie(i32 6)
%7 = call i32 @piecesOfPie(i32 7)
%8 = call i32 @piecesOfPie(i32 8)
%9 = load i32, i32* @M_PI
%10 = call i32 @piecesOfPie(i32 %9)
ret i32 0
}

LLVM IR (-O2):
@M_PI = global i32 0
define i32 @main() {
%1 = tail call i32 @piecesOfPie(i32 1)
%2 = tail call i32 @piecesOfPie(i32 2)
%3 = tail call i32 @piecesOfPie(i32 3)
%4 = tail call i32 @piecesOfPie(i32 4)
%5 = tail call i32 @piecesOfPie(i32 5)
%6 = tail call i32 @piecesOfPie(i32 6)
%7 = tail call i32 @piecesOfPie(i32 7)
%8 = tail call i32 @piecesOfPie(i32 8)
%9 = load i32, i32* @M_PI
%10 = tail call i32 @piecesOfPie(i32 %9)
ret i32 0
}
unsigned valen(void *argv[]) {
  unsigned argc = 0;
  while (argv && *argv++)
    argc++;
  return argc;
}


x86 assembly (clang, -O0):
<valen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0xd(%rbp)
je     1138 <valen+0x38>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x8(%rbp)
cmpq   $0x0,(%rax)
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1148 <valen+0x48>
jmp    1156 <valen+0x56>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <valen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<valen>:
xor    %eax,%eax
test   %rdi,%rdi
je     111c <valen+0x1c>
cmpq   $0x0,(%rdi)
je     111c <valen+0x1c>
xor    %eax,%eax
nop
cmpq   $0x0,0x8(%rdi,%rax,8)
lea    0x1(%rax),%rax
jne    1110 <valen+0x10>
ret

LLVM IR (-O0):
define i32 @valen(i8** %0) {
%2 = alloca i8**
%3 = alloca i32
store i8** %0, i8*** %2
store i32 0, i32* %3
br label %4
4: ; preds = %14, %1
%5 = load i8**, i8*** %2
%6 = icmp ne i8** %5, null
br i1 %6, label %7, label %12
7: ; preds = %4
%8 = load i8**, i8*** %2
%9 = getelementptr inbounds i8*, i8** %8, i32 1
store i8** %9, i8*** %2
%10 = load i8*, i8** %8
%11 = icmp ne i8* %10, null
br label %12
12: ; preds = %7, %4
%13 = phi i1 [ false, %4 ], [ %11, %7 ]
br i1 %13, label %14, label %17
14: ; preds = %12
%15 = load i32, i32* %3
%16 = add i32 %15, 1
store i32 %16, i32* %3
br label %4
17: ; preds = %12
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
define i32 @valen(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
%5 = icmp eq i8* %4, null
br i1 %5, label %13, label %6
6: ; preds = %3, %6
%7 = phi i8** [ %9, %6 ], [ %0, %3 ]
%8 = phi i32 [ %10, %6 ], [ 0, %3 ]
%9 = getelementptr inbounds i8*, i8** %7, i64 1
%10 = add i32 %8, 1
%11 = load i8*, i8** %9
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %6
13: ; preds = %6, %3, %1
%14 = phi i32 [ 0, %1 ], [ 0, %3 ], [ %10, %6 ]
ret i32 %14
}
/* Variables and functions */
int pow(int, int);
double lambda(int i, int n0) {
  double heap_recur(int n, int A, int n0, int A0);
  double lamb;
  int A0;
  if (n0 == 0) {
    lamb = 1;
  } else if (i == 0) {
    lamb = 1;
  } else {
    A0 = pow(2, i);
    lamb = 1 - heap_recur(0, 1, n0, A0);
  }
  return (lamb);
}


x86 assembly (clang, -O0):
<lambda>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    114a <lambda+0x2a>
movsd  0xec0(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    11a1 <lambda+0x81>
cmpl   $0x0,-0x4(%rbp)
jne    1166 <lambda+0x46>
movsd  0xea4(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    119c <lambda+0x7c>
mov    -0x4(%rbp),%esi
mov    $0x2,%edi
call   1040 <pow@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%edx
mov    -0x14(%rbp),%ecx
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <heap_recur@plt>
movaps %xmm0,%xmm1
movsd  0xe6d(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    11a1 <lambda+0x81>
movsd  -0x10(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lambda>:
push   %rbx
movsd  0xed7(%rip),%xmm0
test   %edi,%edi
je     115f <lambda+0x3f>
mov    %esi,%ebx
test   %esi,%esi
je     115f <lambda+0x3f>
mov    %edi,%esi
mov    $0x2,%edi
call   1040 <pow@plt>
xor    %edi,%edi
mov    $0x1,%esi
mov    %ebx,%edx
mov    %eax,%ecx
call   1030 <heap_recur@plt>
movapd %xmm0,%xmm1
movsd  0xea5(%rip),%xmm0
subsd  %xmm1,%xmm0
pop    %rbx
ret

LLVM IR (-O0):
define double @lambda(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca double
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %2
store double 1.000000e+00, double* %5
br label %22
10: ; preds = %2
%11 = load i32, i32* %3
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %10
store double 1.000000e+00, double* %5
br label %21
14: ; preds = %10
%15 = load i32, i32* %3
%16 = call i32 @pow(i32 2, i32 %15)
store i32 %16, i32* %6
%17 = load i32, i32* %4
%18 = load i32, i32* %6
%19 = call double @heap_recur(i32 0, i32 1, i32 %17, i32 %18)
%20 = fsub double 1.000000e+00, %19
store double %20, double* %5
br label %21
21: ; preds = %14, %13
br label %22
22: ; preds = %21, %9
%23 = load double, double* %5
ret double %23
}

LLVM IR (-O2):
define double @lambda(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = icmp eq i32 %0, 0
%5 = or i1 %4, %3
br i1 %5, label %10, label %6
6: ; preds = %2
%7 = tail call i32 @pow(i32 2, i32 %0)
%8 = tail call double @heap_recur(i32 0, i32 1, i32 %1, i32 %7)
%9 = fsub double 1.000000e+00, %8
br label %10
10: ; preds = %2, %6
%11 = phi double [ %9, %6 ], [ 1.000000e+00, %2 ]
ret double %11
}
/* Type definitions */
typedef scalar_t__ pid_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
scalar_t__ fork();
int /*<<< orphan*/ perror(char *);
pid_t cfork(void) {
  pid_t pid = fork();
  if (pid < 0) {
    perror("cfork");
    exit(1);
  }
  return pid;
}


x86 assembly (clang, -O0):
<cfork>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <fork@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jge    1164 <cfork+0x34>
lea    0xeab(%rip),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cfork>:
push   %rax
xor    %eax,%eax
call   1050 <fork@plt>
test   %rax,%rax
js     113f <cfork+0xf>
pop    %rcx
ret
lea    0xeba(%rip),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"cfork\00"
define i64 @cfork() {
%1 = alloca i64
%2 = call i64 (...) @fork()
store i64 %2, i64* %1
%3 = load i64, i64* %1
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @exit(i32 1)
unreachable
8: ; preds = %0
%9 = load i64, i64* %1
ret i64 %9
}

LLVM IR (-O2):
@.str = [6 x i8] c"cfork\00"
define i64 @cfork() {
%1 = tail call i64 (...) @fork()
%2 = icmp slt i64 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = tail call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @exit(i32 1)
unreachable
6: ; preds = %0
ret i64 %1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void exit_usage(char *arg0) {
  printf("USAGE: %s [-W | -R | -E | -U] [serial port] [filename]\n", arg0);
  exit(1);
}


x86 assembly (clang, -O0):
<exit_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<exit_usage>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [56 x i8] c"USAGE: %s [-W | -R | -E | -U] [serial port] [filename]\0A\00"
define void @exit_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [56 x i8] c"USAGE: %s [-W | -R | -E | -U] [serial port] [filename]\0A\00"
define void @exit_usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
void delay() {
  int i = 10000;
  while (i--)
    ;
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
movl   $0x2710,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
je     1124 <delay+0x24>
jmp    110b <delay+0xb>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @delay() {
ret void
}
void TimerCCPreloadControl(unsigned long ulBase, unsigned long ulCCPreload) {

  ;

  ;
  if (ulCCPreload == 0x00000001) {
    (*((volatile unsigned long *)(ulBase + 0x00000004))) |= 0x00000001;
  } else {
    (*((volatile unsigned long *)(ulBase + 0x00000004))) &= ~0x00000001;
  }
}


x86 assembly (clang, -O0):
<TimerCCPreloadControl>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x1,-0x10(%rbp)
jne    112c <TimerCCPreloadControl+0x2c>
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%rcx
or     $0x1,%rcx
mov    %rcx,0x4(%rax)
jmp    113c <TimerCCPreloadControl+0x3c>
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%rcx
and    $0xfffffffffffffffe,%rcx
mov    %rcx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<TimerCCPreloadControl>:
xor    %eax,%eax
cmp    $0x1,%rsi
sete   %al
mov    0x4(%rdi),%rcx
and    $0xfffffffffffffffe,%rcx
or     %rcx,%rax
mov    %rax,0x4(%rdi)
ret

LLVM IR (-O0):
define void @TimerCCPreloadControl(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = icmp eq i64 %5, 1
br i1 %6, label %7, label %13
7: ; preds = %2
%8 = load i64, i64* %3
%9 = add i64 %8, 4
%10 = inttoptr i64 %9 to i64*
%11 = load volatile i64, i64* %10
%12 = or i64 %11, 1
store volatile i64 %12, i64* %10
br label %19
13: ; preds = %2
%14 = load i64, i64* %3
%15 = add i64 %14, 4
%16 = inttoptr i64 %15 to i64*
%17 = load volatile i64, i64* %16
%18 = and i64 %17, -2
store volatile i64 %18, i64* %16
br label %19
19: ; preds = %13, %7
ret void
}

LLVM IR (-O2):
define void @TimerCCPreloadControl(i64 %0, i64 %1) {
%3 = icmp eq i64 %1, 1
%4 = add i64 %0, 4
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = and i64 %6, -2
%8 = zext i1 %3 to i64
%9 = or i64 %7, %8
store volatile i64 %9, i64* %5
ret void
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int sd_resolve_default(void **ret) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_resolve_default>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
mov    0x2ecf(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_resolve_default>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_resolve_default(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_resolve_default(i8** nocapture readnone %0) {
%2 = load i32, i32* @EINVAL
%3 = sub nsw i32 0, %2
ret i32 %3
}
/* Variables and functions */
void *malloc(int);
int /*<<< orphan*/ pexit(char *);
void *growHeap() {
  void *mem;
  mem = malloc((1024) * 1024);
  if (mem == NULL) {
    pexit("malloc");
  }
  return mem;
}


x86 assembly (clang, -O0):
<growHeap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x100000,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    114d <growHeap+0x2d>
lea    0xeb8(%rip),%rdi
call   1040 <pexit@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<growHeap>:
push   %rbx
mov    $0x100000,%edi
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113f <growHeap+0x1f>
lea    0xec6(%rip),%rdi
call   1040 <pexit@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"malloc\00"
define i8* @growHeap() {
%1 = alloca i8*
%2 = call i8* @malloc(i32 1048576)
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @pexit(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %0
%8 = load i8*, i8** %1
ret i8* %8
}

LLVM IR (-O2):
@.str = [7 x i8] c"malloc\00"
define noalias i8* @growHeap() {
%1 = tail call dereferenceable_or_null(1048576) i8* @malloc(i32 1048576)
%2 = icmp eq i8* %1, null
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @pexit(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
ret i8* %1
}
void atomic_int_set_gcc(volatile int *ptr, int val) {
  *ptr = val;
  __sync_synchronize();
}


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

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

LLVM IR (-O0):
define void @atomic_int_set_gcc(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32*, i32** %3
store volatile i32 %5, i32* %6
fence seq_cst
ret void
}

LLVM IR (-O2):
define void @atomic_int_set_gcc(i32* %0, i32 %1) {
store volatile i32 %1, i32* %0
fence seq_cst
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0x6e() {
  Assert_real((ispunct(110) == 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_ispunct.c",
              555, ("ispunct should be 0 for n"));
}


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

x86 assembly (clang, -O2):
<t_ispunct_0x6e>:
push   %rax
mov    $0x6e,%edi
call   1030 <ispunct@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x22b,%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_ispunct.c\00"
@.str.1 = [26 x i8] c"ispunct should be 0 for n\00"
define void @t_ispunct_0x6e() {
%1 = call i64 @ispunct(i32 110)
%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 555, i8* getelementptr inbounds ([26 x i8], [26 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_ispunct.c\00"
@.str.1 = [26 x i8] c"ispunct should be 0 for n\00"
define void @t_ispunct_0x6e() {
%1 = tail call i64 @ispunct(i32 110)
%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 555, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int fun848() { return 848; }


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

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

LLVM IR (-O0):
define i32 @fun848() {
ret i32 848
}

LLVM IR (-O2):
define i32 @fun848() {
ret i32 848
}
/* Type definitions */
typedef int /*<<< orphan*/ spaces;

/* Variables and functions */
scalar_t__ in(int, int, int);
scalar_t__ in2(int, int *, int);
int u8isspacei(int n) {
  static int spaces[] = {0x09,   0x0A,   0x0B,   0x0C,   0x0D,
                         0x20,   0xA0,   0x1680, 0x180E, 0x2000,
                         0x202F, 0x205F, 0x3000, 0xFEFF};
  return in2(n, spaces, sizeof(spaces) / sizeof(int)) || in(n, 0x2000, 0x200B);
}


x86 assembly (clang, -O0):
<u8isspacei>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    0x2f0b(%rip),%rsi
mov    $0xe,%edx
call   1030 <in2@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    116d <u8isspacei+0x4d>
mov    -0x4(%rbp),%edi
mov    $0x2000,%esi
mov    $0x200b,%edx
call   1040 <in@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<u8isspacei>:
push   %rbx
mov    %edi,%ebx
lea    0x2f16(%rip),%rsi
mov    $0xe,%edx
call   1030 <in2@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1143 <u8isspacei+0x23>
pop    %rbx
ret
mov    %ebx,%edi
mov    $0x2000,%esi
mov    $0x200b,%edx
call   1040 <in@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
@u8isspacei.spaces = internal global [14 x i32] [i32 9, i32 10, i32 11, i32 12, i32 13, i32 32, i32 160, i32 5760, i32 6158, i32 8192, i32 8239, i32 8287, i32 12288, i32 65279]
define i32 @u8isspacei(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @in2(i32 %3, i32* getelementptr inbounds ([14 x i32], [14 x i32]* @u8isspacei.spaces, i64 0, i64 0), i32 14)
%5 = icmp ne i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i64 @in(i32 %7, i32 8192, i32 8203)
%9 = icmp ne i64 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
@u8isspacei.spaces = internal global [14 x i32] [i32 9, i32 10, i32 11, i32 12, i32 13, i32 32, i32 160, i32 5760, i32 6158, i32 8192, i32 8239, i32 8287, i32 12288, i32 65279]
define i32 @u8isspacei(i32 %0) {
%2 = tail call i64 @in2(i32 %0, i32* getelementptr inbounds ([14 x i32], [14 x i32]* @u8isspacei.spaces, i64 0, i64 0), i32 14)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @in(i32 %0, i32 8192, i32 8203)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int getline(char *, int);
int /*<<< orphan*/ printf(char *, int, char *);
main() {
  int len;
  char line[1000];
  while ((len = getline(line, 1000)) > 0)
    if (len >= 80) {
      printf("%d: %s", len, line);
    }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3f0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x3f0(%rbp),%rdi
mov    $0x3e8,%esi
call   1040 <getline@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jle    1174 <main+0x54>
cmpl   $0x50,-0x8(%rbp)
jl     116f <main+0x4f>
mov    -0x8(%rbp),%esi
lea    -0x3f0(%rbp),%rdx
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
jmp    1132 <main+0x12>
xor    %eax,%eax
add    $0x3f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x3e8,%rsp
mov    %rsp,%rdi
mov    $0x3e8,%esi
call   1040 <getline@plt>
test   %eax,%eax
jle    1175 <main+0x55>
lea    0xebe(%rip),%r14
mov    %rsp,%rbx
jmp    1161 <main+0x41>
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1040 <getline@plt>
test   %eax,%eax
jle    1175 <main+0x55>
cmp    $0x50,%eax
jb     1150 <main+0x30>
mov    %r14,%rdi
mov    %eax,%esi
mov    %rbx,%rdx
call   1030 <printf@plt>
jmp    1150 <main+0x30>
xor    %eax,%eax
add    $0x3e8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%d: %s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [1000 x i8]
store i32 0, i32* %1
br label %4
4: ; preds = %15, %0
%5 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%6 = call i32 @getline(i8* %5, i32 1000)
store i32 %6, i32* %2
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %16
8: ; preds = %4
%9 = load i32, i32* %2
%10 = icmp sge i32 %9, 80
br i1 %10, label %11, label %15
11: ; preds = %8
%12 = load i32, i32* %2
%13 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%14 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %12, i8* %13)
br label %15
15: ; preds = %11, %8
br label %4
16: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%d: %s\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = call i32 @getline(i8* %2, i32 1000)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %13
5: ; preds = %0, %10
%6 = phi i32 [ %11, %10 ], [ %3, %0 ]
%7 = icmp ugt i32 %6, 79
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %6, i8* %2)
br label %10
10: ; preds = %8, %5
%11 = call i32 @getline(i8* %2, i32 1000)
%12 = icmp sgt i32 %11, 0
br i1 %12, label %5, label %13
13: ; preds = %10, %0
ret i32 0
}
/* Variables and functions */
int yahoo_M1Common(unsigned int, int);
int yahoo_f01_39(int Salt, int Parameter) {
  unsigned b = Salt ^ 0x57611b36;
  return yahoo_M1Common(b, Parameter);
}


x86 assembly (clang, -O0):
<yahoo_f01_39>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    $0x57611b36,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <yahoo_M1Common@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yahoo_f01_39>:
xor    $0x57611b36,%edi
jmp    1030 <yahoo_M1Common@plt>

LLVM IR (-O0):
define i32 @yahoo_f01_39(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 = xor i32 %6, 1465981750
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = load i32, i32* %4
%10 = call i32 @yahoo_M1Common(i32 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @yahoo_f01_39(i32 %0, i32 %1) {
%3 = xor i32 %0, 1465981750
%4 = tail call i32 @yahoo_M1Common(i32 %3, i32 %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ __debugfs_init();
int __real_open(char *, int, int);
int /*<<< orphan*/ printf(char *);
int open(char *filename, int flags, int mode) {
  printf("calling "
         "open"
         "\n");
  __debugfs_init();
  return (__real_open(filename, flags, mode));
}


x86 assembly (clang, -O0):
<open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <__debugfs_init@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1050 <__real_open@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%rbx
lea    0xebd(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <__debugfs_init@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <__real_open@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"calling open\0A\00"
define i32 @open(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (...) @__debugfs_init()
%9 = load i8*, i8** %4
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = call i32 @__real_open(i8* %9, i32 %10, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
@str = [13 x i8] c"calling open\00"
define i32 @open(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 (...) @__debugfs_init()
%6 = tail call i32 @__real_open(i8* %0, i32 %1, i32 %2)
ret i32 %6
}
double fifdint(double a) { return (double)((int)a); }


x86 assembly (clang, -O0):
<fifdint>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
cvttsd2si -0x8(%rbp),%eax
cvtsi2sd %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fifdint>:
cvttpd2dq %xmm0,%xmm0
cvtdq2pd %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @fifdint(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fptosi double %3 to i32
%5 = sitofp i32 %4 to double
ret double %5
}

LLVM IR (-O2):
define double @fifdint(double %0) {
%2 = fptosi double %0 to i32
%3 = sitofp i32 %2 to double
ret double %3
}
/* Type definitions */
struct session {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ socket_printf(struct session *, int, char *, int, int, int);
int /*<<< orphan*/ telopt_debug(struct session *, char *);
int send_wont_lflow(struct session *ses, int cplen, unsigned char *cpsrc) {
  socket_printf(ses, 3, "%c%c%c", 255, 252, 33);
  telopt_debug(ses, "SENT IAC WONT LFLOW");
  return 3;
}


x86 assembly (clang, -O0):
<send_wont_lflow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x3,%esi
lea    0xebd(%rip),%rdx
mov    $0xff,%ecx
mov    $0xfc,%r8d
mov    $0x21,%r9d
call   1040 <socket_printf@plt>
mov    -0x8(%rbp),%rdi
lea    0xea3(%rip),%rsi
call   1030 <telopt_debug@plt>
mov    $0x3,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_wont_lflow>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdx
mov    $0x3,%esi
mov    $0xff,%ecx
mov    $0xfc,%r8d
mov    $0x21,%r9d
call   1040 <socket_printf@plt>
lea    0xeba(%rip),%rsi
mov    %rbx,%rdi
call   1030 <telopt_debug@plt>
mov    $0x3,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.session = type { i32 }
@.str = [7 x i8] c"%c%c%c\00"
@.str.1 = [20 x i8] c"SENT IAC WONT LFLOW\00"
define i32 @send_wont_lflow(%struct.session* %0, i32 %1, i8* %2) {
%4 = alloca %struct.session*
%5 = alloca i32
%6 = alloca i8*
store %struct.session* %0, %struct.session** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load %struct.session*, %struct.session** %4
%8 = call i32 @socket_printf(%struct.session* %7, i32 3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 255, i32 252, i32 33)
%9 = load %struct.session*, %struct.session** %4
%10 = call i32 @telopt_debug(%struct.session* %9, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
ret i32 3
}

LLVM IR (-O2):
%struct.session = type { i32 }
@.str = [7 x i8] c"%c%c%c\00"
@.str.1 = [20 x i8] c"SENT IAC WONT LFLOW\00"
define i32 @send_wont_lflow(%struct.session* %0, i32 %1, i8* nocapture readnone %2) {
%4 = tail call i32 @socket_printf(%struct.session* %0, i32 3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 255, i32 252, i32 33)
%5 = tail call i32 @telopt_debug(%struct.session* %0, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
ret i32 3
}
/* Type definitions */
struct rusage {
  int dummy;
};

/* Variables and functions */
int syscall(int, int, struct rusage *);
int getrusage(int who, struct rusage *ru) { return syscall(77, who, ru); }


x86 assembly (clang, -O0):
<getrusage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    $0x4d,%edi
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getrusage>:
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0x4d,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
%struct.rusage = type { i32 }
define i32 @getrusage(i32 %0, %struct.rusage* %1) {
%3 = alloca i32
%4 = alloca %struct.rusage*
store i32 %0, i32* %3
store %struct.rusage* %1, %struct.rusage** %4
%5 = load i32, i32* %3
%6 = load %struct.rusage*, %struct.rusage** %4
%7 = call i32 @syscall(i32 77, i32 %5, %struct.rusage* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.rusage = type { i32 }
define i32 @getrusage(i32 %0, %struct.rusage* %1) {
%3 = tail call i32 @syscall(i32 77, i32 %0, %struct.rusage* %1)
ret i32 %3
}
/* Variables and functions */
int rand();
unsigned char mk_rnd_u8() { return (rand() & 0xff); }


x86 assembly (clang, -O0):
<mk_rnd_u8>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
and    $0xff,%eax
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i8 @mk_rnd_u8() {
%1 = call i32 (...) @rand()
%2 = and i32 %1, 255
%3 = trunc i32 %2 to i8
ret i8 %3
}

LLVM IR (-O2):
define zeroext i8 @mk_rnd_u8() {
%1 = tail call i32 (...) @rand()
%2 = trunc i32 %1 to i8
ret i8 %2
}
/* Type definitions */
struct timespec {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
int clock_nanosleep(int /*<<< orphan*/, int /*<<< orphan*/,
                    struct timespec const *, struct timespec *);
int nanosleep(const struct timespec *rqtp, struct timespec *rmtp) {
  return clock_nanosleep(CLOCK_MONOTONIC, 0, rqtp, rmtp);
}


x86 assembly (clang, -O0):
<nanosleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
xor    %esi,%esi
call   1030 <clock_nanosleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nanosleep>:
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2ecb(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
jmp    1030 <clock_nanosleep@plt>

LLVM IR (-O0):
%struct.timespec = type { i32 }
@CLOCK_MONOTONIC = global i32 0
define i32 @nanosleep(%struct.timespec* %0, %struct.timespec* %1) {
%3 = alloca %struct.timespec*
%4 = alloca %struct.timespec*
store %struct.timespec* %0, %struct.timespec** %3
store %struct.timespec* %1, %struct.timespec** %4
%5 = load i32, i32* @CLOCK_MONOTONIC
%6 = load %struct.timespec*, %struct.timespec** %3
%7 = load %struct.timespec*, %struct.timespec** %4
%8 = call i32 @clock_nanosleep(i32 %5, i32 0, %struct.timespec* %6, %struct.timespec* %7)
ret i32 %8
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
@CLOCK_MONOTONIC = global i32 0
define i32 @nanosleep(%struct.timespec* %0, %struct.timespec* %1) {
%3 = load i32, i32* @CLOCK_MONOTONIC
%4 = tail call i32 @clock_nanosleep(i32 %3, i32 0, %struct.timespec* %0, %struct.timespec* %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ error(char *);
scalar_t__ match(char *);
ns() {
  if (match(";") == 0)
    error("missing semicolon");
}


x86 assembly (clang, -O0):
<ns>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <match@plt>
cmp    $0x0,%rax
jne    114a <ns+0x2a>
lea    0xebd(%rip),%rdi
call   1040 <error@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ns>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <match@plt>
test   %rax,%rax
je     1134 <ns+0x14>
pop    %rcx
ret
lea    0xec7(%rip),%rdi
call   1040 <error@plt>
pop    %rcx
ret

LLVM IR (-O0):
@.str = [2 x i8] c";\00"
@.str.1 = [18 x i8] c"missing semicolon\00"
define i32 @ns() {
%1 = alloca i32
%2 = call i64 @match(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @error(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
br label %6
6: ; preds = %4, %0
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
@.str = [2 x i8] c";\00"
@.str.1 = [18 x i8] c"missing semicolon\00"
define i32 @ns() {
%1 = tail call i64 @match(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @error(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
ret i32 undef
}
void _PDBreak() { return; }


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

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

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

LLVM IR (-O2):
define void @_PDBreak() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() { printf("Hello Dockerized Jenkins World"); }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [31 x i8] c"Hello Dockerized Jenkins World\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [31 x i8] c"Hello Dockerized Jenkins World\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
bool nrf53_errata_109(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf53_errata_109() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ str_new;

/* Variables and functions */
int /*<<< orphan*/ ft_bzero(char *, size_t);
char *malloc(int);
char *ft_strnew(size_t size) {
  char *str_new;
  str_new = malloc(sizeof(str_new) * size + 1);
  if (str_new) {
    ft_bzero(str_new, size);
    return (str_new);
  } else
    return (NULL);
}


x86 assembly (clang, -O0):
<ft_strnew>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shl    $0x3,%rax
add    $0x1,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1168 <ft_strnew+0x48>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <ft_bzero@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1170 <ft_strnew+0x50>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strnew>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
lea    0x1(,%rdi,8),%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1146 <ft_strnew+0x26>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <ft_bzero@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @ft_strnew(i64 %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i64 %0, i64* %3
%5 = load i64, i64* %3
%6 = mul i64 8, %5
%7 = add i64 %6, 1
%8 = trunc i64 %7 to i32
%9 = call i8* @malloc(i32 %8)
store i8* %9, i8** %4
%10 = load i8*, i8** %4
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %17
12: ; preds = %1
%13 = load i8*, i8** %4
%14 = load i64, i64* %3
%15 = call i32 @ft_bzero(i8* %13, i64 %14)
%16 = load i8*, i8** %4
store i8* %16, i8** %2
br label %18
17: ; preds = %1
store i8* null, i8** %2
br label %18
18: ; preds = %17, %12
%19 = load i8*, i8** %2
ret i8* %19
}

LLVM IR (-O2):
define i8* @ft_strnew(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = shl i32 %2, 3
%4 = or i32 %3, 1
%5 = tail call i8* @malloc(i32 %4)
%6 = icmp eq i8* %5, null
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 @ft_bzero(i8* %5, i64 %0)
br label %9
9: ; preds = %1, %7
ret i8* %5
}
int strcmp(const char *s1, const char *s2) {
  for (; *s1 == *s2 && *s1; s1++, s2++)
    ;
  return (unsigned char)*s1 - (unsigned char)*s2;
}


x86 assembly (clang, -O0):
<strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    -0x10(%rbp),%rax
movsbl (%rax),%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0x11(%rbp)
jne    1137 <strcmp+0x37>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1147 <strcmp+0x47>
jmp    1169 <strcmp+0x69>
jmp    114c <strcmp+0x4c>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110c <strcmp+0xc>
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movzbl (%rcx),%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp>:
mov    (%rdi),%al
mov    (%rsi),%cl
test   %al,%al
je     1134 <strcmp+0x34>
cmp    %cl,%al
jne    1134 <strcmp+0x34>
mov    $0x1,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzbl (%rdi,%rdx,1),%eax
movzbl (%rsi,%rdx,1),%ecx
test   %al,%al
je     1134 <strcmp+0x34>
add    $0x1,%rdx
cmp    %cl,%al
je     1120 <strcmp+0x20>
movzbl %al,%eax
movzbl %cl,%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @strcmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
br label %5
5: ; preds = %21, %2
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = load i8*, i8** %4
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %8, %11
br i1 %12, label %13, label %18
13: ; preds = %5
%14 = load i8*, i8** %3
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp ne i32 %16, 0
br label %18
18: ; preds = %13, %5
%19 = phi i1 [ false, %5 ], [ %17, %13 ]
br i1 %19, label %20, label %26
20: ; preds = %18
br label %21
21: ; preds = %20
%22 = load i8*, i8** %3
%23 = getelementptr inbounds i8, i8* %22, i32 1
store i8* %23, i8** %3
%24 = load i8*, i8** %4
%25 = getelementptr inbounds i8, i8* %24, i32 1
store i8* %25, i8** %4
br label %5
26: ; preds = %18
%27 = load i8*, i8** %3
%28 = load i8, i8* %27
%29 = zext i8 %28 to i32
%30 = load i8*, i8** %4
%31 = load i8, i8* %30
%32 = zext i8 %31 to i32
%33 = sub nsw i32 %29, %32
ret i32 %33
}

LLVM IR (-O2):
define i32 @strcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp ne i8 %3, %4
%6 = icmp eq i8 %3, 0
%7 = or i1 %6, %5
br i1 %7, label %18, label %8
8: ; preds = %2, %8
%9 = phi i8* [ %12, %8 ], [ %1, %2 ]
%10 = phi i8* [ %11, %8 ], [ %0, %2 ]
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = getelementptr inbounds i8, i8* %9, i64 1
%13 = load i8, i8* %11
%14 = load i8, i8* %12
%15 = icmp ne i8 %13, %14
%16 = icmp eq i8 %13, 0
%17 = or i1 %16, %15
br i1 %17, label %18, label %8
18: ; preds = %8, %2
%19 = phi i8 [ %3, %2 ], [ %13, %8 ]
%20 = phi i8 [ %4, %2 ], [ %14, %8 ]
%21 = zext i8 %19 to i32
%22 = zext i8 %20 to i32
%23 = sub nsw i32 %21, %22
ret i32 %23
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void kmain(void) {
  extern uint32_t magic;
  extern void *mbd;
  if (magic != 0x2BADB002) {
  }
  char *boot_loader_name = (char *)((long *)mbd)[16];
  unsigned char *videoram = (unsigned char *)0xB8000;
  videoram[0] = 65;
  videoram[1] = 0x07;
  videoram[2] = boot_loader_name[0];
}


x86 assembly (clang, -O0):
<kmain>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
cmpl   $0x2badb002,(%rax)
je     111c <kmain+0x1c>
jmp    111c <kmain+0x1c>
mov    0x2ebd(%rip),%rax
mov    (%rax),%rax
mov    0x80(%rax),%rax
mov    %rax,-0x8(%rbp)
mov    $0xb8000,%eax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x41,(%rax)
mov    -0x10(%rbp),%rax
movb   $0x7,0x1(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x2(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<kmain>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%rax
mov    0x80(%rax),%rax
movb   $0x41,0xb8000
41
movb   $0x7,0xb8001
07
mov    (%rax),%al
mov    %al,0xb8002
ret

LLVM IR (-O0):
@magic = external global i32
@mbd = external global i8*
define void @kmain() {
%1 = alloca i8*
%2 = alloca i8*
%3 = load i32, i32* @magic
%4 = icmp ne i32 %3, 732803074
br i1 %4, label %5, label %6
5: ; preds = %0
br label %6
6: ; preds = %5, %0
%7 = load i8*, i8** @mbd
%8 = bitcast i8* %7 to i64*
%9 = getelementptr inbounds i64, i64* %8, i64 16
%10 = load i64, i64* %9
%11 = inttoptr i64 %10 to i8*
store i8* %11, i8** %1
store i8* inttoptr (i64 753664 to i8*), i8** %2
%12 = load i8*, i8** %2
%13 = getelementptr inbounds i8, i8* %12, i64 0
store i8 65, i8* %13
%14 = load i8*, i8** %2
%15 = getelementptr inbounds i8, i8* %14, i64 1
store i8 7, i8* %15
%16 = load i8*, i8** %1
%17 = getelementptr inbounds i8, i8* %16, i64 0
%18 = load i8, i8* %17
%19 = load i8*, i8** %2
%20 = getelementptr inbounds i8, i8* %19, i64 2
store i8 %18, i8* %20
ret void
}

LLVM IR (-O2):
@mbd = external global i8*
define void @kmain() {
%1 = load i64*, i64** bitcast (i8** @mbd to i64**)
%2 = getelementptr inbounds i64, i64* %1, i64 16
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i8*
store i8 65, i8* inttoptr (i64 753664 to i8*)
store i8 7, i8* inttoptr (i64 753665 to i8*)
%5 = load i8, i8* %4
store i8 %5, i8* inttoptr (i64 753666 to i8*)
ret void
}