xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char const *, int, int);
void print_help(const char *name) {
  printf("usage: %s file|dir [w=%i] [h=%i]\n"
         "generate a test video stream\n",
         name, 352, 288);
  exit(1);
}


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

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

LLVM IR (-O0):
@.str = [63 x i8] c"usage: %s file|dir [w=%i] [h=%i]\0Agenerate a test video stream\0A\00"
define void @print_help(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0), i8* %3, i32 352, i32 288)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [63 x i8] c"usage: %s file|dir [w=%i] [h=%i]\0Agenerate a test video stream\0A\00"
define void @print_help(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0), i8* %0, i32 352, i32 288)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int bis(int, int);
int bool_or(int x, int y) {
  int result = bis(x, y);
  return result;
}


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

x86 assembly (clang, -O2):
<bool_or>:
jmp    1030 <bis@plt>

LLVM IR (-O0):
define i32 @bool_or(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i32 @bis(i32 %6, i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
define i32 @bool_or(i32 %0, i32 %1) {
%3 = tail call i32 @bis(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int rec1(int);
int rec2(int j) {
  if (j <= 0)
    return 0;
  return rec2(rec1(j - 1)) - 1;
}


x86 assembly (clang, -O0):
<rec2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jg     1141 <rec2+0x21>
movl   $0x0,-0x4(%rbp)
jmp    1159 <rec2+0x39>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1040 <rec1@plt>
mov    %eax,%edi
call   1030 <rec2@plt>
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rec2>:
push   %rbx
test   %edi,%edi
jle    1133 <rec2+0x23>
mov    %edi,%eax
xor    %ebx,%ebx
nopl   0x0(%rax)
add    $0xffffffff,%eax
mov    %eax,%edi
call   1030 <rec1@plt>
add    $0xffffffff,%ebx
test   %eax,%eax
jg     1120 <rec2+0x10>
jmp    1135 <rec2+0x25>
xor    %ebx,%ebx
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @rec2(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ %0, %1 ]
%5 = phi i32 [ %8, %3 ], [ 0, %1 ]
%6 = add nsw i32 %4, -1
%7 = tail call i32 @rec1(i32 %6)
%8 = add nsw i32 %5, -1
%9 = icmp slt i32 %7, 1
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *);
int undo(int curr) {
  int backtrack = 0;
  scanf("%d", &backtrack);
  while (backtrack--)
    curr--;
  return curr < 0 ? 0 : curr;
}


x86 assembly (clang, -O0):
<undo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xed7(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
je     1154 <undo+0x44>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    1132 <undo+0x22>
cmpl   $0x0,-0x4(%rbp)
jge    1168 <undo+0x58>
xor    %eax,%eax
mov    %eax,-0xc(%rbp)
jmp    116e <undo+0x5e>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<undo>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
movl   $0x0,0xc(%rsp)
lea    0xeda(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1030 <scanf@plt>
xor    %eax,%eax
sub    0xc(%rsp),%ebx
cmovs  %eax,%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @undo(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
br label %5
5: ; preds = %9, %1
%6 = load i32, i32* %3
%7 = add nsw i32 %6, -1
store i32 %7, i32* %3
%8 = icmp ne i32 %6, 0
br i1 %8, label %9, label %12
9: ; preds = %5
%10 = load i32, i32* %2
%11 = add nsw i32 %10, -1
store i32 %11, i32* %2
br label %5
12: ; preds = %5
%13 = load i32, i32* %2
%14 = icmp slt i32 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %12
br label %18
16: ; preds = %12
%17 = load i32, i32* %2
br label %18
18: ; preds = %16, %15
%19 = phi i32 [ 0, %15 ], [ %17, %16 ]
ret i32 %19
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @undo(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = sub i32 %0, %5
%7 = icmp sgt i32 %6, 0
%8 = select i1 %7, i32 %6, i32 0
ret i32 %8
}
double v_dot_p3(const double x[3], const double y[3]) {
  double res = 0.0;
  int i;
  for (i = 0; i < 3; i++)
    res += x[i] * y[i];
  return res;
}


x86 assembly (clang, -O0):
<v_dot_p3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x3,-0x1c(%rbp)
jge    115f <v_dot_p3+0x5f>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x18(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    111b <v_dot_p3+0x1b>
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<v_dot_p3>:
movsd  (%rdi),%xmm0
movsd  0x8(%rdi),%xmm1
mulsd  (%rsi),%xmm0
xorpd  %xmm2,%xmm2
addsd  %xmm0,%xmm2
mulsd  0x8(%rsi),%xmm1
addsd  %xmm2,%xmm1
movsd  0x10(%rdi),%xmm0
mulsd  0x10(%rsi),%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @v_dot_p3(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca double
%6 = alloca i32
store double* %0, double** %3
store double* %1, double** %4
store double 0.000000e+00, double* %5
store i32 0, i32* %6
br label %7
7: ; preds = %23, %2
%8 = load i32, i32* %6
%9 = icmp slt i32 %8, 3
br i1 %9, label %10, label %26
10: ; preds = %7
%11 = load double*, double** %3
%12 = load i32, i32* %6
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds double, double* %11, i64 %13
%15 = load double, double* %14
%16 = load double*, double** %4
%17 = load i32, i32* %6
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds double, double* %16, i64 %18
%20 = load double, double* %19
%21 = load double, double* %5
%22 = call double @llvm.fmuladd.f64(double %15, double %20, double %21)
store double %22, double* %5
br label %23
23: ; preds = %10
%24 = load i32, i32* %6
%25 = add nsw i32 %24, 1
store i32 %25, i32* %6
br label %7
26: ; preds = %7
%27 = load double, double* %5
ret double %27
}

LLVM IR (-O2):
define double @v_dot_p3(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
%5 = tail call double @llvm.fmuladd.f64(double %3, double %4, double 0.000000e+00)
%6 = getelementptr inbounds double, double* %0, i64 1
%7 = load double, double* %6
%8 = getelementptr inbounds double, double* %1, i64 1
%9 = load double, double* %8
%10 = tail call double @llvm.fmuladd.f64(double %7, double %9, double %5)
%11 = getelementptr inbounds double, double* %0, i64 2
%12 = load double, double* %11
%13 = getelementptr inbounds double, double* %1, i64 2
%14 = load double, double* %13
%15 = tail call double @llvm.fmuladd.f64(double %12, double %14, double %10)
ret double %15
}
/* Variables and functions */
int /*<<< orphan*/ clear_ibuf();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void new_prompt(void) {
  clear_ibuf();
  fprintf(stdout, "> ");
}


x86 assembly (clang, -O0):
<new_prompt>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <clear_ibuf@plt>
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
lea    0xec5(%rip),%rsi
call   1040 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<new_prompt>:
push   %rax
xor    %eax,%eax
call   1030 <clear_ibuf@plt>
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
lea    0xec8(%rip),%rsi
pop    %rax
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [3 x i8] c"> \00"
define void @new_prompt() {
%1 = call i32 (...) @clear_ibuf()
%2 = load i32, i32* @stdout
%3 = call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [3 x i8] c"> \00"
define void @new_prompt() {
%1 = tail call i32 (...) @clear_ibuf()
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bgnline();
void bgnline_() { bgnline(); }


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

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

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

LLVM IR (-O2):
define void @bgnline_() {
%1 = tail call i32 (...) @bgnline()
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ cross_product_of_vectors(int *, int *);
int /*<<< orphan*/ fill_array(int *, int);
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Enter vector members :\n");
  int firstVector[3], secondVector[3];
  fill_array(firstVector, 3);
  fill_array(secondVector, 3);
  cross_product_of_vectors(firstVector, secondVector);
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
lea    -0x10(%rbp),%rdi
mov    $0x3,%esi
call   1040 <fill_array@plt>
lea    -0x1c(%rbp),%rdi
mov    $0x3,%esi
call   1040 <fill_array@plt>
lea    -0x10(%rbp),%rdi
lea    -0x1c(%rbp),%rsi
call   1050 <cross_product_of_vectors@plt>
mov    0x2e65(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
lea    0xec2(%rip),%rdi
call   1030 <puts@plt>
lea    0xc(%rsp),%r14
mov    %r14,%rdi
mov    $0x3,%esi
call   1040 <fill_array@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x3,%esi
call   1040 <fill_array@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <cross_product_of_vectors@plt>
mov    0x2e69(%rip),%rax
mov    (%rax),%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Enter vector members :\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x i32]
%3 = alloca [3 x i32]
store i32 0, i32* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%6 = call i32 @fill_array(i32* %5, i32 3)
%7 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 0
%8 = call i32 @fill_array(i32* %7, i32 3)
%9 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%10 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 0
%11 = call i32 @cross_product_of_vectors(i32* %9, i32* %10)
%12 = load i32, i32* @EXIT_SUCCESS
ret i32 %12
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@str = [23 x i8] c"Enter vector members :\00"
define i32 @main() {
%1 = alloca [3 x i32]
%2 = alloca [3 x i32]
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%4 = bitcast [3 x i32]* %1 to i8*
%5 = bitcast [3 x i32]* %2 to i8*
%6 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%7 = call i32 @fill_array(i32* %6, i32 3)
%8 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%9 = call i32 @fill_array(i32* %8, i32 3)
%10 = call i32 @cross_product_of_vectors(i32* %6, i32* %8)
%11 = load i32, i32* @EXIT_SUCCESS
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char myChar;
  printf("Please enter a character: ");
  scanf("%c", &myChar);
  if (myChar == 'A') {
    printf("Hello");
  } else {
    printf("You entered an invalid character.\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
lea    0xed9(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1040 <scanf@plt>
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
jne    1169 <main+0x49>
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
jmp    1175 <main+0x55>
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
lea    0xed7(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1050 <scanf@plt>
cmpb   $0x41,0x7(%rsp)
jne    1163 <main+0x33>
lea    0xec2(%rip),%rdi
call   1040 <printf@plt>
jmp    116f <main+0x3f>
lea    0xeba(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Please enter a character: \00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [6 x i8] c"Hello\00"
@.str.3 = [35 x i8] c"You entered an invalid character.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 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), i8* %2)
%5 = load i8, i8* %2
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 65
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %12
10: ; preds = %0
%11 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0))
br label %12
12: ; preds = %10, %8
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"Please enter a character: \00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [6 x i8] c"Hello\00"
@str = [34 x i8] c"You entered an invalid character.\00"
define i32 @main() {
%1 = alloca i8
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%4 = load i8, i8* %1
%5 = icmp eq i8 %4, 65
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %10
8: ; preds = %0
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
br label %10
10: ; preds = %8, %6
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0x97() {
  Assert_real((isdigit(151) == 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_isdigit.c",
              760, ("isdigit should be 0 for 0x97"));
}


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

x86 assembly (clang, -O2):
<t_isdigit_0x97>:
push   %rax
mov    $0x97,%edi
call   1030 <isdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2f8,%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_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0x97\00"
define void @t_isdigit_0x97() {
%1 = call i64 @isdigit(i32 151)
%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 760, 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_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0x97\00"
define void @t_isdigit_0x97() {
%1 = tail call i64 @isdigit(i32 151)
%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 760, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int munmap(void *, size_t);
int /*<<< orphan*/ perror(char *);
void close_log(void *addr, size_t mem_size) {
  if (munmap(addr, mem_size) == -1) {
    perror("munmap");
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<close_log>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <munmap@plt>
cmp    $0xffffffff,%eax
jne    1170 <close_log+0x40>
lea    0xea3(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e77(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_log>:
push   %rax
call   1030 <munmap@plt>
cmp    $0xffffffff,%eax
je     113d <close_log+0xd>
pop    %rax
ret
lea    0xebc(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"munmap\00"
@EXIT_FAILURE = global i32 0
define void @close_log(i8* %0, i64 %1) {
%3 = tail call i32 @munmap(i8* %0, i64 %1)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("hello, my cat:%d\n", 1);
  printf("hello, my cat:%d\n", 1);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [18 x i8] c"hello, my cat:%d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 1)
%3 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"hello, my cat:%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 0
}
/* Variables and functions */
double aa_tf_cos_series2(double);
double aa_tf_cos_series(double theta) {
  return aa_tf_cos_series2(theta * theta);
}


x86 assembly (clang, -O0):
<aa_tf_cos_series>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
call   1030 <aa_tf_cos_series2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aa_tf_cos_series>:
mulsd  %xmm0,%xmm0
jmp    1030 <aa_tf_cos_series2@plt>

LLVM IR (-O0):
define double @aa_tf_cos_series(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fmul double %3, %4
%6 = call double @aa_tf_cos_series2(double %5)
ret double %6
}

LLVM IR (-O2):
define double @aa_tf_cos_series(double %0) {
%2 = fmul double %0, %0
%3 = tail call double @aa_tf_cos_series2(double %2)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ Uart_SendString(char *, int);
void cpum_setup() { Uart_SendString("cpum setup.\n", 12); }


x86 assembly (clang, -O0):
<cpum_setup>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0xc,%esi
call   1030 <Uart_SendString@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpum_setup>:
lea    0xee9(%rip),%rdi
mov    $0xc,%esi
jmp    1030 <Uart_SendString@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"cpum setup.\0A\00"
define void @cpum_setup() {
%1 = call i32 @Uart_SendString(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 12)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"cpum setup.\0A\00"
define void @cpum_setup() {
%1 = tail call i32 @Uart_SendString(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 12)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(void) { printf("usage: stnc [-h HOST] [-p PORT] [-u USER] [-l]\n"); }


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

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

LLVM IR (-O0):
@.str = [48 x i8] c"usage: stnc [-h HOST] [-p PORT] [-u USER] [-l]\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [47 x i8] c"usage: stnc [-h HOST] [-p PORT] [-u USER] [-l]\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ read(int, void *, size_t);
ssize_t read_pre(int fd, void *buf, size_t count) {
  return read(fd, buf, count);
}


x86 assembly (clang, -O0):
<read_pre>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <read@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_pre>:
jmp    1030 <read@plt>

LLVM IR (-O0):
define i32 @read_pre(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
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i32 @read(i32 %7, i8* %8, i64 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @read_pre(i32 %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32 @read(i32 %0, i8* %1, i64 %2)
ret i32 %4
}
/* Variables and functions */
char *strchr(char *, char);
int strlen(char *);
int /*<<< orphan*/ strncpy(char *, char *, int);
char *clean_text(char *raw, char *clean) {
  raw[strlen(raw) - 1] = '\0';
  raw = strchr(raw, '>') + 1;
  strncpy(clean, raw, strlen(raw) + 1);
  return clean;
}


x86 assembly (clang, -O0):
<clean_text>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rdi
mov    $0x3e,%esi
call   1050 <strchr@plt>
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
add    $0x1,%edx
call   1030 <strncpy@plt>
mov    -0x10(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clean_text>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%rbx,1)
mov    %rbx,%rdi
mov    $0x3e,%esi
call   1050 <strchr@plt>
lea    0x1(%rax),%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
lea    0x1(%rax),%edx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <strncpy@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @clean_text(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @strlen(i8* %6)
%8 = sub nsw i32 %7, 1
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %5, i64 %9
store i8 0, i8* %10
%11 = load i8*, i8** %3
%12 = call i8* @strchr(i8* %11, i8 signext 62)
%13 = getelementptr inbounds i8, i8* %12, i64 1
store i8* %13, i8** %3
%14 = load i8*, i8** %4
%15 = load i8*, i8** %3
%16 = load i8*, i8** %3
%17 = call i32 @strlen(i8* %16)
%18 = add nsw i32 %17, 1
%19 = call i32 @strncpy(i8* %14, i8* %15, i32 %18)
%20 = load i8*, i8** %4
ret i8* %20
}

LLVM IR (-O2):
define i8* @clean_text(i8* %0, i8* returned %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = add nsw i32 %3, -1
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
store i8 0, i8* %6
%7 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 62)
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = tail call i32 @strlen(i8* %8)
%10 = add nsw i32 %9, 1
%11 = tail call i32 @strncpy(i8* %1, i8* %8, i32 %10)
ret i8* %1
}
/* Variables and functions */
int tobyte(unsigned char, unsigned char);
unsigned int toword(unsigned char ch1, unsigned char ch2, unsigned char ch3,
                    unsigned char ch4) {
  return tobyte(ch1, ch2) << 8 | tobyte(ch3, ch4);
}


x86 assembly (clang, -O0):
<toword>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %cl,%al
mov    %dl,%cl
mov    %sil,%dl
mov    %dil,%sil
mov    %sil,-0x1(%rbp)
mov    %dl,-0x2(%rbp)
mov    %cl,-0x3(%rbp)
mov    %al,-0x4(%rbp)
mov    -0x1(%rbp),%al
movzbl %al,%edi
movzbl -0x2(%rbp),%esi
call   1030 <tobyte@plt>
shl    $0x8,%eax
mov    %eax,-0x8(%rbp)
mov    -0x3(%rbp),%al
movzbl %al,%edi
movzbl -0x4(%rbp),%esi
call   1030 <tobyte@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
or     %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<toword>:
push   %rbp
push   %r14
push   %rbx
mov    %ecx,%r14d
mov    %edx,%ebp
call   1030 <tobyte@plt>
mov    %eax,%ebx
shl    $0x8,%ebx
mov    %ebp,%edi
mov    %r14d,%esi
call   1030 <tobyte@plt>
or     %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @toword(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2, i8 zeroext %3) {
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8 %0, i8* %5
store i8 %1, i8* %6
store i8 %2, i8* %7
store i8 %3, i8* %8
%9 = load i8, i8* %5
%10 = load i8, i8* %6
%11 = call i32 @tobyte(i8 zeroext %9, i8 zeroext %10)
%12 = shl i32 %11, 8
%13 = load i8, i8* %7
%14 = load i8, i8* %8
%15 = call i32 @tobyte(i8 zeroext %13, i8 zeroext %14)
%16 = or i32 %12, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @toword(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2, i8 zeroext %3) {
%5 = tail call i32 @tobyte(i8 zeroext %0, i8 zeroext %1)
%6 = shl i32 %5, 8
%7 = tail call i32 @tobyte(i8 zeroext %2, i8 zeroext %3)
%8 = or i32 %6, %7
ret i32 %8
}
int tagcmp(char *got, char *expected) {
  int i;
  for (i = 0; *(expected + i); i++) {
    if (*(got + i) != *(expected + i))
      return i + 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<tagcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1166 <tagcmp+0x66>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    -0x18(%rbp),%rcx
movslq -0x1c(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
je     1153 <tagcmp+0x53>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    116d <tagcmp+0x6d>
jmp    1158 <tagcmp+0x58>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1113 <tagcmp+0x13>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tagcmp>:
mov    (%rsi),%dl
xor    %eax,%eax
test   %dl,%dl
je     1122 <tagcmp+0x22>
mov    $0x1,%ecx
nopl   (%rax)
cmp    %dl,-0x1(%rdi,%rcx,1)
jne    1123 <tagcmp+0x23>
movzbl (%rsi,%rcx,1),%edx
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <tagcmp+0x10>
ret
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @tagcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %19, label %5
5: ; preds = %2, %14
%6 = phi i64 [ %15, %14 ], [ 0, %2 ]
%7 = phi i8 [ %17, %14 ], [ %3, %2 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %6
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, %7
br i1 %10, label %14, label %11
11: ; preds = %5
%12 = trunc i64 %6 to i32
%13 = add nuw nsw i32 %12, 1
br label %19
14: ; preds = %5
%15 = add nuw i64 %6, 1
%16 = getelementptr inbounds i8, i8* %1, i64 %15
%17 = load i8, i8* %16
%18 = icmp eq i8 %17, 0
br i1 %18, label %19, label %5
19: ; preds = %14, %2, %11
%20 = phi i32 [ %13, %11 ], [ 0, %2 ], [ 0, %14 ]
ret i32 %20
}
void gluiAddSubMenu(char *name, void (*func)(int value)) {}


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

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

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

LLVM IR (-O2):
define void @gluiAddSubMenu(i8* nocapture %0, void (i32)* nocapture %1) {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void systick_enable(void) {
  (*(volatile uint32_t *)((0xE000E010) + 0x04)) = ((40000000 / 1000) - 1);
  (*(volatile uint32_t *)((0xE000E010) + 0x08)) = 0;
  (*(volatile uint32_t *)((0xE000E010) + 0x00)) |= 0x07;
}


x86 assembly (clang, -O0):
<systick_enable>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe000e014,%eax
movl   $0x9c3f,(%rax)
mov    $0xe000e018,%eax
movl   $0x0,(%rax)
mov    $0xe000e010,%eax
mov    (%rax),%ecx
or     $0x7,%ecx
mov    $0xe000e010,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<systick_enable>:
mov    $0xe000e010,%eax
movl   $0x9c3f,0x4(%rax)
movl   $0x0,0x8(%rax)
orl    $0x7,(%rax)
ret

LLVM IR (-O0):
define void @systick_enable() {
store volatile i32 39999, i32* inttoptr (i64 3758153748 to i32*)
store volatile i32 0, i32* inttoptr (i64 3758153752 to i32*)
%1 = load volatile i32, i32* inttoptr (i64 3758153744 to i32*)
%2 = or i32 %1, 7
store volatile i32 %2, i32* inttoptr (i64 3758153744 to i32*)
ret void
}

LLVM IR (-O2):
define void @systick_enable() {
store volatile i32 39999, i32* inttoptr (i64 3758153748 to i32*)
store volatile i32 0, i32* inttoptr (i64 3758153752 to i32*)
%1 = load volatile i32, i32* inttoptr (i64 3758153744 to i32*)
%2 = or i32 %1, 7
store volatile i32 %2, i32* inttoptr (i64 3758153744 to i32*)
ret void
}
/* Variables and functions */
double hypotenuse(double, double);
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ scanf(char *, double *, double *);
void main(void) {
  double a, b;
  scanf("%lf %lf", &a, &b);
  printf("%.2f\n", hypotenuse(a, b));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0x10(%rbp),%rdx
call   1050 <scanf@plt>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1040 <hypotenuse@plt>
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xec5(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1050 <scanf@plt>
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
call   1040 <hypotenuse@plt>
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"%lf %lf\00"
@.str.1 = [6 x i8] c"%.2f\0A\00"
define void @main() {
%1 = alloca double
%2 = alloca double
%3 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double* %1, double* %2)
%4 = load double, double* %1
%5 = load double, double* %2
%6 = call double @hypotenuse(double %4, double %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), double %6)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"%lf %lf\00"
@.str.1 = [6 x i8] c"%.2f\0A\00"
define void @main() {
%1 = alloca double
%2 = alloca double
%3 = bitcast double* %1 to i8*
%4 = bitcast double* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double* %1, double* %2)
%6 = load double, double* %1
%7 = load double, double* %2
%8 = call double @hypotenuse(double %6, double %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), double %8)
ret void
}
int cdAppNull(unsigned char *es, int x) {
  int y;
  for (y = 0; y < x; y++) {
    *es = '\0';
    es++;
  }
  return x;
}


x86 assembly (clang, -O0):
<cdAppNull>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    113f <cdAppNull+0x3f>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <cdAppNull+0x12>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cdAppNull>:
push   %rbx
mov    %esi,%ebx
test   %esi,%esi
jle    1120 <cdAppNull+0x10>
mov    %ebx,%edx
xor    %esi,%esi
call   1030 <memset@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @cdAppNull(i8* nocapture writeonly %0, i32 returned %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %2
ret i32 %1
}
/* Variables and functions */
long env_djb2_hash(char *);
int env_hash(char *k, int limit) {
  long hash = env_djb2_hash(k);
  return hash % limit;
}


x86 assembly (clang, -O0):
<env_hash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <env_djb2_hash@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
cqto
idiv   %rcx
mov    %edx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<env_hash>:
push   %rbx
mov    %esi,%ebx
call   1030 <env_djb2_hash@plt>
movslq %ebx,%rcx
mov    %rax,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
je     1131 <env_hash+0x21>
cqto
idiv   %rcx
mov    %rdx,%rax
pop    %rbx
ret
xor    %edx,%edx
div    %ebx
mov    %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @env_hash(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i64
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = call i64 @env_djb2_hash(i8* %6)
store i64 %7, i64* %5
%8 = load i64, i64* %5
%9 = load i32, i32* %4
%10 = sext i32 %9 to i64
%11 = srem i64 %8, %10
%12 = trunc i64 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @env_hash(i8* %0, i32 %1) {
%3 = tail call i64 @env_djb2_hash(i8* %0)
%4 = sext i32 %1 to i64
%5 = srem i64 %3, %4
%6 = trunc i64 %5 to i32
ret i32 %6
}
/* Variables and functions */
scalar_t__ _U_Qfcmp(long double, long double, int);
int _U_Qfunle(long double a, long double b) {
  return (_U_Qfcmp(a, b, 1 | 2 | 4 | 8) != 0);
}


x86 assembly (clang, -O0):
<_U_Qfunle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  0x10(%rax)
fstpt  (%rax)
mov    $0xf,%edi
call   1030 <_U_Qfcmp@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_U_Qfunle>:
sub    $0x28,%rsp
fldt   0x30(%rsp)
fldt   0x40(%rsp)
fstpt  0x10(%rsp)
fstpt  (%rsp)
mov    $0xf,%edi
call   1030 <_U_Qfcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
define i32 @_U_Qfunle(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
store x86_fp80 %1, x86_fp80* %4
%5 = load x86_fp80, x86_fp80* %3
%6 = load x86_fp80, x86_fp80* %4
%7 = call i64 @_U_Qfcmp(x86_fp80 %5, x86_fp80 %6, i32 15)
%8 = icmp ne i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @_U_Qfunle(x86_fp80 %0, x86_fp80 %1) {
%3 = tail call i64 @_U_Qfcmp(x86_fp80 %0, x86_fp80 %1, i32 15)
%4 = icmp ne i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
int fusion_schar(signed char *p) { return p[0x12345]; }


x86 assembly (clang, -O0):
<fusion_schar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl 0x12345(%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fusion_schar>:
movsbl 0x12345(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @fusion_schar(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 74565
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @fusion_schar(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 74565
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
ret i32 %4
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ slog(int, char *, int);
scalar_t__ strlen(char *);
int getMaxDaysInCache(char *string) {
  int days = 2;
  string += strlen("days=");
  if (strlen(string) > 0) {
    days = atoi(string);
  }
  slog(2, "max number of days in cache: %d \n", days);
  return days;
}


x86 assembly (clang, -O0):
<getMaxDaysInCache>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
lea    0xeb6(%rip),%rdi
call   1030 <strlen@plt>
add    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x0,%rax
jle    1176 <getMaxDaysInCache+0x46>
mov    -0x8(%rbp),%rdi
call   1050 <atoi@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edx
mov    $0x2,%edi
lea    0xe81(%rip),%rsi
call   1040 <slog@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getMaxDaysInCache>:
push   %rbx
mov    %rdi,%rbx
add    $0x5,%rbx
mov    %rbx,%rdi
call   1030 <strlen@plt>
test   %rax,%rax
jle    1151 <getMaxDaysInCache+0x21>
mov    %rbx,%rdi
call   1050 <atoi@plt>
mov    %eax,%ebx
jmp    1156 <getMaxDaysInCache+0x26>
mov    $0x2,%ebx
lea    0xea3(%rip),%rsi
mov    $0x2,%edi
mov    %ebx,%edx
call   1040 <slog@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"days=\00"
@.str.1 = [34 x i8] c"max number of days in cache: %d \0A\00"
define i32 @getMaxDaysInCache(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 2, i32* %3
%4 = call i64 @strlen(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 %4
store i8* %6, i8** %2
%7 = load i8*, i8** %2
%8 = call i64 @strlen(i8* %7)
%9 = icmp sgt i64 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %1
%11 = load i8*, i8** %2
%12 = call i32 @atoi(i8* %11)
store i32 %12, i32* %3
br label %13
13: ; preds = %10, %1
%14 = load i32, i32* %3
%15 = call i32 @slog(i32 2, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i32 %14)
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
@.str.1 = [34 x i8] c"max number of days in cache: %d \0A\00"
define i32 @getMaxDaysInCache(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 5
%3 = tail call i64 @strlen(i8* %2)
%4 = icmp sgt i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @atoi(i8* %2)
br label %7
7: ; preds = %5, %1
%8 = phi i32 [ %6, %5 ], [ 2, %1 ]
%9 = tail call i32 @slog(i32 2, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 %8
}
/* Variables and functions */
int mpu_write_mem(int, int, unsigned char *);
int dmp_set_shake_reject_time(unsigned short time) {
  unsigned char tmp[2];
  time /= (1000 / (200));
  tmp[0] = time >> 8;
  tmp[1] = time & 0xFF;
  return mpu_write_mem((256 + 90), 2, tmp);
}


x86 assembly (clang, -O0):
<dmp_set_shake_reject_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
sar    $0x8,%eax
mov    %al,-0x4(%rbp)
movzwl -0x2(%rbp),%eax
and    $0xff,%eax
mov    %al,-0x3(%rbp)
lea    -0x4(%rbp),%rdx
mov    $0x15a,%edi
mov    $0x2,%esi
call   1030 <mpu_write_mem@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dmp_set_shake_reject_time>:
push   %rax
imul   $0xcccd,%edi,%eax
shr    $0x12,%eax
rol    $0x8,%ax
mov    %ax,0x6(%rsp)
lea    0x6(%rsp),%rdx
mov    $0x15a,%edi
mov    $0x2,%esi
call   1030 <mpu_write_mem@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @dmp_set_shake_reject_time(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca [2 x i8]
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = zext i16 %4 to i32
%6 = sdiv i32 %5, 5
%7 = trunc i32 %6 to i16
store i16 %7, i16* %2
%8 = load i16, i16* %2
%9 = zext i16 %8 to i32
%10 = ashr i32 %9, 8
%11 = trunc i32 %10 to i8
%12 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
store i8 %11, i8* %12
%13 = load i16, i16* %2
%14 = zext i16 %13 to i32
%15 = and i32 %14, 255
%16 = trunc i32 %15 to i8
%17 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 1
store i8 %16, i8* %17
%18 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%19 = call i32 @mpu_write_mem(i32 346, i32 2, i8* %18)
ret i32 %19
}

LLVM IR (-O2):
define i32 @dmp_set_shake_reject_time(i16 zeroext %0) {
%2 = alloca [2 x i8]
%3 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
%4 = udiv i16 %0, 5
%5 = lshr i16 %4, 8
%6 = trunc i16 %5 to i8
store i8 %6, i8* %3
%7 = trunc i16 %4 to i8
%8 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 1
store i8 %7, i8* %8
%9 = call i32 @mpu_write_mem(i32 346, i32 2, i8* %3)
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, const char *argv[]) { printf("\nHello World\n\n"); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [14 x i8] c"\0AHello World\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 0
}