xunge/DecIR huggingface dataset:
unsigned char __inbc_p(unsigned short port) {
  unsigned char _v;
  __asm__ __volatile__("in"
                       "b"
                       " %"
                       ""
                       "1,%"
                       ""
                       "0"
                       : "=a"(_v)
                       : "id"(port));
  __asm__ __volatile__("outb %al,$0x80");
  return _v;
}


x86 assembly (clang, -O0):
<__inbc_p>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%dx
in     (%dx),%al
mov    %al,-0x3(%rbp)
out    %al,$0x80
movzbl -0x3(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__inbc_p>:
mov    %edi,%edx
in     (%dx),%al
out    %al,$0x80
ret

LLVM IR (-O0):
define zeroext i8 @__inbc_p(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i8
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = call i8 asm sideeffect "inb $1,$0", "={ax},i{dx},~{dirflag},~{fpsr},~{flags}"(i16 %4)
store i8 %5, i8* %3
%6 = load i8, i8* %3
ret i8 %6
}

LLVM IR (-O2):
define zeroext i8 @__inbc_p(i16 zeroext %0) {
%2 = tail call i8 asm sideeffect "inb $1,$0", "={ax},i{dx},~{dirflag},~{fpsr},~{flags}"(i16 %0)
tail call void asm sideeffect "outb %al,$$0x80", "~{dirflag},~{fpsr},~{flags}"()
ret i8 %2
}
/* Variables and functions */
char *make(char const *);
int /*<<< orphan*/ sh_free(char *);
void replace(char **a, const char *v) {
  sh_free(*a);
  *a = make(v);
}


x86 assembly (clang, -O0):
<replace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <sh_free@plt>
mov    -0x10(%rbp),%rdi
call   1040 <make@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<replace>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <sh_free@plt>
mov    %r14,%rdi
call   1040 <make@plt>
mov    %rax,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @replace(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** %5
%7 = call i32 @sh_free(i8* %6)
%8 = load i8*, i8** %4
%9 = call i8* @make(i8* %8)
%10 = load i8**, i8*** %3
store i8* %9, i8** %10
ret void
}

LLVM IR (-O2):
define void @replace(i8** nocapture %0, i8* %1) {
%3 = load i8*, i8** %0
%4 = tail call i32 @sh_free(i8* %3)
%5 = tail call i8* @make(i8* %1)
store i8* %5, i8** %0
ret void
}
int imm_deref(int *p) {
  if (p && *p > 4)
    return 4;
  else
    return 0;
}


x86 assembly (clang, -O0):
<imm_deref>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     112c <imm_deref+0x2c>
mov    -0x10(%rbp),%rax
cmpl   $0x4,(%rax)
jle    112c <imm_deref+0x2c>
movl   $0x4,-0x4(%rbp)
jmp    1133 <imm_deref+0x33>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<imm_deref>:
test   %rdi,%rdi
je     110f <imm_deref+0xf>
mov    $0x4,%eax
cmpl   $0x4,(%rdi)
jg     1111 <imm_deref+0x11>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @imm_deref(i32* %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = load i32, i32* %0
%5 = icmp sgt i32 %4, 4
br i1 %5, label %7, label %6
6: ; preds = %3, %1
br label %7
7: ; preds = %3, %6
%8 = phi i32 [ 0, %6 ], [ 4, %3 ]
ret i32 %8
}
/* Type definitions */
struct session {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ create_map(struct session *);
int /*<<< orphan*/ tintin_printf2(struct session *, char *);
void map_create(struct session *ses, char *arg) {
  create_map(ses);
  tintin_printf2(ses, "#MAP: Map created, use #map goto 1, to proceed");
}


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

x86 assembly (clang, -O2):
<map_create>:
push   %rbx
mov    %rdi,%rbx
call   1040 <create_map@plt>
lea    0xed0(%rip),%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <tintin_printf2@plt>

LLVM IR (-O0):
%struct.session = type { i32 }
@.str = [47 x i8] c"#MAP: Map created, use #map goto 1, to proceed\00"
define void @map_create(%struct.session* %0, i8* %1) {
%3 = alloca %struct.session*
%4 = alloca i8*
store %struct.session* %0, %struct.session** %3
store i8* %1, i8** %4
%5 = load %struct.session*, %struct.session** %3
%6 = call i32 @create_map(%struct.session* %5)
%7 = load %struct.session*, %struct.session** %3
%8 = call i32 @tintin_printf2(%struct.session* %7, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.session = type { i32 }
@.str = [47 x i8] c"#MAP: Map created, use #map goto 1, to proceed\00"
define void @map_create(%struct.session* %0, i8* nocapture readnone %1) {
%3 = tail call i32 @create_map(%struct.session* %0)
%4 = tail call i32 @tintin_printf2(%struct.session* %0, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ build_crc_table();
unsigned long calculate_buffer_crc(long, unsigned long, unsigned char *);
int /*<<< orphan*/ free_crc_table();
unsigned long calculate_data_crc(unsigned char *buffer, long length) {
  unsigned long crc = 0l;
  ;
  if (build_crc_table()) {
    crc = 0xFFFFFFFFL;
    crc = calculate_buffer_crc(length, crc, buffer);
    crc ^= 0xFFFFFFFFL;
    free_crc_table();
  }
  return crc;
}


x86 assembly (clang, -O0):
<calculate_data_crc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    $0x0,%al
call   1050 <build_crc_table@plt>
cmp    $0x0,%rax
je     1190 <calculate_data_crc+0x60>
mov    $0xffffffff,%eax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x8(%rbp),%rdx
call   1040 <calculate_buffer_crc@plt>
mov    %rax,-0x18(%rbp)
movabs $0xffffffff,%rax
xor    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <free_crc_table@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculate_data_crc>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r15
xor    %ebx,%ebx
xor    %eax,%eax
call   1050 <build_crc_table@plt>
test   %rax,%rax
je     116f <calculate_data_crc+0x3f>
mov    $0xffffffff,%r12d
mov    $0xffffffff,%esi
mov    %r14,%rdi
mov    %r15,%rdx
call   1040 <calculate_buffer_crc@plt>
mov    %rax,%rbx
xor    %r12,%rbx
xor    %eax,%eax
call   1030 <free_crc_table@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i64 @calculate_data_crc(i8* %0, i64 %1) {
%3 = tail call i64 (...) @build_crc_table()
%4 = icmp eq i64 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i64 @calculate_buffer_crc(i64 %1, i64 4294967295, i8* %0)
%7 = xor i64 %6, 4294967295
%8 = tail call i32 (...) @free_crc_table()
br label %9
9: ; preds = %5, %2
%10 = phi i64 [ %7, %5 ], [ 0, %2 ]
ret i64 %10
}
/* Variables and functions */
char getchar();
scalar_t__ isdigit(char);
void getPhoneNumber() {
  char areaCode = 0;
  int number = 0;
  char c = 0;
  while (1) {
    c = getchar();
    if (isdigit(c)) {
    }
  }
}


x86 assembly (clang, -O0):
<getPhoneNumber>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x0,-0x1(%rbp)
movl   $0x0,-0x8(%rbp)
movb   $0x0,-0x9(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     1159 <getPhoneNumber+0x39>
jmp    1159 <getPhoneNumber+0x39>
jmp    1137 <getPhoneNumber+0x17>

x86 assembly (clang, -O2):
<getPhoneNumber>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <getchar@plt>
movsbl %al,%edi
call   1030 <isdigit@plt>
jmp    1130 <getPhoneNumber+0x10>

LLVM IR (-O0):
define void @getPhoneNumber() {
%1 = alloca i8
%2 = alloca i32
%3 = alloca i8
store i8 0, i8* %1
store i32 0, i32* %2
store i8 0, i8* %3
br label %4
4: ; preds = %0, %10
%5 = call signext i8 (...) @getchar()
store i8 %5, i8* %3
%6 = load i8, i8* %3
%7 = call i64 @isdigit(i8 signext %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %4
br label %10
10: ; preds = %9, %4
br label %4
}

LLVM IR (-O2):
define void @getPhoneNumber() {
br label %1
1: ; preds = %1, %0
%2 = tail call signext i8 (...) @getchar()
%3 = tail call i64 @isdigit(i8 signext %2)
br label %1
}
/* Type definitions */
typedef int wchar_t;

/* Variables and functions */
int /*<<< orphan*/ free(int *);
int *malloc(int);
int *utf8_to_utf16be(char const *, int *, int);
int utf8_to_utf16_int(const char *str) {
  int *num = malloc(sizeof(int));
  wchar_t *utf16_wchar = utf8_to_utf16be(str, num, true);
  int utf16_int = (int)utf16_wchar[0];
  free(utf16_wchar);
  free(num);
  return utf16_int;
}


x86 assembly (clang, -O0):
<utf8_to_utf16_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x4,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x1,%edx
call   1040 <utf8_to_utf16be@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<utf8_to_utf16_int>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
mov    $0x4,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %rax,%rsi
mov    $0x1,%edx
call   1040 <utf8_to_utf16be@plt>
mov    (%rax),%ebp
mov    %rax,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @utf8_to_utf16_int(i8* %0) {
%2 = tail call i32* @malloc(i32 4)
%3 = tail call i32* @utf8_to_utf16be(i8* %0, i32* %2, i32 1)
%4 = load i32, i32* %3
%5 = tail call i32 @free(i32* %3)
%6 = tail call i32 @free(i32* %2)
ret i32 %4
}
void Console_Update(void) {}


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

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

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

LLVM IR (-O2):
define void @Console_Update() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SYS_rename;
int syscall(int /*<<< orphan*/, char const *, char const *);
int rename(const char *oldpath, const char *newpath) {
  return syscall(SYS_rename, oldpath, newpath);
}


x86 assembly (clang, -O0):
<rename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rename>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    0x2ec3(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@SYS_rename = global i32 0
define i32 @rename(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @SYS_rename
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32 @syscall(i32 %5, i8* %6, i8* %7)
ret i32 %8
}

LLVM IR (-O2):
@SYS_rename = global i32 0
define i32 @rename(i8* %0, i8* %1) {
%3 = load i32, i32* @SYS_rename
%4 = tail call i32 @syscall(i32 %3, i8* %0, i8* %1)
ret i32 %4
}
void RTMemDupTag(void) {}


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

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

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

LLVM IR (-O2):
define void @RTMemDupTag() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int operatorDoesTakePrecedence(char op1, char op2) {
  assert(op1 > 0);
  assert(op2 > 0);
  int result = 0;
  if (op1 == '*' || op1 == '/') {
    result = 1;
  }
  return result;
}


x86 assembly (clang, -O0):
<operatorDoesTakePrecedence>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x0,%eax
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movsbl -0x2(%rbp),%eax
cmp    $0x0,%eax
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movl   $0x0,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x2a,%eax
je     116d <operatorDoesTakePrecedence+0x5d>
movsbl -0x1(%rbp),%eax
cmp    $0x2f,%eax
jne    1174 <operatorDoesTakePrecedence+0x64>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<operatorDoesTakePrecedence>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %edi,%edi
test   %bpl,%bpl
setg   %dil
call   1030 <assert@plt>
xor    %edi,%edi
test   %bl,%bl
setg   %dil
call   1030 <assert@plt>
cmp    $0x2a,%bpl
sete   %al
cmp    $0x2f,%bpl
sete   %cl
or     %al,%cl
movzbl %cl,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @operatorDoesTakePrecedence(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
%6 = load i8, i8* %3
%7 = sext i8 %6 to i32
%8 = icmp sgt i32 %7, 0
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = load i8, i8* %4
%12 = sext i8 %11 to i32
%13 = icmp sgt i32 %12, 0
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
store i32 0, i32* %5
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 42
br i1 %18, label %23, label %19
19: ; preds = %2
%20 = load i8, i8* %3
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %21, 47
br i1 %22, label %23, label %24
23: ; preds = %19, %2
store i32 1, i32* %5
br label %24
24: ; preds = %23, %19
%25 = load i32, i32* %5
ret i32 %25
}

LLVM IR (-O2):
define i32 @operatorDoesTakePrecedence(i8 signext %0, i8 signext %1) {
%3 = icmp sgt i8 %0, 0
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = icmp sgt i8 %1, 0
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = icmp eq i8 %0, 42
%10 = icmp eq i8 %0, 47
%11 = or i1 %9, %10
%12 = zext i1 %11 to i32
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void usage(const char *name) {
  fprintf(stderr, "\tUsage: %s PID [-p -d]\n", name);
  exit(0);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"\09Usage: %s PID [-p -d]\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"\09Usage: %s PID [-p -d]\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 0)
unreachable
}
unsigned long b_disk_write(unsigned long start, unsigned long num,
                           unsigned long disknum, void *source) {
  unsigned long tlong = 0;
  asm volatile("call *0x00100078"
               : "=c"(tlong)
               : "a"(start), "c"(num), "d"(disknum), "S"(source));
  return tlong;
}


x86 assembly (clang, -O0):
<b_disk_write>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rsi
call   *0x100078
mov    %rcx,-0x28(%rbp)
mov    -0x28(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_disk_write>:
mov    %rcx,%r8
mov    %rsi,%rcx
mov    %rdi,%rax
mov    %r8,%rsi
call   *0x100078
mov    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @b_disk_write(i64 %0, i64 %1, i64 %2, i8* %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i8*
%9 = alloca i64
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i8* %3, i8** %8
store i64 0, i64* %9
%10 = load i64, i64* %5
%11 = load i64, i64* %6
%12 = load i64, i64* %7
%13 = load i8*, i8** %8
%14 = call i64 asm sideeffect "call *0x00100078", "={cx},{ax},{cx},{dx},{si},~{dirflag},~{fpsr},~{flags}"(i64 %10, i64 %11, i64 %12, i8* %13)
store i64 %14, i64* %9
%15 = load i64, i64* %9
ret i64 %15
}

LLVM IR (-O2):
define i64 @b_disk_write(i64 %0, i64 %1, i64 %2, i8* %3) {
%5 = tail call i64 asm sideeffect "call *0x00100078", "={cx},{ax},{cx},{dx},{si},~{dirflag},~{fpsr},~{flags}"(i64 %0, i64 %1, i64 %2, i8* %3)
ret i64 %5
}
unsigned int __VERIFIER_nondet_uint() { return -99999999; }


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

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

LLVM IR (-O0):
define i32 @__VERIFIER_nondet_uint() {
ret i32 -99999999
}

LLVM IR (-O2):
define i32 @__VERIFIER_nondet_uint() {
ret i32 -99999999
}
/* Variables and functions */
int /*<<< orphan*/ expand_seed(unsigned char *, unsigned char const *);
int /*<<< orphan*/ gen_fullchains(unsigned char *, unsigned char const *);
void wots_pkgen(unsigned char pk[67 * 32], const unsigned char sk[32],
                const unsigned char masks[((1 << 4) - 1) * 32]) {
  expand_seed(pk, sk);
  gen_fullchains(pk, masks);
}


x86 assembly (clang, -O0):
<wots_pkgen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <expand_seed@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <gen_fullchains@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wots_pkgen>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rbx
call   1030 <expand_seed@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <gen_fullchains@plt>

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

LLVM IR (-O2):
define void @wots_pkgen(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @expand_seed(i8* %0, i8* %1)
%5 = tail call i32 @gen_fullchains(i8* %0, i8* %2)
ret void
}
/* Variables and functions */
int strncmp(const char *s1, const char *s2, size_t n) { return 0; }


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ INT_MAX;
int /*<<< orphan*/ _drawtext(int, int /*<<< orphan*/, int, char const *,
                             int /*<<< orphan*/);
void drawtext(int x, int y, const char *str, uint16_t length) {
  _drawtext(x, INT_MAX, y, str, length);
}


x86 assembly (clang, -O0):
<drawtext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eb9(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%edx
mov    -0x10(%rbp),%rcx
mov    -0x14(%rbp),%r8d
call   1030 <_drawtext@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drawtext>:
mov    %ecx,%r8d
mov    %rdx,%rcx
mov    %esi,%edx
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
jmp    1030 <_drawtext@plt>

LLVM IR (-O0):
@INT_MAX = global i32 0
define void @drawtext(i32 %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* @INT_MAX
%11 = load i32, i32* %6
%12 = load i8*, i8** %7
%13 = load i32, i32* %8
%14 = call i32 @_drawtext(i32 %9, i32 %10, i32 %11, i8* %12, i32 %13)
ret void
}

LLVM IR (-O2):
@INT_MAX = global i32 0
define void @drawtext(i32 %0, i32 %1, i8* %2, i32 %3) {
%5 = load i32, i32* @INT_MAX
%6 = tail call i32 @_drawtext(i32 %0, i32 %5, i32 %1, i8* %2, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void Usage(void) {
  printf("\n");
  printf("Usage:\n");
  printf("update_fdt.exe u-boot.bin xxx.dtb output_file.bin\n\n");
}


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

x86 assembly (clang, -O2):
<Usage>:
push   %rax
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xece(%rip),%rdi
call   1040 <puts@plt>
lea    0xec9(%rip),%rdi
pop    %rax
jmp    1040 <puts@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [8 x i8] c"Usage:\0A\00"
@.str.2 = [52 x i8] c"update_fdt.exe u-boot.bin xxx.dtb output_file.bin\0A\0A\00"
define void @Usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [7 x i8] c"Usage:\00"
@str.3 = [51 x i8] c"update_fdt.exe u-boot.bin xxx.dtb output_file.bin\0A\00"
define void @Usage() {
%1 = tail call i32 @putchar(i32 10)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str.3, i64 0, i64 0))
ret void
}
int last() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @last() {
ret i32 0
}
/* Type definitions */
typedef int ptrdiff_t;

/* Variables and functions */
int main(void) {
  ptrdiff_t qp, pq;
  int *p;
  {
    int array[10];
    p = &array[0];
    int *q = &array[5];
    qp = q - p;
    pq = p - q;
  }
  if (qp == 5 && pq == -5) {
    return 5;
  }
  return *p;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
lea    -0x40(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0x40(%rbp),%rax
add    $0x14,%rax
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    %rcx,%rax
sar    $0x2,%rax
mov    %eax,-0x8(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x48(%rbp),%rcx
sub    %rcx,%rax
sar    $0x2,%rax
mov    %eax,-0xc(%rbp)
cmpl   $0x5,-0x8(%rbp)
jne    1163 <main+0x63>
cmpl   $0xfffffffb,-0xc(%rbp)
jne    1163 <main+0x63>
movl   $0x5,-0x4(%rbp)
jmp    116c <main+0x6c>
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32*
%5 = alloca [10 x i32]
%6 = alloca i32*
store i32 0, i32* %1
%7 = getelementptr inbounds [10 x i32], [10 x i32]* %5, i64 0, i64 0
store i32* %7, i32** %4
%8 = getelementptr inbounds [10 x i32], [10 x i32]* %5, i64 0, i64 5
store i32* %8, i32** %6
%9 = load i32*, i32** %6
%10 = load i32*, i32** %4
%11 = ptrtoint i32* %9 to i64
%12 = ptrtoint i32* %10 to i64
%13 = sub i64 %11, %12
%14 = sdiv exact i64 %13, 4
%15 = trunc i64 %14 to i32
store i32 %15, i32* %2
%16 = load i32*, i32** %4
%17 = load i32*, i32** %6
%18 = ptrtoint i32* %16 to i64
%19 = ptrtoint i32* %17 to i64
%20 = sub i64 %18, %19
%21 = sdiv exact i64 %20, 4
%22 = trunc i64 %21 to i32
store i32 %22, i32* %3
%23 = load i32, i32* %2
%24 = icmp eq i32 %23, 5
br i1 %24, label %25, label %29
25: ; preds = %0
%26 = load i32, i32* %3
%27 = icmp eq i32 %26, -5
br i1 %27, label %28, label %29
28: ; preds = %25
store i32 5, i32* %1
br label %32
29: ; preds = %25, %0
%30 = load i32*, i32** %4
%31 = load i32, i32* %30
store i32 %31, i32* %1
br label %32
32: ; preds = %29, %28
%33 = load i32, i32* %1
ret i32 %33
}

LLVM IR (-O2):
define i32 @main() {
ret i32 5
}
void gtk_scale_get_value_pos() {}


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

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

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

LLVM IR (-O2):
define void @gtk_scale_get_value_pos() {
ret void
}
unsigned long get_score(char *s) {
  unsigned long sum = 0;
  int i = 0;
  while (*(s + i) != '\0' && *(s + i) != '\n') {
    sum += 1 + (unsigned long)(*(s + i) - 'A');
    i++;
  }
  return sum;
}


x86 assembly (clang, -O0):
<get_score>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x15(%rbp)
je     1146 <get_score+0x46>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
setne  %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    1156 <get_score+0x56>
jmp    1181 <get_score+0x81>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
sub    $0x41,%eax
cltq
add    $0x1,%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1117 <get_score+0x17>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_score>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbq (%rdi),%rcx
test   %rcx,%rcx
je     112b <get_score+0x2b>
cmp    $0xa,%cl
je     112b <get_score+0x2b>
add    %rcx,%rax
add    $0xffffffffffffffc0,%rax
add    $0x1,%rdi
jmp    1110 <get_score+0x10>
ret

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

LLVM IR (-O2):
define i64 @get_score(i8* nocapture %0) {
br label %2
2: ; preds = %7, %1
%3 = phi i64 [ %11, %7 ], [ 0, %1 ]
%4 = phi i64 [ %10, %7 ], [ 0, %1 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %3
%6 = load i8, i8* %5
switch i8 %6, label %7 [
i8 0, label %12
i8 10, label %12
]
7: ; preds = %2
%8 = sext i8 %6 to i64
%9 = add i64 %4, -64
%10 = add i64 %9, %8
%11 = add nuw i64 %3, 1
br label %2
12: ; preds = %2, %2
ret i64 %4
}
/* Variables and functions */
int add(int, int);
int /*<<< orphan*/ printf(char *, int);
int main() { printf("%d", add(1, 2)); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <add@plt>
mov    %eax,%esi
lea    0xec4(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <add@plt>
lea    0xec9(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @add(i32 1, i32 2)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ errnoThrow(int);
int unlink(char const *);
void Sys_FileDelete(const char *name) { errnoThrow(-1 == unlink(name)); }


x86 assembly (clang, -O0):
<Sys_FileDelete>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <unlink@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <errnoThrow@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sys_FileDelete>:
push   %rax
call   1030 <unlink@plt>
xor    %edi,%edi
cmp    $0xffffffff,%eax
sete   %dil
pop    %rax
jmp    1040 <errnoThrow@plt>

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

LLVM IR (-O2):
define void @Sys_FileDelete(i8* nocapture %0) {
%2 = tail call i32 @unlink(i8* %0)
%3 = icmp eq i32 %2, -1
%4 = zext i1 %3 to i32
%5 = tail call i32 @errnoThrow(i32 %4)
ret void
}
/* Variables and functions */
char *test_solve() { return NULL; }


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

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

LLVM IR (-O0):
define i8* @test_solve() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @test_solve() {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printFloat(void *i) {
  if (i == NULL)
    printf("null\t");
  else
    printf("%.02f\t", *((float *)i));
}


x86 assembly (clang, -O0):
<printFloat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113a <printFloat+0x2a>
lea    0xed2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1154 <printFloat+0x44>
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xeb9(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printFloat>:
test   %rdi,%rdi
je     112b <printFloat+0x1b>
movss  (%rdi),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xee2(%rip),%rdi
mov    $0x1,%al
jmp    1030 <printf@plt>
lea    0xece(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"null\09\00"
@.str.1 = [7 x i8] c"%.02f\09\00"
define void @printFloat(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %13
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = bitcast i8* %8 to float*
%10 = load float, float* %9
%11 = fpext float %10 to double
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %11)
br label %13
13: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"null\09\00"
@.str.1 = [7 x i8] c"%.02f\09\00"
define void @printFloat(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %10
5: ; preds = %1
%6 = bitcast i8* %0 to float*
%7 = load float, float* %6
%8 = fpext float %7 to double
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %8)
br label %10
10: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ fb_flock(int, int);
void shm_unlock(int fd) {
  fb_flock(fd, 8);
  close(fd);
}


x86 assembly (clang, -O0):
<shm_unlock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x8,%esi
call   1040 <fb_flock@plt>
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shm_unlock>:
push   %rbx
mov    %edi,%ebx
mov    $0x8,%esi
call   1040 <fb_flock@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <close@plt>

LLVM IR (-O0):
define void @shm_unlock(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @fb_flock(i32 %3, i32 8)
%5 = load i32, i32* %2
%6 = call i32 @close(i32 %5)
ret void
}

LLVM IR (-O2):
define void @shm_unlock(i32 %0) {
%2 = tail call i32 @fb_flock(i32 %0, i32 8)
%3 = tail call i32 @close(i32 %0)
ret void
}
unsigned twoxsai_generic_input_fmts(void) { return (1 << 0) | (1 << 1); }


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

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

LLVM IR (-O0):
define i32 @twoxsai_generic_input_fmts() {
ret i32 3
}

LLVM IR (-O2):
define i32 @twoxsai_generic_input_fmts() {
ret i32 3
}
/* Variables and functions */
size_t mycompare_equal(void *key1, void *key2) {
  if ((const char *)key1 == (const char *)key2)
    return (1);
  else
    return (0);
}


x86 assembly (clang, -O0):
<mycompare_equal>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jne    1127 <mycompare_equal+0x27>
movq   $0x1,-0x8(%rbp)
jmp    112f <mycompare_equal+0x2f>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mycompare_equal>:
xor    %eax,%eax
cmp    %rsi,%rdi
sete   %al
ret

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

LLVM IR (-O2):
define i64 @mycompare_equal(i8* readnone %0, i8* readnone %1) {
%3 = icmp eq i8* %0, %1
%4 = zext i1 %3 to i64
ret i64 %4
}
/* Variables and functions */
int send(int, char const *, int, int /*<<< orphan*/);
int udp_send(int fd, const char *data, int len) {
  int ret = send(fd, data, len, 0);
  if (ret <= 0)
    return 0;
  return ret;
}


x86 assembly (clang, -O0):
<udp_send>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
xor    %ecx,%ecx
call   1030 <send@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jg     114c <udp_send+0x3c>
movl   $0x0,-0x4(%rbp)
jmp    1152 <udp_send+0x42>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<udp_send>:
push   %rbx
xor    %ebx,%ebx
xor    %ecx,%ecx
call   1030 <send@plt>
test   %eax,%eax
cmovs  %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @udp_send(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @send(i32 %0, i8* %1, i32 %2, i32 0)
%5 = icmp sgt i32 %4, 0
%6 = select i1 %5, i32 %4, i32 0
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
void curses_destroy_window() { endwin(); }


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

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

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

LLVM IR (-O2):
define void @curses_destroy_window() {
%1 = tail call i32 (...) @endwin()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
scalar_t__ mkdir(char *, int);
int /*<<< orphan*/ yyerror(char *);
int /*<<< orphan*/ yyparse();
int main(void) {
  if (mkdir("./pam.d", 0755) != 0) {
    yyerror("./pam.d"
            " already exists.. aborting");
    exit(1);
  }
  yyparse();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
mov    $0x1ed,%esi
call   1030 <mkdir@plt>
cmp    $0x0,%rax
je     1180 <main+0x40>
lea    0xe97(%rip),%rdi
call   1040 <yyerror@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    $0x0,%al
call   1050 <yyparse@plt>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb8(%rip),%rdi
mov    $0x1ed,%esi
call   1030 <mkdir@plt>
test   %rax,%rax
jne    1165 <main+0x25>
xor    %eax,%eax
call   1050 <yyparse@plt>
xor    %edi,%edi
call   1060 <exit@plt>
lea    0xe9c(%rip),%rdi
call   1040 <yyerror@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"./pam.d\00"
@.str.1 = [34 x i8] c"./pam.d already exists.. aborting\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 @mkdir(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 493)
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = call i32 @yyerror(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @exit(i32 1)
unreachable
7: ; preds = %0
%8 = call i32 (...) @yyparse()
%9 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [8 x i8] c"./pam.d\00"
@.str.1 = [34 x i8] c"./pam.d already exists.. aborting\00"
define i32 @main() {
%1 = tail call i64 @mkdir(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 493)
%2 = icmp eq i64 %1, 0
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = tail call i32 @yyerror(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @exit(i32 1)
unreachable
6: ; preds = %0
%7 = tail call i32 (...) @yyparse()
%8 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
scalar_t__ premier(int);
int ft_find_next_prime(int nb) {
  while (premier(nb) == 0) {
    ++nb;
  }
  return (nb);
}


x86 assembly (clang, -O0):
<ft_find_next_prime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <premier@plt>
cmp    $0x0,%rax
jne    113b <ft_find_next_prime+0x2b>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111b <ft_find_next_prime+0xb>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_find_next_prime>:
push   %rbx
mov    %edi,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebx,%edi
call   1030 <premier@plt>
add    $0x1,%ebx
test   %rax,%rax
je     1120 <ft_find_next_prime+0x10>
add    $0xffffffff,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ft_find_next_prime(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %7, %1
%4 = load i32, i32* %2
%5 = call i64 @premier(i32 %4)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = load i32, i32* %2
%9 = add nsw i32 %8, 1
store i32 %9, i32* %2
br label %3
10: ; preds = %3
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @ft_find_next_prime(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ %0, %1 ], [ %6, %2 ]
%4 = tail call i64 @premier(i32 %3)
%5 = icmp eq i64 %4, 0
%6 = add nsw i32 %3, 1
br i1 %5, label %2, label %7
7: ; preds = %2
ret i32 %3
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t vga_makeChar(char character, uint8_t color) {
  uint16_t character16 = character;
  uint16_t color16 = color;
  return character16 | color16 << 8;
}


x86 assembly (clang, -O0):
<vga_makeChar>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vga_makeChar>:
mov    %esi,%eax
shl    $0x8,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @vga_makeChar(i8 signext %0, i32 %1) {
%3 = alloca i8
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i8 %0, i8* %3
store i32 %1, i32* %4
%7 = load i8, i8* %3
%8 = sext i8 %7 to i32
store i32 %8, i32* %5
%9 = load i32, i32* %4
store i32 %9, i32* %6
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = shl i32 %11, 8
%13 = or i32 %10, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @vga_makeChar(i8 signext %0, i32 %1) {
%3 = sext i8 %0 to i32
%4 = shl i32 %1, 8
%5 = or i32 %4, %3
ret i32 %5
}
int kgsl_cffdump_capture_ib_desc(struct kgsl_device *device,
                                 struct kgsl_context *context,
                                 struct kgsl_cmdbatch *cmdbatch) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.kgsl_device = type opaque
%struct.kgsl_context = type opaque
%struct.kgsl_cmdbatch = type opaque
define i32 @kgsl_cffdump_capture_ib_desc(%struct.kgsl_device* %0, %struct.kgsl_context* %1, %struct.kgsl_cmdbatch* %2) {
%4 = alloca %struct.kgsl_device*
%5 = alloca %struct.kgsl_context*
%6 = alloca %struct.kgsl_cmdbatch*
store %struct.kgsl_device* %0, %struct.kgsl_device** %4
store %struct.kgsl_context* %1, %struct.kgsl_context** %5
store %struct.kgsl_cmdbatch* %2, %struct.kgsl_cmdbatch** %6
ret i32 0
}

LLVM IR (-O2):
%struct.kgsl_device = type opaque
%struct.kgsl_context = type opaque
%struct.kgsl_cmdbatch = type opaque
define i32 @kgsl_cffdump_capture_ib_desc(%struct.kgsl_device* nocapture readnone %0, %struct.kgsl_context* nocapture readnone %1, %struct.kgsl_cmdbatch* nocapture readnone %2) {
ret i32 0
}
main() {
  int UserData[4];
  int i;
  int a = 1;
  double d;
  ((int *)(&d))[a] = UserData[i];
  ((int *)(&d))[1] = UserData[i];
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x18(%rbp)
movslq -0x14(%rbp),%rax
mov    -0x10(%rbp,%rax,4),%ecx
movslq -0x18(%rbp),%rax
mov    %ecx,-0x20(%rbp,%rax,4)
movslq -0x14(%rbp),%rax
mov    -0x10(%rbp,%rax,4),%eax
mov    %eax,-0x1c(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca [4 x i32]
%2 = alloca i32
%3 = alloca i32
%4 = alloca double
store i32 1, i32* %3
%5 = load i32, i32* %2
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 %6
%8 = load i32, i32* %7
%9 = bitcast double* %4 to i32*
%10 = load i32, i32* %3
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i32, i32* %9, i64 %11
store i32 %8, i32* %12
%13 = load i32, i32* %2
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 %14
%16 = load i32, i32* %15
%17 = bitcast double* %4 to i32*
%18 = getelementptr inbounds i32, i32* %17, i64 1
store i32 %16, i32* %18
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ do_pages(int);
void no_flush_switch_pages(void) { do_pages(2); }


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

x86 assembly (clang, -O2):
<no_flush_switch_pages>:
mov    $0x2,%edi
jmp    1030 <do_pages@plt>

LLVM IR (-O0):
define void @no_flush_switch_pages() {
%1 = call i32 @do_pages(i32 2)
ret void
}

LLVM IR (-O2):
define void @no_flush_switch_pages() {
%1 = tail call i32 @do_pages(i32 2)
ret void
}
int test_imm_29uint8_mem(unsigned char *val) {
  return ((*val) & (-0x29 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_29uint8_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, -41
%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_29uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -41
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}