xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void PrintArgs(char *name) {
  fprintf(stderr,
          "Usage: %s [OPTIONS] < input > output             \n"
          "                                                 \n"
          "  -n <int>       Maximum number of \"N\" in read,\n"
          "  -m <int>       Minimum size of the read,       \n"
          "  -a <int>       Discard read below average QS,  \n"
          "                                                 \n"
          "  -k <int>       Window size (sw) to filter QS,  \n"
          "  -w <int>       Minimum average QS with k-sw.   \n"
          "                                                 \n",
          name);
}


x86 assembly (clang, -O0):
<PrintArgs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrintArgs>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [449 x i8] c"Usage: %s [OPTIONS] < input > output \0A \0A -n <int> Maximum number of \22N\22 in read,\0A -m <int> Minimum size of the read, \0A -a <int> Discard read below average QS, \0A \0A -k <int> Window size (sw) to filter QS, \0A -w <int> Minimum average QS with k-sw. \0A \0A\00"
define void @PrintArgs(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([449 x i8], [449 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [449 x i8] c"Usage: %s [OPTIONS] < input > output \0A \0A -n <int> Maximum number of \22N\22 in read,\0A -m <int> Minimum size of the read, \0A -a <int> Discard read below average QS, \0A \0A -k <int> Window size (sw) to filter QS, \0A -w <int> Minimum average QS with k-sw. \0A \0A\00"
define void @PrintArgs(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([449 x i8], [449 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void int20() { exit(0); }


x86 assembly (clang, -O0):
<int20>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<int20>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @int20() {
%1 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @int20() {
%1 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void tracer_exception_return(void *t) { fprintf(stdout, "Exception return\n"); }


x86 assembly (clang, -O0):
<tracer_exception_return>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
lea    0xed4(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tracer_exception_return>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [18 x i8] c"Exception return\0A\00"
define void @tracer_exception_return(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stdout
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [18 x i8] c"Exception return\0A\00"
define void @tracer_exception_return(i8* nocapture readnone %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct timespec {
  scalar_t__ tv_sec;
  scalar_t__ tv_nsec;
};

/* Variables and functions */
void ts_positive(struct timespec *const t) {
  if (t->tv_sec < 0) {
    t->tv_sec = 0;
    t->tv_nsec = 0;
  }
}


x86 assembly (clang, -O0):
<ts_positive>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
jge    112d <ts_positive+0x2d>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
mov    -0x8(%rbp),%rax
movq   $0x0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ts_positive>:
cmpq   $0x0,(%rdi)
js     1107 <ts_positive+0x7>
ret
xorps  %xmm0,%xmm0
movups %xmm0,(%rdi)
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
define void @ts_positive(%struct.timespec* %0) {
%2 = alloca %struct.timespec*
store %struct.timespec* %0, %struct.timespec** %2
%3 = load %struct.timespec*, %struct.timespec** %2
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
%5 = load i64, i64* %4
%6 = icmp slt i64 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load %struct.timespec*, %struct.timespec** %2
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %8, i32 0, i32 0
store i64 0, i64* %9
%10 = load %struct.timespec*, %struct.timespec** %2
%11 = getelementptr inbounds %struct.timespec, %struct.timespec* %10, i32 0, i32 1
store i64 0, i64* %11
br label %12
12: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
define void @ts_positive(%struct.timespec* nocapture %0) {
%2 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 0
%3 = load i64, i64* %2
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = bitcast %struct.timespec* %0 to i8*
br label %7
7: ; preds = %5, %1
ret void
}
void hal_print_init(struct multiboot_tag_framebuffer *info) {
  { (info) = (info); };
}


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

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

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

LLVM IR (-O2):
%struct.multiboot_tag_framebuffer = type opaque
define void @hal_print_init(%struct.multiboot_tag_framebuffer* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ imprimir(int *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int vetor[3], i;
  for (i = 0; i < 3; i++) {
    scanf("%d", &vetor[i]);
  }
  imprimir(vetor, 3);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x3,-0x14(%rbp)
jge    1169 <main+0x49>
movslq -0x14(%rbp),%rax
lea    -0x10(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xeaa(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1136 <main+0x16>
lea    -0x10(%rbp),%rdi
mov    $0x3,%esi
call   1030 <imprimir@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
lea    0xed2(%rip),%rbx
lea    0xc(%rsp),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <scanf@plt>
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x14(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    %r14,%rdi
mov    $0x3,%esi
call   1030 <imprimir@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca [3 x i32]
%2 = bitcast [3 x i32]* %1 to i8*
%3 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%5 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 1
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %5)
%7 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 2
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %7)
%9 = call i32 @imprimir(i32* %3, i32 3)
ret i32 0
}
unsigned long cfs_time_add(unsigned long t, long d) {
  return (unsigned long)(t + d);
}


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

x86 assembly (clang, -O2):
<cfs_time_add>:
lea    (%rdi,%rsi,1),%rax
ret

LLVM IR (-O0):
define i64 @cfs_time_add(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 = add i64 %5, %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @cfs_time_add(i64 %0, i64 %1) {
%3 = add i64 %1, %0
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ panic(int);
void panic2() { panic(3); }


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

x86 assembly (clang, -O2):
<panic2>:
mov    $0x3,%edi
jmp    1030 <panic@plt>

LLVM IR (-O0):
define void @panic2() {
%1 = call i32 @panic(i32 3)
ret void
}

LLVM IR (-O2):
define void @panic2() {
%1 = tail call i32 @panic(i32 3)
ret void
}
/* Type definitions */
struct Trie {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ logger_impl(int, char *, int, char *);
int del_trie(struct Trie *root, char *p) {
  {
    logger_impl(
        0x08,
        "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
        "2022-01-22/02-19-57/repos/loadingvx/clib/refs/heads/master/trie.c",
        40, "NotImplementedError\n");
  };
}


x86 assembly (clang, -O0):
<del_trie>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    $0x8,%edi
lea    0xed4(%rip),%rsi
mov    $0x28,%edx
lea    0xf4a(%rip),%rcx
call   1030 <logger_impl@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<del_trie>:
lea    0xee9(%rip),%rsi
lea    0xf64(%rip),%rcx
mov    $0x8,%edi
mov    $0x28,%edx
jmp    1030 <logger_impl@plt>

LLVM IR (-O0):
%struct.Trie = type { i32 }
@.str = [130 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/loadingvx/clib/refs/heads/master/trie.c\00"
@.str.1 = [21 x i8] c"NotImplementedError\0A\00"
define i32 @del_trie(%struct.Trie* %0, i8* %1) {
%3 = alloca i32
%4 = alloca %struct.Trie*
%5 = alloca i8*
store %struct.Trie* %0, %struct.Trie** %4
store i8* %1, i8** %5
%6 = call i32 @logger_impl(i32 8, i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 40, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
%struct.Trie = type { i32 }
@.str = [130 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/loadingvx/clib/refs/heads/master/trie.c\00"
@.str.1 = [21 x i8] c"NotImplementedError\0A\00"
define i32 @del_trie(%struct.Trie* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = tail call i32 @logger_impl(i32 8, i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 40, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
ret i32 undef
}
void test_no_clause() {
  int i;
#pragma omp for simd
  for (i = 0; i < 16; ++i)
    ;
#pragma omp for simd
  ++i;
}


x86 assembly (clang, -O0):
<test_no_clause>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
jge    1128 <test_no_clause+0x28>
jmp    111a <test_no_clause+0x1a>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <test_no_clause+0xb>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @test_no_clause() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void luaHelper_FreeFunction(void *ptr, int oldsize, void *data) {
  ((void)(data));
  ((void)(oldsize));
  free(ptr);
}


x86 assembly (clang, -O0):
<luaHelper_FreeFunction>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @luaHelper_FreeFunction(i8* nocapture %0, i32 %1, i8* nocapture readnone %2) {
%4 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ clock();
uint64_t __Clock(void) { return clock(); }


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

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

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

LLVM IR (-O2):
define i32 @__Clock() {
%1 = tail call i32 (...) @clock()
ret i32 %1
}
int _abs(int i) {
  if (i < 0)
    i = i * -1;
  return (i);
}


x86 assembly (clang, -O0):
<_abs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1118 <_abs+0x18>
imul   $0xffffffff,-0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_abs>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @_abs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
/* Variables and functions */
int log(double);
double rmstodb(double f) {
  if (f <= 0)
    return (0);
  else {
    double val = 100 + 20. / 2.302585092994 * log(f);
    return (val < 0 ? 0 : val);
  }
}


x86 assembly (clang, -O0):
<rmstodb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     1138 <rmstodb+0x28>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1192 <rmstodb+0x82>
movsd  -0x10(%rbp),%xmm0
call   1030 <log@plt>
cvtsi2sd %eax,%xmm0
movsd  0xeb2(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeae(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    117e <rmstodb+0x6e>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    1188 <rmstodb+0x78>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rmstodb>:
movapd %xmm0,%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jae    114b <rmstodb+0x3b>
push   %rax
movapd %xmm1,%xmm0
call   1030 <log@plt>
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
mulsd  0xec9(%rip),%xmm1
addsd  0xec9(%rip),%xmm1
xorpd  %xmm0,%xmm0
maxsd  %xmm1,%xmm0
add    $0x8,%rsp
ret

LLVM IR (-O0):
define double @rmstodb(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %3
%5 = load double, double* %3
%6 = fcmp ole double %5, 0.000000e+00
br i1 %6, label %7, label %8
7: ; preds = %1
store double 0.000000e+00, double* %2
br label %20
8: ; preds = %1
%9 = load double, double* %3
%10 = call i32 @log(double %9)
%11 = sitofp i32 %10 to double
%12 = call double @llvm.fmuladd.f64(double 0x40215F2CED384F8A, double %11, double 1.000000e+02)
store double %12, double* %4
%13 = load double, double* %4
%14 = fcmp olt double %13, 0.000000e+00
br i1 %14, label %15, label %16
15: ; preds = %8
br label %18
16: ; preds = %8
%17 = load double, double* %4
br label %18
18: ; preds = %16, %15
%19 = phi double [ 0.000000e+00, %15 ], [ %17, %16 ]
store double %19, double* %2
br label %20
20: ; preds = %18, %7
%21 = load double, double* %2
ret double %21
}

LLVM IR (-O2):
define double @rmstodb(double %0) {
%2 = fcmp ugt double %0, 0.000000e+00
br i1 %2, label %3, label %9
3: ; preds = %1
%4 = tail call i32 @log(double %0)
%5 = sitofp i32 %4 to double
%6 = tail call double @llvm.fmuladd.f64(double %5, double 0x40215F2CED384F8A, double 1.000000e+02)
%7 = fcmp olt double %6, 0.000000e+00
%8 = select i1 %7, double 0.000000e+00, double %6
br label %9
9: ; preds = %1, %3
%10 = phi double [ %8, %3 ], [ 0.000000e+00, %1 ]
ret double %10
}
/* Variables and functions */
int /*<<< orphan*/ use_math();
int main(int argc, char *argv[]) {
  use_math();
  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 <use_math@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <use_math@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 (...) @use_math()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @use_math()
ret i32 0
}
/* Variables and functions */
double sqrt(int);
double circularEaseInd(double p) { return 1 - sqrt(1 - (p * p)); }


x86 assembly (clang, -O0):
<circularEaseInd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xeb6(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  0xe9e(%rip),%xmm0
subsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<circularEaseInd>:
push   %rax
mulsd  %xmm0,%xmm0
movsd  0xee3(%rip),%xmm1
subsd  %xmm0,%xmm1
cvttsd2si %xmm1,%edi
call   1030 <sqrt@plt>
movsd  0xece(%rip),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @circularEaseInd(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fneg double %3
%6 = call double @llvm.fmuladd.f64(double %5, double %4, double 1.000000e+00)
%7 = fptosi double %6 to i32
%8 = call double @sqrt(i32 %7)
%9 = fsub double 1.000000e+00, %8
ret double %9
}

LLVM IR (-O2):
define double @circularEaseInd(double %0) {
%2 = fneg double %0
%3 = tail call double @llvm.fmuladd.f64(double %2, double %0, double 1.000000e+00)
%4 = fptosi double %3 to i32
%5 = tail call double @sqrt(i32 %4)
%6 = fsub double 1.000000e+00, %5
ret double %6
}
double norm2(const double _Complex c) {
  return creal(c) * creal(c) + cimag(c) * cimag(c);
}


x86 assembly (clang, -O0):
<norm2>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x8(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
movsd  -0x8(%rbp),%xmm1
mulsd  -0x8(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @norm2(double %0, double %1) {
%3 = alloca { double, double }
%4 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 0
store double %0, double* %4
%5 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 1
store double %1, double* %5
%6 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 0
%7 = load double, double* %6
%8 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 1
%9 = load double, double* %8
%10 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 0
%11 = load double, double* %10
%12 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 1
%13 = load double, double* %12
%14 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 0
%15 = load double, double* %14
%16 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 1
%17 = load double, double* %16
%18 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 0
%19 = load double, double* %18
%20 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 1
%21 = load double, double* %20
%22 = fmul double %17, %21
%23 = call double @llvm.fmuladd.f64(double %7, double %11, double %22)
ret double %23
}

LLVM IR (-O2):
define double @norm2(double %0, double %1) {
%3 = fmul double %1, %1
%4 = tail call double @llvm.fmuladd.f64(double %0, double %0, double %3)
ret double %4
}
/* Variables and functions */
char *ctermid(char *);
char *ctermid_r(char *s) { return (s != NULL ? ctermid(s) : NULL); }


x86 assembly (clang, -O0):
<ctermid_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1139 <ctermid_r+0x29>
mov    -0x8(%rbp),%rdi
call   1030 <ctermid@plt>
mov    %rax,-0x10(%rbp)
jmp    1144 <ctermid_r+0x34>
xor    %eax,%eax
mov    %rax,-0x10(%rbp)
jmp    1144 <ctermid_r+0x34>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ctermid_r>:
test   %rdi,%rdi
je     111a <ctermid_r+0xa>
jmp    1030 <ctermid@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8* @ctermid_r(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i8* @ctermid(i8* %6)
br label %9
8: ; preds = %1
br label %9
9: ; preds = %8, %5
%10 = phi i8* [ %7, %5 ], [ null, %8 ]
ret i8* %10
}

LLVM IR (-O2):
define i8* @ctermid_r(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i8* @ctermid(i8* %0)
br label %5
5: ; preds = %1, %3
%6 = phi i8* [ %4, %3 ], [ null, %1 ]
ret i8* %6
}
int Mx1_is_ignored_wrap(struct Mx1 *m, char *start, char **found, int flag) {
  int ret;
  static char ignored_wraps[][20] = {"@ref{", "@xref{", ""};
  ret = Mx1_is_wrap(m, ignored_wraps, start, found, 0);
  return (ret);
}


x86 assembly (clang, -O0):
<Mx1_is_ignored_wrap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0x2ef6(%rip),%rsi
xor    %r8d,%r8d
mov    $0x0,%al
call   1030 <Mx1_is_wrap@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Mx1_is_ignored_wrap>:
mov    %rdx,%rcx
mov    %rsi,%rdx
lea    0x2f13(%rip),%rsi
xor    %r8d,%r8d
xor    %eax,%eax
jmp    1030 <Mx1_is_wrap@plt>

LLVM IR (-O0):
%struct.Mx1 = type opaque
@Mx1_is_ignored_wrap.ignored_wraps = internal global [3 x [20 x i8]] [[20 x i8] c"@ref{\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [20 x i8] c"@xref{\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [20 x i8] zeroinitializer]
define i32 @Mx1_is_ignored_wrap(%struct.Mx1* %0, i8* %1, i8** %2, i32 %3) {
%5 = alloca %struct.Mx1*
%6 = alloca i8*
%7 = alloca i8**
%8 = alloca i32
%9 = alloca i32
store %struct.Mx1* %0, %struct.Mx1** %5
store i8* %1, i8** %6
store i8** %2, i8*** %7
store i32 %3, i32* %8
%10 = load %struct.Mx1*, %struct.Mx1** %5
%11 = load i8*, i8** %6
%12 = load i8**, i8*** %7
%13 = call i32 (%struct.Mx1*, [20 x i8]*, i8*, i8**, i32, ...) bitcast (i32 (...)* @Mx1_is_wrap to i32 (%struct.Mx1*, [20 x i8]*, i8*, i8**, i32, ...)*)(%struct.Mx1* %10, [20 x i8]* getelementptr inbounds ([3 x [20 x i8]], [3 x [20 x i8]]* @Mx1_is_ignored_wrap.ignored_wraps, i64 0, i64 0), i8* %11, i8** %12, i32 0)
store i32 %13, i32* %9
%14 = load i32, i32* %9
ret i32 %14
}

LLVM IR (-O2):
%struct.Mx1 = type opaque
@Mx1_is_ignored_wrap.ignored_wraps = internal global [3 x [20 x i8]] [[20 x i8] c"@ref{\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [20 x i8] c"@xref{\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [20 x i8] zeroinitializer]
define i32 @Mx1_is_ignored_wrap(%struct.Mx1* %0, i8* %1, i8** %2, i32 %3) {
%5 = tail call i32 (%struct.Mx1*, [20 x i8]*, i8*, i8**, i32, ...) bitcast (i32 (...)* @Mx1_is_wrap to i32 (%struct.Mx1*, [20 x i8]*, i8*, i8**, i32, ...)*)(%struct.Mx1* %0, [20 x i8]* getelementptr inbounds ([3 x [20 x i8]], [3 x [20 x i8]]* @Mx1_is_ignored_wrap.ignored_wraps, i64 0, i64 0), i8* %1, i8** %2, i32 0)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ leavex(int, char *);
void bad_con(void) { leavex(1, "The game is full.  Sorry."); }


x86 assembly (clang, -O0):
<bad_con>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
lea    0xee0(%rip),%rsi
call   1030 <leavex@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bad_con>:
lea    0xee9(%rip),%rsi
mov    $0x1,%edi
jmp    1030 <leavex@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"The game is full. Sorry.\00"
define void @bad_con() {
%1 = call i32 @leavex(i32 1, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"The game is full. Sorry.\00"
define void @bad_con() {
%1 = tail call i32 @leavex(i32 1, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int bbm_word_read(void *, unsigned short, unsigned short, unsigned short *);
int bbm_com_word_read(void *handle, unsigned short devid, unsigned short addr,
                      unsigned short *data) {
  int res;
  res = bbm_word_read(handle, devid, addr, data);
  return res;
}


x86 assembly (clang, -O0):
<bbm_com_word_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dx,%ax
mov    %si,%dx
mov    %rdi,-0x8(%rbp)
mov    %dx,-0xa(%rbp)
mov    %ax,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xa(%rbp),%dx
mov    -0xc(%rbp),%ax
mov    -0x18(%rbp),%rcx
movzwl %dx,%esi
movzwl %ax,%edx
call   1030 <bbm_word_read@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bbm_com_word_read>:
jmp    1030 <bbm_word_read@plt>

LLVM IR (-O0):
define i32 @bbm_com_word_read(i8* %0, i16 zeroext %1, i16 zeroext %2, i16* %3) {
%5 = alloca i8*
%6 = alloca i16
%7 = alloca i16
%8 = alloca i16*
%9 = alloca i32
store i8* %0, i8** %5
store i16 %1, i16* %6
store i16 %2, i16* %7
store i16* %3, i16** %8
%10 = load i8*, i8** %5
%11 = load i16, i16* %6
%12 = load i16, i16* %7
%13 = load i16*, i16** %8
%14 = call i32 @bbm_word_read(i8* %10, i16 zeroext %11, i16 zeroext %12, i16* %13)
store i32 %14, i32* %9
%15 = load i32, i32* %9
ret i32 %15
}

LLVM IR (-O2):
define i32 @bbm_com_word_read(i8* %0, i16 zeroext %1, i16 zeroext %2, i16* %3) {
%5 = tail call i32 @bbm_word_read(i8* %0, i16 zeroext %1, i16 zeroext %2, i16* %3)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void log_error(char *str) { printf("[ERROR] %s\n", str); }


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"[ERROR] %s\0A\00"
define void @log_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"[ERROR] %s\0A\00"
define void @log_error(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ base_test();
int /*<<< orphan*/ greth_test(int);
int /*<<< orphan*/ report_end();
int /*<<< orphan*/ report_start();
main() {
  report_start();
  base_test();
  greth_test(0x800c0000);
  report_end();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <report_start@plt>
mov    $0x0,%al
call   1050 <base_test@plt>
mov    $0x800c0000,%edi
call   1040 <greth_test@plt>
mov    $0x0,%al
call   1030 <report_end@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <report_start@plt>
xor    %eax,%eax
call   1050 <base_test@plt>
mov    $0x800c0000,%edi
call   1040 <greth_test@plt>
xor    %eax,%eax
call   1030 <report_end@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @report_start()
%2 = call i32 (...) @base_test()
%3 = call i32 @greth_test(i32 -2146697216)
%4 = call i32 (...) @report_end()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @report_start()
%2 = tail call i32 (...) @base_test()
%3 = tail call i32 @greth_test(i32 -2146697216)
%4 = tail call i32 (...) @report_end()
ret i32 0
}
int min(int a, int b, int c) {
  int min = a;
  if (b < min) {
    min = b;
  }
  if (c < min) {
    min = c;
  }
  return min;
}


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1125 <min+0x25>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1137 <min+0x37>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
mov    %edi,%eax
cmp    %edi,%esi
cmovl  %esi,%eax
cmp    %edx,%eax
cmovg  %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @min(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %0
%5 = select i1 %4, i32 %1, i32 %0
%6 = icmp sgt i32 %5, %2
%7 = select i1 %6, i32 %2, i32 %5
ret i32 %7
}
void gdk_pango_layout_get_clip_region() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @MirrorUVRow_SSSE3() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void _scgi_header_ct_free_data(void *data) {
  if (data) {
    free(data);
    data = NULL;
  }
}


x86 assembly (clang, -O0):
<_scgi_header_ct_free_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1138 <_scgi_header_ct_free_data+0x28>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_scgi_header_ct_free_data>:
test   %rdi,%rdi
je     111a <_scgi_header_ct_free_data+0xa>
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @_scgi_header_ct_free_data(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Type definitions */
typedef int uint32_t;
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
int16_t getImmediateValue(uint32_t instruction) {
  uint32_t mask = 0x0000ffff;
  return (int16_t)(mask & instruction);
}


x86 assembly (clang, -O0):
<getImmediateValue>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0xffff,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getImmediateValue>:
movzwl %di,%eax
ret

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

LLVM IR (-O2):
define i32 @getImmediateValue(i32 %0) {
%2 = and i32 %0, 65535
ret i32 %2
}
int CalcFrame(int lats) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @CalcFrame(i32 %0) {
ret i32 0
}
void rop3_109_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  unsigned char stk4;
  stk4 = T | *D;
  stk3 = S & stk4;
  stk2 = *D ^ stk3;
  stk1 = T ^ stk2;
  stk1 = ~stk1;
  *D = stk1;
}


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

x86 assembly (clang, -O2):
<rop3_109_0_0>:
mov    (%rdi),%al
mov    %eax,%ecx
or     %dl,%cl
and    %sil,%cl
xor    %dl,%al
xor    %cl,%al
not    %al
mov    %al,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_109_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = or i8 %4, %2
%6 = and i8 %5, %1
%7 = xor i8 %4, %2
%8 = xor i8 %7, %6
%9 = xor i8 %8, -1
store i8 %9, i8* %0
ret void
}
void pcibios_fixup_bus(struct pci_bus *bus) {}


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

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

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

LLVM IR (-O2):
%struct.pci_bus = type opaque
define void @pcibios_fixup_bus(%struct.pci_bus* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(float *);
int /*<<< orphan*/ functionTestLoop(float *, size_t);
float *malloc(int);
int main(int argc, char **argv) {
  size_t size = 10;
  float *tabFloat = malloc(sizeof(float) * size);
  functionTestLoop(tabFloat, size);
  free(tabFloat);
  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)
movq   $0xa,-0x18(%rbp)
mov    -0x18(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <functionTestLoop@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x28,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    $0xa,%esi
mov    %rax,%rdi
call   1040 <functionTestLoop@plt>
mov    %rbx,%rdi
call   1030 <free@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 i64
%7 = alloca float*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i64 10, i64* %6
%8 = load i64, i64* %6
%9 = mul i64 4, %8
%10 = trunc i64 %9 to i32
%11 = call float* @malloc(i32 %10)
store float* %11, float** %7
%12 = load float*, float** %7
%13 = load i64, i64* %6
%14 = call i32 @functionTestLoop(float* %12, i64 %13)
%15 = load float*, float** %7
%16 = call i32 @free(float* %15)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call float* @malloc(i32 40)
%4 = tail call i32 @functionTestLoop(float* %3, i64 10)
%5 = tail call i32 @free(float* %3)
ret i32 0
}
char *_RC_basename(const char *f) {
  const char *base;
  for (base = f; *f; f++) {
    if (*f == '/')
      base = f + 1;
  }
  return (char *)base;
}


x86 assembly (clang, -O0):
<_RC_basename>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114f <_RC_basename+0x4f>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
jne    1139 <_RC_basename+0x39>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    113e <_RC_basename+0x3e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1110 <_RC_basename+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_RC_basename>:
mov    %rdi,%rax
lea    0x1(%rdi),%rcx
jmp    1117 <_RC_basename+0x17>
nopl   0x0(%rax)
mov    %rcx,%rax
add    $0x1,%rcx
movzbl -0x1(%rcx),%edx
cmp    $0x2f,%dl
je     1110 <_RC_basename+0x10>
test   %dl,%dl
jne    1113 <_RC_basename+0x13>
ret

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

LLVM IR (-O2):
define i8* @_RC_basename(i8* %0) {
br label %2
2: ; preds = %8, %1
%3 = phi i8* [ %0, %1 ], [ %10, %8 ]
%4 = phi i8* [ %0, %1 ], [ %9, %8 ]
%5 = load i8, i8* %3
switch i8 %5, label %8 [
i8 0, label %11
i8 47, label %6
]
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %3, i64 1
br label %8
8: ; preds = %2, %6
%9 = phi i8* [ %7, %6 ], [ %4, %2 ]
%10 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
11: ; preds = %2
ret i8* %4
}
unsigned int gmp_ctag(char a, char b, char c, char d) {
  unsigned int value;
  char *s = (char *)&value;
  s[0] = a;
  s[1] = b;
  s[2] = c;
  s[3] = d;
  return value;
}


x86 assembly (clang, -O0):
<gmp_ctag>:
push   %rbp
mov    %rsp,%rbp
mov    %cl,%al
mov    %dl,%cl
mov    %sil,%dl
mov    %dil,%sil
mov    %sil,-0x1(%rbp)
mov    %dl,-0x2(%rbp)
mov    %cl,-0x3(%rbp)
mov    %al,-0x4(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x1(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x2(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x3(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x4(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gmp_ctag>:
shl    $0x18,%ecx
movzbl %dl,%eax
shl    $0x10,%eax
or     %ecx,%eax
movzbl %sil,%ecx
shl    $0x8,%ecx
or     %eax,%ecx
movzbl %dil,%eax
or     %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @gmp_ctag(i8 signext %0, i8 signext %1, i8 signext %2, i8 signext %3) {
%5 = zext i8 %3 to i32
%6 = shl nuw i32 %5, 24
%7 = zext i8 %2 to i32
%8 = shl nuw nsw i32 %7, 16
%9 = or i32 %6, %8
%10 = zext i8 %1 to i32
%11 = shl nuw nsw i32 %10, 8
%12 = or i32 %9, %11
%13 = zext i8 %0 to i32
%14 = or i32 %12, %13
ret i32 %14
}
/* Variables and functions */
long random_linux_libc(int);
long MyGetTickCount() { return random_linux_libc(1); }


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

x86 assembly (clang, -O2):
<MyGetTickCount>:
mov    $0x1,%edi
jmp    1030 <random_linux_libc@plt>

LLVM IR (-O0):
define i64 @MyGetTickCount() {
%1 = call i64 @random_linux_libc(i32 1)
ret i64 %1
}

LLVM IR (-O2):
define i64 @MyGetTickCount() {
%1 = tail call i64 @random_linux_libc(i32 1)
ret i64 %1
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int /*<<< orphan*/);
int os_daemon_return(int, int);
int os_daemon(int nochdir, int noclose) {
  int ret;
  ret = os_daemon_return(nochdir, noclose);
  if (ret <= 0)
    return ret;
  _exit(0);
}


x86 assembly (clang, -O0):
<os_daemon>:
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   1040 <os_daemon_return@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jg     114f <os_daemon+0x2f>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret
xor    %edi,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<os_daemon>:
push   %rax
call   1040 <os_daemon_return@plt>
test   %eax,%eax
jg     112c <os_daemon+0xc>
pop    %rcx
ret
xor    %edi,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
define i32 @os_daemon(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i32 @os_daemon_return(i32 %6, i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp sle i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = load i32, i32* %5
ret i32 %12
13: ; preds = %2
%14 = call i32 @_exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @os_daemon(i32 %0, i32 %1) {
%3 = tail call i32 @os_daemon_return(i32 %0, i32 %1)
%4 = icmp slt i32 %3, 1
br i1 %4, label %5, label %6
5: ; preds = %2
ret i32 %3
6: ; preds = %2
%7 = tail call i32 @_exit(i32 0)
unreachable
}
void foo() {
  "§Ã";
  const char *d = "¥";
}


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"\C2\A7\C3\83\00"
@.str.1 = [3 x i8] c"\C2\A5\00"
define void @foo() {
%1 = alloca i8*
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %1
ret void
}

LLVM IR (-O2):
define void @foo() {
ret void
}
void BSP_delay(int val) {
  int i;
  for (i = 0; i < val; i++)
    ;
}


x86 assembly (clang, -O0):
<BSP_delay>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    112d <BSP_delay+0x2d>
jmp    111f <BSP_delay+0x1f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <BSP_delay+0xe>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @BSP_delay(i32 %0) {
ret void
}
/* Variables and functions */
double tanh(double);
double d_tanh(double *x) { return (tanh(*x)); }


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

x86 assembly (clang, -O2):
<d_tanh>:
movsd  (%rdi),%xmm0
jmp    1030 <tanh@plt>

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

LLVM IR (-O2):
define double @d_tanh(double* nocapture %0) {
%2 = load double, double* %0
%3 = tail call double @tanh(double %2)
ret double %3
}