xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
void part_2_3() {
  enum months {
    JAN = 1,
    FEB,
    MAR,
    APR,
    MAY,
    JUN,
    JUL,
    AUG,
    SEP,
    OCT,
    NOV,
    DEC
  };
  printf("%d, %d, %d", JAN, FEB, MAR);
}


x86 assembly (clang, -O0):
<part_2_3>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<part_2_3>:
lea    0xee9(%rip),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [11 x i8] c"%d, %d, %d\00"
define void @part_2_3() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 1, i32 2, i32 3)
ret void
}
int wpas_wps_scan_pbc_overlap(struct wpa_supplicant *wpa_s,
                              struct wpa_bss *selected, struct wpa_ssid *ssid) {
  return 0;
}


x86 assembly (clang, -O0):
<wpas_wps_scan_pbc_overlap>:
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):
<wpas_wps_scan_pbc_overlap>:
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.wpa_supplicant = type opaque
%struct.wpa_bss = type opaque
%struct.wpa_ssid = type opaque
define i32 @wpas_wps_scan_pbc_overlap(%struct.wpa_supplicant* %0, %struct.wpa_bss* %1, %struct.wpa_ssid* %2) {
%4 = alloca %struct.wpa_supplicant*
%5 = alloca %struct.wpa_bss*
%6 = alloca %struct.wpa_ssid*
store %struct.wpa_supplicant* %0, %struct.wpa_supplicant** %4
store %struct.wpa_bss* %1, %struct.wpa_bss** %5
store %struct.wpa_ssid* %2, %struct.wpa_ssid** %6
ret i32 0
}

LLVM IR (-O2):
%struct.wpa_supplicant = type opaque
%struct.wpa_bss = type opaque
%struct.wpa_ssid = type opaque
define i32 @wpas_wps_scan_pbc_overlap(%struct.wpa_supplicant* nocapture readnone %0, %struct.wpa_bss* nocapture readnone %1, %struct.wpa_ssid* nocapture readnone %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ init_ui_gtk(int *, char ***);
int main(int argc, char *argv[]) {
  init_ui_gtk(&argc, &argv);
  return 0;
}


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)
lea    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <init_ui_gtk@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    %edi,0xc(%rsp)
mov    %rsi,0x10(%rsp)
lea    0xc(%rsp),%rdi
lea    0x10(%rsp),%rsi
call   1030 <init_ui_gtk@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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 = call i32 @init_ui_gtk(i32* %4, i8*** %5)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @init_ui_gtk(i32* %3, i8*** %4)
ret i32 0
}
/* Type definitions */
struct em8051 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *);
int disasm_ret(struct em8051 *aCPU, int aPosition, char *aBuffer) {
  sprintf(aBuffer, "RET");
  return 1;
}


x86 assembly (clang, -O0):
<disasm_ret>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xed2(%rip),%rsi
call   1030 <sprintf@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<disasm_ret>:
movl   $0x544552,(%rdx)
mov    $0x1,%eax
ret

