xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int number;
  printf("Type in your number: ");
  scanf("%i", &number);
  if (number < 0) {
    number = -number;
  }
  printf("The absolute value is %i\n", number);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed2(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
jge    115f <main+0x3f>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xeb0(%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    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee0(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
test   %esi,%esi
jns    114e <main+0x2e>
neg    %esi
mov    %esi,0x4(%rsp)
lea    0xec4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Type in your number: \00"
@.str.1 = [3 x i8] c"%i\00"
@.str.2 = [26 x i8] c"The absolute value is %i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 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 = icmp slt i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %0
%8 = load i32, i32* %2
%9 = sub nsw i32 0, %8
store i32 %9, i32* %2
br label %10
10: ; preds = %7, %0
%11 = load i32, i32* %2
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i32 %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"Type in your number: \00"
@.str.1 = [3 x i8] c"%i\00"
@.str.2 = [26 x i8] c"The absolute value is %i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 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 = icmp slt i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = sub nsw i32 0, %5
store i32 %8, i32* %1
br label %9
9: ; preds = %7, %0
%10 = phi i32 [ %8, %7 ], [ %5, %0 ]
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i32 %10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0x1a() {
  Assert_real((isdigit(26) == 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",
              135, ("isdigit should be 0 for 0x1a"));
}


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

x86 assembly (clang, -O2):
<t_isdigit_0x1a>:
push   %rax
mov    $0x1a,%edi
call   1030 <isdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x87,%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 0x1a\00"
define void @t_isdigit_0x1a() {
%1 = call i64 @isdigit(i32 26)
%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 135, 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 0x1a\00"
define void @t_isdigit_0x1a() {
%1 = tail call i64 @isdigit(i32 26)
%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 135, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int rand();
double GetRandomDouble() {
  double r = rand() % 1000;
  return r / 1000000;
}


x86 assembly (clang, -O0):
<GetRandomDouble>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x3e8,%ecx
cltd
idiv   %ecx
cvtsi2sd %edx,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xec3(%rip),%xmm1
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetRandomDouble>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x10624dd3,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rcx
add    %edx,%ecx
imul   $0x3e8,%ecx,%ecx
sub    %ecx,%eax
cvtsi2sd %eax,%xmm0
divsd  0xebe(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @GetRandomDouble() {
%1 = alloca double
%2 = call i32 (...) @rand()
%3 = srem i32 %2, 1000
%4 = sitofp i32 %3 to double
store double %4, double* %1
%5 = load double, double* %1
%6 = fdiv double %5, 1.000000e+06
ret double %6
}

LLVM IR (-O2):
define double @GetRandomDouble() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 1000
%3 = sitofp i32 %2 to double
%4 = fdiv double %3, 1.000000e+06
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ getch();
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ printw(char *);
int /*<<< orphan*/ refresh();
int main() {
  initscr();
  printw("Hello World !");
  refresh();
  getch();
  endwin();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <initscr@plt>
lea    0xe93(%rip),%rdi
call   1040 <printw@plt>
mov    $0x0,%al
call   1050 <refresh@plt>
mov    $0x0,%al
call   1060 <getch@plt>
mov    $0x0,%al
call   1070 <endwin@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <initscr@plt>
lea    0xea1(%rip),%rdi
call   1040 <printw@plt>
xor    %eax,%eax
call   1050 <refresh@plt>
xor    %eax,%eax
call   1060 <getch@plt>
xor    %eax,%eax
call   1070 <endwin@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Hello World !\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @initscr()
%3 = call i32 @printw(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @refresh()
%5 = call i32 (...) @getch()
%6 = call i32 (...) @endwin()
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"Hello World !\00"
define i32 @main() {
%1 = tail call i32 (...) @initscr()
%2 = tail call i32 @printw(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @refresh()
%4 = tail call i32 (...) @getch()
%5 = tail call i32 (...) @endwin()
ret i32 0
}
int main(void) {
  int a = -100;
  int b = 2;
  int f = 6;
  int g = 7;
  int h = 8;
  while (f || a) {
    a += b;
    f += g;
    g += h;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0xffffff9c,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
movl   $0x6,-0x10(%rbp)
movl   $0x7,-0x14(%rbp)
movl   $0x8,-0x18(%rbp)
mov    $0x1,%al
cmpl   $0x0,-0x10(%rbp)
mov    %al,-0x19(%rbp)
jne    1147 <main+0x47>
cmpl   $0x0,-0x8(%rbp)
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1157 <main+0x57>
jmp    1177 <main+0x77>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x14(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x18(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    112e <main+0x2e>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i32 -100, i32* %2
store i32 2, i32* %3
store i32 6, i32* %4
store i32 7, i32* %5
store i32 8, i32* %6
br label %7
7: ; preds = %15, %0
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 0
br i1 %9, label %13, label %10
10: ; preds = %7
%11 = load i32, i32* %2
%12 = icmp ne i32 %11, 0
br label %13
13: ; preds = %10, %7
%14 = phi i1 [ true, %7 ], [ %12, %10 ]
br i1 %14, label %15, label %25
15: ; preds = %13
%16 = load i32, i32* %3
%17 = load i32, i32* %2
%18 = add nsw i32 %17, %16
store i32 %18, i32* %2
%19 = load i32, i32* %5
%20 = load i32, i32* %4
%21 = add nsw i32 %20, %19
store i32 %21, i32* %4
%22 = load i32, i32* %6
%23 = load i32, i32* %5
%24 = add nsw i32 %23, %22
store i32 %24, i32* %5
br label %7
25: ; preds = %13
%26 = load i32, i32* %1
ret i32 %26
}

LLVM IR (-O2):
/* Variables and functions */
scalar_t__ my_strcmp(char *, char *);
int is_sorted(char **tab) {
  while (*tab++) {
    if (my_strcmp(tab[0], tab[1]) > 0)
      return (0);
  }
  return (1);
}


x86 assembly (clang, -O0):
<is_sorted>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
cmpq   $0x0,(%rax)
je     1164 <is_sorted+0x54>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
call   1030 <my_strcmp@plt>
cmp    $0x0,%rax
jle    115f <is_sorted+0x4f>
movl   $0x0,-0x4(%rbp)
jmp    116b <is_sorted+0x5b>
jmp    111c <is_sorted+0xc>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_sorted>:
push   %rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
cmpq   $0x0,(%rdi)
je     1146 <is_sorted+0x36>
lea    0x8(%rdi),%rbx
mov    0x8(%rdi),%rax
mov    0x10(%rdi),%rsi
mov    %rax,%rdi
call   1030 <my_strcmp@plt>
mov    %rbx,%rdi
test   %rax,%rax
jle    1120 <is_sorted+0x10>
xor    %eax,%eax
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @is_sorted(i8** nocapture %0) {
br label %2
2: ; preds = %7, %1
%3 = phi i8** [ %0, %1 ], [ %4, %7 ]
%4 = getelementptr inbounds i8*, i8** %3, i64 1
%5 = load i8*, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %13, label %7
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = getelementptr inbounds i8*, i8** %3, i64 2
%10 = load i8*, i8** %9
%11 = tail call i64 @my_strcmp(i8* %8, i8* %10)
%12 = icmp sgt i64 %11, 0
br i1 %12, label %13, label %2
13: ; preds = %2, %7
%14 = phi i32 [ 0, %7 ], [ 1, %2 ]
ret i32 %14
}
int mod255(int x) {
  while (x >= 255) {
    x -= 255;
    x = (x >> 8) + (x & 255);
  }
  return x;
}


x86 assembly (clang, -O0):
<mod255>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0xff,-0x4(%rbp)
jl     1138 <mod255+0x38>
mov    -0x4(%rbp),%eax
sub    $0xff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
mov    -0x4(%rbp),%ecx
and    $0xff,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    1107 <mod255+0x7>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mod255>:
mov    %edi,%eax
cmp    $0xff,%edi
jl     1126 <mod255+0x26>
nopw   0x0(%rax,%rax,1)
add    $0xffffff01,%eax
mov    %eax,%ecx
shr    $0x8,%ecx
movzbl %al,%eax
add    %ecx,%eax
cmp    $0xfe,%eax
ja     1110 <mod255+0x10>
ret

LLVM IR (-O0):
define i32 @mod255(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %6, %1
%4 = load i32, i32* %2
%5 = icmp sge i32 %4, 255
br i1 %5, label %6, label %14
6: ; preds = %3
%7 = load i32, i32* %2
%8 = sub nsw i32 %7, 255
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = ashr i32 %9, 8
%11 = load i32, i32* %2
%12 = and i32 %11, 255
%13 = add nsw i32 %10, %12
store i32 %13, i32* %2
br label %3
14: ; preds = %3
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @mod255(i32 %0) {
%2 = icmp sgt i32 %0, 254
br i1 %2, label %3, label %10
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = add nsw i32 %4, -255
%6 = lshr i32 %5, 8
%7 = and i32 %5, 255
%8 = add nuw nsw i32 %6, %7
%9 = icmp ugt i32 %8, 254
br i1 %9, label %3, label %10
10: ; preds = %3, %1
%11 = phi i32 [ %0, %1 ], [ %8, %3 ]
ret i32 %11
}
/* Type definitions */
typedef unsigned char u_int8_t;

/* Variables and functions */
unsigned char *deserialize_u_int8_t(u_int8_t *dest, unsigned char *data) {
  *dest = data[0];
  return data + 1;
}


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

x86 assembly (clang, -O2):
<deserialize_u_int8_t>:
mov    (%rsi),%al
mov    %al,(%rdi)
lea    0x1(%rsi),%rax
ret

LLVM IR (-O0):
define i8* @deserialize_u_int8_t(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
%8 = load i8*, i8** %3
store i8 %7, i8* %8
%9 = load i8*, i8** %4
%10 = getelementptr inbounds i8, i8* %9, i64 1
ret i8* %10
}

LLVM IR (-O2):
define i8* @deserialize_u_int8_t(i8* nocapture writeonly %0, i8* %1) {
%3 = load i8, i8* %1
store i8 %3, i8* %0
%4 = getelementptr inbounds i8, i8* %1, i64 1
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void foo2() { printf("Unreachable!\n"); }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"Unreachable!\0A\00"
define void @foo2() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [13 x i8] c"Unreachable!\00"
define void @foo2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret void
}
void foo655(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo655(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int a, b;
  a = 0 ?: 7;
  b = 3 ?: 17;
  printf("a = 0 ?: 7; a == %d\n", a);
  printf("b = 3 ?: 17; b == %d\n", b);
  return (a == 7 && b == 3) ? 0 : 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x7,-0x8(%rbp)
movl   $0x3,-0xc(%rbp)
mov    -0x8(%rbp),%esi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
cmpl   $0x7,-0x8(%rbp)
mov    %al,-0xd(%rbp)
jne    1164 <main+0x54>
cmpl   $0x3,-0xc(%rbp)
sete   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%dl
mov    $0x1,%eax
xor    %ecx,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [21 x i8] c"a = 0 ?: 7; a == %d\0A\00"
@.str.1 = [22 x i8] c"b = 3 ?: 17; b == %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 7, i32* %2
store i32 3, i32* %3
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = load i32, i32* %2
%9 = icmp eq i32 %8, 7
br i1 %9, label %10, label %13
10: ; preds = %0
%11 = load i32, i32* %3
%12 = icmp eq i32 %11, 3
br label %13
13: ; preds = %10, %0
%14 = phi i1 [ false, %0 ], [ %12, %10 ]
%15 = zext i1 %14 to i64
%16 = select i1 %14, i32 0, i32 1
ret i32 %16
}

LLVM IR (-O2):
@.str = [21 x i8] c"a = 0 ?: 7; a == %d\0A\00"
@.str.1 = [22 x i8] c"b = 3 ?: 17; b == %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 7)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ cleanup();
int /*<<< orphan*/ warn(char const *);
void error(const char *message) {
  warn(message);
  cleanup();
}


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

x86 assembly (clang, -O2):
<error>:
push   %rax
call   1030 <warn@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <cleanup@plt>

LLVM IR (-O0):
define void @error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @warn(i8* %3)
%5 = call i32 (...) @cleanup()
ret void
}

LLVM IR (-O2):
define void @error(i8* %0) {
%2 = tail call i32 @warn(i8* %0)
%3 = tail call i32 (...) @cleanup()
ret void
}
int and (int register2, int register3) { return (register2 & register3); }


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

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

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

LLVM IR (-O2):
define i32 @and(i32 %0, i32 %1) {
%3 = and i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int log(double);
double powtodb(double f) {
  if (f <= 0)
    return (0);
  else {
    double val = 100 + 10. / 2.302585092994 * log(f);
    return (val < 0 ? 0 : val);
  }
}


x86 assembly (clang, -O0):
<powtodb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     1138 <powtodb+0x28>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1192 <powtodb+0x82>
movsd  -0x10(%rbp),%xmm0
call   1030 <log@plt>
cvtsi2sd %eax,%xmm0
movsd  0xeb2(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeae(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    117e <powtodb+0x6e>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    1188 <powtodb+0x78>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<powtodb>:
movapd %xmm0,%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jae    114b <powtodb+0x3b>
push   %rax
movapd %xmm1,%xmm0
call   1030 <log@plt>
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
mulsd  0xec9(%rip),%xmm1
addsd  0xec9(%rip),%xmm1
xorpd  %xmm0,%xmm0
maxsd  %xmm1,%xmm0
add    $0x8,%rsp
ret

LLVM IR (-O0):
define double @powtodb(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %3
%5 = load double, double* %3
%6 = fcmp ole double %5, 0.000000e+00
br i1 %6, label %7, label %8
7: ; preds = %1
store double 0.000000e+00, double* %2
br label %20
8: ; preds = %1
%9 = load double, double* %3
%10 = call i32 @log(double %9)
%11 = sitofp i32 %10 to double
%12 = call double @llvm.fmuladd.f64(double 0x40115F2CED384F8A, double %11, double 1.000000e+02)
store double %12, double* %4
%13 = load double, double* %4
%14 = fcmp olt double %13, 0.000000e+00
br i1 %14, label %15, label %16
15: ; preds = %8
br label %18
16: ; preds = %8
%17 = load double, double* %4
br label %18
18: ; preds = %16, %15
%19 = phi double [ 0.000000e+00, %15 ], [ %17, %16 ]
store double %19, double* %2
br label %20
20: ; preds = %18, %7
%21 = load double, double* %2
ret double %21
}

LLVM IR (-O2):
define double @powtodb(double %0) {
%2 = fcmp ugt double %0, 0.000000e+00
br i1 %2, label %3, label %9
3: ; preds = %1
%4 = tail call i32 @log(double %0)
%5 = sitofp i32 %4 to double
%6 = tail call double @llvm.fmuladd.f64(double %5, double 0x40115F2CED384F8A, double 1.000000e+02)
%7 = fcmp olt double %6, 0.000000e+00
%8 = select i1 %7, double 0.000000e+00, double %6
br label %9
9: ; preds = %1, %3
%10 = phi double [ %8, %3 ], [ 0.000000e+00, %1 ]
ret double %10
}
void strcopy(char *s1, const char *s2) {
  while (*s2 != 0x00)
    *s1++ = *s2++;
  *s1 = 0x00;
}


x86 assembly (clang, -O0):
<strcopy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1143 <strcopy+0x43>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    110c <strcopy+0xc>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcopy>:
mov    (%rsi),%al
test   %al,%al
je     1121 <strcopy+0x21>
add    $0x1,%rsi
nopw   0x0(%rax,%rax,1)
mov    %al,(%rdi)
add    $0x1,%rdi
movzbl (%rsi),%eax
add    $0x1,%rsi
test   %al,%al
jne    1110 <strcopy+0x10>
movb   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @strcopy(i8* nocapture writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %9, %5 ], [ %1, %2 ]
%8 = phi i8* [ %10, %5 ], [ %0, %2 ]
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = getelementptr inbounds i8, i8* %8, i64 1
store i8 %6, i8* %8
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = phi i8* [ %0, %2 ], [ %10, %5 ]
store i8 0, i8* %14
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int nb_generation() {
  int nombre_generation;
  do {
    printf("Saisissez le nombre de generation souhaite : ");
    scanf("%d", &nombre_generation);
  } while (nombre_generation < 1);
  return nombre_generation;
}


x86 assembly (clang, -O0):
<nb_generation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
lea    0xef3(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x1,-0x4(%rbp)
jl     1128 <nb_generation+0x8>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nb_generation>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xed0(%rip),%r14
lea    0xef7(%rip),%r15
lea    0xc(%rsp),%rbx
nopl   0x0(%rax)
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%eax
test   %eax,%eax
jle    1140 <nb_generation+0x20>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [46 x i8] c"Saisissez le nombre de generation souhaite : \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @nb_generation() {
%1 = alloca i32
br label %2
2: ; preds = %5, %0
%3 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 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)
br label %5
5: ; preds = %2
%6 = load i32, i32* %1
%7 = icmp slt i32 %6, 1
br i1 %7, label %2, label %8
8: ; preds = %5
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
@.str = [46 x i8] c"Saisissez le nombre de generation souhaite : \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @nb_generation() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
br label %3
3: ; preds = %3, %0
%4 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
%7 = icmp slt i32 %6, 1
br i1 %7, label %3, label %8
8: ; preds = %3
ret i32 %6
}
/* Variables and functions */
double pow(double, int);
int /*<<< orphan*/ printf(char *, int);
void probability(int input_k) {
  double p;
  p = pow(0.25, input_k);
  p *= 100;
  printf("With probability p~=%.2f%%\n", 100 - p);
}


x86 assembly (clang, -O0):
<probability>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
movsd  0xed2(%rip),%xmm0
call   1040 <pow@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  0xeb8(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xea6(%rip),%xmm0
subsd  -0x10(%rbp),%xmm0
cvttsd2si %xmm0,%esi
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<probability>:
push   %rax
movsd  0xed7(%rip),%xmm0
call   1040 <pow@plt>
movsd  0xed2(%rip),%xmm1
mulsd  %xmm1,%xmm0
subsd  %xmm0,%xmm1
cvttsd2si %xmm1,%esi
lea    0xec7(%rip),%rdi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"With probability p~=%.2f%%\0A\00"
define void @probability(i32 %0) {
%2 = alloca i32
%3 = alloca double
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call double @pow(double 2.500000e-01, i32 %4)
store double %5, double* %3
%6 = load double, double* %3
%7 = fmul double %6, 1.000000e+02
store double %7, double* %3
%8 = load double, double* %3
%9 = fsub double 1.000000e+02, %8
%10 = fptosi double %9 to i32
%11 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %10)
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"With probability p~=%.2f%%\0A\00"
define void @probability(i32 %0) {
%2 = tail call double @pow(double 2.500000e-01, i32 %0)
%3 = fmul double %2, 1.000000e+02
%4 = fsub double 1.000000e+02, %3
%5 = fptosi double %4 to i32
%6 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %5)
ret void
}
/* Variables and functions */
scalar_t__ strchr(char *, char);
int nsvg__isspace(char c) { return strchr(" \t\n\v\f\r", c) != 0; }


x86 assembly (clang, -O0):
<nsvg__isspace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    0xedb(%rip),%rdi
movsbl -0x1(%rbp),%esi
call   1030 <strchr@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nsvg__isspace>:
push   %rax
mov    %edi,%esi
lea    0xee6(%rip),%rdi
call   1030 <strchr@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c" \09\0A\0B\0C\0D\00"
define i32 @nsvg__isspace(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @strchr(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8 signext %3)
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
@.str = [7 x i8] c" \09\0A\0B\0C\0D\00"
define i32 @nsvg__isspace(i8 signext %0) {
%2 = tail call i64 @strchr(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8 signext %0)
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ InitGame();
int /*<<< orphan*/ TapeStartPlaying();
void TapeStartGamePlaying() {
  TapeStartPlaying();
  InitGame();
}


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

x86 assembly (clang, -O2):
<TapeStartGamePlaying>:
push   %rax
xor    %eax,%eax
call   1030 <TapeStartPlaying@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <InitGame@plt>

LLVM IR (-O0):
define void @TapeStartGamePlaying() {
%1 = call i32 (...) @TapeStartPlaying()
%2 = call i32 (...) @InitGame()
ret void
}

LLVM IR (-O2):
define void @TapeStartGamePlaying() {
%1 = tail call i32 (...) @TapeStartPlaying()
%2 = tail call i32 (...) @InitGame()
ret void
}
/* Variables and functions */
char *malloc(size_t);
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
size_t strlen(char const *);
char *strdup(const char *s) {
  size_t len = strlen(s);
  char *dup = malloc(len + 1);
  memcpy(dup, s, len + 1);
  return dup;
}


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

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

LLVM IR (-O0):
define i8* @strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i64 @strlen(i8* %5)
store i64 %6, i64* %3
%7 = load i64, i64* %3
%8 = add i64 %7, 1
%9 = call i8* @malloc(i64 %8)
store i8* %9, i8** %4
%10 = load i8*, i8** %4
%11 = load i8*, i8** %2
%12 = load i64, i64* %3
%13 = add i64 %12, 1
%14 = call i32 @memcpy(i8* %10, i8* %11, i64 %13)
%15 = load i8*, i8** %4
ret i8* %15
}

LLVM IR (-O2):
define i8* @strdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = tail call i32 @memcpy(i8* %4, i8* %0, i64 %3)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, unsigned char const *, int);
void GLUE_PUSH_VAL_AT_PX_TO_FPSTACK(void *b, int wv) {
  static const unsigned char tab[3][2] = {
      {0xDD, 0x00},
      {0xDD, 0x07},
      {0xDD, 0x01},
  };
  memcpy(b, tab[wv], 2);
}


x86 assembly (clang, -O0):
<GLUE_PUSH_VAL_AT_PX_TO_FPSTACK>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
lea    0xed2(%rip),%rsi
shl    $0x1,%rax
add    %rax,%rsi
mov    $0x2,%edx
call   1030 <memcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GLUE_PUSH_VAL_AT_PX_TO_FPSTACK>:
movslq %esi,%rax
lea    0xee6(%rip),%rcx
lea    (%rcx,%rax,2),%rsi
mov    $0x2,%edx
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
@GLUE_PUSH_VAL_AT_PX_TO_FPSTACK.tab = internal constant [3 x [2 x i8]] [[2 x i8] c"\DD\00", [2 x i8] c"\DD\07", [2 x i8] c"\DD\01"]
define void @GLUE_PUSH_VAL_AT_PX_TO_FPSTACK(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds [3 x [2 x i8]], [3 x [2 x i8]]* @GLUE_PUSH_VAL_AT_PX_TO_FPSTACK.tab, i64 0, i64 %7
%9 = getelementptr inbounds [2 x i8], [2 x i8]* %8, i64 0, i64 0
%10 = call i32 @memcpy(i8* %5, i8* %9, i32 2)
ret void
}

LLVM IR (-O2):
@GLUE_PUSH_VAL_AT_PX_TO_FPSTACK.tab = internal constant [3 x [2 x i8]] [[2 x i8] c"\DD\00", [2 x i8] c"\DD\07", [2 x i8] c"\DD\01"]
define void @GLUE_PUSH_VAL_AT_PX_TO_FPSTACK(i8* %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds [3 x [2 x i8]], [3 x [2 x i8]]* @GLUE_PUSH_VAL_AT_PX_TO_FPSTACK.tab, i64 0, i64 %3, i64 0
%5 = tail call i32 @memcpy(i8* %0, i8* %4, i32 2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void seg_note_free(void *data) { free(data); }


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

x86 assembly (clang, -O2):
<seg_note_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @seg_note_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printHeader() {
  printf("------------------------------------\n");
  printf("        smbusb_bq8030flasher\n");
  printf("------------------------------------\n");
}


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

x86 assembly (clang, -O2):
<printHeader>:
push   %rbx
lea    0xf05(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xed9(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str.2 = [29 x i8] c" smbusb_bq8030flasher\00"
@str.3 = [37 x i8] c"------------------------------------\00"
define void @printHeader() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.3, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.2, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.3, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isprint(int);
void t_isprint_0x22() {
  Assert_real((isprint(34)),
              "/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_isprint.c",
              175, ("isprint should be 1 for 0x22"));
}


x86 assembly (clang, -O0):
<t_isprint_0x22>:
push   %rbp
mov    %rsp,%rbp
mov    $0x22,%edi
call   1030 <isprint@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0xaf,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isprint_0x22>:
push   %rax
mov    $0x22,%edi
call   1030 <isprint@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0xaf,%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_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 1 for 0x22\00"
define void @t_isprint_0x22() {
%1 = call i32 @isprint(i32 34)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 175, 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_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 1 for 0x22\00"
define void @t_isprint_0x22() {
%1 = tail call i32 @isprint(i32 34)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 175, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct hnode {
  int dummy;
};
struct hmap {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ hmap_free_node(struct hnode *);
struct hnode *hmap_get_node(struct hmap *, char const *);
int hmap_del(struct hmap *hmap, const char *key) {
  struct hnode *hnode_ptr = hmap_get_node(hmap, key);
  if (hnode_ptr != NULL) {
    hmap_free_node(hnode_ptr);
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<hmap_del>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <hmap_get_node@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1161 <hmap_del+0x41>
mov    -0x20(%rbp),%rdi
call   1040 <hmap_free_node@plt>
movl   $0x1,-0x4(%rbp)
jmp    1168 <hmap_del+0x48>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hmap_del>:
push   %rax
call   1030 <hmap_get_node@plt>
test   %rax,%rax
je     113a <hmap_del+0x1a>
mov    %rax,%rdi
call   1040 <hmap_free_node@plt>
mov    $0x1,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.hmap = type { i32 }
%struct.hnode = type { i32 }
define i32 @hmap_del(%struct.hmap* %0, i8* %1) {
%3 = alloca i32
%4 = alloca %struct.hmap*
%5 = alloca i8*
%6 = alloca %struct.hnode*
store %struct.hmap* %0, %struct.hmap** %4
store i8* %1, i8** %5
%7 = load %struct.hmap*, %struct.hmap** %4
%8 = load i8*, i8** %5
%9 = call %struct.hnode* @hmap_get_node(%struct.hmap* %7, i8* %8)
store %struct.hnode* %9, %struct.hnode** %6
%10 = load %struct.hnode*, %struct.hnode** %6
%11 = icmp ne %struct.hnode* %10, null
br i1 %11, label %12, label %15
12: ; preds = %2
%13 = load %struct.hnode*, %struct.hnode** %6
%14 = call i32 @hmap_free_node(%struct.hnode* %13)
store i32 1, i32* %3
br label %16
15: ; preds = %2
store i32 0, i32* %3
br label %16
16: ; preds = %15, %12
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
%struct.hmap = type { i32 }
%struct.hnode = type { i32 }
define i32 @hmap_del(%struct.hmap* %0, i8* %1) {
%3 = tail call %struct.hnode* @hmap_get_node(%struct.hmap* %0, i8* %1)
%4 = icmp eq %struct.hnode* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @hmap_free_node(%struct.hnode* %3)
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ 1, %5 ], [ 0, %2 ]
ret i32 %8
}
long new_critic(int code) { return code; }


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

x86 assembly (clang, -O2):
<new_critic>:
movslq %edi,%rax
ret

LLVM IR (-O0):
define i64 @new_critic(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
ret i64 %4
}

LLVM IR (-O2):
define i64 @new_critic(i32 %0) {
%2 = sext i32 %0 to i64
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int main(void) {
  int n;
  long double x;
  x = 1 / 0.0;
  n = (x == 1 / 0.0);
  if (n == 1)
    return 0;
  else
    abort();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
flds   0xedb(%rip)
fld    %st(0)
fstpt  -0x20(%rbp)
fldt   -0x20(%rbp)
fucomip %st(1),%st
fstp   %st(0)
setae  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    114e <main+0x3e>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret
mov    $0x0,%al
call   1030 <abort@plt>

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca x86_fp80
store i32 0, i32* %1
store x86_fp80 0xK7FFF8000000000000000, x86_fp80* %3
%4 = load x86_fp80, x86_fp80* %3
%5 = fcmp oeq x86_fp80 %4, 0xK7FFF8000000000000000
%6 = zext i1 %5 to i32
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = icmp eq i32 %7, 1
br i1 %8, label %9, label %10
9: ; preds = %0
ret i32 0
10: ; preds = %0
%11 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
char *d_alloc(b)
unsigned b;
{ return (malloc(b)); }


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

x86 assembly (clang, -O2):
<d_alloc>:
mov    %edi,%edi
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @d_alloc(i32 %0) {
%2 = zext i32 %0 to i64
%3 = tail call i8* @malloc(i64 %2)
ret i8* %3
}
/* Variables and functions */
int BITMASK(int, int, int);
int /*<<< orphan*/ cpuid(int, int *, int *, int *, int *);
int WhereAmI(void) {
  int eax, ebx, ecx, edx;
  int apicid;
  cpuid(1, &eax, &ebx, &ecx, &edx);
  apicid = BITMASK(ebx, 24, 0xff);
  return apicid;
}


x86 assembly (clang, -O0):
<WhereAmI>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x1,%edi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
lea    -0xc(%rbp),%rcx
lea    -0x10(%rbp),%r8
call   1040 <cpuid@plt>
mov    -0x8(%rbp),%edi
mov    $0x18,%esi
mov    $0xff,%edx
call   1030 <BITMASK@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WhereAmI>:
sub    $0x18,%rsp
lea    0x14(%rsp),%rsi
lea    0x8(%rsp),%rdx
lea    0x10(%rsp),%rcx
lea    0xc(%rsp),%r8
mov    $0x1,%edi
call   1040 <cpuid@plt>
mov    0x8(%rsp),%edi
mov    $0x18,%esi
mov    $0xff,%edx
call   1030 <BITMASK@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @WhereAmI() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = call i32 @cpuid(i32 1, i32* %1, i32* %2, i32* %3, i32* %4)
%7 = load i32, i32* %2
%8 = call i32 @BITMASK(i32 %7, i32 24, i32 255)
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
define i32 @WhereAmI() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %1 to i8*
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = call i32 @cpuid(i32 1, i32* %1, i32* %2, i32* %3, i32* %4)
%10 = load i32, i32* %2
%11 = call i32 @BITMASK(i32 %10, i32 24, i32 255)
ret i32 %11
}
int main(int argc, char *argv[]) {
  if (argv[1] == '\0') {
    return 0;
  }
  filebench(argv + 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,0x8(%rax)
jne    1141 <main+0x31>
movl   $0x0,-0x4(%rbp)
jmp    1157 <main+0x47>
mov    -0x10(%rbp),%rdi
add    $0x8,%rdi
mov    $0x0,%al
call   1030 <filebench@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmpq   $0x0,0x8(%rsi)
je     1126 <main+0x16>
add    $0x8,%rsi
mov    %rsi,%rdi
xor    %eax,%eax
call   1030 <filebench@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 (i8**, ...) bitcast (i32 (...)* @filebench to i32 (i8**, ...)*)(i8** %3)
br label %8
8: ; preds = %2, %6
ret i32 0
}
int kaijou(input)
int input;
{
  int i;
  int result = input;
  for (i = input; i > 0; --i) {
    result = result * i;
    printf("%d\n", result);
  }
  return result;
}


x86 assembly (clang, -O0):
<kaijou>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    115a <kaijou+0x4a>
mov    -0xc(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    1127 <kaijou+0x17>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kaijou>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebp
test   %edi,%edi
jle    1149 <kaijou+0x39>
lea    0xedf(%rip),%r14
mov    %ebp,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
imul   %ebx,%ebp
mov    %r14,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    -0x1(%rbx),%eax
cmp    $0x1,%ebx
mov    %eax,%ebx
ja     1130 <kaijou+0x20>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @kaijou(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %10
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ %0, %1 ]
%5 = phi i32 [ %8, %3 ], [ %0, %1 ]
%6 = mul nsw i32 %4, %5
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = add nsw i32 %5, -1
%9 = icmp ugt i32 %5, 1
br i1 %9, label %3, label %10
10: ; preds = %3, %1
%11 = phi i32 [ %0, %1 ], [ %6, %3 ]
ret i32 %11
}