xunge/DecIR huggingface dataset:
__attribute__((always_)) void __set_bit(int nr, volatile unsigned long *addr) {
  __asm__("btsl %1,%0" : "=m"((*(volatile long *)addr)) : "Ir"(nr));
}


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

x86 assembly (clang, -O2):
<__set_bit>:
bts    %edi,(%rsi)
ret

LLVM IR (-O0):
define void @__set_bit(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64*
store i32 %0, i32* %3
store i64* %1, i64** %4
%5 = load i64*, i64** %4
%6 = load i32, i32* %3
ret void
}

LLVM IR (-O2):
define void @__set_bit(i32 %0, i64* %1) {
tail call void asm "btsl $1,$0", "=*m,Ir,~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %1, i32 %0)
ret void
}
int yaffs_CountBits(unsigned char x) {
  int r = 0;
  while (x) {
    if (x & 1)
      r++;
    x >>= 1;
  }
  return r;
}


x86 assembly (clang, -O0):
<yaffs_CountBits>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movl   $0x0,-0x8(%rbp)
cmpb   $0x0,-0x1(%rbp)
je     1143 <yaffs_CountBits+0x43>
movzbl -0x1(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1134 <yaffs_CountBits+0x34>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
sar    $0x1,%eax
mov    %al,-0x1(%rbp)
jmp    1111 <yaffs_CountBits+0x11>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<yaffs_CountBits>:
xor    %eax,%eax
test   %edi,%edi
je     1124 <yaffs_CountBits+0x24>
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
mov    %edi,%edx
and    $0x1,%dl
movzbl %dl,%edx
add    %edx,%eax
shr    %cl
cmp    $0x1,%dil
mov    %ecx,%edi
ja     1110 <yaffs_CountBits+0x10>
ret

LLVM IR (-O0):
define i32 @yaffs_CountBits(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
store i32 0, i32* %3
br label %4
4: ; preds = %15, %1
%5 = load i8, i8* %2
%6 = icmp ne i8 %5, 0
br i1 %6, label %7, label %20
7: ; preds = %4
%8 = load i8, i8* %2
%9 = zext i8 %8 to i32
%10 = and i32 %9, 1
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %7
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %15
15: ; preds = %12, %7
%16 = load i8, i8* %2
%17 = zext i8 %16 to i32
%18 = ashr i32 %17, 1
%19 = trunc i32 %18 to i8
store i8 %19, i8* %2
br label %4
20: ; preds = %4
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @yaffs_CountBits(i8 zeroext %0) {
%2 = icmp eq i8 %0, 0
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ 0, %1 ]
%5 = phi i8 [ %9, %3 ], [ %0, %1 ]
%6 = and i8 %5, 1
%7 = zext i8 %6 to i32
%8 = add nuw nsw i32 %4, %7
%9 = lshr i8 %5, 1
%10 = icmp ult i8 %5, 2
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %12
}
void handler(int x) {}


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

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

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

LLVM IR (-O2):
define void @handler(i32 %0) {
ret void
}
unsigned long readl(unsigned long addr) {
  volatile unsigned long *p = (volatile unsigned long *)addr;
  return *p;
}


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

x86 assembly (clang, -O2):
<readl>:
mov    (%rdi),%rax
ret

LLVM IR (-O0):
define i64 @readl(i64 %0) {
%2 = alloca i64
%3 = alloca i64*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = inttoptr i64 %4 to i64*
store i64* %5, i64** %3
%6 = load i64*, i64** %3
%7 = load volatile i64, i64* %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @readl(i64 %0) {
%2 = inttoptr i64 %0 to i64*
%3 = load volatile i64, i64* %2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ a_readlock(int /*<<< orphan*/, int /*<<< orphan*/);
void b_readlock(void) { a_readlock(0, 0); }


x86 assembly (clang, -O0):
<b_readlock>:
push   %rbp
mov    %rsp,%rbp
xor    %esi,%esi
mov    %esi,%edi
call   1030 <a_readlock@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_readlock>:
xor    %edi,%edi
xor    %esi,%esi
jmp    1030 <a_readlock@plt>

LLVM IR (-O0):
define void @b_readlock() {
%1 = call i32 @a_readlock(i32 0, i32 0)
ret void
}

LLVM IR (-O2):
define void @b_readlock() {
%1 = tail call i32 @a_readlock(i32 0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ unlink(char *);
void cleanup() { unlink("test_timemachine.conf"); }


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

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

LLVM IR (-O0):
@.str = [22 x i8] c"test_timemachine.conf\00"
define void @cleanup() {
%1 = call i32 @unlink(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"test_timemachine.conf\00"
define void @cleanup() {
%1 = tail call i32 @unlink(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret void
}
unsigned long int foo(signed char b, signed char e) {
  return ((2ULL * b) * (e * 13)) * (32 << 24);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbq -0x1(%rbp),%rax
shl    $0x1,%rax
movsbl -0x2(%rbp),%ecx
imul   $0xd,%ecx,%ecx
movslq %ecx,%rcx
imul   %rcx,%rax
shl    $0x1d,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movslq %edi,%rax
movslq %esi,%rcx
imul   %rax,%rcx
movabs $0x340000000,%rax
imul   %rcx,%rax
ret

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

LLVM IR (-O2):
define i64 @foo(i8 signext %0, i8 signext %1) {
%3 = sext i8 %0 to i64
%4 = sext i8 %1 to i64
%5 = mul nsw i64 %3, 13958643712
%6 = mul nsw i64 %5, %4
ret i64 %6
}
/* Variables and functions */
scalar_t__ GC_realloc(void *, size_t);
void *GC_realloc_hint(void *x, size_t old_size, size_t new_size) {
  return (void *)GC_realloc(x, new_size);
}


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

x86 assembly (clang, -O2):
<GC_realloc_hint>:
mov    %rdx,%rsi
jmp    1030 <GC_realloc@plt>

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

LLVM IR (-O2):
define i8* @GC_realloc_hint(i8* %0, i64 %1, i64 %2) {
%4 = tail call i64 @GC_realloc(i8* %0, i64 %2)
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}
/* Variables and functions */
int do_stuff();
int /*<<< orphan*/ release();
int f2() {
  int err = do_stuff();
  if (err)
    release();
  return err;
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <do_stuff@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1143 <f2+0x23>
mov    $0x0,%al
call   1030 <release@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
push   %rbx
xor    %eax,%eax
call   1040 <do_stuff@plt>
mov    %eax,%ebx
test   %eax,%eax
je     1135 <f2+0x15>
xor    %eax,%eax
call   1030 <release@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @f2() {
%1 = tail call i32 (...) @do_stuff()
%2 = icmp eq i32 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @release()
br label %5
5: ; preds = %3, %0
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ roadmap_lang_get(char *);
int /*<<< orphan*/ roadmap_main_remove_periodic(void (*)());
int /*<<< orphan*/ roadmap_messagebox(char *, int /*<<< orphan*/);
int /*<<< orphan*/ roadmap_twitter_setting_dialog();
void twitter_network_error(void) {
  roadmap_main_remove_periodic(twitter_network_error);
  roadmap_twitter_setting_dialog();
  roadmap_messagebox("Error",
                     roadmap_lang_get("There is no network connection.Updating "
                                      "your twitter account details failed."));
}


x86 assembly (clang, -O0):
<twitter_network_error>:
push   %rbp
mov    %rsp,%rbp
mov    0x2e95(%rip),%rdi
call   1050 <roadmap_main_remove_periodic@plt>
mov    $0x0,%al
call   1040 <roadmap_twitter_setting_dialog@plt>
lea    0xea8(%rip),%rdi
call   1030 <roadmap_lang_get@plt>
mov    %eax,%esi
lea    0xe94(%rip),%rdi
call   1060 <roadmap_messagebox@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<twitter_network_error>:
push   %rax
mov    0x2e98(%rip),%rdi
call   1050 <roadmap_main_remove_periodic@plt>
xor    %eax,%eax
call   1040 <roadmap_twitter_setting_dialog@plt>
lea    0xeab(%rip),%rdi
call   1030 <roadmap_lang_get@plt>
lea    0xe99(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1060 <roadmap_messagebox@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"Error\00"
@.str.1 = [77 x i8] c"There is no network connection.Updating your twitter account details failed.\00"
define void @twitter_network_error() {
%1 = call i32 @roadmap_main_remove_periodic(void (...)* bitcast (void ()* @twitter_network_error to void (...)*))
%2 = call i32 (...) @roadmap_twitter_setting_dialog()
%3 = call i32 @roadmap_lang_get(i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @roadmap_messagebox(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"Error\00"
@.str.1 = [77 x i8] c"There is no network connection.Updating your twitter account details failed.\00"
define void @twitter_network_error() {
%1 = tail call i32 @roadmap_main_remove_periodic(void (...)* bitcast (void ()* @twitter_network_error to void (...)*))
%2 = tail call i32 (...) @roadmap_twitter_setting_dialog()
%3 = tail call i32 @roadmap_lang_get(i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @roadmap_messagebox(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ drv_Newhaven_sendCommand(char, int /*<<< orphan*/ *,
                                            int /*<<< orphan*/);
void __attribute__((unused)) drv_Newhaven_display_off(void) {
  char cmd;
  cmd = 0x42;
  drv_Newhaven_sendCommand(cmd, NULL, 0);
}


x86 assembly (clang, -O0):
<drv_Newhaven_display_off>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x42,-0x1(%rbp)
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
movsbl -0x1(%rbp),%edi
call   1030 <drv_Newhaven_sendCommand@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drv_Newhaven_display_off>:
mov    $0x42,%edi
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <drv_Newhaven_sendCommand@plt>

LLVM IR (-O0):
define void @drv_Newhaven_display_off() {
%1 = alloca i8
store i8 66, i8* %1
%2 = load i8, i8* %1
%3 = call i32 @drv_Newhaven_sendCommand(i8 signext %2, i32* null, i32 0)
ret void
}

LLVM IR (-O2):
define void @drv_Newhaven_display_off() {
%1 = tail call i32 @drv_Newhaven_sendCommand(i8 signext 66, i32* null, i32 0)
ret void
}
/* Variables and functions */
unsigned long saturateAddBound(unsigned long, int);
unsigned long compressBound(unsigned long sourceLen) {
  unsigned long complen = sourceLen;
  complen = saturateAddBound(complen, sourceLen >> 12);
  complen = saturateAddBound(complen, sourceLen >> 14);
  complen = saturateAddBound(complen, sourceLen >> 25);
  complen = saturateAddBound(complen, 13);
  return complen;
}


x86 assembly (clang, -O0):
<compressBound>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rax
shr    $0xc,%rax
mov    %eax,%esi
call   1030 <saturateAddBound@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rax
shr    $0xe,%rax
mov    %eax,%esi
call   1030 <saturateAddBound@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rax
shr    $0x19,%rax
mov    %eax,%esi
call   1030 <saturateAddBound@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0xd,%esi
call   1030 <saturateAddBound@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compressBound>:
push   %rbx
mov    %rdi,%rbx
mov    %rdi,%rsi
shr    $0xc,%rsi
call   1030 <saturateAddBound@plt>
mov    %rbx,%rsi
shr    $0xe,%rsi
mov    %rax,%rdi
call   1030 <saturateAddBound@plt>
shr    $0x19,%rbx
mov    %rax,%rdi
mov    %ebx,%esi
call   1030 <saturateAddBound@plt>
mov    %rax,%rdi
mov    $0xd,%esi
pop    %rbx
jmp    1030 <saturateAddBound@plt>

LLVM IR (-O0):
define i64 @compressBound(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
store i64 %4, i64* %3
%5 = load i64, i64* %3
%6 = load i64, i64* %2
%7 = lshr i64 %6, 12
%8 = trunc i64 %7 to i32
%9 = call i64 @saturateAddBound(i64 %5, i32 %8)
store i64 %9, i64* %3
%10 = load i64, i64* %3
%11 = load i64, i64* %2
%12 = lshr i64 %11, 14
%13 = trunc i64 %12 to i32
%14 = call i64 @saturateAddBound(i64 %10, i32 %13)
store i64 %14, i64* %3
%15 = load i64, i64* %3
%16 = load i64, i64* %2
%17 = lshr i64 %16, 25
%18 = trunc i64 %17 to i32
%19 = call i64 @saturateAddBound(i64 %15, i32 %18)
store i64 %19, i64* %3
%20 = load i64, i64* %3
%21 = call i64 @saturateAddBound(i64 %20, i32 13)
store i64 %21, i64* %3
%22 = load i64, i64* %3
ret i64 %22
}

LLVM IR (-O2):
define i64 @compressBound(i64 %0) {
%2 = lshr i64 %0, 12
%3 = trunc i64 %2 to i32
%4 = tail call i64 @saturateAddBound(i64 %0, i32 %3)
%5 = lshr i64 %0, 14
%6 = trunc i64 %5 to i32
%7 = tail call i64 @saturateAddBound(i64 %4, i32 %6)
%8 = lshr i64 %0, 25
%9 = trunc i64 %8 to i32
%10 = tail call i64 @saturateAddBound(i64 %7, i32 %9)
%11 = tail call i64 @saturateAddBound(i64 %10, i32 13)
ret i64 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ uart_getc();
int /*<<< orphan*/ uart_init();
int /*<<< orphan*/ uart_putc(int /*<<< orphan*/);
int /*<<< orphan*/ uart_puts(char *);
void kernel(uint32_t r0, uint32_t r1, uint32_t atags) {
  (void)r0;
  (void)r1;
  (void)atags;
  uart_init();
  uart_puts("Hello, Raspberry Pi world!\r\n");
  while (1)
    uart_putc(uart_getc());
}


x86 assembly (clang, -O0):
<kernel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    $0x0,%al
call   1040 <uart_init@plt>
lea    0xea1(%rip),%rdi
call   1060 <uart_puts@plt>
mov    $0x0,%al
call   1050 <uart_getc@plt>
mov    %eax,%edi
call   1030 <uart_putc@plt>
jmp    1164 <kernel+0x24>

x86 assembly (clang, -O2):
<kernel>:
push   %rax
xor    %eax,%eax
call   1040 <uart_init@plt>
lea    0xeb1(%rip),%rdi
call   1060 <uart_puts@plt>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1050 <uart_getc@plt>
mov    %eax,%edi
call   1030 <uart_putc@plt>
jmp    1160 <kernel+0x20>

LLVM IR (-O0):
@.str = [29 x i8] c"Hello, Raspberry Pi world!\0D\0A\00"
define void @kernel(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 (...) @uart_init()
%11 = call i32 @uart_puts(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %3, %12
%13 = call i32 (...) @uart_getc()
%14 = call i32 @uart_putc(i32 %13)
br label %12
}

LLVM IR (-O2):
@.str = [29 x i8] c"Hello, Raspberry Pi world!\0D\0A\00"
define void @kernel(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 (...) @uart_init()
%5 = tail call i32 @uart_puts(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %3, %6
%7 = tail call i32 (...) @uart_getc()
%8 = tail call i32 @uart_putc(i32 %7)
br label %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ rdpmc(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                         unsigned int const);
int /*<<< orphan*/ u32_to_64(int /*<<< orphan*/, int /*<<< orphan*/);
__attribute__((__unused__, __always___)) __attribute__((__artificial__))
uint64_t
rdpmcl(const unsigned int selector) {
  uint32_t high, low;
  rdpmc(&low, &high, selector);
  return u32_to_64(low, high);
}


x86 assembly (clang, -O0):
<rdpmcl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    -0xc(%rbp),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <rdpmc@plt>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <u32_to_64@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rdpmcl>:
push   %rax
mov    %edi,%edx
mov    %rsp,%rdi
lea    0x4(%rsp),%rsi
call   1040 <rdpmc@plt>
mov    (%rsp),%edi
mov    0x4(%rsp),%esi
call   1030 <u32_to_64@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @rdpmcl(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = call i32 @rdpmc(i32* %4, i32* %3, i32 %5)
%7 = load i32, i32* %4
%8 = load i32, i32* %3
%9 = call i32 @u32_to_64(i32 %7, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @rdpmcl(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %2 to i8*
%5 = bitcast i32* %3 to i8*
%6 = call i32 @rdpmc(i32* %3, i32* %2, i32 %0)
%7 = load i32, i32* %3
%8 = load i32, i32* %2
%9 = call i32 @u32_to_64(i32 %7, i32 %8)
ret i32 %9
}
char *sccsid(void) {
  return ("@(#)sysstat-"
          "8.1.5"
          ": "
          "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/odit/rv042/refs/heads/master/linux/"
          "embedded_rootfs/pkg_addon/sysstat-8.1.5/iostat.c"
          " compiled "
          "Mar 16 2022"
          " "
          "14:55:07");
}


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

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

LLVM IR (-O0):
@.str = [223 x i8] c"@(#)sysstat-8.1.5: /scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/odit/rv042/refs/heads/master/linux/embedded_rootfs/pkg_addon/sysstat-8.1.5/iostat.c compiled Mar 16 2022 14:55:07\00"
define i8* @sccsid() {
ret i8* getelementptr inbounds ([223 x i8], [223 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [223 x i8] c"@(#)sysstat-8.1.5: /scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/odit/rv042/refs/heads/master/linux/embedded_rootfs/pkg_addon/sysstat-8.1.5/iostat.c compiled Mar 16 2022 14:55:07\00"
define i8* @sccsid() {
ret i8* getelementptr inbounds ([223 x i8], [223 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ WNOHANG;
scalar_t__ waitpid(int, int /*<<< orphan*/ *, int /*<<< orphan*/);
void sigchld_handlr(int s) {
  while (waitpid(-1, NULL, WNOHANG) > 0)
    ;
}


x86 assembly (clang, -O0):
<sigchld_handlr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ec6(%rip),%rax
mov    (%rax),%edx
mov    $0xffffffff,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <waitpid@plt>
cmp    $0x0,%rax
jle    1141 <sigchld_handlr+0x31>
jmp    111b <sigchld_handlr+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigchld_handlr>:
push   %rbx
mov    0x2ed0(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    (%rbx),%edx
mov    $0xffffffff,%edi
xor    %esi,%esi
call   1030 <waitpid@plt>
test   %rax,%rax
jg     1120 <sigchld_handlr+0x10>
pop    %rbx
ret

LLVM IR (-O0):
@WNOHANG = global i32 0
define void @sigchld_handlr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %7, %1
%4 = load i32, i32* @WNOHANG
%5 = call i64 @waitpid(i32 -1, i32* null, i32 %4)
%6 = icmp sgt i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %3
br label %3
8: ; preds = %3
ret void
}

LLVM IR (-O2):
@WNOHANG = global i32 0
define void @sigchld_handlr(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = load i32, i32* @WNOHANG
%4 = tail call i64 @waitpid(i32 -1, i32* null, i32 %3)
%5 = icmp sgt i64 %4, 0
br i1 %5, label %2, label %6
6: ; preds = %2
ret void
}
/* Variables and functions */
int execve(char *, char **, char **);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int);
int /*<<< orphan*/ stderr;
int main(int argc, char **argv, char **envp) {
  int retVal = execve(argv[1], &argv[1], envp);
  fprintf(stderr, "%s: exec returned %d\n", argv[0], retVal);
  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    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rsi
add    $0x8,%rsi
mov    -0x18(%rbp),%rdx
call   1030 <execve@plt>
mov    %eax,-0x1c(%rbp)
mov    0x2e83(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
mov    -0x1c(%rbp),%ecx
lea    0xe90(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
add    $0x8,%rsi
mov    0x8(%rbx),%rdi
call   1030 <execve@plt>
mov    0x2ea8(%rip),%rcx
mov    (%rcx),%edi
mov    (%rbx),%rdx
lea    0xebc(%rip),%rsi
mov    %eax,%ecx
call   1040 <fprintf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [22 x i8] c"%s: exec returned %d\0A\00"
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8**
%8 = alloca i32
store i32 0, i32* %4
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
%9 = load i8**, i8*** %6
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = load i8**, i8*** %6
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8**, i8*** %7
%15 = call i32 @execve(i8* %11, i8** %13, i8** %14)
store i32 %15, i32* %8
%16 = load i32, i32* @stderr
%17 = load i8**, i8*** %6
%18 = getelementptr inbounds i8*, i8** %17, i64 0
%19 = load i8*, i8** %18
%20 = load i32, i32* %8
%21 = call i32 @fprintf(i32 %16, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %19, i32 %20)
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [22 x i8] c"%s: exec returned %d\0A\00"
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = getelementptr inbounds i8*, i8** %1, i64 1
%5 = load i8*, i8** %4
%6 = tail call i32 @execve(i8* %5, i8** %4, i8** %2)
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %1
%9 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %8, i32 %6)
ret i32 0
}
/* Variables and functions */
double RAND_MAX;
int rand();
int rand_limit(int lim) { return rand() * (lim / (RAND_MAX + 1.0)); }


x86 assembly (clang, -O0):
<rand_limit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2sd %eax,%xmm0
cvtsi2sdl -0x4(%rbp),%xmm1
movsd  0xecd(%rip),%xmm2
mov    0x2eae(%rip),%rax
addsd  (%rax),%xmm2
divsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_limit>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2sd %eax,%xmm0
cvtsi2sd %ebx,%xmm1
mov    0x2ebf(%rip),%rax
movsd  (%rax),%xmm2
addsd  0xecb(%rip),%xmm2
divsd  %xmm2,%xmm1
mulsd  %xmm0,%xmm1
cvttsd2si %xmm1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define i32 @rand_limit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @rand()
%4 = sitofp i32 %3 to double
%5 = load i32, i32* %2
%6 = sitofp i32 %5 to double
%7 = load double, double* @RAND_MAX
%8 = fadd double %7, 1.000000e+00
%9 = fdiv double %6, %8
%10 = fmul double %4, %9
%11 = fptosi double %10 to i32
ret i32 %11
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define i32 @rand_limit(i32 %0) {
%2 = tail call i32 (...) @rand()
%3 = sitofp i32 %2 to double
%4 = sitofp i32 %0 to double
%5 = load double, double* @RAND_MAX
%6 = fadd double %5, 1.000000e+00
%7 = fdiv double %4, %6
%8 = fmul double %7, %3
%9 = fptosi double %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
char *getprogname();
int /*<<< orphan*/ stderr;
void usage(void) {
  (void)fprintf(stderr, "usage: %s [-d | -p] [-t tty] [-w wtmp] [users ...]\n",
                getprogname());
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getprogname@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rdx
lea    0xea8(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2ea8(%rip),%rax
mov    (%rax),%ebx
xor    %eax,%eax
call   1030 <getprogname@plt>
lea    0xeb8(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [52 x i8] c"usage: %s [-d | -p] [-t tty] [-w wtmp] [users ...]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i8* (...) @getprogname()
%3 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [52 x i8] c"usage: %s [-d | -p] [-t tty] [-w wtmp] [users ...]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i8* (...) @getprogname()
%3 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = tail call i32 @exit(i32 1)
unreachable
}
int test_imm_DFuint32_mem(unsigned int *val) {
  return ((*val) & (0xDF << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_DFuint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 223
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ pr_info(char *, int);
int sci_get_chip_id();
int soc_id_is_sc8730g2v0(void) {
  pr_info("chip id is %x\n", sci_get_chip_id());
  return ((sci_get_chip_id() & (0xFFFFF000)) == ((0x8730C000) & (0xFFFFF000)));
}


x86 assembly (clang, -O0):
<soc_id_is_sc8730g2v0>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <sci_get_chip_id@plt>
mov    %eax,%esi
lea    0xecc(%rip),%rdi
call   1030 <pr_info@plt>
mov    $0x0,%al
call   1040 <sci_get_chip_id@plt>
and    $0xfffff000,%eax
cmp    $0x8730c000,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<soc_id_is_sc8730g2v0>:
push   %rax
xor    %eax,%eax
call   1040 <sci_get_chip_id@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
call   1030 <pr_info@plt>
xor    %eax,%eax
call   1040 <sci_get_chip_id@plt>
and    $0xfffff000,%eax
xor    %ecx,%ecx
cmp    $0x8730c000,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"chip id is %x\0A\00"
define i32 @soc_id_is_sc8730g2v0() {
%1 = call i32 (...) @sci_get_chip_id()
%2 = call i32 @pr_info(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = call i32 (...) @sci_get_chip_id()
%4 = and i32 %3, -4096
%5 = icmp eq i32 %4, -2026848256
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
@.str = [15 x i8] c"chip id is %x\0A\00"
define i32 @soc_id_is_sc8730g2v0() {
%1 = tail call i32 (...) @sci_get_chip_id()
%2 = tail call i32 @pr_info(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (...) @sci_get_chip_id()
%4 = and i32 %3, -4096
%5 = icmp eq i32 %4, -2026848256
%6 = zext i1 %5 to i32
ret i32 %6
}
const char *get_lame_very_short_version(void) {
  static const char *const str = "LAME"
                                 "LAME_MAJOR_VERSION"
                                 "."
                                 "LAME_MINOR_VERSION"
                                 " ";
  return str;
}


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

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

LLVM IR (-O0):
@get_lame_very_short_version.str = internal constant i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i32 0, i32 0)
@.str = [43 x i8] c"LAMELAME_MAJOR_VERSION.LAME_MINOR_VERSION \00"
define i8* @get_lame_very_short_version() {
ret i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i32 0, i32 0)
}

LLVM IR (-O2):
@.str = [43 x i8] c"LAMELAME_MAJOR_VERSION.LAME_MINOR_VERSION \00"
define i8* @get_lame_very_short_version() {
ret i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int id(int);
int /*<<< orphan*/ print_int(int);
int /*<<< orphan*/ print_string(char *);
void main(void) {
  int n, f;
  f = 1;
  for (n = 7; n > 0; n = n - 1)
    f = id(n) * f;
  print_int(f);
  print_string("\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x8(%rbp)
movl   $0x7,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    116d <main+0x3d>
mov    -0x4(%rbp),%edi
call   1050 <id@plt>
imul   -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1146 <main+0x16>
mov    -0x8(%rbp),%edi
call   1040 <print_int@plt>
lea    0xe84(%rip),%rdi
call   1030 <print_string@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    $0x7,%edi
call   1050 <id@plt>
mov    %eax,%ebp
mov    $0x6,%edi
call   1050 <id@plt>
imul   %eax,%ebp
mov    $0x5,%edi
call   1050 <id@plt>
mov    %eax,%ebx
mov    $0x4,%edi
call   1050 <id@plt>
imul   %eax,%ebx
imul   %ebp,%ebx
mov    $0x3,%edi
call   1050 <id@plt>
mov    %eax,%ebp
mov    $0x2,%edi
call   1050 <id@plt>
imul   %eax,%ebp
mov    $0x1,%edi
call   1050 <id@plt>
imul   %eax,%ebp
imul   %ebx,%ebp
mov    %ebp,%edi
call   1040 <print_int@plt>
lea    0xe61(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <print_string@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
store i32 1, i32* %2
store i32 7, i32* %1
br label %3
3: ; preds = %11, %0
%4 = load i32, i32* %1
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %14
6: ; preds = %3
%7 = load i32, i32* %1
%8 = call i32 @id(i32 %7)
%9 = load i32, i32* %2
%10 = mul nsw i32 %8, %9
store i32 %10, i32* %2
br label %11
11: ; preds = %6
%12 = load i32, i32* %1
%13 = sub nsw i32 %12, 1
store i32 %13, i32* %1
br label %3
14: ; preds = %3
%15 = load i32, i32* %2
%16 = call i32 @print_int(i32 %15)
%17 = call i32 @print_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define void @main() {
%1 = tail call i32 @id(i32 7)
%2 = tail call i32 @id(i32 6)
%3 = mul nsw i32 %2, %1
%4 = tail call i32 @id(i32 5)
%5 = mul nsw i32 %4, %3
%6 = tail call i32 @id(i32 4)
%7 = mul nsw i32 %6, %5
%8 = tail call i32 @id(i32 3)
%9 = mul nsw i32 %8, %7
%10 = tail call i32 @id(i32 2)
%11 = mul nsw i32 %10, %9
%12 = tail call i32 @id(i32 1)
%13 = mul nsw i32 %12, %11
%14 = tail call i32 @print_int(i32 %13)
%15 = tail call i32 @print_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ writeByte(int);
void skipROM() { writeByte(0xcc); }


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

x86 assembly (clang, -O2):
<skipROM>:
mov    $0xcc,%edi
jmp    1030 <writeByte@plt>

LLVM IR (-O0):
define void @skipROM() {
%1 = call i32 @writeByte(i32 204)
ret void
}

LLVM IR (-O2):
define void @skipROM() {
%1 = tail call i32 @writeByte(i32 204)
ret void
}
/* Variables and functions */
int game_scene_init(int **, char **, int, int /*<<< orphan*/,
                    int /*<<< orphan*/, int /*<<< orphan*/);
scalar_t__ malloc(int);
void game_scene(int size) {
  while (game_scene_init((int **)malloc(sizeof(int *) * size),
                         (char **)malloc(sizeof(char *) * size), size, 0, 0, 0),
         0) {
  }
}


x86 assembly (clang, -O0):
<game_scene>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    -0x10(%rbp),%rdi
mov    %rax,%rsi
mov    -0x4(%rbp),%edx
xor    %r9d,%r9d
mov    %r9d,%ecx
mov    %r9d,%r8d
call   1030 <game_scene_init@plt>
xor    %eax,%eax
test   $0x1,%al
jne    1174 <game_scene+0x54>
jmp    1179 <game_scene+0x59>
jmp    112b <game_scene+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<game_scene>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebx
lea    0x0(,%rbx,8),%ebp
mov    %ebp,%edi
call   1040 <malloc@plt>
mov    %rax,%r14
mov    %ebp,%edi
call   1040 <malloc@plt>
mov    %r14,%rdi
mov    %rax,%rsi
mov    %ebx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <game_scene_init@plt>

LLVM IR (-O0):
define void @game_scene(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %18, %1
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = mul i64 8, %5
%7 = trunc i64 %6 to i32
%8 = call i64 @malloc(i32 %7)
%9 = inttoptr i64 %8 to i32**
%10 = load i32, i32* %2
%11 = sext i32 %10 to i64
%12 = mul i64 8, %11
%13 = trunc i64 %12 to i32
%14 = call i64 @malloc(i32 %13)
%15 = inttoptr i64 %14 to i8**
%16 = load i32, i32* %2
%17 = call i32 @game_scene_init(i32** %9, i8** %15, i32 %16, i32 0, i32 0, i32 0)
br i1 false, label %18, label %19
18: ; preds = %3
br label %3
19: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @game_scene(i32 %0) {
%2 = shl i32 %0, 3
%3 = tail call i64 @malloc(i32 %2)
%4 = inttoptr i64 %3 to i32**
%5 = tail call i64 @malloc(i32 %2)
%6 = inttoptr i64 %5 to i8**
%7 = tail call i32 @game_scene_init(i32** %4, i8** %6, i32 %0, i32 0, i32 0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void _printUsage(void) {
  printf("Usage:\n");
  printf("\ta:\tAllocate a new unit.\n");
}


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

x86 assembly (clang, -O2):
<_printUsage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xee3(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"Usage:\0A\00"
@.str.1 = [26 x i8] c"\09a:\09Allocate a new unit.\0A\00"
define void @_printUsage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [7 x i8] c"Usage:\00"
@str.2 = [25 x i8] c"\09a:\09Allocate a new unit.\00"
define void @_printUsage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.2, i64 0, i64 0))
ret void
}
OP(fd, a0) {
  illegal_1();
  op_a0();
}


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <illegal_1@plt>
mov    $0x0,%al
call   1040 <op_a0@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OP>:
push   %rax
xor    %eax,%eax
call   1030 <illegal_1@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <op_a0@plt>

LLVM IR (-O0):
define i32 @OP(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = call i32 (...) @illegal_1()
%7 = call i32 (...) @op_a0()
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_1()
%4 = tail call i32 (...) @op_a0()
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int time(int /*<<< orphan*/ *);
signed date(time_t *curr_time) { return time(curr_time); }


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

x86 assembly (clang, -O2):
<date>:
jmp    1030 <time@plt>

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

LLVM IR (-O2):
define i32 @date(i32* %0) {
%2 = tail call i32 @time(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ complain(char *);
scalar_t__ numa_available();
void checknuma(void) {
  static int numa = -1;
  if (numa < 0) {
    if (numa_available() < 0)
      complain("This system does not support NUMA functionality");
  }
  numa = 0;
}


x86 assembly (clang, -O0):
<checknuma>:
push   %rbp
mov    %rsp,%rbp
cmpl   $0x0,0x2f05(%rip)
jge    1153 <checknuma+0x33>
mov    $0x0,%al
call   1030 <numa_available@plt>
cmp    $0x0,%rax
jge    114e <checknuma+0x2e>
lea    0xeb7(%rip),%rdi
call   1040 <complain@plt>
jmp    1153 <checknuma+0x33>
movl   $0x0,0x2ed3(%rip)
pop    %rbp
ret

x86 assembly (clang, -O2):
<checknuma>:
push   %rax
cmpb   $0x0,0x2f0c(%rip)
jne    1142 <checknuma+0x22>
xor    %eax,%eax
call   1030 <numa_available@plt>
test   %rax,%rax
jns    1142 <checknuma+0x22>
lea    0xec3(%rip),%rdi
call   1040 <complain@plt>
movb   $0x1,0x2eeb(%rip)
pop    %rax
ret

LLVM IR (-O0):
@checknuma.numa = internal global i32 -1
@.str = [48 x i8] c"This system does not support NUMA functionality\00"
define void @checknuma() {
%1 = load i32, i32* @checknuma.numa
%2 = icmp slt i32 %1, 0
br i1 %2, label %3, label %9
3: ; preds = %0
%4 = call i64 (...) @numa_available()
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = call i32 @complain(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
br label %9
9: ; preds = %8, %0
store i32 0, i32* @checknuma.numa
ret void
}

LLVM IR (-O2):
@checknuma.numa = internal unnamed_addr global i1 false
@.str = [48 x i8] c"This system does not support NUMA functionality\00"
define void @checknuma() {
%1 = load i1, i1* @checknuma.numa
br i1 %1, label %7, label %2
2: ; preds = %0
%3 = tail call i64 (...) @numa_available()
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @complain(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %2, %5, %0
store i1 true, i1* @checknuma.numa
ret void
}
void dummy_copy(struct rb_node *old, struct rb_node *_new) {}


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

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

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

LLVM IR (-O2):
%struct.rb_node = type opaque
define void @dummy_copy(%struct.rb_node* nocapture %0, %struct.rb_node* nocapture %1) {
ret void
}
/* Variables and functions */
int pth_init();
int pth_pth_init(void) { return pth_init(); }


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

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

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

LLVM IR (-O2):
define i32 @pth_pth_init() {
%1 = tail call i32 (...) @pth_init()
ret i32 %1
}
/* Variables and functions */
unsigned int Thrd_Get_Bits(int, int);
unsigned int Thrd_Get_Bits1(int t) {
  unsigned int tmp;
  {
    tmp = Thrd_Get_Bits(t, 1);
    return (tmp);
  }
}


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

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

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

LLVM IR (-O2):
define i32 @Thrd_Get_Bits1(i32 %0) {
%2 = tail call i32 @Thrd_Get_Bits(i32 %0, i32 1)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ getch();
int main(void) {
  getch();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @getch()
ret i32 0
}
/* Variables and functions */
char const *fmt_human(long, int);
scalar_t__ get_swap_info(int /*<<< orphan*/ *, long *, int /*<<< orphan*/ *);
const char *swap_free(void) {
  long free;
  if (get_swap_info(NULL, &free, NULL)) {
    return NULL;
  }
  return fmt_human(free * 1024, 1024);
}


x86 assembly (clang, -O0):
<swap_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
mov    %eax,%edx
lea    -0x10(%rbp),%rsi
mov    %rdx,%rdi
call   1040 <get_swap_info@plt>
cmp    $0x0,%rax
je     114f <swap_free+0x2f>
movq   $0x0,-0x8(%rbp)
jmp    1165 <swap_free+0x45>
mov    -0x10(%rbp),%rdi
shl    $0xa,%rdi
mov    $0x400,%esi
call   1030 <fmt_human@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap_free>:
push   %rbx
sub    $0x10,%rsp
xor    %ebx,%ebx
lea    0x8(%rsp),%rsi
xor    %edi,%edi
xor    %edx,%edx
call   1040 <get_swap_info@plt>
test   %rax,%rax
jne    1150 <swap_free+0x30>
mov    0x8(%rsp),%rdi
shl    $0xa,%rdi
mov    $0x400,%esi
call   1030 <fmt_human@plt>
mov    %rax,%rbx
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i8* @swap_free() {
%1 = alloca i8*
%2 = alloca i64
%3 = call i64 @get_swap_info(i32* null, i64* %2, i32* null)
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %0
store i8* null, i8** %1
br label %10
6: ; preds = %0
%7 = load i64, i64* %2
%8 = mul nsw i64 %7, 1024
%9 = call i8* @fmt_human(i64 %8, i32 1024)
store i8* %9, i8** %1
br label %10
10: ; preds = %6, %5
%11 = load i8*, i8** %1
ret i8* %11
}

LLVM IR (-O2):
define i8* @swap_free() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = call i64 @get_swap_info(i32* null, i64* %1, i32* null)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %0
%6 = load i64, i64* %1
%7 = shl nsw i64 %6, 10
%8 = call i8* @fmt_human(i64 %7, i32 1024)
br label %9
9: ; preds = %0, %5
%10 = phi i8* [ %8, %5 ], [ null, %0 ]
ret i8* %10
}
/* Variables and functions */
int /*<<< orphan*/ make_rb_tree(int);
int main() {
  make_rb_tree(9);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x9,%edi
call   1030 <make_rb_tree@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @make_rb_tree(i32 9)
ret i32 0
}
unsigned char mc_bitstream_read_byte(unsigned char **bs) {
  unsigned char v = **bs;
  *bs += 1;
  return v;
}


x86 assembly (clang, -O0):
<mc_bitstream_read_byte>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%al
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
movzbl -0x9(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mc_bitstream_read_byte>:
mov    (%rdi),%rcx
mov    (%rcx),%al
add    $0x1,%rcx
mov    %rcx,(%rdi)
ret

LLVM IR (-O0):
define zeroext i8 @mc_bitstream_read_byte(i8** %0) {
%2 = alloca i8**
%3 = alloca i8
store i8** %0, i8*** %2
%4 = load i8**, i8*** %2
%5 = load i8*, i8** %4
%6 = load i8, i8* %5
store i8 %6, i8* %3
%7 = load i8**, i8*** %2
%8 = load i8*, i8** %7
%9 = getelementptr inbounds i8, i8* %8, i64 1
store i8* %9, i8** %7
%10 = load i8, i8* %3
ret i8 %10
}

LLVM IR (-O2):
define zeroext i8 @mc_bitstream_read_byte(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = getelementptr inbounds i8, i8* %2, i64 1
store i8* %4, i8** %0
ret i8 %3
}