xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, void *, int);
int /*<<< orphan*/ ntohl(int /*<<< orphan*/);
uint32_t get_uint32(void *buf) {
  uint32_t u;
  memcpy(&u, buf, 4);
  return ntohl(u);
}


x86 assembly (clang, -O0):
<get_uint32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0xc(%rbp),%edi
call   1040 <ntohl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_uint32>:
push   %rax
mov    %rdi,%rsi
lea    0x4(%rsp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    0x4(%rsp),%edi
call   1040 <ntohl@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @get_uint32(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @memcpy(i32* %3, i8* %4, i32 4)
%6 = load i32, i32* %3
%7 = call i32 @ntohl(i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_uint32(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @memcpy(i32* %2, i8* %0, i32 4)
%5 = load i32, i32* %2
%6 = call i32 @ntohl(i32 %5)
ret i32 %6
}
int lsbZero(int x) { return x >> 1 << 1; }


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

x86 assembly (clang, -O2):
<lsbZero>:
mov    %edi,%eax
and    $0xfffffffe,%eax
ret

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

LLVM IR (-O2):
define i32 @lsbZero(i32 %0) {
%2 = and i32 %0, -2
ret i32 %2
}
void flashlightLoop() {}


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

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

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

LLVM IR (-O2):
define void @flashlightLoop() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ modify_heap(int *, int, int);
void build_heap(int a[], int n) {
  int i = n / 2 - 1;
  for (; i >= 0; i--) {
    modify_heap(a, n, i);
  }
}


x86 assembly (clang, -O0):
<build_heap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jl     1157 <build_heap+0x47>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <modify_heap@plt>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1130 <build_heap+0x20>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<build_heap>:
push   %rbp
push   %r14
push   %rbx
cmp    $0x2,%esi
jl     1145 <build_heap+0x35>
mov    %esi,%ebp
mov    %rdi,%r14
mov    %esi,%ebx
shr    %ebx
add    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
lea    -0x2(%rbx),%edx
mov    %r14,%rdi
mov    %ebp,%esi
call   1030 <modify_heap@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     1130 <build_heap+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @build_heap(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = sdiv i32 %6, 2
%8 = sub nsw i32 %7, 1
store i32 %8, i32* %5
br label %9
9: ; preds = %17, %2
%10 = load i32, i32* %5
%11 = icmp sge i32 %10, 0
br i1 %11, label %12, label %20
12: ; preds = %9
%13 = load i32*, i32** %3
%14 = load i32, i32* %4
%15 = load i32, i32* %5
%16 = call i32 @modify_heap(i32* %13, i32 %14, i32 %15)
br label %17
17: ; preds = %12
%18 = load i32, i32* %5
%19 = add nsw i32 %18, -1
store i32 %19, i32* %5
br label %9
20: ; preds = %9
ret void
}

LLVM IR (-O2):
define void @build_heap(i32* %0, i32 %1) {
%3 = icmp sgt i32 %1, 1
br i1 %3, label %4, label %11
4: ; preds = %2
%5 = lshr i32 %1, 1
br label %6
6: ; preds = %4, %6
%7 = phi i32 [ %8, %6 ], [ %5, %4 ]
%8 = add nsw i32 %7, -1
%9 = tail call i32 @modify_heap(i32* %0, i32 %1, i32 %8)
%10 = icmp ugt i32 %7, 1
br i1 %10, label %6, label %11
11: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() { printf("This is as small as it gets.\n"); }


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

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

LLVM IR (-O0):
@.str = [30 x i8] c"This is as small as it gets.\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [29 x i8] c"This is as small as it gets.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int trio_vfprintf(int /*<<< orphan*/ *, char const *, int /*<<< orphan*/);
int vfprintf(FILE *file, const char *format, va_list args) {
  return trio_vfprintf(file, format, args);
}


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

x86 assembly (clang, -O2):
<vfprintf>:
jmp    1030 <trio_vfprintf@plt>

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

LLVM IR (-O2):
define i32 @vfprintf(i32* %0, i8* %1, i32 %2) {
%4 = tail call i32 @trio_vfprintf(i32* %0, i8* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ marker_C();
int /*<<< orphan*/ mutual_test_4(int);
void mutual_test_3(int flag) {
  marker_C();
  if (flag)
    mutual_test_4(flag);
}


x86 assembly (clang, -O0):
<mutual_test_3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <marker_C@plt>
cmpl   $0x0,-0x4(%rbp)
je     1144 <mutual_test_3+0x24>
mov    -0x4(%rbp),%edi
call   1030 <mutual_test_4@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mutual_test_3>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <marker_C@plt>
test   %ebx,%ebx
je     1136 <mutual_test_3+0x16>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <mutual_test_4@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @mutual_test_3(i32 %0) {
%2 = tail call i32 (...) @marker_C()
%3 = icmp eq i32 %0, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @mutual_test_4(i32 %0)
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
long long llrint(double);
long long int llrintl(long double x) { return llrint((double)x); }


x86 assembly (clang, -O0):
<llrintl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fstpl  -0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <llrint@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<llrintl>:
fldt   0x8(%rsp)
fstpl  -0x8(%rsp)
movsd  -0x8(%rsp),%xmm0
jmp    1030 <llrint@plt>

LLVM IR (-O0):
define i64 @llrintl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fptrunc x86_fp80 %3 to double
%5 = call i64 @llrint(double %4)
ret i64 %5
}

LLVM IR (-O2):
define i64 @llrintl(x86_fp80 %0) {
%2 = fptrunc x86_fp80 %0 to double
%3 = tail call i64 @llrint(double %2)
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ dict_hash_init();
int dict_init(void) {
  dict_hash_init();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @dict_init() {
%1 = call i32 (...) @dict_hash_init()
ret i32 0
}

LLVM IR (-O2):
define i32 @dict_init() {
%1 = tail call i32 (...) @dict_hash_init()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_open_config_file() {
  printf("NOT IMPLEMENTED:"
         "pa_open_config_file"
         "\n");
}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ set_rounding(int /*<<< orphan*/ const *);
void cvt_d_l(const uint32_t *fcr31, const int64_t *source, double *dest) {
  set_rounding(fcr31);
  *dest = (double)*source;
}


x86 assembly (clang, -O0):
<cvt_d_l>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <set_rounding@plt>
mov    -0x10(%rbp),%rax
cvtsi2sdq (%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cvt_d_l>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
call   1030 <set_rounding@plt>
cvtsi2sdq (%rbx),%xmm0
movsd  %xmm0,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @cvt_d_l(i32* %0, i64* %1, double* %2) {
%4 = alloca i32*
%5 = alloca i64*
%6 = alloca double*
store i32* %0, i32** %4
store i64* %1, i64** %5
store double* %2, double** %6
%7 = load i32*, i32** %4
%8 = call i32 @set_rounding(i32* %7)
%9 = load i64*, i64** %5
%10 = load i64, i64* %9
%11 = sitofp i64 %10 to double
%12 = load double*, double** %6
store double %11, double* %12
ret void
}

LLVM IR (-O2):
define void @cvt_d_l(i32* %0, i64* nocapture %1, double* nocapture writeonly %2) {
%4 = tail call i32 @set_rounding(i32* %0)
%5 = load i64, i64* %1
%6 = sitofp i64 %5 to double
store double %6, double* %2
ret void
}
void ctrlc_handler_dummy(void) {}


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

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

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

LLVM IR (-O2):
define void @ctrlc_handler_dummy() {
ret void
}
void foo024(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo024(i32 %0) {
ret void
}
void new_file(char *name, char *data) {}


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

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

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

LLVM IR (-O2):
define void @new_file(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
uint8_t u8min(uint8_t x, uint8_t y) { return x < y ? x : y; }


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

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

LLVM IR (-O0):
define i64 @u8min(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 slt i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i64, i64* %3
br label %12
10: ; preds = %2
%11 = load i64, i64* %4
br label %12
12: ; preds = %10, %8
%13 = phi i64 [ %9, %8 ], [ %11, %10 ]
ret i64 %13
}

LLVM IR (-O2):
define i64 @u8min(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
void FetchOpcode(FILE *fh, int Offset) {
  fprintf(fh, "Opcode = Z80_RD_OPCODE_BYTE(%d);\r\n", Offset);
}


x86 assembly (clang, -O0):
<FetchOpcode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xed3(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FetchOpcode>:
mov    %esi,%edx
lea    0xee7(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"Opcode = Z80_RD_OPCODE_BYTE(%d);\0D\0A\00"
define void @FetchOpcode(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %4
%7 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [35 x i8] c"Opcode = Z80_RD_OPCODE_BYTE(%d);\0D\0A\00"
define void @FetchOpcode(i32* nocapture %0, i32 %1) {
%3 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M165_f(char *s) {
  debug("M165_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M165_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M165_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M165_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M165_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M165_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M165_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Variables and functions */
double calerf(double, int);
double derfc(double x) { return (calerf(x, 1)); }


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

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

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

LLVM IR (-O2):
define double @derfc(double %0) {
%2 = tail call double @calerf(double %0, i32 1)
ret double %2
}
/* Variables and functions */
char *calloc(int /*<<< orphan*/, int);
void test_calloc(void) {
  char *foo = calloc(0, 42);
  for (unsigned i = 0; i < 100; i++) {
    foo[i] = 0;
  }
}


x86 assembly (clang, -O0):
<test_calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
mov    $0x2a,%esi
call   1030 <calloc@plt>
mov    %rax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x64,-0xc(%rbp)
jae    1152 <test_calloc+0x42>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
movb   $0x0,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112f <test_calloc+0x1f>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @test_calloc() {
%1 = alloca i8*
%2 = alloca i32
%3 = call i8* @calloc(i32 0, i32 42)
store i8* %3, i8** %1
store i32 0, i32* %2
br label %4
4: ; preds = %12, %0
%5 = load i32, i32* %2
%6 = icmp ult i32 %5, 100
br i1 %6, label %7, label %15
7: ; preds = %4
%8 = load i8*, i8** %1
%9 = load i32, i32* %2
%10 = zext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
store i8 0, i8* %11
br label %12
12: ; preds = %7
%13 = load i32, i32* %2
%14 = add i32 %13, 1
store i32 %14, i32* %2
br label %4
15: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @test_calloc() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ my_mergesort(char *, int /*<<< orphan*/, int, char *, int *);
int /*<<< orphan*/ strcpy(char *, char *);
int calc_inversion(char *seq, int len) {
  int total_inv = 0;
  char buf[100];
  char seq_copy[100];
  strcpy(seq_copy, seq);
  my_mergesort(seq_copy, 0, len, buf, &total_inv);
  return total_inv;
}


x86 assembly (clang, -O0):
<calc_inversion>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
lea    -0xf0(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0xf0(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    -0x80(%rbp),%rcx
xor    %esi,%esi
lea    -0x10(%rbp),%r8
call   1040 <my_mergesort@plt>
mov    -0x10(%rbp),%eax
add    $0xf0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_inversion>:
push   %r14
push   %rbx
sub    $0xe8,%rsp
mov    %esi,%ebx
mov    %rdi,%rsi
movl   $0x0,0xc(%rsp)
lea    0x10(%rsp),%r14
mov    %r14,%rdi
call   1030 <strcpy@plt>
lea    0x80(%rsp),%rcx
lea    0xc(%rsp),%r8
mov    %r14,%rdi
xor    %esi,%esi
mov    %ebx,%edx
call   1040 <my_mergesort@plt>
mov    0xc(%rsp),%eax
add    $0xe8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @calc_inversion(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca [100 x i8]
%7 = alloca [100 x i8]
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32 0, i32* %5
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%9 = load i8*, i8** %3
%10 = call i32 @strcpy(i8* %8, i8* %9)
%11 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%12 = load i32, i32* %4
%13 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%14 = call i32 @my_mergesort(i8* %11, i32 0, i32 %12, i8* %13, i32* %5)
%15 = load i32, i32* %5
ret i32 %15
}

LLVM IR (-O2):
define i32 @calc_inversion(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca [100 x i8]
%5 = alloca [100 x i8]
%6 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%9 = call i32 @strcpy(i8* %8, i8* %0)
%10 = call i32 @my_mergesort(i8* %8, i32 0, i32 %1, i8* %7, i32* %3)
%11 = load i32, i32* %3
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ Emit1(int);
void Emit4(int v) {
  Emit1(v & 255);
  Emit1((v >> 8) & 255);
  Emit1((v >> 16) & 255);
  Emit1((v >> 24) & 255);
}


x86 assembly (clang, -O0):
<Emit4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
and    $0xff,%edi
call   1030 <Emit1@plt>
mov    -0x4(%rbp),%edi
sar    $0x8,%edi
and    $0xff,%edi
call   1030 <Emit1@plt>
mov    -0x4(%rbp),%edi
sar    $0x10,%edi
and    $0xff,%edi
call   1030 <Emit1@plt>
mov    -0x4(%rbp),%edi
sar    $0x18,%edi
and    $0xff,%edi
call   1030 <Emit1@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Emit4>:
push   %rbx
mov    %edi,%ebx
movzbl %bl,%edi
call   1030 <Emit1@plt>
movzbl %bh,%edi
call   1030 <Emit1@plt>
mov    %ebx,%eax
shr    $0x10,%eax
movzbl %al,%edi
call   1030 <Emit1@plt>
shr    $0x18,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <Emit1@plt>

LLVM IR (-O0):
define void @Emit4(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 255
%5 = call i32 @Emit1(i32 %4)
%6 = load i32, i32* %2
%7 = ashr i32 %6, 8
%8 = and i32 %7, 255
%9 = call i32 @Emit1(i32 %8)
%10 = load i32, i32* %2
%11 = ashr i32 %10, 16
%12 = and i32 %11, 255
%13 = call i32 @Emit1(i32 %12)
%14 = load i32, i32* %2
%15 = ashr i32 %14, 24
%16 = and i32 %15, 255
%17 = call i32 @Emit1(i32 %16)
ret void
}

LLVM IR (-O2):
define void @Emit4(i32 %0) {
%2 = and i32 %0, 255
%3 = tail call i32 @Emit1(i32 %2)
%4 = lshr i32 %0, 8
%5 = and i32 %4, 255
%6 = tail call i32 @Emit1(i32 %5)
%7 = lshr i32 %0, 16
%8 = and i32 %7, 255
%9 = tail call i32 @Emit1(i32 %8)
%10 = lshr i32 %0, 24
%11 = tail call i32 @Emit1(i32 %10)
ret void
}
/* Variables and functions */
char *ckmalloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *savestr(const char *s) {
  char *p;
  p = ckmalloc(strlen(s) + 1);
  strcpy(p, s);
  return p;
}


x86 assembly (clang, -O0):
<savestr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <ckmalloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<savestr>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <ckmalloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @savestr(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i8* @ckmalloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = load i8*, i8** %2
%10 = call i32 @strcpy(i8* %8, i8* %9)
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define i8* @savestr(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @ckmalloc(i64 %3)
%5 = tail call i32 @strcpy(i8* %4, i8* %0)
ret i8* %4
}
void XFreeFontInfo() {}


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

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

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

LLVM IR (-O2):
define void @XFreeFontInfo() {
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int solcon_replace_dobldobl_solution(int n, int k, int m, double *sol) {
  int b[2], fail;
  b[0] = n;
  b[1] = m;
  fail = _ada_use_c2phc(345, &k, b, sol);
  return fail;
}


x86 assembly (clang, -O0):
<solcon_replace_dobldobl_solution>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
lea    -0x20(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x159,%edi
lea    -0x8(%rbp),%rsi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solcon_replace_dobldobl_solution>:
sub    $0x18,%rsp
mov    %esi,0xc(%rsp)
mov    %edi,0x10(%rsp)
mov    %edx,0x14(%rsp)
lea    0xc(%rsp),%rsi
lea    0x10(%rsp),%rdx
mov    $0x159,%edi
call   1030 <_ada_use_c2phc@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @solcon_replace_dobldobl_solution(i32 %0, i32 %1, i32 %2, double* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca double*
%9 = alloca [2 x i32]
%10 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store double* %3, double** %8
%11 = load i32, i32* %5
%12 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 0
store i32 %11, i32* %12
%13 = load i32, i32* %7
%14 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 1
store i32 %13, i32* %14
%15 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 0
%16 = load double*, double** %8
%17 = call i32 @_ada_use_c2phc(i32 345, i32* %6, i32* %15, double* %16)
store i32 %17, i32* %10
%18 = load i32, i32* %10
ret i32 %18
}

LLVM IR (-O2):
define i32 @solcon_replace_dobldobl_solution(i32 %0, i32 %1, i32 %2, double* %3) {
%5 = alloca i32
%6 = alloca [2 x i32]
store i32 %1, i32* %5
%7 = bitcast [2 x i32]* %6 to i8*
%8 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
store i32 %0, i32* %8
%9 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 1
store i32 %2, i32* %9
%10 = call i32 @_ada_use_c2phc(i32 345, i32* %5, i32* %8, double* %3)
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_z95() {
  printf(
      "        __..,,-----l\"|-.\n    __/\"__  |----\"\"  |  i--voo..,,__\n "
      ".-'=|:|/\\|-------o.,,,---. Y88888888o,,_\n_+=:_|_|__|_|   ___|__|___-| "
      " \"\"\"\"````\"\"\"`----------.........___\n__============:' \"\" "
      "|==|__\\===========(=>=+    |           ,_, .-\"`--..._\n  ;=\"|\"|  "
      "|\"| `.____|__|__/===========(=>=+----+===-|---------<---------_=-\n | "
      "==|:|\\/| |   | o|.-'__,-|   .'  _______|o  `----'|        __\\ "
      "__,.-'\"\n  \"`--\"\"`--\"'\"\"\"`.-+------'\" .'  "
      "_L___,,...-----------\"\"\"\"\"\"\"   \"\n                  "
      "`------\"\"\"\"\"\"\"\"\n\n");
}


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

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

LLVM IR (-O0):
@.str = [494 x i8] c" __..,,-----l\22|-.\0A __/\22__ |----\22\22 | i--voo..,,__\0A .-'=|:|/\\|-------o.,,,---. Y88888888o,,_\0A_+=:_|_|__|_| ___|__|___-| \22\22\22\22````\22\22\22`----------.........___\0A__============:' \22\22 |==|__\\===========(=>=+ | ,_, .-\22`--..._\0A ;=\22|\22| |\22| `.____|__|__/===========(=>=+----+===-|---------<---------_=-\0A | ==|:|\\/| | | o|.-'__,-| .' _______|o `----'| __\\ __,.-'\22\0A \22`--\22\22`--\22'\22\22\22`.-+------'\22 .' _L___,,...-----------\22\22\22\22\22\22\22 \22\0A `------\22\22\22\22\22\22\22\22\0A\0A\00"
define void @print_z95() {
%1 = call i32 @printf(i8* getelementptr inbounds ([494 x i8], [494 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [493 x i8] c" __..,,-----l\22|-.\0A __/\22__ |----\22\22 | i--voo..,,__\0A .-'=|:|/\\|-------o.,,,---. Y88888888o,,_\0A_+=:_|_|__|_| ___|__|___-| \22\22\22\22````\22\22\22`----------.........___\0A__============:' \22\22 |==|__\\===========(=>=+ | ,_, .-\22`--..._\0A ;=\22|\22| |\22| `.____|__|__/===========(=>=+----+===-|---------<---------_=-\0A | ==|:|\\/| | | o|.-'__,-| .' _______|o `----'| __\\ __,.-'\22\0A \22`--\22\22`--\22'\22\22\22`.-+------'\22 .' _L___,,...-----------\22\22\22\22\22\22\22 \22\0A `------\22\22\22\22\22\22\22\22\0A\00"
define void @print_z95() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([493 x i8], [493 x i8]* @str, i64 0, i64 0))
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ *gregs;
};
struct TYPE_4__ {
  TYPE_1__ uc_mcontext;
};
typedef TYPE_2__ ucontext_t;
struct siginfo {
  int dummy;
};

/* Variables and functions */
int PROT_READ;
int PROT_WRITE;
int /*<<< orphan*/ mprotect(char *, int, int);
void sig_segv_handler(int signo, struct siginfo *si, void *ctx) {
  mprotect((char *)(((ucontext_t *)ctx)->uc_mcontext.gregs[8]), 4096,
           PROT_READ | PROT_WRITE);
}


x86 assembly (clang, -O0):
<sig_segv_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    0x40(%rax),%rdi
mov    0x2ec3(%rip),%rax
mov    (%rax),%edx
mov    0x2e9a(%rip),%rax
or     (%rax),%edx
mov    $0x1000,%esi
call   1030 <mprotect@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_segv_handler>:
mov    (%rdx),%rax
mov    0x40(%rax),%rdi
mov    0x2eda(%rip),%rax
mov    0x2eb3(%rip),%rcx
mov    (%rcx),%edx
or     (%rax),%edx
mov    $0x1000,%esi
jmp    1030 <mprotect@plt>

LLVM IR (-O0):
%struct.siginfo = type { i32 }
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64* }
@PROT_READ = global i32 0
@PROT_WRITE = global i32 0
define void @sig_segv_handler(i32 %0, %struct.siginfo* %1, i8* %2) {
%4 = alloca i32
%5 = alloca %struct.siginfo*
%6 = alloca i8*
store i32 %0, i32* %4
store %struct.siginfo* %1, %struct.siginfo** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %6
%8 = bitcast i8* %7 to %struct.TYPE_4__*
%9 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %8, i32 0, i32 0
%10 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %9, i32 0, i32 0
%11 = load i64*, i64** %10
%12 = getelementptr inbounds i64, i64* %11, i64 8
%13 = load i64, i64* %12
%14 = inttoptr i64 %13 to i8*
%15 = load i32, i32* @PROT_READ
%16 = load i32, i32* @PROT_WRITE
%17 = or i32 %15, %16
%18 = call i32 @mprotect(i8* %14, i32 4096, i32 %17)
ret void
}

LLVM IR (-O2):
%struct.siginfo = type { i32 }
@PROT_READ = global i32 0
@PROT_WRITE = global i32 0
define void @sig_segv_handler(i32 %0, %struct.siginfo* nocapture readnone %1, i8* nocapture %2) {
%4 = bitcast i8* %2 to i64**
%5 = load i64*, i64** %4
%6 = getelementptr inbounds i64, i64* %5, i64 8
%7 = load i64, i64* %6
%8 = inttoptr i64 %7 to i8*
%9 = load i32, i32* @PROT_READ
%10 = load i32, i32* @PROT_WRITE
%11 = or i32 %10, %9
%12 = tail call i32 @mprotect(i8* %8, i32 4096, i32 %11)
ret void
}
void _src_iter_process_tab(unsigned *back_column, const char *current,
                           unsigned tab_size) {
  unsigned d =
      (unsigned)((unsigned long long)(current - (const char *)0) & ~0u);
  d = ~0u - (d - *back_column - 1);
  (*back_column) -= d % tab_size;
}


x86 assembly (clang, -O0):
<_src_iter_process_tab>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
sub    $0x0,%rax
movabs $0xffffffff,%rcx
and    %rcx,%rax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%ecx
mov    -0x8(%rbp),%rax
sub    (%rax),%ecx
sub    $0x1,%ecx
mov    $0xffffffff,%eax
sub    %ecx,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
xor    %edx,%edx
divl   -0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
sub    %edx,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<_src_iter_process_tab>:
mov    %edx,%r8d
mov    (%rdi),%ecx
mov    %ecx,%eax
sub    %esi,%eax
xor    %edx,%edx
div    %r8d
sub    %edx,%ecx
mov    %ecx,(%rdi)
ret

LLVM IR (-O0):
define void @_src_iter_process_tab(i32* %0, i8* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i8*, i8** %5
%9 = ptrtoint i8* %8 to i64
%10 = sub i64 %9, 0
%11 = and i64 %10, 4294967295
%12 = trunc i64 %11 to i32
store i32 %12, i32* %7
%13 = load i32, i32* %7
%14 = load i32*, i32** %4
%15 = load i32, i32* %14
%16 = sub i32 %13, %15
%17 = sub i32 %16, 1
%18 = sub i32 -1, %17
store i32 %18, i32* %7
%19 = load i32, i32* %7
%20 = load i32, i32* %6
%21 = urem i32 %19, %20
%22 = load i32*, i32** %4
%23 = load i32, i32* %22
%24 = sub i32 %23, %21
store i32 %24, i32* %22
ret void
}

LLVM IR (-O2):
define void @_src_iter_process_tab(i32* nocapture %0, i8* %1, i32 %2) {
%4 = ptrtoint i8* %1 to i64
%5 = trunc i64 %4 to i32
%6 = load i32, i32* %0
%7 = sub i32 %6, %5
%8 = urem i32 %7, %2
%9 = sub i32 %6, %8
store i32 %9, i32* %0
ret void
}
unsigned hash(char *s, unsigned int size) {
  unsigned hashval;
  for (hashval = 0; *s != '\0'; s++) {
    hashval = *s + 31 * hashval;
  }
  return hashval % size;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1143 <hash+0x43>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
imul   $0x1f,-0x10(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1112 <hash+0x12>
mov    -0x10(%rbp),%eax
xor    %edx,%edx
divl   -0xc(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1129 <hash+0x29>
add    $0x1,%rdi
xor    %edx,%edx
mov    %edx,%eax
xchg   %ax,%ax
movsbl %cl,%ecx
shl    $0x5,%eax
sub    %edx,%eax
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
mov    %eax,%edx
test   %cl,%cl
jne    1110 <hash+0x10>
jmp    112b <hash+0x2b>
xor    %eax,%eax
xor    %edx,%edx
div    %esi
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @hash(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %13, %5 ], [ %3, %2 ]
%7 = phi i32 [ %11, %5 ], [ 0, %2 ]
%8 = phi i8* [ %12, %5 ], [ %0, %2 ]
%9 = sext i8 %6 to i32
%10 = mul i32 %7, 31
%11 = add i32 %10, %9
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %2
%16 = phi i32 [ 0, %2 ], [ %11, %5 ]
%17 = urem i32 %16, %1
ret i32 %17
}
double Sleef_exp_u10(double x) { return __builtin_exp(x); }


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

x86 assembly (clang, -O2):
<Sleef_exp_u10>:
jmp    1030 <exp@plt>

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

LLVM IR (-O2):
define double @Sleef_exp_u10(double %0) {
%2 = tail call double @exp(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void printUsage() {
  printf("Usage: testmemdump <1|2|3|4|5|6>\n");
  exit(1);
}


x86 assembly (clang, -O0):
<printUsage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<printUsage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"Usage: testmemdump <1|2|3|4|5|6>\0A\00"
define void @printUsage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [33 x i8] c"Usage: testmemdump <1|2|3|4|5|6>\00"
define void @printUsage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void onDisconnectHandler(const char *ip) {
  printf("Client %s disconnected\n", ip);
}


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

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

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

LLVM IR (-O2):
@.str = [24 x i8] c"Client %s disconnected\0A\00"
define void @onDisconnectHandler(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int main(void) {
  double x;
  x = 3.1415;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movsd  0xeed(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca double
store i32 0, i32* %1
store double 3.141500e+00, double* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t next_power_of_two(uint64_t v) {
  v--;
  v |= v >> 1;
  v |= v >> 2;
  v |= v >> 4;
  v |= v >> 8;
  v |= v >> 16;
  v |= v >> 32;
  return ++v;
}


x86 assembly (clang, -O0):
<next_power_of_two>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x2,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x4,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x20,%ecx
sar    %cl,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @next_power_of_two(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, -1
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = ashr i32 %5, 1
%7 = load i32, i32* %2
%8 = or i32 %7, %6
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = ashr i32 %9, 2
%11 = load i32, i32* %2
%12 = or i32 %11, %10
store i32 %12, i32* %2
%13 = load i32, i32* %2
%14 = ashr i32 %13, 4
%15 = load i32, i32* %2
%16 = or i32 %15, %14
store i32 %16, i32* %2
%17 = load i32, i32* %2
%18 = ashr i32 %17, 8
%19 = load i32, i32* %2
%20 = or i32 %19, %18
store i32 %20, i32* %2
%21 = load i32, i32* %2
%22 = ashr i32 %21, 16
%23 = load i32, i32* %2
%24 = or i32 %23, %22
store i32 %24, i32* %2
%25 = load i32, i32* %2
%26 = ashr i32 %25, 32
%27 = load i32, i32* %2
%28 = or i32 %27, %26
store i32 %28, i32* %2
%29 = load i32, i32* %2
%30 = add nsw i32 %29, 1
store i32 %30, i32* %2
ret i32 %30
}

LLVM IR (-O2):
define i32 @next_power_of_two(i32 %0) {
ret i32 poison
}
/* Variables and functions */
int /*<<< orphan*/ adjust_temp0();
int /*<<< orphan*/ adjust_temp1();
void adjust() {
  adjust_temp0();
  adjust_temp1();
}


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

x86 assembly (clang, -O2):
<adjust>:
push   %rax
xor    %eax,%eax
call   1030 <adjust_temp0@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <adjust_temp1@plt>

LLVM IR (-O0):
define void @adjust() {
%1 = call i32 (...) @adjust_temp0()
%2 = call i32 (...) @adjust_temp1()
ret void
}

LLVM IR (-O2):
define void @adjust() {
%1 = tail call i32 (...) @adjust_temp0()
%2 = tail call i32 (...) @adjust_temp1()
ret void
}
/* Variables and functions */
scalar_t__ isascii(int);
scalar_t__ isupper(int);
int utf32_isupper(int c) { return isascii(c) && isupper(c); }


x86 assembly (clang, -O0):
<utf32_isupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <isascii@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
je     1157 <utf32_isupper+0x37>
mov    -0x4(%rbp),%edi
call   1030 <isupper@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<utf32_isupper>:
push   %rbx
mov    %edi,%ebx
call   1040 <isascii@plt>
test   %rax,%rax
je     1141 <utf32_isupper+0x21>
mov    %ebx,%edi
call   1030 <isupper@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @utf32_isupper(i32 %0) {
%2 = tail call i64 @isascii(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i64 @isupper(i32 %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ output_line(char *);
void gen_multiply_by_two(void) { output_line("dad \th"); }


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"dad \09h\00"
define void @gen_multiply_by_two() {
%1 = call i32 @output_line(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"dad \09h\00"
define void @gen_multiply_by_two() {
%1 = tail call i32 @output_line(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
char getch();
scalar_t__ iscntrl(char);
char *control(void) {
  char ch;
  ch = getch();
  if (iscntrl(ch))
    return "Yes";
  else
    return "No";
}


x86 assembly (clang, -O0):
<control>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <getch@plt>
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%edi
call   1030 <iscntrl@plt>
cmp    $0x0,%rax
je     1155 <control+0x35>
lea    0xeb4(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1160 <control+0x40>
lea    0xea8(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<control>:
push   %rax
xor    %eax,%eax
call   1040 <getch@plt>
movsbl %al,%edi
call   1030 <iscntrl@plt>
test   %rax,%rax
lea    0xeca(%rip),%rcx
lea    0xebf(%rip),%rax
cmove  %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"Yes\00"
@.str.1 = [3 x i8] c"No\00"
define i8* @control() {
%1 = alloca i8*
%2 = alloca i8
%3 = call signext i8 (...) @getch()
store i8 %3, i8* %2
%4 = load i8, i8* %2
%5 = call i64 @iscntrl(i8 signext %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %0
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %1
br label %9
8: ; preds = %0
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %1
br label %9
9: ; preds = %8, %7
%10 = load i8*, i8** %1
ret i8* %10
}

LLVM IR (-O2):
@.str = [4 x i8] c"Yes\00"
@.str.1 = [3 x i8] c"No\00"
define i8* @control() {
%1 = tail call signext i8 (...) @getch()
%2 = tail call i64 @iscntrl(i8 signext %1)
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
ret i8* %4
}
int b(int c) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @b(i32 %0) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
char *strdup(char const *);
char *stralloc(const char *str) {
  char *n;
  n = strdup(str);
  if (n)
    return n;
  perror("malloc");
  exit(1);
}


x86 assembly (clang, -O0):
<stralloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strdup@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     115e <stralloc+0x2e>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret
lea    0xe9b(%rip),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<stralloc>:
push   %rax
call   1050 <strdup@plt>
test   %rax,%rax
je     113d <stralloc+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"malloc\00"
define i8* @stralloc(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strdup(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i8*, i8** %3
ret i8* %9
10: ; preds = %1
%11 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [7 x i8] c"malloc\00"
define noalias i8* @stralloc(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %5, label %4
4: ; preds = %1
ret i8* %2
5: ; preds = %1
%6 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ console_print(char *);
void console_printnl(char *str) {
  console_print(str);
  console_print("\n");
}


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

x86 assembly (clang, -O2):
<console_printnl>:
push   %rax
call   1030 <console_print@plt>
lea    0xee3(%rip),%rdi
pop    %rax
jmp    1030 <console_print@plt>

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

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