xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int get_rest_steps() {
  printf("get_rest_steps\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [15 x i8] c"get_rest_steps\00"
define i32 @get_rest_steps() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int calc_lowcomp1(int a, int b0, int b1) {
  if ((b0 + 256) == b1) {
    a = 384;
  } else if (b0 > b1) {
    a = a - 64;
    if (a < 0)
      a = 0;
  }
  return a;
}


x86 assembly (clang, -O0):
<calc_lowcomp1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x100,%eax
cmp    -0xc(%rbp),%eax
jne    112a <calc_lowcomp1+0x2a>
movl   $0x180,-0x4(%rbp)
jmp    115a <calc_lowcomp1+0x5a>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1155 <calc_lowcomp1+0x55>
mov    -0x4(%rbp),%eax
sub    $0x40,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1150 <calc_lowcomp1+0x50>
movl   $0x0,-0x4(%rbp)
jmp    1155 <calc_lowcomp1+0x55>
jmp    115a <calc_lowcomp1+0x5a>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_lowcomp1>:
lea    0x100(%rsi),%ecx
mov    $0x180,%eax
cmp    %edx,%ecx
je     1121 <calc_lowcomp1+0x21>
cmp    %edx,%esi
jle    1122 <calc_lowcomp1+0x22>
cmp    $0x41,%edi
mov    $0x40,%eax
cmovge %edi,%eax
add    $0xffffffc0,%eax
ret
mov    %edi,%eax
ret

LLVM IR (-O0):
define i32 @calc_lowcomp1(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = add nsw i32 %7, 256
%9 = load i32, i32* %6
%10 = icmp eq i32 %8, %9
br i1 %10, label %11, label %12
11: ; preds = %3
store i32 384, i32* %4
br label %24
12: ; preds = %3
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = icmp sgt i32 %13, %14
br i1 %15, label %16, label %23
16: ; preds = %12
%17 = load i32, i32* %4
%18 = sub nsw i32 %17, 64
store i32 %18, i32* %4
%19 = load i32, i32* %4
%20 = icmp slt i32 %19, 0
br i1 %20, label %21, label %22
21: ; preds = %16
store i32 0, i32* %4
br label %22
22: ; preds = %21, %16
br label %23
23: ; preds = %22, %12
br label %24
24: ; preds = %23, %11
%25 = load i32, i32* %4
ret i32 %25
}

LLVM IR (-O2):
define i32 @calc_lowcomp1(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %1, 256
%5 = icmp eq i32 %4, %2
br i1 %5, label %12, label %6
6: ; preds = %3
%7 = icmp sgt i32 %1, %2
br i1 %7, label %8, label %12
8: ; preds = %6
%9 = icmp sgt i32 %0, 64
%10 = select i1 %9, i32 %0, i32 64
%11 = add nsw i32 %10, -64
br label %12
12: ; preds = %3, %6, %8
%13 = phi i32 [ %11, %8 ], [ %0, %6 ], [ 384, %3 ]
ret i32 %13
}
void glutSetWindow(int bla) {}


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

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

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

LLVM IR (-O2):
define void @glutSetWindow(i32 %0) {
ret void
}
int ithread_cleanup_library(void) {
  int ret = 0;
  return ret;
}


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

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

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

LLVM IR (-O2):
define i32 @ithread_cleanup_library() {
ret i32 0
}
void i2d_PKCS8_PRIV_KEY_INFO_bio(void) {}


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

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

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

LLVM IR (-O2):
define void @i2d_PKCS8_PRIV_KEY_INFO_bio() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char, char);
int main(void) {
  int a, b;
  char c, d;
  a = 512;
  b = 127;
  c = a;
  d = b;
  printf("%hhd %hhd\n", c, d);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x200,-0x8(%rbp)
movl   $0x7f,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %al,-0xd(%rbp)
mov    -0xc(%rbp),%eax
mov    %al,-0xe(%rbp)
mov    -0xd(%rbp),%al
lea    0xebd(%rip),%rdi
movsbl %al,%esi
movsbl -0xe(%rbp),%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [11 x i8] c"%hhd %hhd\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8
%5 = alloca i8
store i32 0, i32* %1
store i32 512, i32* %2
store i32 127, i32* %3
%6 = load i32, i32* %2
%7 = trunc i32 %6 to i8
store i8 %7, i8* %4
%8 = load i32, i32* %3
%9 = trunc i32 %8 to i8
store i8 %9, i8* %5
%10 = load i8, i8* %4
%11 = load i8, i8* %5
%12 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8 signext %10, i8 signext %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"%hhd %hhd\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8 signext 0, i8 signext 127)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M910_f(char *s) {
  debug("M910_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M910_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M910_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M910_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M910_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M910_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M910_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
void swap(struct node_t **arr, int i, int j) {
  struct node_t *tmp;
  tmp = arr[i];
  arr[i] = arr[j];
  arr[j] = tmp;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x18(%rbp),%rdx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
movslq %esi,%rax
mov    (%rdi,%rax,8),%rcx
movslq %edx,%rdx
mov    (%rdi,%rdx,8),%rsi
mov    %rsi,(%rdi,%rax,8)
mov    %rcx,(%rdi,%rdx,8)
ret

LLVM IR (-O0):
%struct.node_t = type opaque
define void @swap(%struct.node_t** %0, i32 %1, i32 %2) {
%4 = alloca %struct.node_t**
%5 = alloca i32
%6 = alloca i32
%7 = alloca %struct.node_t*
store %struct.node_t** %0, %struct.node_t*** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load %struct.node_t**, %struct.node_t*** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds %struct.node_t*, %struct.node_t** %8, i64 %10
%12 = load %struct.node_t*, %struct.node_t** %11
store %struct.node_t* %12, %struct.node_t** %7
%13 = load %struct.node_t**, %struct.node_t*** %4
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds %struct.node_t*, %struct.node_t** %13, i64 %15
%17 = load %struct.node_t*, %struct.node_t** %16
%18 = load %struct.node_t**, %struct.node_t*** %4
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds %struct.node_t*, %struct.node_t** %18, i64 %20
store %struct.node_t* %17, %struct.node_t** %21
%22 = load %struct.node_t*, %struct.node_t** %7
%23 = load %struct.node_t**, %struct.node_t*** %4
%24 = load i32, i32* %6
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds %struct.node_t*, %struct.node_t** %23, i64 %25
store %struct.node_t* %22, %struct.node_t** %26
ret void
}

LLVM IR (-O2):
%struct.node_t = type opaque
define void @swap(%struct.node_t** nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds %struct.node_t*, %struct.node_t** %0, i64 %4
%6 = load %struct.node_t*, %struct.node_t** %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds %struct.node_t*, %struct.node_t** %0, i64 %7
%9 = load %struct.node_t*, %struct.node_t** %8
store %struct.node_t* %9, %struct.node_t** %5
store %struct.node_t* %6, %struct.node_t** %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void hello(int opt) { printf("Hello World: int test %d \n", opt); }


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

x86 assembly (clang, -O2):
<hello>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"Hello World: int test %d \0A\00"
define void @hello(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"Hello World: int test %d \0A\00"
define void @hello(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
void doNothin(void (*f)()) { f(); }


x86 assembly (clang, -O0):
<doNothin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   *-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<doNothin>:
xor    %eax,%eax
jmp    *%rdi

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

LLVM IR (-O2):
define void @doNothin(void (...)* nocapture %0) {
tail call void (...) %0()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pana_debug(char *);
void eapRespTimerStart() { pana_debug("eapRespTimerStart function"); }


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

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

LLVM IR (-O0):
@.str = [27 x i8] c"eapRespTimerStart function\00"
define void @eapRespTimerStart() {
%1 = call i32 @pana_debug(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"eapRespTimerStart function\00"
define void @eapRespTimerStart() {
%1 = tail call i32 @pana_debug(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int get(int *x, int *y) {
  puts("This is get");
  return (*x) * (*y);
}


x86 assembly (clang, -O0):
<get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed9(%rip),%rdi
call   1030 <puts@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
imul   (%rcx),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
lea    0xedf(%rip),%rdi
call   1030 <puts@plt>
mov    (%rbx),%eax
imul   (%r14),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [12 x i8] c"This is get\00"
define i32 @get(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = call i32 @puts(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = mul nsw i32 %7, %9
ret i32 %10
}

LLVM IR (-O2):
@.str = [12 x i8] c"This is get\00"
define i32 @get(i32* nocapture %0, i32* nocapture %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %0
%5 = load i32, i32* %1
%6 = mul nsw i32 %5, %4
ret i32 %6
}
int foo(int a) { return 10; }


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

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

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
ret i32 10
}
int optparse_is_shortopt(const char *arg) {
  return arg != 0 && arg[0] == '-' && arg[1] != '-' && arg[1] != '\0';
}


x86 assembly (clang, -O0):
<optparse_is_shortopt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1154 <optparse_is_shortopt+0x54>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x2d,%ecx
mov    %al,-0x9(%rbp)
jne    1154 <optparse_is_shortopt+0x54>
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%ecx
xor    %eax,%eax
cmp    $0x2d,%ecx
mov    %al,-0x9(%rbp)
je     1154 <optparse_is_shortopt+0x54>
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<optparse_is_shortopt>:
xor    %eax,%eax
test   %rdi,%rdi
je     111b <optparse_is_shortopt+0x1b>
cmpb   $0x2d,(%rdi)
jne    111b <optparse_is_shortopt+0x1b>
mov    0x1(%rdi),%cl
cmp    $0x2d,%cl
je     111b <optparse_is_shortopt+0x1b>
xor    %eax,%eax
test   %cl,%cl
setne  %al
ret

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

LLVM IR (-O2):
define i32 @optparse_is_shortopt(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 45
br i1 %5, label %6, label %13
6: ; preds = %3
%7 = getelementptr inbounds i8, i8* %0, i64 1
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 45
br i1 %9, label %13, label %10
10: ; preds = %6
%11 = icmp ne i8 %8, 0
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %10, %6, %3, %1
%14 = phi i32 [ 0, %6 ], [ 0, %3 ], [ 0, %1 ], [ %12, %10 ]
ret i32 %14
}
void threshold_by_comparison_1_Good() {
  int arr[100];
  for (int i = 0; i != 100; i++) {
    arr[i] = 0;
  }
}


x86 assembly (clang, -O0):
<threshold_by_comparison_1_Good>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
movl   $0x0,-0x194(%rbp)
cmpl   $0x64,-0x194(%rbp)
je     1148 <threshold_by_comparison_1_Good+0x48>
movslq -0x194(%rbp),%rax
movl   $0x0,-0x190(%rbp,%rax,4)
mov    -0x194(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x194(%rbp)
jmp    1115 <threshold_by_comparison_1_Good+0x15>
add    $0x120,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @threshold_by_comparison_1_Good() {
%1 = alloca [100 x i32]
%2 = alloca i32
store i32 0, i32* %2
br label %3
3: ; preds = %10, %0
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 100
br i1 %5, label %6, label %13
6: ; preds = %3
%7 = load i32, i32* %2
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 %8
store i32 0, i32* %9
br label %10
10: ; preds = %6
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 1
store i32 %12, i32* %2
br label %3
13: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @threshold_by_comparison_1_Good() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ die(char *, char const *);
void usage(const char *cmd) {
  die("Usage: %s [-d] [-o output] [input]\n", cmd);
}


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

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <die@plt>

LLVM IR (-O0):
@.str = [36 x i8] c"Usage: %s [-d] [-o output] [input]\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @die(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [36 x i8] c"Usage: %s [-d] [-o output] [input]\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @die(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int test_imm_73uint32_reg(unsigned int val) {
  return ((val) & (0x73 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_73uint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x73,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_73uint32_reg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 115
%5 = icmp ne i32 %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_73uint32_reg(i32 %0) {
%2 = and i32 %0, 115
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void release_mem_region(unsigned long start, unsigned long len) {
  { return; }
}


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

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

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

LLVM IR (-O2):
define void @release_mem_region(i64 %0, i64 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ t_mixprocess(int, unsigned int, unsigned char const *,
                                unsigned char *, unsigned long const,
                                unsigned char const *, unsigned char const *);
void t_mixencrypt(unsigned int thr, const unsigned char *data,
                  unsigned char *out, const unsigned long size,
                  const unsigned char *key, const unsigned char *iv) {
  t_mixprocess(1, thr, data, out, size, key, iv);
}


x86 assembly (clang, -O0):
<t_mixencrypt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9
mov    -0x30(%rbp),%rax
mov    $0x1,%edi
mov    %rax,(%rsp)
call   1030 <t_mixprocess@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_mixencrypt>:
push   %rax
mov    %r8,%rax
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,%esi
mov    %r9,(%rsp)
mov    $0x1,%edi
mov    %rax,%r9
call   1030 <t_mixprocess@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @t_mixencrypt(i32 %0, i8* %1, i8* %2, i64 %3, i8* %4, i8* %5) {
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i64
%11 = alloca i8*
%12 = alloca i8*
store i32 %0, i32* %7
store i8* %1, i8** %8
store i8* %2, i8** %9
store i64 %3, i64* %10
store i8* %4, i8** %11
store i8* %5, i8** %12
%13 = load i32, i32* %7
%14 = load i8*, i8** %8
%15 = load i8*, i8** %9
%16 = load i64, i64* %10
%17 = load i8*, i8** %11
%18 = load i8*, i8** %12
%19 = call i32 @t_mixprocess(i32 1, i32 %13, i8* %14, i8* %15, i64 %16, i8* %17, i8* %18)
ret void
}

LLVM IR (-O2):
define void @t_mixencrypt(i32 %0, i8* %1, i8* %2, i64 %3, i8* %4, i8* %5) {
%7 = tail call i32 @t_mixprocess(i32 1, i32 %0, i8* %1, i8* %2, i64 %3, i8* %4, i8* %5)
ret void
}
void EXTENDED_KEY_USAGE_free(void) {}


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

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

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

LLVM IR (-O2):
define void @EXTENDED_KEY_USAGE_free() {
ret void
}
/* Type definitions */
typedef scalar_t__ pid_t;

/* Variables and functions */
scalar_t__ find_adb();
int /*<<< orphan*/ kill(int, int);
int /*<<< orphan*/ sleep(int);
void wait_for_root_adb(pid_t old_adb) {
  pid_t p = 0;
  for (;;) {
    p = find_adb();
    if (p != 0 && p != old_adb)
      break;
    sleep(1);
  }
  sleep(5);
  kill(-1, 9);
}


x86 assembly (clang, -O0):
<wait_for_root_adb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    $0x0,%al
call   1030 <find_adb@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     116d <wait_for_root_adb+0x3d>
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
je     116d <wait_for_root_adb+0x3d>
jmp    117c <wait_for_root_adb+0x4c>
mov    $0x1,%edi
call   1050 <sleep@plt>
jmp    1144 <wait_for_root_adb+0x14>
mov    $0x5,%edi
call   1050 <sleep@plt>
mov    $0xffffffff,%edi
mov    $0x9,%esi
call   1040 <kill@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait_for_root_adb>:
push   %rbx
mov    %rdi,%rbx
jmp    114a <wait_for_root_adb+0x1a>
cs nopw 0x0(%rax,%rax,1)
mov    $0x1,%edi
call   1050 <sleep@plt>
xor    %eax,%eax
call   1030 <find_adb@plt>
test   %rax,%rax
je     1140 <wait_for_root_adb+0x10>
cmp    %rbx,%rax
je     1140 <wait_for_root_adb+0x10>
mov    $0x5,%edi
call   1050 <sleep@plt>
mov    $0xffffffff,%edi
mov    $0x9,%esi
pop    %rbx
jmp    1040 <kill@plt>

LLVM IR (-O0):
define void @wait_for_root_adb(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
store i64 0, i64* %3
br label %4
4: ; preds = %13, %1
%5 = call i64 (...) @find_adb()
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %4
%9 = load i64, i64* %3
%10 = load i64, i64* %2
%11 = icmp ne i64 %9, %10
br i1 %11, label %12, label %13
12: ; preds = %8
br label %15
13: ; preds = %8, %4
%14 = call i32 @sleep(i32 1)
br label %4
15: ; preds = %12
%16 = call i32 @sleep(i32 5)
%17 = call i32 @kill(i32 -1, i32 9)
ret void
}

LLVM IR (-O2):
define void @wait_for_root_adb(i64 %0) {
%2 = tail call i64 (...) @find_adb()
%3 = icmp eq i64 %2, 0
%4 = icmp eq i64 %2, %0
%5 = or i1 %3, %4
br i1 %5, label %6, label %12
6: ; preds = %1, %6
%7 = tail call i32 @sleep(i32 1)
%8 = tail call i64 (...) @find_adb()
%9 = icmp eq i64 %8, 0
%10 = icmp eq i64 %8, %0
%11 = or i1 %9, %10
br i1 %11, label %6, label %12
12: ; preds = %6, %1
%13 = tail call i32 @sleep(i32 5)
%14 = tail call i32 @kill(i32 -1, i32 9)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ OutputDACchannel(int, int /*<<< orphan*/);
void ClearDACchannel(int channel_no) { OutputDACchannel(channel_no, 0); }


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

x86 assembly (clang, -O2):
<ClearDACchannel>:
xor    %esi,%esi
jmp    1030 <OutputDACchannel@plt>

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

LLVM IR (-O2):
define void @ClearDACchannel(i32 %0) {
%2 = tail call i32 @OutputDACchannel(i32 %0, i32 0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *stdin;
int /*<<< orphan*/ *stdout;
void dehexFclose(FILE *file) {
  if (!(stdin == file || stdout == file)) {
    fclose(file);
  }
}


x86 assembly (clang, -O0):
<dehexFclose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ec5(%rip),%rax
mov    (%rax),%rax
cmp    -0x8(%rbp),%rax
je     114d <dehexFclose+0x3d>
mov    0x2ea1(%rip),%rax
mov    (%rax),%rax
cmp    -0x8(%rbp),%rax
je     114d <dehexFclose+0x3d>
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dehexFclose>:
mov    0x2ed1(%rip),%rax
cmp    %rdi,(%rax)
je     112d <dehexFclose+0x1d>
mov    0x2eb5(%rip),%rax
cmp    %rdi,(%rax)
je     112d <dehexFclose+0x1d>
jmp    1030 <fclose@plt>
ret

LLVM IR (-O0):
@stdin = global i32* null
@stdout = global i32* null
define void @dehexFclose(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** @stdin
%4 = load i32*, i32** %2
%5 = icmp eq i32* %3, %4
br i1 %5, label %13, label %6
6: ; preds = %1
%7 = load i32*, i32** @stdout
%8 = load i32*, i32** %2
%9 = icmp eq i32* %7, %8
br i1 %9, label %13, label %10
10: ; preds = %6
%11 = load i32*, i32** %2
%12 = call i32 @fclose(i32* %11)
br label %13
13: ; preds = %10, %6, %1
ret void
}

LLVM IR (-O2):
@stdin = global i32* null
@stdout = global i32* null
define void @dehexFclose(i32* nocapture %0) {
%2 = load i32*, i32** @stdin
%3 = icmp eq i32* %2, %0
%4 = load i32*, i32** @stdout
%5 = icmp eq i32* %4, %0
%6 = select i1 %3, i1 true, i1 %5
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 @fclose(i32* %0)
br label %9
9: ; preds = %7, %1
ret void
}
/* Variables and functions */
long EthernetPacketGetInternal(unsigned long, unsigned char *, long);
long EthernetPacketGet(unsigned long ulBase, unsigned char *pucBuf,
                       long lBufLen) {
  ;
  ;
  ;
  while (((*((volatile unsigned long *)(ulBase + 0x00000034))) & 0x0000003F) ==
         0) {
  }
  return (EthernetPacketGetInternal(ulBase, pucBuf, lBufLen));
}


x86 assembly (clang, -O0):
<EthernetPacketGet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    0x34(%rax),%rax
and    $0x3f,%rax
cmp    $0x0,%rax
jne    113f <EthernetPacketGet+0x2f>
jmp    1124 <EthernetPacketGet+0x14>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <EthernetPacketGetInternal@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EthernetPacketGet>:
testq  $0x3f,0x34(%rdi)
je     1110 <EthernetPacketGet>
jmp    1030 <EthernetPacketGetInternal@plt>

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

LLVM IR (-O2):
define i64 @EthernetPacketGet(i64 %0, i8* %1, i64 %2) {
%4 = add i64 %0, 52
%5 = inttoptr i64 %4 to i64*
br label %6
6: ; preds = %6, %3
%7 = load volatile i64, i64* %5
%8 = and i64 %7, 63
%9 = icmp eq i64 %8, 0
br i1 %9, label %6, label %10
10: ; preds = %6
%11 = tail call i64 @EthernetPacketGetInternal(i64 %0, i8* %1, i64 %2)
ret i64 %11
}
int do_670() { return 670; }


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

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

LLVM IR (-O0):
define i32 @do_670() {
ret i32 670
}

LLVM IR (-O2):
define i32 @do_670() {
ret i32 670
}
/* Type definitions */
struct target {
  int dummy;
};

/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ snprintf(char *, int, char *);
char *dump_sys_getppid(int depth, struct target *target) {
  char *param_str = malloc(5);
  snprintf(param_str, 5, "void");
  return param_str;
}


x86 assembly (clang, -O0):
<dump_sys_getppid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x5,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x5,%esi
lea    0xeb3(%rip),%rdx
call   1030 <snprintf@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_sys_getppid>:
push   %rbx
mov    $0x5,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
lea    0xecb(%rip),%rdx
mov    %rax,%rdi
mov    $0x5,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.target = type { i32 }
@.str = [5 x i8] c"void\00"
define i8* @dump_sys_getppid(i32 %0, %struct.target* %1) {
%3 = alloca i32
%4 = alloca %struct.target*
%5 = alloca i8*
store i32 %0, i32* %3
store %struct.target* %1, %struct.target** %4
%6 = call i8* @malloc(i32 5)
store i8* %6, i8** %5
%7 = load i8*, i8** %5
%8 = call i32 @snprintf(i8* %7, i32 5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%9 = load i8*, i8** %5
ret i8* %9
}

LLVM IR (-O2):
%struct.target = type { i32 }
@.str = [5 x i8] c"void\00"
define i8* @dump_sys_getppid(i32 %0, %struct.target* nocapture readnone %1) {
%3 = tail call dereferenceable_or_null(5) i8* @malloc(i32 5)
%4 = tail call i32 @snprintf(i8* %3, i32 5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0xec() {
  Assert_real((isxdigit(236) == 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_isxdigit.c",
              1185, ("isxdigit should be 0 for 0xec"));
}


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

x86 assembly (clang, -O2):
<t_isxdigit_0xec>:
push   %rax
mov    $0xec,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x4a1,%edx
pop    %rax
jmp    1040 <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_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0xec\00"
define void @t_isxdigit_0xec() {
%1 = call i64 @isxdigit(i32 236)
%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 1185, i8* getelementptr inbounds ([30 x i8], [30 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_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0xec\00"
define void @t_isxdigit_0xec() {
%1 = tail call i64 @isxdigit(i32 236)
%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 1185, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
rip(s) register char *s;
{
  register char *cp;
  if ((cp = strchr(s, '\r')) != (char *)0)
    *cp = '\0';
  if ((cp = strchr(s, '\n')) != (char *)0)
    *cp = '\0';
}


x86 assembly (clang, -O0):
<rip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0xd,%esi
call   1030 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     113f <rip+0x2f>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rdi
mov    $0xa,%esi
call   1030 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     1162 <rip+0x52>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rip>:
push   %rbx
mov    %rdi,%rbx
mov    $0xd,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     1126 <rip+0x16>
movb   $0x0,(%rax)
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     113b <rip+0x2b>
movb   $0x0,(%rax)
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @rip(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i32 13)
%3 = icmp eq i8* %2, null
br i1 %3, label %5, label %4
4: ; preds = %1
store i8 0, i8* %2
br label %5
5: ; preds = %4, %1
%6 = tail call i8* @strchr(i8* dereferenceable(1) %0, i32 10)
%7 = icmp eq i8* %6, null
br i1 %7, label %9, label %8
8: ; preds = %5
store i8 0, i8* %6
br label %9
9: ; preds = %8, %5
ret i32 undef
}
int is_point_loss_or_neither(int sum_dice, int point_value) {
  int is_point = -1;
  if (sum_dice == point_value) {
    is_point = 1;
  } else if (sum_dice == 7) {
    is_point = 0;
  }
  return is_point;
}


x86 assembly (clang, -O0):
<is_point_loss_or_neither>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0xffffffff,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    1129 <is_point_loss_or_neither+0x29>
movl   $0x1,-0xc(%rbp)
jmp    113f <is_point_loss_or_neither+0x3f>
cmpl   $0x7,-0x4(%rbp)
jne    113a <is_point_loss_or_neither+0x3a>
movl   $0x0,-0xc(%rbp)
jmp    113f <is_point_loss_or_neither+0x3f>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_point_loss_or_neither>:
xor    %ecx,%ecx
cmp    $0x7,%edi
setne  %cl
neg    %ecx
cmp    %esi,%edi
mov    $0x1,%eax
cmovne %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @is_point_loss_or_neither(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
%4 = icmp ne i32 %0, 7
%5 = sext i1 %4 to i32
%6 = select i1 %3, i32 1, i32 %5
ret i32 %6
}
float warp_lerp(float a, float b, float t) { return a * (1 - t) + b * t; }


x86 assembly (clang, -O0):
<warp_lerp>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xee0(%rip),%xmm2
subss  -0xc(%rbp),%xmm2
movss  -0x8(%rbp),%xmm1
mulss  -0xc(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<warp_lerp>:
movss  0xef8(%rip),%xmm3
subss  %xmm2,%xmm3
mulss  %xmm2,%xmm1
mulss  %xmm3,%xmm0
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @warp_lerp(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %6
%9 = fsub float 1.000000e+00, %8
%10 = load float, float* %5
%11 = load float, float* %6
%12 = fmul float %10, %11
%13 = call float @llvm.fmuladd.f32(float %7, float %9, float %12)
ret float %13
}

LLVM IR (-O2):
define float @warp_lerp(float %0, float %1, float %2) {
%4 = fsub float 1.000000e+00, %2
%5 = fmul float %1, %2
%6 = tail call float @llvm.fmuladd.f32(float %0, float %4, float %5)
ret float %6
}
int findIndexOfRun(unsigned char *level, int start, int count, int tlevel) {
  int i;
  for (i = start; i < count; i++) {
    if (tlevel <= level[i]) {
      return i;
    }
  }
  return count;
}


x86 assembly (clang, -O0):
<findIndexOfRun>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1158 <findIndexOfRun+0x58>
mov    -0x1c(%rbp),%eax
mov    -0x10(%rbp),%rcx
movslq -0x20(%rbp),%rdx
movzbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
jg     1145 <findIndexOfRun+0x45>
mov    -0x20(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115e <findIndexOfRun+0x5e>
jmp    114a <findIndexOfRun+0x4a>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1117 <findIndexOfRun+0x17>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<findIndexOfRun>:
mov    %edx,%eax
cmp    %edx,%esi
jge    1122 <findIndexOfRun+0x22>
movslq %esi,%rdx
add    %rdx,%rdi
nopl   0x0(%rax)
movzbl (%rdi),%edx
cmp    %ecx,%edx
jge    1123 <findIndexOfRun+0x23>
add    $0x1,%esi
add    $0x1,%rdi
cmp    %esi,%eax
jne    1110 <findIndexOfRun+0x10>
ret
mov    %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @findIndexOfRun(i8* nocapture %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp slt i32 %1, %2
br i1 %5, label %6, label %20
6: ; preds = %4
%7 = sext i32 %1 to i64
br label %8
8: ; preds = %6, %14
%9 = phi i64 [ %7, %6 ], [ %15, %14 ]
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = icmp slt i32 %12, %3
br i1 %13, label %14, label %18
14: ; preds = %8
%15 = add nsw i64 %9, 1
%16 = trunc i64 %15 to i32
%17 = icmp eq i32 %16, %2
br i1 %17, label %20, label %8
18: ; preds = %8
%19 = trunc i64 %9 to i32
br label %20
20: ; preds = %14, %18, %4
%21 = phi i32 [ %2, %4 ], [ %19, %18 ], [ %2, %14 ]
ret i32 %21
}
/* Variables and functions */
int /*<<< orphan*/ fatal();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "usage...\n");
  fatal();
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <fatal@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [10 x i8] c"usage...\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @fatal()
ret void
}
A0AX1(r0, r1, x0, x1, p0, p1) signed char r0, r1;
signed char *p0, *p1;
{
  if ((*((signed char *)10000000)) <= (((signed char *)11111111)[x1]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<A0AX1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %dil,%sil
mov    %sil,-0x5(%rbp)
mov    %al,-0x6(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    $0x989680,%eax
movsbl (%rax),%eax
movslq -0x10(%rbp),%rdx
mov    $0xa98ac7,%ecx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
jg     1147 <A0AX1+0x47>
movl   $0x1,-0x4(%rbp)
jmp    114e <A0AX1+0x4e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<A0AX1>:
mov    0x989680,%dl
movslq %ecx,%rcx
xor    %eax,%eax
cmp    0xa98ac7(%rcx),%dl
setle  %al
ret

LLVM IR (-O0):
define i32 @A0AX1(i32 %0, i32 %1, i32 %2, i32 %3, i8* %4, i8* %5) {
%7 = alloca i32
%8 = alloca i8
%9 = alloca i8
%10 = alloca i32
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i8*
%14 = trunc i32 %0 to i8
%15 = trunc i32 %1 to i8
store i8 %14, i8* %8
store i8 %15, i8* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i8* %4, i8** %12
store i8* %5, i8** %13
%16 = load i8, i8* inttoptr (i64 10000000 to i8*)
%17 = sext i8 %16 to i32
%18 = load i32, i32* %11
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8, i8* inttoptr (i64 11111111 to i8*), i64 %19
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = icmp sle i32 %17, %22
br i1 %23, label %24, label %25
24: ; preds = %6
store i32 1, i32* %7
br label %26
25: ; preds = %6
store i32 0, i32* %7
br label %26
26: ; preds = %25, %24
%27 = load i32, i32* %7
ret i32 %27
}

LLVM IR (-O2):
define i32 @A0AX1(i32 %0, i32 %1, i32 %2, i32 %3, i8* nocapture readnone %4, i8* nocapture readnone %5) {
%7 = load i8, i8* inttoptr (i64 10000000 to i8*)
%8 = sext i32 %3 to i64
%9 = getelementptr inbounds i8, i8* inttoptr (i64 11111111 to i8*), i64 %8
%10 = load i8, i8* %9
%11 = icmp sle i8 %7, %10
%12 = zext i1 %11 to i32
ret i32 %12
}
int route_order(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @route_order() {
ret i32 1
}

LLVM IR (-O2):
define i32 @route_order() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_233() {
  Assert_real((isqrt(233) == 15),
              "/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/stdlib/isqrt.c",
              1170, ("Integer square root of 233 should be 15"));
}


x86 assembly (clang, -O0):
<t_sqrt_233>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe9,%edi
call   1030 <isqrt@plt>
cmp    $0xf,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x492,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_233>:
push   %rax
mov    $0xe9,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0xf,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x492,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 233 should be 15\00"
define void @t_sqrt_233() {
%1 = call i32 @isqrt(i32 233)
%2 = icmp eq i32 %1, 15
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 1170, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 233 should be 15\00"
define void @t_sqrt_233() {
%1 = tail call i32 @isqrt(i32 233)
%2 = icmp eq i32 %1, 15
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 1170, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}