xunge/DecIR huggingface dataset:
double reciprocal_estimate(double a) {
  int q, s;
  double r;
  q = (int)(a * 512.0);
  r = 1.0 / (((double)q + 0.5) / 512.0);
  s = (int)(256.0 * r + 0.5);
  return (double)s / 256.0;
}


x86 assembly (clang, -O0):
<reciprocal_estimate>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xf07(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0xc(%rbp)
cvtsi2sdl -0xc(%rbp),%xmm1
movsd  0xede(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  0xee2(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0xece(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xea8(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xea4(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x10(%rbp)
cvtsi2sdl -0x10(%rbp),%xmm0
movsd  0xe84(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<reciprocal_estimate>:
mulsd  0xef8(%rip),%xmm0
cvttpd2dq %xmm0,%xmm0
cvtdq2pd %xmm0,%xmm0
movsd  0xef0(%rip),%xmm1
addsd  %xmm1,%xmm0
mulsd  0xeec(%rip),%xmm0
movsd  0xeec(%rip),%xmm2
divsd  %xmm0,%xmm2
mulsd  0xee8(%rip),%xmm2
addsd  %xmm1,%xmm2
cvttpd2dq %xmm2,%xmm0
cvtdq2pd %xmm0,%xmm0
mulsd  0xedc(%rip),%xmm0
ret

LLVM IR (-O0):
define double @reciprocal_estimate(double %0) {
%2 = alloca double
%3 = alloca i32
%4 = alloca i32
%5 = alloca double
store double %0, double* %2
%6 = load double, double* %2
%7 = fmul double %6, 5.120000e+02
%8 = fptosi double %7 to i32
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = sitofp i32 %9 to double
%11 = fadd double %10, 5.000000e-01
%12 = fdiv double %11, 5.120000e+02
%13 = fdiv double 1.000000e+00, %12
store double %13, double* %5
%14 = load double, double* %5
%15 = call double @llvm.fmuladd.f64(double 2.560000e+02, double %14, double 5.000000e-01)
%16 = fptosi double %15 to i32
store i32 %16, i32* %4
%17 = load i32, i32* %4
%18 = sitofp i32 %17 to double
%19 = fdiv double %18, 2.560000e+02
ret double %19
}

LLVM IR (-O2):
define double @reciprocal_estimate(double %0) {
%2 = fmul double %0, 5.120000e+02
%3 = fptosi double %2 to i32
%4 = sitofp i32 %3 to double
%5 = fadd double %4, 5.000000e-01
%6 = fmul double %5, 0x3F60000000000000
%7 = fdiv double 1.000000e+00, %6
%8 = tail call double @llvm.fmuladd.f64(double %7, double 2.560000e+02, double 5.000000e-01)
%9 = fptosi double %8 to i32
%10 = sitofp i32 %9 to double
%11 = fmul double %10, 3.906250e-03
ret double %11
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
void print_html_end(FILE *f) { fputs("</pre>\n</div>\n</body>\n</html>\n", f); }


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

x86 assembly (clang, -O2):
<print_html_end>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0x1e,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"</pre>\0A</div>\0A</body>\0A</html>\0A\00"
define void @print_html_end(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fputs(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32* %3)
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"</pre>\0A</div>\0A</body>\0A</html>\0A\00"
define void @print_html_end(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i64 30, i64 1, i32* %0)
ret void
}
/* Variables and functions */
float exp(double);
float svp(float K) {
  float hit;
  hit = exp((17.2693882 * K - 4717.306) / (K - 35.7));
  return (6.1078 * hit);
}


x86 assembly (clang, -O0):
<svp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xee2(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xede(%rip),%xmm1
addsd  %xmm1,%xmm0
movss  -0x4(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movsd  0xeb9(%rip),%xmm2
subsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
call   1030 <exp@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe8e(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<svp>:
push   %rax
cvtss2sd %xmm0,%xmm1
movsd  0xee3(%rip),%xmm0
mulsd  %xmm1,%xmm0
addsd  0xedf(%rip),%xmm0
addsd  0xedf(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <exp@plt>
cvtss2sd %xmm0,%xmm0
mulsd  0xed2(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @svp(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = fpext float %4 to double
%6 = call double @llvm.fmuladd.f64(double 0x403144F6A004EDA6, double %5, double 0xC0B26D4E56041893)
%7 = load float, float* %2
%8 = fpext float %7 to double
%9 = fsub double %8, 3.570000e+01
%10 = fdiv double %6, %9
%11 = call float @exp(double %10)
store float %11, float* %3
%12 = load float, float* %3
%13 = fpext float %12 to double
%14 = fmul double 6.107800e+00, %13
%15 = fptrunc double %14 to float
ret float %15
}

LLVM IR (-O2):
define float @svp(float %0) {
%2 = fpext float %0 to double
%3 = tail call double @llvm.fmuladd.f64(double %2, double 0x403144F6A004EDA6, double 0xC0B26D4E56041893)
%4 = fadd double %2, -3.570000e+01
%5 = fdiv double %3, %4
%6 = tail call float @exp(double %5)
%7 = fpext float %6 to double
%8 = fmul double %7, 6.107800e+00
%9 = fptrunc double %8 to float
ret float %9
}
/* Variables and functions */
float bounce_io(float, float, float);
float bounce_f_io(float step, float max_steps, float max_val) {
  return bounce_io(step, max_steps, max_val);
}


x86 assembly (clang, -O0):
<bounce_f_io>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
call   1030 <bounce_io@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bounce_f_io>:
jmp    1030 <bounce_io@plt>

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

LLVM IR (-O2):
define float @bounce_f_io(float %0, float %1, float %2) {
%4 = tail call float @bounce_io(float %0, float %1, float %2)
ret float %4
}
void js_ConsoleEnabled(const char *prompt) {}


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

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

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

LLVM IR (-O2):
define void @js_ConsoleEnabled(i8* nocapture %0) {
ret void
}
int fun249() { return 249; }


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

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

LLVM IR (-O0):
define i32 @fun249() {
ret i32 249
}

LLVM IR (-O2):
define i32 @fun249() {
ret i32 249
}
/* Variables and functions */
char const *strrchr(char const *const, char);
char const *path_extname(char const *const path) {
  if (!path)
    return NULL;
  return strrchr(path, '.');
}


x86 assembly (clang, -O0):
<path_extname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1134 <path_extname+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1146 <path_extname+0x36>
mov    -0x10(%rbp),%rdi
mov    $0x2e,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<path_extname>:
test   %rdi,%rdi
je     111f <path_extname+0xf>
mov    $0x2e,%esi
jmp    1030 <strrchr@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8* @path_extname(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = icmp ne i8* %4, null
br i1 %5, label %7, label %6
6: ; preds = %1
store i8* null, i8** %2
br label %10
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = call i8* @strrchr(i8* %8, i8 signext 46)
store i8* %9, i8** %2
br label %10
10: ; preds = %7, %6
%11 = load i8*, i8** %2
ret i8* %11
}

LLVM IR (-O2):
define i8* @path_extname(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i8* @strrchr(i8* %0, i8 signext 46)
br label %5
5: ; preds = %1, %3
%6 = phi i8* [ %4, %3 ], [ null, %1 ]
ret i8* %6
}
/* Type definitions */
struct fsm {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
struct fsm *fsm_bimachine(struct fsm *net) {
  printf("implementation pending\n");
  return (net);
}


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

x86 assembly (clang, -O2):
<fsm_bimachine>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.fsm = type { i32 }
@.str = [24 x i8] c"implementation pending\0A\00"
define %struct.fsm* @fsm_bimachine(%struct.fsm* %0) {
%2 = alloca %struct.fsm*
store %struct.fsm* %0, %struct.fsm** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%4 = load %struct.fsm*, %struct.fsm** %2
ret %struct.fsm* %4
}

LLVM IR (-O2):
%struct.fsm = type { i32 }
@str = [23 x i8] c"implementation pending\00"
define %struct.fsm* @fsm_bimachine(%struct.fsm* readnone returned %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
ret %struct.fsm* %0
}
float linear(float z) { return z; }


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

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

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

LLVM IR (-O2):
define float @linear(float returned %0) {
ret float %0
}
/* Variables and functions */
double calc_polynomial(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int x;
  printf("3x^5 + 2x^4 - 5x^3 - x^2 + 7x - 6\n");
  printf("Enter a value for x: ");
  scanf("%d", &x);
  printf("Polynomial: %.2f\n", calc_polynomial(x));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xecf(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xed7(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1030 <calc_polynomial@plt>
lea    0xec2(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee3(%rip),%rdi
call   1040 <puts@plt>
lea    0xeac(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xeb4(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
mov    0x4(%rsp),%edi
call   1030 <calc_polynomial@plt>
lea    0xe9d(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [35 x i8] c"3x^5 + 2x^4 - 5x^3 - x^2 + 7x - 6\0A\00"
@.str.1 = [22 x i8] c"Enter a value for x: \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [18 x i8] c"Polynomial: %.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = call double @calc_polynomial(i32 %6)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), double %7)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [22 x i8] c"Enter a value for x: \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [18 x i8] c"Polynomial: %.2f\0A\00"
@str = [34 x i8] c"3x^5 + 2x^4 - 5x^3 - x^2 + 7x - 6\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
%7 = call double @calc_polynomial(i32 %6)
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), double %7)
ret i32 0
}
/* Variables and functions */
scalar_t__ blowfish_test();
int /*<<< orphan*/ printf(char *, char *);
int main() {
  printf("Blowfish tests: %s\n", blowfish_test() ? "SUCCEEDED" : "FAILED");
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <blowfish_test@plt>
mov    %rax,%rcx
lea    0xede(%rip),%rsi
lea    0xecd(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%rsi
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <blowfish_test@plt>
test   %rax,%rax
lea    0xeec(%rip),%rax
lea    0xedb(%rip),%rsi
cmove  %rax,%rsi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Blowfish tests: %s\0A\00"
@.str.1 = [10 x i8] c"SUCCEEDED\00"
@.str.2 = [7 x i8] c"FAILED\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @blowfish_test()
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i64
%5 = select i1 %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0)
%6 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"Blowfish tests: %s\0A\00"
@.str.1 = [10 x i8] c"SUCCEEDED\00"
@.str.2 = [7 x i8] c"FAILED\00"
define i32 @main() {
%1 = tail call i64 (...) @blowfish_test()
%2 = icmp eq i64 %1, 0
%3 = select i1 %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}
/* Type definitions */
struct em8051 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *);
int disasm_cpl_a(struct em8051 *aCPU, int aPosition, char *aBuffer) {
  sprintf(aBuffer, "CPL   A");
  return 1;
}


x86 assembly (clang, -O0):
<disasm_cpl_a>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xed2(%rip),%rsi
call   1030 <sprintf@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<disasm_cpl_a>:
movabs $0x412020204c5043,%rax
mov    %rax,(%rdx)
mov    $0x1,%eax
ret

LLVM IR (-O0):
%struct.em8051 = type { i32 }
@.str = [8 x i8] c"CPL A\00"
define i32 @disasm_cpl_a(%struct.em8051* %0, i32 %1, i8* %2) {
%4 = alloca %struct.em8051*
%5 = alloca i32
%6 = alloca i8*
store %struct.em8051* %0, %struct.em8051** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %6
%8 = call i32 @sprintf(i8* %7, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
%struct.em8051 = type { i32 }
define i32 @disasm_cpl_a(%struct.em8051* nocapture readnone %0, i32 %1, i8* nocapture writeonly %2) {
%4 = bitcast i8* %2 to i64*
store i64 18331195839107139, i64* %4
ret i32 1
}
int g(long long a, int b) {
  int c = a != 0;
  return c + b;
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
mov    %esi,%eax
cmp    $0x1,%rdi
sbb    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @g(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
%5 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%6 = load i64, i64* %3
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i32
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = load i32, i32* %4
%11 = add nsw i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @g(i64 %0, i32 %1) {
%3 = icmp ne i64 %0, 0
%4 = zext i1 %3 to i32
%5 = add nsw i32 %4, %1
ret i32 %5
}
/* Variables and functions */
char *libgamma_name_of_method(int);
__attribute__((__const__)) const char *method_name(int method) {
  const char *r = libgamma_name_of_method(method);
  return r ? r : "(unknown)";
}


x86 assembly (clang, -O0):
<method_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <libgamma_name_of_method@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     113f <method_name+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    114f <method_name+0x3f>
lea    0xeba(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    114f <method_name+0x3f>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<method_name>:
push   %rax
call   1030 <libgamma_name_of_method@plt>
test   %rax,%rax
lea    0xee0(%rip),%rcx
cmove  %rcx,%rax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"(unknown)\00"
define i8* @method_name(i32 %0) {
%2 = tail call i8* @libgamma_name_of_method(i32 %0)
%3 = icmp eq i8* %2, null
%4 = select i1 %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %2
ret i8* %4
}
void RTPathExistsEx(void) {}


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

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

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

LLVM IR (-O2):
define void @RTPathExistsEx() {
ret void
}
void shiftrows(unsigned char *state) {
  unsigned int t;
  t = *(unsigned int *)(&state[4]);
  *(unsigned int *)(&state[4]) = (t >> 8) | (t << 24);
  t = *(unsigned int *)(&state[8]);
  *(unsigned int *)(&state[8]) = (t >> 16) | (t << 16);
  t = *(unsigned int *)(&state[12]);
  *(unsigned int *)(&state[12]) = (t >> 24) | (t << 8);
}


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

x86 assembly (clang, -O2):
<shiftrows>:
roll   $0x18,0x4(%rdi)
roll   $0x10,0x8(%rdi)
roll   $0x8,0xc(%rdi)
ret

LLVM IR (-O0):
define void @shiftrows(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 4
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = lshr i32 %8, 8
%10 = load i32, i32* %3
%11 = shl i32 %10, 24
%12 = or i32 %9, %11
%13 = load i8*, i8** %2
%14 = getelementptr inbounds i8, i8* %13, i64 4
%15 = bitcast i8* %14 to i32*
store i32 %12, i32* %15
%16 = load i8*, i8** %2
%17 = getelementptr inbounds i8, i8* %16, i64 8
%18 = bitcast i8* %17 to i32*
%19 = load i32, i32* %18
store i32 %19, i32* %3
%20 = load i32, i32* %3
%21 = lshr i32 %20, 16
%22 = load i32, i32* %3
%23 = shl i32 %22, 16
%24 = or i32 %21, %23
%25 = load i8*, i8** %2
%26 = getelementptr inbounds i8, i8* %25, i64 8
%27 = bitcast i8* %26 to i32*
store i32 %24, i32* %27
%28 = load i8*, i8** %2
%29 = getelementptr inbounds i8, i8* %28, i64 12
%30 = bitcast i8* %29 to i32*
%31 = load i32, i32* %30
store i32 %31, i32* %3
%32 = load i32, i32* %3
%33 = lshr i32 %32, 24
%34 = load i32, i32* %3
%35 = shl i32 %34, 8
%36 = or i32 %33, %35
%37 = load i8*, i8** %2
%38 = getelementptr inbounds i8, i8* %37, i64 12
%39 = bitcast i8* %38 to i32*
store i32 %36, i32* %39
ret void
}

LLVM IR (-O2):
define void @shiftrows(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 4
%3 = bitcast i8* %2 to i32*
%4 = load i32, i32* %3
%5 = tail call i32 @llvm.fshl.i32(i32 %4, i32 %4, i32 24)
store i32 %5, i32* %3
%6 = getelementptr inbounds i8, i8* %0, i64 8
%7 = bitcast i8* %6 to i32*
%8 = load i32, i32* %7
%9 = tail call i32 @llvm.fshl.i32(i32 %8, i32 %8, i32 16)
store i32 %9, i32* %7
%10 = getelementptr inbounds i8, i8* %0, i64 12
%11 = bitcast i8* %10 to i32*
%12 = load i32, i32* %11
%13 = tail call i32 @llvm.fshl.i32(i32 %12, i32 %12, i32 8)
store i32 %13, i32* %11
ret void
}
/* Variables and functions */
int /*<<< orphan*/ state_exec();
int /*<<< orphan*/ state_init();
int /*<<< orphan*/ state_input_a(int);
int /*<<< orphan*/ state_input_b(int);
int /*<<< orphan*/ state_input_c(float);
int main(int argc, char **argv) {
  int loops = 100;
  state_init();
  while (loops > 0) {
    state_input_a(42);
    state_input_b(14400);
    state_input_c(3.14159f);
    state_exec();
    loops -= 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x64,-0x14(%rbp)
mov    $0x0,%al
call   1050 <state_init@plt>
cmpl   $0x0,-0x14(%rbp)
jle    11b4 <main+0x64>
mov    $0x2a,%edi
call   1070 <state_input_a@plt>
mov    $0x3840,%edi
call   1030 <state_input_b@plt>
movss  0xe66(%rip),%xmm0
call   1060 <state_input_c@plt>
mov    $0x0,%al
call   1040 <state_exec@plt>
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1174 <main+0x24>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1050 <state_init@plt>
mov    $0x65,%ebx
nopl   (%rax)
mov    $0x2a,%edi
call   1070 <state_input_a@plt>
mov    $0x3840,%edi
call   1030 <state_input_b@plt>
movss  0xe84(%rip),%xmm0
call   1060 <state_input_c@plt>
xor    %eax,%eax
call   1040 <state_exec@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     1160 <main+0x10>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 100, i32* %6
%7 = call i32 (...) @state_init()
br label %8
8: ; preds = %11, %2
%9 = load i32, i32* %6
%10 = icmp sgt i32 %9, 0
br i1 %10, label %11, label %18
11: ; preds = %8
%12 = call i32 @state_input_a(i32 42)
%13 = call i32 @state_input_b(i32 14400)
%14 = call i32 @state_input_c(float 0x400921FA00000000)
%15 = call i32 (...) @state_exec()
%16 = load i32, i32* %6
%17 = sub nsw i32 %16, 1
store i32 %17, i32* %6
br label %8
18: ; preds = %8
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @state_init()
br label %4
4: ; preds = %2, %4
%5 = phi i32 [ 100, %2 ], [ %10, %4 ]
%6 = tail call i32 @state_input_a(i32 42)
%7 = tail call i32 @state_input_b(i32 14400)
%8 = tail call i32 @state_input_c(float 0x400921FA00000000)
%9 = tail call i32 (...) @state_exec()
%10 = add nsw i32 %5, -1
%11 = icmp ugt i32 %5, 1
br i1 %11, label %4, label %12
12: ; preds = %4
ret i32 0
}
__attribute__((no_sanitize("undefined"))) unsigned int
blacklist_0(signed int src) {
  return src;
}


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

x86 assembly (clang, -O2):
<blacklist_0>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @blacklist_0(i32 returned %0) {
ret i32 %0
}
void UART_RECEIVER_ISR() {}


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

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

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

LLVM IR (-O2):
define void @UART_RECEIVER_ISR() {
ret void
}
/* Variables and functions */
scalar_t__ inver_thread_a();
void *inver_thread_a_wrap(void *v __attribute__((unused))) {
  return (void *)(intptr_t)inver_thread_a();
}


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

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

LLVM IR (-O0):
define i8* @inver_thread_a_wrap(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i64 (...) @inver_thread_a()
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}

LLVM IR (-O2):
define i8* @inver_thread_a_wrap(i8* nocapture readnone %0) {
%2 = tail call i64 (...) @inver_thread_a()
%3 = inttoptr i64 %2 to i8*
ret i8* %3
}
AX0AR1(r0, r1, x0, x1, p0, p1) int r0, r1;
int *p0, *p1;
{ (((int *)10000000)[x0]) = (p1[1111111 / 4]); }


x86 assembly (clang, -O0):
<AX0AR1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    0x10f444(%rax),%edx
movslq -0x10(%rbp),%rcx
mov    $0x989680,%eax
mov    %edx,(%rax,%rcx,4)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<AX0AR1>:
mov    0x10f444(%r9),%eax
movslq %edx,%rcx
mov    %eax,0x989680(,%rcx,4)
ret

LLVM IR (-O0):
define i32 @AX0AR1(i32 %0, i32 %1, i32 %2, i32 %3, i32* %4, i32* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32*
%13 = alloca i32*
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32* %4, i32** %12
store i32* %5, i32** %13
%14 = load i32*, i32** %13
%15 = getelementptr inbounds i32, i32* %14, i64 277777
%16 = load i32, i32* %15
%17 = load i32, i32* %10
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i32, i32* inttoptr (i64 10000000 to i32*), i64 %18
store i32 %16, i32* %19
%20 = load i32, i32* %7
ret i32 %20
}

LLVM IR (-O2):
define i32 @AX0AR1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture readnone %4, i32* nocapture %5) {
%7 = getelementptr inbounds i32, i32* %5, i64 277777
%8 = load i32, i32* %7
%9 = sext i32 %2 to i64
%10 = getelementptr inbounds i32, i32* inttoptr (i64 10000000 to i32*), i64 %9
store i32 %8, i32* %10
ret i32 undef
}
/* Type definitions */
struct Cyc_Absyn_Tvar {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ Cyc_Absyn_naive_tvar_cmp(struct Cyc_Absyn_Tvar *,
                                            struct Cyc_Absyn_Tvar *);
int Cyc_Absyn_naive_tvar_cmp2(struct Cyc_Absyn_Tvar *t1,
                              struct Cyc_Absyn_Tvar *t2) {
  return ({ Cyc_Absyn_naive_tvar_cmp(t1, t2); }) != 0;
}


x86 assembly (clang, -O0):
<Cyc_Absyn_naive_tvar_cmp2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <Cyc_Absyn_naive_tvar_cmp@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_Absyn_naive_tvar_cmp2>:
push   %rax
call   1030 <Cyc_Absyn_naive_tvar_cmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.Cyc_Absyn_Tvar = type { i32 }
define i32 @Cyc_Absyn_naive_tvar_cmp2(%struct.Cyc_Absyn_Tvar* %0, %struct.Cyc_Absyn_Tvar* %1) {
%3 = alloca %struct.Cyc_Absyn_Tvar*
%4 = alloca %struct.Cyc_Absyn_Tvar*
%5 = alloca i32
store %struct.Cyc_Absyn_Tvar* %0, %struct.Cyc_Absyn_Tvar** %3
store %struct.Cyc_Absyn_Tvar* %1, %struct.Cyc_Absyn_Tvar** %4
%6 = load %struct.Cyc_Absyn_Tvar*, %struct.Cyc_Absyn_Tvar** %3
%7 = load %struct.Cyc_Absyn_Tvar*, %struct.Cyc_Absyn_Tvar** %4
%8 = call i32 @Cyc_Absyn_naive_tvar_cmp(%struct.Cyc_Absyn_Tvar* %6, %struct.Cyc_Absyn_Tvar* %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp ne i32 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
%struct.Cyc_Absyn_Tvar = type { i32 }
define i32 @Cyc_Absyn_naive_tvar_cmp2(%struct.Cyc_Absyn_Tvar* %0, %struct.Cyc_Absyn_Tvar* %1) {
%3 = tail call i32 @Cyc_Absyn_naive_tvar_cmp(%struct.Cyc_Absyn_Tvar* %0, %struct.Cyc_Absyn_Tvar* %1)
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
double atan(int /*<<< orphan*/);
int /*<<< orphan*/ luaL_check_number(int);
int /*<<< orphan*/ lua_pushnumber(double);
void math_atan(void) {
  lua_pushnumber(((atan(luaL_check_number(1))) *
                  (180.0 / ((double)3.14159265358979323846))));
}


x86 assembly (clang, -O0):
<math_atan>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <luaL_check_number@plt>
mov    %eax,%edi
call   1050 <atan@plt>
movsd  0xeb3(%rip),%xmm1
mulsd  %xmm1,%xmm0
call   1040 <lua_pushnumber@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<math_atan>:
push   %rax
mov    $0x1,%edi
call   1030 <luaL_check_number@plt>
mov    %eax,%edi
call   1050 <atan@plt>
mulsd  0xeb6(%rip),%xmm0
pop    %rax
jmp    1040 <lua_pushnumber@plt>

LLVM IR (-O0):
define void @math_atan() {
%1 = call i32 @luaL_check_number(i32 1)
%2 = call double @atan(i32 %1)
%3 = fmul double %2, 0x404CA5DC1A63C1F8
%4 = call i32 @lua_pushnumber(double %3)
ret void
}

LLVM IR (-O2):
define void @math_atan() {
%1 = tail call i32 @luaL_check_number(i32 1)
%2 = tail call double @atan(i32 %1)
%3 = fmul double %2, 0x404CA5DC1A63C1F8
%4 = tail call i32 @lua_pushnumber(double %3)
ret void
}
void __cxa_pure_virtual(void) {}


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

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

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

LLVM IR (-O2):
define void @__cxa_pure_virtual() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int i = 1;
  assert(i == 1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 1, i32* %1
%2 = load i32, i32* %1
%3 = icmp eq i32 %2, 1
%4 = zext i1 %3 to i32
%5 = call i32 @assert(i32 %4)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
ret i32 0
}
unsigned int cpu_vec_exts() { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @cpu_vec_exts() {
ret i32 0
}
/* Variables and functions */
int TestModel();
int /*<<< orphan*/ printf(char *);
int main() {
  int retval = TestModel();
  if (retval == 0)
    printf("Model test OK !\n");
  else
    printf("Model test failed !\n");
  return retval;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <TestModel@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1154 <main+0x34>
lea    0xeb6(%rip),%rdi
call   1040 <printf@plt>
jmp    1160 <main+0x40>
lea    0xeb6(%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   1040 <TestModel@plt>
mov    %eax,%ebx
test   %eax,%eax
lea    0xee1(%rip),%rax
lea    0xec6(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@str = [20 x i8] c"Model test failed !\00"
@str.2 = [16 x i8] c"Model test OK !\00"
define i32 @main() {
%1 = tail call i32 (...) @TestModel()
%2 = icmp eq i32 %1, 0
%3 = select i1 %2, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @str.2, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0)
%4 = tail call i32 @puts(i8* dereferenceable(1) %3)
ret i32 %1
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ prg16setBank0(int);
void s1setParams8XXX(uint16_t addr, uint8_t val) {
  (void)addr;
  prg16setBank0(((val >> 4) & 7) << 14);
}


x86 assembly (clang, -O0):
<s1setParams8XXX>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
sar    $0x4,%edi
and    $0x7,%edi
shl    $0xe,%edi
call   1030 <prg16setBank0@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s1setParams8XXX>:
mov    %esi,%edi
and    $0x70,%edi
shl    $0xa,%edi
jmp    1030 <prg16setBank0@plt>

LLVM IR (-O0):
define void @s1setParams8XXX(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 = ashr i32 %6, 4
%8 = and i32 %7, 7
%9 = shl i32 %8, 14
%10 = call i32 @prg16setBank0(i32 %9)
ret void
}

LLVM IR (-O2):
define void @s1setParams8XXX(i32 %0, i32 %1) {
%3 = shl i32 %1, 10
%4 = and i32 %3, 114688
%5 = tail call i32 @prg16setBank0(i32 %4)
ret void
}
void SXNET_free(void) {}


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

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

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

LLVM IR (-O2):
define void @SXNET_free() {
ret void
}
/* Variables and functions */
int strncasecmp(char const *, char const *, int);
int strnicmp(const char *a, const char *b, int c) {
  return strncasecmp(a, b, c);
}


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

x86 assembly (clang, -O2):
<strnicmp>:
jmp    1030 <strncasecmp@plt>

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

LLVM IR (-O2):
define i32 @strnicmp(i8* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @strncasecmp(i8* %0, i8* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ parallel_clr_eoi(int);
int /*<<< orphan*/ parallel_set_eoi(int);
void parallel_drv0_set_eoi(unsigned char val) {
  if (val) {
    parallel_set_eoi(0x04);
  } else {
    parallel_clr_eoi(~0x04);
  }
}


x86 assembly (clang, -O0):
<parallel_drv0_set_eoi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
cmpb   $0x0,-0x1(%rbp)
je     1147 <parallel_drv0_set_eoi+0x27>
mov    $0x4,%edi
call   1040 <parallel_set_eoi@plt>
jmp    1151 <parallel_drv0_set_eoi+0x31>
mov    $0xfffffffb,%edi
call   1030 <parallel_clr_eoi@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parallel_drv0_set_eoi>:
test   %edi,%edi
je     112e <parallel_drv0_set_eoi+0xe>
mov    $0x4,%edi
jmp    1040 <parallel_set_eoi@plt>
mov    $0xfffffffb,%edi
jmp    1030 <parallel_clr_eoi@plt>

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

LLVM IR (-O2):
define void @parallel_drv0_set_eoi(i8 zeroext %0) {
%2 = icmp eq i8 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @parallel_set_eoi(i32 4)
br label %7
5: ; preds = %1
%6 = tail call i32 @parallel_clr_eoi(i32 -5)
br label %7
7: ; preds = %5, %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int getc(int /*<<< orphan*/ *);
unsigned short my_getw(FILE *f) {
  int ch;
  ch = getc(f);
  return ch | (getc(f) << 8);
}


x86 assembly (clang, -O0):
<my_getw>:
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    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getc@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
shl    $0x8,%ecx
or     %ecx,%eax
movzwl %ax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_getw>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <getc@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <getc@plt>
shl    $0x8,%eax
or     %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define zeroext i16 @my_getw(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
%6 = load i32, i32* %3
%7 = load i32*, i32** %2
%8 = call i32 @getc(i32* %7)
%9 = shl i32 %8, 8
%10 = or i32 %6, %9
%11 = trunc i32 %10 to i16
ret i16 %11
}

LLVM IR (-O2):
define zeroext i16 @my_getw(i32* nocapture %0) {
%2 = tail call i32 @getc(i32* %0)
%3 = tail call i32 @getc(i32* %0)
%4 = shl i32 %3, 8
%5 = or i32 %4, %2
%6 = trunc i32 %5 to i16
ret i16 %6
}
void simple64_help(void) { printf("%s - TBD\n", __func__); }


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

x86 assembly (clang, -O2):
<simple64_help>:
lea    0xee9(%rip),%rdi
lea    0xeec(%rip),%rsi
xor    %eax,%eax
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [10 x i8] c"%s - TBD\0A\00"
@__func__.simple64_help = [14 x i8] c"simple64_help\00"
define void @simple64_help() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @__func__.simple64_help, i64 0, i64 0))
ret void
}
int numberLength(int n) {
  int c = 0;
  while (n != 0) {
    c++;
    n /= 10;
  }
  return c;
}


x86 assembly (clang, -O0):
<numberLength>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1134 <numberLength+0x34>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    110e <numberLength+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<numberLength>:
xor    %eax,%eax
test   %edi,%edi
je     1132 <numberLength+0x32>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%eax
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rdi
add    %edx,%edi
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1110 <numberLength+0x10>
ret

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

LLVM IR (-O2):
define i32 @numberLength(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = phi i32 [ %7, %3 ], [ %0, %1 ]
%6 = add nuw nsw i32 %4, 1
%7 = sdiv i32 %5, 10
%8 = add i32 %5, 9
%9 = icmp ult i32 %8, 19
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %11
}
long _add(long EV_x, long EV_y) { return (EV_x + EV_y); }


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

x86 assembly (clang, -O2):
<_add>:
lea    (%rdi,%rsi,1),%rax
ret

LLVM IR (-O0):
define i64 @_add(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = add nsw i64 %5, %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @_add(i64 %0, i64 %1) {
%3 = add nsw i64 %1, %0
ret i64 %3
}
void av_cast5_crypt2() {}


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

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

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

LLVM IR (-O2):
define void @av_cast5_crypt2() {
ret void
}
/* Variables and functions */
unsigned int atoul(char const *);
unsigned int atoui(const char *num) { return atoul(num); }


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

x86 assembly (clang, -O2):
<atoui>:
jmp    1030 <atoul@plt>

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

LLVM IR (-O2):
define i32 @atoui(i8* %0) {
%2 = tail call i32 @atoul(i8* %0)
ret i32 %2
}
void gtk_progress_bar_orientation_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gtk_progress_bar_orientation_get_type() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bar(int);
void w(int i) { bar(1); }


x86 assembly (clang, -O0):
<w>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%edi
call   1030 <bar@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @w(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @bar(i32 1)
ret void
}

LLVM IR (-O2):
define void @w(i32 %0) {
%2 = tail call i32 @bar(i32 1)
ret void
}
void drv_base_init_hbar() {}


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

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

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

LLVM IR (-O2):
define void @drv_base_init_hbar() {
ret void
}
/* Type definitions */
struct parg_state {
  int dummy;
};

/* Variables and functions */
int parg_getopt_long(struct parg_state *, int, char *const *, char const *,
                     int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int parg_getopt(struct parg_state *ps, int argc, char *const argv[],
                const char *optstring) {
  return parg_getopt_long(ps, argc, argv, optstring, NULL, NULL);
}


x86 assembly (clang, -O0):
<parg_getopt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%r9d
mov    %r9,%r8
call   1030 <parg_getopt_long@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parg_getopt>:
xor    %r8d,%r8d
xor    %r9d,%r9d
jmp    1030 <parg_getopt_long@plt>

LLVM IR (-O0):
%struct.parg_state = type { i32 }
define i32 @parg_getopt(%struct.parg_state* %0, i32 %1, i8** %2, i8* %3) {
%5 = alloca %struct.parg_state*
%6 = alloca i32
%7 = alloca i8**
%8 = alloca i8*
store %struct.parg_state* %0, %struct.parg_state** %5
store i32 %1, i32* %6
store i8** %2, i8*** %7
store i8* %3, i8** %8
%9 = load %struct.parg_state*, %struct.parg_state** %5
%10 = load i32, i32* %6
%11 = load i8**, i8*** %7
%12 = load i8*, i8** %8
%13 = call i32 @parg_getopt_long(%struct.parg_state* %9, i32 %10, i8** %11, i8* %12, i32* null, i32* null)
ret i32 %13
}

LLVM IR (-O2):
%struct.parg_state = type { i32 }
define i32 @parg_getopt(%struct.parg_state* %0, i32 %1, i8** %2, i8* %3) {
%5 = tail call i32 @parg_getopt_long(%struct.parg_state* %0, i32 %1, i8** %2, i8* %3, i32* null, i32* null)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
bool sector_error(bool sector_exist) {
  if (!sector_exist) {
    printf("Sector does not exist\n");
  }
}


x86 assembly (clang, -O0):
<sector_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <sector_error+0x21>
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sector_error>:
test   %edi,%edi
je     1115 <sector_error+0x5>
ret
push   %rax
lea    0xee3(%rip),%rdi
call   1030 <puts@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
@str = [22 x i8] c"Sector does not exist\00"
define i32 @sector_error(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
br label %5
5: ; preds = %3, %1
ret i32 undef
}