xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ bar();
int /*<<< orphan*/ bla();
int /*<<< orphan*/ foo();
void dont_thread_1(void) {
  int i = 0;
  int first = 1;
  do {
    bla();
    bla();
    bla();
    if (first)
      foo();
    else
      bar();
    first = 0;
    bla();
  } while (i++ < 100);
}


x86 assembly (clang, -O0):
<dont_thread_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    $0x0,%al
call   1040 <bla@plt>
mov    $0x0,%al
call   1040 <bla@plt>
mov    $0x0,%al
call   1040 <bla@plt>
cmpl   $0x0,-0x8(%rbp)
je     1171 <dont_thread_1+0x41>
mov    $0x0,%al
call   1050 <foo@plt>
jmp    1178 <dont_thread_1+0x48>
mov    $0x0,%al
call   1030 <bar@plt>
movl   $0x0,-0x8(%rbp)
mov    $0x0,%al
call   1040 <bla@plt>
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x64,%eax
jl     1146 <dont_thread_1+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dont_thread_1>:
push   %rbx
xor    %eax,%eax
call   1040 <bla@plt>
xor    %eax,%eax
call   1040 <bla@plt>
xor    %eax,%eax
call   1040 <bla@plt>
xor    %eax,%eax
call   1050 <foo@plt>
xor    %eax,%eax
call   1040 <bla@plt>
mov    $0x64,%ebx
nopl   0x0(%rax)
xor    %eax,%eax
call   1040 <bla@plt>
xor    %eax,%eax
call   1040 <bla@plt>
xor    %eax,%eax
call   1040 <bla@plt>
xor    %eax,%eax
call   1030 <bar@plt>
xor    %eax,%eax
call   1040 <bla@plt>
add    $0xffffffff,%ebx
jne    1160 <dont_thread_1+0x30>
pop    %rbx
ret

LLVM IR (-O0):
define void @dont_thread_1() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
br label %3
3: ; preds = %15, %0
%4 = call i32 (...) @bla()
%5 = call i32 (...) @bla()
%6 = call i32 (...) @bla()
%7 = load i32, i32* %2
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %3
%10 = call i32 (...) @foo()
br label %13
11: ; preds = %3
%12 = call i32 (...) @bar()
br label %13
13: ; preds = %11, %9
store i32 0, i32* %2
%14 = call i32 (...) @bla()
br label %15
15: ; preds = %13
%16 = load i32, i32* %1
%17 = add nsw i32 %16, 1
store i32 %17, i32* %1
%18 = icmp slt i32 %16, 100
br i1 %18, label %3, label %19
19: ; preds = %15
ret void
}

