xunge/DecIR huggingface dataset:
char testchar() { return ('0'); }


x86 assembly (clang, -O0):
<testchar>:
push   %rbp
mov    %rsp,%rbp
mov    $0x30,%al
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<testchar>:
mov    $0x30,%al
ret

LLVM IR (-O0):
define signext i8 @testchar() {
ret i8 48
}

LLVM IR (-O2):
define signext i8 @testchar() {
ret i8 48
}
int *get_jobs_completed() { return 0; }


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

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

LLVM IR (-O0):
define i32* @get_jobs_completed() {
ret i32* null
}

LLVM IR (-O2):
define noalias i32* @get_jobs_completed() {
ret i32* null
}
/* Variables and functions */
void *malloc(long);
void *ei_malloc(long size) { return malloc(size); }


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

x86 assembly (clang, -O2):
<ei_malloc>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @ei_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ end_emulation();
int /*<<< orphan*/ end_keyboard();
int /*<<< orphan*/ end_screen();
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fileio_shutdown();
int /*<<< orphan*/ release_heap();
int /*<<< orphan*/ restore_handlers();
void exit_interpreter(int retcode) {
  fileio_shutdown();
  end_screen();
  end_keyboard();
  end_emulation();
  restore_handlers();
  release_heap();
  exit(retcode);
}


x86 assembly (clang, -O0):
<exit_interpreter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <fileio_shutdown@plt>
mov    $0x0,%al
call   1030 <end_screen@plt>
mov    $0x0,%al
call   1070 <end_keyboard@plt>
mov    $0x0,%al
call   1050 <end_emulation@plt>
mov    $0x0,%al
call   1060 <restore_handlers@plt>
mov    $0x0,%al
call   1080 <release_heap@plt>
mov    -0x4(%rbp),%edi
call   1090 <exit@plt>

x86 assembly (clang, -O2):
<exit_interpreter>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <fileio_shutdown@plt>
xor    %eax,%eax
call   1030 <end_screen@plt>
xor    %eax,%eax
call   1070 <end_keyboard@plt>
xor    %eax,%eax
call   1050 <end_emulation@plt>
xor    %eax,%eax
call   1060 <restore_handlers@plt>
xor    %eax,%eax
call   1080 <release_heap@plt>
mov    %ebx,%edi
call   1090 <exit@plt>

LLVM IR (-O0):
define void @exit_interpreter(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @fileio_shutdown()
%4 = call i32 (...) @end_screen()
%5 = call i32 (...) @end_keyboard()
%6 = call i32 (...) @end_emulation()
%7 = call i32 (...) @restore_handlers()
%8 = call i32 (...) @release_heap()
%9 = load i32, i32* %2
%10 = call i32 @exit(i32 %9)
unreachable
}

