xunge/DecIR huggingface dataset:
int ast_strlen_zero(const char *s) { return (!s || (*s == '\0')); }


x86 assembly (clang, -O0):
<ast_strlen_zero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%al
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1128 <ast_strlen_zero+0x28>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ast_strlen_zero>:
test   %rdi,%rdi
je     110e <ast_strlen_zero+0xe>
xor    %eax,%eax
cmpb   $0x0,(%rdi)
sete   %al
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @ast_strlen_zero(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 0
br label %10
10: ; preds = %5, %1
%11 = phi i1 [ true, %1 ], [ %9, %5 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @ast_strlen_zero(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 1, %1 ], [ %6, %3 ]
ret i32 %8
}
/* Variables and functions */
int rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/);
int rdp_get_seq_number() {
  srand(time(0));
  return rand() & 0xffff;
}


x86 assembly (clang, -O0):
<rdp_get_seq_number>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
mov    $0x0,%al
call   1050 <rand@plt>
and    $0xffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rdp_get_seq_number>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
movzwl %ax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @rdp_get_seq_number() {
%1 = call i32 @time(i32 0)
%2 = call i32 @srand(i32 %1)
%3 = call i32 (...) @rand()
%4 = and i32 %3, 65535
ret i32 %4
}

LLVM IR (-O2):
define i32 @rdp_get_seq_number() {
%1 = tail call i32 @time(i32 0)
%2 = tail call i32 @srand(i32 %1)
%3 = tail call i32 (...) @rand()
%4 = and i32 %3, 65535
ret i32 %4
}
double normSqr(const double *a) {
  return (a[0] * a[0] + a[1] * a[1] + a[2] * a[2]);
}


x86 assembly (clang, -O0):
<normSqr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
mulsd  0x8(%rax),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<normSqr>:
movsd  (%rdi),%xmm1
movsd  0x8(%rdi),%xmm0
mulsd  %xmm0,%xmm0
mulsd  %xmm1,%xmm1
addsd  %xmm0,%xmm1
movsd  0x10(%rdi),%xmm0
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @normSqr(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 = load double*, double** %2
%18 = getelementptr inbounds double, double* %17, i64 2
%19 = load double, double* %18
%20 = load double*, double** %2
%21 = getelementptr inbounds double, double* %20, i64 2
%22 = load double, double* %21
%23 = call double @llvm.fmuladd.f64(double %19, double %22, double %16)
ret double %23
}

