xunge/DecIR huggingface dataset:
/* Type definitions */
struct battle_char {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ charge_generic(struct battle_char *, struct battle_char *,
                                  int);
void charge5(struct battle_char *origin, struct battle_char *target) {
  charge_generic(origin, target, 5);
}


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

x86 assembly (clang, -O2):
<charge5>:
mov    $0x5,%edx
jmp    1030 <charge_generic@plt>

LLVM IR (-O0):
%struct.battle_char = type { i32 }
define void @charge5(%struct.battle_char* %0, %struct.battle_char* %1) {
%3 = alloca %struct.battle_char*
%4 = alloca %struct.battle_char*
store %struct.battle_char* %0, %struct.battle_char** %3
store %struct.battle_char* %1, %struct.battle_char** %4
%5 = load %struct.battle_char*, %struct.battle_char** %3
%6 = load %struct.battle_char*, %struct.battle_char** %4
%7 = call i32 @charge_generic(%struct.battle_char* %5, %struct.battle_char* %6, i32 5)
ret void
}

LLVM IR (-O2):
%struct.battle_char = type { i32 }
define void @charge5(%struct.battle_char* %0, %struct.battle_char* %1) {
%3 = tail call i32 @charge_generic(%struct.battle_char* %0, %struct.battle_char* %1, i32 5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ send_command(int);
void target_stop(void) { send_command(0x24); }


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

x86 assembly (clang, -O2):
<target_stop>:
mov    $0x24,%edi
jmp    1030 <send_command@plt>

LLVM IR (-O0):
define void @target_stop() {
%1 = call i32 @send_command(i32 36)
ret void
}

LLVM IR (-O2):
define void @target_stop() {
%1 = tail call i32 @send_command(i32 36)
ret void
}
unsigned long int cast_long_ulong_fast(long int x) {
  return (unsigned long int)x;
}


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

x86 assembly (clang, -O2):
<cast_long_ulong_fast>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @cast_long_ulong_fast(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
ret i64 %3
}

LLVM IR (-O2):
define i64 @cast_long_ulong_fast(i64 returned %0) {
ret i64 %0
}
int Heap_roundup(int size) {
  static int multsize = 4 * sizeof(int);
  if (size % multsize != 0)
    size += multsize - (size % multsize);
  return size;
}


x86 assembly (clang, -O0):
<Heap_roundup>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  0x2f0f(%rip)
cmp    $0x0,%edx
je     1138 <Heap_roundup+0x38>
mov    0x2f00(%rip),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  0x2ef3(%rip)
mov    -0x8(%rbp),%eax
sub    %edx,%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Heap_roundup>:
lea    0xf(%rdi),%eax
test   %edi,%edi
cmovns %edi,%eax
and    $0xfffffff0,%eax
mov    %edi,%ecx
sub    %eax,%ecx
mov    $0x10,%eax
sub    %ecx,%eax
test   %ecx,%ecx
cmove  %ecx,%eax
add    %edi,%eax
ret

LLVM IR (-O0):
@Heap_roundup.multsize = internal global i32 16
define i32 @Heap_roundup(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @Heap_roundup.multsize
%5 = srem i32 %3, %4
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %15
7: ; preds = %1
%8 = load i32, i32* @Heap_roundup.multsize
%9 = load i32, i32* %2
%10 = load i32, i32* @Heap_roundup.multsize
%11 = srem i32 %9, %10
%12 = sub nsw i32 %8, %11
%13 = load i32, i32* %2
%14 = add nsw i32 %13, %12
store i32 %14, i32* %2
br label %15
15: ; preds = %7, %1
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @Heap_roundup(i32 %0) {
%2 = srem i32 %0, 16
%3 = icmp eq i32 %2, 0
%4 = sub nsw i32 16, %2
%5 = select i1 %3, i32 0, i32 %4
%6 = add nsw i32 %5, %0
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void displayMenu() {
  char *menuStr = "********** MENU **********\n"
                  "0 - exit\n"
                  "1 - read content from file\n"
                  "2 - write content to file\n"
                  "**************************\n";
  puts(menuStr);
}


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

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

LLVM IR (-O0):
@.str = [117 x i8] c"********** MENU **********\0A0 - exit\0A1 - read content from file\0A2 - write content to file\0A**************************\0A\00"
define void @displayMenu() {
%1 = alloca i8*
store i8* getelementptr inbounds ([117 x i8], [117 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = load i8*, i8** %1
%3 = call i32 @puts(i8* %2)
ret void
}

LLVM IR (-O2):
@.str = [117 x i8] c"********** MENU **********\0A0 - exit\0A1 - read content from file\0A2 - write content to file\0A**************************\0A\00"
define void @displayMenu() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([117 x i8], [117 x i8]* @.str, i64 0, i64 0))
ret void
}
int arch_rand_seed(unsigned long *seed) {
  unsigned char ok;
  asm volatile(".byte 0x48,0x0f,0xc7,0xf8"
               "\n\t"
               "setc %0"
               : "=qm"(ok), "=a"(*seed));
  return 0;
}


x86 assembly (clang, -O0):
<arch_rand_seed>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
rdseed %rax
setb   -0x9(%rbp)
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<arch_rand_seed>:
rdseed %rax
setb   -0x1(%rsp)
mov    %rax,(%rdi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @arch_rand_seed(i64* %0) {
%2 = alloca i64*
%3 = alloca i8
store i64* %0, i64** %2
%4 = load i64*, i64** %2
%5 = call i64 asm sideeffect ".byte 0x48,0x0f,0xc7,0xf8\0A\09setc $0", "=*qm,={ax},~{dirflag},~{fpsr},~{flags}"(i8* elementtype(i8) %3)
store i64 %5, i64* %4
ret i32 0
}

LLVM IR (-O2):
define i32 @arch_rand_seed(i64* nocapture writeonly %0) {
%2 = alloca i8
%3 = call i64 asm sideeffect ".byte 0x48,0x0f,0xc7,0xf8\0A\09setc $0", "=*qm,={ax},~{dirflag},~{fpsr},~{flags}"(i8* elementtype(i8) %2)
store i64 %3, i64* %0
ret i32 0
}
/* Type definitions */
struct timespec {
  long tv_sec;
  long tv_nsec;
};

/* Variables and functions */
struct timespec us_to_tspec(long us) {
  struct timespec ts;
  ts.tv_sec = us / 1000000;
  ts.tv_nsec = (us % 1000000) * 1000;
  return ts;
}


x86 assembly (clang, -O0):
<us_to_tspec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movabs $0x431bde82d7b634db,%rcx
de 1b 43
imul   %rcx
mov    %rdx,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x12,%rax
add    %rdx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
imul   %rcx
mov    -0x20(%rbp),%rax
mov    %rdx,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x12,%rcx
add    %rdx,%rcx
imul   $0xf4240,%rcx,%rcx
sub    %rcx,%rax
imul   $0x3e8,%rax,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
pop    %rbp
ret

x86 assembly (clang, -O2):
<us_to_tspec>:
movabs $0x431bde82d7b634db,%rcx
de 1b 43
mov    %rdi,%rax
imul   %rcx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x12,%rdx
add    %rdx,%rax
imul   $0xf4240,%rax,%rcx
sub    %rcx,%rdi
imul   $0x3e8,%rdi,%rdx
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
define { i64, i64 } @us_to_tspec(i64 %0) {
%2 = alloca %struct.timespec
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = sdiv i64 %4, 1000000
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 0
store i64 %5, i64* %6
%7 = load i64, i64* %3
%8 = srem i64 %7, 1000000
%9 = mul nsw i64 %8, 1000
%10 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 1
store i64 %9, i64* %10
%11 = bitcast %struct.timespec* %2 to { i64, i64 }*
%12 = load { i64, i64 }, { i64, i64 }* %11
ret { i64, i64 } %12
}

LLVM IR (-O2):
define { i64, i64 } @us_to_tspec(i64 %0) {
%2 = sdiv i64 %0, 1000000
%3 = srem i64 %0, 1000000
%4 = mul nsw i64 %3, 1000
%5 = insertvalue { i64, i64 } poison, i64 %2, 0
%6 = insertvalue { i64, i64 } %5, i64 %4, 1
ret { i64, i64 } %6
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int syscon_degree_of_dobldobl_polynomial(int k, int *d) {
  int fail;
  double *c;
  fail = _ada_use_c2phc4c(339, &k, d, c, 0);
  return fail;
}


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

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

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

LLVM IR (-O2):
define i32 @syscon_degree_of_dobldobl_polynomial(i32 %0, i32* %1) {
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 @_ada_use_c2phc4c(i32 339, i32* %3, i32* %1, double* undef, i32 0)
ret i32 %4
}
/* Variables and functions */
int popop2(int *);
int popop() {
  int v2;
  return popop2(&v2);
}


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

x86 assembly (clang, -O2):
<popop>:
push   %rax
lea    0x4(%rsp),%rdi
call   1030 <popop2@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @popop() {
%1 = alloca i32
%2 = call i32 @popop2(i32* %1)
ret i32 %2
}

LLVM IR (-O2):
define i32 @popop() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @popop2(i32* %1)
ret i32 %3
}
void chk_svg_lines(void) {}


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

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

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

LLVM IR (-O2):
define void @chk_svg_lines() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clearEEPROM();
int /*<<< orphan*/ convertImageScreen();
int /*<<< orphan*/ firstFormat();
int /*<<< orphan*/ firstStartComplete();
int /*<<< orphan*/ stdEEPROMSet();
int /*<<< orphan*/ tempFormatScreen();
int /*<<< orphan*/ timeDateScreen();
int /*<<< orphan*/ visualImageScreen();
int /*<<< orphan*/ welcomeScreen();
void firstStart() {
  clearEEPROM();
  welcomeScreen();
  timeDateScreen();
  tempFormatScreen();
  convertImageScreen();
  visualImageScreen();
  firstFormat();
  stdEEPROMSet();
  firstStartComplete();
}


x86 assembly (clang, -O0):
<firstStart>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <clearEEPROM@plt>
mov    $0x0,%al
call   1030 <welcomeScreen@plt>
mov    $0x0,%al
call   1040 <timeDateScreen@plt>
mov    $0x0,%al
call   1090 <tempFormatScreen@plt>
mov    $0x0,%al
call   1080 <convertImageScreen@plt>
mov    $0x0,%al
call   1070 <visualImageScreen@plt>
mov    $0x0,%al
call   1060 <firstFormat@plt>
mov    $0x0,%al
call   10a0 <stdEEPROMSet@plt>
mov    $0x0,%al
call   10b0 <firstStartComplete@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<firstStart>:
push   %rax
xor    %eax,%eax
call   1050 <clearEEPROM@plt>
xor    %eax,%eax
call   1030 <welcomeScreen@plt>
xor    %eax,%eax
call   1040 <timeDateScreen@plt>
xor    %eax,%eax
call   1090 <tempFormatScreen@plt>
xor    %eax,%eax
call   1080 <convertImageScreen@plt>
xor    %eax,%eax
call   1070 <visualImageScreen@plt>
xor    %eax,%eax
call   1060 <firstFormat@plt>
xor    %eax,%eax
call   10a0 <stdEEPROMSet@plt>
xor    %eax,%eax
pop    %rcx
jmp    10b0 <firstStartComplete@plt>

LLVM IR (-O0):
define void @firstStart() {
%1 = call i32 (...) @clearEEPROM()
%2 = call i32 (...) @welcomeScreen()
%3 = call i32 (...) @timeDateScreen()
%4 = call i32 (...) @tempFormatScreen()
%5 = call i32 (...) @convertImageScreen()
%6 = call i32 (...) @visualImageScreen()
%7 = call i32 (...) @firstFormat()
%8 = call i32 (...) @stdEEPROMSet()
%9 = call i32 (...) @firstStartComplete()
ret void
}

LLVM IR (-O2):
define void @firstStart() {
%1 = tail call i32 (...) @clearEEPROM()
%2 = tail call i32 (...) @welcomeScreen()
%3 = tail call i32 (...) @timeDateScreen()
%4 = tail call i32 (...) @tempFormatScreen()
%5 = tail call i32 (...) @convertImageScreen()
%6 = tail call i32 (...) @visualImageScreen()
%7 = tail call i32 (...) @firstFormat()
%8 = tail call i32 (...) @stdEEPROMSet()
%9 = tail call i32 (...) @firstStartComplete()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fun(double, double, char);
int main() {
  fun(23.333, 3.14, 'a');
  fun(24.444, 2.78, 'b');
  fun(42.222, 1.414, 'c');
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movsd  0xf04(%rip),%xmm0
movsd  0xf04(%rip),%xmm1
mov    $0x61,%edi
call   1030 <fun@plt>
movsd  0xeda(%rip),%xmm0
movsd  0xeda(%rip),%xmm1
mov    $0x62,%edi
call   1030 <fun@plt>
movsd  0xeb0(%rip),%xmm0
movsd  0xeb0(%rip),%xmm1
mov    $0x63,%edi
call   1030 <fun@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xee7(%rip),%xmm0
movsd  0xee7(%rip),%xmm1
mov    $0x61,%edi
call   1030 <fun@plt>
movsd  0xedd(%rip),%xmm0
movsd  0xedd(%rip),%xmm1
mov    $0x62,%edi
call   1030 <fun@plt>
movsd  0xed3(%rip),%xmm0
movsd  0xed3(%rip),%xmm1
mov    $0x63,%edi
call   1030 <fun@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @fun(double 2.333300e+01, double 3.140000e+00, i8 signext 97)
%2 = call i32 @fun(double 2.444400e+01, double 2.780000e+00, i8 signext 98)
%3 = call i32 @fun(double 4.222200e+01, double 1.414000e+00, i8 signext 99)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @fun(double 2.333300e+01, double 3.140000e+00, i8 signext 97)
%2 = tail call i32 @fun(double 2.444400e+01, double 2.780000e+00, i8 signext 98)
%3 = tail call i32 @fun(double 4.222200e+01, double 1.414000e+00, i8 signext 99)
ret i32 0
}
/* Variables and functions */
int pathcon_nm10_f0(double const **, double **, int *, double *, int);
int pathcon_nm10(const double **arg, double **res, int *iw, double *w,
                 int mem) {
  return pathcon_nm10_f0(arg, res, iw, w, mem);
}


x86 assembly (clang, -O0):
<pathcon_nm10>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x24(%rbp),%r8d
call   1030 <pathcon_nm10_f0@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pathcon_nm10>:
jmp    1030 <pathcon_nm10_f0@plt>

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

LLVM IR (-O2):
define i32 @pathcon_nm10(double** %0, double** %1, i32* %2, double* %3, i32 %4) {
%6 = tail call i32 @pathcon_nm10_f0(double** %0, double** %1, i32* %2, double* %3, i32 %4)
ret i32 %6
}
/* Variables and functions */
double arc_length(double, double, double, double, double);
double arc_length_km(double lat1, double lon1, double lat2, double lon2) {
  return arc_length(lat1, lon1, lat2, lon2, 6371.228);
}


x86 assembly (clang, -O0):
<arc_length_km>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
movsd  0xeb8(%rip),%xmm4
call   1030 <arc_length@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arc_length_km>:
movsd  0xee8(%rip),%xmm4
jmp    1030 <arc_length@plt>

LLVM IR (-O0):
define double @arc_length_km(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %5
%10 = load double, double* %6
%11 = load double, double* %7
%12 = load double, double* %8
%13 = call double @arc_length(double %9, double %10, double %11, double %12, double 0x40B8E33A5E353F7D)
ret double %13
}

LLVM IR (-O2):
define double @arc_length_km(double %0, double %1, double %2, double %3) {
%5 = tail call double @arc_length(double %0, double %1, double %2, double %3, double 0x40B8E33A5E353F7D)
ret double %5
}
/* Type definitions */
struct vec2 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ vec2_multiply(float *, float *, float *);
__attribute__((always_)) struct vec2 *
psvec2_multiply(struct vec2 *result, struct vec2 *a, struct vec2 *b) {
  vec2_multiply((float *)result, (float *)a, (float *)b);
  return result;
}


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

x86 assembly (clang, -O2):
<psvec2_multiply>:
push   %rbx
mov    %rdi,%rbx
call   1030 <vec2_multiply@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.vec2 = type { i32 }
define %struct.vec2* @psvec2_multiply(%struct.vec2* %0, %struct.vec2* %1, %struct.vec2* %2) {
%4 = alloca %struct.vec2*
%5 = alloca %struct.vec2*
%6 = alloca %struct.vec2*
store %struct.vec2* %0, %struct.vec2** %4
store %struct.vec2* %1, %struct.vec2** %5
store %struct.vec2* %2, %struct.vec2** %6
%7 = load %struct.vec2*, %struct.vec2** %4
%8 = bitcast %struct.vec2* %7 to float*
%9 = load %struct.vec2*, %struct.vec2** %5
%10 = bitcast %struct.vec2* %9 to float*
%11 = load %struct.vec2*, %struct.vec2** %6
%12 = bitcast %struct.vec2* %11 to float*
%13 = call i32 @vec2_multiply(float* %8, float* %10, float* %12)
%14 = load %struct.vec2*, %struct.vec2** %4
ret %struct.vec2* %14
}

LLVM IR (-O2):
%struct.vec2 = type { i32 }
define %struct.vec2* @psvec2_multiply(%struct.vec2* returned %0, %struct.vec2* %1, %struct.vec2* %2) {
%4 = bitcast %struct.vec2* %0 to float*
%5 = bitcast %struct.vec2* %1 to float*
%6 = bitcast %struct.vec2* %2 to float*
%7 = tail call i32 @vec2_multiply(float* %4, float* %5, float* %6)
ret %struct.vec2* %0
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *);
void handler2(int signo) {
  printf("in handler2\n");
  fflush(NULL);
}


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

x86 assembly (clang, -O2):
<handler2>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <fflush@plt>

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

LLVM IR (-O2):
@str = [12 x i8] c"in handler2\00"
define void @handler2(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @fflush(i32* null)
ret void
}
int main() {
  int a[3] = {0};
  if (a == &a[0]) {
    if (a == &a) {
      return 0;
    }
    return 1;
  }
  return 2;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x i32]
store i32 0, i32* %1
%3 = bitcast [3 x i32]* %2 to i8*
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int fda_flush(struct fda_state *state) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.fda_state = type opaque
define i32 @fda_flush(%struct.fda_state* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _putc(int /*<<< orphan*/);
void _puts(const char *s) {
  while (*s) {
    _putc(*s++);
  }
}


x86 assembly (clang, -O0):
<_puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <_puts+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <_putc@plt>
jmp    111c <_puts+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_puts>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <_puts+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <_putc@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <_puts+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @_puts(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %7, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = icmp ne i8 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %3
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i32 1
store i8* %9, i8** %2
%10 = load i8, i8* %8
%11 = sext i8 %10 to i32
%12 = call i32 @_putc(i32 %11)
br label %3
13: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @_puts(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 @_putc(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
void outw(unsigned short b, unsigned long int port) {
  *((volatile unsigned short *)((0x7c000000 + ((port) << 0)))) = b;
}


x86 assembly (clang, -O0):
<outw>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x2(%rbp),%cx
mov    -0x10(%rbp),%rax
shl    $0x0,%rax
add    $0x7c000000,%rax
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outw>:
mov    %di,0x7c000000(%rsi)
ret

LLVM IR (-O0):
define void @outw(i16 zeroext %0, i64 %1) {
%3 = alloca i16
%4 = alloca i64
store i16 %0, i16* %3
store i64 %1, i64* %4
%5 = load i16, i16* %3
%6 = load i64, i64* %4
%7 = shl i64 %6, 0
%8 = add i64 2080374784, %7
%9 = inttoptr i64 %8 to i16*
store volatile i16 %5, i16* %9
ret void
}

LLVM IR (-O2):
define void @outw(i16 zeroext %0, i64 %1) {
%3 = add i64 %1, 2080374784
%4 = inttoptr i64 %3 to i16*
store volatile i16 %0, i16* %4
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
void gen_scan_res(FILE *outfile, int num) {
  fprintf(outfile, "_scan_result[%d]", num);
}


x86 assembly (clang, -O0):
<gen_scan_res>:
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):
<gen_scan_res>:
mov    %esi,%edx
lea    0xee7(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"_scan_result[%d]\00"
define void @gen_scan_res(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 ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"_scan_result[%d]\00"
define void @gen_scan_res(i32* nocapture %0, i32 %1) {
%3 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
double b1f(int nsam) {
  double b1;
  b1 = (nsam + 1.0) / (3.0 * (nsam - 1.0));
  return (b1);
}


x86 assembly (clang, -O0):
<b1f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xef4(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsi2sdl -0x4(%rbp),%xmm2
movsd  0xee3(%rip),%xmm1
subsd  %xmm1,%xmm2
movsd  0xecf(%rip),%xmm1
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<b1f>:
cvtsi2sd %edi,%xmm1
movsd  0xef4(%rip),%xmm0
addsd  %xmm1,%xmm0
addsd  0xef0(%rip),%xmm1
mulsd  0xef0(%rip),%xmm1
divsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @b1f(i32 %0) {
%2 = alloca i32
%3 = alloca double
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sitofp i32 %4 to double
%6 = fadd double %5, 1.000000e+00
%7 = load i32, i32* %2
%8 = sitofp i32 %7 to double
%9 = fsub double %8, 1.000000e+00
%10 = fmul double 3.000000e+00, %9
%11 = fdiv double %6, %10
store double %11, double* %3
%12 = load double, double* %3
ret double %12
}

LLVM IR (-O2):
define double @b1f(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = fadd double %2, 1.000000e+00
%4 = fadd double %2, -1.000000e+00
%5 = fmul double %4, 3.000000e+00
%6 = fdiv double %3, %5
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void exitfunc8(void) {
  printf("Executing exitfunc8.\n");
  exit(0);
}


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

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

LLVM IR (-O0):
@.str = [22 x i8] c"Executing exitfunc8.\0A\00"
define void @exitfunc8() {
%1 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [21 x i8] c"Executing exitfunc8.\00"
define void @exitfunc8() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int read_byte_data(int, int);
int /*<<< orphan*/ write_byte_data(int, int, int);
void enable_allcall_address(uint8_t address) {
  uint8_t oldmode = read_byte_data(address, 0x00);
  uint8_t newmode = oldmode | (1 << 0);
  write_byte_data(address, 0x00, newmode);
}


x86 assembly (clang, -O0):
<enable_allcall_address>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1030 <read_byte_data@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
or     $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%edx
xor    %esi,%esi
call   1040 <write_byte_data@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<enable_allcall_address>:
push   %rbx
mov    %edi,%ebx
xor    %esi,%esi
call   1030 <read_byte_data@plt>
or     $0x1,%eax
mov    %ebx,%edi
xor    %esi,%esi
mov    %eax,%edx
pop    %rbx
jmp    1040 <write_byte_data@plt>

LLVM IR (-O0):
define void @enable_allcall_address(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = call i32 @read_byte_data(i32 %5, i32 0)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = or i32 %7, 1
store i32 %8, i32* %4
%9 = load i32, i32* %2
%10 = load i32, i32* %4
%11 = call i32 @write_byte_data(i32 %9, i32 0, i32 %10)
ret void
}

LLVM IR (-O2):
define void @enable_allcall_address(i32 %0) {
%2 = tail call i32 @read_byte_data(i32 %0, i32 0)
%3 = or i32 %2, 1
%4 = tail call i32 @write_byte_data(i32 %0, i32 0, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abms_system(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *, char *, char *, char *,
                           char *);
void abms_mount(char *src, char *fs, char *dst) {
  char lcmd[255];
  sprintf(lcmd, "%s%s -vt %s %s %s", "/app/os/sys/bin/", "mount", src, fs, dst);
  abms_system(lcmd);
}


x86 assembly (clang, -O0):
<abms_mount>:
push   %rbp
mov    %rsp,%rbp
sub    $0x130,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x120(%rbp),%rdi
mov    -0x8(%rbp),%r8
mov    -0x10(%rbp),%r9
mov    -0x18(%rbp),%rax
lea    0xeaf(%rip),%rsi
lea    0xeba(%rip),%rdx
lea    0xec4(%rip),%rcx
mov    %rax,(%rsp)
call   1040 <sprintf@plt>
lea    -0x120(%rbp),%rdi
call   1030 <abms_system@plt>
add    $0x130,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<abms_mount>:
push   %rbx
sub    $0x110,%rsp
mov    %rsi,%r9
mov    %rdi,%r8
mov    %rdx,(%rsp)
lea    0xec7(%rip),%rsi
lea    0xed2(%rip),%rdx
lea    0xedc(%rip),%rcx
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <abms_system@plt>
add    $0x110,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"%s%s -vt %s %s %s\00"
@.str.1 = [17 x i8] c"/app/os/sys/bin/\00"
@.str.2 = [6 x i8] c"mount\00"
define void @abms_mount(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca [255 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = getelementptr inbounds [255 x i8], [255 x i8]* %7, i64 0, i64 0
%9 = load i8*, i8** %4
%10 = load i8*, i8** %5
%11 = load i8*, i8** %6
%12 = call i32 @sprintf(i8* %8, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* %9, i8* %10, i8* %11)
%13 = getelementptr inbounds [255 x i8], [255 x i8]* %7, i64 0, i64 0
%14 = call i32 @abms_system(i8* %13)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"%s%s -vt %s %s %s\00"
@.str.1 = [17 x i8] c"/app/os/sys/bin/\00"
@.str.2 = [6 x i8] c"mount\00"
define void @abms_mount(i8* %0, i8* %1, i8* %2) {
%4 = alloca [255 x i8]
%5 = getelementptr inbounds [255 x i8], [255 x i8]* %4, i64 0, i64 0
%6 = call i32 @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* %0, i8* %1, i8* %2)
%7 = call i32 @abms_system(i8* %5)
ret void
}
/* Variables and functions */
scalar_t__ library_func2();
int /*<<< orphan*/ printf(char *, int);
int main() {
  int res = 1;
  res += library_func2();
  printf("[-] => %d\n", res);
  return res;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    $0x0,%al
call   1030 <library_func2@plt>
mov    %rax,%rcx
movslq -0x8(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xeac(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <library_func2@plt>
mov    %rax,%rbx
add    $0x1,%ebx
lea    0xecb(%rip),%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"[-] => %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
%3 = call i64 (...) @library_func2()
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = add nsw i64 %5, %3
%7 = trunc i64 %6 to i32
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
@.str = [11 x i8] c"[-] => %d\0A\00"
define i32 @main() {
%1 = tail call i64 (...) @library_func2()
%2 = trunc i64 %1 to i32
%3 = add i32 %2, 1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 %3
}
int prepend_integer(char *buffer, unsigned val, int i) {
  buffer[--i] = '\0';
  do {
    buffer[--i] = '0' + (val % 10);
    val /= 10;
  } while (val);
  return i;
}


x86 assembly (clang, -O0):
<prepend_integer>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x10(%rbp)
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
add    $0x30,%edx
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x10(%rbp)
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1122 <prepend_integer+0x22>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<prepend_integer>:
movslq %edx,%rcx
movb   $0x0,-0x1(%rcx,%rdi,1)
lea    -0x1(%rcx),%eax
add    %rdi,%rcx
add    $0xfffffffffffffffe,%rcx
mov    $0xcccccccd,%r8d
nopl   0x0(%rax,%rax,1)
mov    %esi,%edi
imul   %r8,%rdi
shr    $0x23,%rdi
lea    (%rdi,%rdi,1),%edx
lea    (%rdx,%rdx,4),%r9d
mov    %esi,%edx
sub    %r9d,%edx
or     $0x30,%dl
mov    %dl,(%rcx)
add    $0xffffffff,%eax
add    $0xffffffffffffffff,%rcx
cmp    $0x9,%esi
mov    %edi,%esi
ja     1120 <prepend_integer+0x20>
ret

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

LLVM IR (-O2):
define i32 @prepend_integer(i8* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = add nsw i32 %2, -1
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
store i8 0, i8* %6
%7 = sext i32 %2 to i64
%8 = add nsw i64 %7, -1
br label %9
9: ; preds = %9, %3
%10 = phi i64 [ %15, %9 ], [ %8, %3 ]
%11 = phi i32 [ %17, %9 ], [ %1, %3 ]
%12 = urem i32 %11, 10
%13 = trunc i32 %12 to i8
%14 = or i8 %13, 48
%15 = add i64 %10, -1
%16 = getelementptr inbounds i8, i8* %0, i64 %15
store i8 %14, i8* %16
%17 = udiv i32 %11, 10
%18 = icmp ult i32 %11, 10
br i1 %18, label %19, label %9
19: ; preds = %9
%20 = trunc i64 %15 to i32
ret i32 %20
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void foo2(void) { printf("MAIN2\n"); }


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"MAIN2\0A\00"
define void @foo2() {
%1 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [6 x i8] c"MAIN2\00"
define void @foo2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ error_and_exit();
char *malloc(int);
char *malloc_char_string(int dim1) {
  char *string;
  string = malloc(sizeof(char) * dim1);
  if (string == NULL)
    error_and_exit();
  return string;
}


x86 assembly (clang, -O0):
<malloc_char_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1150 <malloc_char_string+0x30>
mov    $0x0,%al
call   1030 <error_and_exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<malloc_char_string>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1135 <malloc_char_string+0x15>
xor    %eax,%eax
call   1030 <error_and_exit@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @malloc_char_string(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = mul i64 1, %5
%7 = trunc i64 %6 to i32
%8 = call i8* @malloc(i32 %7)
store i8* %8, i8** %3
%9 = load i8*, i8** %3
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %13
11: ; preds = %1
%12 = call i32 (...) @error_and_exit()
br label %13
13: ; preds = %11, %1
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
define noalias i8* @malloc_char_string(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @error_and_exit()
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Type definitions */
typedef int uLong;
typedef int /*<<< orphan*/ Bytef;

/* Variables and functions */
int Z_OK;
int uncompress(int /*<<< orphan*/ *, int *, int /*<<< orphan*/ *, int);
int unz(char *out, int *outlen, char *in, int inlen) {
  int e;
  uLong u_outlen = *outlen;
  uLong u_inlen = inlen;
  e = uncompress((Bytef *)out, &u_outlen, (Bytef *)in, u_inlen);
  if (e == Z_OK)
    *outlen = (int)u_outlen;
  return (e);
}


x86 assembly (clang, -O0):
<unz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0x28(%rbp),%ecx
lea    -0x24(%rbp),%rsi
call   1030 <uncompress@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    0x2e99(%rip),%rcx
cmp    (%rcx),%eax
jne    1168 <unz+0x58>
mov    -0x24(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x20(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unz>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
mov    (%rsi),%eax
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rsi
call   1030 <uncompress@plt>
mov    0x2ec1(%rip),%rcx
cmp    (%rcx),%eax
jne    1139 <unz+0x29>
mov    0xc(%rsp),%ecx
mov    %ecx,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@Z_OK = global i32 0
define i32 @unz(i8* %0, i32* nocapture %1, i8* %2, i32 %3) {
%5 = alloca i32
%6 = bitcast i32* %5 to i8*
%7 = load i32, i32* %1
store i32 %7, i32* %5
%8 = bitcast i8* %0 to i32*
%9 = bitcast i8* %2 to i32*
%10 = call i32 @uncompress(i32* %8, i32* %5, i32* %9, i32 %3)
%11 = load i32, i32* @Z_OK
%12 = icmp eq i32 %10, %11
br i1 %12, label %13, label %15
13: ; preds = %4
%14 = load i32, i32* %5
store i32 %14, i32* %1
br label %15
15: ; preds = %13, %4
ret i32 %10
}
int test_imm_1Fuint16_mem(unsigned short *val) {
  return ((*val) & (0x1F << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_1Fuint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%edx
and    $0x1f,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_1Fuint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 31
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ llog(int, char *, void *);
void xfree(void *ptr) {
  free(ptr);
  llog(9, "xfree(%p)\n", ptr);
}


x86 assembly (clang, -O0):
<xfree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rdx
mov    $0x9,%edi
lea    0xebb(%rip),%rsi
call   1040 <llog@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xfree>:
push   %rbx
mov    %rdi,%rbx
call   1030 <free@plt>
lea    0xed0(%rip),%rsi
mov    $0x9,%edi
mov    %rbx,%rdx
pop    %rbx
jmp    1040 <llog@plt>

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

LLVM IR (-O2):
@.str = [11 x i8] c"xfree(%p)\0A\00"
define void @xfree(i8* %0) {
%2 = tail call i32 @free(i8* %0)
%3 = tail call i32 @llog(i32 9, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int crypto_sign_ed25519_keypair(unsigned char *, unsigned char *);
int crypto_sign_keypair(unsigned char *pk, unsigned char *sk) {
  return crypto_sign_ed25519_keypair(pk, sk);
}


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

x86 assembly (clang, -O2):
<crypto_sign_keypair>:
jmp    1030 <crypto_sign_ed25519_keypair@plt>

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

LLVM IR (-O2):
define i32 @crypto_sign_keypair(i8* %0, i8* %1) {
%3 = tail call i32 @crypto_sign_ed25519_keypair(i8* %0, i8* %1)
ret i32 %3
}
/* Variables and functions */
int INT_MIN;
int /*<<< orphan*/ this_comparison_is_not_decidable();
void bla2lt(int var) {
  if (var + 10 < INT_MIN + 11)
    this_comparison_is_not_decidable();
}


x86 assembly (clang, -O0):
<bla2lt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xa,%eax
mov    0x2ec0(%rip),%rcx
mov    (%rcx),%ecx
add    $0xb,%ecx
cmp    %ecx,%eax
jge    113c <bla2lt+0x2c>
mov    $0x0,%al
call   1030 <this_comparison_is_not_decidable@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bla2lt>:
mov    0x2ed1(%rip),%rax
cmp    %edi,(%rax)
jge    111c <bla2lt+0xc>
ret
xor    %eax,%eax
jmp    1030 <this_comparison_is_not_decidable@plt>

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

LLVM IR (-O2):
@INT_MIN = global i32 0
define void @bla2lt(i32 %0) {
%2 = load i32, i32* @INT_MIN
%3 = icmp slt i32 %2, %0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 (...) @this_comparison_is_not_decidable()
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
void checkRequirement(int req) {
  switch (req) {
  case 268:
  case 269:
    break;
  default:
    fprintf(stderr, "Not supported requirement %d\n", req);
  }
}


x86 assembly (clang, -O0):
<checkRequirement>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xfffffef4,%eax
sub    $0x1,%eax
ja     1136 <checkRequirement+0x26>
jmp    1131 <checkRequirement+0x21>
jmp    114e <checkRequirement+0x3e>
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xeb7(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkRequirement>:
mov    %edi,%eax
and    $0xfffffffe,%eax
cmp    $0x10c,%eax
jne    111d <checkRequirement+0xd>
ret
mov    %edi,%edx
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
lea    0xed1(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [30 x i8] c"Not supported requirement %d\0A\00"
define void @checkRequirement(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %5 [
i32 268, label %4
i32 269, label %4
]
4: ; preds = %1, %1
br label %9
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = load i32, i32* %2
%8 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %7)
br label %9
9: ; preds = %5, %4
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [30 x i8] c"Not supported requirement %d\0A\00"
define void @checkRequirement(i32 %0) {
%2 = and i32 %0, -2
%3 = icmp eq i32 %2, 268
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %7
7: ; preds = %1, %4
ret void
}