LLVM IR (-O2):
define void @dont_thread_1() {
%1 = tail call i32 (...) @bla()
%2 = tail call i32 (...) @bla()
%3 = tail call i32 (...) @bla()
%4 = tail call i32 (...) @foo()
%5 = tail call i32 (...) @bla()
br label %6
6: ; preds = %6, %0
%7 = phi i32 [ 1, %0 ], [ %13, %6 ]
%8 = tail call i32 (...) @bla()
%9 = tail call i32 (...) @bla()
%10 = tail call i32 (...) @bla()
%11 = tail call i32 (...) @bar()
%12 = tail call i32 (...) @bla()
%13 = add nuw nsw i32 %7, 1
%14 = icmp eq i32 %13, 101
br i1 %14, label %15, label %6
15: ; preds = %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mintaka_thread_begin(int, int);
void mintaka_thread_begin_(int *processor, int *thread) {
  mintaka_thread_begin(*processor, *thread);
}


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

x86 assembly (clang, -O2):
<mintaka_thread_begin_>:
mov    (%rdi),%edi
mov    (%rsi),%esi
jmp    1030 <mintaka_thread_begin@plt>

LLVM IR (-O0):
define void @mintaka_thread_begin_(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* %5
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = call i32 @mintaka_thread_begin(i32 %6, i32 %8)
ret void
}

LLVM IR (-O2):
define void @mintaka_thread_begin_(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = tail call i32 @mintaka_thread_begin(i32 %3, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0x83() {
  Assert_real((isbdigit(131) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isbdigit.c",
              660, ("isbdigit should be 0 for 0x83"));
}


x86 assembly (clang, -O0):
<t_isbdigit_0x83>:
push   %rbp
mov    %rsp,%rbp
mov    $0x83,%edi
call   1040 <isbdigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x294,%edx
lea    0xf5c(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isbdigit_0x83>:
push   %rax
mov    $0x83,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x294,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0x83\00"
define void @t_isbdigit_0x83() {
%1 = call i64 @isbdigit(i32 131)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 660, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0x83\00"
define void @t_isbdigit_0x83() {
%1 = tail call i64 @isbdigit(i32 131)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 660, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void foo727(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo727(i32 %0) {
ret void
}
unsigned idhash(char *sym) {
  unsigned int hash = 0;
  unsigned c;
  while (c = *sym++)
    hash = hash * 9 ^ c;
  return hash;
}


x86 assembly (clang, -O0):
<idhash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x10(%rbp)
cmp    $0x0,%eax
je     113c <idhash+0x3c>
imul   $0x9,-0xc(%rbp),%eax
xor    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    110f <idhash+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<idhash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1124 <idhash+0x24>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
lea    (%rax,%rax,8),%eax
xor    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <idhash+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @idhash(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %5
5: ; preds = %11, %1
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i32 1
store i8* %7, i8** %2
%8 = load i8, i8* %6
%9 = sext i8 %8 to i32
store i32 %9, i32* %4
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %5
%12 = load i32, i32* %3
%13 = mul i32 %12, 9
%14 = load i32, i32* %4
%15 = xor i32 %13, %14
store i32 %15, i32* %3
br label %5
16: ; preds = %5
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @idhash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %9, %4 ], [ %0, %1 ]
%7 = phi i32 [ %11, %4 ], [ 0, %1 ]
%8 = sext i8 %5 to i32
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = mul i32 %7, 9
%11 = xor i32 %10, %8
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %15
}
__attribute__((__weak__, __always___)) int *softboundmpx___errno_location() {
  void *ret_ptr = (int *)__errno_location();
  __softboundmpx_store_return_metadata(
      ret_ptr, (void *)((char *)ret_ptr + sizeof(int *)));
  return ret_ptr;
}


x86 assembly (clang, -O0):
<softboundmpx___errno_location>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <__errno_location@plt>
cltq
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
add    $0x8,%rsi
mov    $0x0,%al
call   1040 <__softboundmpx_store_return_metadata@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<softboundmpx___errno_location>:
push   %rbx
xor    %eax,%eax
call   1030 <__errno_location@plt>
movslq %eax,%rbx
lea    0x8(%rbx),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <__softboundmpx_store_return_metadata@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define weak i32* @softboundmpx___errno_location() {
%1 = alloca i8*
%2 = call i32 (...) @__errno_location()
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = bitcast i32* %4 to i8*
store i8* %5, i8** %1
%6 = load i8*, i8** %1
%7 = load i8*, i8** %1
%8 = getelementptr inbounds i8, i8* %7, i64 8
%9 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @__softboundmpx_store_return_metadata to i32 (i8*, i8*, ...)*)(i8* %6, i8* %8)
%10 = load i8*, i8** %1
%11 = bitcast i8* %10 to i32*
ret i32* %11
}

LLVM IR (-O2):
define weak i32* @softboundmpx___errno_location() {
%1 = tail call i32 (...) @__errno_location()
%2 = sext i32 %1 to i64
%3 = inttoptr i64 %2 to i32*
%4 = inttoptr i64 %2 to i8*
%5 = getelementptr inbounds i8, i8* %4, i64 8
%6 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @__softboundmpx_store_return_metadata to i32 (i8*, i8*, ...)*)(i8* %4, i8* %5)
ret i32* %3
}
/* Variables and functions */
size_t strlen(char *);
char toupper(char);
void uppercase(char *str) {
  size_t len = strlen(str);
  size_t i;
  for (i = 0; i < len; i++) {
    str[i] = toupper(str[i]);
  }
}


x86 assembly (clang, -O0):
<uppercase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    117e <uppercase+0x5e>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <toupper@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1141 <uppercase+0x21>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uppercase>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
call   1040 <strlen@plt>
test   %rax,%rax
je     1157 <uppercase+0x37>
mov    %rax,%r14
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
movsbl (%r15,%rbx,1),%edi
call   1030 <toupper@plt>
mov    %al,(%r15,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1140 <uppercase+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @uppercase(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i64
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i64 @strlen(i8* %5)
store i64 %6, i64* %3
store i64 0, i64* %4
br label %7
7: ; preds = %20, %1
%8 = load i64, i64* %4
%9 = load i64, i64* %3
%10 = icmp ult i64 %8, %9
br i1 %10, label %11, label %23
11: ; preds = %7
%12 = load i8*, i8** %2
%13 = load i64, i64* %4
%14 = getelementptr inbounds i8, i8* %12, i64 %13
%15 = load i8, i8* %14
%16 = call signext i8 @toupper(i8 signext %15)
%17 = load i8*, i8** %2
%18 = load i64, i64* %4
%19 = getelementptr inbounds i8, i8* %17, i64 %18
store i8 %16, i8* %19
br label %20
20: ; preds = %11
%21 = load i64, i64* %4
%22 = add i64 %21, 1
store i64 %22, i64* %4
br label %7
23: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @uppercase(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %9, %4 ], [ 0, %1 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = tail call signext i8 @toupper(i8 signext %7)
store i8 %8, i8* %6
%9 = add nuw i64 %5, 1
%10 = icmp eq i64 %9, %2
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
void imx_smp_prepare(void) {}


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

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

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

LLVM IR (-O2):
define void @imx_smp_prepare() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void help(void) {
  puts("This is the low level assembler for the Nibble Knowledge 4-bit "
       "computer");
  puts("");
  puts("Usage: as4 [-b base_address] input output");
}


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

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

LLVM IR (-O0):
@.str = [72 x i8] c"This is the low level assembler for the Nibble Knowledge 4-bit computer\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [42 x i8] c"Usage: as4 [-b base_address] input output\00"
define void @help() {
%1 = call i32 @puts(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @puts(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [72 x i8] c"This is the low level assembler for the Nibble Knowledge 4-bit computer\00"
@.str.2 = [42 x i8] c"Usage: as4 [-b base_address] input output\00"
define void @help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([72 x i8], [72 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @putchar(i32 10)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0))
ret void
}
int nohandle(char c) {}


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

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

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

LLVM IR (-O2):
define i32 @nohandle(i8 signext %0) {
ret i32 undef
}
void rotate_bit_right(unsigned *str) {
  int count;
  for (count = 0; str[count]; count++) {
    str[count] = (((str[count]) >> (1)) | ((str[count]) << (8 - (1))));
  }
  return;
}


x86 assembly (clang, -O0):
<rotate_bit_right>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     1158 <rotate_bit_right+0x58>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
shr    $0x1,%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
shl    $0x7,%eax
or     %eax,%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <rotate_bit_right+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotate_bit_right>:
mov    (%rdi),%eax
test   %eax,%eax
je     1126 <rotate_bit_right+0x26>
add    $0x4,%rdi
nopw   0x0(%rax,%rax,1)
mov    %eax,%ecx
shr    %ecx
shl    $0x7,%eax
or     %ecx,%eax
mov    %eax,-0x4(%rdi)
mov    (%rdi),%eax
add    $0x4,%rdi
test   %eax,%eax
jne    1110 <rotate_bit_right+0x10>
ret

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

LLVM IR (-O2):
define void @rotate_bit_right(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp eq i32 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %11, %4 ], [ 0, %1 ]
%6 = phi i32 [ %13, %4 ], [ %2, %1 ]
%7 = phi i32* [ %12, %4 ], [ %0, %1 ]
%8 = lshr i32 %6, 1
%9 = shl i32 %6, 7
%10 = or i32 %8, %9
store i32 %10, i32* %7
%11 = add nuw nsw i64 %5, 1
%12 = getelementptr inbounds i32, i32* %0, i64 %11
%13 = load i32, i32* %12
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4, %1
ret void
}
float lms_fabs(float n) {
  float f;
  if (n >= 0)
    f = n;
  else
    f = -n;
  return f;
}


x86 assembly (clang, -O0):
<lms_fabs>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     1129 <lms_fabs+0x29>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    1140 <lms_fabs+0x40>
movss  -0x4(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<lms_fabs>:
movaps 0xef9(%rip),%xmm2
xorps  %xmm0,%xmm2
xorps  %xmm1,%xmm1
cmpnless %xmm0,%xmm1
andps  %xmm1,%xmm2
andnps %xmm0,%xmm1
orps   %xmm2,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @lms_fabs(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = fcmp oge float %4, 0.000000e+00
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load float, float* %2
store float %7, float* %3
br label %11
8: ; preds = %1
%9 = load float, float* %2
%10 = fneg float %9
store float %10, float* %3
br label %11
11: ; preds = %8, %6
%12 = load float, float* %3
ret float %12
}

LLVM IR (-O2):
define float @lms_fabs(float %0) {
%2 = fcmp ult float %0, 0.000000e+00
%3 = fneg float %0
%4 = select i1 %2, float %3, float %0
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("'1 < 2' = [%d]\n", 1 < 2);
  printf("'1 > 2' = [%d]\n", 1 > 2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
lea    0xed9(%rip),%rdi
xor    %esi,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [16 x i8] c"'1 < 2' = [%d]\0A\00"
@.str.1 = [16 x i8] c"'1 > 2' = [%d]\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 0)
ret i32 0
}
/* Variables and functions */
size_t base64_len(size_t len) {
  if (((len + 2) / 3) * 4 < len)
    return 0;
  return ((len + 2) / 3) * 4;
}


x86 assembly (clang, -O0):
<base64_len>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x2,%rax
mov    $0x3,%ecx
xor    %edx,%edx
div    %rcx
shl    $0x2,%rax
cmp    -0x10(%rbp),%rax
jae    1135 <base64_len+0x35>
movq   $0x0,-0x8(%rbp)
jmp    114f <base64_len+0x4f>
mov    -0x10(%rbp),%rax
add    $0x2,%rax
mov    $0x3,%ecx
xor    %edx,%edx
div    %rcx
shl    $0x2,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<base64_len>:
lea    0x2(%rdi),%rax
movabs $0xaaaaaaaaaaaaaaab,%rcx
aa aa aa
mul    %rcx
lea    (%rdx,%rdx,1),%rcx
and    $0xfffffffffffffffc,%rcx
xor    %eax,%eax
cmp    %rdi,%rcx
cmovae %rcx,%rax
ret

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

LLVM IR (-O2):
define i64 @base64_len(i64 %0) {
%2 = add i64 %0, 2
%3 = udiv i64 %2, 3
%4 = shl i64 %3, 2
%5 = icmp ult i64 %4, %0
%6 = select i1 %5, i64 0, i64 %4
ret i64 %6
}
unsigned long long t8(unsigned long long a, unsigned long long b) {
  printf("%s: a: %llu\n", __func__, a);
  printf("%s: b: %llu\n", __func__, b);
  return a + b;
}


x86 assembly (clang, -O0):
<t8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdx
lea    0xed5(%rip),%rdi
lea    0xedb(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rdx
lea    0xecc(%rip),%rdi
lea    0xec2(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t8>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
lea    0xede(%rip),%rdi
lea    0xee4(%rip),%r15
mov    %r15,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed3(%rip),%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
add    %r14,%rbx
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [13 x i8] c"%s: a: %llu\0A\00"
@__func__.t8 = [3 x i8] c"t8\00"
@.str.1 = [13 x i8] c"%s: b: %llu\0A\00"
define i64 @t8(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__func__.t8, i64 0, i64 0), i64 %5)
%7 = load i64, i64* %4
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__func__.t8, i64 0, i64 0), i64 %7)
%9 = load i64, i64* %3
%10 = load i64, i64* %4
%11 = add i64 %9, %10
ret i64 %11
}

LLVM IR (-O2):
@.str = [13 x i8] c"%s: a: %llu\0A\00"
@__func__.t8 = [3 x i8] c"t8\00"
@.str.1 = [13 x i8] c"%s: b: %llu\0A\00"
define i64 @t8(i64 %0, i64 %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__func__.t8, i64 0, i64 0), i64 %0)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @__func__.t8, i64 0, i64 0), i64 %1)
%5 = add i64 %1, %0
ret i64 %5
}
void RTUuidFromUtf16(void) {}


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

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

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

LLVM IR (-O2):
define void @RTUuidFromUtf16() {
ret void
}
void LPC0_Handler(void) {
  while (1) {
  }
}


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

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

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

LLVM IR (-O2):
define void @LPC0_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int vsnprintf_internal(char *, int, char const *, int /*<<< orphan*/);
int vsprintf(char *buf, const char *fmt, va_list args) {
  return vsnprintf_internal(buf, ((int)(~0U >> 1)), fmt, args);
}


x86 assembly (clang, -O0):
<vsprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    $0x7fffffff,%esi
call   1030 <vsnprintf_internal@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vsprintf>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    $0x7fffffff,%esi
jmp    1030 <vsnprintf_internal@plt>

LLVM IR (-O0):
define i32 @vsprintf(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @vsnprintf_internal(i8* %7, i32 2147483647, i8* %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @vsprintf(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @vsnprintf_internal(i8* %0, i32 2147483647, i8* %1, i32 %2)
ret i32 %4
}
/* Type definitions */
struct sockaddr_in {
  scalar_t__ sin_family;
};
struct ndm_ip_sockaddr_t {
  int dummy;
};

/* Variables and functions */
scalar_t__ AF_INET;
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ memcpy(struct ndm_ip_sockaddr_t *,
                          struct sockaddr_in const *const, int);
void ndm_ip_sockaddr_assign(struct ndm_ip_sockaddr_t *sa,
                            const struct sockaddr_in *const in) {
  assert(in->sin_family == AF_INET);
  memcpy(sa, in, sizeof(*in));
}


x86 assembly (clang, -O0):
<ndm_ip_sockaddr_assign>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    0x2eaa(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x8,%edx
call   1040 <memcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ndm_ip_sockaddr_assign>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    (%rsi),%rax
mov    0x2eb4(%rip),%rcx
xor    %edi,%edi
cmp    (%rcx),%rax
sete   %dil
call   1030 <assert@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x8,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <memcpy@plt>

LLVM IR (-O0):
%struct.ndm_ip_sockaddr_t = type { i32 }
%struct.sockaddr_in = type { i64 }
@AF_INET = global i64 0
define void @ndm_ip_sockaddr_assign(%struct.ndm_ip_sockaddr_t* %0, %struct.sockaddr_in* %1) {
%3 = alloca %struct.ndm_ip_sockaddr_t*
%4 = alloca %struct.sockaddr_in*
store %struct.ndm_ip_sockaddr_t* %0, %struct.ndm_ip_sockaddr_t** %3
store %struct.sockaddr_in* %1, %struct.sockaddr_in** %4
%5 = load %struct.sockaddr_in*, %struct.sockaddr_in** %4
%6 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %5, i32 0, i32 0
%7 = load i64, i64* %6
%8 = load i64, i64* @AF_INET
%9 = icmp eq i64 %7, %8
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = load %struct.ndm_ip_sockaddr_t*, %struct.ndm_ip_sockaddr_t** %3
%13 = load %struct.sockaddr_in*, %struct.sockaddr_in** %4
%14 = call i32 @memcpy(%struct.ndm_ip_sockaddr_t* %12, %struct.sockaddr_in* %13, i32 8)
ret void
}

LLVM IR (-O2):
%struct.ndm_ip_sockaddr_t = type { i32 }
%struct.sockaddr_in = type { i64 }
@AF_INET = global i64 0
define void @ndm_ip_sockaddr_assign(%struct.ndm_ip_sockaddr_t* %0, %struct.sockaddr_in* %1) {
%3 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %1, i64 0, i32 0
%4 = load i64, i64* %3
%5 = load i64, i64* @AF_INET
%6 = icmp eq i64 %4, %5
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = tail call i32 @memcpy(%struct.ndm_ip_sockaddr_t* %0, %struct.sockaddr_in* %1, i32 8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_objid(int);
int /*<<< orphan*/ writeln(char *);
int /*<<< orphan*/ writestr(char *);
void writeprop(char *propname, int obj) {
  writestr(propname);
  writestr(" [");
  print_objid(obj);
  writeln("]");
}


x86 assembly (clang, -O0):
<writeprop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <writestr@plt>
lea    0xeb1(%rip),%rdi
call   1050 <writestr@plt>
mov    -0xc(%rbp),%edi
call   1030 <print_objid@plt>
lea    0xea0(%rip),%rdi
call   1040 <writeln@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeprop>:
push   %rbx
mov    %esi,%ebx
call   1050 <writestr@plt>
lea    0xec1(%rip),%rdi
call   1050 <writestr@plt>
mov    %ebx,%edi
call   1030 <print_objid@plt>
lea    0xeb1(%rip),%rdi
pop    %rbx
jmp    1040 <writeln@plt>

LLVM IR (-O0):
@.str = [3 x i8] c" [\00"
@.str.1 = [2 x i8] c"]\00"
define void @writeprop(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = call i32 @writestr(i8* %5)
%7 = call i32 @writestr(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* %4
%9 = call i32 @print_objid(i32 %8)
%10 = call i32 @writeln(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c" [\00"
@.str.1 = [2 x i8] c"]\00"
define void @writeprop(i8* %0, i32 %1) {
%3 = tail call i32 @writestr(i8* %0)
%4 = tail call i32 @writestr(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @print_objid(i32 %1)
%6 = tail call i32 @writeln(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}
float ctss_norm_cos(const float x) {
  const float x2 = x * x;
  return 1.0f + x2 * (-4.0f + 2.0f * x2);
}


x86 assembly (clang, -O0):
<ctss_norm_cos>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
addss  %xmm1,%xmm1
movss  0xed6(%rip),%xmm2
addss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
movss  0xec2(%rip),%xmm1
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ctss_norm_cos>:
mulss  %xmm0,%xmm0
movaps %xmm0,%xmm1
addss  %xmm0,%xmm1
addss  0xeed(%rip),%xmm1
mulss  %xmm1,%xmm0
addss  0xee5(%rip),%xmm0
ret

LLVM IR (-O0):
define float @ctss_norm_cos(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = load float, float* %2
%6 = fmul float %4, %5
store float %6, float* %3
%7 = load float, float* %3
%8 = load float, float* %3
%9 = call float @llvm.fmuladd.f32(float 2.000000e+00, float %8, float -4.000000e+00)
%10 = call float @llvm.fmuladd.f32(float %7, float %9, float 1.000000e+00)
ret float %10
}

LLVM IR (-O2):
define float @ctss_norm_cos(float %0) {
%2 = fmul float %0, %0
%3 = tail call float @llvm.fmuladd.f32(float %2, float 2.000000e+00, float -4.000000e+00)
%4 = tail call float @llvm.fmuladd.f32(float %2, float %3, float 1.000000e+00)
ret float %4
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void u8tohex(uint8_t x, char *str) {
  static const char hdigit[16] = {'0', '1', '2', '3', '4', '5', '6', '7',
                                  '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
  str[0] = hdigit[(x >> 4) & 0xf];
  str[1] = hdigit[x & 0xf];
  str[2] = '\0';
}


x86 assembly (clang, -O0):
<u8tohex>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x4,%eax
and    $0xf,%eax
movslq %eax,%rcx
lea    0xee2(%rip),%rax
mov    (%rax,%rcx,1),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x4(%rbp),%eax
and    $0xf,%eax
movslq %eax,%rcx
lea    0xec9(%rip),%rax
mov    (%rax,%rcx,1),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x10(%rbp),%rax
movb   $0x0,0x2(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<u8tohex>:
mov    %edi,%eax
shr    $0x4,%eax
and    $0xf,%eax
lea    0xef1(%rip),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,(%rsi)
and    $0xf,%edi
mov    (%rdi,%rcx,1),%al
mov    %al,0x1(%rsi)
movb   $0x0,0x2(%rsi)
ret

LLVM IR (-O0):
@u8tohex.hdigit = internal constant [16 x i8] c"0123456789abcdef"
define void @u8tohex(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = ashr i32 %5, 4
%7 = and i32 %6, 15
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds [16 x i8], [16 x i8]* @u8tohex.hdigit, i64 0, i64 %8
%10 = load i8, i8* %9
%11 = load i8*, i8** %4
%12 = getelementptr inbounds i8, i8* %11, i64 0
store i8 %10, i8* %12
%13 = load i32, i32* %3
%14 = and i32 %13, 15
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [16 x i8], [16 x i8]* @u8tohex.hdigit, i64 0, i64 %15
%17 = load i8, i8* %16
%18 = load i8*, i8** %4
%19 = getelementptr inbounds i8, i8* %18, i64 1
store i8 %17, i8* %19
%20 = load i8*, i8** %4
%21 = getelementptr inbounds i8, i8* %20, i64 2
store i8 0, i8* %21
ret void
}

LLVM IR (-O2):
@u8tohex.hdigit = internal unnamed_addr constant [16 x i8] c"0123456789abcdef"
define void @u8tohex(i32 %0, i8* nocapture writeonly %1) {
%3 = lshr i32 %0, 4
%4 = and i32 %3, 15
%5 = zext i32 %4 to i64
%6 = getelementptr inbounds [16 x i8], [16 x i8]* @u8tohex.hdigit, i64 0, i64 %5
%7 = load i8, i8* %6
store i8 %7, i8* %1
%8 = and i32 %0, 15
%9 = zext i32 %8 to i64
%10 = getelementptr inbounds [16 x i8], [16 x i8]* @u8tohex.hdigit, i64 0, i64 %9
%11 = load i8, i8* %10
%12 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %11, i8* %12
%13 = getelementptr inbounds i8, i8* %1, i64 2
store i8 0, i8* %13
ret void
}
void ff_hevc_put_hevc_epel_hv16_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_epel_hv16_10_sse4() {
ret void
}
/* Type definitions */
struct pico_mqtt_serializer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ add_2_byte_stream(struct pico_mqtt_serializer *, int);
int create_stream(struct pico_mqtt_serializer *, int);
int serialize_pingreq(struct pico_mqtt_serializer *serializer) {
  do {
  } while (0);
  if (create_stream(serializer, 2) == -1) {
    do {
    } while (0);
    return -1;
  }
  add_2_byte_stream(serializer, 0xC000);
  return 0;
}


x86 assembly (clang, -O0):
<serialize_pingreq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
jmp    1131 <serialize_pingreq+0x11>
mov    -0x10(%rbp),%rdi
mov    $0x2,%esi
call   1030 <create_stream@plt>
cmp    $0xffffffff,%eax
jne    115e <serialize_pingreq+0x3e>
jmp    114d <serialize_pingreq+0x2d>
jmp    1152 <serialize_pingreq+0x32>
movl   $0xffffffff,-0x4(%rbp)
jmp    1173 <serialize_pingreq+0x53>
mov    -0x10(%rbp),%rdi
mov    $0xc000,%esi
call   1040 <add_2_byte_stream@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serialize_pingreq>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2,%esi
call   1030 <create_stream@plt>
cmp    $0xffffffff,%eax
je     1144 <serialize_pingreq+0x24>
mov    %rbx,%rdi
mov    $0xc000,%esi
call   1040 <add_2_byte_stream@plt>
xor    %eax,%eax
pop    %rbx
ret
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.pico_mqtt_serializer = type { i32 }
define i32 @serialize_pingreq(%struct.pico_mqtt_serializer* %0) {
%2 = alloca i32
%3 = alloca %struct.pico_mqtt_serializer*
store %struct.pico_mqtt_serializer* %0, %struct.pico_mqtt_serializer** %3
br label %4
4: ; preds = %1
br label %5
5: ; preds = %4
%6 = load %struct.pico_mqtt_serializer*, %struct.pico_mqtt_serializer** %3
%7 = call i32 @create_stream(%struct.pico_mqtt_serializer* %6, i32 2)
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %12
9: ; preds = %5
br label %10
10: ; preds = %9
br label %11
11: ; preds = %10
store i32 -1, i32* %2
br label %15
12: ; preds = %5
%13 = load %struct.pico_mqtt_serializer*, %struct.pico_mqtt_serializer** %3
%14 = call i32 @add_2_byte_stream(%struct.pico_mqtt_serializer* %13, i32 49152)
store i32 0, i32* %2
br label %15
15: ; preds = %12, %11
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
%struct.pico_mqtt_serializer = type { i32 }
define i32 @serialize_pingreq(%struct.pico_mqtt_serializer* %0) {
%2 = tail call i32 @create_stream(%struct.pico_mqtt_serializer* %0, i32 2)
%3 = icmp eq i32 %2, -1
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @add_2_byte_stream(%struct.pico_mqtt_serializer* %0, i32 49152)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 0, %4 ], [ -1, %1 ]
ret i32 %7
}
long max32(long a, long b) { return (a > b) ? a : b; }


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

x86 assembly (clang, -O2):
<max32>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovg  %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @max32(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Variables and functions */
double __ocml_sinh_f64(double);
double sinh(double x) { return __ocml_sinh_f64(x); }


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

x86 assembly (clang, -O2):
<sinh>:
jmp    1030 <__ocml_sinh_f64@plt>

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

LLVM IR (-O2):
define double @sinh(double %0) {
%2 = tail call double @__ocml_sinh_f64(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ merge_sort(double *, int);
void sort(double array[], int array_size) { merge_sort(array, array_size); }


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

x86 assembly (clang, -O2):
<sort>:
jmp    1030 <merge_sort@plt>

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

LLVM IR (-O2):
define void @sort(double* %0, i32 %1) {
%3 = tail call i32 @merge_sort(double* %0, i32 %1)
ret void
}
void dbg_debugfs_exit(void) { return; }


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

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

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

LLVM IR (-O2):
define void @dbg_debugfs_exit() {
ret void
}
void irssi_redraw(void) {}


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

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

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

LLVM IR (-O2):
define void @irssi_redraw() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, double, double, double);
void printAngles(char indicator[], double angles[3]) {
  printf("%s - Angle 1: %.2f;   Angle 2: %.2f;  Angle 3: %.2f;\n", indicator,
         angles[0], angles[1], angles[2]);
}


x86 assembly (clang, -O0):
<printAngles>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm2
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printAngles>:
mov    %rdi,%rax
movsd  (%rsi),%xmm0
movsd  0x8(%rsi),%xmm1
movsd  0x10(%rsi),%xmm2
lea    0xed8(%rip),%rdi
mov    %rax,%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [54 x i8] c"%s - Angle 1: %.2f; Angle 2: %.2f; Angle 3: %.2f;\0A\00"
define void @printAngles(i8* %0, double* %1) {
%3 = alloca i8*
%4 = alloca double*
store i8* %0, i8** %3
store double* %1, double** %4
%5 = load i8*, i8** %3
%6 = load double*, double** %4
%7 = getelementptr inbounds double, double* %6, i64 0
%8 = load double, double* %7
%9 = load double*, double** %4
%10 = getelementptr inbounds double, double* %9, i64 1
%11 = load double, double* %10
%12 = load double*, double** %4
%13 = getelementptr inbounds double, double* %12, i64 2
%14 = load double, double* %13
%15 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i8* %5, double %8, double %11, double %14)
ret void
}

LLVM IR (-O2):
@.str = [54 x i8] c"%s - Angle 1: %.2f; Angle 2: %.2f; Angle 3: %.2f;\0A\00"
define void @printAngles(i8* %0, double* nocapture %1) {
%3 = load double, double* %1
%4 = getelementptr inbounds double, double* %1, i64 1
%5 = load double, double* %4
%6 = getelementptr inbounds double, double* %1, i64 2
%7 = load double, double* %6
%8 = tail call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i8* %0, double %3, double %5, double %7)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ divide(int);
int main() {
  for (uint32_t N0 = 1; N0 <= 6000; N0++)
    divide(N0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x1770,-0x8(%rbp)
jg     1149 <main+0x39>
mov    -0x8(%rbp),%edi
call   1030 <divide@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
br label %2
1: ; preds = %2
ret i32 0
2: ; preds = %0, %2
%3 = phi i32 [ 1, %0 ], [ %5, %2 ]
%4 = tail call i32 @divide(i32 %3)
%5 = add nuw nsw i32 %3, 1
%6 = icmp eq i32 %5, 6001
br i1 %6, label %1, label %2
}
unsigned short swaps(s)
unsigned short *s;
{
  union {
    unsigned s;
    unsigned char c[2];
  } u;
  unsigned char temp;
  u.s = *s;
  temp = u.c[0];
  u.c[0] = u.c[1];
  u.c[1] = temp;
  return (u.s);
}


x86 assembly (clang, -O0):
<swaps>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%al
mov    %al,-0x11(%rbp)
mov    -0xf(%rbp),%al
mov    %al,-0x10(%rbp)
mov    -0x11(%rbp),%al
mov    %al,-0xf(%rbp)
mov    -0x10(%rbp),%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<swaps>:
movzwl (%rdi),%eax
rol    $0x8,%ax
ret

LLVM IR (-O0):
%union.anon = type { i32 }
define zeroext i16 @swaps(i16* %0) {
%2 = alloca i16*
%3 = alloca %union.anon
%4 = alloca i8
store i16* %0, i16** %2
%5 = load i16*, i16** %2
%6 = load i16, i16* %5
%7 = zext i16 %6 to i32
%8 = bitcast %union.anon* %3 to i32*
store i32 %7, i32* %8
%9 = bitcast %union.anon* %3 to [2 x i8]*
%10 = getelementptr inbounds [2 x i8], [2 x i8]* %9, i64 0, i64 0
%11 = load i8, i8* %10
store i8 %11, i8* %4
%12 = bitcast %union.anon* %3 to [2 x i8]*
%13 = getelementptr inbounds [2 x i8], [2 x i8]* %12, i64 0, i64 1
%14 = load i8, i8* %13
%15 = bitcast %union.anon* %3 to [2 x i8]*
%16 = getelementptr inbounds [2 x i8], [2 x i8]* %15, i64 0, i64 0
store i8 %14, i8* %16
%17 = load i8, i8* %4
%18 = bitcast %union.anon* %3 to [2 x i8]*
%19 = getelementptr inbounds [2 x i8], [2 x i8]* %18, i64 0, i64 1
store i8 %17, i8* %19
%20 = bitcast %union.anon* %3 to i32*
%21 = load i32, i32* %20
%22 = trunc i32 %21 to i16
ret i16 %22
}

LLVM IR (-O2):
define zeroext i16 @swaps(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = tail call i16 @llvm.bswap.i16(i16 %2)
ret i16 %3
}
void mus_set_big_endian_float(unsigned char *j, float x) {
  unsigned char *ox;
  ox = (unsigned char *)&x;
  j[0] = ox[0];
  j[1] = ox[1];
  j[2] = ox[2];
  j[3] = ox[3];
}


x86 assembly (clang, -O0):
<mus_set_big_endian_float>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x18(%rbp),%rax
mov    0x2(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x18(%rbp),%rax
mov    0x3(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mus_set_big_endian_float>:
movss  %xmm0,(%rdi)
ret

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

LLVM IR (-O2):
define void @mus_set_big_endian_float(i8* nocapture writeonly %0, float %1) {
%3 = bitcast float %1 to i32
%4 = trunc i32 %3 to i8
store i8 %4, i8* %0
%5 = lshr i32 %3, 8
%6 = trunc i32 %5 to i8
%7 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %6, i8* %7
%8 = lshr i32 %3, 16
%9 = trunc i32 %8 to i8
%10 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %9, i8* %10
%11 = lshr i32 %3, 24
%12 = trunc i32 %11 to i8
%13 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %12, i8* %13
ret void
}
void load_hi_score() {}


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

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

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

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