xunge/DecIR huggingface dataset:
int emac2_etherstatspkts64octets_set(
    unsigned int dev_id, union emac2_etherstatspkts64octets_u *value) {
  return 1;
}


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

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

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

LLVM IR (-O2):
%union.emac2_etherstatspkts64octets_u = type opaque
define i32 @emac2_etherstatspkts64octets_set(i32 %0, %union.emac2_etherstatspkts64octets_u* nocapture readnone %1) {
ret i32 1
}
/* Variables and functions */
int return_zero();
int divide_by_zero() { return 1 / return_zero(); }


x86 assembly (clang, -O0):
<divide_by_zero>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <return_zero@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<divide_by_zero>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <return_zero@plt>
lea    0x1(%rax),%ecx
cmp    $0x3,%ecx
cmovae %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @divide_by_zero() {
%1 = call i32 (...) @return_zero()
%2 = sdiv i32 1, %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @divide_by_zero() {
%1 = tail call i32 (...) @return_zero()
%2 = add i32 %1, 1
%3 = icmp ult i32 %2, 3
%4 = select i1 %3, i32 %1, i32 0
ret i32 %4
}
int main(void) {
  int a;
  if (a) {
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     111a <main+0x1a>
jmp    111a <main+0x1a>
xor    %eax,%eax
pop    %rbp
ret

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

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

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


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

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

LLVM IR (-O0):
define i32 @foo() {
%1 = alloca i32
%2 = call i32 (...) @bar()
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @foo() {
%1 = tail call i32 (...) @bar()
ret i32 undef
}
__attribute__((__section__(".cpuidle.text"))) void native_safe_halt(void) {
  asm volatile("sti; hlt" : : : "memory");
}


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

x86 assembly (clang, -O2):
<native_safe_halt>:
sti
hlt
ret

LLVM IR (-O0):
define void @native_safe_halt() section ".cpuidle.text" {
ret void
}

LLVM IR (-O2):
define void @native_safe_halt() section ".cpuidle.text" {
tail call void asm sideeffect "sti; hlt", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
void nseel_asm_band_end(void) {}


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

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

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

LLVM IR (-O2):
define void @nseel_asm_band_end() {
ret void
}
/* Variables and functions */
int inch();
int /*<<< orphan*/ move(int const, int const);
int yxisChar(const int y, const int x, const int c) {
  int cmp;
  move(y, x);
  cmp = inch();
  if (cmp == c) {
    return 1;
  } else
    return 0;
}


x86 assembly (clang, -O0):
<yxisChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <move@plt>
mov    $0x0,%al
call   1030 <inch@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jne    115e <yxisChar+0x3e>
movl   $0x1,-0x4(%rbp)
jmp    1165 <yxisChar+0x45>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yxisChar>:
push   %rbx
mov    %edx,%ebx
call   1040 <move@plt>
xor    %eax,%eax
call   1030 <inch@plt>
xor    %ecx,%ecx
cmp    %ebx,%eax
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @yxisChar(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @move(i32 %0, i32 %1)
%5 = tail call i32 (...) @inch()
%6 = icmp eq i32 %5, %2
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(int *, int *, int);
void copy8(int *x, int *y) { memcpy(x, y, 8); }


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

x86 assembly (clang, -O2):
<copy8>:
mov    $0x8,%edx
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @copy8(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 @memcpy(i32* %5, i32* %6, i32 8)
ret void
}

LLVM IR (-O2):
define void @copy8(i32* %0, i32* %1) {
%3 = tail call i32 @memcpy(i32* %0, i32* %1, i32 8)
ret void
}
int process_disk_fin() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @process_disk_fin() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
__attribute__((always_)) void XRaySetAnnotationFilter(uint32_t filter) { ; }


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

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

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

LLVM IR (-O2):
define void @XRaySetAnnotationFilter(i32 %0) {
ret void
}
void OPENSSL_init(void) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @INT_Excep_PERIB_INTB149() {
ret void
}
int hex_to_num(int ch) {
  if ('0' <= ch && ch <= '9')
    return ch - '0';
  if ('a' <= ch && ch <= 'f')
    return ch - 'a' + 10;
  return -1;
}


x86 assembly (clang, -O0):
<hex_to_num>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    $0x30,%eax
cmp    -0x8(%rbp),%eax
jg     112d <hex_to_num+0x2d>
cmpl   $0x39,-0x8(%rbp)
jg     112d <hex_to_num+0x2d>
mov    -0x8(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    115d <hex_to_num+0x5d>
mov    $0x61,%eax
cmp    -0x8(%rbp),%eax
jg     1156 <hex_to_num+0x56>
cmpl   $0x66,-0x8(%rbp)
jg     1156 <hex_to_num+0x56>
mov    -0x8(%rbp),%eax
sub    $0x61,%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
jmp    115d <hex_to_num+0x5d>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hex_to_num>:
lea    -0x61(%rdi),%eax
lea    -0x57(%rdi),%ecx
cmp    $0x6,%eax
mov    $0xffffffff,%eax
cmovb  %ecx,%eax
lea    -0x30(%rdi),%ecx
cmp    $0xa,%ecx
cmovb  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @hex_to_num(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = add i32 %0, -97
%5 = icmp ult i32 %4, 6
%6 = add nsw i32 %0, -87
%7 = select i1 %5, i32 %6, i32 -1
%8 = select i1 %3, i32 %2, i32 %7
ret i32 %8
}
int print_compiler_id() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @print_compiler_id() {
ret i32 0
}
int h(int c) { return (c > 0 ? c : -c) % 8; }


x86 assembly (clang, -O0):
<h>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    111c <h+0x1c>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1124 <h+0x24>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<h>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
and    $0x7,%eax
ret

LLVM IR (-O0):
define i32 @h(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load i32, i32* %2
br label %10
7: ; preds = %1
%8 = load i32, i32* %2
%9 = sub nsw i32 0, %8
br label %10
10: ; preds = %7, %5
%11 = phi i32 [ %6, %5 ], [ %9, %7 ]
%12 = srem i32 %11, 8
ret i32 %12
}

LLVM IR (-O2):
define i32 @h(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
%3 = and i32 %2, 7
ret i32 %3
}
int dheap_left_child_index(int i, int n) {
  int li = 2 * i + 1;
  if (li >= n)
    return -1;
  else
    return li;
}


x86 assembly (clang, -O0):
<dheap_left_child_index>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jl     112e <dheap_left_child_index+0x2e>
movl   $0xffffffff,-0x4(%rbp)
jmp    1134 <dheap_left_child_index+0x34>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dheap_left_child_index>:
lea    (%rdi,%rdi,1),%ecx
add    $0x1,%ecx
cmp    %esi,%ecx
mov    $0xffffffff,%eax
cmovl  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @dheap_left_child_index(i32 %0, i32 %1) {
%3 = shl nsw i32 %0, 1
%4 = or i32 %3, 1
%5 = icmp slt i32 %4, %1
%6 = select i1 %5, i32 %4, i32 -1
ret i32 %6
}
void g_date_is_leap_year() {}


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

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

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

LLVM IR (-O2):
define void @g_date_is_leap_year() {
ret void
}
int main(int narg, char **args) { return 0; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ hoge(int, int, int, int, int, int, int);
void func() { hoge(1, 2, 3, 4, 5, 6, 7); }


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
mov    $0x4,%ecx
mov    $0x5,%r8d
mov    $0x6,%r9d
movl   $0x7,(%rsp)
call   1030 <hoge@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
push   %rax
movl   $0x7,(%rsp)
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
mov    $0x4,%ecx
mov    $0x5,%r8d
mov    $0x6,%r9d
call   1030 <hoge@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @func() {
%1 = call i32 @hoge(i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7)
ret void
}

LLVM IR (-O2):
define void @func() {
%1 = tail call i32 @hoge(i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ w5100_socket_cmd(unsigned int, int);
void socket_disconnect(unsigned sock) { w5100_socket_cmd(sock, 0x08); }


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

x86 assembly (clang, -O2):
<socket_disconnect>:
mov    $0x8,%esi
jmp    1030 <w5100_socket_cmd@plt>

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

LLVM IR (-O2):
define void @socket_disconnect(i32 %0) {
%2 = tail call i32 @w5100_socket_cmd(i32 %0, i32 8)
ret void
}
esc2(s1, s2) char s1, s2;
{ printf("%c%s%s", 27, s1, s2); }


x86 assembly (clang, -O0):
<esc2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%cl
mov    %sil,%al
mov    %cl,-0x5(%rbp)
mov    %al,-0x6(%rbp)
movsbl -0x5(%rbp),%edx
movsbl -0x6(%rbp),%ecx
lea    0xecd(%rip),%rdi
mov    $0x1b,%esi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<esc2>:
movsbl %dil,%edx
movsbl %sil,%ecx
lea    0xee1(%rip),%rdi
mov    $0x1b,%esi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"%c%s%s\00"
define i32 @esc2(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8
%5 = alloca i8
%6 = trunc i32 %0 to i8
%7 = trunc i32 %1 to i8
store i8 %6, i8* %4
store i8 %7, i8* %5
%8 = load i8, i8* %4
%9 = sext i8 %8 to i32
%10 = load i8, i8* %5
%11 = sext i8 %10 to i32
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 27, i32 %9, i32 %11)
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
@.str = [7 x i8] c"%c%s%s\00"
define i32 @esc2(i32 %0, i32 %1) {
%3 = shl i32 %0, 24
%4 = ashr exact i32 %3, 24
%5 = shl i32 %1, 24
%6 = ashr exact i32 %5, 24
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 27, i32 %4, i32 %6)
ret i32 undef
}
/* Variables and functions */
int _tfsrun(char **, int);
int /*<<< orphan*/ monLock();
int /*<<< orphan*/ monUnlock();
int mon_tfsrun(char **name, int verbose) {
  int ret;
  monLock();
  ret = _tfsrun(name, verbose);
  monUnlock();
  return (ret);
}


x86 assembly (clang, -O0):
<mon_tfsrun>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <monLock@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1050 <_tfsrun@plt>
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1040 <monUnlock@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mon_tfsrun>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <monLock@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1050 <_tfsrun@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <monUnlock@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @mon_tfsrun(i8** %0, i32 %1) {
%3 = alloca i8**
%4 = alloca i32
%5 = alloca i32
store i8** %0, i8*** %3
store i32 %1, i32* %4
%6 = call i32 (...) @monLock()
%7 = load i8**, i8*** %3
%8 = load i32, i32* %4
%9 = call i32 @_tfsrun(i8** %7, i32 %8)
store i32 %9, i32* %5
%10 = call i32 (...) @monUnlock()
%11 = load i32, i32* %5
ret i32 %11
}

LLVM IR (-O2):
define i32 @mon_tfsrun(i8** %0, i32 %1) {
%3 = tail call i32 (...) @monLock()
%4 = tail call i32 @_tfsrun(i8** %0, i32 %1)
%5 = tail call i32 (...) @monUnlock()
ret i32 %4
}
unsigned long div_round_up(unsigned int n, unsigned int d) {
  return (n + d - 1) / d;
}


x86 assembly (clang, -O0):
<div_round_up>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
sub    $0x1,%eax
xor    %edx,%edx
divl   -0x8(%rbp)
mov    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<div_round_up>:
lea    (%rdi,%rsi,1),%eax
add    $0xffffffff,%eax
xor    %edx,%edx
div    %esi
ret

LLVM IR (-O0):
define i64 @div_round_up(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 = add i32 %5, %6
%8 = sub i32 %7, 1
%9 = load i32, i32* %4
%10 = udiv i32 %8, %9
%11 = zext i32 %10 to i64
ret i64 %11
}

LLVM IR (-O2):
define i64 @div_round_up(i32 %0, i32 %1) {
%3 = add i32 %0, -1
%4 = add i32 %3, %1
%5 = udiv i32 %4, %1
%6 = zext i32 %5 to i64
ret i64 %6
}
/* Variables and functions */
int consoleCmdGetCampos(int);
double log(int);
double consoleCmdGetCamposl(int index) {
  return log(consoleCmdGetCampos(index)) / log(2);
}


x86 assembly (clang, -O0):
<consoleCmdGetCamposl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <consoleCmdGetCampos@plt>
mov    %eax,%edi
call   1040 <log@plt>
movsd  %xmm0,-0x10(%rbp)
mov    $0x2,%edi
call   1040 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<consoleCmdGetCamposl>:
push   %rax
call   1030 <consoleCmdGetCampos@plt>
mov    %eax,%edi
call   1040 <log@plt>
movsd  %xmm0,(%rsp)
mov    $0x2,%edi
call   1040 <log@plt>
movsd  (%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @consoleCmdGetCamposl(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @consoleCmdGetCampos(i32 %3)
%5 = call double @log(i32 %4)
%6 = call double @log(i32 2)
%7 = fdiv double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @consoleCmdGetCamposl(i32 %0) {
%2 = tail call i32 @consoleCmdGetCampos(i32 %0)
%3 = tail call double @log(i32 %2)
%4 = tail call double @log(i32 2)
%5 = fdiv double %3, %4
ret double %5
}
void PWM1Fault_Handler(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<PWM1Fault_Handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <PWM1Fault_Handler+0x9>
jmp    1109 <PWM1Fault_Handler+0x9>

x86 assembly (clang, -O2):
<PWM1Fault_Handler>:
jmp    1100 <PWM1Fault_Handler>

LLVM IR (-O0):
define void @PWM1Fault_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @PWM1Fault_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
void uniphier_sbc_init_savepin(void) {}


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

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

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

LLVM IR (-O2):
define void @uniphier_sbc_init_savepin() {
ret void
}
regx0indreg1(r0, r1, x0, x1, p0, p1) short r0, r1;
short *p0, *p1;
{
  if ((p0[x0]) <= (*p1))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<regx0indreg1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
movswl (%rax,%rcx,2),%eax
mov    -0x20(%rbp),%rcx
movswl (%rcx),%ecx
cmp    %ecx,%eax
jg     1146 <regx0indreg1+0x46>
movl   $0x1,-0x4(%rbp)
jmp    114d <regx0indreg1+0x4d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<regx0indreg1>:
movslq %edx,%rax
movzwl (%r8,%rax,2),%ecx
xor    %eax,%eax
cmp    (%r9),%cx
setle  %al
ret

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

LLVM IR (-O2):
define i32 @regx0indreg1(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture %4, i16* nocapture %5) {
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i16, i16* %4, i64 %7
%9 = load i16, i16* %8
%10 = load i16, i16* %5
%11 = icmp sle i16 %9, %10
%12 = zext i1 %11 to i32
ret i32 %12
}
int test_imm_55int16_mem(short *val) {
  return ((*val) & (0x55 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_55int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 85
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long);
long sieve_and_sum(int);
int main() {
  long sum = 0;
  sum = sieve_and_sum(2000000);
  printf("ANSWER: %ld\n", sum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    $0x1e8480,%edi
call   1040 <sieve_and_sum@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1e8480,%edi
call   1040 <sieve_and_sum@plt>
lea    0xece(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"ANSWER: %ld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
store i64 0, i64* %2
%3 = call i64 @sieve_and_sum(i32 2000000)
store i64 %3, i64* %2
%4 = load i64, i64* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i64 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"ANSWER: %ld\0A\00"
define i32 @main() {
%1 = tail call i64 @sieve_and_sum(i32 2000000)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i64 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ stderr;
void myassert(char *file, int line) {
  fprintf(stderr, "Assertion failed on line %d of file \"%s\"\n", line, file);
  exit(1);
}


x86 assembly (clang, -O0):
<myassert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%rcx
lea    0xeba(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<myassert>:
push   %rax
mov    %esi,%edx
mov    %rdi,%rcx
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
lea    0xeca(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [42 x i8] c"Assertion failed on line %d of file \22%s\22\0A\00"
define void @myassert(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = load i32, i32* %4
%7 = load i8*, i8** %3
%8 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 %6, i8* %7)
%9 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [42 x i8] c"Assertion failed on line %d of file \22%s\22\0A\00"
define void @myassert(i8* %0, i32 %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 %1, i8* %0)
%5 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
struct rtattr {
  int dummy;
};
struct qdisc_util {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fifo_print_xstats(struct qdisc_util *qu, FILE *f, struct rtattr *xstats) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.qdisc_util = type { i32 }
%struct.rtattr = type { i32 }
define i32 @fifo_print_xstats(%struct.qdisc_util* %0, i32* %1, %struct.rtattr* %2) {
%4 = alloca %struct.qdisc_util*
%5 = alloca i32*
%6 = alloca %struct.rtattr*
store %struct.qdisc_util* %0, %struct.qdisc_util** %4
store i32* %1, i32** %5
store %struct.rtattr* %2, %struct.rtattr** %6
ret i32 0
}

LLVM IR (-O2):
%struct.qdisc_util = type { i32 }
%struct.rtattr = type { i32 }
define i32 @fifo_print_xstats(%struct.qdisc_util* nocapture readnone %0, i32* nocapture readnone %1, %struct.rtattr* nocapture readnone %2) {
ret i32 0
}
__attribute__((weak)) void PendSV_Handler(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<PendSV_Handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <PendSV_Handler+0x9>
jmp    1109 <PendSV_Handler+0x9>

x86 assembly (clang, -O2):
<PendSV_Handler>:
jmp    1100 <PendSV_Handler>

LLVM IR (-O0):
define weak void @PendSV_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define weak void @PendSV_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ freeeze(int);
int /*<<< orphan*/ say(char *, int);
int /*<<< orphan*/ unfreeeze(int);
void talk(void) {
  freeeze(1);
  say("Mr.SmileStein's bed, I shudder at what happens here.", 1);
  unfreeeze(1);
}


x86 assembly (clang, -O0):
<talk>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1040 <freeeze@plt>
lea    0xebb(%rip),%rdi
mov    $0x1,%esi
call   1050 <say@plt>
mov    $0x1,%edi
call   1030 <unfreeeze@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<talk>:
push   %rax
mov    $0x1,%edi
call   1040 <freeeze@plt>
lea    0xebe(%rip),%rdi
mov    $0x1,%esi
call   1050 <say@plt>
mov    $0x1,%edi
pop    %rax
jmp    1030 <unfreeeze@plt>

LLVM IR (-O0):
@.str = [53 x i8] c"Mr.SmileStein's bed, I shudder at what happens here.\00"
define void @talk() {
%1 = call i32 @freeeze(i32 1)
%2 = call i32 @say(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i32 1)
%3 = call i32 @unfreeeze(i32 1)
ret void
}

LLVM IR (-O2):
@.str = [53 x i8] c"Mr.SmileStein's bed, I shudder at what happens here.\00"
define void @talk() {
%1 = tail call i32 @freeeze(i32 1)
%2 = tail call i32 @say(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i32 1)
%3 = tail call i32 @unfreeeze(i32 1)
ret void
}
int __attribute__((target("default"))) fwd_decl_default(void) { return 2; }


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

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

LLVM IR (-O0):
define i32 @fwd_decl_default() {
ret i32 2
}

LLVM IR (-O2):
define i32 @fwd_decl_default() {
ret i32 2
}
int get_depth(int hcnt) {
  int d, m;
  for (d = 1, m = 2; m < hcnt; m <<= 1, d++)
    ;
  return d;
}


x86 assembly (clang, -O0):
<get_depth>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    113d <get_depth+0x3d>
jmp    1126 <get_depth+0x26>
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1115 <get_depth+0x15>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_depth>:
mov    $0x1,%eax
cmp    $0x3,%edi
jl     1129 <get_depth+0x29>
mov    $0x1,%eax
mov    $0x2,%ecx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    %ecx,%ecx
add    $0x1,%eax
cmp    %edi,%ecx
jl     1120 <get_depth+0x20>
ret

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

LLVM IR (-O2):
define i32 @get_depth(i32 %0) {
%2 = icmp sgt i32 %0, 2
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 2, %1 ]
%5 = phi i32 [ %7, %3 ], [ 1, %1 ]
%6 = shl i32 %4, 1
%7 = add nuw nsw i32 %5, 1
%8 = icmp slt i32 %6, %0
br i1 %8, label %3, label %9
9: ; preds = %3, %1
%10 = phi i32 [ 1, %1 ], [ %7, %3 ]
ret i32 %10
}
/* Variables and functions */
double gsl_sf_psi(double);
double psi(double x) { return gsl_sf_psi(x); }


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

x86 assembly (clang, -O2):
<psi>:
jmp    1030 <gsl_sf_psi@plt>

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

LLVM IR (-O2):
define double @psi(double %0) {
%2 = tail call double @gsl_sf_psi(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void drwav__free_default(void *p, void *pUserData) {
  (void)pUserData;
  free((p));
}


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

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

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

LLVM IR (-O2):
define void @drwav__free_default(i8* nocapture %0, i8* nocapture readnone %1) {
%3 = tail call i32 @free(i8* %0)
ret void
}
long long_fetch_ior_release(long *ptr, long value) {
  return __atomic_fetch_or(ptr, value, 3);
}


x86 assembly (clang, -O0):
<long_fetch_ior_release>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rcx
mov    %rcx,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
mov    %rcx,-0x30(%rbp)
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    -0x30(%rbp),%rsi
mov    %rax,%rdx
or     %rsi,%rdx
lock cmpxchg %rdx,(%rcx)
sete   %cl
mov    %rax,-0x40(%rbp)
test   $0x1,%cl
mov    %rax,-0x28(%rbp)
jne    115b <long_fetch_ior_release+0x5b>
jmp    112b <long_fetch_ior_release+0x2b>
mov    -0x40(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<long_fetch_ior_release>:
mov    (%rdi),%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rax,%rcx
or     %rsi,%rcx
lock cmpxchg %rcx,(%rdi)
jne    1110 <long_fetch_ior_release+0x10>
ret

LLVM IR (-O0):
define i64 @long_fetch_ior_release(i64* %0, i64 %1) {
%3 = alloca i64*
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64* %0, i64** %3
store i64 %1, i64* %4
%7 = load i64*, i64** %3
%8 = load i64, i64* %4
store i64 %8, i64* %5
%9 = load i64, i64* %5
%10 = atomicrmw or i64* %7, i64 %9 release
store i64 %10, i64* %6
%11 = load i64, i64* %6
ret i64 %11
}

LLVM IR (-O2):
define i64 @long_fetch_ior_release(i64* nocapture %0, i64 %1) {
%3 = atomicrmw or i64* %0, i64 %1 release
ret i64 %3
}
double square(x)
double x;
{ return x * x; }


x86 assembly (clang, -O0):
<square>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<square>:
mulsd  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @square(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fmul double %3, %4
ret double %5
}

LLVM IR (-O2):
define double @square(double %0) {
%2 = fmul double %0, %0
ret double %2
}
float squareroot(const float x) {
  union {
    int i;
    float x;
  } u;
  u.x = x;
  u.i = (1 << 29) + (u.i >> 1) - (1 << 22);
  u.x = u.x + x / u.x;
  u.x = 0.25f * u.x + x / u.x;
  return u.x;
}


x86 assembly (clang, -O0):
<squareroot>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x1,%eax
add    $0x20000000,%eax
sub    $0x400000,%eax
mov    %eax,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movss  -0x4(%rbp),%xmm1
divss  -0x8(%rbp),%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movss  -0x4(%rbp),%xmm1
divss  -0x8(%rbp),%xmm1
movss  0xeab(%rip),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<squareroot>:
movd   %xmm0,%eax
sar    %eax
add    $0x1fc00000,%eax
movd   %eax,%xmm1
movdqa %xmm0,%xmm2
divss  %xmm1,%xmm2
addss  %xmm1,%xmm2
divss  %xmm2,%xmm0
mulss  0xed9(%rip),%xmm2
addss  %xmm2,%xmm0
ret

LLVM IR (-O0):
%union.anon = type { i32 }
define float @squareroot(float %0) {
%2 = alloca float
%3 = alloca %union.anon
store float %0, float* %2
%4 = load float, float* %2
%5 = bitcast %union.anon* %3 to float*
store float %4, float* %5
%6 = bitcast %union.anon* %3 to i32*
%7 = load i32, i32* %6
%8 = ashr i32 %7, 1
%9 = add nsw i32 536870912, %8
%10 = sub nsw i32 %9, 4194304
%11 = bitcast %union.anon* %3 to i32*
store i32 %10, i32* %11
%12 = bitcast %union.anon* %3 to float*
%13 = load float, float* %12
%14 = load float, float* %2
%15 = bitcast %union.anon* %3 to float*
%16 = load float, float* %15
%17 = fdiv float %14, %16
%18 = fadd float %13, %17
%19 = bitcast %union.anon* %3 to float*
store float %18, float* %19
%20 = bitcast %union.anon* %3 to float*
%21 = load float, float* %20
%22 = load float, float* %2
%23 = bitcast %union.anon* %3 to float*
%24 = load float, float* %23
%25 = fdiv float %22, %24
%26 = call float @llvm.fmuladd.f32(float 2.500000e-01, float %21, float %25)
%27 = bitcast %union.anon* %3 to float*
store float %26, float* %27
%28 = bitcast %union.anon* %3 to float*
%29 = load float, float* %28
ret float %29
}

LLVM IR (-O2):
define float @squareroot(float %0) {
%2 = bitcast float %0 to i32
%3 = ashr i32 %2, 1
%4 = add nsw i32 %3, 532676608
%5 = bitcast i32 %4 to float
%6 = fdiv float %0, %5
%7 = fadd float %6, %5
%8 = fdiv float %0, %7
%9 = tail call float @llvm.fmuladd.f32(float %7, float 2.500000e-01, float %8)
ret float %9
}
int function_receive_void_return_something(void) {
  int i;
  return i;
}


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

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

LLVM IR (-O0):
define i32 @function_receive_void_return_something() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @function_receive_void_return_something() {
ret i32 undef
}
int qsort_cmp_AHEAP_KEY(const void *x, const void *y) {
  if (*((int *)x) < *((int *)y))
    return (-1);
  else
    return (*((int *)x) > *((int *)y));
}


x86 assembly (clang, -O0):
<qsort_cmp_AHEAP_KEY>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jge    112a <qsort_cmp_AHEAP_KEY+0x2a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1141 <qsort_cmp_AHEAP_KEY+0x41>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<qsort_cmp_AHEAP_KEY>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%eax
setg   %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @qsort_cmp_AHEAP_KEY(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp slt i32 %4, %6
%8 = icmp sgt i32 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ polyglot_array_typeid(int /*<<< orphan*/,
                                         int /*<<< orphan*/);
void *polyglot_from_typed(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ polyglot_i64_typeid();
__attribute__((always_)) void *polyglot_from_i64_array(int64_t *arr,
                                                       uint64_t len) {
  return polyglot_from_typed(arr,
                             polyglot_array_typeid(polyglot_i64_typeid(), len));
}


x86 assembly (clang, -O0):
<polyglot_from_i64_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <polyglot_i64_typeid@plt>
mov    %eax,%edi
mov    -0xc(%rbp),%esi
call   1050 <polyglot_array_typeid@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1040 <polyglot_from_typed@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<polyglot_from_i64_array>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
xor    %eax,%eax
call   1030 <polyglot_i64_typeid@plt>
mov    %eax,%edi
mov    %ebx,%esi
call   1050 <polyglot_array_typeid@plt>
mov    %r14,%rdi
mov    %eax,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <polyglot_from_typed@plt>

LLVM IR (-O0):
define i8* @polyglot_from_i64_array(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 = call i32 (...) @polyglot_i64_typeid()
%7 = load i32, i32* %4
%8 = call i32 @polyglot_array_typeid(i32 %6, i32 %7)
%9 = call i8* @polyglot_from_typed(i32* %5, i32 %8)
ret i8* %9
}

LLVM IR (-O2):
define i8* @polyglot_from_i64_array(i32* %0, i32 %1) {
%3 = tail call i32 (...) @polyglot_i64_typeid()
%4 = tail call i32 @polyglot_array_typeid(i32 %3, i32 %1)
%5 = tail call i8* @polyglot_from_typed(i32* %0, i32 %4)
ret i8* %5
}
float return_float(float a, float b) { return b; }


x86 assembly (clang, -O0):
<return_float>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<return_float>:
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @return_float(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %4
ret float %5
}

LLVM IR (-O2):
define float @return_float(float %0, float returned %1) {
ret float %1
}
/* Variables and functions */
int /*<<< orphan*/ SPC_MSG(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("SPCleaner usage.");
  SPC_MSG(0, "Hello %d %s\n", 100, "world");
  return;
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
lea    0xed8(%rip),%rsi
mov    $0x64,%edx
lea    0xed9(%rip),%rcx
call   1040 <SPC_MSG@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
lea    0xedd(%rip),%rsi
lea    0xee3(%rip),%rcx
xor    %edi,%edi
mov    $0x64,%edx
pop    %rax
jmp    1040 <SPC_MSG@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"SPCleaner usage.\00"
@.str.1 = [13 x i8] c"Hello %d %s\0A\00"
@.str.2 = [6 x i8] c"world\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @SPC_MSG(i32 0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 100, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"SPCleaner usage.\00"
@.str.1 = [13 x i8] c"Hello %d %s\0A\00"
@.str.2 = [6 x i8] c"world\00"
define void @usage() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @SPC_MSG(i32 0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 100, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ reverse(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int l;
  scanf("%d", &l);
  char str[l + 1];
  gets(str);
  reverse(str, 0, l - 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x20(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x18(%rbp)
call   1040 <gets@plt>
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%edx
sub    $0x1,%edx
xor    %esi,%esi
call   1030 <reverse@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xebe(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1050 <scanf@plt>
mov    %rsp,%r14
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %rsp,%rbx
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
mov    %rbx,%rdi
call   1040 <gets@plt>
mov    -0x14(%rbp),%edx
add    $0xffffffff,%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <reverse@plt>
mov    %r14,%rsp
xor    %eax,%eax
lea    -0x10(%rbp),%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
store i32 0, i32* %1
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = add nsw i32 %6, 1
%8 = zext i32 %7 to i64
%9 = call i8* @llvm.stacksave()
store i8* %9, i8** %3
%10 = alloca i8, i64 %8
store i64 %8, i64* %4
%11 = call i32 @gets(i8* %10)
%12 = load i32, i32* %2
%13 = sub nsw i32 %12, 1
%14 = call i32 @reverse(i8* %10, i32 0, i32 %13)
store i32 0, i32* %1
%15 = load i8*, i8** %3
%16 = load i32, i32* %1
ret i32 %16
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = add nsw i32 %4, 1
%6 = zext i32 %5 to i64
%7 = call i8* @llvm.stacksave()
%8 = alloca i8, i64 %6
%9 = call i32 @gets(i8* %8)
%10 = load i32, i32* %1
%11 = add nsw i32 %10, -1
%12 = call i32 @reverse(i8* %8, i32 0, i32 %11)
ret i32 0
}