LLVM IR (-O2):
define double @normSqr(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 = getelementptr inbounds double, double* %0, i64 2
%8 = load double, double* %7
%9 = tail call double @llvm.fmuladd.f64(double %8, double %8, double %6)
ret double %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
int main() {
  printf("begin\n");
  sleep(1);
  printf("end\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"begin\0A\00"
@.str.1 = [5 x i8] c"end\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @sleep(i32 1)
%4 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [6 x i8] c"begin\00"
@str.2 = [4 x i8] c"end\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @sleep(i32 1)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
void activate_bison_debug() {}


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

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

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

LLVM IR (-O2):
define void @activate_bison_debug() {
ret void
}
int __ltldouble(long double a, long double b) { return a < b; }


x86 assembly (clang, -O0):
<__ltldouble>:
push   %rbp
mov    %rsp,%rbp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
fucomip %st(1),%st
fstp   %st(0)
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ltldouble>:
fldt   0x8(%rsp)
fldt   0x18(%rsp)
xor    %eax,%eax
fucomip %st(1),%st
fstp   %st(0)
seta   %al
ret

LLVM IR (-O0):
define i32 @__ltldouble(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
store x86_fp80 %1, x86_fp80* %4
%5 = load x86_fp80, x86_fp80* %3
%6 = load x86_fp80, x86_fp80* %4
%7 = fcmp olt x86_fp80 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @__ltldouble(x86_fp80 %0, x86_fp80 %1) {
%3 = fcmp olt x86_fp80 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void macscp3_2() { puts("macscp3_2"); }


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

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

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

LLVM IR (-O2):
@.str = [10 x i8] c"macscp3_2\00"
define void @macscp3_2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
double exp(double);
double dBbp2a(double x) {
  return ((1.0 - x) * exp(x) - 1.0) / ((exp(x) - 1.0) * (exp(x) - 1.0));
}


x86 assembly (clang, -O0):
<dBbp2a>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xebb(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <exp@plt>
movsd  0xe98(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <exp@plt>
movsd  -0x18(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x10(%rbp),%xmm0
movsd  0xe70(%rip),%xmm3
subsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dBbp2a>:
sub    $0x18,%rsp
movsd  %xmm0,0x8(%rsp)
movsd  0xede(%rip),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,(%rsp)
call   1030 <exp@plt>
mulsd  (%rsp),%xmm0
addsd  0xecb(%rip),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <exp@plt>
addsd  0xeb3(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <exp@plt>
addsd  0xe9a(%rip),%xmm0
mulsd  0x10(%rsp),%xmm0
movsd  (%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @dBbp2a(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fsub double 1.000000e+00, %3
%5 = load double, double* %2
%6 = call double @exp(double %5)
%7 = call double @llvm.fmuladd.f64(double %4, double %6, double -1.000000e+00)
%8 = load double, double* %2
%9 = call double @exp(double %8)
%10 = fsub double %9, 1.000000e+00
%11 = load double, double* %2
%12 = call double @exp(double %11)
%13 = fsub double %12, 1.000000e+00
%14 = fmul double %10, %13
%15 = fdiv double %7, %14
ret double %15
}

LLVM IR (-O2):
define double @dBbp2a(double %0) {
%2 = fsub double 1.000000e+00, %0
%3 = tail call double @exp(double %0)
%4 = tail call double @llvm.fmuladd.f64(double %2, double %3, double -1.000000e+00)
%5 = tail call double @exp(double %0)
%6 = fadd double %5, -1.000000e+00
%7 = tail call double @exp(double %0)
%8 = fadd double %7, -1.000000e+00
%9 = fmul double %6, %8
%10 = fdiv double %4, %9
ret double %10
}
/* Variables and functions */
int /*<<< orphan*/ putMessage(unsigned char *, int);
void nrf_cmd_flush_rx(void) {
  unsigned char cmd;
  cmd = 0x07;
  putMessage(&cmd, 1);
}


x86 assembly (clang, -O0):
<nrf_cmd_flush_rx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x7,-0x1(%rbp)
lea    -0x1(%rbp),%rdi
mov    $0x1,%esi
call   1030 <putMessage@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nrf_cmd_flush_rx>:
push   %rax
movb   $0x7,0x7(%rsp)
lea    0x7(%rsp),%rdi
mov    $0x1,%esi
call   1030 <putMessage@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @nrf_cmd_flush_rx() {
%1 = alloca i8
store i8 7, i8* %1
%2 = call i32 @putMessage(i8* %1, i32 1)
ret void
}

LLVM IR (-O2):
define void @nrf_cmd_flush_rx() {
%1 = alloca i8
store i8 7, i8* %1
%2 = call i32 @putMessage(i8* %1, i32 1)
ret void
}
__attribute__((always_)) int local_memory_node(int node_id) { return node_id; }


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

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

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

LLVM IR (-O2):
define i32 @local_memory_node(i32 returned %0) {
ret i32 %0
}
void vnum_test9(int *data) {
  int i = data[0];
  int j = data[1];
  if (i == j)
    data[2] = (i - j) * 21;
  else
    data[2] = i + j;
}


x86 assembly (clang, -O0):
<vnum_test9>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jne    113c <vnum_test9+0x3c>
mov    -0xc(%rbp),%eax
sub    -0x10(%rbp),%eax
imul   $0x15,%eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x8(%rax)
jmp    1149 <vnum_test9+0x49>
mov    -0xc(%rbp),%ecx
add    -0x10(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<vnum_test9>:
mov    (%rdi),%eax
mov    0x4(%rdi),%ecx
lea    (%rcx,%rax,1),%edx
xor    %esi,%esi
cmp    %ecx,%eax
cmovne %edx,%esi
mov    %esi,0x8(%rdi)
ret

LLVM IR (-O0):
define void @vnum_test9(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = getelementptr inbounds i32, i32* %5, i64 0
%7 = load i32, i32* %6
store i32 %7, i32* %3
%8 = load i32*, i32** %2
%9 = getelementptr inbounds i32, i32* %8, i64 1
%10 = load i32, i32* %9
store i32 %10, i32* %4
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = icmp eq i32 %11, %12
br i1 %13, label %14, label %21
14: ; preds = %1
%15 = load i32, i32* %3
%16 = load i32, i32* %4
%17 = sub nsw i32 %15, %16
%18 = mul nsw i32 %17, 21
%19 = load i32*, i32** %2
%20 = getelementptr inbounds i32, i32* %19, i64 2
store i32 %18, i32* %20
br label %27
21: ; preds = %1
%22 = load i32, i32* %3
%23 = load i32, i32* %4
%24 = add nsw i32 %22, %23
%25 = load i32*, i32** %2
%26 = getelementptr inbounds i32, i32* %25, i64 2
store i32 %24, i32* %26
br label %27
27: ; preds = %21, %14
ret void
}

LLVM IR (-O2):
define void @vnum_test9(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = load i32, i32* %3
%5 = icmp eq i32 %2, %4
%6 = add nsw i32 %4, %2
%7 = select i1 %5, i32 0, i32 %6
%8 = getelementptr inbounds i32, i32* %0, i64 2
store i32 %7, i32* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void outChar(char *x) {
  if (x)
    printf("%c ", *x);
}


x86 assembly (clang, -O0):
<outChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     113a <outChar+0x2a>
mov    -0x8(%rbp),%rax
lea    0xece(%rip),%rdi
movsbl (%rax),%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outChar>:
test   %rdi,%rdi
je     1124 <outChar+0x14>
movsbl (%rdi),%esi
lea    0xee1(%rip),%rdi
jmp    1030 <printf@plt>
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%c \00"
define void @outChar(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %4)
br label %6
6: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ stress_float_put(float const);
float __attribute__((no))
stress_funccall_float_3(const float a, const float b, const float c) {
  stress_float_put(a);
  stress_float_put(b);
  stress_float_put(c);
  return a + b + c;
}


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

x86 assembly (clang, -O2):
<stress_funccall_float_3>:
sub    $0x18,%rsp
movss  %xmm2,0x10(%rsp)
movss  %xmm1,0xc(%rsp)
movss  %xmm0,0x14(%rsp)
call   1030 <stress_float_put@plt>
movss  0xc(%rsp),%xmm0
call   1030 <stress_float_put@plt>
movss  0x10(%rsp),%xmm0
call   1030 <stress_float_put@plt>
movss  0x14(%rsp),%xmm0
addss  0xc(%rsp),%xmm0
addss  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define float @stress_funccall_float_3(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 = call i32 @stress_float_put(float %7)
%9 = load float, float* %5
%10 = call i32 @stress_float_put(float %9)
%11 = load float, float* %6
%12 = call i32 @stress_float_put(float %11)
%13 = load float, float* %4
%14 = load float, float* %5
%15 = fadd float %13, %14
%16 = load float, float* %6
%17 = fadd float %15, %16
ret float %17
}

LLVM IR (-O2):
define float @stress_funccall_float_3(float %0, float %1, float %2) {
%4 = tail call i32 @stress_float_put(float %0)
%5 = tail call i32 @stress_float_put(float %1)
%6 = tail call i32 @stress_float_put(float %2)
%7 = fadd float %0, %1
%8 = fadd float %7, %2
ret float %8
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int product_pythagorean_triplet(int);
int main() {
  assert(12180 == product_pythagorean_triplet(70));
  assert(31875000 == product_pythagorean_triplet(1000));
  assert(31875000000 == product_pythagorean_triplet(10000));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x46,%edi
call   1040 <product_pythagorean_triplet@plt>
mov    %eax,%ecx
mov    $0x2f94,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    $0x3e8,%edi
call   1040 <product_pythagorean_triplet@plt>
mov    %eax,%ecx
mov    $0x1e65fb8,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    $0x2710,%edi
call   1040 <product_pythagorean_triplet@plt>
movslq %eax,%rcx
movabs $0x76be5e6c0,%rax
cmp    %rcx,%rax
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    $0x46,%edi
call   1040 <product_pythagorean_triplet@plt>
xor    %edi,%edi
cmp    $0x2f94,%eax
sete   %dil
call   1030 <assert@plt>
mov    $0x3e8,%edi
call   1040 <product_pythagorean_triplet@plt>
xor    %edi,%edi
cmp    $0x1e65fb8,%eax
sete   %dil
call   1030 <assert@plt>
mov    $0x2710,%edi
call   1040 <product_pythagorean_triplet@plt>
xor    %edi,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @product_pythagorean_triplet(i32 70)
%3 = icmp eq i32 12180, %2
%4 = zext i1 %3 to i32
%5 = call i32 @assert(i32 %4)
%6 = call i32 @product_pythagorean_triplet(i32 1000)
%7 = icmp eq i32 31875000, %6
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = call i32 @product_pythagorean_triplet(i32 10000)
%11 = sext i32 %10 to i64
%12 = icmp eq i64 31875000000, %11
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @product_pythagorean_triplet(i32 70)
%2 = icmp eq i32 %1, 12180
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 @product_pythagorean_triplet(i32 1000)
%6 = icmp eq i32 %5, 31875000
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = tail call i32 @product_pythagorean_triplet(i32 10000)
%10 = tail call i32 @assert(i32 0)
ret i32 0
}
/* Variables and functions */
char const *ERR_getErrorName(size_t);
const char *ZBUFFv05_getErrorName(size_t errorCode) {
  return ERR_getErrorName(errorCode);
}


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

x86 assembly (clang, -O2):
<ZBUFFv05_getErrorName>:
jmp    1030 <ERR_getErrorName@plt>

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

LLVM IR (-O2):
define i8* @ZBUFFv05_getErrorName(i64 %0) {
%2 = tail call i8* @ERR_getErrorName(i64 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void *, unsigned long);
unsigned char mem_copy_to_offset(void *dst, unsigned long dst_offset,
                                 char *bytes, unsigned long len) {
  memcpy((void *)(((char *)dst) + dst_offset), (void *)bytes, len);
  return (1);
}


x86 assembly (clang, -O0):
<mem_copy_to_offset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
add    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <memcpy@plt>
mov    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_copy_to_offset>:
push   %rax
add    %rsi,%rdi
mov    %rdx,%rsi
mov    %rcx,%rdx
call   1030 <memcpy@plt>
mov    $0x1,%al
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i8 @mem_copy_to_offset(i8* %0, i64 %1, i8* %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i64
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = getelementptr inbounds i8, i8* %9, i64 %10
%12 = load i8*, i8** %7
%13 = load i64, i64* %8
%14 = call i32 @memcpy(i8* %11, i8* %12, i64 %13)
ret i8 1
}

LLVM IR (-O2):
define zeroext i8 @mem_copy_to_offset(i8* %0, i64 %1, i8* %2, i64 %3) {
%5 = getelementptr inbounds i8, i8* %0, i64 %1
%6 = tail call i32 @memcpy(i8* %5, i8* %2, i64 %3)
ret i8 1
}
/* Variables and functions */
int SerialIsGetChar();
int /*<<< orphan*/ SerialIsReadyChar();
int console_getc(void) {
  while (!SerialIsReadyChar())
    ;
  return SerialIsGetChar() & 0xFF;
}


x86 assembly (clang, -O0):
<console_getc>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <console_getc+0x9>
mov    $0x0,%al
call   1030 <SerialIsReadyChar@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1145 <console_getc+0x25>
jmp    114a <console_getc+0x2a>
jmp    1129 <console_getc+0x9>
mov    $0x0,%al
call   1040 <SerialIsGetChar@plt>
and    $0xff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<console_getc>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <SerialIsReadyChar@plt>
test   %eax,%eax
je     1130 <console_getc+0x10>
xor    %eax,%eax
call   1040 <SerialIsGetChar@plt>
movzbl %al,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @console_getc() {
br label %1
1: ; preds = %5, %0
%2 = call i32 (...) @SerialIsReadyChar()
%3 = icmp ne i32 %2, 0
%4 = xor i1 %3, true
br i1 %4, label %5, label %6
5: ; preds = %1
br label %1
6: ; preds = %1
%7 = call i32 (...) @SerialIsGetChar()
%8 = and i32 %7, 255
ret i32 %8
}

LLVM IR (-O2):
define i32 @console_getc() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @SerialIsReadyChar()
%3 = icmp eq i32 %2, 0
br i1 %3, label %1, label %4
4: ; preds = %1
%5 = tail call i32 (...) @SerialIsGetChar()
%6 = and i32 %5, 255
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ anoi(unsigned int, char *, char *, char *);
int /*<<< orphan*/ scanf(char *, unsigned int *);
int main() {
  unsigned n;
  scanf("%u", &n);
  anoi(n, "foo", "bar", "baz");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <scanf@plt>
mov    -0x8(%rbp),%edi
lea    0xeba(%rip),%rsi
lea    0xeb7(%rip),%rdx
lea    0xeb4(%rip),%rcx
call   1040 <anoi@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1030 <scanf@plt>
mov    0x4(%rsp),%edi
lea    0xec6(%rip),%rsi
lea    0xec3(%rip),%rdx
lea    0xec0(%rip),%rcx
call   1040 <anoi@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%u\00"
@.str.1 = [4 x i8] c"foo\00"
@.str.2 = [4 x i8] c"bar\00"
@.str.3 = [4 x i8] c"baz\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = load i32, i32* %2
%5 = call i32 @anoi(i32 %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%u\00"
@.str.1 = [4 x i8] c"foo\00"
@.str.2 = [4 x i8] c"bar\00"
@.str.3 = [4 x i8] c"baz\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @anoi(i32 %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float, float, float);
float Multiplication(float a, float b) {
  printf("\nResult of Multiplication %.2f and %.2f is %.2f.", a, b, a * b);
  return a * b;
}


x86 assembly (clang, -O0):
<Multiplication>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0x4(%rbp),%xmm2
mulss  -0x8(%rbp),%xmm2
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
movss  -0x4(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Multiplication>:
push   %rax
movaps %xmm0,%xmm2
mulss  %xmm1,%xmm2
movss  %xmm2,0x4(%rsp)
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
movss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [49 x i8] c"\0AResult of Multiplication %.2f and %.2f is %.2f.\00"
define float @Multiplication(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = load float, float* %3
%8 = load float, float* %4
%9 = fmul float %7, %8
%10 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), float %5, float %6, float %9)
%11 = load float, float* %3
%12 = load float, float* %4
%13 = fmul float %11, %12
ret float %13
}

LLVM IR (-O2):
@.str = [49 x i8] c"\0AResult of Multiplication %.2f and %.2f is %.2f.\00"
define float @Multiplication(float %0, float %1) {
%3 = fmul float %0, %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), float %0, float %1, float %3)
ret float %3
}
/* Type definitions */
typedef int /*<<< orphan*/ sem_t;

/* Variables and functions */
scalar_t__ sem_init(int /*<<< orphan*/ *, int /*<<< orphan*/,
                    int /*<<< orphan*/);
int /*<<< orphan*/ terminal_error(char *);
void init_sem(sem_t *sem) {
  if (sem_init(sem, 0, 0))
    terminal_error("sem_init");
}


x86 assembly (clang, -O0):
<init_sem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %edx,%edx
mov    %edx,%esi
call   1030 <sem_init@plt>
cmp    $0x0,%rax
je     114f <init_sem+0x2f>
lea    0xeb6(%rip),%rdi
call   1040 <terminal_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_sem>:
push   %rax
xor    %esi,%esi
xor    %edx,%edx
call   1030 <sem_init@plt>
test   %rax,%rax
je     113c <init_sem+0x1c>
lea    0xeca(%rip),%rdi
pop    %rax
jmp    1040 <terminal_error@plt>
pop    %rax
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"sem_init\00"
define void @init_sem(i32* %0) {
%2 = tail call i64 @sem_init(i32* %0, i32 0, i32 0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @terminal_error(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ anvil_syslog(int /*<<< orphan*/, char *);
int /*<<< orphan*/ wait4(int /*<<< orphan*/, int *, int, int /*<<< orphan*/ *);
pid_t waitpid(pid_t pid, int *stat_loc, int options) {
  anvil_syslog(0, "Calling waitpid()\n");
  return wait4(pid, stat_loc, options, NULL);
}


x86 assembly (clang, -O0):
<waitpid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
xor    %edi,%edi
lea    0xec5(%rip),%rsi
call   1030 <anvil_syslog@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
xor    %eax,%eax
mov    %eax,%ecx
call   1040 <wait4@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<waitpid>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xecd(%rip),%rsi
xor    %edi,%edi
call   1030 <anvil_syslog@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14d,%edx
xor    %ecx,%ecx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <wait4@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"Calling waitpid()\0A\00"
define i32 @waitpid(i32 %0, i32* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
store i32 %0, i32* %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%7 = call i32 @anvil_syslog(i32 0, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* %4
%9 = load i32*, i32** %5
%10 = load i32, i32* %6
%11 = call i32 @wait4(i32 %8, i32* %9, i32 %10, i32* null)
ret i32 %11
}

LLVM IR (-O2):
@.str = [19 x i8] c"Calling waitpid()\0A\00"
define i32 @waitpid(i32 %0, i32* %1, i32 %2) {
%4 = tail call i32 @anvil_syslog(i32 0, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @wait4(i32 %0, i32* %1, i32 %2, i32* null)
ret i32 %5
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
bool mp2vpicx_get_compositedisplay(const uint8_t *p_mp2vpicx) {
  return !!(p_mp2vpicx[8] & 0x40);
}


x86 assembly (clang, -O0):
<mp2vpicx_get_compositedisplay>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x20(%rax),%eax
and    $0x40,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp2vpicx_get_compositedisplay>:
mov    0x20(%rdi),%eax
shr    $0x6,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @mp2vpicx_get_compositedisplay(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 8
%5 = load i32, i32* %4
%6 = and i32 %5, 64
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @mp2vpicx_get_compositedisplay(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 8
%3 = load i32, i32* %2
%4 = lshr i32 %3, 6
%5 = and i32 %4, 1
ret i32 %5
}
/* Type definitions */
struct in6_addr {
  int dummy;
};

/* Variables and functions */
int memcmp(struct in6_addr const *, struct in6_addr const *, int);
int ipv6_addr_cmp(const struct in6_addr *a1, const struct in6_addr *a2) {
  return memcmp(a1, a2, sizeof(struct in6_addr));
}


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

x86 assembly (clang, -O2):
<ipv6_addr_cmp>:
mov    $0x4,%edx
jmp    1030 <memcmp@plt>

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

LLVM IR (-O2):
%struct.in6_addr = type { i32 }
define i32 @ipv6_addr_cmp(%struct.in6_addr* %0, %struct.in6_addr* %1) {
%3 = tail call i32 @memcmp(%struct.in6_addr* %0, %struct.in6_addr* %1, i32 4)
ret i32 %3
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int solcon_retrieve_standard_solution(int n, int k, int *m, double *sol) {
  int fail;
  fail = _ada_use_c2phc4c(34, &k, m, sol, 0);
  return fail;
}


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

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

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

LLVM IR (-O2):
define i32 @solcon_retrieve_standard_solution(i32 %0, i32 %1, i32* %2, double* %3) {
%5 = alloca i32
store i32 %1, i32* %5
%6 = call i32 @_ada_use_c2phc4c(i32 34, i32* %5, i32* %2, double* %3, i32 0)
ret i32 %6
}
int cmp(const int *a, const int *b) { return *a < *b ? -1 : 1; }


x86 assembly (clang, -O0):
<cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    $0x1,%eax
mov    $0xffffffff,%ecx
cmp    %esi,%edx
cmovl  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%eax
setge  %cl
lea    (%rcx,%rcx,1),%eax
add    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @cmp(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %3, %4
%6 = select i1 %5, i32 -1, i32 1
ret i32 %6
}
int anything(int i) { return i * i; }


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

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

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

LLVM IR (-O2):
define i32 @anything(i32 %0) {
%2 = mul nsw i32 %0, %0
ret i32 %2
}
__attribute__((no)) long trampoline_create_code_heap(unsigned long n1,
                                                     unsigned long n2,
                                                     unsigned long n3) {
  long ret;
  __asm__ __volatile__("leaq 1f(%%rip), %%r11\n\t"
                       "movq %%r11, %%fs:0x20\n\t"
                       "jmpq *%%gs:0x10000+"
                       "0xA0"
                       "\n\t"
                       "1:\n\t"
                       : "=a"(ret)
                       : "D"(n1), "S"(n2), "d"(n3)
                       : "memory");
  return ret;
}


x86 assembly (clang, -O0):
<trampoline_create_code_heap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0x11(%rip),%r11
mov    %r11,%fs:0x20
jmp    *%gs:0x100a0
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<trampoline_create_code_heap>:
lea    0x11(%rip),%r11
mov    %r11,%fs:0x20
jmp    *%gs:0x100a0
ret

LLVM IR (-O0):
define i64 @trampoline_create_code_heap(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%8 = load i64, i64* %4
%9 = load i64, i64* %5
%10 = load i64, i64* %6
%11 = call i64 asm sideeffect "leaq 1f(%rip), %r11\0A\09movq %r11, %fs:0x20\0A\09jmpq *%gs:0x10000+0xA0\0A\091:\0A\09", "={ax},{di},{si},{dx},~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %8, i64 %9, i64 %10)
store i64 %11, i64* %7
%12 = load i64, i64* %7
ret i64 %12
}

LLVM IR (-O2):
define i64 @trampoline_create_code_heap(i64 %0, i64 %1, i64 %2) {
%4 = tail call i64 asm sideeffect "leaq 1f(%rip), %r11\0A\09movq %r11, %fs:0x20\0A\09jmpq *%gs:0x10000+0xA0\0A\091:\0A\09", "={ax},{di},{si},{dx},~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %0, i64 %1, i64 %2)
ret i64 %4
}
int main(void) {
  char tmp[128];
  __float128 x = sqrtq(2.0Q);
  quadmath_snprintf(tmp, sizeof tmp, "%.45Qf", x);
  printf("%s\n", tmp);
  printf("%zu \n", sizeof(__float128));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x4(%rbp)
movaps 0xeb7(%rip),%xmm0
mov    $0x1,%al
call   1030 <sqrtq@plt>
mov    %eax,%edi
call   11c0 <__floatsitf>
movaps %xmm0,-0xa0(%rbp)
lea    -0x90(%rbp),%rdi
movaps -0xa0(%rbp),%xmm0
mov    $0x80,%esi
lea    0xe98(%rip),%rdx
mov    $0x1,%al
call   1050 <quadmath_snprintf@plt>
lea    -0x90(%rbp),%rsi
lea    0xe8a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe80(%rip),%rdi
mov    $0x10,%esi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0xa0,%rsp
pop    %rbp
ret
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x80,%rsp
movaps 0xeb1(%rip),%xmm0
mov    $0x1,%al
call   1030 <sqrtq@plt>
mov    %eax,%edi
call   11a0 <__floatsitf>
lea    0xeac(%rip),%rdx
mov    %rsp,%rbx
mov    $0x80,%esi
mov    %rbx,%rdi
mov    $0x1,%al
call   1060 <quadmath_snprintf@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
lea    0xe92(%rip),%rdi
mov    $0x10,%esi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbx
ret
nopl   0x0(%rax)

LLVM IR (-O0):
@.str = [7 x i8] c"%.45Qf\00"
@.str.1 = [4 x i8] c"%s\0A\00"
@.str.2 = [6 x i8] c"%zu \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [128 x i8]
%3 = alloca fp128
store i32 0, i32* %1
%4 = call i32 (fp128, ...) bitcast (i32 (...)* @sqrtq to i32 (fp128, ...)*)(fp128 0xL00000000000000004000000000000000)
%5 = sitofp i32 %4 to fp128
store fp128 %5, fp128* %3
%6 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%7 = load fp128, fp128* %3
%8 = call i32 (i8*, i64, i8*, fp128, ...) bitcast (i32 (...)* @quadmath_snprintf to i32 (i8*, i64, i8*, fp128, ...)*)(i8* %6, i64 128, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), fp128 %7)
%9 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %9)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i64 16)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%.45Qf\00"
@.str.2 = [6 x i8] c"%zu \0A\00"
define i32 @main() {
%1 = alloca [128 x i8]
%2 = getelementptr inbounds [128 x i8], [128 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (fp128, ...) bitcast (i32 (...)* @sqrtq to i32 (fp128, ...)*)(fp128 0xL00000000000000004000000000000000)
%4 = sitofp i32 %3 to fp128
%5 = call i32 (i8*, i64, i8*, fp128, ...) bitcast (i32 (...)* @quadmath_snprintf to i32 (i8*, i64, i8*, fp128, ...)*)(i8* %2, i64 128, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), fp128 %4)
%6 = call i32 @puts(i8* %2)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i64 16)
ret i32 0
}
void vtime_guest_enter(struct task_struct *tsk) {}


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

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

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

LLVM IR (-O2):
%struct.task_struct = type opaque
define void @vtime_guest_enter(%struct.task_struct* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ genconfig(char *);
int /*<<< orphan*/ strcat(char *, char *);
char *gencmd(char *cmd) {
  char tmp[256];
  genconfig(tmp);
  cmd[0] = '/';
  cmd[0] = 'b';
  cmd[0] = 'i';
  cmd[0] = 'n';
  cmd[0] = '/';
  cmd[0] = 's';
  cmd[0] = 'h';
  cmd[0] = ' ';
  cmd[0] = '\0';
  strcat(cmd, tmp);
}


x86 assembly (clang, -O0):
<gencmd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %rdi,-0x10(%rbp)
lea    -0x110(%rbp),%rdi
call   1030 <genconfig@plt>
mov    -0x10(%rbp),%rax
movb   $0x2f,(%rax)
mov    -0x10(%rbp),%rax
movb   $0x62,(%rax)
mov    -0x10(%rbp),%rax
movb   $0x69,(%rax)
mov    -0x10(%rbp),%rax
movb   $0x6e,(%rax)
mov    -0x10(%rbp),%rax
movb   $0x2f,(%rax)
mov    -0x10(%rbp),%rax
movb   $0x73,(%rax)
mov    -0x10(%rbp),%rax
movb   $0x68,(%rax)
mov    -0x10(%rbp),%rax
movb   $0x20,(%rax)
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rdi
lea    -0x110(%rbp),%rsi
call   1040 <strcat@plt>
mov    -0x8(%rbp),%rax
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gencmd>:
push   %r14
push   %rbx
sub    $0x108,%rsp
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %r14,%rdi
call   1030 <genconfig@plt>
movb   $0x0,(%rbx)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <strcat@plt>
add    $0x108,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @gencmd(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca [256 x i8]
store i8* %0, i8** %3
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%6 = call i32 @genconfig(i8* %5)
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8, i8* %7, i64 0
store i8 47, i8* %8
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 0
store i8 98, i8* %10
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i64 0
store i8 105, i8* %12
%13 = load i8*, i8** %3
%14 = getelementptr inbounds i8, i8* %13, i64 0
store i8 110, i8* %14
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i64 0
store i8 47, i8* %16
%17 = load i8*, i8** %3
%18 = getelementptr inbounds i8, i8* %17, i64 0
store i8 115, i8* %18
%19 = load i8*, i8** %3
%20 = getelementptr inbounds i8, i8* %19, i64 0
store i8 104, i8* %20
%21 = load i8*, i8** %3
%22 = getelementptr inbounds i8, i8* %21, i64 0
store i8 32, i8* %22
%23 = load i8*, i8** %3
%24 = getelementptr inbounds i8, i8* %23, i64 0
store i8 0, i8* %24
%25 = load i8*, i8** %3
%26 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%27 = call i32 @strcat(i8* %25, i8* %26)
%28 = load i8*, i8** %2
ret i8* %28
}

LLVM IR (-O2):
define noalias i8* @gencmd(i8* %0) {
%2 = alloca [256 x i8]
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%4 = call i32 @genconfig(i8* %3)
store i8 0, i8* %0
%5 = call i32 @strcat(i8* %0, i8* %3)
ret i8* undef
}
__attribute__((no_sanitize("implicit-integer-truncation"),
               no_sanitize("implicit-integer-sign-change"))) signed char
unsigned_int_to_signed_char__no_sanitizers(unsigned int src) {
  return src;
}


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

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

LLVM IR (-O0):
define signext i8 @unsigned_int_to_signed_char__no_sanitizers(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = trunc i32 %3 to i8
ret i8 %4
}

LLVM IR (-O2):
define signext i8 @unsigned_int_to_signed_char__no_sanitizers(i32 %0) {
%2 = trunc i32 %0 to i8
ret i8 %2
}
double MtoFT(double M) { return M * 3.2808399; }


x86 assembly (clang, -O0):
<MtoFT>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<MtoFT>:
mulsd  0xef8(%rip),%xmm0
ret

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

LLVM IR (-O2):
define double @MtoFT(double %0) {
%2 = fmul double %0, 0x400A3F28FD4F4B98
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ f(int);
int main(void) {
  f(-1);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 -1)
ret i32 0
}
void uevent_unregister_notifier(struct uevent_notify *nb) {}


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

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

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

LLVM IR (-O2):
%struct.uevent_notify = type opaque
define void @uevent_unregister_notifier(%struct.uevent_notify* nocapture %0) {
ret void
}
double _Complex add_double_rr(double a, double b) { return a + b; }


x86 assembly (clang, -O0):
<add_double_rr>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x18(%rbp)
movsd  %xmm1,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movq   $0x0,-0x8(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_double_rr>:
addsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ret

LLVM IR (-O0):
define { double, double } @add_double_rr(double %0, double %1) {
%3 = alloca { double, double }
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %4
%7 = load double, double* %5
%8 = fadd double %6, %7
%9 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 0
%10 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 1
store double %8, double* %9
store double 0.000000e+00, double* %10
%11 = load { double, double }, { double, double }* %3
ret { double, double } %11
}

LLVM IR (-O2):
define { double, double } @add_double_rr(double %0, double %1) {
%3 = fadd double %0, %1
%4 = insertvalue { double, double } poison, double %3, 0
%5 = insertvalue { double, double } %4, double 0.000000e+00, 1
ret { double, double } %5
}