xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
menu_mostrar() {
  printf("\nEscolha uma opção:\n");
  printf("1 - Incluir na pilha\n");
  printf("2 - Excluir da pilha\n");
  printf("0 - Sair\n\n");
}


x86 assembly (clang, -O0):
<menu_mostrar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
lea    0xeec(%rip),%rdi
call   1030 <printf@plt>
lea    0xef6(%rip),%rdi
call   1030 <printf@plt>
lea    0xf00(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<menu_mostrar>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xef2(%rip),%rdi
call   1030 <puts@plt>
lea    0xefb(%rip),%rdi
call   1030 <puts@plt>
lea    0xf04(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"\0AEscolha uma op\C3\A7\C3\A3o:\0A\00"
@.str.1 = [22 x i8] c"1 - Incluir na pilha\0A\00"
@.str.2 = [22 x i8] c"2 - Excluir da pilha\0A\00"
@.str.3 = [11 x i8] c"0 - Sair\0A\0A\00"
define i32 @menu_mostrar() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
%6 = load i32, i32* %1
ret i32 %6
}

LLVM IR (-O2):
@str = [22 x i8] c"\0AEscolha uma op\C3\A7\C3\A3o:\00"
@str.4 = [21 x i8] c"1 - Incluir na pilha\00"
@str.5 = [21 x i8] c"2 - Excluir da pilha\00"
@str.6 = [10 x i8] c"0 - Sair\0A\00"
define i32 @menu_mostrar() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.6, i64 0, i64 0))
ret i32 undef
}
int abs(int k) {
  if (k >= 0)
    return k;
  else
    return -1 * k;
}


x86 assembly (clang, -O0):
<abs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     111c <abs+0x1c>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1126 <abs+0x26>
imul   $0xffffffff,-0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<abs>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @abs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
void asnInit(void) {}


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

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

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

LLVM IR (-O2):
define void @asnInit() {
ret void
}
/* Variables and functions */
int ceil(int x, int m) {
  x += m - 1;
  return x - x % m;
}


