xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M240_f(char *s) {
  debug("M240_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M240_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):
<M240_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"M240_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M240_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"M240_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M240_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
}
/* Variables and functions */
scalar_t__ write(int, int *, int);
int write_int4(int f, int i) { return write(f, &i, 4) > 0; }


x86 assembly (clang, -O0):
<write_int4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
mov    $0x4,%edx
call   1030 <write@plt>
cmp    $0x0,%rax
setg   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_int4>:
push   %rax
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
call   1030 <write@plt>
xor    %ecx,%ecx
test   %rax,%rax
setg   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @write_int4(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = call i64 @write(i32 %5, i32* %4, i32 4)
%7 = icmp sgt i64 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @write_int4(i32 %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = call i64 @write(i32 %0, i32* %3, i32 4)
%5 = icmp sgt i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
int main() {
  ;
  ;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void *wrap_printf_int(void *data) {
  int *i = (int *)data;
  printf("%d\n", *i);
  return data;
}


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

x86 assembly (clang, -O2):
<wrap_printf_int>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%esi
lea    0xee3(%rip),%rdi
call   1030 <printf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i8* @wrap_printf_int(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i8* @wrap_printf_int(i8* returned %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void printUsage(char *fname) {
  printf("\nUsage:\n"
         "   %s <input file> <output directory>\n",
         fname);
}


x86 assembly (clang, -O0):
<printUsage>:
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):
<printUsage>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [47 x i8] c"\0AUsage:\0A %s <input file> <output directory>\0A\00"
define void @printUsage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [47 x i8] c"\0AUsage:\0A %s <input file> <output directory>\0A\00"
define void @printUsage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int rand();
int funRand(int MaxRand) {
  int iRandOut = 0;
  iRandOut = rand() % MaxRand;
  return iRandOut;
}


x86 assembly (clang, -O0):
<funRand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
cltd
idivl  -0x4(%rbp)
mov    %edx,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<funRand>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
cltd
idiv   %ebx
mov    %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @funRand(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = call i32 (...) @rand()
%5 = load i32, i32* %2
%6 = srem i32 %4, %5
store i32 %6, i32* %3
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @funRand(i32 %0) {
%2 = tail call i32 (...) @rand()
%3 = srem i32 %2, %0
ret i32 %3
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ send_event;
};
typedef TYPE_1__ XDestroyWindowEvent;

/* Variables and functions */
int get_XDestroyWindowEvent_send_event(void *_p) {
  return (int)((XDestroyWindowEvent *)_p)->send_event;
}


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

x86 assembly (clang, -O2):
<get_XDestroyWindowEvent_send_event>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XDestroyWindowEvent_send_event(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XDestroyWindowEvent_send_event(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
int put2(const char *string) {
  int count = 0;
  while (*string) {
    putchar(*string++);
    count++;
  }
  putchar('\n');
  return (count);
}


x86 assembly (clang, -O0):
<put2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1155 <put2+0x45>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <putchar@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <put2+0x13>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<put2>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     1138 <put2+0x28>
mov    %rdi,%r14
xor    %ebx,%ebx
nop
movsbl %al,%edi
call   1030 <putchar@plt>
movzbl 0x1(%r14,%rbx,1),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <put2+0x10>
jmp    113a <put2+0x2a>
xor    %ebx,%ebx
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @put2(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %11, %4 ], [ %2, %1 ]
%6 = phi i32 [ %10, %4 ], [ 0, %1 ]
%7 = phi i8* [ %8, %4 ], [ %0, %1 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = tail call i32 @putchar(i8 signext %5)
%10 = add nuw nsw i32 %6, 1
%11 = load i8, i8* %8
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %1
%14 = phi i32 [ 0, %1 ], [ %10, %4 ]
%15 = tail call i32 @putchar(i8 signext 10)
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ write_number_to_buffer(void *, unsigned short, int);
void write_halfword_to_buffer(void *buffer, unsigned short number) {
  write_number_to_buffer(buffer, number, 2);
}


x86 assembly (clang, -O0):
<write_halfword_to_buffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2,%edx
movzwl -0xa(%rbp),%esi
call   1030 <write_number_to_buffer@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_halfword_to_buffer>:
mov    $0x2,%edx
jmp    1030 <write_number_to_buffer@plt>

LLVM IR (-O0):
define void @write_halfword_to_buffer(i8* %0, i16 zeroext %1) {
%3 = alloca i8*
%4 = alloca i16
store i8* %0, i8** %3
store i16 %1, i16* %4
%5 = load i8*, i8** %3
%6 = load i16, i16* %4
%7 = call i32 @write_number_to_buffer(i8* %5, i16 zeroext %6, i32 2)
ret void
}

LLVM IR (-O2):
define void @write_halfword_to_buffer(i8* %0, i16 zeroext %1) {
%3 = tail call i32 @write_number_to_buffer(i8* %0, i16 zeroext %1, i32 2)
ret void
}
__attribute__((always_)) int
variable_test_bit(int nr, const volatile unsigned long *addr) {
  int oldbit;
  __asm__ __volatile__("btl %2,%1\n\tsbbl %0,%0"
                       : "=r"(oldbit)
                       : "m"((*(volatile long *)addr)), "Ir"(nr));
  return oldbit;
}


x86 assembly (clang, -O0):
<variable_test_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
bt     %ecx,(%rax)
sbb    %eax,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<variable_test_bit>:
bt     %edi,(%rsi)
sbb    %eax,%eax
ret

LLVM IR (-O0):
define i32 @variable_test_bit(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64*
%5 = alloca i32
store i32 %0, i32* %3
store i64* %1, i64** %4
%6 = load i64*, i64** %4
%7 = load i32, i32* %3
%8 = call i32 asm sideeffect "btl $2,$1\0A\09sbbl $0,$0", "=r,*m,Ir,~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %6, i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
define i32 @variable_test_bit(i32 %0, i64* %1) {
%3 = tail call i32 asm sideeffect "btl $2,$1\0A\09sbbl $0,$0", "=r,*m,Ir,~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %1, i32 %0)
ret i32 %3
}
void foo303() {}


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

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

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

LLVM IR (-O2):
define void @foo303() {
ret void
}
const char *Get_Name(void) { return "Get"; }


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"Get\00"
define i8* @Get_Name() {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [4 x i8] c"Get\00"
define i8* @Get_Name() {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
struct tslib_module_info {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct tslib_module_info *);
int threshold_fini(struct tslib_module_info *info) { free(info); }


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

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

LLVM IR (-O0):
%struct.tslib_module_info = type { i32 }
define i32 @threshold_fini(%struct.tslib_module_info* %0) {
%2 = alloca i32
%3 = alloca %struct.tslib_module_info*
store %struct.tslib_module_info* %0, %struct.tslib_module_info** %3
%4 = load %struct.tslib_module_info*, %struct.tslib_module_info** %3
%5 = call i32 @free(%struct.tslib_module_info* %4)
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
%struct.tslib_module_info = type { i32 }
define i32 @threshold_fini(%struct.tslib_module_info* nocapture %0) {
%2 = tail call i32 @free(%struct.tslib_module_info* %0)
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct timeval {
  int /*<<< orphan*/ tv_sec;
};

/* Variables and functions */
scalar_t__ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
time_t time(time_t *t) {
  struct timeval tv;
  if (gettimeofday(&tv, NULL) < 0)
    return ((time_t)-1);
  if (t)
    *t = tv.tv_sec;
  return tv.tv_sec;
}


x86 assembly (clang, -O0):
<time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
cmp    $0x0,%rax
jge    113f <time+0x2f>
movl   $0xffffffff,-0x4(%rbp)
jmp    1159 <time+0x49>
cmpq   $0x0,-0x10(%rbp)
je     1153 <time+0x43>
mov    -0x18(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<time>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
test   %rax,%rax
js     1136 <time+0x26>
mov    0x8(%rsp),%eax
test   %rbx,%rbx
je     113b <time+0x2b>
mov    %eax,(%rbx)
jmp    113b <time+0x2b>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timeval = type { i32 }
define i32 @time(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca %struct.timeval
store i32* %0, i32** %3
%5 = call i64 @gettimeofday(%struct.timeval* %4, i32* null)
%6 = icmp slt i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 -1, i32* %2
br label %18
8: ; preds = %1
%9 = load i32*, i32** %3
%10 = icmp ne i32* %9, null
br i1 %10, label %11, label %15
11: ; preds = %8
%12 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i32 0, i32 0
%13 = load i32, i32* %12
%14 = load i32*, i32** %3
store i32 %13, i32* %14
br label %15
15: ; preds = %11, %8
%16 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i32 0, i32 0
%17 = load i32, i32* %16
store i32 %17, i32* %2
br label %18
18: ; preds = %15, %7
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define i32 @time(i32* writeonly %0) {
%2 = alloca %struct.timeval
%3 = bitcast %struct.timeval* %2 to i8*
%4 = call i64 @gettimeofday(%struct.timeval* %2, i32* null)
%5 = icmp slt i64 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %1
%7 = icmp eq i32* %0, null
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 0
%9 = load i32, i32* %8
br i1 %7, label %11, label %10
10: ; preds = %6
store i32 %9, i32* %0
br label %11
11: ; preds = %6, %10, %1
%12 = phi i32 [ -1, %1 ], [ %9, %10 ], [ %9, %6 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ debuglog(char *, ...);
int /*<<< orphan*/ do_clear(char const *);
int /*<<< orphan*/ siglock();
int /*<<< orphan*/ sigunlock();
void notify(const char *hostname, const int state) {
  debuglog("notify from %s, new state %d", hostname, state);
  siglock();
  do_clear(hostname);
  sigunlock();
  debuglog("Leaving notify\n");
}


x86 assembly (clang, -O0):
<notify>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1060 <debuglog@plt>
mov    $0x0,%al
call   1030 <siglock@plt>
mov    -0x8(%rbp),%rdi
call   1040 <do_clear@plt>
mov    $0x0,%al
call   1050 <sigunlock@plt>
lea    0xe9b(%rip),%rdi
mov    $0x0,%al
call   1060 <debuglog@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<notify>:
push   %rbx
mov    %esi,%edx
mov    %rdi,%rbx
lea    0xeb3(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <debuglog@plt>
xor    %eax,%eax
call   1030 <siglock@plt>
mov    %rbx,%rdi
call   1040 <do_clear@plt>
xor    %eax,%eax
call   1050 <sigunlock@plt>
lea    0xea9(%rip),%rdi
xor    %eax,%eax
pop    %rbx
jmp    1060 <debuglog@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"notify from %s, new state %d\00"
@.str.1 = [16 x i8] c"Leaving notify\0A\00"
define void @notify(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 (i8*, ...) @debuglog(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %5, i32 %6)
%8 = call i32 (...) @siglock()
%9 = load i8*, i8** %3
%10 = call i32 @do_clear(i8* %9)
%11 = call i32 (...) @sigunlock()
%12 = call i32 (i8*, ...) @debuglog(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"notify from %s, new state %d\00"
@.str.1 = [16 x i8] c"Leaving notify\0A\00"
define void @notify(i8* %0, i32 %1) {
%3 = tail call i32 (i8*, ...) @debuglog(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
%4 = tail call i32 (...) @siglock()
%5 = tail call i32 @do_clear(i8* %0)
%6 = tail call i32 (...) @sigunlock()
%7 = tail call i32 (i8*, ...) @debuglog(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void retro_init(void) {}


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

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

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

LLVM IR (-O2):
define void @retro_init() {
ret void
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int c, x;
  x = __VERIFIER_nondet_int();
  c = __VERIFIER_nondet_int();
  if (c >= 2) {
    while (x + c >= 0) {
      x = x - c;
      c = c + 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jl     116d <main+0x5d>
jmp    1142 <main+0x32>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
cmp    $0x0,%eax
jl     1168 <main+0x58>
mov    -0xc(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1142 <main+0x32>
jmp    116d <main+0x5d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ conio_init();
void caca_conio_lowvideo(void) { conio_init(); }


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

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

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

LLVM IR (-O2):
define void @caca_conio_lowvideo() {
%1 = tail call i32 (...) @conio_init()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, int, int, char const *,
                          char const *);
void createMsgError(int error, const char *type, int mark,
                    const char *functionName, const char *file) {
  printf(
      "Error  \n type: %s \n code: %d\n line: %d\n function: %s\n file: %s\n",
      type, error, mark, functionName, file);
}


x86 assembly (clang, -O0):
<createMsgError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x4(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<createMsgError>:
mov    %r8,%r9
mov    %rcx,%r8
mov    %edx,%ecx
mov    %edi,%edx
lea    0xedf(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [64 x i8] c"Error \0A type: %s \0A code: %d\0A line: %d\0A function: %s\0A file: %s\0A\00"
define void @createMsgError(i32 %0, i8* %1, i32 %2, i8* %3, i8* %4) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i8*
store i32 %0, i32* %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store i8* %3, i8** %9
store i8* %4, i8** %10
%11 = load i8*, i8** %7
%12 = load i32, i32* %6
%13 = load i32, i32* %8
%14 = load i8*, i8** %9
%15 = load i8*, i8** %10
%16 = call i32 @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0), i8* %11, i32 %12, i32 %13, i8* %14, i8* %15)
ret void
}

LLVM IR (-O2):
@.str = [64 x i8] c"Error \0A type: %s \0A code: %d\0A line: %d\0A function: %s\0A file: %s\0A\00"
define void @createMsgError(i32 %0, i8* %1, i32 %2, i8* %3, i8* %4) {
%6 = tail call i32 @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %0, i32 %2, i8* %3, i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_thr_pool_destroy();
int main(void) {
  test_thr_pool_destroy();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <test_thr_pool_destroy@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <test_thr_pool_destroy@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_thr_pool_destroy()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_thr_pool_destroy()
ret i32 0
}
/* Variables and functions */
char *lltoa(int, char *, int);
char *itoa(int value, char *str, int base) { return lltoa(value, str, base); }


x86 assembly (clang, -O0):
<itoa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <lltoa@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<itoa>:
jmp    1030 <lltoa@plt>

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

LLVM IR (-O2):
define i8* @itoa(i32 %0, i8* %1, i32 %2) {
%4 = tail call i8* @lltoa(i32 %0, i8* %1, i32 %2)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ CANBaseValid(unsigned long);
int CANRegRead(unsigned long);
int /*<<< orphan*/ CANRegWrite(unsigned long, int);
int /*<<< orphan*/ DEBUG_ASSERT(int /*<<< orphan*/);
void CANEnable(unsigned long ulBase) {
  DEBUG_ASSERT(CANBaseValid(ulBase));
  CANRegWrite(ulBase + 0x00000000,
              CANRegRead(ulBase + 0x00000000) & ~0x00000001);
}


x86 assembly (clang, -O0):
<CANEnable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <CANBaseValid@plt>
mov    %eax,%edi
call   1050 <DEBUG_ASSERT@plt>
mov    -0x8(%rbp),%rax
add    $0x0,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x0,%rdi
call   1040 <CANRegRead@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
and    $0xfffffffe,%esi
call   1030 <CANRegWrite@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CANEnable>:
push   %rbx
mov    %rdi,%rbx
call   1060 <CANBaseValid@plt>
mov    %eax,%edi
call   1050 <DEBUG_ASSERT@plt>
mov    %rbx,%rdi
call   1040 <CANRegRead@plt>
and    $0xfffffffe,%eax
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <CANRegWrite@plt>

LLVM IR (-O0):
define void @CANEnable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @CANBaseValid(i64 %3)
%5 = call i32 @DEBUG_ASSERT(i32 %4)
%6 = load i64, i64* %2
%7 = add i64 %6, 0
%8 = load i64, i64* %2
%9 = add i64 %8, 0
%10 = call i32 @CANRegRead(i64 %9)
%11 = and i32 %10, -2
%12 = call i32 @CANRegWrite(i64 %7, i32 %11)
ret void
}

LLVM IR (-O2):
define void @CANEnable(i64 %0) {
%2 = tail call i32 @CANBaseValid(i64 %0)
%3 = tail call i32 @DEBUG_ASSERT(i32 %2)
%4 = tail call i32 @CANRegRead(i64 %0)
%5 = and i32 %4, -2
%6 = tail call i32 @CANRegWrite(i64 %0, i32 %5)
ret void
}
/* Variables and functions */
void *calloc(int, int);
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ memcpy(void *, void *, int);
void *mem_double(void *ptr, int size) {
  void *newptr;
  newptr = calloc(2 * size, 1);
  if (newptr == NULL) {
    return NULL;
  }
  memcpy(newptr, ptr, size);
  free(ptr);
  return newptr;
}


x86 assembly (clang, -O0):
<mem_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x14(%rbp),%edi
shl    $0x1,%edi
mov    $0x1,%esi
call   1040 <calloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    116b <mem_double+0x3b>
movq   $0x0,-0x8(%rbp)
jmp    118c <mem_double+0x5c>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1050 <memcpy@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_double>:
push   %r15
push   %r14
push   %rbx
mov    %esi,%r15d
mov    %rdi,%r14
lea    (%r15,%r15,1),%edi
mov    $0x1,%esi
call   1040 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1167 <mem_double+0x37>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15d,%edx
call   1050 <memcpy@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @mem_double(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
%7 = load i32, i32* %5
%8 = mul nsw i32 2, %7
%9 = call i8* @calloc(i32 %8, i32 1)
store i8* %9, i8** %6
%10 = load i8*, i8** %6
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %13
12: ; preds = %2
store i8* null, i8** %3
br label %21
13: ; preds = %2
%14 = load i8*, i8** %6
%15 = load i8*, i8** %4
%16 = load i32, i32* %5
%17 = call i32 @memcpy(i8* %14, i8* %15, i32 %16)
%18 = load i8*, i8** %4
%19 = call i32 @free(i8* %18)
%20 = load i8*, i8** %6
store i8* %20, i8** %3
br label %21
21: ; preds = %13, %12
%22 = load i8*, i8** %3
ret i8* %22
}

LLVM IR (-O2):
define i8* @mem_double(i8* %0, i32 %1) {
%3 = shl nsw i32 %1, 1
%4 = tail call i8* @calloc(i32 %3, i32 1)
%5 = icmp eq i8* %4, null
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = tail call i32 @memcpy(i8* %4, i8* %0, i32 %1)
%8 = tail call i32 @free(i8* %0)
br label %9
9: ; preds = %2, %6
ret i8* %4
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void ux00ddr_enablewriteleveling(size_t ahbregaddr) {
  (*(volatile uint32_t *)((170 << 2) + (ahbregaddr))) |= ((1 << 0) | (1 << 24));
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x2a8,%rax
mov    (%rax),%ecx
or     $0x1000001,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
orl    $0x1000001,0x2a8(%rdi)
ret

LLVM IR (-O0):
define void @ux00ddr_enablewriteleveling(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 680, %3
%5 = inttoptr i64 %4 to i32*
%6 = load volatile i32, i32* %5
%7 = or i32 %6, 16777217
store volatile i32 %7, i32* %5
ret void
}

LLVM IR (-O2):
define void @ux00ddr_enablewriteleveling(i64 %0) {
%2 = add i64 %0, 680
%3 = inttoptr i64 %2 to i32*
%4 = load volatile i32, i32* %3
%5 = or i32 %4, 16777217
store volatile i32 %5, i32* %3
ret void
}
/* Variables and functions */
size_t rb_scan_args_hash_idx(char const *);
int rb_scan_args_f_hash(const char *fmt) {
  return (fmt[rb_scan_args_hash_idx(fmt)] == ':');
}


x86 assembly (clang, -O0):
<rb_scan_args_f_hash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <rb_scan_args_hash_idx@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
movsbl (%rax,%rcx,1),%eax
cmp    $0x3a,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rb_scan_args_f_hash>:
push   %rbx
mov    %rdi,%rbx
call   1030 <rb_scan_args_hash_idx@plt>
xor    %ecx,%ecx
cmpb   $0x3a,(%rbx,%rax,1)
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @rb_scan_args_f_hash(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @rb_scan_args_hash_idx(i8* %4)
%6 = getelementptr inbounds i8, i8* %3, i64 %5
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 58
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @rb_scan_args_f_hash(i8* %0) {
%2 = tail call i64 @rb_scan_args_hash_idx(i8* %0)
%3 = getelementptr inbounds i8, i8* %0, i64 %2
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 58
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ EX_OSERR;
int /*<<< orphan*/ pfpanic(char *, unsigned short, unsigned short, char const *,
                           char const *, int, int, int /*<<< orphan*/);
void __pfpanic_pselect(unsigned short _syslog, unsigned short _verbose,
                       const char *_function_name, const char *_file_name,
                       int _line_number, int _errno) {
  pfpanic("Error occurred while doing pselect()", _syslog, _verbose,
          _function_name, _file_name, _line_number, _errno, EX_OSERR);
}


x86 assembly (clang, -O0):
<__pfpanic_pselect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %si,%ax
mov    %di,%si
mov    %si,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
mov    -0x2(%rbp),%si
mov    -0x4(%rbp),%dx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
mov    -0x1c(%rbp),%r9d
mov    -0x20(%rbp),%r10d
mov    0x2e8b(%rip),%rax
mov    (%rax),%eax
lea    0xea2(%rip),%rdi
movzwl %si,%esi
movzwl %dx,%edx
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
call   1030 <pfpanic@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__pfpanic_pselect>:
push   %rax
mov    %r9d,%r10d
mov    %r8d,%r9d
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %esi,%edx
mov    %edi,%esi
mov    0x2eb8(%rip),%rdi
mov    (%rdi),%eax
lea    0xecf(%rip),%rdi
push   %rax
push   %r10
call   1030 <pfpanic@plt>
add    $0x10,%rsp
pop    %rax
ret

LLVM IR (-O0):
@.str = [37 x i8] c"Error occurred while doing pselect()\00"
@EX_OSERR = global i32 0
define void @__pfpanic_pselect(i16 zeroext %0, i16 zeroext %1, i8* %2, i8* %3, i32 %4, i32 %5) {
%7 = alloca i16
%8 = alloca i16
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i32
store i16 %0, i16* %7
store i16 %1, i16* %8
store i8* %2, i8** %9
store i8* %3, i8** %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%13 = load i16, i16* %7
%14 = load i16, i16* %8
%15 = load i8*, i8** %9
%16 = load i8*, i8** %10
%17 = load i32, i32* %11
%18 = load i32, i32* %12
%19 = load i32, i32* @EX_OSERR
%20 = call i32 @pfpanic(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i16 zeroext %13, i16 zeroext %14, i8* %15, i8* %16, i32 %17, i32 %18, i32 %19)
ret void
}

LLVM IR (-O2):
@.str = [37 x i8] c"Error occurred while doing pselect()\00"
@EX_OSERR = global i32 0
define void @__pfpanic_pselect(i16 zeroext %0, i16 zeroext %1, i8* %2, i8* %3, i32 %4, i32 %5) {
%7 = load i32, i32* @EX_OSERR
%8 = tail call i32 @pfpanic(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i16 zeroext %0, i16 zeroext %1, i8* %2, i8* %3, i32 %4, i32 %5, i32 %7)
ret void
}
/* Variables and functions */
char *strdup(char *);
char *print_str(const void *addr) {
  char *str = *(char **)addr;
  return strdup(str);
}


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

x86 assembly (clang, -O2):
<print_str>:
mov    (%rdi),%rdi
jmp    1030 <strdup@plt>

LLVM IR (-O0):
define i8* @print_str(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i8**
%6 = load i8*, i8** %5
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = call i8* @strdup(i8* %7)
ret i8* %8
}

LLVM IR (-O2):
define noalias i8* @print_str(i8* nocapture %0) {
%2 = bitcast i8* %0 to i8**
%3 = load i8*, i8** %2
%4 = tail call i8* @strdup(i8* %3)
ret i8* %4
}
int test_imm_79uint8_mem(unsigned char *val) {
  return ((*val) & (0x79 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_79uint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%edx
and    $0x79,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_79uint8_mem>:
testb  $0x79,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_79uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 121
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void test_equal(void) {}


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

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

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

LLVM IR (-O2):
define void @test_equal() {
ret void
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
void swap16(uint16_t *word) {
  uint16_t w1, w2;
  w1 = *word << 8;
  w2 = *word >> 8;
  *word = w1 | w2;
}


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

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

LLVM IR (-O0):
define void @swap16(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = load i32, i32* %5
%7 = shl i32 %6, 8
store i32 %7, i32* %3
%8 = load i32*, i32** %2
%9 = load i32, i32* %8
%10 = ashr i32 %9, 8
store i32 %10, i32* %4
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = or i32 %11, %12
%14 = load i32*, i32** %2
store i32 %13, i32* %14
ret void
}

LLVM IR (-O2):
define void @swap16(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl i32 %2, 8
%4 = ashr i32 %2, 8
%5 = or i32 %3, %4
store i32 %5, i32* %0
ret void
}
/* Type definitions */
typedef int uint64_t;
struct timeval {
  int tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
uint64_t get_usectime() {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return ((uint64_t)(tv.tv_sec)) * 1000000 + tv.tv_usec;
}


x86 assembly (clang, -O0):
<get_usectime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    -0x8(%rbp),%rax
imul   $0xf4240,%eax,%eax
add    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_usectime>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,0x10(%rsp),%eax
add    0x8(%rsp),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
define i32 @get_usectime() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%4 = load i64, i64* %3
%5 = trunc i64 %4 to i32
%6 = mul nsw i32 %5, 1000000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%8 = load i32, i32* %7
%9 = add nsw i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
define i32 @get_usectime() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = mul nsw i32 %6, 1000000
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%9 = load i32, i32* %8
%10 = add nsw i32 %7, %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ st103_set_btable();
int /*<<< orphan*/ st103_set_daddr(int /*<<< orphan*/);
void usb_lld_reset(void) {
  st103_set_btable();
  st103_set_daddr(0);
}


x86 assembly (clang, -O0):
<usb_lld_reset>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <st103_set_btable@plt>
xor    %edi,%edi
call   1040 <st103_set_daddr@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usb_lld_reset>:
push   %rax
xor    %eax,%eax
call   1030 <st103_set_btable@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <st103_set_daddr@plt>

LLVM IR (-O0):
define void @usb_lld_reset() {
%1 = call i32 (...) @st103_set_btable()
%2 = call i32 @st103_set_daddr(i32 0)
ret void
}

LLVM IR (-O2):
define void @usb_lld_reset() {
%1 = tail call i32 (...) @st103_set_btable()
%2 = tail call i32 @st103_set_daddr(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ adc16(int /*<<< orphan*/);
int /*<<< orphan*/ indirectl();
int /*<<< orphan*/ readmemw65816(int /*<<< orphan*/);
void adcIndirectLong16(void) { adc16(readmemw65816(indirectl())); }


x86 assembly (clang, -O0):
<adcIndirectLong16>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <indirectl@plt>
mov    %eax,%edi
call   1030 <readmemw65816@plt>
mov    %eax,%edi
call   1050 <adc16@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<adcIndirectLong16>:
push   %rax
xor    %eax,%eax
call   1040 <indirectl@plt>
mov    %eax,%edi
call   1030 <readmemw65816@plt>
mov    %eax,%edi
pop    %rax
jmp    1050 <adc16@plt>

LLVM IR (-O0):
define void @adcIndirectLong16() {
%1 = call i32 (...) @indirectl()
%2 = call i32 @readmemw65816(i32 %1)
%3 = call i32 @adc16(i32 %2)
ret void
}

LLVM IR (-O2):
define void @adcIndirectLong16() {
%1 = tail call i32 (...) @indirectl()
%2 = tail call i32 @readmemw65816(i32 %1)
%3 = tail call i32 @adc16(i32 %2)
ret void
}
void NmiSR(void) {
  for (;;) {
  }
}


x86 assembly (clang, -O0):
<NmiSR>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <NmiSR+0x9>
jmp    1109 <NmiSR+0x9>

x86 assembly (clang, -O2):
<NmiSR>:
jmp    1100 <NmiSR>

LLVM IR (-O0):
define void @NmiSR() {
br label %1
1: ; preds = %1, %0
br label %1
}

LLVM IR (-O2):
define void @NmiSR() {
br label %1
1: ; preds = %1, %0
br label %1
}
const char *skip(const char *in) {
  while (in && *in && ((unsigned char)*in <= 32)) {
    in++;
  }
  return in;
}


x86 assembly (clang, -O0):
<skip>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     113d <skip+0x3d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     113d <skip+0x3d>
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
cmp    $0x20,%eax
setle  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    114d <skip+0x4d>
jmp    115e <skip+0x5e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <skip+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip>:
test   %rdi,%rdi
je     1121 <skip+0x21>
mov    %rdi,%rax
add    $0xffffffffffffffff,%rax
nopl   0x0(%rax)
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
add    $0xff,%cl
cmp    $0x20,%cl
jb     1110 <skip+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @skip(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i8* [ %8, %3 ], [ %0, %1 ]
%5 = load i8, i8* %4
%6 = add i8 %5, -1
%7 = icmp ult i8 %6, 32
%8 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %7, label %3, label %9
9: ; preds = %3, %1
%10 = phi i8* [ null, %1 ], [ %4, %3 ]
ret i8* %10
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
void *malloc(size_t);
void *mem_alloc(size_t size) {
  void *mem = malloc(size);
  assert(mem != NULL);
  return mem;
}


x86 assembly (clang, -O0):
<mem_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_alloc>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   1030 <assert@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @mem_alloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = load i8*, i8** %3
ret i8* %10
}

LLVM IR (-O2):
define noalias i8* @mem_alloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp ne i8* %2, null
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
ret i8* %2
}
/* Type definitions */
typedef int uint8_t;
typedef int uint64_t;

/* Variables and functions */
int edge(const uint8_t *bits, uint64_t index) {
  return (bits[index / 8] >> (index % 8)) & 0x1;
}


x86 assembly (clang, -O0):
<edge>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    -0x10(%rbp),%eax
mov    %edx,%ecx
sar    %cl,%eax
and    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<edge>:
mov    %esi,%ecx
lea    0x7(%rcx),%eax
test   %esi,%esi
cmovns %esi,%eax
sar    $0x3,%eax
cltq
mov    (%rdi,%rax,4),%eax
and    $0x7,%cl
shr    %cl,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @edge(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %4
%7 = sdiv i32 %6, 8
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i32, i32* %5, i64 %8
%10 = load i32, i32* %9
%11 = load i32, i32* %4
%12 = srem i32 %11, 8
%13 = ashr i32 %10, %12
%14 = and i32 %13, 1
ret i32 %14
}

LLVM IR (-O2):
define i32 @edge(i32* nocapture %0, i32 %1) {
%3 = sdiv i32 %1, 8
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = and i32 %1, 7
%8 = lshr i32 %6, %7
%9 = and i32 %8, 1
ret i32 %9
}
void add_reader(char *name, char *whole_line, char *list_name) { return; }


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

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

LLVM IR (-O0):
define void @add_reader(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
ret void
}

LLVM IR (-O2):
define void @add_reader(i8* nocapture %0, i8* nocapture %1, i8* nocapture %2) {
ret void
}