xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ YabauseExec();
int PERDummyHandleEvents(void) {
  if (YabauseExec() != 0)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<PERDummyHandleEvents>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <YabauseExec@plt>
cmp    $0x0,%rax
je     1135 <PERDummyHandleEvents+0x25>
movl   $0xffffffff,-0x4(%rbp)
jmp    113c <PERDummyHandleEvents+0x2c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PERDummyHandleEvents>:
push   %rax
xor    %eax,%eax
call   1030 <YabauseExec@plt>
neg    %rax
sbb    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @PERDummyHandleEvents() {
%1 = alloca i32
%2 = call i64 (...) @YabauseExec()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 -1, i32* %1
br label %6
5: ; preds = %0
store i32 0, i32* %1
br label %6
6: ; preds = %5, %4
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
define i32 @PERDummyHandleEvents() {
%1 = tail call i64 (...) @YabauseExec()
%2 = icmp ne i64 %1, 0
%3 = sext i1 %2 to i32
ret i32 %3
}
int timer_handler(void *arg __attribute__((unused))) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @timer_handler(i8* nocapture readnone %0) {
ret i32 1
}
int whisper_init() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @whisper_init() {
ret i32 0
}
/* Type definitions */
struct ambapp_dev_hdr {
  int dummy;
};
struct ambapp_ahb_info {
  int dummy;
};

/* Variables and functions */
int ambapp_find_ahbslvs_next(struct ambapp_dev_hdr *, int, int,
                             struct ambapp_ahb_info *, int /*<<< orphan*/, int);
int ambapp_find_ahbslvs(struct ambapp_dev_hdr *root, int vendor, int device,
                        struct ambapp_ahb_info *dev, int maxno) {
  return ambapp_find_ahbslvs_next(root, vendor, device, dev, 0, maxno);
}


x86 assembly (clang, -O0):
<ambapp_find_ahbslvs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r9d
xor    %r8d,%r8d
call   1030 <ambapp_find_ahbslvs_next@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ambapp_find_ahbslvs>:
mov    %r8d,%r9d
xor    %r8d,%r8d
jmp    1030 <ambapp_find_ahbslvs_next@plt>

LLVM IR (-O0):
%struct.ambapp_dev_hdr = type { i32 }
%struct.ambapp_ahb_info = type { i32 }
define i32 @ambapp_find_ahbslvs(%struct.ambapp_dev_hdr* %0, i32 %1, i32 %2, %struct.ambapp_ahb_info* %3, i32 %4) {
%6 = alloca %struct.ambapp_dev_hdr*
%7 = alloca i32
%8 = alloca i32
%9 = alloca %struct.ambapp_ahb_info*
%10 = alloca i32
store %struct.ambapp_dev_hdr* %0, %struct.ambapp_dev_hdr** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store %struct.ambapp_ahb_info* %3, %struct.ambapp_ahb_info** %9
store i32 %4, i32* %10
%11 = load %struct.ambapp_dev_hdr*, %struct.ambapp_dev_hdr** %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = load %struct.ambapp_ahb_info*, %struct.ambapp_ahb_info** %9
%15 = load i32, i32* %10
%16 = call i32 @ambapp_find_ahbslvs_next(%struct.ambapp_dev_hdr* %11, i32 %12, i32 %13, %struct.ambapp_ahb_info* %14, i32 0, i32 %15)
ret i32 %16
}

LLVM IR (-O2):
%struct.ambapp_dev_hdr = type { i32 }
%struct.ambapp_ahb_info = type { i32 }
define i32 @ambapp_find_ahbslvs(%struct.ambapp_dev_hdr* %0, i32 %1, i32 %2, %struct.ambapp_ahb_info* %3, i32 %4) {
%6 = tail call i32 @ambapp_find_ahbslvs_next(%struct.ambapp_dev_hdr* %0, i32 %1, i32 %2, %struct.ambapp_ahb_info* %3, i32 0, i32 %4)
ret i32 %6
}
void gtk_layout_get_hadjustment() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @CloseGraph() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ is_prime(int);
void *thread2_find(void *arg) {
  int i;
  for (i = 90000; i < 140000; i++)
    is_prime(i);
}


x86 assembly (clang, -O0):
<thread2_find>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x15f90,-0x14(%rbp)
cmpl   $0x222e0,-0x14(%rbp)
jge    1146 <thread2_find+0x36>
mov    -0x14(%rbp),%edi
call   1030 <is_prime@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1123 <thread2_find+0x13>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread2_find>:
push   %rbx
mov    $0x15f90,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1030 <is_prime@plt>
add    $0x1,%ebx
cmp    $0x222e0,%ebx
jne    1120 <thread2_find+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define i8* @thread2_find(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 90000, i32* %4
br label %5
5: ; preds = %11, %1
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 140000
br i1 %7, label %8, label %14
8: ; preds = %5
%9 = load i32, i32* %4
%10 = call i32 @is_prime(i32 %9)
br label %11
11: ; preds = %8
%12 = load i32, i32* %4
%13 = add nsw i32 %12, 1
store i32 %13, i32* %4
br label %5
14: ; preds = %5
%15 = load i8*, i8** %2
ret i8* %15
}

LLVM IR (-O2):
define noalias i8* @thread2_find(i8* nocapture readnone %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i32 [ 90000, %1 ], [ %5, %2 ]
%4 = tail call i32 @is_prime(i32 %3)
%5 = add nuw nsw i32 %3, 1
%6 = icmp eq i32 %5, 140000
br i1 %6, label %7, label %2
7: ; preds = %2
ret i8* undef
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;
typedef int /*<<< orphan*/ buffer;

/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ vsnprintf(char *, int, char const *const,
                             int /*<<< orphan*/);
void vprint_error(const char *const format, va_list args) {
  char buffer[1024];
  vsnprintf(buffer, sizeof(buffer), format, args);
  fprintf(stderr, "%s", buffer);
  fflush(stderr);
}


x86 assembly (clang, -O0):
<vprint_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x410(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
mov    $0x400,%esi
call   1030 <vsnprintf@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
lea    -0x410(%rbp),%rdx
lea    0xe8f(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e63(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vprint_error>:
push   %r14
push   %rbx
sub    $0x408,%rsp
mov    %esi,%ecx
mov    %rdi,%rdx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x400,%esi
call   1030 <vsnprintf@plt>
mov    0x2e8a(%rip),%rbx
mov    (%rbx),%edi
lea    0xea1(%rip),%rsi
mov    %r14,%rdx
call   1040 <fprintf@plt>
mov    (%rbx),%edi
call   1050 <fflush@plt>
add    $0x408,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [3 x i8] c"%s\00"
define void @vprint_error(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [1024 x i8]
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = load i32, i32* %4
%9 = call i32 @vsnprintf(i8* %6, i32 1024, i8* %7, i32 %8)
%10 = load i32, i32* @stderr
%11 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%12 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %11)
%13 = load i32, i32* @stderr
%14 = call i32 @fflush(i32 %13)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [3 x i8] c"%s\00"
define void @vprint_error(i8* nocapture %0, i32 %1) {
%3 = alloca [1024 x i8]
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%5 = call i32 @vsnprintf(i8* %4, i32 1024, i8* %0, i32 %1)
%6 = load i32, i32* @stderr
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%8 = load i32, i32* @stderr
%9 = call i32 @fflush(i32 %8)
ret void
}
/* Type definitions */
typedef scalar_t__ addr;

/* Variables and functions */
void *kernel_virt(uintptr_t addr) {
  return (void *)((addr) + 0xffffffff80000000);
}


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

x86 assembly (clang, -O2):
<kernel_virt>:
lea    -0x80000000(%rdi),%rax
ret

LLVM IR (-O0):
define i8* @kernel_virt(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, -2147483648
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}

LLVM IR (-O2):
define i8* @kernel_virt(i64 %0) {
%2 = add i64 %0, -2147483648
%3 = inttoptr i64 %2 to i8*
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *basename) {
  fprintf(stderr, "usage : %s [<programme 1> [<programme 2>]]\n", basename);
  exit(1);
}


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    $0x1,%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    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [44 x i8] c"usage : %s [<programme 1> [<programme 2>]]\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 ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [44 x i8] c"usage : %s [<programme 1> [<programme 2>]]\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int static_lib_function();
int both_lib_function(void) { return static_lib_function(); }


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

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

LLVM IR (-O0):
define i32 @both_lib_function() {
%1 = call i32 (...) @static_lib_function()
ret i32 %1
}

LLVM IR (-O2):
define i32 @both_lib_function() {
%1 = tail call i32 (...) @static_lib_function()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int getNum() {
  int num1;
  printf("\nEnter an integer: ");
  scanf("%d", &num1);
  return num1;
}


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

x86 assembly (clang, -O2):
<getNum>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
lea    0xee0(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"\0AEnter an integer: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @getNum() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@.str = [20 x i8] c"\0AEnter an integer: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @getNum() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
ret i32 %5
}
void ble_rsp_dfu_flash_upload_finish(
    const struct ble_msg_dfu_flash_upload_finish_rsp_t *msg) {}


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

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

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

LLVM IR (-O2):
%struct.ble_msg_dfu_flash_upload_finish_rsp_t = type opaque
define void @ble_rsp_dfu_flash_upload_finish(%struct.ble_msg_dfu_flash_upload_finish_rsp_t* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_cstrerror() {
  printf("NOT IMPLEMENTED:"
         "pa_cstrerror"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [30 x i8] c"NOT IMPLEMENTED:pa_cstrerror\0A\00"
define i32 @pa_cstrerror() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [29 x i8] c"NOT IMPLEMENTED:pa_cstrerror\00"
define i32 @pa_cstrerror() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
int estPuissanceDeux(int x) { return (x & (x - 1)) == 0; }


x86 assembly (clang, -O0):
<estPuissanceDeux>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<estPuissanceDeux>:
lea    -0x1(%rdi),%ecx
xor    %eax,%eax
test   %ecx,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @estPuissanceDeux(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = sub nsw i32 %4, 1
%6 = and i32 %3, %5
%7 = icmp eq i32 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @estPuissanceDeux(i32 %0) {
%2 = tail call i32 @llvm.ctpop.i32(i32 %0)
%3 = icmp ult i32 %2, 2
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
size_t _upper_power(register size_t v) {
  v--;
  v |= v >> 1;
  v |= v >> 2;
  v |= v >> 4;
  v |= v >> 8;
  v |= v >> 16;
  v |= v >> 32;
  return ++v;
}


x86 assembly (clang, -O0):
<_upper_power>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x1,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x2,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x4,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x8,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x10,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x20,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<_upper_power>:
lea    -0x1(%rdi),%rax
mov    %rax,%rcx
shr    %rcx
or     %rax,%rcx
mov    %rcx,%rax
shr    $0x2,%rax
or     %rcx,%rax
mov    %rax,%rcx
shr    $0x4,%rcx
or     %rax,%rcx
mov    %rcx,%rax
shr    $0x8,%rax
or     %rcx,%rax
mov    %rax,%rcx
shr    $0x10,%rcx
or     %rax,%rcx
mov    %rcx,%rax
shr    $0x20,%rax
or     %rcx,%rax
add    $0x1,%rax
ret

LLVM IR (-O0):
define i64 @_upper_power(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, -1
store i64 %4, i64* %2
%5 = load i64, i64* %2
%6 = lshr i64 %5, 1
%7 = load i64, i64* %2
%8 = or i64 %7, %6
store i64 %8, i64* %2
%9 = load i64, i64* %2
%10 = lshr i64 %9, 2
%11 = load i64, i64* %2
%12 = or i64 %11, %10
store i64 %12, i64* %2
%13 = load i64, i64* %2
%14 = lshr i64 %13, 4
%15 = load i64, i64* %2
%16 = or i64 %15, %14
store i64 %16, i64* %2
%17 = load i64, i64* %2
%18 = lshr i64 %17, 8
%19 = load i64, i64* %2
%20 = or i64 %19, %18
store i64 %20, i64* %2
%21 = load i64, i64* %2
%22 = lshr i64 %21, 16
%23 = load i64, i64* %2
%24 = or i64 %23, %22
store i64 %24, i64* %2
%25 = load i64, i64* %2
%26 = lshr i64 %25, 32
%27 = load i64, i64* %2
%28 = or i64 %27, %26
store i64 %28, i64* %2
%29 = load i64, i64* %2
%30 = add i64 %29, 1
store i64 %30, i64* %2
ret i64 %30
}

LLVM IR (-O2):
define i64 @_upper_power(i64 %0) {
%2 = add i64 %0, -1
%3 = lshr i64 %2, 1
%4 = or i64 %3, %2
%5 = lshr i64 %4, 2
%6 = or i64 %5, %4
%7 = lshr i64 %6, 4
%8 = or i64 %7, %6
%9 = lshr i64 %8, 8
%10 = or i64 %9, %8
%11 = lshr i64 %10, 16
%12 = or i64 %11, %10
%13 = lshr i64 %12, 32
%14 = or i64 %13, %12
%15 = add i64 %14, 1
ret i64 %15
}
/* Variables and functions */
float logf(float);
float gb_log(float x) { return logf(x); }


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

x86 assembly (clang, -O2):
<gb_log>:
jmp    1030 <logf@plt>

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

LLVM IR (-O2):
define float @gb_log(float %0) {
%2 = tail call float @logf(float %0)
ret float %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
const uint8_t *get_transport6(const uint8_t *b, uint32_t blen) {
  return b + 40;
}


x86 assembly (clang, -O0):
<get_transport6>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0xa0,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_transport6>:
lea    0xa0(%rdi),%rax
ret

LLVM IR (-O0):
define i32* @get_transport6(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 = getelementptr inbounds i32, i32* %5, i64 40
ret i32* %6
}

LLVM IR (-O2):
define i32* @get_transport6(i32* readnone %0, i32 %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 40
ret i32* %3
}
/* Variables and functions */
int /*<<< orphan*/ _bad_return_address(int);
void bad_return_l1dataA(void) { _bad_return_address(0xFF800000); }


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

x86 assembly (clang, -O2):
<bad_return_l1dataA>:
mov    $0xff800000,%edi
jmp    1030 <_bad_return_address@plt>

LLVM IR (-O0):
define void @bad_return_l1dataA() {
%1 = call i32 @_bad_return_address(i32 -8388608)
ret void
}

LLVM IR (-O2):
define void @bad_return_l1dataA() {
%1 = tail call i32 @_bad_return_address(i32 -8388608)
ret void
}
void I2SIntClear(unsigned long ulBase, unsigned long ulIntFlags) {
  ;

  ;
  (*((volatile unsigned long *)(ulBase + 0x00000C1C))) = ulIntFlags;
}


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

x86 assembly (clang, -O2):
<I2SIntClear>:
mov    %rsi,0xc1c(%rdi)
ret

LLVM IR (-O0):
define void @I2SIntClear(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = add i64 %6, 3100
%8 = inttoptr i64 %7 to i64*
store volatile i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @I2SIntClear(i64 %0, i64 %1) {
%3 = add i64 %0, 3100
%4 = inttoptr i64 %3 to i64*
store volatile i64 %1, i64* %4
ret void
}
void foo050() {}


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

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

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

LLVM IR (-O2):
define void @foo050() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sh_unsetenv(char *);
int /*<<< orphan*/ unset_func(char *);
int /*<<< orphan*/ unset_local_var(char *);
void unset_var_func(char *name) {
  if (!unset_local_var(name)) {
    if (!sh_unsetenv(name)) {
      unset_func(name);
    }
  }
}


x86 assembly (clang, -O0):
<unset_var_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <unset_local_var@plt>
cmp    $0x0,%eax
jne    116e <unset_var_func+0x3e>
mov    -0x8(%rbp),%rdi
call   1030 <sh_unsetenv@plt>
cmp    $0x0,%eax
jne    1169 <unset_var_func+0x39>
mov    -0x8(%rbp),%rdi
call   1050 <unset_func@plt>
jmp    116e <unset_var_func+0x3e>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unset_var_func>:
push   %rbx
mov    %rdi,%rbx
call   1040 <unset_local_var@plt>
test   %eax,%eax
jne    1149 <unset_var_func+0x19>
mov    %rbx,%rdi
call   1030 <sh_unsetenv@plt>
test   %eax,%eax
je     114b <unset_var_func+0x1b>
pop    %rbx
ret
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <unset_func@plt>

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

LLVM IR (-O2):
define void @unset_var_func(i8* %0) {
%2 = tail call i32 @unset_local_var(i8* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = tail call i32 @sh_unsetenv(i8* %0)
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i32 @unset_func(i8* %0)
br label %9
9: ; preds = %4, %7, %1
ret void
}
void ff_hevc_put_hevc_uni_w_qpel_hv12_8_sse4() {}


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

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

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

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

/* Variables and functions */
int TsPid(const uint8_t *p) { return (p[1] & 0x1F) * 256 + p[2]; }


x86 assembly (clang, -O0):
<TsPid>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
and    $0x1f,%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
add    0x8(%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<TsPid>:
mov    0x4(%rdi),%eax
and    $0x1f,%eax
shl    $0x8,%eax
add    0x8(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @TsPid(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
%3 = load i32, i32* %2
%4 = shl i32 %3, 8
%5 = and i32 %4, 7936
%6 = getelementptr inbounds i32, i32* %0, i64 2
%7 = load i32, i32* %6
%8 = add nsw i32 %5, %7
ret i32 %8
}
long __syscall3(long n, long a1, long a2, long a3) {
  unsigned long __ret;
  __asm__ __volatile__("call *%%gs:16"
                       : "=a"(__ret)
                       : "a"(n), "b"(a1), "c"(a2), "d"(a3)
                       : "memory");
  return __ret;
}


x86 assembly (clang, -O0):
<__syscall3>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rbx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%rdx
call   *%gs:0x10
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<__syscall3>:
push   %rbx
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rbx
mov    %rdi,%rax
mov    %r8,%rdx
call   *%gs:0x10
pop    %rbx
ret

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

LLVM IR (-O2):
define i64 @__syscall3(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = tail call i64 asm sideeffect "call *%gs:16", "={ax},{ax},{bx},{cx},{dx},~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %0, i64 %1, i64 %2, i64 %3)
ret i64 %5
}
int ceil_ln2(int x) {
  int tmp = -1;
  ;
  ;
  ;
  while ((1 << ++tmp) < x)
    ;
  ;
  ;
  return (tmp);
}


x86 assembly (clang, -O0):
<ceil_ln2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0xffffffff,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
mov    $0x1,%eax
shl    %cl,%eax
cmp    -0x4(%rbp),%eax
jge    112c <ceil_ln2+0x2c>
jmp    110e <ceil_ln2+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ceil_ln2>:
mov    $0xffffffff,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%ecx
mov    $0x1,%eax
shl    %cl,%eax
cmp    %edi,%eax
jl     1110 <ceil_ln2+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @ceil_ln2(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ -1, %1 ], [ %4, %2 ]
%4 = add nsw i32 %3, 1
%5 = shl nuw i32 1, %4
%6 = icmp slt i32 %5, %0
br i1 %6, label %2, label %7
7: ; preds = %2
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ WDOG_EWM_DriverIRQHandler();
__attribute__((weak)) void WDOG_EWM_IRQHandler(void) {
  WDOG_EWM_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @WDOG_EWM_IRQHandler() {
%1 = call i32 (...) @WDOG_EWM_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @WDOG_EWM_IRQHandler() {
%1 = tail call i32 (...) @WDOG_EWM_DriverIRQHandler()
ret void
}
void uart_putc(unsigned char ch) {
  while (1) {
    if (((*(volatile unsigned int *)(0x7F005010)) & 6) == 6)
      break;
  }
  (*(volatile unsigned int *)(0x7F005020)) = ch;
  if (ch == '\n')
    uart_putc('\r');
  return;
}


x86 assembly (clang, -O0):
<uart_putc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x7f005010,%eax
mov    (%rax),%eax
and    $0x6,%eax
cmp    $0x6,%eax
jne    1136 <uart_putc+0x26>
jmp    113b <uart_putc+0x2b>
jmp    111e <uart_putc+0xe>
movzbl -0x1(%rbp),%ecx
mov    $0x7f005020,%eax
mov    %ecx,(%rax)
movzbl -0x1(%rbp),%eax
cmp    $0xa,%eax
jne    115d <uart_putc+0x4d>
mov    $0xd,%edi
call   1030 <uart_putc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_putc>:
mov    0x7f005010,%eax
not    %eax
test   $0x6,%al
jne    1100 <uart_putc>
movzbl %dil,%eax
mov    %eax,0x7f005020
cmp    $0xa,%al
jne    1138 <uart_putc+0x38>
nopl   0x0(%rax)
mov    0x7f005010,%eax
not    %eax
test   $0x6,%al
jne    1120 <uart_putc+0x20>
movl   $0xd,0x7f005020
ret

LLVM IR (-O0):
define void @uart_putc(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
br label %3
3: ; preds = %1, %8
%4 = load volatile i32, i32* inttoptr (i64 2130726928 to i32*)
%5 = and i32 %4, 6
%6 = icmp eq i32 %5, 6
br i1 %6, label %7, label %8
7: ; preds = %3
br label %9
8: ; preds = %3
br label %3
9: ; preds = %7
%10 = load i8, i8* %2
%11 = zext i8 %10 to i32
store volatile i32 %11, i32* inttoptr (i64 2130726944 to i32*)
%12 = load i8, i8* %2
%13 = zext i8 %12 to i32
%14 = icmp eq i32 %13, 10
br i1 %14, label %15, label %16
15: ; preds = %9
br label %16
16: ; preds = %15, %9
ret void
}

LLVM IR (-O2):
define void @uart_putc(i8 zeroext %0) {
br label %2
2: ; preds = %2, %1
%3 = load volatile i32, i32* inttoptr (i64 2130726928 to i32*)
%4 = and i32 %3, 6
%5 = icmp eq i32 %4, 6
br i1 %5, label %6, label %2
6: ; preds = %2
%7 = zext i8 %0 to i32
store volatile i32 %7, i32* inttoptr (i64 2130726944 to i32*)
%8 = icmp eq i8 %0, 10
br i1 %8, label %9, label %14
9: ; preds = %6, %9
%10 = load volatile i32, i32* inttoptr (i64 2130726928 to i32*)
%11 = and i32 %10, 6
%12 = icmp eq i32 %11, 6
br i1 %12, label %13, label %9
13: ; preds = %9
store volatile i32 13, i32* inttoptr (i64 2130726944 to i32*)
br label %14
14: ; preds = %13, %6
ret void
}
void ff_hevc_dsp_init_mips() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_dsp_init_mips() {
ret void
}
int getCharacterByName(unsigned char *character, const char *name) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @getCharacterByName(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  short width;
};
typedef TYPE_1__ XCharStruct;

/* Variables and functions */
void set_XCharStruct_width(void *_p, short _v) {
  ((XCharStruct *)_p)->width = (short)_v;
}


x86 assembly (clang, -O0):
<set_XCharStruct_width>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    -0xa(%rbp),%cx
mov    -0x8(%rbp),%rax
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_XCharStruct_width>:
mov    %si,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i16 }
define void @set_XCharStruct_width(i8* %0, i16 signext %1) {
%3 = alloca i8*
%4 = alloca i16
store i8* %0, i8** %3
store i16 %1, i16* %4
%5 = load i16, i16* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i16 %5, i16* %8
ret void
}

LLVM IR (-O2):
define void @set_XCharStruct_width(i8* nocapture writeonly %0, i16 signext %1) {
%3 = bitcast i8* %0 to i16*
store i16 %1, i16* %3
ret void
}
double f4_sum_float_post_double(float v, double v0) {
  return v0 + ((double)(v));
}


x86 assembly (clang, -O0):
<f4_sum_float_post_double>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movss  -0x4(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4_sum_float_post_double>:
cvtss2sd %xmm0,%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @f4_sum_float_post_double(float %0, double %1) {
%3 = alloca float
%4 = alloca double
store float %0, float* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = load float, float* %3
%7 = fpext float %6 to double
%8 = fadd double %5, %7
ret double %8
}

LLVM IR (-O2):
define double @f4_sum_float_post_double(float %0, double %1) {
%3 = fpext float %0 to double
%4 = fadd double %3, %1
ret double %4
}
/* Variables and functions */
int sched_get_priority_min(int /*<<< orphan*/);
int main(void) { return sched_get_priority_min(0); }


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

x86 assembly (clang, -O2):
<main>:
xor    %edi,%edi
jmp    1030 <sched_get_priority_min@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @sched_get_priority_min(i32 0)
ret i32 %1
}
/* Variables and functions */
int rand();
void piedraPapelTijera(int *b) { *b = rand() % 3; }


x86 assembly (clang, -O0):
<piedraPapelTijera>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    -0x8(%rbp),%rax
mov    %edx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<piedraPapelTijera>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x55555556,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,2),%ecx
sub    %ecx,%eax
mov    %eax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @piedraPapelTijera(i32* nocapture writeonly %0) {
%2 = tail call i32 (...) @rand()
%3 = srem i32 %2, 3
store i32 %3, i32* %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m64;

/* Variables and functions */
int /*<<< orphan*/ _mm_add_pi8(int /*<<< orphan*/, int /*<<< orphan*/);
__m64 __attribute__((no, unused)) test(__m64 s1, __m64 s2) {
  return _mm_add_pi8(s1, s2);
}


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

x86 assembly (clang, -O2):
<test>:
jmp    1030 <_mm_add_pi8@plt>

LLVM IR (-O0):
define i32 @test(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 = call i32 @_mm_add_pi8(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_add_pi8(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
long file_mtime(char *);
int file_newer_p(char *a, char *b) {
  long at = file_mtime(a), bt = file_mtime(b);
  return bt == 0 ? 1 : (at != 0 && at >= bt);
}


x86 assembly (clang, -O0):
<file_newer_p>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <file_mtime@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <file_mtime@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1152 <file_newer_p+0x42>
mov    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    117b <file_newer_p+0x6b>
xor    %eax,%eax
cmpq   $0x0,-0x18(%rbp)
mov    %al,-0x25(%rbp)
je     1170 <file_newer_p+0x60>
mov    -0x18(%rbp),%rax
cmp    -0x20(%rbp),%rax
setge  %al
mov    %al,-0x25(%rbp)
mov    -0x25(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_newer_p>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
call   1030 <file_mtime@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1030 <file_mtime@plt>
test   %rax,%rax
sete   %cl
test   %rbx,%rbx
setne  %dl
cmp    %rax,%rbx
setge  %al
and    %dl,%al
or     %cl,%al
movzbl %al,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @file_newer_p(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = call i64 @file_mtime(i8* %7)
store i64 %8, i64* %5
%9 = load i8*, i8** %4
%10 = call i64 @file_mtime(i8* %9)
store i64 %10, i64* %6
%11 = load i64, i64* %6
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %2
br label %24
14: ; preds = %2
%15 = load i64, i64* %5
%16 = icmp ne i64 %15, 0
br i1 %16, label %17, label %21
17: ; preds = %14
%18 = load i64, i64* %5
%19 = load i64, i64* %6
%20 = icmp sge i64 %18, %19
br label %21
21: ; preds = %17, %14
%22 = phi i1 [ false, %14 ], [ %20, %17 ]
%23 = zext i1 %22 to i32
br label %24
24: ; preds = %21, %13
%25 = phi i32 [ 1, %13 ], [ %23, %21 ]
ret i32 %25
}

LLVM IR (-O2):
define i32 @file_newer_p(i8* %0, i8* %1) {
%3 = tail call i64 @file_mtime(i8* %0)
%4 = tail call i64 @file_mtime(i8* %1)
%5 = icmp eq i64 %4, 0
%6 = icmp ne i64 %3, 0
%7 = icmp sge i64 %3, %4
%8 = select i1 %6, i1 %7, i1 false
%9 = select i1 %5, i1 true, i1 %8
%10 = zext i1 %9 to i32
ret i32 %10
}
void decode(char *in __attribute__((__unused__)),
            char *out __attribute__((__unused__)),
            int count __attribute__((__unused__))) {}


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

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

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

LLVM IR (-O2):
define void @decode(i8* nocapture %0, i8* nocapture %1, i32 %2) {
ret void
}
/* Type definitions */
struct iax_ie_data {
  int dummy;
};

/* Variables and functions */
int iax_ie_append_raw(struct iax_ie_data *, unsigned char, unsigned char *,
                      int);
int iax_ie_append_byte(struct iax_ie_data *ied, unsigned char ie,
                       unsigned char dat) {
  return iax_ie_append_raw(ied, ie, &dat, 1);
}


x86 assembly (clang, -O0):
<iax_ie_append_byte>:
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
lea    -0xa(%rbp),%rdx
mov    $0x1,%ecx
movzbl -0x9(%rbp),%esi
call   1030 <iax_ie_append_raw@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iax_ie_append_byte>:
push   %rax
mov    %dl,0x7(%rsp)
lea    0x7(%rsp),%rdx
mov    $0x1,%ecx
call   1030 <iax_ie_append_raw@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.iax_ie_data = type { i32 }
define i32 @iax_ie_append_byte(%struct.iax_ie_data* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca %struct.iax_ie_data*
%5 = alloca i8
%6 = alloca i8
store %struct.iax_ie_data* %0, %struct.iax_ie_data** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%7 = load %struct.iax_ie_data*, %struct.iax_ie_data** %4
%8 = load i8, i8* %5
%9 = call i32 @iax_ie_append_raw(%struct.iax_ie_data* %7, i8 zeroext %8, i8* %6, i32 1)
ret i32 %9
}

LLVM IR (-O2):
%struct.iax_ie_data = type { i32 }
define i32 @iax_ie_append_byte(%struct.iax_ie_data* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8
store i8 %2, i8* %4
%5 = call i32 @iax_ie_append_raw(%struct.iax_ie_data* %0, i8 zeroext %1, i8* %4, i32 1)
ret i32 %5
}
int set_bit(int number, int index) { return number | (1 << index); }


x86 assembly (clang, -O0):
<set_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_bit>:
mov    %edi,%eax
bts    %esi,%eax
ret

LLVM IR (-O0):
define i32 @set_bit(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 = shl i32 1, %6
%8 = or i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @set_bit(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = or i32 %3, %0
ret i32 %4
}
void arg_test(int x, char *z) {}


x86 assembly (clang, -O0):
<arg_test>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @arg_test(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
define void @arg_test(i32 %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf_verbose(char *);
int snd_pcm_open(void) {
  printf_verbose("snd_pcm_open(...) = BLOCKED;");
  return -1;
}


x86 assembly (clang, -O0):
<snd_pcm_open>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf_verbose@plt>
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<snd_pcm_open>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <printf_verbose@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"snd_pcm_open(...) = BLOCKED;\00"
define i32 @snd_pcm_open() {
%1 = call i32 @printf_verbose(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
@.str = [29 x i8] c"snd_pcm_open(...) = BLOCKED;\00"
define i32 @snd_pcm_open() {
%1 = tail call i32 @printf_verbose(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ EINVAL;
int /*<<< orphan*/ TCSBRKP;
int /*<<< orphan*/ errno;
int ioctl(int, int /*<<< orphan*/, int /*<<< orphan*/);
int tcsendbreak(int fd, int duration) {
  if (duration <= 0)
    return (ioctl(fd, TCSBRKP, 0));
  errno = EINVAL;
  return (-1);
}


x86 assembly (clang, -O0):
<tcsendbreak>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jg     1143 <tcsendbreak+0x33>
mov    -0x8(%rbp),%edi
mov    0x2ebe(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <ioctl@plt>
mov    %eax,-0x4(%rbp)
jmp    115c <tcsendbreak+0x4c>
mov    0x2e86(%rip),%rax
mov    (%rax),%ecx
mov    0x2e85(%rip),%rax
mov    %ecx,(%rax)
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tcsendbreak>:
test   %esi,%esi
jle    112c <tcsendbreak+0x1c>
mov    0x2eb5(%rip),%rax
mov    (%rax),%eax
mov    0x2eb4(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret
mov    0x2ebd(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
jmp    1030 <ioctl@plt>

LLVM IR (-O0):
@TCSBRKP = global i32 0
@EINVAL = global i32 0
@errno = global i32 0
define i32 @tcsendbreak(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = icmp sle i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i32, i32* %4
%10 = load i32, i32* @TCSBRKP
%11 = call i32 @ioctl(i32 %9, i32 %10, i32 0)
store i32 %11, i32* %3
br label %14
12: ; preds = %2
%13 = load i32, i32* @EINVAL
store i32 %13, i32* @errno
store i32 -1, i32* %3
br label %14
14: ; preds = %12, %8
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
@TCSBRKP = global i32 0
@EINVAL = global i32 0
@errno = global i32 0
define i32 @tcsendbreak(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, 1
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = load i32, i32* @TCSBRKP
%6 = tail call i32 @ioctl(i32 %0, i32 %5, i32 0)
br label %9
7: ; preds = %2
%8 = load i32, i32* @EINVAL
store i32 %8, i32* @errno
br label %9
9: ; preds = %7, %4
%10 = phi i32 [ %6, %4 ], [ -1, %7 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ barrier();
void cpu_relax(void) { barrier(); }


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

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

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

LLVM IR (-O2):
define void @cpu_relax() {
%1 = tail call i32 (...) @barrier()
ret void
}
void rop3_47_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = ~*D;
  stk2 = S | stk3;
  stk1 = T & stk2;
  stk1 = ~stk1;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_47_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
xor    $0xffffffff,%eax
mov    %al,-0xd(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xd(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xc(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_47_0_0>:
mov    (%rdi),%al
not    %al
or     %sil,%al
and    %dl,%al
not    %al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_47_0_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8*, i8** %4
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = xor i32 %12, -1
%14 = trunc i32 %13 to i8
store i8 %14, i8* %9
%15 = load i8, i8* %5
%16 = zext i8 %15 to i32
%17 = load i8, i8* %9
%18 = zext i8 %17 to i32
%19 = or i32 %16, %18
%20 = trunc i32 %19 to i8
store i8 %20, i8* %8
%21 = load i8, i8* %6
%22 = zext i8 %21 to i32
%23 = load i8, i8* %8
%24 = zext i8 %23 to i32
%25 = and i32 %22, %24
%26 = trunc i32 %25 to i8
store i8 %26, i8* %7
%27 = load i8, i8* %7
%28 = zext i8 %27 to i32
%29 = xor i32 %28, -1
%30 = trunc i32 %29 to i8
store i8 %30, i8* %7
%31 = load i8, i8* %7
%32 = load i8*, i8** %4
store i8 %31, i8* %32
ret void
}

LLVM IR (-O2):
define void @rop3_47_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %4, -1
%6 = or i8 %5, %1
%7 = and i8 %6, %2
%8 = xor i8 %7, -1
store i8 %8, i8* %0
ret void
}
int test_imm_D4int64_midword_mem(long long *val) {
  return ((*val >> 16) & (0xD4 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_D4int64_midword_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, 16
%6 = and i64 %5, 212
%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_D4int64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 13893632
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}