xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void usage() {
  printf(
      "Usage: mkrd -out <output> [-boot <file>] [-swap <file>] [-fs <file>]\n");
  exit(10);
}


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

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

LLVM IR (-O0):
@.str = [70 x i8] c"Usage: mkrd -out <output> [-boot <file>] [-swap <file>] [-fs <file>]\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 10)
unreachable
}

LLVM IR (-O2):
@str = [69 x i8] c"Usage: mkrd -out <output> [-boot <file>] [-swap <file>] [-fs <file>]\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([69 x i8], [69 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 10)
unreachable
}
unsigned kol_event_wait() { asm("int $0x40" ::"a"(10)); }


x86 assembly (clang, -O0):
<kol_event_wait>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa,%eax
int    $0x40
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<kol_event_wait>:
mov    $0xa,%eax
int    $0x40
ret

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

LLVM IR (-O2):
define i32 @kol_event_wait() {
tail call void asm sideeffect "int $$0x40", "{ax},~{dirflag},~{fpsr},~{flags}"(i32 10)
ret i32 undef
}
/* Variables and functions */
double powf(float, double);
float gamma_srgb(float v) {
  if (v <= 0.0031308) {
    v *= 12.92;
  } else {
    v = 1.055 * powf(v, 1.0 / 2.4) - 0.055;
  }
  return v;
}