x86 assembly (clang, -O0):
<ceil>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    -0xc(%rbp),%eax
sub    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ceil>:
lea    (%rdi,%rsi,1),%ecx
add    $0xffffffff,%ecx
mov    %ecx,%eax
cltd
idiv   %esi
sub    %edx,%ecx
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @ceil(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = sub nsw i32 %5, 1
%7 = load i32, i32* %3
%8 = add nsw i32 %7, %6
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = srem i32 %10, %11
%13 = sub nsw i32 %9, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @ceil(i32 %0, i32 %1) {
%3 = add i32 %0, -1
%4 = add i32 %3, %1
%5 = srem i32 %4, %1
%6 = sub nsw i32 %4, %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_syntax() { printf("collector -p <preset value> -d\n"); }


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

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

LLVM IR (-O0):
@.str = [32 x i8] c"collector -p <preset value> -d\0A\00"
define void @print_syntax() {
%1 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [31 x i8] c"collector -p <preset value> -d\00"
define void @print_syntax() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct stack_t {
  int dummy;
};

/* Variables and functions */
int stack_init(struct stack_t *, size_t);
int fstack_init(struct stack_t *stack, size_t size) {
  int ret = stack_init(stack, size);
}


x86 assembly (clang, -O0):
<fstack_init>:
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 <stack_init@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fstack_init>:
jmp    1030 <stack_init@plt>

LLVM IR (-O0):
%struct.stack_t = type { i32 }
define i32 @fstack_init(%struct.stack_t* %0, i64 %1) {
%3 = alloca i32
%4 = alloca %struct.stack_t*
%5 = alloca i64
%6 = alloca i32
store %struct.stack_t* %0, %struct.stack_t** %4
store i64 %1, i64* %5
%7 = load %struct.stack_t*, %struct.stack_t** %4
%8 = load i64, i64* %5
%9 = call i32 @stack_init(%struct.stack_t* %7, i64 %8)
store i32 %9, i32* %6
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
%struct.stack_t = type { i32 }
define i32 @fstack_init(%struct.stack_t* %0, i64 %1) {
%3 = tail call i32 @stack_init(%struct.stack_t* %0, i64 %1)
ret i32 undef
}
int char_hexa_to_i(char c) {
  if (c >= '0' && c <= '9') {
    return c - '0';
  } else if (c >= 'A' || c <= 'F') {
    return 10 + c - 'A';
  } else if (c >= 'a' || c <= 'f') {
    return 10 + c - 'a';
  } else {
    return -1;
  }
}


x86 assembly (clang, -O0):
<char_hexa_to_i>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jl     1133 <char_hexa_to_i+0x33>
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jg     1133 <char_hexa_to_i+0x33>
movsbl -0x5(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    1192 <char_hexa_to_i+0x92>
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
jge    114d <char_hexa_to_i+0x4d>
movsbl -0x5(%rbp),%eax
cmp    $0x46,%eax
jg     115f <char_hexa_to_i+0x5f>
movsbl -0x5(%rbp),%eax
add    $0xa,%eax
sub    $0x41,%eax
mov    %eax,-0x4(%rbp)
jmp    1192 <char_hexa_to_i+0x92>
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jge    1179 <char_hexa_to_i+0x79>
movsbl -0x5(%rbp),%eax
cmp    $0x66,%eax
jg     118b <char_hexa_to_i+0x8b>
movsbl -0x5(%rbp),%eax
add    $0xa,%eax
sub    $0x61,%eax
mov    %eax,-0x4(%rbp)
jmp    1192 <char_hexa_to_i+0x92>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<char_hexa_to_i>:
lea    -0x30(%rdi),%ecx
lea    -0x37(%rdi),%edx
lea    -0x30(%rdi),%eax
cmp    $0xa,%cl
cmovae %edx,%eax
ret

LLVM IR (-O0):
define i32 @char_hexa_to_i(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 48
br i1 %6, label %7, label %15
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 57
br i1 %10, label %11, label %15
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = sub nsw i32 %13, 48
store i32 %14, i32* %2
br label %42
15: ; preds = %7, %1
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = icmp sge i32 %17, 65
br i1 %18, label %23, label %19
19: ; preds = %15
%20 = load i8, i8* %3
%21 = sext i8 %20 to i32
%22 = icmp sle i32 %21, 70
br i1 %22, label %23, label %28
23: ; preds = %19, %15
%24 = load i8, i8* %3
%25 = sext i8 %24 to i32
%26 = add nsw i32 10, %25
%27 = sub nsw i32 %26, 65
store i32 %27, i32* %2
br label %42
28: ; preds = %19
%29 = load i8, i8* %3
%30 = sext i8 %29 to i32
%31 = icmp sge i32 %30, 97
br i1 %31, label %36, label %32
32: ; preds = %28
%33 = load i8, i8* %3
%34 = sext i8 %33 to i32
%35 = icmp sle i32 %34, 102
br i1 %35, label %36, label %41
36: ; preds = %32, %28
%37 = load i8, i8* %3
%38 = sext i8 %37 to i32
%39 = add nsw i32 10, %38
%40 = sub nsw i32 %39, 97
store i32 %40, i32* %2
br label %42
41: ; preds = %32
store i32 -1, i32* %2
br label %42
42: ; preds = %41, %36, %23, %11
%43 = load i32, i32* %2
ret i32 %43
}

LLVM IR (-O2):
define i32 @char_hexa_to_i(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add i8 %0, -48
%4 = icmp ult i8 %3, 10
%5 = select i1 %4, i32 -48, i32 -55
%6 = add nsw i32 %5, %2
ret i32 %6
}
double _rnd(r)
double r;
{ return (r + (r < 0 ? -0.5 : 0.5)); }


x86 assembly (clang, -O0):
<_rnd>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  0xee5(%rip),%xmm4
movsd  0xee5(%rip),%xmm3
xorps  %xmm2,%xmm2
cmpltsd %xmm2,%xmm1
movaps %xmm1,%xmm2
andpd  %xmm4,%xmm2
andnpd %xmm3,%xmm1
orpd   %xmm2,%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<_rnd>:
xorpd  %xmm1,%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
seta   %al
lea    0xeec(%rip),%rcx
addsd  (%rcx,%rax,8),%xmm0
ret

LLVM IR (-O0):
define double @_rnd(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fcmp olt double %4, 0.000000e+00
%6 = zext i1 %5 to i64
%7 = select i1 %5, double -5.000000e-01, double 5.000000e-01
%8 = fadd double %3, %7
ret double %8
}

LLVM IR (-O2):
define double @_rnd(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = select i1 %2, double -5.000000e-01, double 5.000000e-01
%4 = fadd double %3, %0
ret double %4
}
long set_mark(long i) {
  i |= 0x1L;
  return i;
}


x86 assembly (clang, -O0):
<set_mark>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
or     $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_mark>:
mov    %rdi,%rax
or     $0x1,%rax
ret

LLVM IR (-O0):
define i64 @set_mark(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = or i64 %3, 1
store i64 %4, i64* %2
%5 = load i64, i64* %2
ret i64 %5
}

LLVM IR (-O2):
define i64 @set_mark(i64 %0) {
%2 = or i64 %0, 1
ret i64 %2
}
int os_cleanup(void) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @os_cleanup() {
ret i32 0
}
void RTHandleTableAlloc(void) {}


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

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

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

LLVM IR (-O2):
define void @RTHandleTableAlloc() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo(int *);
int bar(int x) {
  int a;
  int b;
  int c;
  foo(&b);
  foo(&c);
  foo(&a);
  return a + b + c;
}


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

x86 assembly (clang, -O2):
<bar>:
sub    $0x18,%rsp
lea    0x10(%rsp),%rdi
call   1030 <foo@plt>
lea    0xc(%rsp),%rdi
call   1030 <foo@plt>
lea    0x14(%rsp),%rdi
call   1030 <foo@plt>
mov    0x10(%rsp),%eax
add    0x14(%rsp),%eax
add    0xc(%rsp),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @bar(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
%6 = call i32 @foo(i32* %4)
%7 = call i32 @foo(i32* %5)
%8 = call i32 @foo(i32* %3)
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = add nsw i32 %9, %10
%12 = load i32, i32* %5
%13 = add nsw i32 %11, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @bar(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = bitcast i32* %4 to i8*
%8 = call i32 @foo(i32* %3)
%9 = call i32 @foo(i32* %4)
%10 = call i32 @foo(i32* %2)
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = add nsw i32 %12, %11
%14 = load i32, i32* %4
%15 = add nsw i32 %13, %14
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ SYS_execve;
int /*<<< orphan*/ syscall(int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/, int /*<<< orphan*/);
int main() {
  syscall(SYS_execve, 0, 0, 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
xor    %ecx,%ecx
mov    %ecx,%esi
mov    %ecx,%edx
call   1030 <syscall@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <syscall@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@SYS_execve = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @SYS_execve
%3 = call i32 @syscall(i32 %2, i32 0, i32 0, i32 0)
ret i32 0
}

LLVM IR (-O2):
@SYS_execve = global i32 0
define i32 @main() {
%1 = load i32, i32* @SYS_execve
%2 = tail call i32 @syscall(i32 %1, i32 0, i32 0, i32 0)
ret i32 0
}
int writemessage(char *msgbuf, int secs, int bell) {
  (void)msgbuf;
  (void)secs;
  (void)bell;
  return 0;
}


x86 assembly (clang, -O0):
<writemessage>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @writemessage(i8* nocapture readnone %0, i32 %1, i32 %2) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ SSL;

/* Variables and functions */
int SSL_TLSEXT_ERR_OK;
int ssl_servername_cb(SSL *s, int *ad, void *arg) { return SSL_TLSEXT_ERR_OK; }


x86 assembly (clang, -O0):
<ssl_servername_cb>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ssl_servername_cb>:
mov    0x2ef1(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@SSL_TLSEXT_ERR_OK = global i32 0
define i32 @ssl_servername_cb(i32* %0, i32* %1, i8* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i8*
store i32* %0, i32** %4
store i32* %1, i32** %5
store i8* %2, i8** %6
%7 = load i32, i32* @SSL_TLSEXT_ERR_OK
ret i32 %7
}

LLVM IR (-O2):
@SSL_TLSEXT_ERR_OK = global i32 0
define i32 @ssl_servername_cb(i32* nocapture readnone %0, i32* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = load i32, i32* @SSL_TLSEXT_ERR_OK
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *);
int main(int argc, char **argv) {
  int i = 0;
  for (i = 0; i < argc; ++i) {
    printf("%d  -->  %s \n", i, argv[i]);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1169 <main+0x59>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1134 <main+0x24>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edi,%edi
jle    1147 <main+0x37>
mov    %rsi,%r14
mov    %edi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdx
mov    %r15,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"%d --> %s \0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
%10 = trunc i64 %7 to i32
%11 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %10, i8* %9)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ GLuint;

/* Variables and functions */
int /*<<< orphan*/ glStencilMask(int /*<<< orphan*/);
void StencilMask(GLuint mask) { glStencilMask(mask); }


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

x86 assembly (clang, -O2):
<StencilMask>:
jmp    1030 <glStencilMask@plt>

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

LLVM IR (-O2):
define void @StencilMask(i32 %0) {
%2 = tail call i32 @glStencilMask(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, long);
int /*<<< orphan*/ stderr;
void _checkIndexArray(long *a, long i) {
  if (i < 0 || i > a[-1]) {
    fprintf(stderr, "Runtime error: array index %ld out of bounds!\n", i);
    exit(-1);
  }
}


x86 assembly (clang, -O0):
<_checkIndexArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jl     114d <_checkIndexArray+0x2d>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
cmp    -0x8(%rcx),%rax
jle    1170 <_checkIndexArray+0x50>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xe9f(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_checkIndexArray>:
push   %rax
mov    %rsi,%rdx
test   %rsi,%rsi
js     1131 <_checkIndexArray+0x11>
cmp    %rdx,-0x8(%rdi)
jl     1131 <_checkIndexArray+0x11>
pop    %rax
ret
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
lea    0xebf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [47 x i8] c"Runtime error: array index %ld out of bounds!\0A\00"
define void @_checkIndexArray(i64* %0, i64 %1) {
%3 = alloca i64*
%4 = alloca i64
store i64* %0, i64** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = icmp slt i64 %5, 0
br i1 %6, label %13, label %7
7: ; preds = %2
%8 = load i64, i64* %4
%9 = load i64*, i64** %3
%10 = getelementptr inbounds i64, i64* %9, i64 -1
%11 = load i64, i64* %10
%12 = icmp sgt i64 %8, %11
br i1 %12, label %13, label %18
13: ; preds = %7, %2
%14 = load i32, i32* @stderr
%15 = load i64, i64* %4
%16 = call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i64 %15)
%17 = call i32 @exit(i32 -1)
unreachable
18: ; preds = %7
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [47 x i8] c"Runtime error: array index %ld out of bounds!\0A\00"
define void @_checkIndexArray(i64* nocapture %0, i64 %1) {
%3 = icmp slt i64 %1, 0
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = getelementptr inbounds i64, i64* %0, i64 -1
%6 = load i64, i64* %5
%7 = icmp slt i64 %6, %1
br i1 %7, label %8, label %12
8: ; preds = %4, %2
%9 = load i32, i32* @stderr
%10 = tail call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i64 %1)
%11 = tail call i32 @exit(i32 -1)
unreachable
12: ; preds = %4
ret void
}
int test_imm_C3int8_reg(signed char val) {
  return ((val) & (-0xC3 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_C3int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xffffff3d,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_C3int8_reg>:
test   $0xffffff3d,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_C3int8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, -195
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_C3int8_reg(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = and i32 %2, -195
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int test_imm_4Bint64_lowword_reg(long long val) {
  return ((val) & (0x4B << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_4Bint64_lowword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
and    $0x4b,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_4Bint64_lowword_reg>:
test   $0x4b,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_4Bint64_lowword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 75
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 -20, i32 -40
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_imm_4Bint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 75
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void fatal_failed(void) {
  fprintf(stdout, "\tFAILED\n");
  exit(1);
}


x86 assembly (clang, -O0):
<fatal_failed>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fatal_failed>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [9 x i8] c"\09FAILED\0A\00"
define void @fatal_failed() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [9 x i8] c"\09FAILED\0A\00"
define void @fatal_failed() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
void gameShutdown() { endwin(); }


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

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

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

LLVM IR (-O2):
define void @gameShutdown() {
%1 = tail call i32 (...) @endwin()
ret void
}
int pinmux_validate_map(struct pinctrl_map const *map, int i) { return 0; }


x86 assembly (clang, -O0):
<pinmux_validate_map>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.pinctrl_map = type opaque
define i32 @pinmux_validate_map(%struct.pinctrl_map* %0, i32 %1) {
%3 = alloca %struct.pinctrl_map*
%4 = alloca i32
store %struct.pinctrl_map* %0, %struct.pinctrl_map** %3
store i32 %1, i32* %4
ret i32 0
}

LLVM IR (-O2):
%struct.pinctrl_map = type opaque
define i32 @pinmux_validate_map(%struct.pinctrl_map* nocapture readnone %0, i32 %1) {
ret i32 0
}
int LZ4F_compressionLevel_max(void) { return 12; }


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

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

LLVM IR (-O0):
define i32 @LZ4F_compressionLevel_max() {
ret i32 12
}

LLVM IR (-O2):
define i32 @LZ4F_compressionLevel_max() {
ret i32 12
}
/* Variables and functions */
int /*<<< orphan*/ disassemble();
int parse_args(int, char **);
int main(int argc, char **argv) {
  int err, res = 1;
  err = parse_args(argc, argv);
  if (err < 0)
    goto out;
  if (err > 0) {
    res = 0;
    goto out;
  }
  disassemble();
  res = 0;
out:
  return res;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <parse_args@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    115b <main+0x3b>
jmp    117f <main+0x5f>
cmpl   $0x0,-0x14(%rbp)
jle    1171 <main+0x51>
movl   $0x0,-0x18(%rbp)
jmp    117f <main+0x5f>
mov    $0x0,%al
call   1040 <disassemble@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
call   1030 <parse_args@plt>
test   %eax,%eax
js     113b <main+0x1b>
xor    %ebx,%ebx
test   %eax,%eax
jne    1140 <main+0x20>
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <disassemble@plt>
jmp    1140 <main+0x20>
mov    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %7
%8 = load i32, i32* %4
%9 = load i8**, i8*** %5
%10 = call i32 @parse_args(i32 %8, i8** %9)
store i32 %10, i32* %6
%11 = load i32, i32* %6
%12 = icmp slt i32 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %2
br label %20
14: ; preds = %2
%15 = load i32, i32* %6
%16 = icmp sgt i32 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %14
store i32 0, i32* %7
br label %20
18: ; preds = %14
%19 = call i32 (...) @disassemble()
store i32 0, i32* %7
br label %20
20: ; preds = %18, %17, %13
%21 = load i32, i32* %7
ret i32 %21
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @parse_args(i32 %0, i8** %1)
%4 = icmp slt i32 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = icmp eq i32 %3, 0
br i1 %6, label %7, label %9
7: ; preds = %5
%8 = tail call i32 (...) @disassemble()
br label %9
9: ; preds = %5, %2, %7
%10 = phi i32 [ 1, %2 ], [ 0, %7 ], [ 0, %5 ]
ret i32 %10
}
/* Variables and functions */
int O_APPEND;
int O_WRONLY;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ dprintf(int, char *, int);
int open(char *, int);
void gotoline(int line) {
  int fd;
  int value;
  fd = open("/sys/class/dothat/st7036/cursor_position", O_WRONLY | O_APPEND);
  if (fd > 0) {
    dprintf(fd, "0 %d", line);
    close(fd);
  }
}


x86 assembly (clang, -O0):
<gotoline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2e96(%rip),%rax
mov    (%rax),%esi
mov    0x2e85(%rip),%rax
or     (%rax),%esi
lea    0xeac(%rip),%rdi
call   1050 <open@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1180 <gotoline+0x50>
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%edx
lea    0xeb6(%rip),%rsi
call   1040 <dprintf@plt>
mov    -0x8(%rbp),%edi
call   1030 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gotoline>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    0x2e9c(%rip),%rax
mov    0x2e8d(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
lea    0xeb2(%rip),%rdi
call   1050 <open@plt>
test   %eax,%eax
jle    1176 <gotoline+0x46>
mov    %eax,%ebp
lea    0xec9(%rip),%rsi
mov    %eax,%edi
mov    %ebx,%edx
call   1040 <dprintf@plt>
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <close@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [41 x i8] c"/sys/class/dothat/st7036/cursor_position\00"
@O_WRONLY = global i32 0
@O_APPEND = global i32 0
@.str.1 = [5 x i8] c"0 %d\00"
define void @gotoline(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* @O_WRONLY
%6 = load i32, i32* @O_APPEND
%7 = or i32 %5, %6
%8 = call i32 @open(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = icmp sgt i32 %9, 0
br i1 %10, label %11, label %17
11: ; preds = %1
%12 = load i32, i32* %3
%13 = load i32, i32* %2
%14 = call i32 @dprintf(i32 %12, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %13)
%15 = load i32, i32* %3
%16 = call i32 @close(i32 %15)
br label %17
17: ; preds = %11, %1
ret void
}

LLVM IR (-O2):
@.str = [41 x i8] c"/sys/class/dothat/st7036/cursor_position\00"
@O_WRONLY = global i32 0
@O_APPEND = global i32 0
@.str.1 = [5 x i8] c"0 %d\00"
define void @gotoline(i32 %0) {
%2 = load i32, i32* @O_WRONLY
%3 = load i32, i32* @O_APPEND
%4 = or i32 %3, %2
%5 = tail call i32 @open(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = tail call i32 @dprintf(i32 %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %0)
%9 = tail call i32 @close(i32 %5)
br label %10
10: ; preds = %7, %1
ret void
}
/* Variables and functions */
unsigned int time(int /*<<< orphan*/);
void waitForIt(unsigned char seconds) {
  unsigned int retTime = (unsigned int)time(0) + (unsigned int)seconds;
  while (time(0) < retTime)
    ;
}


x86 assembly (clang, -O0):
<waitForIt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
xor    %edi,%edi
call   1030 <time@plt>
movzbl -0x1(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
xor    %edi,%edi
call   1030 <time@plt>
cmp    -0x8(%rbp),%eax
jae    1143 <waitForIt+0x33>
jmp    112e <waitForIt+0x1e>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<waitForIt>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
xor    %edi,%edi
call   1030 <time@plt>
mov    %eax,%ebx
add    %ebp,%ebx
xor    %edi,%edi
call   1030 <time@plt>
cmp    %ebx,%eax
jb     1120 <waitForIt+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @waitForIt(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
%4 = call i32 @time(i32 0)
%5 = load i8, i8* %2
%6 = zext i8 %5 to i32
%7 = add i32 %4, %6
store i32 %7, i32* %3
br label %8
8: ; preds = %12, %1
%9 = call i32 @time(i32 0)
%10 = load i32, i32* %3
%11 = icmp ult i32 %9, %10
br i1 %11, label %12, label %13
12: ; preds = %8
br label %8
13: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @waitForIt(i8 zeroext %0) {
%2 = tail call i32 @time(i32 0)
%3 = zext i8 %0 to i32
%4 = add i32 %2, %3
br label %5
5: ; preds = %5, %1
%6 = tail call i32 @time(i32 0)
%7 = icmp ult i32 %6, %4
br i1 %7, label %5, label %8
8: ; preds = %5
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ MD4_CTX;

/* Variables and functions */
int /*<<< orphan*/ MD4_Final(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ MD4_Init(int /*<<< orphan*/ *);
int /*<<< orphan*/ MD4_Update(int /*<<< orphan*/ *, int /*<<< orphan*/ const *,
                              int);
void ntlm_create_session_key(const uint8_t ntlm[16], uint8_t result[16]) {
  MD4_CTX session_key;
  MD4_Init(&session_key);
  MD4_Update(&session_key, ntlm, 16);
  MD4_Final(result, &session_key);
}


x86 assembly (clang, -O0):
<ntlm_create_session_key>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x14(%rbp),%rdi
call   1040 <MD4_Init@plt>
mov    -0x8(%rbp),%rsi
lea    -0x14(%rbp),%rdi
mov    $0x10,%edx
call   1030 <MD4_Update@plt>
mov    -0x10(%rbp),%rdi
lea    -0x14(%rbp),%rsi
call   1050 <MD4_Final@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ntlm_create_session_key>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xc(%rsp),%r15
mov    %r15,%rdi
call   1040 <MD4_Init@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    $0x10,%edx
call   1030 <MD4_Update@plt>
mov    %r14,%rdi
mov    %r15,%rsi
call   1050 <MD4_Final@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @ntlm_create_session_key(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = call i32 @MD4_Init(i32* %5)
%7 = load i32*, i32** %3
%8 = call i32 @MD4_Update(i32* %5, i32* %7, i32 16)
%9 = load i32*, i32** %4
%10 = call i32 @MD4_Final(i32* %9, i32* %5)
ret void
}

LLVM IR (-O2):
define void @ntlm_create_session_key(i32* %0, i32* %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @MD4_Init(i32* %3)
%6 = call i32 @MD4_Update(i32* %3, i32* %0, i32 16)
%7 = call i32 @MD4_Final(i32* %1, i32* %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ CheckedCommand(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                                  char *);
void EndAtomic(FILE *p_cmd, FILE *p_res) {
  CheckedCommand(p_cmd, p_res, "EndAtomic\n");
}


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

x86 assembly (clang, -O2):
<EndAtomic>:
lea    0xee9(%rip),%rdx
jmp    1030 <CheckedCommand@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"EndAtomic\0A\00"
define void @EndAtomic(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %3
%6 = load i32*, i32** %4
%7 = call i32 @CheckedCommand(i32* %5, i32* %6, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"EndAtomic\0A\00"
define void @EndAtomic(i32* %0, i32* %1) {
%3 = tail call i32 @CheckedCommand(i32* %0, i32* %1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}
void write_cr3(unsigned long value) {
  __asm__ __volatile__("mov %0, %%cr3" : : "r"(value));
}


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

x86 assembly (clang, -O2):
<write_cr3>:
mov    %rdi,%cr3
ret

LLVM IR (-O0):
define void @write_cr3(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
ret void
}

LLVM IR (-O2):
define void @write_cr3(i64 %0) {
tail call void asm sideeffect "mov $0, %cr3", "r,~{dirflag},~{fpsr},~{flags}"(i64 %0)
ret void
}
int adder_implementation(int a, int b) { return a + b; }


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

x86 assembly (clang, -O2):
<adder_implementation>:
lea    (%rdi,%rsi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @adder_implementation(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
void ff_h264chroma_init_mips() {}


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

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

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

LLVM IR (-O2):
define void @ff_h264chroma_init_mips() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0x57() {
  Assert_real((isodigit(87) == 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_isodigit.c",
              440, ("isodigit should be 0 for W"));
}


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

x86 assembly (clang, -O2):
<t_isodigit_0x57>:
push   %rax
mov    $0x57,%edi
call   1040 <isodigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x1b8,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isodigit.c\00"
@.str.1 = [27 x i8] c"isodigit should be 0 for W\00"
define void @t_isodigit_0x57() {
%1 = call i64 @isodigit(i32 87)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 440, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isodigit.c\00"
@.str.1 = [27 x i8] c"isodigit should be 0 for W\00"
define void @t_isodigit_0x57() {
%1 = tail call i64 @isodigit(i32 87)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 440, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ do_it();
scalar_t__ last();
__attribute__((no, noclone)) void f2(void) {
  while (1) {
    if (last())
      break;
    do_it();
  }
  do_it();
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <f2+0x9>
mov    $0x0,%al
call   1030 <last@plt>
cmp    $0x0,%rax
je     113f <f2+0x1f>
jmp    114b <f2+0x2b>
mov    $0x0,%al
call   1040 <do_it@plt>
jmp    1129 <f2+0x9>
mov    $0x0,%al
call   1040 <do_it@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <last@plt>
test   %rax,%rax
jne    1145 <f2+0x25>
xor    %eax,%eax
call   1040 <do_it@plt>
jmp    1130 <f2+0x10>
xor    %eax,%eax
pop    %rcx
jmp    1040 <do_it@plt>

LLVM IR (-O0):
define void @f2() {
br label %1
1: ; preds = %0, %5
%2 = call i64 (...) @last()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %1
br label %7
5: ; preds = %1
%6 = call i32 (...) @do_it()
br label %1
7: ; preds = %4
%8 = call i32 (...) @do_it()
ret void
}

LLVM IR (-O2):
define void @f2() {
%1 = tail call i64 (...) @last()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %7
3: ; preds = %0, %3
%4 = tail call i32 (...) @do_it()
%5 = tail call i64 (...) @last()
%6 = icmp eq i64 %5, 0
br i1 %6, label %3, label %7
7: ; preds = %3, %0
%8 = tail call i32 (...) @do_it()
ret void
}
int bit_TBRE(unsigned char reg_value) { return (reg_value & 0x01) == 0x01; }


x86 assembly (clang, -O0):
<bit_TBRE>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
and    $0x1,%eax
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_TBRE>:
mov    %edi,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @bit_TBRE(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, 1
%6 = icmp eq i32 %5, 1
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @bit_TBRE(i8 zeroext %0) {
%2 = and i8 %0, 1
%3 = zext i8 %2 to i32
ret i32 %3
}
/* Variables and functions */
size_t ex_header_size(int exoid) { return 0; }


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

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

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

LLVM IR (-O2):
define i64 @ex_header_size(i32 %0) {
ret i64 0
}
/* Variables and functions */
bool in_range(const void *low, const void *n, const void *high) {
  return low <= n && n < high;
}


x86 assembly (clang, -O0):
<in_range>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rcx
xor    %eax,%eax
cmp    -0x10(%rbp),%rcx
mov    %al,-0x19(%rbp)
ja     1131 <in_range+0x31>
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
setb   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<in_range>:
cmp    %rsi,%rdi
setbe  %al
cmp    %rdx,%rsi
setb   %cl
and    %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @in_range(i8* readnone %0, i8* readnone %1, i8* readnone %2) {
%4 = icmp ule i8* %0, %1
%5 = icmp ult i8* %1, %2
%6 = and i1 %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Type definitions */
struct memory_pool {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ pool_expand(struct memory_pool *);
uintptr_t try_pool_alloc(struct memory_pool *, size_t);
uintptr_t pool_alloc(struct memory_pool *pool, size_t size) {
  uintptr_t addr;
  addr = try_pool_alloc(pool, size);
  if (addr == 0) {
    pool_expand(pool);
    addr = try_pool_alloc(pool, size);
  }
  return addr;
}


x86 assembly (clang, -O0):
<pool_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <try_pool_alloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1166 <pool_alloc+0x46>
mov    -0x8(%rbp),%rdi
call   1030 <pool_expand@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <try_pool_alloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pool_alloc>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <try_pool_alloc@plt>
test   %rax,%rax
je     113c <pool_alloc+0x1c>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    %rbx,%rdi
call   1030 <pool_expand@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <try_pool_alloc@plt>

LLVM IR (-O0):
%struct.memory_pool = type { i32 }
define i64 @pool_alloc(%struct.memory_pool* %0, i64 %1) {
%3 = alloca %struct.memory_pool*
%4 = alloca i64
%5 = alloca i64
store %struct.memory_pool* %0, %struct.memory_pool** %3
store i64 %1, i64* %4
%6 = load %struct.memory_pool*, %struct.memory_pool** %3
%7 = load i64, i64* %4
%8 = call i64 @try_pool_alloc(%struct.memory_pool* %6, i64 %7)
store i64 %8, i64* %5
%9 = load i64, i64* %5
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %17
11: ; preds = %2
%12 = load %struct.memory_pool*, %struct.memory_pool** %3
%13 = call i32 @pool_expand(%struct.memory_pool* %12)
%14 = load %struct.memory_pool*, %struct.memory_pool** %3
%15 = load i64, i64* %4
%16 = call i64 @try_pool_alloc(%struct.memory_pool* %14, i64 %15)
store i64 %16, i64* %5
br label %17
17: ; preds = %11, %2
%18 = load i64, i64* %5
ret i64 %18
}

LLVM IR (-O2):
%struct.memory_pool = type { i32 }
define i64 @pool_alloc(%struct.memory_pool* %0, i64 %1) {
%3 = tail call i64 @try_pool_alloc(%struct.memory_pool* %0, i64 %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @pool_expand(%struct.memory_pool* %0)
%7 = tail call i64 @try_pool_alloc(%struct.memory_pool* %0, i64 %1)
br label %8
8: ; preds = %5, %2
%9 = phi i64 [ %7, %5 ], [ %3, %2 ]
ret i64 %9
}
/* Type definitions */
struct LinearList {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ private_LinearList_Delete(struct LinearList *, int);
void LinearList_Delete(struct LinearList *list, int value) {
  if (list == NULL)
    return;
  private_LinearList_Delete(list, value);
  return;
}


x86 assembly (clang, -O0):
<LinearList_Delete>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112f <LinearList_Delete+0x1f>
jmp    113b <LinearList_Delete+0x2b>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <private_LinearList_Delete@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LinearList_Delete>:
test   %rdi,%rdi
je     111a <LinearList_Delete+0xa>
jmp    1030 <private_LinearList_Delete@plt>
ret

LLVM IR (-O0):
%struct.LinearList = type { i32 }
define void @LinearList_Delete(%struct.LinearList* %0, i32 %1) {
%3 = alloca %struct.LinearList*
%4 = alloca i32
store %struct.LinearList* %0, %struct.LinearList** %3
store i32 %1, i32* %4
%5 = load %struct.LinearList*, %struct.LinearList** %3
%6 = icmp eq %struct.LinearList* %5, null
br i1 %6, label %7, label %8
7: ; preds = %2
br label %12
8: ; preds = %2
%9 = load %struct.LinearList*, %struct.LinearList** %3
%10 = load i32, i32* %4
%11 = call i32 @private_LinearList_Delete(%struct.LinearList* %9, i32 %10)
br label %12
12: ; preds = %8, %7
ret void
}

LLVM IR (-O2):
%struct.LinearList = type { i32 }
define void @LinearList_Delete(%struct.LinearList* %0, i32 %1) {
%3 = icmp eq %struct.LinearList* %0, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @private_LinearList_Delete(%struct.LinearList* %0, i32 %1)
br label %6
6: ; preds = %2, %4
ret void
}