xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ xcb_get_setup(int /*<<< orphan*/ *);
int main() {
  (void)xcb_get_setup(NULL);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @xcb_get_setup(i32* null)
ret i32 0
}
_Bool is_number(char *s) { return 1; }


x86 assembly (clang, -O0):
<is_number>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i1 @is_number(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret i1 true
}

LLVM IR (-O2):
define zeroext i1 @is_number(i8* nocapture readnone %0) {
ret i1 true
}
char *suffix(name)
char *name;
{ return rindex(name, '.'); }


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

x86 assembly (clang, -O2):
<suffix>:
mov    $0x2e,%esi
jmp    1030 <rindex@plt>

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

LLVM IR (-O2):
define i8* @suffix(i8* %0) {
%2 = tail call i8* @rindex(i8* %0, i32 46)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ f(int /*<<< orphan*/);
int /*<<< orphan*/ h(int);
void g(int c) {
  if (c == 1) {
    f(0);
    f(0);
    f(0);
    h(2);
    h(2);
    h(2);
    h(2);
    h(2);
    h(0);
  }
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    1183 <g+0x63>
xor    %edi,%edi
call   1040 <f@plt>
xor    %edi,%edi
call   1040 <f@plt>
xor    %edi,%edi
call   1040 <f@plt>
mov    $0x2,%edi
call   1030 <h@plt>
mov    $0x2,%edi
call   1030 <h@plt>
mov    $0x2,%edi
call   1030 <h@plt>
mov    $0x2,%edi
call   1030 <h@plt>
mov    $0x2,%edi
call   1030 <h@plt>
xor    %edi,%edi
call   1030 <h@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
cmp    $0x1,%edi
jne    1175 <g+0x55>
push   %rax
xor    %edi,%edi
call   1040 <f@plt>
xor    %edi,%edi
call   1040 <f@plt>
xor    %edi,%edi
call   1040 <f@plt>
mov    $0x2,%edi
call   1030 <h@plt>
mov    $0x2,%edi
call   1030 <h@plt>
mov    $0x2,%edi
call   1030 <h@plt>
mov    $0x2,%edi
call   1030 <h@plt>
mov    $0x2,%edi
call   1030 <h@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <h@plt>
ret

LLVM IR (-O0):
define void @g(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 1
br i1 %4, label %5, label %15
5: ; preds = %1
%6 = call i32 @f(i32 0)
%7 = call i32 @f(i32 0)
%8 = call i32 @f(i32 0)
%9 = call i32 @h(i32 2)
%10 = call i32 @h(i32 2)
%11 = call i32 @h(i32 2)
%12 = call i32 @h(i32 2)
%13 = call i32 @h(i32 2)
%14 = call i32 @h(i32 0)
br label %15
15: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @g(i32 %0) {
%2 = icmp eq i32 %0, 1
br i1 %2, label %3, label %13
3: ; preds = %1
%4 = tail call i32 @f(i32 0)
%5 = tail call i32 @f(i32 0)
%6 = tail call i32 @f(i32 0)
%7 = tail call i32 @h(i32 2)
%8 = tail call i32 @h(i32 2)
%9 = tail call i32 @h(i32 2)
%10 = tail call i32 @h(i32 2)
%11 = tail call i32 @h(i32 2)
%12 = tail call i32 @h(i32 0)
br label %13
13: ; preds = %3, %1
ret void
}
void test9b() {}


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

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

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

LLVM IR (-O2):
define void @test9b() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  int i = 123;
  if (i > 0)
    printf("1\n");
  else
    printf("2\n");
  printf("3\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x7b,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1141 <main+0x31>
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
jmp    114d <main+0x3d>
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xede(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"1\0A\00"
@.str.1 = [3 x i8] c"2\0A\00"
@.str.2 = [3 x i8] c"3\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 123, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %9
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %9
9: ; preds = %7, %5
%10 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [2 x i8] c"1\00"
@str.3 = [2 x i8] c"3\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.3, i64 0, i64 0))
ret i32 0
}
void g_date_get_day() {}


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

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

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

LLVM IR (-O2):
define void @g_date_get_day() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char const *, char const *);
void arg2_handler(int index, const char *arg_name_, const char *arg_val_) {
  printf("arg_handler2 val:[%d %s %s]\n", index, arg_name_, arg_val_);
}


x86 assembly (clang, -O0):
<arg2_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arg2_handler>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,%esi
lea    0xee1(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"arg_handler2 val:[%d %s %s]\0A\00"
define void @arg2_handler(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %7, i8* %8, i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"arg_handler2 val:[%d %s %s]\0A\00"
define void @arg2_handler(i32 %0, i8* %1, i8* %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %1, i8* %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
int /*<<< orphan*/ CurrentTime;
int /*<<< orphan*/ XUngrabKeyboard(int /*<<< orphan*/ *, int /*<<< orphan*/);
void release_keyboard(Display *display) {
  XUngrabKeyboard(display, CurrentTime);
}


x86 assembly (clang, -O0):
<release_keyboard>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ec1(%rip),%rax
mov    (%rax),%esi
call   1030 <XUngrabKeyboard@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<release_keyboard>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
jmp    1030 <XUngrabKeyboard@plt>

LLVM IR (-O0):
@CurrentTime = global i32 0
define void @release_keyboard(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* @CurrentTime
%5 = call i32 @XUngrabKeyboard(i32* %3, i32 %4)
ret void
}

LLVM IR (-O2):
@CurrentTime = global i32 0
define void @release_keyboard(i32* %0) {
%2 = load i32, i32* @CurrentTime
%3 = tail call i32 @XUngrabKeyboard(i32* %0, i32 %2)
ret void
}
void abort() {
_EXIT:
  goto _EXIT;
}


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

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

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

LLVM IR (-O2):
define void @abort() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ assume(int);
int main() {
  int i;
  assume(i >= 0 && i <= 200);
  while (i > 0) {
    i--;
  }
  assert(i >= 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
jl     114b <main+0x2b>
cmpl   $0xc8,-0x8(%rbp)
setle  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assume@plt>
cmpl   $0x0,-0x8(%rbp)
jle    1170 <main+0x50>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    1158 <main+0x38>
cmpl   $0x0,-0x8(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 200
br label %8
8: ; preds = %5, %0
%9 = phi i1 [ false, %0 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
%11 = call i32 @assume(i32 %10)
br label %12
12: ; preds = %15, %8
%13 = load i32, i32* %2
%14 = icmp sgt i32 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %12
%16 = load i32, i32* %2
%17 = add nsw i32 %16, -1
store i32 %17, i32* %2
br label %12
18: ; preds = %12
%19 = load i32, i32* %2
%20 = icmp sge i32 %19, 0
%21 = zext i1 %20 to i32
%22 = call i32 @assert(i32 %21)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assume(i32 1)
%2 = tail call i32 @assert(i32 0)
ret i32 0
}
int compareIntKeys(void *a, void *b) {
  int *a1, *b1;
  a1 = (int *)a;
  b1 = (int *)b;
  return ((*a1) - (*b1));
}


x86 assembly (clang, -O0):
<compareIntKeys>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    -0x20(%rbp),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compareIntKeys>:
mov    (%rdi),%eax
sub    (%rsi),%eax
ret

LLVM IR (-O0):
define i32 @compareIntKeys(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
store i32* %8, i32** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i32*
store i32* %10, i32** %6
%11 = load i32*, i32** %5
%12 = load i32, i32* %11
%13 = load i32*, i32** %6
%14 = load i32, i32* %13
%15 = sub nsw i32 %12, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @compareIntKeys(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = sub nsw i32 %5, %6
ret i32 %7
}
void movUUC(unsigned *src, unsigned char *dst) { *dst = *src; }


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

x86 assembly (clang, -O2):
<movUUC>:
mov    (%rdi),%al
mov    %al,(%rsi)
ret

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

LLVM IR (-O2):
define void @movUUC(i32* nocapture %0, i8* nocapture writeonly %1) {
%3 = load i32, i32* %0
%4 = trunc i32 %3 to i8
store i8 %4, i8* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glmFract3f(float *, float *);
void glmFract3f_(float x[3]) { glmFract3f(x, x); }


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

x86 assembly (clang, -O2):
<glmFract3f_>:
mov    %rdi,%rsi
jmp    1030 <glmFract3f@plt>

LLVM IR (-O0):
define void @glmFract3f_(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = load float*, float** %2
%5 = call i32 @glmFract3f(float* %3, float* %4)
ret void
}

LLVM IR (-O2):
define void @glmFract3f_(float* %0) {
%2 = tail call i32 @glmFract3f(float* %0, float* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __v4si;
typedef scalar_t__ __m128i;
typedef int /*<<< orphan*/ __m128d;

/* Variables and functions */
int /*<<< orphan*/ __builtin_ia32_cvtdq2pd(int /*<<< orphan*/);
__m128d __attribute__((__always___, __nodebug__)) _mm_cvtepi32_pd(__m128i a) {
  return __builtin_ia32_cvtdq2pd((__v4si)a);
}


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

x86 assembly (clang, -O2):
<_mm_cvtepi32_pd>:
jmp    1030 <__builtin_ia32_cvtdq2pd@plt>

LLVM IR (-O0):
define i32 @_mm_cvtepi32_pd(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
%5 = call i32 @__builtin_ia32_cvtdq2pd(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @_mm_cvtepi32_pd(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = tail call i32 @__builtin_ia32_cvtdq2pd(i32 %2)
ret i32 %3
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ next_row(int, int *);
int main(void) {
  int length = 10;
  int ss[length];
  next_row(length, ss);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
lea    0xf(,%rax,4),%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rsi
sub    %rcx,%rsi
mov    %rsi,%rsp
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <next_row@plt>
mov    0x2e88(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    %rsp,%rsi
mov    $0xa,%edi
call   1030 <next_row@plt>
mov    0x2eb8(%rip),%rax
mov    (%rax),%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
store i32 0, i32* %1
store i32 10, i32* %2
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
%7 = call i8* @llvm.stacksave()
store i8* %7, i8** %3
%8 = alloca i32, i64 %6
store i64 %6, i64* %4
%9 = load i32, i32* %2
%10 = call i32 @next_row(i32 %9, i32* %8)
%11 = load i32, i32* @EXIT_SUCCESS
store i32 %11, i32* %1
%12 = load i8*, i8** %3
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca [10 x i32]
%2 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%3 = call i32 @next_row(i32 10, i32* %2)
%4 = load i32, i32* @EXIT_SUCCESS
ret i32 %4
}
/* Variables and functions */
char *cvt(double, int, int *, int *, char *, int);
char *ecvtbuf(double arg, int ndigits, int *decpt, int *sign, char *buf) {
  return cvt(arg, ndigits, decpt, sign, buf, 1);
}


x86 assembly (clang, -O0):
<ecvtbuf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    $0x1,%r8d
call   1030 <cvt@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ecvtbuf>:
mov    $0x1,%r8d
jmp    1030 <cvt@plt>

LLVM IR (-O0):
define i8* @ecvtbuf(double %0, i32 %1, i32* %2, i32* %3, i8* %4) {
%6 = alloca double
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i8*
store double %0, double* %6
store i32 %1, i32* %7
store i32* %2, i32** %8
store i32* %3, i32** %9
store i8* %4, i8** %10
%11 = load double, double* %6
%12 = load i32, i32* %7
%13 = load i32*, i32** %8
%14 = load i32*, i32** %9
%15 = load i8*, i8** %10
%16 = call i8* @cvt(double %11, i32 %12, i32* %13, i32* %14, i8* %15, i32 1)
ret i8* %16
}

LLVM IR (-O2):
define i8* @ecvtbuf(double %0, i32 %1, i32* %2, i32* %3, i8* %4) {
%6 = tail call i8* @cvt(double %0, i32 %1, i32* %2, i32* %3, i8* %4, i32 1)
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ pal();
int main() {
  pal();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @pal()
ret i32 0
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
scalar_t__ stat(char const *, struct stat *);
int file_exists(const char *file) {
  struct stat st;
  if (stat(file, &st) >= 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<file_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
jl     113f <file_exists+0x2f>
movl   $0x1,-0x4(%rbp)
jmp    1146 <file_exists+0x36>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_exists>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
shr    $0x3f,%rax
xor    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @file_exists(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @stat(i8* %5, %struct.stat* %4)
%7 = icmp sge i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 1, i32* %2
br label %10
9: ; preds = %1
store i32 0, i32* %2
br label %10
10: ; preds = %9, %8
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @file_exists(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = lshr i64 %4, 63
%6 = trunc i64 %5 to i32
%7 = xor i32 %6, 1
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *gmtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int get_datetime(char *buffer) {
  time_t current_time;
  struct tm *ptm;
  time(&current_time);
  ptm = gmtime(&current_time);
  strftime(buffer, 36, "%a, %d %b %G %T GMT", ptm);
  return 0;
}


x86 assembly (clang, -O0):
<get_datetime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0xc(%rbp),%rdi
call   1030 <time@plt>
lea    -0xc(%rbp),%rdi
call   1050 <gmtime@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    $0x24,%esi
lea    0xe9a(%rip),%rdx
call   1040 <strftime@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_datetime>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0x4(%rsp),%r14
mov    %r14,%rdi
call   1030 <time@plt>
mov    %r14,%rdi
call   1050 <gmtime@plt>
lea    0xead(%rip),%rdx
mov    %rbx,%rdi
mov    $0x24,%esi
mov    %rax,%rcx
call   1040 <strftime@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [20 x i8] c"%a, %d %b %G %T GMT\00"
define i32 @get_datetime(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca %struct.tm*
store i8* %0, i8** %2
%5 = call i32 @time(i32* %3)
%6 = call %struct.tm* @gmtime(i32* %3)
store %struct.tm* %6, %struct.tm** %4
%7 = load i8*, i8** %2
%8 = load %struct.tm*, %struct.tm** %4
%9 = call i32 @strftime(i8* %7, i32 36, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), %struct.tm* %8)
ret i32 0
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [20 x i8] c"%a, %d %b %G %T GMT\00"
define i32 @get_datetime(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @time(i32* %2)
%5 = call %struct.tm* @gmtime(i32* %2)
%6 = call i32 @strftime(i8* %0, i32 36, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), %struct.tm* %5)
ret i32 0
}
int bitcount(unsigned long val) {
  int nbits;
  for (nbits = 0; val != 0; nbits++)
    val &= val - 1;
  return nbits;
}


x86 assembly (clang, -O0):
<bitcount>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1138 <bitcount+0x38>
mov    -0x8(%rbp),%rax
sub    $0x1,%rax
and    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <bitcount+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitcount>:
xor    %eax,%eax
test   %rdi,%rdi
je     111c <bitcount+0x1c>
nopw   0x0(%rax,%rax,1)
lea    -0x1(%rdi),%rcx
add    $0x1,%eax
and    %rcx,%rdi
jne    1110 <bitcount+0x10>
ret

LLVM IR (-O0):
define i32 @bitcount(i64 %0) {
%2 = alloca i64
%3 = alloca i32
store i64 %0, i64* %2
store i32 0, i32* %3
br label %4
4: ; preds = %12, %1
%5 = load i64, i64* %2
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %15
7: ; preds = %4
%8 = load i64, i64* %2
%9 = sub i64 %8, 1
%10 = load i64, i64* %2
%11 = and i64 %10, %9
store i64 %11, i64* %2
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 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @bitcount(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ 0, %1 ]
%5 = phi i64 [ %7, %3 ], [ %0, %1 ]
%6 = add i64 %5, -1
%7 = and i64 %6, %5
%8 = add nuw nsw i32 %4, 1
%9 = icmp eq i64 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %11
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int quaddobl_trace_sum_difference(int n, int *f, double *d) {
  int fail;
  fail = _ada_use_c2phc4c(677, &n, f, d, 0);
  return fail;
}


x86 assembly (clang, -O0):
<quaddobl_trace_sum_difference>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x2a5,%edi
lea    -0x4(%rbp),%rsi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quaddobl_trace_sum_difference>:
push   %rax
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x2a5,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @quaddobl_trace_sum_difference(i32 %0, i32* %1, double* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca double*
%7 = alloca i32
store i32 %0, i32* %4
store i32* %1, i32** %5
store double* %2, double** %6
%8 = load i32*, i32** %5
%9 = load double*, double** %6
%10 = call i32 @_ada_use_c2phc4c(i32 677, i32* %4, i32* %8, double* %9, i32 0)
store i32 %10, i32* %7
%11 = load i32, i32* %7
ret i32 %11
}

LLVM IR (-O2):
define i32 @quaddobl_trace_sum_difference(i32 %0, i32* %1, double* %2) {
%4 = alloca i32
store i32 %0, i32* %4
%5 = call i32 @_ada_use_c2phc4c(i32 677, i32* %4, i32* %1, double* %2, i32 0)
ret i32 %5
}
/* Type definitions */
struct strbuf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ strbuf_cat(struct strbuf *, char *);
void strbuf_append_num(struct strbuf *buf, int x) {
  char res[16];
  sprintf(res, "%d", x);
  strbuf_cat(buf, res);
}


x86 assembly (clang, -O0):
<strbuf_append_num>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xec3(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1030 <strbuf_cat@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strbuf_append_num>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %esi,%edx
mov    %rdi,%rbx
lea    0xecd(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strbuf_cat@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.strbuf = type { i32 }
@.str = [3 x i8] c"%d\00"
define void @strbuf_append_num(%struct.strbuf* %0, i32 %1) {
%3 = alloca %struct.strbuf*
%4 = alloca i32
%5 = alloca [16 x i8]
store %struct.strbuf* %0, %struct.strbuf** %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [16 x i8], [16 x i8]* %5, i64 0, i64 0
%7 = load i32, i32* %4
%8 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load %struct.strbuf*, %struct.strbuf** %3
%10 = getelementptr inbounds [16 x i8], [16 x i8]* %5, i64 0, i64 0
%11 = call i32 @strbuf_cat(%struct.strbuf* %9, i8* %10)
ret void
}

LLVM IR (-O2):
%struct.strbuf = type { i32 }
@.str = [3 x i8] c"%d\00"
define void @strbuf_append_num(%struct.strbuf* %0, i32 %1) {
%3 = alloca [16 x i8]
%4 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
%6 = call i32 @strbuf_cat(%struct.strbuf* %0, i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EA_AL_32();
int /*<<< orphan*/ m68ki_jump(int /*<<< orphan*/);
void m68k_op_jmp_32_al(void) { m68ki_jump(EA_AL_32()); }


x86 assembly (clang, -O0):
<m68k_op_jmp_32_al>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <EA_AL_32@plt>
mov    %eax,%edi
call   1030 <m68ki_jump@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<m68k_op_jmp_32_al>:
push   %rax
xor    %eax,%eax
call   1040 <EA_AL_32@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <m68ki_jump@plt>

LLVM IR (-O0):
define void @m68k_op_jmp_32_al() {
%1 = call i32 (...) @EA_AL_32()
%2 = call i32 @m68ki_jump(i32 %1)
ret void
}

LLVM IR (-O2):
define void @m68k_op_jmp_32_al() {
%1 = tail call i32 (...) @EA_AL_32()
%2 = tail call i32 @m68ki_jump(i32 %1)
ret void
}
int isWritten(char *memory, int wide) {
  for (int j = 0; j <= wide; j++) {
    if (memory[j] != 0) {
      return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<isWritten>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jg     1152 <isWritten+0x52>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     113f <isWritten+0x3f>
movl   $0x1,-0x4(%rbp)
jmp    1159 <isWritten+0x59>
jmp    1144 <isWritten+0x44>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1112 <isWritten+0x12>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isWritten>:
test   %esi,%esi
js     110f <isWritten+0xf>
mov    $0x1,%eax
cmpb   $0x0,(%rdi)
je     1112 <isWritten+0x12>
ret
xor    %eax,%eax
ret
mov    %esi,%ecx
add    $0x1,%esi
add    $0xffffffffffffffff,%rsi
xor    %eax,%eax
nopl   (%rax)
mov    %rax,%rdx
cmp    %rax,%rsi
je     1133 <isWritten+0x33>
lea    0x1(%rdx),%rax
cmpb   $0x0,0x1(%rdi,%rdx,1)
je     1120 <isWritten+0x20>
xor    %eax,%eax
cmp    %rcx,%rdx
setb   %al
ret

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

LLVM IR (-O2):
define i32 @isWritten(i8* nocapture %0, i32 %1) {
%3 = icmp slt i32 %1, 0
br i1 %3, label %21, label %4
4: ; preds = %2
%5 = zext i32 %1 to i64
%6 = add nuw i32 %1, 1
%7 = zext i32 %6 to i64
%8 = load i8, i8* %0
%9 = icmp eq i8 %8, 0
br i1 %9, label %10, label %21
10: ; preds = %4, %14
%11 = phi i64 [ %12, %14 ], [ 0, %4 ]
%12 = add nuw nsw i64 %11, 1
%13 = icmp eq i64 %12, %7
br i1 %13, label %18, label %14
14: ; preds = %10
%15 = getelementptr inbounds i8, i8* %0, i64 %12
%16 = load i8, i8* %15
%17 = icmp eq i8 %16, 0
br i1 %17, label %10, label %18
18: ; preds = %10, %14
%19 = icmp ult i64 %11, %5
%20 = zext i1 %19 to i32
br label %21
21: ; preds = %18, %4, %2
%22 = phi i32 [ 0, %2 ], [ 1, %4 ], [ %20, %18 ]
ret i32 %22
}
int _isatty(int f) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @_isatty(i32 %0) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ test_compile_inner();
int main(int argc, char *argv[]) {
  if (argc > 1) {
    printf("%s takes no arguments\n", argv[0]);
    return 1;
  }
  test_compile_inner();
  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)
cmpl   $0x1,-0x8(%rbp)
jle    115f <main+0x3f>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    116d <main+0x4d>
mov    $0x0,%al
call   1040 <test_compile_inner@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
cmp    $0x2,%edi
jl     113c <main+0x1c>
mov    (%rsi),%rsi
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%ebx
jmp    1145 <main+0x25>
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <test_compile_inner@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"%s takes no arguments\0A\00"
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 = load i32, i32* %4
%7 = icmp sgt i32 %6, 1
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 0
%11 = load i8*, i8** %10
%12 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %11)
store i32 1, i32* %3
br label %15
13: ; preds = %2
%14 = call i32 (...) @test_compile_inner()
store i32 0, i32* %3
br label %15
15: ; preds = %13, %8
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
@.str = [23 x i8] c"%s takes no arguments\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %5)
br label %9
7: ; preds = %2
%8 = tail call i32 (...) @test_compile_inner()
br label %9
9: ; preds = %7, %4
%10 = phi i32 [ 1, %4 ], [ 0, %7 ]
ret i32 %10
}
/* Variables and functions */
float __ocml_nearbyint_f32(float);
float nearbyintf(float x) { return __ocml_nearbyint_f32(x); }


x86 assembly (clang, -O0):
<nearbyintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <__ocml_nearbyint_f32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nearbyintf>:
jmp    1030 <__ocml_nearbyint_f32@plt>

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

LLVM IR (-O2):
define float @nearbyintf(float %0) {
%2 = tail call float @__ocml_nearbyint_f32(float %0)
ret float %2
}
void RTTimeIsLeapYear(void) {}


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

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

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

LLVM IR (-O2):
define void @RTTimeIsLeapYear() {
ret void
}
int swap16(int value) {
  int rc;
  rc = 0;
  rc |= (value >> 8) & 0x00ff;
  rc |= (value << 8) & 0xff00;
  return rc;
}


x86 assembly (clang, -O0):
<swap16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x8,%eax
and    $0xff00,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap16>:
rol    $0x8,%di
movzwl %di,%eax
ret

LLVM IR (-O0):
define i32 @swap16(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = ashr i32 %4, 8
%6 = and i32 %5, 255
%7 = load i32, i32* %3
%8 = or i32 %7, %6
store i32 %8, i32* %3
%9 = load i32, i32* %2
%10 = shl i32 %9, 8
%11 = and i32 %10, 65280
%12 = load i32, i32* %3
%13 = or i32 %12, %11
store i32 %13, i32* %3
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @swap16(i32 %0) {
%2 = trunc i32 %0 to i16
%3 = tail call i16 @llvm.bswap.i16(i16 %2)
%4 = zext i16 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
int m_less_equal(const uint64_t a, const uint64_t b) { return (a <= b); }


x86 assembly (clang, -O0):
<m_less_equal>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
setle  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<m_less_equal>:
xor    %eax,%eax
cmp    %rsi,%rdi
setle  %al
ret

LLVM IR (-O0):
define i32 @m_less_equal(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp sle i64 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @m_less_equal(i64 %0, i64 %1) {
%3 = icmp sle i64 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
char *mktemp(char *template) {
  if (template) {
    *template = 0;
  }
  return template;
}


x86 assembly (clang, -O0):
<mktemp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     111a <mktemp+0x1a>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mktemp>:
mov    %rdi,%rax
test   %rdi,%rdi
je     110b <mktemp+0xb>
movb   $0x0,(%rax)
ret

LLVM IR (-O0):
define i8* @mktemp(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 %7
5: ; preds = %1
%6 = load i8*, i8** %2
store i8 0, i8* %6
br label %7
7: ; preds = %5, %1
%8 = load i8*, i8** %2
ret i8* %8
}

LLVM IR (-O2):
define i8* @mktemp(i8* returned writeonly %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %4, label %3
3: ; preds = %1
store i8 0, i8* %0
br label %4
4: ; preds = %3, %1
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ pthread_detach(int /*<<< orphan*/);
int /*<<< orphan*/ pthread_exit(char *);
int /*<<< orphan*/ pthread_self();
void *run(void *arg) {
  pthread_detach(pthread_self());
  char *thread_tag = (char *)arg;
  for (int i = 0; i < 5; ++i) {
  }
  pthread_exit(thread_tag);
}


x86 assembly (clang, -O0):
<run>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x0,%al
call   1050 <pthread_self@plt>
mov    %eax,%edi
call   1040 <pthread_detach@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x5,-0x1c(%rbp)
jge    1176 <run+0x46>
jmp    1168 <run+0x38>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1159 <run+0x29>
mov    -0x18(%rbp),%rdi
call   1030 <pthread_exit@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<run>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1050 <pthread_self@plt>
mov    %eax,%edi
call   1040 <pthread_detach@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <pthread_exit@plt>

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

LLVM IR (-O2):
define noalias i8* @run(i8* %0) {
%2 = tail call i32 (...) @pthread_self()
%3 = tail call i32 @pthread_detach(i32 %2)
%4 = tail call i32 @pthread_exit(i8* %0)
ret i8* undef
}
/* Variables and functions */
double __nv_dadd_rn(double, double);
double __dadd_rn(double __a, double __b) { return __nv_dadd_rn(__a, __b); }


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

x86 assembly (clang, -O2):
<__dadd_rn>:
jmp    1030 <__nv_dadd_rn@plt>

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

LLVM IR (-O2):
define double @__dadd_rn(double %0, double %1) {
%3 = tail call double @__nv_dadd_rn(double %0, double %1)
ret double %3
}
void display_write_stringf(char *fmt, ...) { (void)fmt; }


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

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

LLVM IR (-O0):
define void @display_write_stringf(i8* %0, ...) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
ret void
}

LLVM IR (-O2):
define void @display_write_stringf(i8* nocapture %0, ...) {
ret void
}
int test_imm_28uint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0x28 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_28uint64_midword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
shr    $0x10,%rdx
and    $0x28,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_28uint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 2621440
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
char *strstrNoCase(char *, char *);
char *containsStringNoCase(char *haystack, char *needle) {
  return strstrNoCase(haystack, needle);
}


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

x86 assembly (clang, -O2):
<containsStringNoCase>:
jmp    1030 <strstrNoCase@plt>

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

LLVM IR (-O2):
define i8* @containsStringNoCase(i8* %0, i8* %1) {
%3 = tail call i8* @strstrNoCase(i8* %0, i8* %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ fatal(char *, unsigned long);
void *malloc(size_t);
void *xmalloc(size_t size) {
  void *obj = malloc(size);
  if (!obj) {
    fatal("gpsbabel: Unable to allocate %ld bytes of memory.\n",
          (unsigned long)size);
  }
  return obj;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <xmalloc+0x34>
mov    -0x8(%rbp),%rsi
lea    0xeb1(%rip),%rdi
call   1040 <fatal@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1143 <xmalloc+0x23>
lea    0xec5(%rip),%rdi
mov    %r14,%rsi
call   1040 <fatal@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [51 x i8] c"gpsbabel: Unable to allocate %ld bytes of memory.\0A\00"
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %11, label %8
8: ; preds = %1
%9 = load i64, i64* %2
%10 = call i32 @fatal(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i64 %9)
br label %11
11: ; preds = %8, %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [51 x i8] c"gpsbabel: Unable to allocate %ld bytes of memory.\0A\00"
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @fatal(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i64 %0)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ pthread_self();
int /*<<< orphan*/ sleep(int);
void *thread_start(void *arg) {
  printf("thread start %lu\n", pthread_self());
  sleep(3);
  printf("thread exit %lu\n", pthread_self());
  return 0;
}


x86 assembly (clang, -O0):
<thread_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <pthread_self@plt>
mov    %eax,%esi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
mov    $0x3,%edi
call   1050 <sleep@plt>
mov    $0x0,%al
call   1040 <pthread_self@plt>
mov    %eax,%esi
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread_start>:
push   %rax
xor    %eax,%eax
call   1040 <pthread_self@plt>
lea    0xec1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x3,%edi
call   1050 <sleep@plt>
xor    %eax,%eax
call   1040 <pthread_self@plt>
lea    0xeb4(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"thread start %lu\0A\00"
@.str.1 = [17 x i8] c"thread exit %lu\0A\00"
define i8* @thread_start(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @pthread_self()
%4 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @sleep(i32 3)
%6 = call i32 (...) @pthread_self()
%7 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i8* null
}

LLVM IR (-O2):
@.str = [18 x i8] c"thread start %lu\0A\00"
@.str.1 = [17 x i8] c"thread exit %lu\0A\00"
define noalias i8* @thread_start(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @pthread_self()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = tail call i32 @sleep(i32 3)
%5 = tail call i32 (...) @pthread_self()
%6 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i8* null
}
/* Variables and functions */
double INT_MIN;
extern double cmin_int() { return INT_MIN; }


x86 assembly (clang, -O0):
<cmin_int>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
movsd  (%rax),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmin_int>:
mov    0x2ee1(%rip),%rax
movsd  (%rax),%xmm0
ret

LLVM IR (-O0):
@INT_MIN = global double 0.000000e+00
define double @cmin_int() {
%1 = load double, double* @INT_MIN
ret double %1
}

LLVM IR (-O2):
@INT_MIN = global double 0.000000e+00
define double @cmin_int() {
%1 = load double, double* @INT_MIN
ret double %1
}
int csk_version() { return ((0) * 10000 + (0) * 100 + (1)); }


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

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

LLVM IR (-O0):
define i32 @csk_version() {
ret i32 1
}

LLVM IR (-O2):
define i32 @csk_version() {
ret i32 1
}
unsigned getMaxPower2(unsigned k) {
  unsigned pow2;
  for (pow2 = 1; pow2 <= k; pow2 <<= 1)
    ;
  return pow2 >> 1;
}


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

x86 assembly (clang, -O2):
<getMaxPower2>:
mov    $0x1,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ecx,%eax
lea    (%rax,%rax,1),%ecx
cmp    %edi,%eax
jbe    1110 <getMaxPower2+0x10>
shr    %eax
ret

LLVM IR (-O0):
define i32 @getMaxPower2(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
br label %4
4: ; preds = %9, %1
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = icmp ule 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 = shl i32 %10, 1
store i32 %11, i32* %3
br label %4
12: ; preds = %4
%13 = load i32, i32* %3
%14 = lshr i32 %13, 1
ret i32 %14
}

LLVM IR (-O2):
define i32 @getMaxPower2(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 1, %1 ], [ %5, %2 ]
%4 = icmp ugt i32 %3, %0
%5 = shl i32 %3, 1
br i1 %4, label %6, label %2
6: ; preds = %2
%7 = lshr i32 %3, 1
ret i32 %7
}