LLVM IR (-O2):
define void @exit_interpreter(i32 %0) {
%2 = tail call i32 (...) @fileio_shutdown()
%3 = tail call i32 (...) @end_screen()
%4 = tail call i32 (...) @end_keyboard()
%5 = tail call i32 (...) @end_emulation()
%6 = tail call i32 (...) @restore_handlers()
%7 = tail call i32 (...) @release_heap()
%8 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
int bar(int);
int foo(int);
int main() { return foo(1) + bar(256) - 257; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
call   1040 <foo@plt>
mov    %eax,-0x8(%rbp)
mov    $0x100,%edi
call   1030 <bar@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    %ecx,%eax
sub    $0x101,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x1,%edi
call   1040 <foo@plt>
mov    %eax,%ebx
mov    $0x100,%edi
call   1030 <bar@plt>
add    %ebx,%eax
add    $0xfffffeff,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @foo(i32 1)
%3 = call i32 @bar(i32 256)
%4 = add nsw i32 %2, %3
%5 = sub nsw i32 %4, 257
ret i32 %5
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 1)
%2 = tail call i32 @bar(i32 256)
%3 = add i32 %1, -257
%4 = add i32 %3, %2
ret i32 %4
}
void foo411(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo411(i32 %0) {
ret void
}
/* Variables and functions */
int factRecurs(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int x;
  printf("Enter a number: \n");
  scanf("%d", &x);
  printf("Factoriel is: %d", factRecurs(x));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec9(%rip),%rdi
call   1030 <puts@plt>
lea    0xeba(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1060 <factRecurs@plt>
lea    0xe92(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [17 x i8] c"Factoriel is: %d\00"
@str = [17 x i8] c"Enter a number: \00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @factRecurs(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Variables and functions */
int func3(int, int);
int /*<<< orphan*/ printf(char *, int);
int func2(int a) {
  int b = 20;
  b = func3(a, b);
  printf("b = %d\n", b);
  return b;
}


x86 assembly (clang, -O0):
<func2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x14,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <func3@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xeb6(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func2>:
push   %rbx
mov    $0x14,%esi
call   1030 <func3@plt>
mov    %eax,%ebx
lea    0xecc(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"b = %d\0A\00"
define i32 @func2(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 20, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = call i32 @func3(i32 %4, i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
@.str = [8 x i8] c"b = %d\0A\00"
define i32 @func2(i32 %0) {
%2 = tail call i32 @func3(i32 %0, i32 20)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 %2
}
int main(int argc, char *argv[]) {
  int i = 0;
  for (i = 0; i < 10000; i++) {
    ;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x2710,-0x14(%rbp)
jge    1140 <main+0x40>
jmp    1132 <main+0x32>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1120 <main+0x20>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i32 0, i32* %6
br label %7
7: ; preds = %11, %2
%8 = load i32, i32* %6
%9 = icmp slt i32 %8, 10000
br i1 %9, label %10, label %14
10: ; preds = %7
br label %11
11: ; preds = %10
%12 = load i32, i32* %6
%13 = add nsw i32 %12, 1
store i32 %13, i32* %6
br label %7
14: ; preds = %7
ret i32 0
}

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


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

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

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

LLVM IR (-O2):
define i32 @ptraceKill(i32 %0) {
ret i32 -1
}
void One_Real_Eigenvalue(double Hrow[], double eigen_real[],
                         double eigen_imag[], int row, double shift) {
  Hrow[row] += shift;
  eigen_real[row] = Hrow[row];
  eigen_imag[row] = 0.0;
}


x86 assembly (clang, -O0):
<One_Real_Eigenvalue>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
pop    %rbp
ret

x86 assembly (clang, -O2):
<One_Real_Eigenvalue>:
movslq %ecx,%rax
addsd  (%rdi,%rax,8),%xmm0
movsd  %xmm0,(%rdi,%rax,8)
movsd  %xmm0,(%rsi,%rax,8)
movq   $0x0,(%rdx,%rax,8)
ret

LLVM IR (-O0):
define void @One_Real_Eigenvalue(double* %0, double* %1, double* %2, i32 %3, double %4) {
%6 = alloca double*
%7 = alloca double*
%8 = alloca double*
%9 = alloca i32
%10 = alloca double
store double* %0, double** %6
store double* %1, double** %7
store double* %2, double** %8
store i32 %3, i32* %9
store double %4, double* %10
%11 = load double, double* %10
%12 = load double*, double** %6
%13 = load i32, i32* %9
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds double, double* %12, i64 %14
%16 = load double, double* %15
%17 = fadd double %16, %11
store double %17, double* %15
%18 = load double*, double** %6
%19 = load i32, i32* %9
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds double, double* %18, i64 %20
%22 = load double, double* %21
%23 = load double*, double** %7
%24 = load i32, i32* %9
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds double, double* %23, i64 %25
store double %22, double* %26
%27 = load double*, double** %8
%28 = load i32, i32* %9
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds double, double* %27, i64 %29
store double 0.000000e+00, double* %30
ret void
}

LLVM IR (-O2):
define void @One_Real_Eigenvalue(double* nocapture %0, double* nocapture writeonly %1, double* nocapture writeonly %2, i32 %3, double %4) {
%6 = sext i32 %3 to i64
%7 = getelementptr inbounds double, double* %0, i64 %6
%8 = load double, double* %7
%9 = fadd double %8, %4
store double %9, double* %7
%10 = getelementptr inbounds double, double* %1, i64 %6
store double %9, double* %10
%11 = getelementptr inbounds double, double* %2, i64 %6
store double 0.000000e+00, double* %11
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CheckDouble(double, int *, int *);
int IsNotANumber(double number) {
  int mantissa, exponent;
  CheckDouble(number, &mantissa, &exponent);
  return (mantissa && exponent);
}


x86 assembly (clang, -O0):
<IsNotANumber>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
lea    -0xc(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <CheckDouble@plt>
xor    %eax,%eax
cmpl   $0x0,-0xc(%rbp)
mov    %al,-0x11(%rbp)
je     1148 <IsNotANumber+0x38>
cmpl   $0x0,-0x10(%rbp)
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsNotANumber>:
push   %rax
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1030 <CheckDouble@plt>
cmpl   $0x0,0x4(%rsp)
setne  %al
cmpl   $0x0,(%rsp)
setne  %cl
and    %al,%cl
movzbl %cl,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @IsNotANumber(double %0) {
%2 = alloca double
%3 = alloca i32
%4 = alloca i32
store double %0, double* %2
%5 = load double, double* %2
%6 = call i32 @CheckDouble(double %5, i32* %3, i32* %4)
%7 = load i32, i32* %3
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i32, i32* %4
%11 = icmp ne i32 %10, 0
br label %12
12: ; preds = %9, %1
%13 = phi i1 [ false, %1 ], [ %11, %9 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @IsNotANumber(double %0) {
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %2 to i8*
%5 = bitcast i32* %3 to i8*
%6 = call i32 @CheckDouble(double %0, i32* %2, i32* %3)
%7 = load i32, i32* %2
%8 = icmp ne i32 %7, 0
%9 = load i32, i32* %3
%10 = icmp ne i32 %9, 0
%11 = select i1 %8, i1 %10, i1 false
%12 = zext i1 %11 to i32
ret i32 %12
}
/* Variables and functions */
char *html_clink3(char *, char *, char *, char *, char *);
int /*<<< orphan*/ printf(char *, char *, char *);
void html_hlink3(char *class, char *method, char *label, char *p1, char *p2,
                 char *p3) {
  printf("<a href=\"%s\">%s</a>", html_clink3(class, method, p1, p2, p3),
         label);
}


x86 assembly (clang, -O0):
<html_hlink3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    -0x30(%rbp),%r8
call   1040 <html_clink3@plt>
mov    %rax,%rsi
mov    -0x18(%rbp),%rdx
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<html_hlink3>:
push   %rbx
mov    %rdx,%rbx
mov    %rcx,%rdx
mov    %r8,%rcx
mov    %r9,%r8
call   1040 <html_clink3@plt>
lea    0xec7(%rip),%rdi
mov    %rax,%rsi
mov    %rbx,%rdx
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"<a href=\22%s\22>%s</a>\00"
define void @html_hlink3(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4, i8* %5) {
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i8*
store i8* %0, i8** %7
store i8* %1, i8** %8
store i8* %2, i8** %9
store i8* %3, i8** %10
store i8* %4, i8** %11
store i8* %5, i8** %12
%13 = load i8*, i8** %7
%14 = load i8*, i8** %8
%15 = load i8*, i8** %10
%16 = load i8*, i8** %11
%17 = load i8*, i8** %12
%18 = call i8* @html_clink3(i8* %13, i8* %14, i8* %15, i8* %16, i8* %17)
%19 = load i8*, i8** %9
%20 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %18, i8* %19)
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"<a href=\22%s\22>%s</a>\00"
define void @html_hlink3(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4, i8* %5) {
%7 = tail call i8* @html_clink3(i8* %0, i8* %1, i8* %3, i8* %4, i8* %5)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %2)
ret void
}
/* Variables and functions */
char toupper(char);
char *makeUpperCase(char *string) {
  char *uppercaseStr;
  int i = 0;
  while (*(string + i) != '\0') {
    *(uppercaseStr + i) = toupper(*(string + i));
    i++;
  }
  *(uppercaseStr + i) = '\0';
  return uppercaseStr;
}


x86 assembly (clang, -O0):
<makeUpperCase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1164 <makeUpperCase+0x54>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <toupper@plt>
mov    %al,%dl
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1123 <makeUpperCase+0x13>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<makeUpperCase>:
push   %rax
movsbl (%rdi),%edi
call   1030 <toupper@plt>

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

LLVM IR (-O2):
define noalias i8* @makeUpperCase(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp ne i8 %2, 0
tail call void @llvm.assume(i1 %3)
%4 = tail call signext i8 @toupper(i8 signext %2)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ strcmp(char *, char *);
void print_error(char *message) {
  if (strcmp(message, "") != 0) {
    printf("ERROR: %s Exiting...\n", message);
  } else {
    printf("ERROR: program error. Exiting...\n");
  }
}


x86 assembly (clang, -O0):
<print_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xf00(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     115d <print_error+0x3d>
mov    -0x8(%rbp),%rsi
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    116b <print_error+0x4b>
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_error>:
push   %rbx
mov    %rdi,%rbx
lea    0xeda(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     1157 <print_error+0x27>
lea    0xeb4(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
pop    %rbx
jmp    1040 <printf@plt>
lea    0xeb8(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [22 x i8] c"ERROR: %s Exiting...\0A\00"
@.str.2 = [34 x i8] c"ERROR: program error. Exiting...\0A\00"
define void @print_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8* %7)
br label %11
9: ; preds = %1
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0))
br label %11
11: ; preds = %9, %6
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [22 x i8] c"ERROR: %s Exiting...\0A\00"
@str = [33 x i8] c"ERROR: program error. Exiting...\00"
define void @print_error(i8* %0) {
%2 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %8
6: ; preds = %1
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
br label %8
8: ; preds = %6, %4
ret void
}
int main(void) { return 0x42; }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
ret i32 66
}

LLVM IR (-O2):
define i32 @main() {
ret i32 66
}
/* Type definitions */
struct timespec {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ts_add_nsec(struct timespec *, int /*<<< orphan*/);
int /*<<< orphan*/ usec_to_nsec(unsigned long);
void ts_add_usec(struct timespec *ts, unsigned long usec) {
  ts_add_nsec(ts, usec_to_nsec(usec));
}


x86 assembly (clang, -O0):
<ts_add_usec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <usec_to_nsec@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1030 <ts_add_nsec@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ts_add_usec>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1040 <usec_to_nsec@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <ts_add_nsec@plt>

LLVM IR (-O0):
%struct.timespec = type { i32 }
define void @ts_add_usec(%struct.timespec* %0, i64 %1) {
%3 = alloca %struct.timespec*
%4 = alloca i64
store %struct.timespec* %0, %struct.timespec** %3
store i64 %1, i64* %4
%5 = load %struct.timespec*, %struct.timespec** %3
%6 = load i64, i64* %4
%7 = call i32 @usec_to_nsec(i64 %6)
%8 = call i32 @ts_add_nsec(%struct.timespec* %5, i32 %7)
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
define void @ts_add_usec(%struct.timespec* %0, i64 %1) {
%3 = tail call i32 @usec_to_nsec(i64 %1)
%4 = tail call i32 @ts_add_nsec(%struct.timespec* %0, i32 %3)
ret void
}
void stop_motor() {}


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

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

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

LLVM IR (-O2):
define void @stop_motor() {
ret void
}
unsigned long I2STxFIFOLevelGet(unsigned long ulBase) {
  ;
  return ((*((volatile unsigned long *)(ulBase + 0x00000018))));
}


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

x86 assembly (clang, -O2):
<I2STxFIFOLevelGet>:
mov    0x18(%rdi),%rax
ret

LLVM IR (-O0):
define i64 @I2STxFIFOLevelGet(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 24
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @I2STxFIFOLevelGet(i64 %0) {
%2 = add i64 %0, 24
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
ret i64 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int /*<<< orphan*/ addToDate(int /*<<< orphan*/, char, int);
time_t addToDateY(time_t ts) { return addToDate(ts, 'y', 1); }


x86 assembly (clang, -O0):
<addToDateY>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x79,%esi
mov    $0x1,%edx
call   1030 <addToDate@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<addToDateY>:
mov    $0x79,%esi
mov    $0x1,%edx
jmp    1030 <addToDate@plt>

LLVM IR (-O0):
define i32 @addToDateY(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @addToDate(i32 %3, i8 signext 121, i32 1)
ret i32 %4
}

LLVM IR (-O2):
define i32 @addToDateY(i32 %0) {
%2 = tail call i32 @addToDate(i32 %0, i8 signext 121, i32 1)
ret i32 %2
}
void installWindow(unsigned int child_handle, unsigned int parent_handle) {}


x86 assembly (clang, -O0):
<installWindow>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @installWindow(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0xe4() {
  Assert_real((isupper(228) == 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_isupper.c",
              1145, ("isupper should be 0 for 0xe4"));
}


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

x86 assembly (clang, -O2):
<t_isupper_0xe4>:
push   %rax
mov    $0xe4,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x479,%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_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0xe4\00"
define void @t_isupper_0xe4() {
%1 = call i64 @isupper(i32 228)
%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 1145, 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_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0xe4\00"
define void @t_isupper_0xe4() {
%1 = tail call i64 @isupper(i32 228)
%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 1145, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ recv(int, char *, size_t, int /*<<< orphan*/);
ssize_t recv_message(int sockfd, char *buf, size_t len) {
  do {
  } while (0);
  return recv(sockfd, buf, len, 0);
}


x86 assembly (clang, -O0):
<recv_message>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
jmp    1128 <recv_message+0x18>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %ecx,%ecx
call   1030 <recv@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<recv_message>:
xor    %ecx,%ecx
jmp    1030 <recv@plt>

LLVM IR (-O0):
define i32 @recv_message(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
br label %7
7: ; preds = %3
br label %8
8: ; preds = %7
%9 = load i32, i32* %4
%10 = load i8*, i8** %5
%11 = load i64, i64* %6
%12 = call i32 @recv(i32 %9, i8* %10, i64 %11, i32 0)
ret i32 %12
}

LLVM IR (-O2):
define i32 @recv_message(i32 %0, i8* %1, i64 %2) {
%4 = tail call i32 @recv(i32 %0, i8* %1, i64 %2, i32 0)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ inplace1(int *, int);
void qsort_inplace1(int *values, int n) { inplace1(values, n); }


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

x86 assembly (clang, -O2):
<qsort_inplace1>:
jmp    1030 <inplace1@plt>

LLVM IR (-O0):
define void @qsort_inplace1(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 = call i32 @inplace1(i32* %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @qsort_inplace1(i32* %0, i32 %1) {
%3 = tail call i32 @inplace1(i32* %0, i32 %1)
ret void
}
/* Type definitions */
typedef long long int64_t;

/* Variables and functions */
int64_t return_int64_0() { return -4611686018427387905LL; }


x86 assembly (clang, -O0):
<return_int64_0>:
push   %rbp
mov    %rsp,%rbp
movabs $0xbfffffffffffffff,%rax
ff ff bf
pop    %rbp
ret

x86 assembly (clang, -O2):
<return_int64_0>:
movabs $0xbfffffffffffffff,%rax
ff ff bf
ret

LLVM IR (-O0):
define i64 @return_int64_0() {
ret i64 -4611686018427387905
}

LLVM IR (-O2):
define i64 @return_int64_0() {
ret i64 -4611686018427387905
}
void end(void) { ; }


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

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

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

LLVM IR (-O2):
define void @end() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ BUG_ON(int);
int /*<<< orphan*/ printk(char *, char const *, int, char const *);
void fsl_assert_fail(const char *fname, int line, const char *str) {
  printk("BARF: %s@%d. %s\n", fname, line, str);
  BUG_ON(1);
}


x86 assembly (clang, -O0):
<fsl_assert_fail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
lea    0xebb(%rip),%rdi
call   1030 <printk@plt>
mov    $0x1,%edi
call   1040 <BUG_ON@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fsl_assert_fail>:
push   %rax
mov    %rdx,%rcx
mov    %esi,%edx
mov    %rdi,%rsi
lea    0xed0(%rip),%rdi
call   1030 <printk@plt>
mov    $0x1,%edi
pop    %rax
jmp    1040 <BUG_ON@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"BARF: %s@%d. %s\0A\00"
define void @fsl_assert_fail(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i8*, i8** %6
%10 = call i32 @printk(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %7, i32 %8, i8* %9)
%11 = call i32 @BUG_ON(i32 1)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"BARF: %s@%d. %s\0A\00"
define void @fsl_assert_fail(i8* %0, i32 %1, i8* %2) {
%4 = tail call i32 @printk(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1, i8* %2)
%5 = tail call i32 @BUG_ON(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ED_getArray2DDimensionsFromXML(void *, char const *, int *,
                                                  int *);
void ED_getArray1DDimensionFromXML(void *_xml, const char *varName, int *n) {
  int m;
  ED_getArray2DDimensionsFromXML(_xml, varName, &m, n);
  *n *= m;
}


x86 assembly (clang, -O0):
<ED_getArray1DDimensionFromXML>:
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),%rcx
lea    -0x1c(%rbp),%rdx
call   1030 <ED_getArray2DDimensionsFromXML@plt>
mov    -0x1c(%rbp),%ecx
mov    -0x18(%rbp),%rax
imul   (%rax),%ecx
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ED_getArray1DDimensionFromXML>:
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%rbx
lea    0xc(%rsp),%rdx
mov    %rbx,%rcx
call   1030 <ED_getArray2DDimensionsFromXML@plt>
mov    (%rbx),%eax
imul   0xc(%rsp),%eax
mov    %eax,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @ED_getArray1DDimensionFromXML(i8* %0, i8* %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32*
%7 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32* %2, i32** %6
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = load i32*, i32** %6
%11 = call i32 @ED_getArray2DDimensionsFromXML(i8* %8, i8* %9, i32* %7, i32* %10)
%12 = load i32, i32* %7
%13 = load i32*, i32** %6
%14 = load i32, i32* %13
%15 = mul nsw i32 %14, %12
store i32 %15, i32* %13
ret void
}

LLVM IR (-O2):
define void @ED_getArray1DDimensionFromXML(i8* %0, i8* %1, i32* %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = call i32 @ED_getArray2DDimensionsFromXML(i8* %0, i8* %1, i32* %4, i32* %2)
%7 = load i32, i32* %4
%8 = load i32, i32* %2
%9 = mul nsw i32 %8, %7
store i32 %9, i32* %2
ret void
}
void f_omp_target(void) {
#pragma omp target
  {
#pragma omp parallel
    ;
  }
}


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

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

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

LLVM IR (-O2):
define void @f_omp_target() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ TreeBarrier_destroy();
void freeBarrier() { TreeBarrier_destroy(); }


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

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

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

LLVM IR (-O2):
define void @freeBarrier() {
%1 = tail call i32 (...) @TreeBarrier_destroy()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ IND(int, int);
int /*<<< orphan*/ T_WAIT_UNTIL(int);
void op_ED_0xaa(void) {
  IND(6, 9);
  T_WAIT_UNTIL(12);
  return;
}


x86 assembly (clang, -O0):
<op_ED_0xaa>:
push   %rbp
mov    %rsp,%rbp
mov    $0x6,%edi
mov    $0x9,%esi
call   1030 <IND@plt>
mov    $0xc,%edi
call   1040 <T_WAIT_UNTIL@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_ED_0xaa>:
push   %rax
mov    $0x6,%edi
mov    $0x9,%esi
call   1030 <IND@plt>
mov    $0xc,%edi
pop    %rax
jmp    1040 <T_WAIT_UNTIL@plt>

LLVM IR (-O0):
define void @op_ED_0xaa() {
%1 = call i32 @IND(i32 6, i32 9)
%2 = call i32 @T_WAIT_UNTIL(i32 12)
ret void
}

LLVM IR (-O2):
define void @op_ED_0xaa() {
%1 = tail call i32 @IND(i32 6, i32 9)
%2 = tail call i32 @T_WAIT_UNTIL(i32 12)
ret void
}
void LdL1(double x, double *y, double *z) {
  *y = x;
  *z = 1.;
}


x86 assembly (clang, -O0):
<LdL1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
movsd  0xed6(%rip),%xmm0
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<LdL1>:
movsd  %xmm0,(%rdi)
movabs $0x3ff0000000000000,%rax
mov    %rax,(%rsi)
ret

LLVM IR (-O0):
define void @LdL1(double %0, double* %1, double* %2) {
%4 = alloca double
%5 = alloca double*
%6 = alloca double*
store double %0, double* %4
store double* %1, double** %5
store double* %2, double** %6
%7 = load double, double* %4
%8 = load double*, double** %5
store double %7, double* %8
%9 = load double*, double** %6
store double 1.000000e+00, double* %9
ret void
}

LLVM IR (-O2):
define void @LdL1(double %0, double* nocapture writeonly %1, double* nocapture writeonly %2) {
store double %0, double* %1
store double 1.000000e+00, double* %2
ret void
}
void packi32(unsigned char *buf, unsigned long i) {
  *buf++ = i >> 24;
  *buf++ = i >> 16;
  *buf++ = i >> 8;
  *buf++ = i;
}


x86 assembly (clang, -O0):
<packi32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shr    $0x18,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
shr    $0x10,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
shr    $0x8,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @packi32(i8* nocapture writeonly %0, i64 %1) {
%3 = lshr i64 %1, 24
%4 = trunc i64 %3 to i8
%5 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %4, i8* %0
%6 = lshr i64 %1, 16
%7 = trunc i64 %6 to i8
%8 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %7, i8* %5
%9 = lshr i64 %1, 8
%10 = trunc i64 %9 to i8
%11 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %10, i8* %8
%12 = trunc i64 %1 to i8
store i8 %12, i8* %11
ret void
}
/* Variables and functions */
int /*<<< orphan*/ RTLD_LAZY;
void *dlopen(char *, int /*<<< orphan*/);
void *malloc(int);
void *LoadIcmp() {
  void *IcmpLib = malloc(sizeof(void));
  IcmpLib = dlopen("./icmp_lib.so", RTLD_LAZY);
  if (!IcmpLib)
    return 0;
  else
    return IcmpLib;
}


x86 assembly (clang, -O0):
<LoadIcmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    0x2ea3(%rip),%rax
mov    (%rax),%esi
lea    0xeba(%rip),%rdi
call   1030 <dlopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1167 <LoadIcmp+0x47>
movq   $0x0,-0x8(%rbp)
jmp    116f <LoadIcmp+0x4f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LoadIcmp>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
lea    0xee0(%rip),%rdi
jmp    1030 <dlopen@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"./icmp_lib.so\00"
@RTLD_LAZY = global i32 0
define i8* @LoadIcmp() {
%1 = alloca i8*
%2 = alloca i8*
%3 = call i8* @malloc(i32 1)
store i8* %3, i8** %2
%4 = load i32, i32* @RTLD_LAZY
%5 = call i8* @dlopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %4)
store i8* %5, i8** %2
%6 = load i8*, i8** %2
%7 = icmp ne i8* %6, null
br i1 %7, label %9, label %8
8: ; preds = %0
store i8* null, i8** %1
br label %11
9: ; preds = %0
%10 = load i8*, i8** %2
store i8* %10, i8** %1
br label %11
11: ; preds = %9, %8
%12 = load i8*, i8** %1
ret i8* %12
}

LLVM IR (-O2):
@.str = [14 x i8] c"./icmp_lib.so\00"
@RTLD_LAZY = global i32 0
define i8* @LoadIcmp() {
%1 = load i32, i32* @RTLD_LAZY
%2 = tail call i8* @dlopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ X509_SIG;
typedef int /*<<< orphan*/ BIO;

/* Variables and functions */
int /*<<< orphan*/ *ASN1_item_d2i_bio(int /*<<< orphan*/ *,
                                      int /*<<< orphan*/ *,
                                      int /*<<< orphan*/ **);
int /*<<< orphan*/ X509_SIG_it;
X509_SIG *d2i_PKCS8_bio(BIO *bp, X509_SIG **p8) {
  return ASN1_item_d2i_bio(&X509_SIG_it, bp, p8);
}


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

x86 assembly (clang, -O2):
<d2i_PKCS8_bio>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    0x2ecb(%rip),%rdi
jmp    1030 <ASN1_item_d2i_bio@plt>

LLVM IR (-O0):
@X509_SIG_it = global i32 0
define i32* @d2i_PKCS8_bio(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 = call i32* @ASN1_item_d2i_bio(i32* @X509_SIG_it, i32* %5, i32** %6)
ret i32* %7
}

LLVM IR (-O2):
@X509_SIG_it = global i32 0
define i32* @d2i_PKCS8_bio(i32* %0, i32** %1) {
%3 = tail call i32* @ASN1_item_d2i_bio(i32* @X509_SIG_it, i32* %0, i32** %1)
ret i32* %3
}
double calculate_ezz(double exx) { return -2 * exx * 0.453; }


x86 assembly (clang, -O0):
<calculate_ezz>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xef7(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xee2(%rip),%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculate_ezz>:
mulsd  0xef8(%rip),%xmm0
mulsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @calculate_ezz(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double -2.000000e+00, %3
%5 = fmul double %4, 4.530000e-01
ret double %5
}

LLVM IR (-O2):
define double @calculate_ezz(double %0) {
%2 = fmul double %0, -2.000000e+00
%3 = fmul double %2, 4.530000e-01
ret double %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fwrite(float *, int, int, int /*<<< orphan*/ *);
void ecrire_reel_binaire(FILE *fichier, float reel) {
  fwrite(&reel, 4, 1, fichier);
}


x86 assembly (clang, -O0):
<ecrire_reel_binaire>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%rcx
lea    -0xc(%rbp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fwrite@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ecrire_reel_binaire>:
push   %rax
mov    %rdi,%rcx
movss  %xmm0,0x4(%rsp)
lea    0x4(%rsp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fwrite@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @ecrire_reel_binaire(i32* nocapture %0, float %1) {
%3 = alloca float
store float %1, float* %3
%4 = call i32 @fwrite(float* %3, i32 4, i32 1, i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, int);
int /*<<< orphan*/ printf(char *, char *, char *, char *);
void fig08_28() {
  char s1[17];
  char s2[] = "Copy this string";
  memcpy(s1, s2, 17);
  printf("%s\n%s\"%s\"\n", "After s2 is copied into s1 with memcpy,",
         "s1 contains ", s1);
}


x86 assembly (clang, -O0):
<fig08_28>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xecc(%rip),%al
mov    %al,-0x30(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x40(%rbp),%rsi
mov    $0x11,%edx
call   1040 <memcpy@plt>
lea    -0x20(%rbp),%rcx
lea    0xead(%rip),%rdi
lea    0xeb1(%rip),%rsi
lea    0xed2(%rip),%rdx
call   1030 <printf@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fig08_28>:
push   %rbx
sub    $0x40,%rsp
movaps 0xed4(%rip),%xmm0
movaps %xmm0,(%rsp)
movb   $0x0,0x10(%rsp)
lea    0x20(%rsp),%rbx
mov    %rsp,%rsi
mov    %rbx,%rdi
mov    $0x11,%edx
call   1040 <memcpy@plt>
lea    0xec0(%rip),%rdi
lea    0xec4(%rip),%rsi
lea    0xee5(%rip),%rdx
mov    %rbx,%rcx
call   1030 <printf@plt>
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.fig08_28.s2 = [17 x i8] c"Copy this string\00"
@.str = [11 x i8] c"%s\0A%s\22%s\22\0A\00"
@.str.1 = [40 x i8] c"After s2 is copied into s1 with memcpy,\00"
@.str.2 = [13 x i8] c"s1 contains \00"
define void @fig08_28() {
%1 = alloca [17 x i8]
%2 = alloca [17 x i8]
%3 = bitcast [17 x i8]* %2 to i8*
%4 = getelementptr inbounds [17 x i8], [17 x i8]* %1, i64 0, i64 0
%5 = getelementptr inbounds [17 x i8], [17 x i8]* %2, i64 0, i64 0
%6 = call i32 @memcpy(i8* %4, i8* %5, i32 17)
%7 = getelementptr inbounds [17 x i8], [17 x i8]* %1, i64 0, i64 0
%8 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* %7)
ret void
}

LLVM IR (-O2):
@__const.fig08_28.s2 = [17 x i8] c"Copy this string\00"
@.str = [11 x i8] c"%s\0A%s\22%s\22\0A\00"
@.str.1 = [40 x i8] c"After s2 is copied into s1 with memcpy,\00"
@.str.2 = [13 x i8] c"s1 contains \00"
define void @fig08_28() {
%1 = alloca [17 x i8]
%2 = alloca [17 x i8]
%3 = getelementptr inbounds [17 x i8], [17 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [17 x i8], [17 x i8]* %2, i64 0, i64 0
%5 = call i32 @memcpy(i8* %3, i8* %4, i32 17)
%6 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SIOCATMARK;
scalar_t__ ioctl(int, int /*<<< orphan*/, int *);
int sockatmark(int fd) {
  int ret;
  if (ioctl(fd, SIOCATMARK, &ret) < 0)
    return -1;
  return ret;
}


x86 assembly (clang, -O0):
<sockatmark>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2ebb(%rip),%rax
mov    (%rax),%esi
lea    -0xc(%rbp),%rdx
call   1030 <ioctl@plt>
cmp    $0x0,%rax
jge    1146 <sockatmark+0x36>
movl   $0xffffffff,-0x4(%rbp)
jmp    114c <sockatmark+0x3c>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sockatmark>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
lea    0x4(%rsp),%rdx
call   1030 <ioctl@plt>
mov    %rax,%rcx
mov    $0xffffffff,%eax
test   %rcx,%rcx
js     1135 <sockatmark+0x25>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@SIOCATMARK = global i32 0
define i32 @sockatmark(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = load i32, i32* @SIOCATMARK
%7 = call i64 @ioctl(i32 %5, i32 %6, i32* %4)
%8 = icmp slt i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 -1, i32* %2
br label %12
10: ; preds = %1
%11 = load i32, i32* %4
store i32 %11, i32* %2
br label %12
12: ; preds = %10, %9
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
@SIOCATMARK = global i32 0
define i32 @sockatmark(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = load i32, i32* @SIOCATMARK
%5 = call i64 @ioctl(i32 %0, i32 %4, i32* %2)
%6 = icmp slt i64 %5, 0
%7 = load i32, i32* %2
%8 = select i1 %6, i32 -1, i32 %7
ret i32 %8
}