xunge/DecIR huggingface dataset:
/* Type definitions */
typedef scalar_t__ clock_t;

/* Variables and functions */
scalar_t__ CLOCKS_PER_SEC;
float diffTime(clock_t t1, clock_t t2) {
  return ((float)(t2 - t1) / (float)CLOCKS_PER_SEC) * 1000;
}


x86 assembly (clang, -O0):
<diffTime>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
sub    -0x8(%rbp),%rax
cvtsi2ss %rax,%xmm0
mov    0x2ec8(%rip),%rax
cvtsi2ssq (%rax),%xmm1
divss  %xmm1,%xmm0
movss  0xecf(%rip),%xmm1
mulss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<diffTime>:
sub    %rdi,%rsi
cvtsi2ss %rsi,%xmm0
mov    0x2ed9(%rip),%rax
cvtsi2ssq (%rax),%xmm1
divss  %xmm1,%xmm0
mulss  0xee0(%rip),%xmm0
ret

LLVM IR (-O0):
@CLOCKS_PER_SEC = global i64 0
define float @diffTime(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = sub nsw i64 %5, %6
%8 = sitofp i64 %7 to float
%9 = load i64, i64* @CLOCKS_PER_SEC
%10 = sitofp i64 %9 to float
%11 = fdiv float %8, %10
%12 = fmul float %11, 1.000000e+03
ret float %12
}