x86 assembly (clang, -O0):
<gamma_srgb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xed2(%rip),%xmm0
ucomisd %xmm1,%xmm0
jb     115b <gamma_srgb+0x4b>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xed7(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    118e <gamma_srgb+0x7e>
movss  -0x4(%rbp),%xmm0
movsd  0xeb0(%rip),%xmm1
call   1030 <powf@plt>
movsd  0xe93(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe8f(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gamma_srgb>:
push   %rax
movaps %xmm0,%xmm2
cvtss2sd %xmm0,%xmm0
movsd  0xee0(%rip),%xmm1
ucomisd %xmm0,%xmm1
jae    1148 <gamma_srgb+0x38>
movsd  0xee2(%rip),%xmm1
movaps %xmm2,%xmm0
call   1030 <powf@plt>
mulsd  0xeda(%rip),%xmm0
addsd  0xeda(%rip),%xmm0
jmp    1150 <gamma_srgb+0x40>
mulsd  0xeb8(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @gamma_srgb(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fcmp ole double %4, 3.130800e-03
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load float, float* %2
%8 = fpext float %7 to double
%9 = fmul double %8, 1.292000e+01
%10 = fptrunc double %9 to float
store float %10, float* %2
br label %16
11: ; preds = %1
%12 = load float, float* %2
%13 = call double @powf(float %12, double 0x3FDAAAAAAAAAAAAB)
%14 = call double @llvm.fmuladd.f64(double 1.055000e+00, double %13, double -5.500000e-02)
%15 = fptrunc double %14 to float
store float %15, float* %2
br label %16
16: ; preds = %11, %6
%17 = load float, float* %2
ret float %17
}

LLVM IR (-O2):
define float @gamma_srgb(float %0) {
%2 = fpext float %0 to double
%3 = fcmp ugt double %2, 3.130800e-03
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = fmul double %2, 1.292000e+01
br label %9
6: ; preds = %1
%7 = tail call double @powf(float %0, double 0x3FDAAAAAAAAAAAAB)
%8 = tail call double @llvm.fmuladd.f64(double %7, double 1.055000e+00, double -5.500000e-02)
br label %9
9: ; preds = %6, %4
%10 = phi double [ %5, %4 ], [ %8, %6 ]
%11 = fptrunc double %10 to float
ret float %11
}
/* Type definitions */
typedef int /*<<< orphan*/ value;

/* Variables and functions */
int /*<<< orphan*/ rpmalloc_thread_finalize();
void thread_destructor(void *value) {
  (void)sizeof(value);
  rpmalloc_thread_finalize();
}


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

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

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

LLVM IR (-O2):
define void @thread_destructor(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @rpmalloc_thread_finalize()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage: t_export_name [-k|-s] name\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [35 x i8] c"Usage: t_export_name [-k|-s] name\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [35 x i8] c"Usage: t_export_name [-k|-s] name\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
void gdk_window_set_user_data() {}


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

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

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

LLVM IR (-O2):
define void @gdk_window_set_user_data() {
ret void
}
/* Variables and functions */
double sqrt(double const);
double len2(const double c[]) { return sqrt(c[0] * c[0] + c[1] * c[1]); }


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

x86 assembly (clang, -O2):
<len2>:
movsd  (%rdi),%xmm0
movsd  0x8(%rdi),%xmm1
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1134 <len2+0x24>
sqrtsd %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define double @len2(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 0
%5 = load double, double* %4
%6 = load double*, double** %2
%7 = getelementptr inbounds double, double* %6, i64 0
%8 = load double, double* %7
%9 = load double*, double** %2
%10 = getelementptr inbounds double, double* %9, i64 1
%11 = load double, double* %10
%12 = load double*, double** %2
%13 = getelementptr inbounds double, double* %12, i64 1
%14 = load double, double* %13
%15 = fmul double %11, %14
%16 = call double @llvm.fmuladd.f64(double %5, double %8, double %15)
%17 = call double @sqrt(double %16)
ret double %17
}

LLVM IR (-O2):
define double @len2(double* nocapture %0) {
%2 = load double, double* %0
%3 = getelementptr inbounds double, double* %0, i64 1
%4 = load double, double* %3
%5 = fmul double %4, %4
%6 = tail call double @llvm.fmuladd.f64(double %2, double %2, double %5)
%7 = tail call double @sqrt(double %6)
ret double %7
}
int test_imm_80int64_highword_reg(long long val) {
  return ((val >> 32) & (0x80 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_80int64_highword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x20,%rdx
and    $0x80,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_80int64_highword_reg>:
bt     $0x27,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmovae %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_80int64_highword_reg(i64 %0) {
%2 = and i64 %0, 549755813888
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
char off_sign(double a) {
  if (a < 0)
    return (-1);
  else if (a == 0)
    return (0);
  else
    return (1);
}


x86 assembly (clang, -O0):
<off_sign>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1120 <off_sign+0x20>
movb   $0xff,-0x1(%rbp)
jmp    1145 <off_sign+0x45>
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1141 <off_sign+0x41>
jp     1141 <off_sign+0x41>
movb   $0x0,-0x1(%rbp)
jmp    1145 <off_sign+0x45>
movb   $0x1,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<off_sign>:
xorpd  %xmm1,%xmm1
movapd %xmm0,%xmm2
cmpneqsd %xmm1,%xmm2
movq   %xmm2,%rcx
and    $0x1,%ecx
ucomisd %xmm0,%xmm1
mov    $0xff,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define signext i8 @off_sign(double %0) {
%2 = alloca i8
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp olt double %4, 0.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store i8 -1, i8* %2
br label %12
7: ; preds = %1
%8 = load double, double* %3
%9 = fcmp oeq double %8, 0.000000e+00
br i1 %9, label %10, label %11
10: ; preds = %7
store i8 0, i8* %2
br label %12
11: ; preds = %7
store i8 1, i8* %2
br label %12
12: ; preds = %11, %10, %6
%13 = load i8, i8* %2
ret i8 %13
}

LLVM IR (-O2):
define signext i8 @off_sign(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fcmp une double %0, 0.000000e+00
%4 = zext i1 %3 to i8
%5 = select i1 %2, i8 -1, i8 %4
ret i8 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ file_error(char *);
int /*<<< orphan*/ *fopen(char *, char *);
FILE *open_file(char *name) {
  FILE *file;
  if ((file = fopen(name, "r")) == NULL)
    file_error(name);
  return file;
}


x86 assembly (clang, -O0):
<open_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1030 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1153 <open_file+0x33>
mov    -0x8(%rbp),%rdi
call   1040 <file_error@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define noalias i32* @open_file(i8* %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @file_error(i8* %0)
br label %6
6: ; preds = %4, %1
ret i32* %2
}
/* Variables and functions */
int rom_present(char *);
int gd5436_available(void) {
  return rom_present(L"roms/video/cirruslogic/5436.vbi");
}


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

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

LLVM IR (-O0):
@.str = [32 x i32] [i32 114, i32 111, i32 109, i32 115, i32 47, i32 118, i32 105, i32 100, i32 101, i32 111, i32 47, i32 99, i32 105, i32 114, i32 114, i32 117, i32 115, i32 108, i32 111, i32 103, i32 105, i32 99, i32 47, i32 53, i32 52, i32 51, i32 54, i32 46, i32 118, i32 98, i32 105, i32 0]
define i32 @gd5436_available() {
%1 = call i32 @rom_present(i8* bitcast ([32 x i32]* @.str to i8*))
ret i32 %1
}

LLVM IR (-O2):
@.str = [32 x i32] [i32 114, i32 111, i32 109, i32 115, i32 47, i32 118, i32 105, i32 100, i32 101, i32 111, i32 47, i32 99, i32 105, i32 114, i32 114, i32 117, i32 115, i32 108, i32 111, i32 103, i32 105, i32 99, i32 47, i32 53, i32 52, i32 51, i32 54, i32 46, i32 118, i32 98, i32 105, i32 0]
define i32 @gd5436_available() {
%1 = tail call i32 @rom_present(i8* bitcast ([32 x i32]* @.str to i8*))
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ DrawMiniGraphic(int, int, int);
int el2edimg(int);
void DrawMiniElement(int x, int y, int element) {
  int graphic;
  graphic = el2edimg(element);
  DrawMiniGraphic(x, y, graphic);
}


x86 assembly (clang, -O0):
<DrawMiniElement>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <el2edimg@plt>
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <DrawMiniGraphic@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DrawMiniElement>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    %edx,%edi
call   1040 <el2edimg@plt>
mov    %ebp,%edi
mov    %ebx,%esi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <DrawMiniGraphic@plt>

LLVM IR (-O0):
define void @DrawMiniElement(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = call i32 @el2edimg(i32 %8)
store i32 %9, i32* %7
%10 = load i32, i32* %4
%11 = load i32, i32* %5
%12 = load i32, i32* %7
%13 = call i32 @DrawMiniGraphic(i32 %10, i32 %11, i32 %12)
ret void
}

LLVM IR (-O2):
define void @DrawMiniElement(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @el2edimg(i32 %2)
%5 = tail call i32 @DrawMiniGraphic(i32 %0, i32 %1, i32 %4)
ret void
}
int test_imm_8Duint16_reg(unsigned short val) {
  return ((val) & (0x8D << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_8Duint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0x8d,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_8Duint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 141
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ EMU68memory_reset();
void EMU68memory_init(void) { EMU68memory_reset(); }


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

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

LLVM IR (-O0):
define void @EMU68memory_init() {
%1 = call i32 (...) @EMU68memory_reset()
ret void
}

LLVM IR (-O2):
define void @EMU68memory_init() {
%1 = tail call i32 (...) @EMU68memory_reset()
ret void
}
void RTMemLockedAllocZTag(void) {}


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

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

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

LLVM IR (-O2):
define void @RTMemLockedAllocZTag() {
ret void
}
/* Variables and functions */
float get_cblock_trans(int *, int, float, float const);
void count_routing_transistors(int num_switch, float R_minW_nmos,
                               float R_minW_pmos) {
  int *num_inputs_to_cblock;
  int iswitch, i, j, iseg, max_inputs_to_cblock;
  float input_cblock_trans;
  const float trans_sram_bit = 6.;
  float trans_cblock_to_lblock_buf;
  input_cblock_trans =
      get_cblock_trans(num_inputs_to_cblock, max_inputs_to_cblock,
                       trans_cblock_to_lblock_buf, trans_sram_bit);
}


x86 assembly (clang, -O0):
<count_routing_transistors>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  0xed3(%rip),%xmm0
movss  %xmm0,-0x34(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x2c(%rbp),%esi
movss  -0x38(%rbp),%xmm0
movss  0xeba(%rip),%xmm1
call   1030 <get_cblock_trans@plt>
movss  %xmm0,-0x30(%rbp)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_routing_transistors>:
movss  0xee8(%rip),%xmm1
jmp    1030 <get_cblock_trans@plt>

LLVM IR (-O0):
define void @count_routing_transistors(i32 %0, float %1, float %2) {
%4 = alloca i32
%5 = alloca float
%6 = alloca float
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca float
%14 = alloca float
%15 = alloca float
store i32 %0, i32* %4
store float %1, float* %5
store float %2, float* %6
store float 6.000000e+00, float* %14
%16 = load i32*, i32** %7
%17 = load i32, i32* %12
%18 = load float, float* %15
%19 = call float @get_cblock_trans(i32* %16, i32 %17, float %18, float 6.000000e+00)
store float %19, float* %13
ret void
}

LLVM IR (-O2):
define void @count_routing_transistors(i32 %0, float %1, float %2) {
%4 = tail call float @get_cblock_trans(i32* undef, i32 undef, float undef, float 6.000000e+00)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ blinkdash();
int /*<<< orphan*/ blinkdot();
int /*<<< orphan*/ sleep(double);
int blinkB() {
  blinkdash();
  int c = 0;
  while (c != 3) {
    blinkdot();
    c++;
  }
  sleep(1.5);
  return 0;
}


x86 assembly (clang, -O0):
<blinkB>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <blinkdash@plt>
movl   $0x0,-0x4(%rbp)
cmpl   $0x3,-0x4(%rbp)
je     1165 <blinkB+0x35>
mov    $0x0,%al
call   1030 <blinkdot@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1146 <blinkB+0x16>
movsd  0xe93(%rip),%xmm0
call   1050 <sleep@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<blinkB>:
push   %rax
xor    %eax,%eax
call   1040 <blinkdash@plt>
xor    %eax,%eax
call   1030 <blinkdot@plt>
xor    %eax,%eax
call   1030 <blinkdot@plt>
xor    %eax,%eax
call   1030 <blinkdot@plt>
movsd  0xeab(%rip),%xmm0
call   1050 <sleep@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @blinkB() {
%1 = alloca i32
%2 = call i32 (...) @blinkdash()
store i32 0, i32* %1
br label %3
3: ; preds = %6, %0
%4 = load i32, i32* %1
%5 = icmp ne i32 %4, 3
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = call i32 (...) @blinkdot()
%8 = load i32, i32* %1
%9 = add nsw i32 %8, 1
store i32 %9, i32* %1
br label %3
10: ; preds = %3
%11 = call i32 @sleep(double 1.500000e+00)
ret i32 0
}

LLVM IR (-O2):
define i32 @blinkB() {
%1 = tail call i32 (...) @blinkdash()
%2 = tail call i32 (...) @blinkdot()
%3 = tail call i32 (...) @blinkdot()
%4 = tail call i32 (...) @blinkdot()
%5 = tail call i32 @sleep(double 1.500000e+00)
ret i32 0
}
int sizefactor(int txtSize, int imgSize) {
  int n = 1;
  while (txtSize * 7 >= imgSize) {
    imgSize *= 2;
    n++;
  }
  return n;
}


x86 assembly (clang, -O0):
<sizefactor>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
imul   $0x7,-0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jl     1135 <sizefactor+0x35>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1111 <sizefactor+0x11>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sizefactor>:
lea    0x0(,%rdi,8),%ecx
sub    %edi,%ecx
mov    $0x1,%eax
cmp    %esi,%ecx
jl     1129 <sizefactor+0x29>
mov    $0x1,%eax
nopw   0x0(%rax,%rax,1)
add    %esi,%esi
add    $0x1,%eax
cmp    %esi,%ecx
jge    1120 <sizefactor+0x20>
ret

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

LLVM IR (-O2):
define i32 @sizefactor(i32 %0, i32 %1) {
%3 = mul nsw i32 %0, 7
%4 = icmp slt i32 %3, %1
br i1 %4, label %11, label %5
5: ; preds = %2, %5
%6 = phi i32 [ %9, %5 ], [ 1, %2 ]
%7 = phi i32 [ %8, %5 ], [ %1, %2 ]
%8 = shl nsw i32 %7, 1
%9 = add nuw nsw i32 %6, 1
%10 = icmp slt i32 %3, %8
br i1 %10, label %11, label %5
11: ; preds = %5, %2
%12 = phi i32 [ 1, %2 ], [ %9, %5 ]
ret i32 %12
}
int Operand_msalp32_encode(unsigned int *valp) {
  unsigned sal_0, msalp32_0;
  msalp32_0 = *valp;
  sal_0 = (0x20 - msalp32_0) & 0x1f;
  *valp = sal_0;
  return 0;
}


x86 assembly (clang, -O0):
<Operand_msalp32_encode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    $0x20,%eax
sub    -0x10(%rbp),%eax
and    $0x1f,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Operand_msalp32_encode>:
xor    %eax,%eax
sub    (%rdi),%eax
and    $0x1f,%eax
mov    %eax,(%rdi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @Operand_msalp32_encode(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = load i32, i32* %5
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = sub i32 32, %7
%9 = and i32 %8, 31
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = load i32*, i32** %2
store i32 %10, i32* %11
ret i32 0
}

LLVM IR (-O2):
define i32 @Operand_msalp32_encode(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = sub i32 0, %2
%4 = and i32 %3, 31
store i32 %4, i32* %0
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int getc(int /*<<< orphan*/ *);
int ignore_whitespace(FILE *config_fp) {
  int c = getc(config_fp);
  while (((c) == ' ' || (c) == '\t' || (c) == '\n'))
    c = getc(config_fp);
  return c;
}


x86 assembly (clang, -O0):
<ignore_whitespace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getc@plt>
mov    %eax,-0xc(%rbp)
mov    $0x1,%al
cmpl   $0x20,-0xc(%rbp)
mov    %al,-0xd(%rbp)
je     1150 <ignore_whitespace+0x40>
mov    $0x1,%al
cmpl   $0x9,-0xc(%rbp)
mov    %al,-0xd(%rbp)
je     1150 <ignore_whitespace+0x40>
cmpl   $0xa,-0xc(%rbp)
sete   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1160 <ignore_whitespace+0x50>
jmp    1171 <ignore_whitespace+0x61>
mov    -0x8(%rbp),%rdi
call   1030 <getc@plt>
mov    %eax,-0xc(%rbp)
jmp    1128 <ignore_whitespace+0x18>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ignore_whitespace>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
movabs $0x100000600,%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <getc@plt>
cmp    $0x20,%eax
ja     1145 <ignore_whitespace+0x35>
mov    %eax,%ecx
bt     %rcx,%r14
jb     1130 <ignore_whitespace+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @ignore_whitespace(i32* nocapture %0) {
br label %2
2: ; preds = %4, %1
%3 = tail call i32 @getc(i32* %0)
switch i32 %3, label %5 [
i32 32, label %4
i32 10, label %4
i32 9, label %4
]
4: ; preds = %2, %2, %2
br label %2
5: ; preds = %2
ret i32 %3
}
/* Variables and functions */
int SuiteSparse_version(int version[3]) {
  if (version != NULL) {
    version[0] = 4;
    version[1] = 2;
    version[2] = 1;
  }
  return (((4) * 1000 + (2)));
}


x86 assembly (clang, -O0):
<SuiteSparse_version>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1133 <SuiteSparse_version+0x33>
mov    -0x8(%rbp),%rax
movl   $0x4,(%rax)
mov    -0x8(%rbp),%rax
movl   $0x2,0x4(%rax)
mov    -0x8(%rbp),%rax
movl   $0x1,0x8(%rax)
mov    $0xfa2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SuiteSparse_version>:
test   %rdi,%rdi
je     1119 <SuiteSparse_version+0x19>
movabs $0x200000004,%rax
mov    %rax,(%rdi)
movl   $0x1,0x8(%rdi)
mov    $0xfa2,%eax
ret

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

LLVM IR (-O2):
define i32 @SuiteSparse_version(i32* writeonly %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
store i32 4, i32* %0
%4 = getelementptr inbounds i32, i32* %0, i64 1
store i32 2, i32* %4
%5 = getelementptr inbounds i32, i32* %0, i64 2
store i32 1, i32* %5
br label %6
6: ; preds = %3, %1
ret i32 4002
}
int update_bits_directly(int m, int n, int j, int i) {
  int all_ones = ~0;
  int left = all_ones << (j + 1);
  int right = ((1 << i) - 1);
  int mask = left | right;
  int n_cleared = n & mask;
  int m_shifted = m << i;
  return n_cleared | m_shifted;
}


x86 assembly (clang, -O0):
<update_bits_directly>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
movl   $0xffffffff,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
shl    %cl,%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
sub    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x8(%rbp),%eax
and    -0x20(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x10(%rbp),%ecx
shl    %cl,%eax
mov    %eax,-0x28(%rbp)
mov    -0x24(%rbp),%eax
or     -0x28(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<update_bits_directly>:
mov    %ecx,%r8d
lea    0x1(%rdx),%ecx
mov    $0xffffffff,%edx
shl    %cl,%edx
mov    $0xffffffff,%eax
mov    %r8d,%ecx
shl    %cl,%eax
not    %eax
or     %edx,%eax
and    %esi,%eax
shl    %cl,%edi
or     %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @update_bits_directly(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = add nsw i32 %2, 1
%6 = shl nsw i32 -1, %5
%7 = shl nsw i32 -1, %3
%8 = xor i32 %7, -1
%9 = or i32 %6, %8
%10 = and i32 %9, %1
%11 = shl i32 %0, %3
%12 = or i32 %10, %11
ret i32 %12
}
int main(void) {
  char c[4];
  int i;
  for (i = 0; i < 4; ++i) {
    printf("Address of c[%d] = %x\n", i, &c[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
jge    115a <main+0x4a>
mov    -0xc(%rbp),%esi
movslq -0xc(%rbp),%rax
lea    -0x8(%rbp),%rdx
add    %rax,%rdx
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xee4(%rip),%rbx
lea    0xc(%rsp),%rdx
mov    %rbx,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xd(%rsp),%rdx
mov    %rbx,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe(%rsp),%rdx
mov    %rbx,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf(%rsp),%rdx
mov    %rbx,%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [23 x i8] c"Address of c[%d] = %x\0A\00"
define i32 @main() {
%1 = alloca [4 x i8]
%2 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 0
%3 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 0, i8* %2)
%4 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 1
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 1, i8* %4)
%6 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 2
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 2, i8* %6)
%8 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 3
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 3, i8* %8)
ret i32 0
}
void lcd_gotoxy(int x, int y) {}


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

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

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

LLVM IR (-O2):
define void @lcd_gotoxy(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int pow10(int n) {
  switch (n) {
  case 0:
    return 1;
  case 1:
    return 10;
  case 2:
    return 100;
  case 3:
    return 1000;
  case 4:
    return 10000;
  case 5:
    return 100000;
  case 6:
    return 1000000;
  case 7:
    return 10000000;
  case 8:
    return 100000000;
  }
  return 1;
}


x86 assembly (clang, -O0):
<pow10>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %rax,-0x10(%rbp)
sub    $0x8,%rax
ja     1198 <pow10+0x98>
mov    -0x10(%rbp),%rax
lea    0xedd(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1,-0x4(%rbp)
jmp    119f <pow10+0x9f>
movl   $0xa,-0x4(%rbp)
jmp    119f <pow10+0x9f>
movl   $0x64,-0x4(%rbp)
jmp    119f <pow10+0x9f>
movl   $0x3e8,-0x4(%rbp)
jmp    119f <pow10+0x9f>
movl   $0x2710,-0x4(%rbp)
jmp    119f <pow10+0x9f>
movl   $0x186a0,-0x4(%rbp)
jmp    119f <pow10+0x9f>
movl   $0xf4240,-0x4(%rbp)
jmp    119f <pow10+0x9f>
movl   $0x989680,-0x4(%rbp)
jmp    119f <pow10+0x9f>
movl   $0x5f5e100,-0x4(%rbp)
jmp    119f <pow10+0x9f>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pow10>:
add    $0xffffffff,%edi
mov    $0x1,%eax
cmp    $0x7,%edi
ja     111a <pow10+0x1a>
movslq %edi,%rax
lea    0xee9(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @pow10(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %14 [
i32 0, label %5
i32 1, label %6
i32 2, label %7
i32 3, label %8
i32 4, label %9
i32 5, label %10
i32 6, label %11
i32 7, label %12
i32 8, label %13
]
5: ; preds = %1
store i32 1, i32* %2
br label %15
6: ; preds = %1
store i32 10, i32* %2
br label %15
7: ; preds = %1
store i32 100, i32* %2
br label %15
8: ; preds = %1
store i32 1000, i32* %2
br label %15
9: ; preds = %1
store i32 10000, i32* %2
br label %15
10: ; preds = %1
store i32 100000, i32* %2
br label %15
11: ; preds = %1
store i32 1000000, i32* %2
br label %15
12: ; preds = %1
store i32 10000000, i32* %2
br label %15
13: ; preds = %1
store i32 100000000, i32* %2
br label %15
14: ; preds = %1
store i32 1, i32* %2
br label %15
15: ; preds = %14, %13, %12, %11, %10, %9, %8, %7, %6, %5
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
@switch.table.pow10 = [8 x i32] [i32 10, i32 100, i32 1000, i32 10000, i32 100000, i32 1000000, i32 10000000, i32 100000000]
define i32 @pow10(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 8
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [8 x i32], [8 x i32]* @switch.table.pow10, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void c_free2d(double **dpp, int m) {
  int i;
  for (i = 0; i < m; i++)
    free((void *)dpp[i]);
  free((void *)dpp);
}


x86 assembly (clang, -O0):
<c_free2d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1151 <c_free2d+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <c_free2d+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_free2d>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1142 <c_free2d+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <c_free2d+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @c_free2d(double** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = getelementptr inbounds double*, double** %0, i64 %7
%9 = bitcast double** %8 to i8**
%10 = load i8*, i8** %9
%11 = tail call i32 @free(i8* %10)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
%15 = bitcast double** %0 to i8*
%16 = tail call i32 @free(i8* %15)
ret void
}
void xen_finish_init_mapping(void) {}


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

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

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

LLVM IR (-O2):
define void @xen_finish_init_mapping() {
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, float);
int /*<<< orphan*/ quadrat(float *);
int main() {
  float seitenlaenge = 3.7;
  printf("Die Seitenlange ist %f\n", seitenlaenge);
  quadrat(&seitenlaenge);
  printf("Das Quadrat ist %f\n", seitenlaenge);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xec9(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
lea    -0x8(%rbp),%rdi
call   1040 <quadrat@plt>
movss  -0x8(%rbp),%xmm0
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e72(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x406ccccd,0x4(%rsp)
40
lea    0xed4(%rip),%rdi
movss  0xec8(%rip),%xmm0
call   1030 <printf@plt>
lea    0x4(%rsp),%rdi
call   1040 <quadrat@plt>
movss  0x4(%rsp),%xmm0
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e80(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Die Seitenlange ist %f\0A\00"
@.str.1 = [20 x i8] c"Das Quadrat ist %f\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
store float 0x400D9999A0000000, float* %2
%3 = load float, float* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), float %3)
%5 = call i32 @quadrat(float* %2)
%6 = load float, float* %2
%7 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), float %6)
%8 = load i32, i32* @EXIT_SUCCESS
ret i32 %8
}

LLVM IR (-O2):
@.str = [24 x i8] c"Die Seitenlange ist %f\0A\00"
@.str.1 = [20 x i8] c"Das Quadrat ist %f\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
store float 0x400D9999A0000000, float* %1
%3 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), float 0x400D9999A0000000)
%4 = call i32 @quadrat(float* %1)
%5 = load float, float* %1
%6 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), float %5)
%7 = load i32, i32* @EXIT_SUCCESS
ret i32 %7
}
int func() {
  int i, array[3];
  for (i = 0; i < 3; i++)
    array[i] = i;
  return array[0];
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x3,-0x4(%rbp)
jge    112e <func+0x2e>
mov    -0x4(%rbp),%ecx
movslq -0x4(%rbp),%rax
mov    %ecx,-0x10(%rbp,%rax,4)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <func+0xb>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @func() {
%1 = alloca i32
%2 = alloca [3 x i32]
store i32 0, i32* %1
br label %3
3: ; preds = %11, %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 3
br i1 %5, label %6, label %14
6: ; preds = %3
%7 = load i32, i32* %1
%8 = load i32, i32* %1
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 %9
store i32 %7, i32* %10
br label %11
11: ; preds = %6
%12 = load i32, i32* %1
%13 = add nsw i32 %12, 1
store i32 %13, i32* %1
br label %3
14: ; preds = %3
%15 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%16 = load i32, i32* %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @func() {
ret i32 0
}
/* Type definitions */
typedef double time_t;
struct timespec {
  double tv_sec;
  long tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ nanosleep(struct timespec *, int /*<<< orphan*/ *);
void ohmd_sleep(double seconds) {
  struct timespec sleepfor;
  sleepfor.tv_sec = (time_t)seconds;
  sleepfor.tv_nsec = (long)((seconds - sleepfor.tv_sec) * 1000000000.0);
  nanosleep(&sleepfor, NULL);
}


x86 assembly (clang, -O0):
<ohmd_sleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  0xec7(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rax
mov    %rax,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <nanosleep@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ohmd_sleep>:
sub    $0x18,%rsp
movsd  %xmm0,0x8(%rsp)
subsd  %xmm0,%xmm0
mulsd  0xeda(%rip),%xmm0
cvttsd2si %xmm0,%rax
mov    %rax,0x10(%rsp)
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <nanosleep@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { double, i64 }
define void @ohmd_sleep(double %0) {
%2 = alloca double
%3 = alloca %struct.timespec
store double %0, double* %2
%4 = load double, double* %2
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
store double %4, double* %5
%6 = load double, double* %2
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
%8 = load double, double* %7
%9 = fsub double %6, %8
%10 = fmul double %9, 1.000000e+09
%11 = fptosi double %10 to i64
%12 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
store i64 %11, i64* %12
%13 = call i32 @nanosleep(%struct.timespec* %3, i32* null)
ret void
}

LLVM IR (-O2):
%struct.timespec = type { double, i64 }
define void @ohmd_sleep(double %0) {
%2 = alloca %struct.timespec
%3 = bitcast %struct.timespec* %2 to i8*
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
store double %0, double* %4
%5 = fsub double %0, %0
%6 = fmul double %5, 1.000000e+09
%7 = fptosi double %6 to i64
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 1
store i64 %7, i64* %8
%9 = call i32 @nanosleep(%struct.timespec* %2, i32* null)
ret void
}
long long _llmin(long long a, long long b) {
  long long min_val;
  min_val = b;
  if (a < b) {
    min_val = a;
  }
  return min_val;
}


x86 assembly (clang, -O0):
<_llmin>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    112a <_llmin+0x2a>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i64 @_llmin(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Variables and functions */
char *strdup(char *);
char *fly_get_font(void) { return strdup("default font"); }


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"default font\00"
define i8* @fly_get_font() {
%1 = call i8* @strdup(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [13 x i8] c"default font\00"
define noalias i8* @fly_get_font() {
%1 = tail call dereferenceable_or_null(13) i8* @strdup(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
int test_imm_FAuint64_lowword_reg(unsigned long long val) {
  return ((val) & (0xFA << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_FAuint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 250
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}