LLVM IR (-O0):
%struct.em8051 = type { i32 }
@.str = [4 x i8] c"RET\00"
define i32 @disasm_ret(%struct.em8051* %0, i32 %1, i8* %2) {
%4 = alloca %struct.em8051*
%5 = alloca i32
%6 = alloca i8*
store %struct.em8051* %0, %struct.em8051** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %6
%8 = call i32 @sprintf(i8* %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
%struct.em8051 = type { i32 }
define i32 @disasm_ret(%struct.em8051* nocapture readnone %0, i32 %1, i8* nocapture writeonly %2) {
%4 = bitcast i8* %2 to i32*
store i32 5522770, i32* %4
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int);
void EPIDividerSet(unsigned long ulBase, unsigned long ulDivider) {
  DEBUG_ASSERT(ulBase == 0x400D0000);
  (*((volatile unsigned long *)(ulBase + 0x00000004))) = ulDivider;
}


x86 assembly (clang, -O0):
<EPIDividerSet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x400d0000,-0x8(%rbp)
40
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x4(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EPIDividerSet>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %edi,%edi
cmp    $0x400d0000,%rbx
sete   %dil
call   1030 <DEBUG_ASSERT@plt>
mov    %r14,0x4(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @EPIDividerSet(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = icmp eq i64 %5, 1074593792
%7 = zext i1 %6 to i32
%8 = call i32 @DEBUG_ASSERT(i32 %7)
%9 = load i64, i64* %4
%10 = load i64, i64* %3
%11 = add i64 %10, 4
%12 = inttoptr i64 %11 to i64*
store volatile i64 %9, i64* %12
ret void
}

LLVM IR (-O2):
define void @EPIDividerSet(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, 1074593792
%4 = zext i1 %3 to i32
%5 = tail call i32 @DEBUG_ASSERT(i32 %4)
%6 = add i64 %0, 4
%7 = inttoptr i64 %6 to i64*
store volatile i64 %1, i64* %7
ret void
}
/* Variables and functions */
void *intel_flash_init(int);
void *intel_flash_bxt_ami_init() { return intel_flash_init(1); }


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

x86 assembly (clang, -O2):
<intel_flash_bxt_ami_init>:
mov    $0x1,%edi
jmp    1030 <intel_flash_init@plt>

LLVM IR (-O0):
define i8* @intel_flash_bxt_ami_init() {
%1 = call i8* @intel_flash_init(i32 1)
ret i8* %1
}

LLVM IR (-O2):
define i8* @intel_flash_bxt_ami_init() {
%1 = tail call i8* @intel_flash_init(i32 1)
ret i8* %1
}
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMREA_set(void) { return U_WMRCORENONE_set("U_WMREA"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMREA\00"
define i8* @U_WMREA_set() {
%1 = call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMREA\00"
define i8* @U_WMREA_set() {
%1 = tail call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ __emit_string_literal_range(char *, int, int, int);
void test_u8(void) { __emit_string_literal_range(u8"0123456789", 6, 4, 7); }


x86 assembly (clang, -O0):
<test_u8>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x6,%esi
mov    $0x4,%edx
mov    $0x7,%ecx
call   1030 <__emit_string_literal_range@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_u8>:
lea    0xee9(%rip),%rdi
mov    $0x6,%esi
mov    $0x4,%edx
mov    $0x7,%ecx
jmp    1030 <__emit_string_literal_range@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"0123456789\00"
define void @test_u8() {
%1 = call i32 @__emit_string_literal_range(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 6, i32 4, i32 7)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"0123456789\00"
define void @test_u8() {
%1 = tail call i32 @__emit_string_literal_range(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 6, i32 4, i32 7)
ret void
}
void gtk_window_get_skip_pager_hint() {}


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

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

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

LLVM IR (-O2):
define void @gtk_window_get_skip_pager_hint() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ move_ip();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ strcpy(char *, char *);
int main(int argc, char *argv[]) {
  char *buffer;
  buffer = (char *)malloc(64);
  strcpy(buffer, "abc");
  printf("%s\n", buffer);
  move_ip();
  printf("returned from move_ip.\n");
  free(buffer);
  return 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)
mov    $0x40,%edi
call   1060 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xe81(%rip),%rsi
call   1040 <strcpy@plt>
mov    -0x18(%rbp),%rsi
lea    0xe75(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x0,%al
call   1070 <move_ip@plt>
lea    0xe64(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x40,%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
lea    0xe9b(%rip),%rsi
mov    %rax,%rdi
call   1040 <strcpy@plt>
mov    %rbx,%rdi
call   1050 <puts@plt>
xor    %eax,%eax
call   1070 <move_ip@plt>
lea    0xe81(%rip),%rdi
call   1050 <puts@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"abc\00"
@.str.1 = [4 x i8] c"%s\0A\00"
@.str.2 = [24 x i8] c"returned from move_ip.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i64 @malloc(i32 64)
%8 = inttoptr i64 %7 to i8*
store i8* %8, i8** %6
%9 = load i8*, i8** %6
%10 = call i32 @strcpy(i8* %9, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%11 = load i8*, i8** %6
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %11)
%13 = call i32 (...) @move_ip()
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
%15 = load i8*, i8** %6
%16 = call i32 @free(i8* %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"abc\00"
@str = [23 x i8] c"returned from move_ip.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 @malloc(i32 64)
%4 = inttoptr i64 %3 to i8*
%5 = tail call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) %4)
%7 = tail call i32 (...) @move_ip()
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%9 = tail call i32 @free(i8* %4)
ret i32 0
}
/* Variables and functions */
int RandomizedPartion(int *, int, int);
void RandomizedQsort(int *arr, int p, int r) {
  if (r > p) {
    int q = RandomizedPartion(arr, p, r);
    RandomizedQsort(arr, p, q - 1);
    RandomizedQsort(arr, q + 1, r);
  }
}


x86 assembly (clang, -O0):
<RandomizedQsort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1174 <RandomizedQsort+0x54>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <RandomizedPartion@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1040 <RandomizedQsort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <RandomizedQsort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomizedQsort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %esi,%edx
jle    1166 <RandomizedQsort+0x46>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <RandomizedPartion@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1040 <RandomizedQsort@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1140 <RandomizedQsort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @RandomizedQsort(i32* %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %2, %1
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @RandomizedPartion(i32* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @RandomizedQsort(i32* %0, i32 %6, i32 %8)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %9, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
/* Type definitions */
struct uv__mmsghdr {
  int dummy;
};

/* Variables and functions */
int syscall(int, int, struct uv__mmsghdr *, unsigned int, unsigned int);
int uv__sendmmsg(int fd, struct uv__mmsghdr *mmsg, unsigned int vlen,
                 unsigned int flags) {
  return syscall(307, fd, mmsg, vlen, flags);
}


x86 assembly (clang, -O0):
<uv__sendmmsg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
mov    $0x133,%edi
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uv__sendmmsg>:
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0x133,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
%struct.uv__mmsghdr = type { i32 }
define i32 @uv__sendmmsg(i32 %0, %struct.uv__mmsghdr* %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca %struct.uv__mmsghdr*
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store %struct.uv__mmsghdr* %1, %struct.uv__mmsghdr** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load %struct.uv__mmsghdr*, %struct.uv__mmsghdr** %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i32 @syscall(i32 307, i32 %9, %struct.uv__mmsghdr* %10, i32 %11, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.uv__mmsghdr = type { i32 }
define i32 @uv__sendmmsg(i32 %0, %struct.uv__mmsghdr* %1, i32 %2, i32 %3) {
%5 = tail call i32 @syscall(i32 307, i32 %0, %struct.uv__mmsghdr* %1, i32 %2, i32 %3)
ret i32 %5
}
int foo(int *x, int i) { return x[i] + i; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
add    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movslq %esi,%rcx
mov    (%rdi,%rcx,4),%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @foo(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i32, i32* %5, i64 %7
%9 = load i32, i32* %8
%10 = load i32, i32* %4
%11 = add nsw i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @foo(i32* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i32, i32* %0, i64 %3
%5 = load i32, i32* %4
%6 = add nsw i32 %5, %1
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *argv0) {
  fprintf(stderr,
          "usage: %s <time limit in seconds> <virtual memory limit in MiB>\n"
          "          <show/hide cpu time: -s|-h> <command> <args>...\n\n"
          "Zero sets no limit (keeps the actual limit)\n",
          argv0);
  exit(EXIT_FAILURE);
}


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>
mov    0x2e8c(%rip),%rax
mov    (%rax),%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>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [168 x i8] c"usage: %s <time limit in seconds> <virtual memory limit in MiB>\0A <show/hide cpu time: -s|-h> <command> <args>...\0A\0AZero sets no limit (keeps the actual limit)\0A\00"
@EXIT_FAILURE = global i32 0
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 ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [168 x i8] c"usage: %s <time limit in seconds> <virtual memory limit in MiB>\0A <show/hide cpu time: -s|-h> <command> <args>...\0A\0AZero sets no limit (keeps the actual limit)\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
int tpa6130a2_stereo_enable(struct snd_soc_codec *codec, int enable) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.snd_soc_codec = type opaque
define i32 @tpa6130a2_stereo_enable(%struct.snd_soc_codec* %0, i32 %1) {
%3 = alloca %struct.snd_soc_codec*
%4 = alloca i32
store %struct.snd_soc_codec* %0, %struct.snd_soc_codec** %3
store i32 %1, i32* %4
ret i32 0
}

LLVM IR (-O2):
%struct.snd_soc_codec = type opaque
define i32 @tpa6130a2_stereo_enable(%struct.snd_soc_codec* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void onabort(void *d) {
  (void)d;
  exit(0);
}


x86 assembly (clang, -O0):
<onabort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %edi,%edi
call   1030 <exit@plt>

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

LLVM IR (-O0):
define void @onabort(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @onabort(i8* nocapture readnone %0) {
%2 = tail call i32 @exit(i32 0)
unreachable
}
void *_Locale_messages_create(const char *__DUMMY_PAR,
                              struct _Locale_name_hint *hint) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct._Locale_name_hint = type opaque
define i8* @_Locale_messages_create(i8* %0, %struct._Locale_name_hint* %1) {
%3 = alloca i8*
%4 = alloca %struct._Locale_name_hint*
store i8* %0, i8** %3
store %struct._Locale_name_hint* %1, %struct._Locale_name_hint** %4
ret i8* null
}

LLVM IR (-O2):
%struct._Locale_name_hint = type opaque
define noalias i8* @_Locale_messages_create(i8* nocapture readnone %0, %struct._Locale_name_hint* nocapture readnone %1) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ error(char *);
void *malloc(unsigned long);
void *tcc_malloc(unsigned long size) {
  void *ptr;
  ptr = malloc(size);
  if (!ptr && size)
    error("memory full");
  return ptr;
}


x86 assembly (clang, -O0):
<tcc_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    115b <tcc_malloc+0x3b>
cmpq   $0x0,-0x8(%rbp)
je     115b <tcc_malloc+0x3b>
lea    0xeaa(%rip),%rdi
call   1040 <error@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tcc_malloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <malloc@plt>
mov    %rax,%r14
test   %rbx,%rbx
je     1145 <tcc_malloc+0x25>
test   %r14,%r14
jne    1145 <tcc_malloc+0x25>
lea    0xec0(%rip),%rdi
call   1040 <error@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [12 x i8] c"memory full\00"
define noalias i8* @tcc_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
%4 = icmp ne i64 %0, 0
%5 = and i1 %4, %3
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 @error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ log_write(char *, int);
int log_info(char *msg) { log_write(msg, 1); }


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

x86 assembly (clang, -O2):
<log_info>:
mov    $0x1,%esi
jmp    1030 <log_write@plt>

LLVM IR (-O0):
define i32 @log_info(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 @log_write(i8* %4, i32 1)
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
define i32 @log_info(i8* %0) {
%2 = tail call i32 @log_write(i8* %0, i32 1)
ret i32 undef
}
/* Type definitions */
struct ascii85 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _ascii85_write_tile(struct ascii85 *, unsigned char,
                                       unsigned char);
void ascii85_write_tile(void *ctx, unsigned char tile_index,
                        unsigned char tile_area) {
  _ascii85_write_tile((struct ascii85 *)ctx, tile_index, tile_area);
}


x86 assembly (clang, -O0):
<ascii85_write_tile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x9(%rbp),%al
movzbl %al,%esi
movzbl -0xa(%rbp),%edx
call   1030 <_ascii85_write_tile@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ascii85_write_tile>:
jmp    1030 <_ascii85_write_tile@plt>

LLVM IR (-O0):
%struct.ascii85 = type { i32 }
define void @ascii85_write_tile(i8* %0, i8 zeroext %1, i8 zeroext %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 = bitcast i8* %7 to %struct.ascii85*
%9 = load i8, i8* %5
%10 = load i8, i8* %6
%11 = call i32 @_ascii85_write_tile(%struct.ascii85* %8, i8 zeroext %9, i8 zeroext %10)
ret void
}

LLVM IR (-O2):
%struct.ascii85 = type { i32 }
define void @ascii85_write_tile(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = bitcast i8* %0 to %struct.ascii85*
%5 = tail call i32 @_ascii85_write_tile(%struct.ascii85* %4, i8 zeroext %1, i8 zeroext %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ decoder_getLength(int /*<<< orphan*/);
uint64_t SSP_Decoder_GetLength(uint32_t handle) {
  return decoder_getLength(handle);
}


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

x86 assembly (clang, -O2):
<SSP_Decoder_GetLength>:
jmp    1030 <decoder_getLength@plt>

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

LLVM IR (-O2):
define i32 @SSP_Decoder_GetLength(i32 %0) {
%2 = tail call i32 @decoder_getLength(i32 %0)
ret i32 %2
}
/* Variables and functions */
int pow(double, int);
double target_f(double x) {
  return -2 * pow(x, 3) + 15 * pow(x, 2) - 24 * x - 3;
}


x86 assembly (clang, -O0):
<target_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x3,%edi
call   1030 <pow@plt>
imul   $0xfffffffe,%eax,%eax
mov    %eax,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
imul   $0xf,%ecx,%ecx
add    %ecx,%eax
cvtsi2sd %eax,%xmm1
movsd  -0x8(%rbp),%xmm0
movsd  0xea9(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xe91(%rip),%xmm1
subsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<target_f>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
mov    $0x3,%edi
call   1030 <pow@plt>
mov    %eax,%ebx
add    %eax,%ebx
movsd  0x8(%rsp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
lea    (%rax,%rax,4),%eax
lea    (%rax,%rax,2),%eax
sub    %ebx,%eax
cvtsi2sd %eax,%xmm1
movsd  0x8(%rsp),%xmm0
mulsd  0xead(%rip),%xmm0
addsd  %xmm1,%xmm0
addsd  0xea9(%rip),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @target_f(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @pow(double %3, i32 3)
%5 = mul nsw i32 -2, %4
%6 = load double, double* %2
%7 = call i32 @pow(double %6, i32 2)
%8 = mul nsw i32 15, %7
%9 = add nsw i32 %5, %8
%10 = sitofp i32 %9 to double
%11 = load double, double* %2
%12 = call double @llvm.fmuladd.f64(double -2.400000e+01, double %11, double %10)
%13 = fsub double %12, 3.000000e+00
ret double %13
}

LLVM IR (-O2):
define double @target_f(double %0) {
%2 = tail call i32 @pow(double %0, i32 3)
%3 = mul nsw i32 %2, -2
%4 = tail call i32 @pow(double %0, i32 2)
%5 = mul nsw i32 %4, 15
%6 = add nsw i32 %5, %3
%7 = sitofp i32 %6 to double
%8 = tail call double @llvm.fmuladd.f64(double %0, double -2.400000e+01, double %7)
%9 = fadd double %8, -3.000000e+00
ret double %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, double, int);
int main(int argc, char *argv[]) {
  printf("(%lf + (%lf +%lf)) = %lf", 1e20, -1e20, 3.14, 1e20 + (-1e20 + 3.14));
  return 0;
}


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)
lea    0xedb(%rip),%rdi
movsd  0xecb(%rip),%xmm0
xor    %ecx,%ecx
mov    %edx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef0(%rip),%rdi
movsd  0xee0(%rip),%xmm0
xor    %ecx,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"(%lf + (%lf +%lf)) = %lf\00"
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 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 poison, i32 poison, double 3.140000e+00, i32 0)
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"(%lf + (%lf +%lf)) = %lf\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 poison, i32 poison, double 3.140000e+00, i32 0)
ret i32 0
}
int bootretry_tstc_timeout(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @bootretry_tstc_timeout() {
ret i32 0
}
int boardh(const int side) { return 4 * side - 3; }


x86 assembly (clang, -O0):
<boardh>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x2,%eax
sub    $0x3,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<boardh>:
lea    -0x3(,%rdi,4),%eax
ret

LLVM IR (-O0):
define i32 @boardh(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 4, %3
%5 = sub nsw i32 %4, 3
ret i32 %5
}

LLVM IR (-O2):
define i32 @boardh(i32 %0) {
%2 = shl nsw i32 %0, 2
%3 = add nsw i32 %2, -3
ret i32 %3
}
int my_cap(char *str) {
  if (*str >= 'a' && *str <= 'z')
    *str -= 32;
  return (0);
}


x86 assembly (clang, -O0):
<my_cap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x61,%eax
jl     1134 <my_cap+0x34>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x7a,%eax
jg     1134 <my_cap+0x34>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
sub    $0x20,%ecx
mov    %cl,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_cap>:
mov    (%rdi),%al
lea    -0x61(%rax),%ecx
cmp    $0x19,%cl
ja     110e <my_cap+0xe>
add    $0xe0,%al
mov    %al,(%rdi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @my_cap(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 97
br i1 %6, label %7, label %18
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp sle i32 %10, 122
br i1 %11, label %12, label %18
12: ; preds = %7
%13 = load i8*, i8** %2
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = sub nsw i32 %15, 32
%17 = trunc i32 %16 to i8
store i8 %17, i8* %13
br label %18
18: ; preds = %12, %7, %1
ret i32 0
}

LLVM IR (-O2):
define i32 @my_cap(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = add i8 %2, -97
%4 = icmp ult i8 %3, 26
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = add nsw i8 %2, -32
store i8 %6, i8* %0
br label %7
7: ; preds = %5, %1
ret i32 0
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int x;
  int y;
  x = __VERIFIER_nondet_int();
  y = __VERIFIER_nondet_int();
  if (y >= 0) {
    while (x >= 0) {
      x = x - y;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     115f <main+0x4f>
jmp    1142 <main+0x32>
cmpl   $0x0,-0x8(%rbp)
jl     115a <main+0x4a>
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1142 <main+0x32>
jmp    115f <main+0x4f>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
test   %eax,%eax
js     1134 <main+0x24>
test   %ebx,%ebx
js     1134 <main+0x24>
nopl   0x0(%rax)
sub    %eax,%ebx
jns    1130 <main+0x20>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
%3 = icmp sgt i32 %2, -1
%4 = icmp sgt i32 %1, -1
%5 = select i1 %3, i1 %4, i1 false
br i1 %5, label %6, label %10
6: ; preds = %0, %6
%7 = phi i32 [ %8, %6 ], [ %1, %0 ]
%8 = sub nsw i32 %7, %2
%9 = icmp sgt i32 %8, -1
br i1 %9, label %6, label %10
10: ; preds = %6, %0
ret i32 0
}
char *StrChr(const char *str, int ch) {
  char c = (char)ch;
  while (1) {
    if (*str == c) {
      return str;
    } else if (*str == '\0') {
      return ((void *)0);
    }
    str++;
  }
}


x86 assembly (clang, -O0):
<StrChr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %al,-0x15(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x15(%rbp),%ecx
cmp    %ecx,%eax
jne    1131 <StrChr+0x31>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1164 <StrChr+0x64>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    114e <StrChr+0x4e>
movq   $0x0,-0x8(%rbp)
jmp    1164 <StrChr+0x64>
jmp    1153 <StrChr+0x53>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1111 <StrChr+0x11>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<StrChr>:
mov    %rdi,%rax
movsbl %sil,%ecx
movsbl (%rdi),%edx
cmp    %edx,%ecx
je     1120 <StrChr+0x20>
xchg   %ax,%ax
test   %dl,%dl
je     1121 <StrChr+0x21>
movsbl 0x1(%rax),%edx
add    $0x1,%rax
cmp    %edx,%ecx
jne    1110 <StrChr+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @StrChr(i8* %0, i32 %1) {
%3 = shl i32 %1, 24
%4 = ashr exact i32 %3, 24
%5 = load i8, i8* %0
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %4, %6
br i1 %7, label %17, label %8
8: ; preds = %2, %12
%9 = phi i8 [ %14, %12 ], [ %5, %2 ]
%10 = phi i8* [ %13, %12 ], [ %0, %2 ]
%11 = icmp eq i8 %9, 0
br i1 %11, label %17, label %12
12: ; preds = %8
%13 = getelementptr inbounds i8, i8* %10, i64 1
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %4, %15
br i1 %16, label %17, label %8
17: ; preds = %12, %8, %2
%18 = phi i8* [ %0, %2 ], [ null, %8 ], [ %13, %12 ]
ret i8* %18
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void tracecmd_put_tracing_file(char *name) { free(name); }


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

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

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

LLVM IR (-O2):
define void @tracecmd_put_tracing_file(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ do_checksum_error(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char **);
int /*<<< orphan*/ stderr;
void fatal(char *args, ...) {
  do_checksum_error(NULL, 0);
  fprintf(stderr, "tar: %r\n", &args);
  exit(-1);
}


x86 assembly (clang, -O0):
<fatal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
mov    %eax,%edi
xor    %esi,%esi
call   1040 <do_checksum_error@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
lea    0xea9(%rip),%rsi
lea    -0x8(%rbp),%rdx
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<fatal>:
push   %rax
mov    %rdi,(%rsp)
xor    %edi,%edi
xor    %esi,%esi
call   1040 <do_checksum_error@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
lea    0xeb2(%rip),%rsi
mov    %rsp,%rdx
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [9 x i8] c"tar: %r\0A\00"
define void @fatal(i8* %0, ...) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @do_checksum_error(i32* null, i32 0)
%4 = load i32, i32* @stderr
%5 = call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8** %2)
%6 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [9 x i8] c"tar: %r\0A\00"
define void @fatal(i8* %0, ...) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = tail call i32 @do_checksum_error(i32* null, i32 0)
%4 = load i32, i32* @stderr
%5 = call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8** %2)
%6 = call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
void *memchr(const void *s, int c, size_t n) { return NULL; }


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

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

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

LLVM IR (-O2):
define noalias i8* @memchr(i8* nocapture readnone %0, i32 %1, i64 %2) {
ret i8* null
}
unsigned int read4FromEco(unsigned char *p) {
  return (unsigned int)p[0] << 24 | (unsigned int)p[1] << 16 |
         (unsigned int)p[2] << 8 | (unsigned int)p[3] << 0;
}


x86 assembly (clang, -O0):
<read4FromEco>:
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
shl    $0x0,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @read4FromEco(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 = shl i32 %23, 0
%25 = or i32 %19, %24
ret i32 %25
}

LLVM IR (-O2):
define i32 @read4FromEco(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
}
void listfiles(char *filespec, char filelist[1024][32], int directories) {}


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

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

LLVM IR (-O0):
define void @listfiles(i8* %0, [32 x i8]* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca [32 x i8]*
%6 = alloca i32
store i8* %0, i8** %4
store [32 x i8]* %1, [32 x i8]** %5
store i32 %2, i32* %6
ret void
}

LLVM IR (-O2):
define void @listfiles(i8* nocapture %0, [32 x i8]* nocapture %1, i32 %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char const *);
void die_die_fopenw(const char *filename) {
  printf("Error! Could not open file '%s' for writing!\n", filename);
  exit(1);
}


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

x86 assembly (clang, -O2):
<die_die_fopenw>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [46 x i8] c"Error! Could not open file '%s' for writing!\0A\00"
define void @die_die_fopenw(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [46 x i8] c"Error! Could not open file '%s' for writing!\0A\00"
define void @die_die_fopenw(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
int test_imm_E0int64_highword_mem(long long *val) {
  return ((*val >> 32) & (0xE0 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_E0int64_highword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
sar    $0x20,%rdx
and    $0xe0,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_E0int64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 32
%6 = and i64 %5, 224
%7 = icmp ne i64 %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_E0int64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 962072674304
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
unsigned int read_belong(unsigned int *l) {
  unsigned char *b = (unsigned char *)l;
  return (b[0] << 24) | (b[1] << 16) | (b[2] << 8) | b[3];
}


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

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

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

LLVM IR (-O2):
define i32 @read_belong(i32* nocapture %0) {
%2 = bitcast i32* %0 to i8*
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = shl nuw i32 %4, 24
%6 = getelementptr inbounds i8, i8* %2, i64 1
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = shl nuw nsw i32 %8, 16
%10 = or i32 %9, %5
%11 = getelementptr inbounds i8, i8* %2, i64 2
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = shl nuw nsw i32 %13, 8
%15 = or i32 %10, %14
%16 = getelementptr inbounds i8, i8* %2, i64 3
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = or i32 %15, %18
ret i32 %19
}