LLVM IR (-O2):
@CLOCKS_PER_SEC = global i64 0
define float @diffTime(i64 %0, i64 %1) {
%3 = sub nsw i64 %1, %0
%4 = sitofp i64 %3 to float
%5 = load i64, i64* @CLOCKS_PER_SEC
%6 = sitofp i64 %5 to float
%7 = fdiv float %4, %6
%8 = fmul float %7, 1.000000e+03
ret float %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_daust_usage() {
  printf("Usage: daust [options] [commands]\n"
         "\t-V, --version\t\tPrint the version and exit.\n"
         "\t-h, --help\t\tPrint this help and exit.\n\n"
         "Options: \n"
         "\t-v, --verbose\t\tMore verbose output\n\n"
         "Commands: \n"
         "\tping\t\t\tSee if node is up\n"
         "\tlist\t\t\tList known nodes\n"
         "\tstop\t\t\tKill the daustd process\n\n"
         "Examples: \n"
         "\tdaust list\t\tList locally known nodes\n"
         "\tdaust remote node1 ping\tPing daustd on node1\n"
         "\tdaust all stop\t\tKill daustd on all nodes\n");
}


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

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

LLVM IR (-O0):
@.str = [398 x i8] c"Usage: daust [options] [commands]\0A\09-V, --version\09\09Print the version and exit.\0A\09-h, --help\09\09Print this help and exit.\0A\0AOptions: \0A\09-v, --verbose\09\09More verbose output\0A\0ACommands: \0A\09ping\09\09\09See if node is up\0A\09list\09\09\09List known nodes\0A\09stop\09\09\09Kill the daustd process\0A\0AExamples: \0A\09daust list\09\09List locally known nodes\0A\09daust remote node1 ping\09Ping daustd on node1\0A\09daust all stop\09\09Kill daustd on all nodes\0A\00"
define void @print_daust_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([398 x i8], [398 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [397 x i8] c"Usage: daust [options] [commands]\0A\09-V, --version\09\09Print the version and exit.\0A\09-h, --help\09\09Print this help and exit.\0A\0AOptions: \0A\09-v, --verbose\09\09More verbose output\0A\0ACommands: \0A\09ping\09\09\09See if node is up\0A\09list\09\09\09List known nodes\0A\09stop\09\09\09Kill the daustd process\0A\0AExamples: \0A\09daust list\09\09List locally known nodes\0A\09daust remote node1 ping\09Ping daustd on node1\0A\09daust all stop\09\09Kill daustd on all nodes\00"
define void @print_daust_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([397 x i8], [397 x i8]* @str, i64 0, i64 0))
ret void
}
int clickplc_exe_EndOfMain_enc(void *obj, unsigned char *stream) {
  int encsize = 4;
  stream[0] = 0x00;
  stream[1] = 0x80;
  stream[2] = 0xff;
  stream[3] = 0xff;
  return (encsize);
}


x86 assembly (clang, -O0):
<clickplc_exe_EndOfMain_enc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x4,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rax
movb   $0x80,0x1(%rax)
mov    -0x10(%rbp),%rax
movb   $0xff,0x2(%rax)
mov    -0x10(%rbp),%rax
movb   $0xff,0x3(%rax)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clickplc_exe_EndOfMain_enc>:
movl   $0xffff8000,(%rsi)
mov    $0x4,%eax
ret

LLVM IR (-O0):
define i32 @clickplc_exe_EndOfMain_enc(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
store i32 4, i32* %5
%6 = load i8*, i8** %4
%7 = getelementptr inbounds i8, i8* %6, i64 0
store i8 0, i8* %7
%8 = load i8*, i8** %4
%9 = getelementptr inbounds i8, i8* %8, i64 1
store i8 -128, i8* %9
%10 = load i8*, i8** %4
%11 = getelementptr inbounds i8, i8* %10, i64 2
store i8 -1, i8* %11
%12 = load i8*, i8** %4
%13 = getelementptr inbounds i8, i8* %12, i64 3
store i8 -1, i8* %13
%14 = load i32, i32* %5
ret i32 %14
}

LLVM IR (-O2):
define i32 @clickplc_exe_EndOfMain_enc(i8* nocapture readnone %0, i8* nocapture writeonly %1) {
store i8 0, i8* %1
%3 = getelementptr inbounds i8, i8* %1, i64 1
store i8 -128, i8* %3
%4 = getelementptr inbounds i8, i8* %1, i64 2
store i8 -1, i8* %4
%5 = getelementptr inbounds i8, i8* %1, i64 3
store i8 -1, i8* %5
ret i32 4
}
/* Variables and functions */
scalar_t__ another_unsigned_high_prod(unsigned int, unsigned int);
int /*<<< orphan*/ assert(int);
scalar_t__ unsigned_high_prod(unsigned int, unsigned int);
int main(int argc, char *argv[]) {
  unsigned x = 0x12345678;
  unsigned y = 0xFFFFFFFF;
  assert(another_unsigned_high_prod(x, y) == unsigned_high_prod(x, y));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x12345678,-0x14(%rbp)
movl   $0xffffffff,-0x18(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1050 <another_unsigned_high_prod@plt>
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1030 <unsigned_high_prod@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x12345678,%edi
mov    $0xffffffff,%esi
call   1050 <another_unsigned_high_prod@plt>
mov    %rax,%rbx
mov    $0x12345678,%edi
mov    $0xffffffff,%esi
call   1030 <unsigned_high_prod@plt>
xor    %edi,%edi
cmp    %rax,%rbx
sete   %dil
call   1040 <assert@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 305419896, i32* %6
store i32 -1, i32* %7
%8 = load i32, i32* %6
%9 = load i32, i32* %7
%10 = call i64 @another_unsigned_high_prod(i32 %8, i32 %9)
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = call i64 @unsigned_high_prod(i32 %11, i32 %12)
%14 = icmp eq i64 %10, %13
%15 = zext i1 %14 to i32
%16 = call i32 @assert(i32 %15)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 @another_unsigned_high_prod(i32 305419896, i32 -1)
%4 = tail call i64 @unsigned_high_prod(i32 305419896, i32 -1)
%5 = icmp eq i64 %3, %4
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ link_failure_logl();
scalar_t__ logl(long double);
void test_logl(long double ld) {
  if (logl(ld) != logl(ld))
    link_failure_logl();
}


x86 assembly (clang, -O0):
<test_logl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <logl@plt>
mov    %rax,-0x18(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <logl@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
je     1163 <test_logl+0x43>
mov    $0x0,%al
call   1040 <link_failure_logl@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_logl>:
push   %rbx
sub    $0x20,%rsp
fldt   0x30(%rsp)
fld    %st(0)
fstpt  0x14(%rsp)
fstpt  (%rsp)
call   1030 <logl@plt>
mov    %rax,%rbx
fldt   0x14(%rsp)
fstpt  (%rsp)
call   1030 <logl@plt>
cmp    %rax,%rbx
jne    1151 <test_logl+0x31>
add    $0x20,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
jmp    1040 <link_failure_logl@plt>

LLVM IR (-O0):
define void @test_logl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = call i64 @logl(x86_fp80 %3)
%5 = load x86_fp80, x86_fp80* %2
%6 = call i64 @logl(x86_fp80 %5)
%7 = icmp ne i64 %4, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @link_failure_logl()
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
define void @test_logl(x86_fp80 %0) {
%2 = tail call i64 @logl(x86_fp80 %0)
%3 = tail call i64 @logl(x86_fp80 %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_logl()
br label %7
7: ; preds = %5, %1
ret void
}
void pausingTimerStartsNow() {}


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

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

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

LLVM IR (-O2):
define void @pausingTimerStartsNow() {
ret void
}
int IDim(const int i) { return i & (-i >> (8 * sizeof i - 1)); }


x86 assembly (clang, -O0):
<IDim>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    %ecx,%ecx
sub    -0x4(%rbp),%ecx
sar    $0x1f,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IDim>:
xor    %eax,%eax
test   %edi,%edi
cmovns %edi,%eax
ret

LLVM IR (-O0):
define i32 @IDim(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = sub nsw i32 0, %4
%6 = ashr i32 %5, 31
%7 = and i32 %3, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @IDim(i32 %0) {
%2 = icmp sgt i32 %0, 0
%3 = select i1 %2, i32 %0, i32 0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_running_in_vm() {
  printf("NOT IMPLEMENTED:"
         "pa_running_in_vm"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [33 x i8] c"NOT IMPLEMENTED:pa_running_in_vm\00"
define i32 @pa_running_in_vm() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ wint_t;
typedef int /*<<< orphan*/ locale_t;

/* Variables and functions */
int iswalnum(int /*<<< orphan*/);
int iswalnum_l(wint_t c, locale_t l) { return iswalnum(c); }


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

x86 assembly (clang, -O2):
<iswalnum_l>:
jmp    1030 <iswalnum@plt>

LLVM IR (-O0):
define i32 @iswalnum_l(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 @iswalnum(i32 %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @iswalnum_l(i32 %0, i32 %1) {
%3 = tail call i32 @iswalnum(i32 %0)
ret i32 %3
}
/* Variables and functions */
int omp_get_num_procs();
int omp_get_thread_num();
int /*<<< orphan*/ omp_set_num_threads(int);
void bones_initialize_target(void) {
  int bones_thread_count = omp_get_num_procs();
  omp_set_num_threads(bones_thread_count);
#pragma omp parallel
  { int bones_thread_id = omp_get_thread_num(); }
}


x86 assembly (clang, -O0):
<bones_initialize_target>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <omp_get_num_procs@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <omp_set_num_threads@plt>
mov    $0x0,%al
call   1030 <omp_get_thread_num@plt>
mov    %eax,-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bones_initialize_target>:
push   %rax
xor    %eax,%eax
call   1040 <omp_get_num_procs@plt>
mov    %eax,%edi
call   1050 <omp_set_num_threads@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <omp_get_thread_num@plt>

LLVM IR (-O0):
define void @bones_initialize_target() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @omp_get_num_procs()
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = call i32 @omp_set_num_threads(i32 %4)
%6 = call i32 (...) @omp_get_thread_num()
store i32 %6, i32* %2
ret void
}

LLVM IR (-O2):
define void @bones_initialize_target() {
%1 = tail call i32 (...) @omp_get_num_procs()
%2 = tail call i32 @omp_set_num_threads(i32 %1)
%3 = tail call i32 (...) @omp_get_thread_num()
ret void
}
unsigned int hweight16(unsigned short w) {
  w = (w & 0x5555) + ((w >> 1) & 0x5555);
  w = (w & 0x3333) + ((w >> 2) & 0x3333);
  w = (w & 0x0F0F) + ((w >> 4) & 0x0F0F);
  w = (w & 0x00FF) + ((w >> 8) & 0x00FF);
  return w;
}


x86 assembly (clang, -O0):
<hweight16>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
and    $0x5555,%eax
movzwl -0x2(%rbp),%ecx
sar    $0x1,%ecx
and    $0x5555,%ecx
add    %ecx,%eax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
and    $0x3333,%eax
movzwl -0x2(%rbp),%ecx
sar    $0x2,%ecx
and    $0x3333,%ecx
add    %ecx,%eax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
and    $0xf0f,%eax
movzwl -0x2(%rbp),%ecx
sar    $0x4,%ecx
and    $0xf0f,%ecx
add    %ecx,%eax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
and    $0xff,%eax
movzwl -0x2(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff,%ecx
add    %ecx,%eax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hweight16>:
mov    %edi,%eax
and    $0x5555,%eax
shr    %edi
and    $0x5555,%edi
add    %eax,%edi
mov    %edi,%eax
and    $0x3333,%eax
shr    $0x2,%edi
and    $0x3333,%edi
add    %eax,%edi
mov    %edi,%eax
and    $0x707,%eax
shr    $0x4,%edi
and    $0x707,%edi
add    %eax,%edi
mov    %edi,%eax
shr    $0x8,%eax
add    %edi,%eax
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @hweight16(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, 21845
%6 = load i16, i16* %2
%7 = zext i16 %6 to i32
%8 = ashr i32 %7, 1
%9 = and i32 %8, 21845
%10 = add nsw i32 %5, %9
%11 = trunc i32 %10 to i16
store i16 %11, i16* %2
%12 = load i16, i16* %2
%13 = zext i16 %12 to i32
%14 = and i32 %13, 13107
%15 = load i16, i16* %2
%16 = zext i16 %15 to i32
%17 = ashr i32 %16, 2
%18 = and i32 %17, 13107
%19 = add nsw i32 %14, %18
%20 = trunc i32 %19 to i16
store i16 %20, i16* %2
%21 = load i16, i16* %2
%22 = zext i16 %21 to i32
%23 = and i32 %22, 3855
%24 = load i16, i16* %2
%25 = zext i16 %24 to i32
%26 = ashr i32 %25, 4
%27 = and i32 %26, 3855
%28 = add nsw i32 %23, %27
%29 = trunc i32 %28 to i16
store i16 %29, i16* %2
%30 = load i16, i16* %2
%31 = zext i16 %30 to i32
%32 = and i32 %31, 255
%33 = load i16, i16* %2
%34 = zext i16 %33 to i32
%35 = ashr i32 %34, 8
%36 = and i32 %35, 255
%37 = add nsw i32 %32, %36
%38 = trunc i32 %37 to i16
store i16 %38, i16* %2
%39 = load i16, i16* %2
%40 = zext i16 %39 to i32
ret i32 %40
}

LLVM IR (-O2):
define i32 @hweight16(i16 zeroext %0) {
%2 = and i16 %0, 21845
%3 = lshr i16 %0, 1
%4 = and i16 %3, 21845
%5 = add nuw i16 %4, %2
%6 = and i16 %5, 13107
%7 = lshr i16 %5, 2
%8 = and i16 %7, 13107
%9 = add nuw nsw i16 %8, %6
%10 = and i16 %9, 1799
%11 = lshr i16 %9, 4
%12 = and i16 %11, 1799
%13 = add nuw nsw i16 %12, %10
%14 = and i16 %13, 15
%15 = lshr i16 %13, 8
%16 = add nuw nsw i16 %14, %15
%17 = zext i16 %16 to i32
ret i32 %17
}
void outValue(int *outValue) { *outValue = 42; }


x86 assembly (clang, -O0):
<outValue>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x2a,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outValue>:
movl   $0x2a,(%rdi)
ret

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

LLVM IR (-O2):
define void @outValue(i32* nocapture writeonly %0) {
store i32 42, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int foobar(void) { puts("foo bar here"); }


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"foo bar here\00"
define i32 @foobar() {
%1 = alloca i32
%2 = call i32 @puts(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [13 x i8] c"foo bar here\00"
define i32 @foobar() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ carriage();
int main(int argc, char *argv[]) {
  carriage();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @carriage()
ret i32 0
}
int ld_gt_rm1(long double a1, long double *a2) { return (((a1) > (*a2))); }


x86 assembly (clang, -O0):
<ld_gt_rm1>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
mov    %rdi,-0x18(%rbp)
fldt   -0x10(%rbp)
mov    -0x18(%rbp),%rax
fldt   (%rax)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ld_gt_rm1>:
fldt   0x8(%rsp)
fldt   (%rdi)
xor    %eax,%eax
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
seta   %al
ret

LLVM IR (-O0):
define i32 @ld_gt_rm1(x86_fp80 %0, x86_fp80* %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80*
store x86_fp80 %0, x86_fp80* %3
store x86_fp80* %1, x86_fp80** %4
%5 = load x86_fp80, x86_fp80* %3
%6 = load x86_fp80*, x86_fp80** %4
%7 = load x86_fp80, x86_fp80* %6
%8 = fcmp ogt x86_fp80 %5, %7
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @ld_gt_rm1(x86_fp80 %0, x86_fp80* nocapture %1) {
%3 = load x86_fp80, x86_fp80* %1
%4 = fcmp olt x86_fp80 %3, %0
%5 = zext i1 %4 to i32
ret i32 %5
}
void to_uns_long_store_4(__float128 a, unsigned long *p) {
  p[4] = (unsigned long)a;
}


x86 assembly (clang, -O0):
<to_uns_long_store_4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movaps %xmm0,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
movaps -0x10(%rbp),%xmm0
call   1130 <__fixunstfdi>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,0x20(%rax)
add    $0x20,%rsp
pop    %rbp
ret
nopw   0x0(%rax,%rax,1)

x86 assembly (clang, -O2):
<to_uns_long_store_4>:
push   %rbx
mov    %rdi,%rbx
call   1110 <__fixunstfdi>
mov    %rax,0x20(%rbx)
pop    %rbx
ret
nop

LLVM IR (-O0):
define void @to_uns_long_store_4(fp128 %0, i64* %1) {
%3 = alloca fp128
%4 = alloca i64*
store fp128 %0, fp128* %3
store i64* %1, i64** %4
%5 = load fp128, fp128* %3
%6 = fptoui fp128 %5 to i64
%7 = load i64*, i64** %4
%8 = getelementptr inbounds i64, i64* %7, i64 4
store i64 %6, i64* %8
ret void
}

LLVM IR (-O2):
define void @to_uns_long_store_4(fp128 %0, i64* nocapture writeonly %1) {
%3 = fptoui fp128 %0 to i64
%4 = getelementptr inbounds i64, i64* %1, i64 4
store i64 %3, i64* %4
ret void
}
/* Variables and functions */
int M_PI;
double normalize(double m) { return m - (int)(m / (M_PI * 2)) * (M_PI * 2); }


x86 assembly (clang, -O0):
<normalize>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
mov    0x2ece(%rip),%rax
mov    (%rax),%eax
shl    $0x1,%eax
cvtsi2sd %eax,%xmm2
divsd  %xmm2,%xmm1
cvttsd2si %xmm1,%eax
mov    0x2eb6(%rip),%rcx
mov    (%rcx),%ecx
shl    $0x1,%ecx
imul   %ecx,%eax
cvtsi2sd %eax,%xmm1
subsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<normalize>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
add    %eax,%eax
cvtsi2sd %eax,%xmm1
movapd %xmm0,%xmm2
divsd  %xmm1,%xmm2
cvttsd2si %xmm2,%ecx
imul   %eax,%ecx
xorps  %xmm1,%xmm1
cvtsi2sd %ecx,%xmm1
subsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
@M_PI = global i32 0
define double @normalize(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = load i32, i32* @M_PI
%6 = mul nsw i32 %5, 2
%7 = sitofp i32 %6 to double
%8 = fdiv double %4, %7
%9 = fptosi double %8 to i32
%10 = load i32, i32* @M_PI
%11 = mul nsw i32 %10, 2
%12 = mul nsw i32 %9, %11
%13 = sitofp i32 %12 to double
%14 = fsub double %3, %13
ret double %14
}

LLVM IR (-O2):
@M_PI = global i32 0
define double @normalize(double %0) {
%2 = load i32, i32* @M_PI
%3 = shl nsw i32 %2, 1
%4 = sitofp i32 %3 to double
%5 = fdiv double %0, %4
%6 = fptosi double %5 to i32
%7 = mul nsw i32 %3, %6
%8 = sitofp i32 %7 to double
%9 = fsub double %0, %8
ret double %9
}
void av_frame_get_channels() {}


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

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

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

LLVM IR (-O2):
define void @av_frame_get_channels() {
ret void
}
void CommonROM_Init(void) { return; }


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

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

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

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

/* Variables and functions */
int half_add(int, int);
uint16_t half_sub(uint16_t ha, uint16_t hb) {
  return half_add(ha, hb ^ 0x8000);
}


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

x86 assembly (clang, -O2):
<half_sub>:
xor    $0x8000,%esi
jmp    1030 <half_add@plt>

LLVM IR (-O0):
define i32 @half_sub(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 = xor i32 %6, 32768
%8 = call i32 @half_add(i32 %5, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @half_sub(i32 %0, i32 %1) {
%3 = xor i32 %1, 32768
%4 = tail call i32 @half_add(i32 %0, i32 %3)
ret i32 %4
}
const char *strerr(int err) {
  static __thread char s[64];
  return strerror_r(abs(err), s, sizeof(s));
}


x86 assembly (clang, -O0):
<strerr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <abs@plt>
mov    %eax,-0x8(%rbp)
lea    0x2e83(%rip),%rdi
call   1040 <__tls_get_addr@plt>
mov    -0x8(%rbp),%edi
lea    0x0(%rax),%rsi
xor    %eax,%eax
mov    $0x40,%edx
call   1050 <strerror_r@plt>
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strerr>:
push   %rbx
mov    %edi,%ebx
mov    %edi,%eax
neg    %eax
cmovns %eax,%ebx
lea    0x2e9f(%rip),%rdi
call   1030 <__tls_get_addr@plt>
lea    0x0(%rax),%rsi
mov    $0x40,%edx
mov    %ebx,%edi
xor    %eax,%eax
call   1040 <strerror_r@plt>
cltq
pop    %rbx
ret

LLVM IR (-O0):
@strerr.s = internal thread_local global [64 x i8] zeroinitializer
define i8* @strerr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @abs(i32 %3)
%5 = call i32 (i32, i8*, i64, ...) bitcast (i32 (...)* @strerror_r to i32 (i32, i8*, i64, ...)*)(i32 %4, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @strerr.s, i64 0, i64 0), i64 64)
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i8*
ret i8* %7
}

LLVM IR (-O2):
@strerr.s = internal thread_local global [64 x i8] zeroinitializer
define i8* @strerr(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
%3 = tail call i32 (i32, i8*, i64, ...) bitcast (i32 (...)* @strerror_r to i32 (i32, i8*, i64, ...)*)(i32 %2, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @strerr.s, i64 0, i64 0), i64 64)
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}
void RTC_EveryDayHandler(void) {}


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

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

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

LLVM IR (-O2):
define void @RTC_EveryDayHandler() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_cmplt_epi16(int /*<<< orphan*/, int /*<<< orphan*/);
__m128i test_mm_cmplt_epi16(__m128i A, __m128i B) {
  return _mm_cmplt_epi16(A, B);
}


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

x86 assembly (clang, -O2):
<test_mm_cmplt_epi16>:
jmp    1030 <_mm_cmplt_epi16@plt>

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

LLVM IR (-O2):
define i32 @test_mm_cmplt_epi16(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_cmplt_epi16(i32 %0, i32 %1)
ret i32 %3
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t mpga_get_layer(const uint8_t *p_mpga) {
  return (p_mpga[1] & 0x06) >> 1;
}


x86 assembly (clang, -O0):
<mpga_get_layer>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
and    $0x6,%eax
sar    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mpga_get_layer>:
mov    0x4(%rdi),%eax
shr    %eax
and    $0x3,%eax
ret

LLVM IR (-O0):
define i32 @mpga_get_layer(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 1
%5 = load i32, i32* %4
%6 = and i32 %5, 6
%7 = ashr i32 %6, 1
ret i32 %7
}

LLVM IR (-O2):
define i32 @mpga_get_layer(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
%3 = load i32, i32* %2
%4 = lshr i32 %3, 1
%5 = and i32 %4, 3
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ CPUirqd();
void IntMasterIRQDisable(void) { CPUirqd(); }


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

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

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

LLVM IR (-O2):
define void @IntMasterIRQDisable() {
%1 = tail call i32 (...) @CPUirqd()
ret void
}
int main() {
  int i;
  int res = 0;
  goto L1;
  while (i < 10) {
  L2:
    res++;
    if (i > 100) {
    L1:
      i = 0;
      goto L2;
    }
    i++;
  }
  return res;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
jmp    113e <main+0x3e>
cmpl   $0xa,-0x8(%rbp)
jge    1158 <main+0x58>
jmp    1126 <main+0x26>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x64,-0x8(%rbp)
jle    114a <main+0x4a>
jmp    113e <main+0x3e>
movl   $0x0,-0x8(%rbp)
jmp    1126 <main+0x26>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1117 <main+0x17>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
br label %15
4: ; No predecessors!
br label %5
5: ; preds = %16, %4
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 10
br i1 %7, label %8, label %19
8: ; preds = %5
br label %9
9: ; preds = %15, %8
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 1
store i32 %11, i32* %3
%12 = load i32, i32* %2
%13 = icmp sgt i32 %12, 100
br i1 %13, label %14, label %16
14: ; preds = %9
br label %15
15: ; preds = %14, %0
store i32 0, i32* %2
br label %9
16: ; preds = %9
%17 = load i32, i32* %2
%18 = add nsw i32 %17, 1
store i32 %18, i32* %2
br label %5
19: ; preds = %5
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
define i32 @main() {
ret i32 10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *, char *, char *);
void not_found2(char *directive, char *tag, char *filename2) {
  char *title = "Not Found";
  (void)printf("<HR><H2>%s</H2>\nThe filename requested in a %s %s directive, "
               "%s,\ndoes not seem to exist.\n<HR>\n",
               title, directive, tag, filename2);
}


x86 assembly (clang, -O0):
<not_found2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xed5(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rsi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<not_found2>:
mov    %rdx,%r8
mov    %rsi,%rcx
mov    %rdi,%rdx
lea    0xeea(%rip),%rdi
lea    0xed9(%rip),%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"Not Found\00"
@.str.1 = [95 x i8] c"<HR><H2>%s</H2>\0AThe filename requested in a %s %s directive, %s,\0Adoes not seem to exist.\0A<HR>\0A\00"
define void @not_found2(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8** %7
%8 = load i8*, i8** %7
%9 = load i8*, i8** %4
%10 = load i8*, i8** %5
%11 = load i8*, i8** %6
%12 = call i32 @printf(i8* getelementptr inbounds ([95 x i8], [95 x i8]* @.str.1, i64 0, i64 0), i8* %8, i8* %9, i8* %10, i8* %11)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"Not Found\00"
@.str.1 = [95 x i8] c"<HR><H2>%s</H2>\0AThe filename requested in a %s %s directive, %s,\0Adoes not seem to exist.\0A<HR>\0A\00"
define void @not_found2(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([95 x i8], [95 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i8* %2)
ret void
}
void world() {
  ctx_log_msg(__FUNCTION__, "saying world", "START");
  printf("world\n");
  sleep(2);
  ctx_log_msg(__FUNCTION__, "saying world", "ENDOK");
}


x86 assembly (clang, -O0):
<world>:
push   %rbp
mov    %rsp,%rbp
lea    0xecc(%rip),%rdi
lea    0xebe(%rip),%rsi
lea    0xec4(%rip),%rdx
mov    $0x0,%al
call   1040 <ctx_log_msg@plt>
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x2,%edi
mov    $0x0,%al
call   1050 <sleep@plt>
lea    0xe96(%rip),%rdi
lea    0xe88(%rip),%rsi
lea    0xe9b(%rip),%rdx
mov    $0x0,%al
call   1040 <ctx_log_msg@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<world>:
push   %r14
push   %rbx
push   %rax
lea    0xecc(%rip),%rbx
lea    0xebe(%rip),%r14
lea    0xec4(%rip),%rdx
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <ctx_log_msg@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    $0x2,%edi
xor    %eax,%eax
call   1050 <sleep@plt>
lea    0xea2(%rip),%rdx
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <ctx_log_msg@plt>

LLVM IR (-O0):
@__FUNCTION__.world = [6 x i8] c"world\00"
@.str = [13 x i8] c"saying world\00"
@.str.1 = [6 x i8] c"START\00"
@.str.2 = [7 x i8] c"world\0A\00"
@.str.3 = [6 x i8] c"ENDOK\00"
define void @world() {
%1 = call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @ctx_log_msg to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @__FUNCTION__.world, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%3 = call i32 (i32, ...) bitcast (i32 (...)* @sleep to i32 (i32, ...)*)(i32 2)
%4 = call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @ctx_log_msg to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @__FUNCTION__.world, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"saying world\00"
@.str.1 = [6 x i8] c"START\00"
@.str.3 = [6 x i8] c"ENDOK\00"
@str = [6 x i8] c"world\00"
define void @world() {
%1 = tail call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @ctx_log_msg to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @sleep to i32 (i32, ...)*)(i32 2)
%4 = tail call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @ctx_log_msg to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
ret void
}
/* Variables and functions */
float pow(int, double);
float sqrtf(float);
float img_deflect_din(float db) {
  float v = pow(10, .05 * (db - 6.0));
  v = sqrtf(sqrtf(2.002353f * v)) - 0.1885f;
  return (v < 0.0f) ? 0.0f : v;
}


x86 assembly (clang, -O0):
<img_deflect_din>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xed2(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0xebe(%rip),%xmm0
mulsd  %xmm1,%xmm0
mov    $0xa,%edi
call   1040 <pow@plt>
movss  %xmm0,-0x8(%rbp)
movss  0xe9f(%rip),%xmm0
mulss  -0x8(%rbp),%xmm0
call   1030 <sqrtf@plt>
call   1030 <sqrtf@plt>
movss  0xe84(%rip),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    119f <img_deflect_din+0x7f>
xorps  %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    11a9 <img_deflect_din+0x89>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<img_deflect_din>:
push   %rax
cvtss2sd %xmm0,%xmm0
addsd  0xed3(%rip),%xmm0
mulsd  0xed3(%rip),%xmm0
mov    $0xa,%edi
call   1040 <pow@plt>
mulss  0xec9(%rip),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     115f <img_deflect_din+0x3f>
sqrtss %xmm0,%xmm0
ucomiss %xmm1,%xmm0
jae    116c <img_deflect_din+0x4c>
call   1030 <sqrtf@plt>
jmp    1170 <img_deflect_din+0x50>
call   1030 <sqrtf@plt>
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     1158 <img_deflect_din+0x38>
sqrtss %xmm0,%xmm0
addss  0xe9c(%rip),%xmm0
xorps  %xmm1,%xmm1
maxss  %xmm0,%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @img_deflect_din(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = fpext float %4 to double
%6 = fsub double %5, 6.000000e+00
%7 = fmul double 5.000000e-02, %6
%8 = call float @pow(i32 10, double %7)
store float %8, float* %3
%9 = load float, float* %3
%10 = fmul float 0x400004D1A0000000, %9
%11 = call float @sqrtf(float %10)
%12 = call float @sqrtf(float %11)
%13 = fsub float %12, 0x3FC820C4A0000000
store float %13, float* %3
%14 = load float, float* %3
%15 = fcmp olt float %14, 0.000000e+00
br i1 %15, label %16, label %17
16: ; preds = %1
br label %19
17: ; preds = %1
%18 = load float, float* %3
br label %19
19: ; preds = %17, %16
%20 = phi float [ 0.000000e+00, %16 ], [ %18, %17 ]
ret float %20
}

LLVM IR (-O2):
define float @img_deflect_din(float %0) {
%2 = fpext float %0 to double
%3 = fadd double %2, -6.000000e+00
%4 = fmul double %3, 5.000000e-02
%5 = tail call float @pow(i32 10, double %4)
%6 = fmul float %5, 0x400004D1A0000000
%7 = tail call float @sqrtf(float %6)
%8 = tail call float @sqrtf(float %7)
%9 = fadd float %8, 0xBFC820C4A0000000
%10 = fcmp olt float %9, 0.000000e+00
%11 = select i1 %10, float 0.000000e+00, float %9
ret float %11
}
OP(ed, e5) {}


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
ret i32 undef
}
/* Variables and functions */
scalar_t__ condition_alphabet(char);
int /*<<< orphan*/ condition_m(char);
int condition_alphabetExcept_m(char c) {
  return condition_alphabet(c) && !condition_m(c);
}


x86 assembly (clang, -O0):
<condition_alphabetExcept_m>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1040 <condition_alphabet@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
je     115d <condition_alphabetExcept_m+0x3d>
movsbl -0x1(%rbp),%edi
call   1030 <condition_m@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<condition_alphabetExcept_m>:
push   %rbx
mov    %edi,%ebx
call   1040 <condition_alphabet@plt>
test   %rax,%rax
je     1140 <condition_alphabetExcept_m+0x20>
movsbl %bl,%edi
call   1030 <condition_m@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @condition_alphabetExcept_m(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @condition_alphabet(i8 signext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i8, i8* %2
%8 = call i32 @condition_m(i8 signext %7)
%9 = icmp ne i32 %8, 0
%10 = xor i1 %9, true
br label %11
11: ; preds = %6, %1
%12 = phi i1 [ false, %1 ], [ %10, %6 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @condition_alphabetExcept_m(i8 signext %0) {
%2 = tail call i64 @condition_alphabet(i8 signext %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i32 @condition_m(i8 signext %0)
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %9
}
int main(void) {
  int i = 10 + 11, j = i + i;
  return j;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x15,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 21, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* %2
%6 = add nsw i32 %4, %5
store i32 %6, i32* %3
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @main() {
ret i32 42
}
/* Variables and functions */
int /*<<< orphan*/ opx_adec(char *, char *);
void i_subx_adec(void) { opx_adec("sbb", ""); }


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

x86 assembly (clang, -O2):
<i_subx_adec>:
lea    0xee9(%rip),%rdi
lea    0xee5(%rip),%rsi
jmp    1030 <opx_adec@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"sbb\00"
@.str.1 = [1 x i8] zeroinitializer
define void @i_subx_adec() {
%1 = call i32 @opx_adec(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"sbb\00"
@.str.1 = [1 x i8] zeroinitializer
define void @i_subx_adec() {
%1 = tail call i32 @opx_adec(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void gtk_toolbar_get_orientation() {}


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

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

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

LLVM IR (-O2):
define void @gtk_toolbar_get_orientation() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ set_io_bit(int, int);
void TOSH_SET_UART_RXD1_PIN() { set_io_bit(0x43, 2); }


x86 assembly (clang, -O0):
<TOSH_SET_UART_RXD1_PIN>:
push   %rbp
mov    %rsp,%rbp
mov    $0x43,%edi
mov    $0x2,%esi
call   1030 <set_io_bit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_SET_UART_RXD1_PIN>:
mov    $0x43,%edi
mov    $0x2,%esi
jmp    1030 <set_io_bit@plt>

LLVM IR (-O0):
define void @TOSH_SET_UART_RXD1_PIN() {
%1 = call i32 @set_io_bit(i32 67, i32 2)
ret void
}

LLVM IR (-O2):
define void @TOSH_SET_UART_RXD1_PIN() {
%1 = tail call i32 @set_io_bit(i32 67, i32 2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void printHello() { printf("%s\n", "Helo there!"); }


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

x86 assembly (clang, -O2):
<printHello>:
lea    0xee9(%rip),%rdi
lea    0xee6(%rip),%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [12 x i8] c"Helo there!\00"
define void @printHello() {
%1 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [12 x i8] c"Helo there!\00"
define void @printHello() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
unsigned long _strtoxl(char const *, char **, int, int /*<<< orphan*/);
unsigned long int strtoul(const char *nptr, char **endptr, int base) {
  return _strtoxl(nptr, endptr, base, 0);
}


x86 assembly (clang, -O0):
<strtoul>:
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),%rsi
mov    -0x14(%rbp),%edx
xor    %ecx,%ecx
call   1030 <_strtoxl@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtoul>:
xor    %ecx,%ecx
jmp    1030 <_strtoxl@plt>

LLVM IR (-O0):
define i64 @strtoul(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 i64 @_strtoxl(i8* %7, i8** %8, i32 %9, i32 0)
ret i64 %10
}

LLVM IR (-O2):
define i64 @strtoul(i8* %0, i8** %1, i32 %2) {
%4 = tail call i64 @_strtoxl(i8* %0, i8** %1, i32 %2, i32 0)
ret i64 %4
}
void Tmf_Mutex_On() { return; }


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

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

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

LLVM IR (-O2):
define void @Tmf_Mutex_On() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write_pixel(int, int, short);
void draw_linehorz(int x, int y, int length, short colour) {
  int i = 0;
  for (i = 0; i < length; i++) {
    write_pixel(x + i, y, colour);
  }
}


x86 assembly (clang, -O0):
<draw_linehorz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %cx,%ax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ax,-0xe(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1162 <draw_linehorz+0x52>
mov    -0x4(%rbp),%edi
add    -0x14(%rbp),%edi
mov    -0x8(%rbp),%esi
movswl -0xe(%rbp),%edx
call   1030 <write_pixel@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1136 <draw_linehorz+0x26>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw_linehorz>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %edx,%edx
jle    1145 <draw_linehorz+0x35>
mov    %edx,%ebx
mov    %esi,%r14d
mov    %edi,%ebp
movswl %cx,%r15d
cs nopw 0x0(%rax,%rax,1)
mov    %ebp,%edi
mov    %r14d,%esi
mov    %r15d,%edx
call   1030 <write_pixel@plt>
add    $0x1,%ebp
add    $0xffffffff,%ebx
jne    1130 <draw_linehorz+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @draw_linehorz(i32 %0, i32 %1, i32 %2, i16 signext %3) {
%5 = icmp sgt i32 %2, 0
br i1 %5, label %6, label %12
6: ; preds = %4, %6
%7 = phi i32 [ %10, %6 ], [ 0, %4 ]
%8 = add nsw i32 %7, %0
%9 = tail call i32 @write_pixel(i32 %8, i32 %1, i16 signext %3)
%10 = add nuw nsw i32 %7, 1
%11 = icmp eq i32 %10, %2
br i1 %11, label %12, label %6
12: ; preds = %6, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ color(int);
int /*<<< orphan*/ io_hlt();
int /*<<< orphan*/ printk(char *);
void int_Over_flow(void) {
  color(0xff0000);
  printk("Over flow!!!");
  io_hlt();
}


x86 assembly (clang, -O0):
<int_Over_flow>:
push   %rbp
mov    %rsp,%rbp
mov    $0xff0000,%edi
call   1050 <color@plt>
lea    0xebb(%rip),%rdi
call   1030 <printk@plt>
mov    $0x0,%al
call   1040 <io_hlt@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_Over_flow>:
push   %rax
mov    $0xff0000,%edi
call   1050 <color@plt>
lea    0xebe(%rip),%rdi
call   1030 <printk@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <io_hlt@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"Over flow!!!\00"
define void @int_Over_flow() {
%1 = call i32 @color(i32 16711680)
%2 = call i32 @printk(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @io_hlt()
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"Over flow!!!\00"
define void @int_Over_flow() {
%1 = tail call i32 @color(i32 16711680)
%2 = tail call i32 @printk(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @io_hlt()
ret void
}