xunge/DecIR huggingface dataset:
void *xrealloc(old, size) void *old;
unsigned int size;
{
  register void *value = (void *)realloc(old, size);
  if (!value)
    fatal("virtual memory exhausted");
  return value;
}


x86 assembly (clang, -O0):
<xrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%eax
mov    %eax,%esi
call   1030 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    115a <xrealloc+0x3a>
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1040 <fatal@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
push   %rbx
mov    %esi,%esi
call   1030 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113e <xrealloc+0x1e>
lea    0xec9(%rip),%rdi
xor    %eax,%eax
call   1040 <fatal@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"virtual memory exhausted\00"
define i8* @xrealloc(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = zext i32 %7 to i64
%9 = call i8* @realloc(i8* %6, i64 %8)
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = icmp ne i8* %10, null
br i1 %11, label %14, label %12
12: ; preds = %2
%13 = call i32 (i8*, ...) bitcast (i32 (...)* @fatal to i32 (i8*, ...)*)(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %14
14: ; preds = %12, %2
%15 = load i8*, i8** %5
ret i8* %15
}

LLVM IR (-O2):
@.str = [25 x i8] c"virtual memory exhausted\00"
define i8* @xrealloc(i8* nocapture %0, i32 %1) {
%3 = zext i32 %1 to i64
%4 = tail call i8* @realloc(i8* %0, i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 (i8*, ...) bitcast (i32 (...)* @fatal to i32 (i8*, ...)*)(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %2
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ put_console(int /*<<< orphan*/);
void put_string(const char *s) {
  while (*s != '\0')
    put_console(*s++);
}


x86 assembly (clang, -O0):
<put_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1148 <put_string+0x38>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <put_console@plt>
jmp    111c <put_string+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_string>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <put_string+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <put_console@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <put_string+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @put_string(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = sext i8 %5 to i32
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = tail call i32 @put_console(i32 %7)
%10 = load i8, i8* %8
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ realloc(void *, int);
void *vector_realloc(void *old_ptr, int num) {
  void *new_ptr;
  new_ptr = (void *)realloc(old_ptr, num);
  if (!new_ptr) {
    printf("\nProblem with memory reallocation");
    printf(" \n%ul number of bytes \n", num);
    exit(1);
  }
  return new_ptr;
}


x86 assembly (clang, -O0):
<vector_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1183 <vector_realloc+0x53>
lea    0xe9f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xeb0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vector_realloc>:
push   %rbx
mov    %esi,%ebx
call   1040 <realloc@plt>
test   %rax,%rax
je     113f <vector_realloc+0xf>
pop    %rbx
ret
lea    0xeba(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xece(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"\0AProblem with memory reallocation\00"
@.str.1 = [24 x i8] c" \0A%ul number of bytes \0A\00"
define i8* @vector_realloc(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i64 @realloc(i8* %6, i32 %7)
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = icmp ne i8* %10, null
br i1 %11, label %17, label %12
12: ; preds = %2
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%14 = load i32, i32* %4
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %14)
%16 = call i32 @exit(i32 1)
unreachable
17: ; preds = %2
%18 = load i8*, i8** %5
ret i8* %18
}

LLVM IR (-O2):
@.str = [34 x i8] c"\0AProblem with memory reallocation\00"
@.str.1 = [24 x i8] c" \0A%ul number of bytes \0A\00"
define i8* @vector_realloc(i8* %0, i32 %1) {
%3 = tail call i64 @realloc(i8* %0, i32 %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %1)
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %2
%10 = inttoptr i64 %3 to i8*
ret i8* %10
}
void gtk_text_attributes_copy() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_attributes_copy() {
ret void
}
unsigned char APPL_StopOutputHandler(void) { return 0; }


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

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

LLVM IR (-O0):
define zeroext i8 @APPL_StopOutputHandler() {
ret i8 0
}

LLVM IR (-O2):
define zeroext i8 @APPL_StopOutputHandler() {
ret i8 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void *sse_test_thread(void *param) {
  int thr_no = (int)param;
  printf("Thread %d starting\n", thr_no);
  printf("SSE support not included (compiled)!\n");
  printf("Thread %d exiting\n", thr_no);
  return NULL;
}


x86 assembly (clang, -O0):
<sse_test_thread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xed3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xeee(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sse_test_thread>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeec(%rip),%rdi
call   1030 <puts@plt>
lea    0xecd(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Thread %d starting\0A\00"
@.str.1 = [38 x i8] c"SSE support not included (compiled)!\0A\00"
@.str.2 = [19 x i8] c"Thread %d exiting\0A\00"
define i8* @sse_test_thread(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = ptrtoint i8* %4 to i32
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
%9 = load i32, i32* %3
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 %9)
ret i8* null
}

LLVM IR (-O2):
@.str = [20 x i8] c"Thread %d starting\0A\00"
@.str.2 = [19 x i8] c"Thread %d exiting\0A\00"
@str = [37 x i8] c"SSE support not included (compiled)!\00"
define noalias i8* @sse_test_thread(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 %3)
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ myprint(char *);
__attribute__((constructor)) void beginB(void) { myprint("ctor b\n"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"ctor b\0A\00"
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @beginB, i8* null }]
define void @beginB() {
%1 = call i32 @myprint(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"ctor b\0A\00"
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @beginB, i8* null }]
define void @beginB() {
%1 = tail call i32 @myprint(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int cmp(void *n1, void *n2) {
  int num1 = (int)n1, num2 = (int)n2;
  printf("num1 %d num2 %d\n", num1, num2);
  if (num1 > num2) {
    return -1;
  } else if (num1 < num2) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<cmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%esi
mov    -0x20(%rbp),%edx
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jle    1158 <cmp+0x48>
movl   $0xffffffff,-0x4(%rbp)
jmp    117c <cmp+0x6c>
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    1170 <cmp+0x60>
movl   $0x1,-0x4(%rbp)
jmp    117c <cmp+0x6c>
jmp    1175 <cmp+0x65>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xedf(%rip),%rdi
mov    %ebx,%esi
mov    %r14d,%edx
call   1030 <printf@plt>
xor    %ecx,%ecx
cmp    %r14d,%ebx
setl   %cl
mov    $0xffffffff,%eax
cmovle %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [17 x i8] c"num1 %d num2 %d\0A\00"
define i32 @cmp(i8* %0, i8* %1) {
%3 = ptrtoint i8* %0 to i64
%4 = trunc i64 %3 to i32
%5 = ptrtoint i8* %1 to i64
%6 = trunc i64 %5 to i32
%7 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %6)
%8 = icmp sgt i32 %4, %6
%9 = icmp slt i32 %4, %6
%10 = zext i1 %9 to i32
%11 = select i1 %8, i32 -1, i32 %10
ret i32 %11
}
int iw_is_output_fmt_supported(int fmt) {
  switch (fmt) {
  case 3:
  case 4:
  case 5:
  case 8:
  case 11:
  case 10:
  case 9:
  case 12:
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<iw_is_output_fmt_supported>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
add    $0xfffffffd,%eax
sub    $0x3,%eax
jb     1132 <iw_is_output_fmt_supported+0x32>
jmp    111e <iw_is_output_fmt_supported+0x1e>
mov    -0xc(%rbp),%eax
add    $0xfffffff8,%eax
sub    $0x4,%eax
ja     113e <iw_is_output_fmt_supported+0x3e>
jmp    1132 <iw_is_output_fmt_supported+0x32>
movl   $0x1,-0x4(%rbp)
jmp    1145 <iw_is_output_fmt_supported+0x45>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iw_is_output_fmt_supported>:
add    $0xfffffffd,%edi
xor    %eax,%eax
cmp    $0x9,%edi
ja     1117 <iw_is_output_fmt_supported+0x17>
movslq %edi,%rax
lea    0xeec(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

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

LLVM IR (-O2):
@switch.table.iw_is_output_fmt_supported = [10 x i32] [i32 1, i32 1, i32 1, i32 0, i32 0, i32 1, i32 1, i32 1, i32 1, i32 1]
define i32 @iw_is_output_fmt_supported(i32 %0) {
%2 = add i32 %0, -3
%3 = icmp ult i32 %2, 10
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [10 x i32], [10 x i32]* @switch.table.iw_is_output_fmt_supported, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ 0, %1 ]
ret i32 %9
}
int flip(int toMove) {
  if (toMove == 1)
    return 2;
  else if (toMove == 2)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<flip>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    111d <flip+0x1d>
movl   $0x2,-0x4(%rbp)
jmp    113f <flip+0x3f>
cmpl   $0x2,-0x8(%rbp)
jne    1133 <flip+0x33>
movl   $0x1,-0x4(%rbp)
jmp    113f <flip+0x3f>
jmp    1138 <flip+0x38>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<flip>:
xor    %ecx,%ecx
cmp    $0x2,%edi
sete   %cl
cmp    $0x1,%edi
mov    $0x2,%eax
cmovne %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @flip(i32 %0) {
%2 = icmp eq i32 %0, 2
%3 = zext i1 %2 to i32
%4 = icmp eq i32 %0, 1
%5 = select i1 %4, i32 2, i32 %3
ret i32 %5
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t le_to_h_u24(const uint8_t *buf) {
  return (uint32_t)(buf[0] | buf[1] << 8 | buf[2] << 16);
}


x86 assembly (clang, -O0):
<le_to_h_u24>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x8(%rbp),%rcx
mov    0x4(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<le_to_h_u24>:
mov    0x4(%rdi),%ecx
mov    0x8(%rdi),%eax
shl    $0x8,%ecx
or     (%rdi),%ecx
shl    $0x10,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @le_to_h_u24(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = load i32*, i32** %2
%7 = getelementptr inbounds i32, i32* %6, i64 1
%8 = load i32, i32* %7
%9 = shl i32 %8, 8
%10 = or i32 %5, %9
%11 = load i32*, i32** %2
%12 = getelementptr inbounds i32, i32* %11, i64 2
%13 = load i32, i32* %12
%14 = shl i32 %13, 16
%15 = or i32 %10, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @le_to_h_u24(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = load i32, i32* %3
%5 = shl i32 %4, 8
%6 = or i32 %5, %2
%7 = getelementptr inbounds i32, i32* %0, i64 2
%8 = load i32, i32* %7
%9 = shl i32 %8, 16
%10 = or i32 %6, %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ strcmp(char const *, char *);
int parse_boolean(const char *boolean) {
  if (boolean != NULL && !strcmp(boolean, "true")) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<parse_boolean>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114c <parse_boolean+0x3c>
mov    -0x10(%rbp),%rdi
lea    0xece(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    114c <parse_boolean+0x3c>
movl   $0x1,-0x4(%rbp)
jmp    1153 <parse_boolean+0x43>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_boolean>:
test   %rdi,%rdi
je     112b <parse_boolean+0x1b>
push   %rax
lea    0xee3(%rip),%rsi
call   1030 <strcmp@plt>
test   %eax,%eax
lea    0x8(%rsp),%rsp
je     112e <parse_boolean+0x1e>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"true\00"
define i32 @parse_boolean(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 @strcmp(i8* %0, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i32 %4, 0
br i1 %5, label %7, label %6
6: ; preds = %3, %1
br label %7
7: ; preds = %3, %6
%8 = phi i32 [ 0, %6 ], [ 1, %3 ]
ret i32 %8
}
void INT_Excep_PERIB_INTB180(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_PERIB_INTB180() {
ret void
}
char *end_arg(str)
register char *str;
{
  while (*str != '\0')
    str++;
  return (str - 1);
}


x86 assembly (clang, -O0):
<end_arg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1129 <end_arg+0x29>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <end_arg+0x8>
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<end_arg>:
mov    %rdi,%rax
add    $0xfffffffffffffffe,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x2(%rax)
lea    0x1(%rax),%rax
jne    1110 <end_arg+0x10>
ret

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

LLVM IR (-O2):
define i8* @end_arg(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = getelementptr inbounds i8, i8* %3, i64 -1
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void warning(char *warning) { printf("%s", warning); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @warning(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
scalar_t__ size_div_check(size_t const, size_t const);
int size_div(size_t *z, const size_t x, const size_t y) {
  assert(z != NULL);
  if (size_div_check(x, y) != 0) {
    *z = x / y;
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<size_div>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <size_div_check@plt>
cmp    $0x0,%rax
je     117f <size_div+0x5f>
mov    -0x18(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x20(%rbp)
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x0,-0x4(%rbp)
jmp    1186 <size_div+0x66>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<size_div>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r15
mov    %rsi,%rbx
mov    %rdi,%r14
xor    %edi,%edi
test   %r14,%r14
setne  %dil
call   1040 <assert@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <size_div_check@plt>
test   %rax,%rax
je     1162 <size_div+0x42>
mov    %rbx,%rax
or     %r15,%rax
shr    $0x20,%rax
je     1169 <size_div+0x49>
mov    %rbx,%rax
xor    %edx,%edx
div    %r15
jmp    1170 <size_div+0x50>
mov    $0x1,%eax
jmp    1175 <size_div+0x55>
mov    %ebx,%eax
xor    %edx,%edx
div    %r15d
mov    %rax,(%r14)
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @size_div(i64* writeonly %0, i64 %1, i64 %2) {
%4 = icmp ne i64* %0, null
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = tail call i64 @size_div_check(i64 %1, i64 %2)
%8 = icmp eq i64 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %3
%10 = udiv i64 %1, %2
store i64 %10, i64* %0
br label %11
11: ; preds = %3, %9
%12 = phi i32 [ 0, %9 ], [ 1, %3 ]
ret i32 %12
}
/* Variables and functions */
scalar_t__ streq(char const *, char *);
bool is_word_in_lexicon(const char *word) {
  if (streq(word, "pirt")) {
    return false;
  }
  return true;
}


x86 assembly (clang, -O0):
<is_word_in_lexicon>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <streq@plt>
cmp    $0x0,%rax
je     1142 <is_word_in_lexicon+0x32>
movl   $0x0,-0x4(%rbp)
jmp    1149 <is_word_in_lexicon+0x39>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_word_in_lexicon>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <streq@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"pirt\00"
define i32 @is_word_in_lexicon(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i64 @streq(i8* %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %9
8: ; preds = %1
store i32 1, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
@.str = [5 x i8] c"pirt\00"
define i32 @is_word_in_lexicon(i8* %0) {
%2 = tail call i64 @streq(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int doubleToRawLongBits(double);
double longBitsToDouble(int);
double xfabs(double x) {
  return longBitsToDouble(0x7fffffffffffffffLL & doubleToRawLongBits(x));
}


x86 assembly (clang, -O0):
<xfabs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <doubleToRawLongBits@plt>
cltq
movabs $0x7fffffffffffffff,%rcx
ff ff 7f
and    %rcx,%rax
mov    %eax,%edi
call   1030 <longBitsToDouble@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xfabs>:
push   %rax
call   1040 <doubleToRawLongBits@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <longBitsToDouble@plt>

LLVM IR (-O0):
define double @xfabs(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @doubleToRawLongBits(double %3)
%5 = sext i32 %4 to i64
%6 = and i64 9223372036854775807, %5
%7 = trunc i64 %6 to i32
%8 = call double @longBitsToDouble(i32 %7)
ret double %8
}

LLVM IR (-O2):
define double @xfabs(double %0) {
%2 = tail call i32 @doubleToRawLongBits(double %0)
%3 = tail call double @longBitsToDouble(i32 %2)
ret double %3
}
int fun1301() { return 1301; }


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

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

LLVM IR (-O0):
define i32 @fun1301() {
ret i32 1301
}

LLVM IR (-O2):
define i32 @fun1301() {
ret i32 1301
}
/* Variables and functions */
int test_clock_direction();
int test_clock_jitter();
int main() {
  int failures = test_clock_jitter();
  if (failures == 0) {
    failures = test_clock_direction();
  }
  return failures;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <test_clock_jitter@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    114d <main+0x2d>
mov    $0x0,%al
call   1030 <test_clock_direction@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <test_clock_jitter@plt>
test   %eax,%eax
je     112e <main+0xe>
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
jmp    1030 <test_clock_direction@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @test_clock_jitter()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 (...) @test_clock_direction()
store i32 %7, i32* %2
br label %8
8: ; preds = %6, %0
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_clock_jitter()
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @test_clock_direction()
br label %5
5: ; preds = %3, %0
%6 = phi i32 [ %4, %3 ], [ %1, %0 ]
ret i32 %6
}
void ubi_dbg_dump_sv(const struct ubi_scan_volume *sv) { return; }


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

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

LLVM IR (-O0):
%struct.ubi_scan_volume = type opaque
define void @ubi_dbg_dump_sv(%struct.ubi_scan_volume* %0) {
%2 = alloca %struct.ubi_scan_volume*
store %struct.ubi_scan_volume* %0, %struct.ubi_scan_volume** %2
ret void
}

LLVM IR (-O2):
%struct.ubi_scan_volume = type opaque
define void @ubi_dbg_dump_sv(%struct.ubi_scan_volume* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ test_count();
int main() {
  int counter = 0;
  if (!test_count()) {
    counter++;
    printf("Count test failed!\n");
  }
  printf("%d tests failed!\n", counter);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <test_count@plt>
cmp    $0x0,%eax
jne    115d <main+0x3d>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <test_count@plt>
test   %eax,%eax
jne    114f <main+0x1f>
lea    0xecd(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%ebx
lea    0xeaa(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Count test failed!\0A\00"
@.str.1 = [18 x i8] c"%d tests failed!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = call i32 (...) @test_count()
%4 = icmp ne i32 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %0
%6 = load i32, i32* %2
%7 = add nsw i32 %6, 1
store i32 %7, i32* %2
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %5, %0
%10 = load i32, i32* %2
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %10)
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
@.str.1 = [18 x i8] c"%d tests failed!\0A\00"
@str = [19 x i8] c"Count test failed!\00"
define i32 @main() {
%1 = tail call i32 (...) @test_count()
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
%6 = phi i32 [ 0, %0 ], [ 1, %3 ]
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}
void reader() { ; }


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

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

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

LLVM IR (-O2):
define void @reader() {
ret void
}
void system_init(void) {}


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

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

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

LLVM IR (-O2):
define void @system_init() {
ret void
}
int priority(char elem) {
  switch (elem) {
  case 'f':
    return 0;
  case '(':
    return 1;
  case '+':
  case '-':
    return 2;
  case '*':
  case '/':
    return 3;
  }
}


x86 assembly (clang, -O0):
<priority>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x28,%eax
je     1180 <priority+0x80>
jmp    111f <priority+0x1f>
mov    -0xc(%rbp),%eax
sub    $0x2a,%eax
je     1198 <priority+0x98>
jmp    1130 <priority+0x30>
mov    -0xc(%rbp),%eax
sub    $0x2b,%eax
je     118c <priority+0x8c>
jmp    1141 <priority+0x41>
mov    -0xc(%rbp),%eax
sub    $0x2d,%eax
je     118c <priority+0x8c>
jmp    1152 <priority+0x52>
mov    -0xc(%rbp),%eax
sub    $0x2f,%eax
je     1198 <priority+0x98>
jmp    1163 <priority+0x63>
mov    -0xc(%rbp),%eax
sub    $0x66,%eax
jne    119f <priority+0x9f>
jmp    1174 <priority+0x74>
movl   $0x0,-0x4(%rbp)
jmp    119f <priority+0x9f>
movl   $0x1,-0x4(%rbp)
jmp    119f <priority+0x9f>
movl   $0x2,-0x4(%rbp)
jmp    119f <priority+0x9f>
movl   $0x3,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<priority>:
add    $0xffffffd8,%edi
xor    %eax,%eax
cmp    $0x7,%edi
ja     1117 <priority+0x17>
movslq %edi,%rax
lea    0xeec(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @priority(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
switch i32 %5, label %10 [
i32 102, label %6
i32 40, label %7
i32 43, label %8
i32 45, label %8
i32 42, label %9
i32 47, label %9
]
6: ; preds = %1
store i32 0, i32* %2
br label %10
7: ; preds = %1
store i32 1, i32* %2
br label %10
8: ; preds = %1, %1
store i32 2, i32* %2
br label %10
9: ; preds = %1, %1
store i32 3, i32* %2
br label %10
10: ; preds = %6, %7, %8, %9, %1
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
@switch.table.priority = [8 x i32] [i32 1, i32 0, i32 3, i32 2, i32 0, i32 2, i32 0, i32 3]
define i32 @priority(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add nsw i32 %2, -40
%4 = icmp ult i32 %3, 8
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = sext i32 %3 to i64
%7 = getelementptr inbounds [8 x i32], [8 x i32]* @switch.table.priority, i64 0, i64 %6
%8 = load i32, i32* %7
br label %9
9: ; preds = %5, %1
%10 = phi i32 [ 0, %1 ], [ %8, %5 ]
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ wint_t;

/* Variables and functions */
int isblank(int /*<<< orphan*/);
int iswblank(wint_t wc) { return isblank(wc); }


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

x86 assembly (clang, -O2):
<iswblank>:
jmp    1030 <isblank@plt>

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

LLVM IR (-O2):
define i32 @iswblank(i32 %0) {
%2 = tail call i32 @isblank(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
int *thread_check(int threads) {
  if (threads <= 0) {
    printf("\nERROR: Threads must be >= 1\n\n");
    exit(-1);
  }
}


x86 assembly (clang, -O0):
<thread_check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jg     114b <thread_check+0x2b>
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread_check>:
test   %edi,%edi
jle    1125 <thread_check+0x5>
ret
push   %rax
lea    0xed3(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"\0AERROR: Threads must be >= 1\0A\0A\00"
define i32* @thread_check(i32 %0) {
%2 = alloca i32*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sle i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @exit(i32 -1)
unreachable
9: ; preds = %1
%10 = load i32*, i32** %2
ret i32* %10
}

LLVM IR (-O2):
@str = [30 x i8] c"\0AERROR: Threads must be >= 1\0A\00"
define noalias i32* @thread_check(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @exit(i32 -1)
unreachable
6: ; preds = %1
ret i32* undef
}
/* Variables and functions */
char *app_version_long();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ license();
int /*<<< orphan*/ printf(char *, char *);
void version(void) {
  printf("CPU_TEST for ARM version %s\n\n", app_version_long());
  license();
  exit(0);
}


x86 assembly (clang, -O0):
<version>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <app_version_long@plt>
mov    %rax,%rsi
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <license@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<version>:
push   %rax
xor    %eax,%eax
call   1060 <app_version_long@plt>
lea    0xeb1(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <license@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"CPU_TEST for ARM version %s\0A\0A\00"
define void @version() {
%1 = call i8* (...) @app_version_long()
%2 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = call i32 (...) @license()
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [30 x i8] c"CPU_TEST for ARM version %s\0A\0A\00"
define void @version() {
%1 = tail call i8* (...) @app_version_long()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = tail call i32 (...) @license()
%4 = tail call i32 @exit(i32 0)
unreachable
}
void xio_timers_list_post_dispatch(struct xio_timers_list *timers_list,
                                   struct xio_timers_list_entry *tentry) {}


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

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

LLVM IR (-O0):
%struct.xio_timers_list = type opaque
%struct.xio_timers_list_entry = type opaque
define void @xio_timers_list_post_dispatch(%struct.xio_timers_list* %0, %struct.xio_timers_list_entry* %1) {
%3 = alloca %struct.xio_timers_list*
%4 = alloca %struct.xio_timers_list_entry*
store %struct.xio_timers_list* %0, %struct.xio_timers_list** %3
store %struct.xio_timers_list_entry* %1, %struct.xio_timers_list_entry** %4
ret void
}

LLVM IR (-O2):
%struct.xio_timers_list = type opaque
%struct.xio_timers_list_entry = type opaque
define void @xio_timers_list_post_dispatch(%struct.xio_timers_list* nocapture %0, %struct.xio_timers_list_entry* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
char *malloc(int);
int /*<<< orphan*/ stderr;
int main() {
  __attribute__((unused)) char *p = malloc(1);
  char *b1 = malloc(128);
  char *b2 = malloc(128);
  fprintf(stderr, "b1 %p b2 %p\n", b1, b2);
  b1[127 + 70] = 'a';
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    $0x80,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    $0x80,%edi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    0x2e80(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
lea    0xe8f(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x18(%rbp),%rax
movb   $0x61,0xc5(%rax)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x80,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    $0x80,%edi
call   1040 <malloc@plt>
mov    0x2ea1(%rip),%rcx
mov    (%rcx),%edi
lea    0xeb8(%rip),%rsi
mov    %rbx,%rdx
mov    %rax,%rcx
call   1030 <fprintf@plt>
movb   $0x61,0xc5(%rbx)
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [13 x i8] c"b1 %p b2 %p\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i32 0, i32* %1
%5 = call i8* @malloc(i32 1)
store i8* %5, i8** %2
%6 = call i8* @malloc(i32 128)
store i8* %6, i8** %3
%7 = call i8* @malloc(i32 128)
store i8* %7, i8** %4
%8 = load i32, i32* @stderr
%9 = load i8*, i8** %3
%10 = load i8*, i8** %4
%11 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %9, i8* %10)
%12 = load i8*, i8** %3
%13 = getelementptr inbounds i8, i8* %12, i64 197
store i8 97, i8* %13
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [13 x i8] c"b1 %p b2 %p\0A\00"
define i32 @main() {
%1 = tail call dereferenceable_or_null(128) i8* @malloc(i32 128)
%2 = tail call dereferenceable_or_null(128) i8* @malloc(i32 128)
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2)
%5 = getelementptr inbounds i8, i8* %1, i64 197
store i8 97, i8* %5
ret i32 0
}
int getTXchannel(char *name) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @getTXchannel(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void hello_function(const char *ptr) { printf("%s", ptr); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @hello_function(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
unsigned char *protocol_data();
unsigned char *getReplyData_Protocol() { return protocol_data(); }


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

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

LLVM IR (-O0):
define i8* @getReplyData_Protocol() {
%1 = call i8* (...) @protocol_data()
ret i8* %1
}

LLVM IR (-O2):
define i8* @getReplyData_Protocol() {
%1 = tail call i8* (...) @protocol_data()
ret i8* %1
}
void YMF278B_sh_stop(void) {}


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

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

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

LLVM IR (-O2):
define void @YMF278B_sh_stop() {
ret void
}
void __eabi() {}


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

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

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

LLVM IR (-O2):
define void @__eabi() {
ret void
}
/* Variables and functions */
int tuner_get_rssi(void *, unsigned short, int *);
int bbm_com_tuner_get_rssi(void *handle, unsigned short devid, int *rssi) {
  int res;
  res = tuner_get_rssi(handle, devid, rssi);
  return res;
}


x86 assembly (clang, -O0):
<bbm_com_tuner_get_rssi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xa(%rbp),%ax
mov    -0x18(%rbp),%rdx
movzwl %ax,%esi
call   1030 <tuner_get_rssi@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bbm_com_tuner_get_rssi>:
jmp    1030 <tuner_get_rssi@plt>

LLVM IR (-O0):
define i32 @bbm_com_tuner_get_rssi(i8* %0, i16 zeroext %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i16
%6 = alloca i32*
%7 = alloca i32
store i8* %0, i8** %4
store i16 %1, i16* %5
store i32* %2, i32** %6
%8 = load i8*, i8** %4
%9 = load i16, i16* %5
%10 = load i32*, i32** %6
%11 = call i32 @tuner_get_rssi(i8* %8, i16 zeroext %9, i32* %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
ret i32 %12
}

LLVM IR (-O2):
define i32 @bbm_com_tuner_get_rssi(i8* %0, i16 zeroext %1, i32* %2) {
%4 = tail call i32 @tuner_get_rssi(i8* %0, i16 zeroext %1, i32* %2)
ret i32 %4
}
char *hash_plugin_detailed(void) {
  return ("oscommerce - A md5(salt,password) module\n"
          "------------------------\n"
          "Use this module to crack simple md5(salt,password) hashes\n"
          "Input should be in form: \'user:hash:salt\' od just \'hash:salt\'\n"
          "Software that uses that password hashing method:\n"
          "osCommerce, AEF, Magento\n"
          "\nAuthor: Milen Rangelov <gat3way@gat3way.eu>\n");
}


x86 assembly (clang, -O0):
<hash_plugin_detailed>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_plugin_detailed>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [306 x i8] c"oscommerce - A md5(salt,password) module\0A------------------------\0AUse this module to crack simple md5(salt,password) hashes\0AInput should be in form: 'user:hash:salt' od just 'hash:salt'\0ASoftware that uses that password hashing method:\0AosCommerce, AEF, Magento\0A\0AAuthor: Milen Rangelov <gat3way@gat3way.eu>\0A\00"
define i8* @hash_plugin_detailed() {
ret i8* getelementptr inbounds ([306 x i8], [306 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [306 x i8] c"oscommerce - A md5(salt,password) module\0A------------------------\0AUse this module to crack simple md5(salt,password) hashes\0AInput should be in form: 'user:hash:salt' od just 'hash:salt'\0ASoftware that uses that password hashing method:\0AosCommerce, AEF, Magento\0A\0AAuthor: Milen Rangelov <gat3way@gat3way.eu>\0A\00"
define i8* @hash_plugin_detailed() {
ret i8* getelementptr inbounds ([306 x i8], [306 x i8]* @.str, i64 0, i64 0)
}