xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ SIGTERM;
int /*<<< orphan*/ getpid();
int /*<<< orphan*/ kill(int /*<<< orphan*/, int /*<<< orphan*/);
int gen_TERM() {
  kill(getpid(), SIGTERM);
  return 0;
}


x86 assembly (clang, -O0):
<gen_TERM>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%edi
mov    0x2eb4(%rip),%rax
mov    (%rax),%esi
call   1040 <kill@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_TERM>:
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
mov    0x2eb9(%rip),%rcx
mov    (%rcx),%esi
mov    %eax,%edi
call   1040 <kill@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@SIGTERM = global i32 0
define i32 @gen_TERM() {
%1 = call i32 (...) @getpid()
%2 = load i32, i32* @SIGTERM
%3 = call i32 @kill(i32 %1, i32 %2)
ret i32 0
}

LLVM IR (-O2):
@SIGTERM = global i32 0
define i32 @gen_TERM() {
%1 = tail call i32 (...) @getpid()
%2 = load i32, i32* @SIGTERM
%3 = tail call i32 @kill(i32 %1, i32 %2)
ret i32 0
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ fig12_19();
int main(int argc, char **argv) {
  fig12_19();
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <fig12_19@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @fig12_19()
%7 = load i32, i32* @EXIT_SUCCESS
ret i32 %7
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @fig12_19()
%4 = load i32, i32* @EXIT_SUCCESS
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ usleep(long);
void msleep(long int t) { usleep(t * 1000); }


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

x86 assembly (clang, -O2):
<msleep>:
imul   $0x3e8,%rdi,%rdi
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @msleep(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = mul nsw i64 %3, 1000
%5 = call i32 @usleep(i64 %4)
ret void
}

LLVM IR (-O2):
define void @msleep(i64 %0) {
%2 = mul nsw i64 %0, 1000
%3 = tail call i32 @usleep(i64 %2)
ret void
}
void gem_print_stack_trace(void) {}


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

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

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

LLVM IR (-O2):
define void @gem_print_stack_trace() {
ret void
}
/* Variables and functions */
float file(char *, int /*<<< orphan*/);
int pow(int, int);
float getLibVal(char *input, int index) {
  return ((int)(((21 * 3) + 1.73) * pow(3, 2)) % 8) / 5.55 + file("AAA", 0);
}


x86 assembly (clang, -O0):
<getLibVal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x3,%edi
mov    $0x2,%esi
call   1030 <pow@plt>
cvtsi2sd %eax,%xmm1
movsd  0xebe(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
cvtsi2sd %edx,%xmm0
movsd  0xe9a(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
lea    0xe9a(%rip),%rdi
xor    %esi,%esi
call   1040 <file@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
cvtss2sd %xmm1,%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getLibVal>:
push   %rax
mov    $0x3,%edi
mov    $0x2,%esi
call   1030 <pow@plt>
cvtsi2sd %eax,%xmm0
mulsd  0xec4(%rip),%xmm0
cvttsd2si %xmm0,%eax
lea    0x7(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xfffffff8,%ecx
sub    %ecx,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
divsd  0xeac(%rip),%xmm0
movsd  %xmm0,(%rsp)
lea    0xea8(%rip),%rdi
xor    %esi,%esi
call   1040 <file@plt>
cvtss2sd %xmm0,%xmm0
addsd  (%rsp),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [4 x i8] c"AAA\00"
define float @getLibVal(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = call i32 @pow(i32 3, i32 2)
%6 = sitofp i32 %5 to double
%7 = fmul double 6.473000e+01, %6
%8 = fptosi double %7 to i32
%9 = srem i32 %8, 8
%10 = sitofp i32 %9 to double
%11 = fdiv double %10, 5.550000e+00
%12 = call float @file(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 0)
%13 = fpext float %12 to double
%14 = fadd double %11, %13
%15 = fptrunc double %14 to float
ret float %15
}

LLVM IR (-O2):
@.str = [4 x i8] c"AAA\00"
define float @getLibVal(i8* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @pow(i32 3, i32 2)
%4 = sitofp i32 %3 to double
%5 = fmul double %4, 6.473000e+01
%6 = fptosi double %5 to i32
%7 = srem i32 %6, 8
%8 = sitofp i32 %7 to double
%9 = fdiv double %8, 5.550000e+00
%10 = tail call float @file(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 0)
%11 = fpext float %10 to double
%12 = fadd double %9, %11
%13 = fptrunc double %12 to float
ret float %13
}
int foo(int a) {
  int x = (a & (~15)) / 16;
  return x;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xfffffff0,%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
and    $0xfffffff0,%edi
lea    0xf(%rdi),%eax
test   %edi,%edi
cmovns %edi,%eax
sar    $0x4,%eax
ret

LLVM IR (-O0):
define i32 @foo(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = and i32 %4, -16
%6 = sdiv i32 %5, 16
store i32 %6, i32* %3
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = and i32 %0, -16
%3 = sdiv i32 %2, 16
ret i32 %3
}
int fun1370() { return 1370; }


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

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

LLVM IR (-O0):
define i32 @fun1370() {
ret i32 1370
}

LLVM IR (-O2):
define i32 @fun1370() {
ret i32 1370
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printError2() { printf("ERROR! ERROR!\n"); }


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

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

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

LLVM IR (-O2):
@str = [14 x i8] c"ERROR! ERROR!\00"
define void @printError2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret void
}
void RTDbgModName(void) {}


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

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

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

LLVM IR (-O2):
define void @RTDbgModName() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Local_Suite();
int /*<<< orphan*/ atf_init(int, char **);
int atf_print_results();
int main(int argc, char **argv) {
  atf_init(argc, argv);
  Local_Suite();
  ;
  do {
    extern void External_Suite(void);
    External_Suite();
    ;
  } while (0);
  return atf_print_results();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <atf_init@plt>
mov    $0x0,%al
call   1040 <Local_Suite@plt>
call   1030 <External_Suite@plt>
mov    $0x0,%al
call   1060 <atf_print_results@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1050 <atf_init@plt>
xor    %eax,%eax
call   1040 <Local_Suite@plt>
call   1030 <External_Suite@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <atf_print_results@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @atf_init(i32 %6, i8** %7)
%9 = call i32 (...) @Local_Suite()
br label %10
10: ; preds = %2
br label %11
11: ; preds = %10
%12 = call i32 (...) @atf_print_results()
ret i32 %12
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @atf_init(i32 %0, i8** %1)
%4 = tail call i32 (...) @Local_Suite()
tail call void @External_Suite()
%5 = tail call i32 (...) @atf_print_results()
ret i32 %5
}
/* Type definitions */
struct stat {
  int st_ino;
};

/* Variables and functions */
int /*<<< orphan*/ fatal(int /*<<< orphan*/, char *, int, int /*<<< orphan*/);
scalar_t__ fstat(int, struct stat *);
int /*<<< orphan*/ getpid();
extern int inode(int fd) {
  struct stat buf;
  if (fstat(fd, &buf))
    fatal(0, "inode(): fstat(%u) failed PID %u", fd, getpid());
  return buf.st_ino;
}


x86 assembly (clang, -O0):
<inode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
call   1050 <fstat@plt>
cmp    $0x0,%rax
je     1171 <inode+0x41>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    -0xc(%rbp),%edx
mov    %eax,%ecx
xor    %edi,%edi
lea    0xe94(%rip),%rsi
call   1040 <fatal@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inode>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
lea    0x8(%rsp),%rsi
call   1050 <fstat@plt>
test   %rax,%rax
je     115f <inode+0x2f>
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xeac(%rip),%rsi
xor    %edi,%edi
mov    %ebx,%edx
mov    %eax,%ecx
call   1040 <fatal@plt>
mov    0x8(%rsp),%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@.str = [33 x i8] c"inode(): fstat(%u) failed PID %u\00"
define i32 @inode(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.stat
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i64 @fstat(i32 %4, %struct.stat* %3)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i32, i32* %2
%9 = call i32 (...) @getpid()
%10 = call i32 @fatal(i32 0, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %9)
br label %11
11: ; preds = %7, %1
%12 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%13 = load i32, i32* %12
ret i32 %13
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@.str = [33 x i8] c"inode(): fstat(%u) failed PID %u\00"
define i32 @inode(i32 %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @fstat(i32 %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = tail call i32 (...) @getpid()
%8 = tail call i32 @fatal(i32 0, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %7)
br label %9
9: ; preds = %6, %1
%10 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%11 = load i32, i32* %10
ret i32 %11
}
int msb_int(unsigned char *cp) {
  return ((cp[0] << 24) | (cp[1] << 16) | (cp[2] << 8) | cp[3]);
}


x86 assembly (clang, -O0):
<msb_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @msb_int(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl i32 %6, 24
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 16
%13 = or i32 %7, %12
%14 = load i8*, i8** %2
%15 = getelementptr inbounds i8, i8* %14, i64 2
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = or i32 %13, %18
%20 = load i8*, i8** %2
%21 = getelementptr inbounds i8, i8* %20, i64 3
%22 = load i8, i8* %21
%23 = zext i8 %22 to i32
%24 = or i32 %19, %23
ret i32 %24
}

LLVM IR (-O2):
define i32 @msb_int(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = shl nuw i32 %3, 24
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 16
%9 = or i32 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl nuw nsw i32 %12, 8
%14 = or i32 %9, %13
%15 = getelementptr inbounds i8, i8* %0, i64 3
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = or i32 %14, %17
ret i32 %18
}
/* Type definitions */
struct input_event {
  scalar_t__ value;
  int /*<<< orphan*/ code;
  int /*<<< orphan*/ type;
};
typedef int /*<<< orphan*/ ev;

/* Variables and functions */
int /*<<< orphan*/ EV_SYN;
int /*<<< orphan*/ SYN_REPORT;
int /*<<< orphan*/ write(int, struct input_event *, int);
void send_syn(int uinput_fd) {
  struct input_event ev;
  ev.type = EV_SYN;
  ev.code = SYN_REPORT;
  ev.value = 0;
  write(uinput_fd, &ev, sizeof(ev));
}


x86 assembly (clang, -O0):
<send_syn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ece(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x18(%rbp),%rsi
mov    $0x10,%edx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_syn>:
sub    $0x18,%rsp
mov    0x2ed5(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x14(%rsp)
mov    0x2eb8(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x10(%rsp)
movq   $0x0,0x8(%rsp)
lea    0x8(%rsp),%rsi
mov    $0x10,%edx
call   1030 <write@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.input_event = type { i64, i32, i32 }
@EV_SYN = global i32 0
@SYN_REPORT = global i32 0
define void @send_syn(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.input_event
store i32 %0, i32* %2
%4 = load i32, i32* @EV_SYN
%5 = getelementptr inbounds %struct.input_event, %struct.input_event* %3, i32 0, i32 2
store i32 %4, i32* %5
%6 = load i32, i32* @SYN_REPORT
%7 = getelementptr inbounds %struct.input_event, %struct.input_event* %3, i32 0, i32 1
store i32 %6, i32* %7
%8 = getelementptr inbounds %struct.input_event, %struct.input_event* %3, i32 0, i32 0
store i64 0, i64* %8
%9 = load i32, i32* %2
%10 = call i32 @write(i32 %9, %struct.input_event* %3, i32 16)
ret void
}

LLVM IR (-O2):
%struct.input_event = type { i64, i32, i32 }
@EV_SYN = global i32 0
@SYN_REPORT = global i32 0
define void @send_syn(i32 %0) {
%2 = alloca %struct.input_event
%3 = bitcast %struct.input_event* %2 to i8*
%4 = load i32, i32* @EV_SYN
%5 = getelementptr inbounds %struct.input_event, %struct.input_event* %2, i64 0, i32 2
store i32 %4, i32* %5
%6 = load i32, i32* @SYN_REPORT
%7 = getelementptr inbounds %struct.input_event, %struct.input_event* %2, i64 0, i32 1
store i32 %6, i32* %7
%8 = getelementptr inbounds %struct.input_event, %struct.input_event* %2, i64 0, i32 0
store i64 0, i64* %8
%9 = call i32 @write(i32 %0, %struct.input_event* %2, i32 16)
ret void
}
/* Type definitions */
typedef unsigned long uint32_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int32_t FlashUserGet(uint32_t *pui32User0, uint32_t *pui32User1) {
  ;
  ;
  *pui32User0 = (*((volatile unsigned long *)(0x400FE1E0)));
  *pui32User1 = (*((volatile unsigned long *)(0x400FE1E4)));
  return (0);
}


x86 assembly (clang, -O0):
<FlashUserGet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x400fe1e0,%eax
mov    (%rax),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    $0x400fe1e4,%eax
mov    (%rax),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<FlashUserGet>:
mov    0x400fe1e0,%rax
40
mov    %rax,(%rdi)
mov    0x400fe1e4,%rax
40
mov    %rax,(%rsi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @FlashUserGet(i64* %0, i64* %1) {
%3 = alloca i64*
%4 = alloca i64*
store i64* %0, i64** %3
store i64* %1, i64** %4
%5 = load volatile i64, i64* inttoptr (i64 1074782688 to i64*)
%6 = load i64*, i64** %3
store i64 %5, i64* %6
%7 = load volatile i64, i64* inttoptr (i64 1074782692 to i64*)
%8 = load i64*, i64** %4
store i64 %7, i64* %8
ret i32 0
}

LLVM IR (-O2):
define i32 @FlashUserGet(i64* nocapture writeonly %0, i64* nocapture writeonly %1) {
%3 = load volatile i64, i64* inttoptr (i64 1074782688 to i64*)
store i64 %3, i64* %0
%4 = load volatile i64, i64* inttoptr (i64 1074782692 to i64*)
store i64 %4, i64* %1
ret i32 0
}
int to_synch_safe(char bytes[]) {
  return ((int)bytes[0] << 21) + ((int)bytes[1] << 14) + ((int)bytes[2] << 7) +
         (int)bytes[3];
}


x86 assembly (clang, -O0):
<to_synch_safe>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
shl    $0x15,%eax
mov    -0x8(%rbp),%rcx
movsbl 0x1(%rcx),%ecx
shl    $0xe,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
movsbl 0x2(%rcx),%ecx
shl    $0x7,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
movsbl 0x3(%rcx),%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_synch_safe>:
movsbl (%rdi),%eax
shl    $0x15,%eax
movsbl 0x1(%rdi),%ecx
shl    $0xe,%ecx
add    %eax,%ecx
movsbl 0x2(%rdi),%edx
shl    $0x7,%edx
add    %ecx,%edx
movsbl 0x3(%rdi),%eax
add    %edx,%eax
ret

LLVM IR (-O0):
define i32 @to_synch_safe(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = shl i32 %6, 21
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = shl i32 %11, 14
%13 = add nsw i32 %7, %12
%14 = load i8*, i8** %2
%15 = getelementptr inbounds i8, i8* %14, i64 2
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = shl i32 %17, 7
%19 = add nsw i32 %13, %18
%20 = load i8*, i8** %2
%21 = getelementptr inbounds i8, i8* %20, i64 3
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = add nsw i32 %19, %23
ret i32 %24
}

LLVM IR (-O2):
define i32 @to_synch_safe(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = shl nsw i32 %3, 21
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = shl nsw i32 %7, 14
%9 = add nsw i32 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = shl nsw i32 %12, 7
%14 = add nsw i32 %9, %13
%15 = getelementptr inbounds i8, i8* %0, i64 3
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = add nsw i32 %14, %17
ret i32 %18
}
void userdefined_u(void) {}


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

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

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

LLVM IR (-O2):
define void @userdefined_u() {
ret void
}
/* Variables and functions */
double string_fuzzy_score(char const *, char const *, double);
double string_score(const char *a, const char *b) {
  return string_fuzzy_score(a, b, 0.0);
}


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

x86 assembly (clang, -O2):
<string_score>:
xorps  %xmm0,%xmm0
jmp    1030 <string_fuzzy_score@plt>

LLVM IR (-O0):
define double @string_score(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call double @string_fuzzy_score(i8* %5, i8* %6, double 0.000000e+00)
ret double %7
}

LLVM IR (-O2):
define double @string_score(i8* %0, i8* %1) {
%3 = tail call double @string_fuzzy_score(i8* %0, i8* %1, double 0.000000e+00)
ret double %3
}
/* Variables and functions */
char *ultoa(unsigned int, char *, int);
extern char *utoa(unsigned value, char *string, int radix) {
  return ultoa(value, string, radix);
}


x86 assembly (clang, -O0):
<utoa>:
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 <ultoa@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<utoa>:
jmp    1030 <ultoa@plt>

LLVM IR (-O0):
define i8* @utoa(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* @ultoa(i32 %7, i8* %8, i32 %9)
ret i8* %10
}

LLVM IR (-O2):
define i8* @utoa(i32 %0, i8* %1, i32 %2) {
%4 = tail call i8* @ultoa(i32 %0, i8* %1, i32 %2)
ret i8* %4
}
int swap_disable_nonboot_cpus_lock(struct cpumask *mask) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.cpumask = type opaque
define i32 @swap_disable_nonboot_cpus_lock(%struct.cpumask* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ChuangXin_bind();
int /*<<< orphan*/ CuiXinShi_bind();
int /*<<< orphan*/ DingShenShi_bind();
int /*<<< orphan*/ DuanChang_bind();
int /*<<< orphan*/ DuanJinShi_bind();
int /*<<< orphan*/ JieMai_bind();
int /*<<< orphan*/ PoJiaShi_bind();
int /*<<< orphan*/ XieWuShi_bind();
int /*<<< orphan*/ ZhuiHunShi_bind();
void KB_Ability_init() {
  ChuangXin_bind();
  CuiXinShi_bind();
  DingShenShi_bind();
  DuanChang_bind();
  DuanJinShi_bind();
  JieMai_bind();
  PoJiaShi_bind();
  XieWuShi_bind();
  ZhuiHunShi_bind();
}


x86 assembly (clang, -O0):
<KB_Ability_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1080 <ChuangXin_bind@plt>
mov    $0x0,%al
call   1040 <CuiXinShi_bind@plt>
mov    $0x0,%al
call   10b0 <DingShenShi_bind@plt>
mov    $0x0,%al
call   1030 <DuanChang_bind@plt>
mov    $0x0,%al
call   1060 <DuanJinShi_bind@plt>
mov    $0x0,%al
call   10a0 <JieMai_bind@plt>
mov    $0x0,%al
call   1090 <PoJiaShi_bind@plt>
mov    $0x0,%al
call   1070 <XieWuShi_bind@plt>
mov    $0x0,%al
call   1050 <ZhuiHunShi_bind@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<KB_Ability_init>:
push   %rax
xor    %eax,%eax
call   1080 <ChuangXin_bind@plt>
xor    %eax,%eax
call   1040 <CuiXinShi_bind@plt>
xor    %eax,%eax
call   10b0 <DingShenShi_bind@plt>
xor    %eax,%eax
call   1030 <DuanChang_bind@plt>
xor    %eax,%eax
call   1060 <DuanJinShi_bind@plt>
xor    %eax,%eax
call   10a0 <JieMai_bind@plt>
xor    %eax,%eax
call   1090 <PoJiaShi_bind@plt>
xor    %eax,%eax
call   1070 <XieWuShi_bind@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <ZhuiHunShi_bind@plt>

LLVM IR (-O0):
define void @KB_Ability_init() {
%1 = call i32 (...) @ChuangXin_bind()
%2 = call i32 (...) @CuiXinShi_bind()
%3 = call i32 (...) @DingShenShi_bind()
%4 = call i32 (...) @DuanChang_bind()
%5 = call i32 (...) @DuanJinShi_bind()
%6 = call i32 (...) @JieMai_bind()
%7 = call i32 (...) @PoJiaShi_bind()
%8 = call i32 (...) @XieWuShi_bind()
%9 = call i32 (...) @ZhuiHunShi_bind()
ret void
}

LLVM IR (-O2):
define void @KB_Ability_init() {
%1 = tail call i32 (...) @ChuangXin_bind()
%2 = tail call i32 (...) @CuiXinShi_bind()
%3 = tail call i32 (...) @DingShenShi_bind()
%4 = tail call i32 (...) @DuanChang_bind()
%5 = tail call i32 (...) @DuanJinShi_bind()
%6 = tail call i32 (...) @JieMai_bind()
%7 = tail call i32 (...) @PoJiaShi_bind()
%8 = tail call i32 (...) @XieWuShi_bind()
%9 = tail call i32 (...) @ZhuiHunShi_bind()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ UFILE;
typedef int /*<<< orphan*/ UChar;

/* Variables and functions */
int u_fprintf(int /*<<< orphan*/ *, char *, int /*<<< orphan*/ *,
              int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int print_delimited(UChar *str, UChar *delim, int delim_length, UFILE *out) {
  return (u_fprintf(out, "%S%S%S", delim, str, delim) >= delim_length * 2) ? 0
                                                                           : 2;
}


x86 assembly (clang, -O0):
<print_delimited>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%r8
lea    0xec2(%rip),%rsi
call   1030 <u_fprintf@plt>
mov    %eax,%edx
mov    -0x14(%rbp),%esi
shl    $0x1,%esi
mov    $0x2,%eax
xor    %ecx,%ecx
cmp    %esi,%edx
cmovge %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_delimited>:
push   %rbx
mov    %edx,%ebx
mov    %rsi,%rdx
mov    %rdi,%rax
lea    0xee0(%rip),%rsi
mov    %rcx,%rdi
mov    %rax,%rcx
mov    %rdx,%r8
call   1030 <u_fprintf@plt>
add    %ebx,%ebx
xor    %ecx,%ecx
cmp    %ebx,%eax
setl   %cl
add    %ecx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%S%S%S\00"
define i32 @print_delimited(i32* %0, i32* %1, i32 %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32*
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32 %2, i32* %7
store i32* %3, i32** %8
%9 = load i32*, i32** %8
%10 = load i32*, i32** %6
%11 = load i32*, i32** %5
%12 = load i32*, i32** %6
%13 = call i32 @u_fprintf(i32* %9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %10, i32* %11, i32* %12)
%14 = load i32, i32* %7
%15 = mul nsw i32 %14, 2
%16 = icmp sge i32 %13, %15
%17 = zext i1 %16 to i64
%18 = select i1 %16, i32 0, i32 2
ret i32 %18
}

LLVM IR (-O2):
@.str = [7 x i8] c"%S%S%S\00"
define i32 @print_delimited(i32* %0, i32* %1, i32 %2, i32* %3) {
%5 = tail call i32 @u_fprintf(i32* %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %0, i32* %1)
%6 = shl nsw i32 %2, 1
%7 = icmp slt i32 %5, %6
%8 = select i1 %7, i32 2, i32 0
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
size_t fmt_s32_dec(char *, int /*<<< orphan*/);
size_t fmt_s16_dec(char *out, int16_t val) { return fmt_s32_dec(out, val); }


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

x86 assembly (clang, -O2):
<fmt_s16_dec>:
jmp    1030 <fmt_s32_dec@plt>

LLVM IR (-O0):
define i64 @fmt_s16_dec(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 i64 @fmt_s32_dec(i8* %5, i32 %6)
ret i64 %7
}

LLVM IR (-O2):
define i64 @fmt_s16_dec(i8* %0, i32 %1) {
%3 = tail call i64 @fmt_s32_dec(i8* %0, i32 %1)
ret i64 %3
}
/* Type definitions */
typedef int ssize_t;

/* Variables and functions */
size_t __get_array_size(void const *);
int __infer_nondet_int();
ssize_t write(int fildes, const void *buf, size_t nbyte) {
  if (__get_array_size(buf) < nbyte)
    while (1)
      ;
  int ret = __infer_nondet_int();
  if (ret < -1 || nbyte < ret)
    while (1)
      ;
  return ret;
}


x86 assembly (clang, -O0):
<write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <__get_array_size@plt>
cmp    -0x18(%rbp),%rax
jae    1150 <write+0x30>
jmp    114b <write+0x2b>
jmp    114b <write+0x2b>
mov    $0x0,%al
call   1030 <__infer_nondet_int@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0xffffffff,-0x1c(%rbp)
jl     1175 <write+0x55>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
cmp    %rcx,%rax
jae    117f <write+0x5f>
jmp    117a <write+0x5a>
jmp    117a <write+0x5a>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write>:
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%rdi
call   1040 <__get_array_size@plt>
cmp    %rbx,%rax
jae    1142 <write+0x22>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
jmp    1140 <write+0x20>
xor    %eax,%eax
call   1030 <__infer_nondet_int@plt>
cmp    $0xffffffff,%eax
jl     1160 <write+0x40>
movslq %eax,%rcx
cmp    %rbx,%rcx
ja     1160 <write+0x40>
pop    %rbx
ret
nopl   0x0(%rax,%rax,1)
jmp    1160 <write+0x40>

LLVM IR (-O0):
define i32 @write(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i8*, i8** %5
%9 = call i64 @__get_array_size(i8* %8)
%10 = load i64, i64* %6
%11 = icmp ult i64 %9, %10
br i1 %11, label %12, label %14
12: ; preds = %3
br label %13
13: ; preds = %12, %13
br label %13
14: ; preds = %3
%15 = call i32 (...) @__infer_nondet_int()
store i32 %15, i32* %7
%16 = load i32, i32* %7
%17 = icmp slt i32 %16, -1
br i1 %17, label %23, label %18
18: ; preds = %14
%19 = load i64, i64* %6
%20 = load i32, i32* %7
%21 = sext i32 %20 to i64
%22 = icmp ult i64 %19, %21
br i1 %22, label %23, label %25
23: ; preds = %18, %14
br label %24
24: ; preds = %23, %24
br label %24
25: ; preds = %18
%26 = load i32, i32* %7
ret i32 %26
}

LLVM IR (-O2):
define i32 @write(i32 %0, i8* %1, i64 %2) {
%4 = tail call i64 @__get_array_size(i8* %1)
%5 = icmp ult i64 %4, %2
br i1 %5, label %6, label %7
6: ; preds = %3, %6
br label %6
7: ; preds = %3
%8 = tail call i32 (...) @__infer_nondet_int()
%9 = icmp slt i32 %8, -1
%10 = sext i32 %8 to i64
%11 = icmp ugt i64 %10, %2
%12 = or i1 %9, %11
br i1 %12, label %13, label %14
13: ; preds = %7, %13
br label %13
14: ; preds = %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void exitb(char **args) {
  printf("Goodbye\n");
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<exitb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<exitb>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"Goodbye\0A\00"
@EXIT_SUCCESS = global i32 0
define void @exitb(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @EXIT_SUCCESS
%5 = call i32 @exit(i32 %4)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@str = [8 x i8] c"Goodbye\00"
define void @exitb(i8** nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_SUCCESS
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fread(unsigned char *, int, int, int /*<<< orphan*/ *);
int read16LE(FILE *f, unsigned short *target) {
  unsigned char bytes[2];
  int got = fread(bytes, 1, 2, f);
  *target = bytes[0];
  *target |= (((unsigned short)bytes[1]) << 8) & 0xFF00;
  return got;
}


x86 assembly (clang, -O0):
<read16LE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x12(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0x1,%esi
mov    $0x2,%edx
call   1030 <fread@plt>
mov    %eax,-0x18(%rbp)
movzbl -0x12(%rbp),%eax
mov    %ax,%cx
mov    -0x10(%rbp),%rax
mov    %cx,(%rax)
movzbl -0x11(%rbp),%eax
movzwl %ax,%edx
shl    $0x8,%edx
and    $0xff00,%edx
mov    -0x10(%rbp),%rax
movzwl (%rax),%ecx
or     %edx,%ecx
mov    %cx,(%rax)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read16LE>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
mov    %rdi,%rcx
lea    0xe(%rsp),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
call   1030 <fread@plt>
movzwl 0xe(%rsp),%ecx
mov    %cx,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @read16LE(i32* %0, i16* %1) {
%3 = alloca i32*
%4 = alloca i16*
%5 = alloca [2 x i8]
%6 = alloca i32
store i32* %0, i32** %3
store i16* %1, i16** %4
%7 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 0
%8 = load i32*, i32** %3
%9 = call i32 @fread(i8* %7, i32 1, i32 2, i32* %8)
store i32 %9, i32* %6
%10 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 0
%11 = load i8, i8* %10
%12 = zext i8 %11 to i16
%13 = load i16*, i16** %4
store i16 %12, i16* %13
%14 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 1
%15 = load i8, i8* %14
%16 = zext i8 %15 to i16
%17 = zext i16 %16 to i32
%18 = shl i32 %17, 8
%19 = and i32 %18, 65280
%20 = load i16*, i16** %4
%21 = load i16, i16* %20
%22 = zext i16 %21 to i32
%23 = or i32 %22, %19
%24 = trunc i32 %23 to i16
store i16 %24, i16* %20
%25 = load i32, i32* %6
ret i32 %25
}

LLVM IR (-O2):
define i32 @read16LE(i32* nocapture %0, i16* nocapture writeonly %1) {
%3 = alloca [2 x i8]
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%5 = call i32 @fread(i8* %4, i32 1, i32 2, i32* %0)
%6 = load i8, i8* %4
%7 = zext i8 %6 to i16
%8 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 1
%9 = load i8, i8* %8
%10 = zext i8 %9 to i16
%11 = shl nuw i16 %10, 8
%12 = or i16 %11, %7
store i16 %12, i16* %1
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void usage(const char *prgname) {
  printf(
      "Extract metadata from a barebox image\n"
      "\n"
      "Usage: %s [OPTIONS] FILE\n"
      "Options:\n"
      "-t <type>    only show information of <type>\n"
      "-n <no>      for tags with multiple strings only show string <no>\n"
      "\n"
      "Without options all information available is printed. Valid types are:\n"
      "release, build, model, of_compatible\n",
      prgname);
}


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

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

LLVM IR (-O0):
@.str = [294 x i8] c"Extract metadata from a barebox image\0A\0AUsage: %s [OPTIONS] FILE\0AOptions:\0A-t <type> only show information of <type>\0A-n <no> for tags with multiple strings only show string <no>\0A\0AWithout options all information available is printed. Valid types are:\0Arelease, build, model, of_compatible\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([294 x i8], [294 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [294 x i8] c"Extract metadata from a barebox image\0A\0AUsage: %s [OPTIONS] FILE\0AOptions:\0A-t <type> only show information of <type>\0A-n <no> for tags with multiple strings only show string <no>\0A\0AWithout options all information available is printed. Valid types are:\0Arelease, build, model, of_compatible\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([294 x i8], [294 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int LOG_ERR;
int LOG_USER;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ syslog(int, char *);
int main() {
  FILE *f;
  f = fopen("not_here", "r");
  if (!f)
    syslog(LOG_ERR | LOG_USER, "oops - %m\n");
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    0xebc(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    117f <main+0x4f>
mov    0x2e68(%rip),%rax
mov    (%rax),%edi
mov    0x2e77(%rip),%rax
or     (%rax),%edi
lea    0xe91(%rip),%rsi
call   1030 <syslog@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0xeca(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
jne    1167 <main+0x37>
mov    0x2e80(%rip),%rax
mov    0x2e91(%rip),%rcx
mov    (%rcx),%edi
or     (%rax),%edi
lea    0xea9(%rip),%rsi
call   1030 <syslog@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"not_here\00"
@.str.1 = [2 x i8] c"r\00"
@LOG_ERR = global i32 0
@LOG_USER = global i32 0
@.str.2 = [11 x i8] c"oops - %m\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %3, i32** %2
%4 = load i32*, i32** %2
%5 = icmp ne i32* %4, null
br i1 %5, label %11, label %6
6: ; preds = %0
%7 = load i32, i32* @LOG_ERR
%8 = load i32, i32* @LOG_USER
%9 = or i32 %7, %8
%10 = call i32 @syslog(i32 %9, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
br label %11
11: ; preds = %6, %0
%12 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [9 x i8] c"not_here\00"
@.str.1 = [2 x i8] c"r\00"
@LOG_ERR = global i32 0
@LOG_USER = global i32 0
@.str.2 = [11 x i8] c"oops - %m\0A\00"
define i32 @main() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp eq i32* %1, null
br i1 %2, label %3, label %8
3: ; preds = %0
%4 = load i32, i32* @LOG_ERR
%5 = load i32, i32* @LOG_USER
%6 = or i32 %5, %4
%7 = tail call i32 @syslog(i32 %6, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
br label %8
8: ; preds = %3, %0
%9 = tail call i32 @exit(i32 0)
unreachable
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ tv_nsec;
};
struct stat {
  TYPE_1__ st_atim;
};

/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  struct stat stb;
  (void)argc;
  (void)argv;
  stb.st_atim.tv_nsec = 0;
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
%struct.stat = type { %struct.TYPE_2__ }
%struct.TYPE_2__ = type { i64 }
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.stat
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = load i8**, i8*** %5
%9 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 0
%10 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %9, i32 0, i32 0
store i64 0, i64* %10
%11 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @exit(i32 0)
unreachable
}
void ptrace_sandbox_permit_brk(struct pt_sandbox *p_sandbox) {
  (void)p_sandbox;
}


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

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

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

LLVM IR (-O2):
%struct.pt_sandbox = type opaque
define void @ptrace_sandbox_permit_brk(%struct.pt_sandbox* nocapture %0) {
ret void
}
/* Variables and functions */
scalar_t__ do_conv(char const *, char **, int, int);
long strtol(const char *nptr, char **endptr, int base) {
  return (long)do_conv(nptr, endptr, base, 1);
}


x86 assembly (clang, -O0):
<strtol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    $0x1,%ecx
call   1030 <do_conv@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtol>:
mov    $0x1,%ecx
jmp    1030 <do_conv@plt>

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

LLVM IR (-O2):
define i64 @strtol(i8* %0, i8** %1, i32 %2) {
%4 = tail call i64 @do_conv(i8* %0, i8** %1, i32 %2, i32 1)
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ yy_push_state(int);
void asn1p_lexer_hack_push_opaque_state() { yy_push_state(5); }


x86 assembly (clang, -O0):
<asn1p_lexer_hack_push_opaque_state>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5,%edi
call   1030 <yy_push_state@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<asn1p_lexer_hack_push_opaque_state>:
mov    $0x5,%edi
jmp    1030 <yy_push_state@plt>

LLVM IR (-O0):
define void @asn1p_lexer_hack_push_opaque_state() {
%1 = call i32 @yy_push_state(i32 5)
ret void
}

LLVM IR (-O2):
define void @asn1p_lexer_hack_push_opaque_state() {
%1 = tail call i32 @yy_push_state(i32 5)
ret void
}
/* Variables and functions */
int write(int, unsigned char *, int);
int write_byte(int fd, unsigned char value) {
  int ret;
  do {
    ret = write(fd, &value, 1);
    if (ret < 0) {
      return ret;
    }
  } while (ret == 0);
  return 0;
}


x86 assembly (clang, -O0):
<write_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x9(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jge    114a <write_byte+0x3a>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1160 <write_byte+0x50>
jmp    114f <write_byte+0x3f>
cmpl   $0x0,-0x10(%rbp)
je     1121 <write_byte+0x11>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_byte>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
mov    %sil,0x7(%rsp)
lea    0x7(%rsp),%r14
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
test   %eax,%eax
js     1137 <write_byte+0x27>
je     1120 <write_byte+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @write_byte(i32 %0, i8 zeroext %1) {
%3 = alloca i8
store i8 %1, i8* %3
br label %4
4: ; preds = %7, %2
%5 = call i32 @write(i32 %0, i8* %3, i32 1)
%6 = icmp slt i32 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = icmp eq i32 %5, 0
br i1 %8, label %4, label %9
9: ; preds = %7, %4
%10 = phi i32 [ %5, %4 ], [ 0, %7 ]
ret i32 %10
}
/* Type definitions */
struct All_variables {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ full_solver_init(struct All_variables *);
void solver_init(struct All_variables *E) { full_solver_init(E); }


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

x86 assembly (clang, -O2):
<solver_init>:
jmp    1030 <full_solver_init@plt>

LLVM IR (-O0):
%struct.All_variables = type { i32 }
define void @solver_init(%struct.All_variables* %0) {
%2 = alloca %struct.All_variables*
store %struct.All_variables* %0, %struct.All_variables** %2
%3 = load %struct.All_variables*, %struct.All_variables** %2
%4 = call i32 @full_solver_init(%struct.All_variables* %3)
ret void
}

LLVM IR (-O2):
%struct.All_variables = type { i32 }
define void @solver_init(%struct.All_variables* %0) {
%2 = tail call i32 @full_solver_init(%struct.All_variables* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ delay_cycles(unsigned long long);
void delay_us(unsigned long long delay) { delay_cycles(delay * 8); }


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

x86 assembly (clang, -O2):
<delay_us>:
shl    $0x3,%rdi
jmp    1030 <delay_cycles@plt>

LLVM IR (-O0):
define void @delay_us(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = mul i64 %3, 8
%5 = call i32 @delay_cycles(i64 %4)
ret void
}

LLVM IR (-O2):
define void @delay_us(i64 %0) {
%2 = shl i64 %0, 3
%3 = tail call i32 @delay_cycles(i64 %2)
ret void
}
int test_imm_05int8_reg(signed char val) {
  return ((val) & (0x05 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_05int8_reg(i8 signext %0) {
%2 = and i8 %0, 5
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void ukf_safe_free(void *p) {
  if (p != 0)
    free(p);
}


x86 assembly (clang, -O0):
<ukf_safe_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <ukf_safe_free+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @ukf_safe_free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @free(i8* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @ukf_safe_free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
void g_list_position() {}


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

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

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

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