xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ init_board_connect_server(int, char **);
int main(int argc, char **argv) {
  init_board_connect_server(argc, argv);
  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    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <init_board_connect_server@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1030 <init_board_connect_server@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 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @init_board_connect_server(i32 %6, i8** %7)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @init_board_connect_server(i32 %0, i8** %1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ key_t;

/* Variables and functions */
key_t getkey(register char *p) { return ((key_t)0x706f7274); }


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

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

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

LLVM IR (-O2):
define i32 @getkey(i8* nocapture readnone %0) {
ret i32 1886351988
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("keymap: Compile or install a keyboard mapping.\nUsage: keymap "
         "[compile|install] file \n");
}


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

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

LLVM IR (-O0):
@.str = [86 x i8] c"keymap: Compile or install a keyboard mapping.\0AUsage: keymap [compile|install] file \0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [85 x i8] c"keymap: Compile or install a keyboard mapping.\0AUsage: keymap [compile|install] file \00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([85 x i8], [85 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint32_t;

/* Variables and functions */
void bigendian_to_u32(uint32_t *dst, uint8_t *src) {
  *dst = (((uint32_t)src[0]) << 24) | (((uint32_t)src[1]) << 16) |
         (((uint32_t)src[2]) << 8) | (uint32_t)src[3];
}


x86 assembly (clang, -O0):
<bigendian_to_u32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %eax,%ecx
shl    $0x18,%ecx
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
shl    $0x10,%eax
or     %eax,%ecx
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
shl    $0x8,%eax
or     %eax,%ecx
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rax
or     %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bigendian_to_u32>:
mov    (%rsi),%eax
mov    0x8(%rsi),%ecx
shl    $0x18,%eax
shl    $0x10,%ecx
or     %eax,%ecx
mov    0x10(%rsi),%eax
shl    $0x8,%eax
or     %ecx,%eax
or     0x18(%rsi),%eax
mov    %eax,(%rdi)
ret

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

LLVM IR (-O2):
define void @bigendian_to_u32(i32* nocapture writeonly %0, i64* nocapture %1) {
%3 = load i64, i64* %1
%4 = trunc i64 %3 to i32
%5 = shl i32 %4, 24
%6 = getelementptr inbounds i64, i64* %1, i64 1
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i32
%9 = shl i32 %8, 16
%10 = or i32 %9, %5
%11 = getelementptr inbounds i64, i64* %1, i64 2
%12 = load i64, i64* %11
%13 = trunc i64 %12 to i32
%14 = shl i32 %13, 8
%15 = or i32 %10, %14
%16 = getelementptr inbounds i64, i64* %1, i64 3
%17 = load i64, i64* %16
%18 = trunc i64 %17 to i32
%19 = or i32 %15, %18
store i32 %19, i32* %0
ret void
}
int pixelComparator(void const *aV, void const *bV) {
  double const *a;
  double const *b;
  {
    a = (double const *)aV;
    b = (double const *)bV;
    if (*a < *b) {
      return (-1);
    }
    if (*a > *b) {
      return (1);
    }
    return (0);
  }
}


x86 assembly (clang, -O0):
<pixelComparator>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
jbe    1142 <pixelComparator+0x42>
movl   $0xffffffff,-0x4(%rbp)
jmp    116b <pixelComparator+0x6b>
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x28(%rbp),%rax
ucomisd (%rax),%xmm0
jbe    1164 <pixelComparator+0x64>
movl   $0x1,-0x4(%rbp)
jmp    116b <pixelComparator+0x6b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pixelComparator>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
xor    %ecx,%ecx
ucomisd %xmm1,%xmm0
seta   %cl
ucomisd %xmm0,%xmm1
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @pixelComparator(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = bitcast i8* %1 to double*
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp olt double %5, %6
%8 = fcmp ogt double %5, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
int rename(char const *, char const *);
int /*<<< orphan*/ syssuerr(char *, char *);
int erename(const char *oldfile, const char *newfile) {
  int status;
  if ((status = rename(oldfile, newfile)))
    syssuerr("%s: erename: rename failed",
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/TobbeTripitaka/src/refs/heads/master/"
             "trip/iwave/sucore/src/subcalls.c");
  return status;
}


x86 assembly (clang, -O0):
<erename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <rename@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     115c <erename+0x3c>
lea    0xeb0(%rip),%rdi
lea    0xec4(%rip),%rsi
call   1030 <syssuerr@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<erename>:
push   %rbx
call   1040 <rename@plt>
mov    %eax,%ebx
test   %eax,%eax
je     113f <erename+0x1f>
lea    0xecd(%rip),%rdi
lea    0xee1(%rip),%rsi
call   1030 <syssuerr@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"%s: erename: rename failed\00"
@.str.1 = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/TobbeTripitaka/src/refs/heads/master/trip/iwave/sucore/src/subcalls.c\00"
define i32 @erename(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32 @rename(i8* %6, i8* %7)
store i32 %8, i32* %5
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 @syssuerr(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %10, %2
%13 = load i32, i32* %5
ret i32 %13
}

LLVM IR (-O2):
@.str = [27 x i8] c"%s: erename: rename failed\00"
@.str.1 = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/TobbeTripitaka/src/refs/heads/master/trip/iwave/sucore/src/subcalls.c\00"
define i32 @erename(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @rename(i8* %0, i8* %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @syssuerr(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str.1, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret i32 %3
}
int nid_cmp(int *a, int *b) { return *a - *b; }


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

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

LLVM IR (-O0):
define i32 @nid_cmp(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %5
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = sub nsw i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @nid_cmp(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = sub nsw i32 %3, %4
ret i32 %5
}
int test_imm_96int32_reg(int val) { return ((val) & (0x96 << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_96int32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x96,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_96int32_reg>:
test   $0x96,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_96int32_reg(i32 %0) {
%2 = and i32 %0, 150
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_avg_epu16(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _mm_setzero_si128();
__m128i xx_round_epu16(__m128i v_val_w) {
  return _mm_avg_epu16(v_val_w, _mm_setzero_si128());
}


x86 assembly (clang, -O0):
<xx_round_epu16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <_mm_setzero_si128@plt>
mov    -0x8(%rbp),%edi
mov    %eax,%esi
call   1040 <_mm_avg_epu16@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xx_round_epu16>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <_mm_setzero_si128@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1040 <_mm_avg_epu16@plt>

LLVM IR (-O0):
define i32 @xx_round_epu16(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (...) @_mm_setzero_si128()
%5 = call i32 @_mm_avg_epu16(i32 %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @xx_round_epu16(i32 %0) {
%2 = tail call i32 (...) @_mm_setzero_si128()
%3 = tail call i32 @_mm_avg_epu16(i32 %0, i32 %2)
ret i32 %3
}
int sub_one(int n) { return n - 1; }


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

x86 assembly (clang, -O2):
<sub_one>:
lea    -0x1(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @sub_one(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 %3, 1
ret i32 %4
}

LLVM IR (-O2):
define i32 @sub_one(i32 %0) {
%2 = add nsw i32 %0, -1
ret i32 %2
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, double);
void print_timeval(FILE *o, const struct timeval *t) {
  fprintf(o, "%8.3f s",
          (double)t->tv_sec + (double)t->tv_usec / (1000.0 * 1000.0));
}


x86 assembly (clang, -O0):
<print_timeval>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
cvtsi2sdq 0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
cvtsi2sdq (%rax),%xmm1
movsd  0xec1(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
lea    0xeba(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_timeval>:
cvtsi2sdq 0x8(%rsi),%xmm1
cvtsi2sdq (%rsi),%xmm0
divsd  0xedd(%rip),%xmm0
addsd  %xmm1,%xmm0
lea    0xeda(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
@.str = [8 x i8] c"%8.3f s\00"
define void @print_timeval(i32* %0, %struct.timeval* %1) {
%3 = alloca i32*
%4 = alloca %struct.timeval*
store i32* %0, i32** %3
store %struct.timeval* %1, %struct.timeval** %4
%5 = load i32*, i32** %3
%6 = load %struct.timeval*, %struct.timeval** %4
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i32 0, i32 1
%8 = load i64, i64* %7
%9 = sitofp i64 %8 to double
%10 = load %struct.timeval*, %struct.timeval** %4
%11 = getelementptr inbounds %struct.timeval, %struct.timeval* %10, i32 0, i32 0
%12 = load i64, i64* %11
%13 = sitofp i64 %12 to double
%14 = fdiv double %13, 1.000000e+06
%15 = fadd double %9, %14
%16 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double %15)
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
@.str = [8 x i8] c"%8.3f s\00"
define void @print_timeval(i32* nocapture %0, %struct.timeval* nocapture %1) {
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%4 = load i64, i64* %3
%5 = sitofp i64 %4 to double
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%7 = load i64, i64* %6
%8 = sitofp i64 %7 to double
%9 = fdiv double %8, 1.000000e+06
%10 = fadd double %9, %5
%11 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double %10)
ret void
}
/* Variables and functions */
scalar_t__ is_nan(double);
int has_nan(double *x, int n) {
  int i;
  for (i = 0; i < n; i++) {
    if (is_nan(x[i]))
      return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<has_nan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    116d <has_nan+0x5d>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
call   1030 <is_nan@plt>
cmp    $0x0,%rax
je     115a <has_nan+0x4a>
movl   $0x1,-0x4(%rbp)
jmp    1174 <has_nan+0x64>
jmp    115f <has_nan+0x4f>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1126 <has_nan+0x16>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<has_nan>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1149 <has_nan+0x39>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsd  (%r14,%rbx,8),%xmm0
call   1030 <is_nan@plt>
test   %rax,%rax
jne    114d <has_nan+0x3d>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <has_nan+0x20>
xor    %eax,%eax
jmp    1152 <has_nan+0x42>
mov    $0x1,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @has_nan(double* %0, i32 %1) {
%3 = alloca i32
%4 = alloca double*
%5 = alloca i32
%6 = alloca i32
store double* %0, double** %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 slt i32 %8, %9
br i1 %10, label %11, label %24
11: ; preds = %7
%12 = load double*, double** %4
%13 = load i32, i32* %6
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds double, double* %12, i64 %14
%16 = load double, double* %15
%17 = call i64 @is_nan(double %16)
%18 = icmp ne i64 %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 @has_nan(double* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %15
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %8
6: ; preds = %8
%7 = icmp eq i64 %14, %5
br i1 %7, label %15, label %8
8: ; preds = %4, %6
%9 = phi i64 [ 0, %4 ], [ %14, %6 ]
%10 = getelementptr inbounds double, double* %0, i64 %9
%11 = load double, double* %10
%12 = tail call i64 @is_nan(double %11)
%13 = icmp eq i64 %12, 0
%14 = add nuw nsw i64 %9, 1
br i1 %13, label %6, label %15
15: ; preds = %8, %6, %2
%16 = phi i32 [ 0, %2 ], [ 0, %6 ], [ 1, %8 ]
ret i32 %16
}
int int_min(int a, int b) { return a < b ? a : b; }


x86 assembly (clang, -O0):
<int_min>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1121 <int_min+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <int_min+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @int_min(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ putnum(int);
int /*<<< orphan*/ putsln(char *);
void putnumln(int num) {
  putnum(num);
  putsln("");
}


x86 assembly (clang, -O0):
<putnumln>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <putnum@plt>
lea    0xec6(%rip),%rdi
call   1030 <putsln@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putnumln>:
push   %rax
call   1040 <putnum@plt>
lea    0xed3(%rip),%rdi
pop    %rax
jmp    1030 <putsln@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define void @putnumln(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @putnum(i32 %3)
%5 = call i32 @putsln(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define void @putnumln(i32 %0) {
%2 = tail call i32 @putnum(i32 %0)
%3 = tail call i32 @putsln(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret void
}
void varput(s, out) register char *s;
int out;
{
  if (letnum(*s)) {
    write(out, s, strlen(s));
    write(out, "\n", 1);
  }
}


x86 assembly (clang, -O0):
<varput>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
mov    $0x0,%al
call   1050 <letnum@plt>
cmp    $0x0,%eax
je     1194 <varput+0x64>
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %rax,%rdx
mov    $0x0,%al
call   1030 <write@plt>
mov    -0xc(%rbp),%edi
lea    0xe78(%rip),%rsi
mov    $0x1,%edx
mov    $0x0,%al
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<varput>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
movsbl (%rdi),%edi
xor    %eax,%eax
call   1050 <letnum@plt>
test   %eax,%eax
je     1178 <varput+0x48>
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %rax,%rdx
xor    %eax,%eax
call   1030 <write@plt>
lea    0xe9c(%rip),%rsi
mov    %ebp,%edi
mov    $0x1,%edx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <write@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define void @varput(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = call i32 (i32, ...) bitcast (i32 (...)* @letnum to i32 (i32, ...)*)(i32 %7)
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %18
10: ; preds = %2
%11 = load i32, i32* %4
%12 = load i8*, i8** %3
%13 = load i8*, i8** %3
%14 = call i64 @strlen(i8* %13)
%15 = call i32 (i32, i8*, i64, ...) bitcast (i32 (...)* @write to i32 (i32, i8*, i64, ...)*)(i32 %11, i8* %12, i64 %14)
%16 = load i32, i32* %4
%17 = call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @write to i32 (i32, i8*, i32, ...)*)(i32 %16, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
br label %18
18: ; preds = %10, %2
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define void @varput(i8* %0, i32 %1) {
%3 = load i8, i8* %0
%4 = sext i8 %3 to i32
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @letnum to i32 (i32, ...)*)(i32 %4)
%6 = icmp eq i32 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %2
%8 = tail call i64 @strlen(i8* %0)
%9 = tail call i32 (i32, i8*, i64, ...) bitcast (i32 (...)* @write to i32 (i32, i8*, i64, ...)*)(i32 %1, i8* %0, i64 %8)
%10 = tail call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @write to i32 (i32, i8*, i32, ...)*)(i32 %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
br label %11
11: ; preds = %7, %2
ret void
}
/* Variables and functions */
int Compare(const void *key, const void *val_at_index) {
  return *(size_t *)key - *(size_t *)val_at_index;
}


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

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

LLVM IR (-O0):
define i32 @Compare(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 = bitcast i8* %5 to i64*
%7 = load i64, i64* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i64*
%10 = load i64, i64* %9
%11 = sub i64 %7, %10
%12 = trunc i64 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @Compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %5
%7 = sub i64 %4, %6
%8 = trunc i64 %7 to i32
ret i32 %8
}
/* Type definitions */
struct emmc_block_dev {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
int /*<<< orphan*/ sd_card_init(struct emmc_block_dev *, char,
                                int /*<<< orphan*/);
void lock(struct emmc_block_dev *emmc_dev) {
  printf(
      "WARNING: This will lock the (e)MMC!\n\n Enter H (big h) to continue.\n");
  char in;
  scanf(" %c", &in);
  if ('H' == in)
    sd_card_init(emmc_dev, 'L', 0);
  return;
}


x86 assembly (clang, -O0):
<lock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xebd(%rip),%rdi
call   1040 <printf@plt>
lea    0xef5(%rip),%rdi
lea    -0x9(%rbp),%rsi
call   1050 <scanf@plt>
movsbl -0x9(%rbp),%ecx
mov    $0x48,%eax
cmp    %ecx,%eax
jne    1179 <lock+0x49>
mov    -0x8(%rbp),%rdi
mov    $0x4c,%esi
xor    %edx,%edx
call   1030 <sd_card_init@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lock>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0xec5(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb5(%rip),%rdi
lea    0xf(%rsp),%rsi
call   1050 <scanf@plt>
cmpb   $0x48,0xf(%rsp)
jne    116b <lock+0x3b>
mov    %rbx,%rdi
mov    $0x4c,%esi
xor    %edx,%edx
call   1040 <sd_card_init@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.emmc_block_dev = type { i32 }
@.str = [68 x i8] c"WARNING: This will lock the (e)MMC!\0A\0A Enter H (big h) to continue.\0A\00"
@.str.1 = [4 x i8] c" %c\00"
define void @lock(%struct.emmc_block_dev* %0) {
%2 = alloca %struct.emmc_block_dev*
%3 = alloca i8
store %struct.emmc_block_dev* %0, %struct.emmc_block_dev** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%6 = load i8, i8* %3
%7 = sext i8 %6 to i32
%8 = icmp eq i32 72, %7
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load %struct.emmc_block_dev*, %struct.emmc_block_dev** %2
%11 = call i32 @sd_card_init(%struct.emmc_block_dev* %10, i8 signext 76, i32 0)
br label %12
12: ; preds = %9, %1
ret void
}

LLVM IR (-O2):
%struct.emmc_block_dev = type { i32 }
@.str.1 = [4 x i8] c" %c\00"
@str = [67 x i8] c"WARNING: This will lock the (e)MMC!\0A\0A Enter H (big h) to continue.\00"
define void @lock(%struct.emmc_block_dev* %0) {
%2 = alloca i8
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([67 x i8], [67 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = load i8, i8* %2
%6 = icmp eq i8 %5, 72
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @sd_card_init(%struct.emmc_block_dev* %0, i8 signext 76, i32 0)
br label %9
9: ; preds = %7, %1
ret void
}
/* Variables and functions */
scalar_t__ __builtin_arm_strex(int, int *);
void foo(int a, int *b) {
  do {
  } while (__builtin_arm_strex(a, b));
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
jmp    1124 <foo+0x14>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <__builtin_arm_strex@plt>
cmp    $0x0,%rax
jne    111f <foo+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
nopl   0x0(%rax,%rax,1)
mov    %ebp,%edi
mov    %rbx,%rsi
call   1030 <__builtin_arm_strex@plt>
test   %rax,%rax
jne    1120 <foo+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @foo(i32 %0, i32* %1) {
br label %3
3: ; preds = %3, %2
%4 = tail call i64 @__builtin_arm_strex(i32 %0, i32* %1)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %3
6: ; preds = %3
ret void
}
/* Variables and functions */
int ipow(int, int);
int ComponentOf(int n, int clut, int nColorant) {
  if (nColorant <= 0)
    return (n % clut);
  n /= ipow(clut, nColorant);
  return (n % clut);
}


x86 assembly (clang, -O0):
<ComponentOf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jg     113a <ComponentOf+0x2a>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x4(%rbp)
jmp    115a <ComponentOf+0x4a>
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <ipow@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ComponentOf>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
test   %edx,%edx
jle    112d <ComponentOf+0x1d>
mov    %ebx,%edi
mov    %edx,%esi
call   1030 <ipow@plt>
mov    %eax,%ecx
mov    %ebp,%eax
cltd
idiv   %ecx
mov    %eax,%ebp
mov    %ebp,%eax
cltd
idiv   %ebx
mov    %edx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @ComponentOf(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %2, 1
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = tail call i32 @ipow(i32 %1, i32 %2)
%7 = sdiv i32 %0, %6
br label %8
8: ; preds = %3, %5
%9 = phi i32 [ %7, %5 ], [ %0, %3 ]
%10 = srem i32 %9, %1
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ is_little_endian();
int main(int argc, char *argv[]) {
  assert(is_little_endian());
  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   1040 <is_little_endian@plt>
mov    %eax,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <is_little_endian@plt>
mov    %eax,%edi
call   1030 <assert@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 (...) @is_little_endian()
%7 = call i32 @assert(i32 %6)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @is_little_endian()
%4 = tail call i32 @assert(i32 %3)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int getgroups(int _size, gid_t *grouplist) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @getgroups(i32 %0, i32* nocapture readnone %1) {
ret i32 0
}
void main() {
  for (;;)
    ;
}


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

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

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

LLVM IR (-O2):
define void @main() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
char *get_message();
int /*<<< orphan*/ printf(char *, char const *);
void ctbenchprintf(int n) {
  int i;
  const char *m = get_message();
  for (i = 0; i < n; i++) {
    printf("%s\n", m);
  }
}


x86 assembly (clang, -O0):
<ctbenchprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <get_message@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1167 <ctbenchprintf+0x47>
mov    -0x10(%rbp),%rsi
lea    0xeac(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113d <ctbenchprintf+0x1d>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ctbenchprintf>:
push   %r15
push   %r14
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <get_message@plt>
test   %ebx,%ebx
jle    1150 <ctbenchprintf+0x30>
mov    %rax,%r14
lea    0xec4(%rip),%r15
nopl   0x0(%rax)
mov    %r15,%rdi
mov    %r14,%rsi
call   1040 <printf@plt>
add    $0xffffffff,%ebx
jne    1140 <ctbenchprintf+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @ctbenchprintf(i32 %0) {
%2 = tail call i8* (...) @get_message()
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %9
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 0, %1 ]
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, %0
br i1 %8, label %9, label %4
9: ; preds = %4, %1
ret void
}
/* Variables and functions */
int FCEUI_AviIsRecording(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @FCEUI_AviIsRecording() {
ret i32 0
}
/* Variables and functions */
char *strchr(const char *s, int c) {
  while (*s && (*s != c))
    s++;
  if (*s == c)
    return (char *)s;
  return NULL;
}


x86 assembly (clang, -O0):
<strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x15(%rbp)
je     1130 <strchr+0x30>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    -0x14(%rbp),%eax
setne  %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    1140 <strchr+0x40>
jmp    1151 <strchr+0x51>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110b <strchr+0xb>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    -0x14(%rbp),%eax
jne    116e <strchr+0x6e>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1176 <strchr+0x76>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchr>:
add    $0xffffffffffffffff,%rdi
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl 0x1(%rdi),%ecx
add    $0x1,%rdi
test   %ecx,%ecx
je     1120 <strchr+0x20>
cmp    %esi,%ecx
jne    1110 <strchr+0x10>
xor    %eax,%eax
cmp    %esi,%ecx
cmove  %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @strchr(i8* %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %10, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = sext i8 %5 to i32
%8 = icmp eq i32 %7, %1
%9 = or i1 %6, %8
%10 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %9, label %11, label %3
11: ; preds = %3
%12 = select i1 %8, i8* %4, i8* null
ret i8* %12
}
/* Variables and functions */
int /*<<< orphan*/ yy_scan_string(char *);
void scanner_init(char *str) { yy_scan_string(str); }


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

x86 assembly (clang, -O2):
<scanner_init>:
jmp    1030 <yy_scan_string@plt>

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

LLVM IR (-O2):
define void @scanner_init(i8* %0) {
%2 = tail call i32 @yy_scan_string(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ queue_test_2();
int main(int argc, char **argv) { queue_test_2(); }


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @queue_test_2()
ret i32 0
}
/* Type definitions */
typedef int uint32_t;
typedef int ipaddr;

/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int, int, int, int);
char *iptos(uint32_t ipaddr) {
  static char ips[16];
  sprintf(ips, "%d.%d.%d.%d", (ipaddr >> 24), (ipaddr >> 16) & 0xff,
          (ipaddr >> 8) & 0xff, (ipaddr)&0xff);
  return ips;
}


x86 assembly (clang, -O0):
<iptos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
sar    $0x18,%edx
mov    -0x4(%rbp),%ecx
sar    $0x10,%ecx
and    $0xff,%ecx
mov    -0x4(%rbp),%r8d
sar    $0x8,%r8d
and    $0xff,%r8d
mov    -0x4(%rbp),%r9d
and    $0xff,%r9d
lea    0x2ef2(%rip),%rdi
lea    0xeab(%rip),%rsi
call   1030 <sprintf@plt>
lea    0x2edf(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iptos>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%edx
mov    %edi,%eax
movzbl %dh,%ebp
movzbl %dl,%r9d
sar    $0x18,%edx
shr    $0x10,%eax
movzbl %al,%ecx
lea    0x2f12(%rip),%rbx
lea    0xecb(%rip),%rsi
mov    %rbx,%rdi
mov    %ebp,%r8d
call   1030 <sprintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@iptos.ips = internal global [16 x i8] zeroinitializer
@.str = [12 x i8] c"%d.%d.%d.%d\00"
define i8* @iptos(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 24
%5 = load i32, i32* %2
%6 = ashr i32 %5, 16
%7 = and i32 %6, 255
%8 = load i32, i32* %2
%9 = ashr i32 %8, 8
%10 = and i32 %9, 255
%11 = load i32, i32* %2
%12 = and i32 %11, 255
%13 = call i32 @sprintf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @iptos.ips, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %7, i32 %10, i32 %12)
ret i8* getelementptr inbounds ([16 x i8], [16 x i8]* @iptos.ips, i64 0, i64 0)
}

LLVM IR (-O2):
@iptos.ips = internal global [16 x i8] zeroinitializer
@.str = [12 x i8] c"%d.%d.%d.%d\00"
define i8* @iptos(i32 %0) {
%2 = ashr i32 %0, 24
%3 = lshr i32 %0, 16
%4 = and i32 %3, 255
%5 = lshr i32 %0, 8
%6 = and i32 %5, 255
%7 = and i32 %0, 255
%8 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @iptos.ips, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %4, i32 %6, i32 %7)
ret i8* getelementptr inbounds ([16 x i8], [16 x i8]* @iptos.ips, i64 0, i64 0)
}
/* Variables and functions */
void *realloc(void *, size_t);
void *egg_memory_fallback(void *p, size_t sz) { return realloc(p, sz); }


x86 assembly (clang, -O0):
<egg_memory_fallback>:
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 <realloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<egg_memory_fallback>:
jmp    1030 <realloc@plt>

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

LLVM IR (-O2):
define noalias i8* @egg_memory_fallback(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void completeWithSpace(int n) {
  int i;
  for (i = 0; i < n; i++)
    printf("%c", ' ');
}


x86 assembly (clang, -O0):
<completeWithSpace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    114d <completeWithSpace+0x3d>
lea    0xecb(%rip),%rdi
mov    $0x20,%esi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <completeWithSpace+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<completeWithSpace>:
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
jle    1142 <completeWithSpace+0x32>
mov    %edi,%ebx
lea    0xedf(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    $0x20,%esi
call   1030 <printf@plt>
add    $0xffffffff,%ebx
jne    1130 <completeWithSpace+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define void @completeWithSpace(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %10, %1
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %13
8: ; preds = %4
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext 32)
br label %10
10: ; preds = %8
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
br label %4
13: ; preds = %4
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @completeWithSpace(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext 32)
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
void RTTimerStop(void) {}


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

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

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

LLVM IR (-O2):
define void @RTTimerStop() {
ret void
}
long long bit63() { return 0x8000000000000000LL; }


x86 assembly (clang, -O0):
<bit63>:
push   %rbp
mov    %rsp,%rbp
movabs $0x8000000000000000,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit63>:
movabs $0x8000000000000000,%rax
ret

LLVM IR (-O0):
define i64 @bit63() {
ret i64 -9223372036854775808
}

LLVM IR (-O2):
define i64 @bit63() {
ret i64 -9223372036854775808
}
int quit_f(int argc, char **argv) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @quit_f(i32 %0, i8** nocapture readnone %1) {
ret i32 1
}
void vcopy4(float *v1, float *out) {
  out[0] = v1[0];
  out[1] = v1[1];
  out[2] = v1[2];
  out[3] = v1[3];
}


x86 assembly (clang, -O0):
<vcopy4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,0x8(%rax)
mov    -0x8(%rbp),%rax
movss  0xc(%rax),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<vcopy4>:
movss  (%rdi),%xmm0
movss  %xmm0,(%rsi)
movss  0x4(%rdi),%xmm0
movss  %xmm0,0x4(%rsi)
movss  0x8(%rdi),%xmm0
movss  %xmm0,0x8(%rsi)
movss  0xc(%rdi),%xmm0
movss  %xmm0,0xc(%rsi)
ret

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

LLVM IR (-O2):
define void @vcopy4(float* nocapture %0, float* nocapture writeonly %1) {
%3 = load float, float* %0
store float %3, float* %1
%4 = getelementptr inbounds float, float* %0, i64 1
%5 = load float, float* %4
%6 = getelementptr inbounds float, float* %1, i64 1
store float %5, float* %6
%7 = getelementptr inbounds float, float* %0, i64 2
%8 = load float, float* %7
%9 = getelementptr inbounds float, float* %1, i64 2
store float %8, float* %9
%10 = getelementptr inbounds float, float* %0, i64 3
%11 = load float, float* %10
%12 = getelementptr inbounds float, float* %1, i64 3
store float %11, float* %12
ret void
}
void BN_mod_exp(void) {}


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

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

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

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