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

/* Variables and functions */
int /*<<< orphan*/ fs_univ_append(int /*<<< orphan*/, int /*<<< orphan*/, int,
                                  int /*<<< orphan*/, int /*<<< orphan*/,
                                  int /*<<< orphan*/, int /*<<< orphan*/,
                                  int /*<<< orphan*/ *);
uint8_t fs_mr_append(uint32_t ts, uint32_t inode, uint32_t inode_src) {
  return fs_univ_append(ts, 0, 0x80, inode, inode_src, 0, 0, NULL);
}


x86 assembly (clang, -O0):
<fs_mr_append>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%ecx
mov    -0xc(%rbp),%r8d
xor    %r9d,%r9d
mov    $0x80,%edx
xor    %eax,%eax
mov    %r9d,%esi
movl   $0x0,(%rsp)
movq   $0x0,0x8(%rsp)
call   1030 <fs_univ_append@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fs_mr_append>:
push   %rax
mov    %edx,%r8d
mov    %esi,%ecx
xor    %esi,%esi
mov    $0x80,%edx
xor    %r9d,%r9d
push   $0x0
push   $0x0
call   1030 <fs_univ_append@plt>
add    $0x10,%rsp
pop    %rcx
ret

LLVM IR (-O0):
define i32 @fs_mr_append(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 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @fs_univ_append(i32 %7, i32 0, i32 128, i32 %8, i32 %9, i32 0, i32 0, i32* null)
ret i32 %10
}

LLVM IR (-O2):
define i32 @fs_mr_append(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @fs_univ_append(i32 %0, i32 0, i32 128, i32 %1, i32 %2, i32 0, i32 0, i32* null)
ret i32 %4
}
double double_abs(double x) {
  if (x < 0) {
    return 0 - x;
  }
  return x;
}


x86 assembly (clang, -O0):
<double_abs>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1129 <double_abs+0x29>
xorps  %xmm0,%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1133 <double_abs+0x33>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<double_abs>:
xorpd  %xmm2,%xmm2
movapd %xmm0,%xmm1
cmpltsd %xmm2,%xmm1
subsd  %xmm0,%xmm2
andpd  %xmm1,%xmm2
andnpd %xmm0,%xmm1
orpd   %xmm2,%xmm1
movapd %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @double_abs(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fsub double 0.000000e+00, %0
%4 = select i1 %2, double %3, double %0
ret double %4
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int check_authentication(char *password) {
  int auth_flag = 0;
  char password_buffer[16];
  strcpy(password_buffer, password);
  if (strcmp(password_buffer, "p@ssw0rd") == 0) {
    auth_flag = 1;
  }
  return auth_flag;
}


x86 assembly (clang, -O0):
<check_authentication>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x20(%rbp),%rdi
lea    0xeb5(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1161 <check_authentication+0x41>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_authentication>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
lea    0xec6(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"p@ssw0rd\00"
define i32 @check_authentication(i8* %0) {
%2 = alloca [16 x i8]
%3 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%4 = call i32 @strcpy(i8* %3, i8* %0)
%5 = call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
bool nrf53_errata_46(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf53_errata_46() {
ret i32 0
}
/* Variables and functions */
int munmap(void *addr, size_t length) { return (int)-1; }


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

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

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

LLVM IR (-O2):
define i32 @munmap(i8* nocapture readnone %0, i64 %1) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ ksbrk();
void kmalloc_init() { ksbrk(); }


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

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

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

LLVM IR (-O2):
define void @kmalloc_init() {
%1 = tail call i32 (...) @ksbrk()
ret void
}
void hogger_task(void) {
  volatile int x = 100000, y = 123456;
  volatile float z = 123.4576;
  for (;;)
    z = z * (x * 3) + y * 123.445;
}


x86 assembly (clang, -O0):
<hogger_task>:
push   %rbp
mov    %rsp,%rbp
movl   $0x186a0,-0x4(%rbp)
movl   $0x1e240,-0x8(%rbp)
movss  0xee6(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
mov    -0x4(%rbp),%eax
imul   $0x3,%eax,%eax
cvtsi2ss %eax,%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x24(%rbp)
cvtss2sd %xmm0,%xmm1
mov    -0x8(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  0xebe(%rip),%xmm2
mulsd  %xmm2,%xmm0
movsd  %xmm0,-0x20(%rbp)
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    111f <hogger_task+0x1f>

x86 assembly (clang, -O2):
<hogger_task>:
movl   $0x186a0,-0x4(%rsp)
movl   $0x1e240,-0x8(%rsp)
movl   $0x42f6ea4b,-0xc(%rsp)
42
movsd  0xee0(%rip),%xmm0
movss  -0xc(%rsp),%xmm1
mov    -0x4(%rsp),%eax
lea    (%rax,%rax,2),%eax
xorps  %xmm2,%xmm2
cvtsi2ss %eax,%xmm2
mulss  %xmm1,%xmm2
xorps  %xmm1,%xmm1
cvtss2sd %xmm2,%xmm1
xorps  %xmm2,%xmm2
cvtsi2sdl -0x8(%rsp),%xmm2
mulsd  %xmm0,%xmm2
addsd  %xmm1,%xmm2
xorps  %xmm1,%xmm1
cvtsd2ss %xmm2,%xmm1
movss  %xmm1,-0xc(%rsp)
jmp    1120 <hogger_task+0x20>

LLVM IR (-O0):
define void @hogger_task() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
store volatile i32 100000, i32* %1
store volatile i32 123456, i32* %2
store volatile float 0x405EDD4960000000, float* %3
br label %4
4: ; preds = %4, %0
%5 = load volatile float, float* %3
%6 = load volatile i32, i32* %1
%7 = mul nsw i32 %6, 3
%8 = sitofp i32 %7 to float
%9 = fmul float %5, %8
%10 = fpext float %9 to double
%11 = load volatile i32, i32* %2
%12 = sitofp i32 %11 to double
%13 = call double @llvm.fmuladd.f64(double %12, double 1.234450e+02, double %10)
%14 = fptrunc double %13 to float
store volatile float %14, float* %3
br label %4
}

LLVM IR (-O2):
define void @hogger_task() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
%4 = bitcast i32* %1 to i8*
store volatile i32 100000, i32* %1
%5 = bitcast i32* %2 to i8*
store volatile i32 123456, i32* %2
%6 = bitcast float* %3 to i8*
store volatile float 0x405EDD4960000000, float* %3
br label %7
7: ; preds = %7, %0
%8 = load volatile float, float* %3
%9 = load volatile i32, i32* %1
%10 = mul nsw i32 %9, 3
%11 = sitofp i32 %10 to float
%12 = fmul float %8, %11
%13 = fpext float %12 to double
%14 = load volatile i32, i32* %2
%15 = sitofp i32 %14 to double
%16 = tail call double @llvm.fmuladd.f64(double %15, double 1.234450e+02, double %13)
%17 = fptrunc double %16 to float
store volatile float %17, float* %3
br label %7
}
/* Variables and functions */
int StatCovMomentDouble(double *, double *, int, int, int, int);
double StatCovDouble(double a[], double b[], int n, int s) {
  return StatCovMomentDouble(a, b, n, s, 1, 1) / (n - 1);
}


x86 assembly (clang, -O0):
<StatCovDouble>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    $0x1,%r9d
mov    %r9d,%r8d
call   1030 <StatCovMomentDouble@plt>
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<StatCovDouble>:
push   %rbx
mov    %edx,%ebx
mov    $0x1,%r8d
mov    $0x1,%r9d
call   1030 <StatCovMomentDouble@plt>
add    $0xffffffff,%ebx
cltd
idiv   %ebx
cvtsi2sd %eax,%xmm0
pop    %rbx
ret

LLVM IR (-O0):
define double @StatCovDouble(double* %0, double* %1, i32 %2, i32 %3) {
%5 = alloca double*
%6 = alloca double*
%7 = alloca i32
%8 = alloca i32
store double* %0, double** %5
store double* %1, double** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load double*, double** %5
%10 = load double*, double** %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i32 @StatCovMomentDouble(double* %9, double* %10, i32 %11, i32 %12, i32 1, i32 1)
%14 = load i32, i32* %7
%15 = sub nsw i32 %14, 1
%16 = sdiv i32 %13, %15
%17 = sitofp i32 %16 to double
ret double %17
}

LLVM IR (-O2):
define double @StatCovDouble(double* %0, double* %1, i32 %2, i32 %3) {
%5 = tail call i32 @StatCovMomentDouble(double* %0, double* %1, i32 %2, i32 %3, i32 1, i32 1)
%6 = add nsw i32 %2, -1
%7 = sdiv i32 %5, %6
%8 = sitofp i32 %7 to double
ret double %8
}
/* Variables and functions */
void unmap_io_range(const void *virt_addr, size_t length) {}


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

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

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

LLVM IR (-O2):
define void @unmap_io_range(i8* nocapture %0, i64 %1) {
ret void
}
/* Type definitions */
struct trace_seq {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ trace_seq_printf(struct trace_seq *, char *, int, char *);
void blk_log_msg(struct trace_seq *s, void *data, int len) {
  trace_seq_printf(s, "%.*s", len, (char *)data);
}


x86 assembly (clang, -O0):
<blk_log_msg>:
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    -0x14(%rbp),%edx
mov    -0x10(%rbp),%rcx
lea    0xecb(%rip),%rsi
call   1030 <trace_seq_printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<blk_log_msg>:
mov    %rsi,%rcx
lea    0xee6(%rip),%rsi
jmp    1030 <trace_seq_printf@plt>

LLVM IR (-O0):
%struct.trace_seq = type { i32 }
@.str = [5 x i8] c"%.*s\00"
define void @blk_log_msg(%struct.trace_seq* %0, i8* %1, i32 %2) {
%4 = alloca %struct.trace_seq*
%5 = alloca i8*
%6 = alloca i32
store %struct.trace_seq* %0, %struct.trace_seq** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load %struct.trace_seq*, %struct.trace_seq** %4
%8 = load i32, i32* %6
%9 = load i8*, i8** %5
%10 = call i32 @trace_seq_printf(%struct.trace_seq* %7, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %8, i8* %9)
ret void
}

LLVM IR (-O2):
%struct.trace_seq = type { i32 }
@.str = [5 x i8] c"%.*s\00"
define void @blk_log_msg(%struct.trace_seq* %0, i8* %1, i32 %2) {
%4 = tail call i32 @trace_seq_printf(%struct.trace_seq* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %2, i8* %1)
ret void
}
void HardFault_Handler(void) {
  int volatile wait = 1;
  while (wait) {
  }
}


x86 assembly (clang, -O0):
<HardFault_Handler>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cmp    $0x0,%eax
je     111c <HardFault_Handler+0x1c>
jmp    110b <HardFault_Handler+0xb>
pop    %rbp
ret

x86 assembly (clang, -O2):
<HardFault_Handler>:
movl   $0x1,-0x4(%rsp)
nopl   0x0(%rax,%rax,1)
cmpl   $0x0,-0x4(%rsp)
jne    1110 <HardFault_Handler+0x10>
ret

LLVM IR (-O0):
define void @HardFault_Handler() {
%1 = alloca i32
store volatile i32 1, i32* %1
br label %2
2: ; preds = %5, %0
%3 = load volatile i32, i32* %1
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %2
br label %2
6: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @HardFault_Handler() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store volatile i32 1, i32* %1
br label %3
3: ; preds = %3, %0
%4 = load volatile i32, i32* %1
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %3
6: ; preds = %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print(char **names, int size) {
  int i;
  for (i = 0; i < size; i++) {
    printf("%s\n", names[i]);
  }
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1158 <print+0x48>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1145 <print+0x35>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,8),%rsi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <print+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @print(i8** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8*, i8** %0, i64 %7
%9 = load i8*, i8** %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ execve(char *, char **, int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ setegid(int /*<<< orphan*/);
int /*<<< orphan*/ seteuid(int /*<<< orphan*/);
int main() {
  seteuid(0);
  setegid(0);
  char *name[2];
  name[0] = "/bin/sh";
  name[1] = 0x0;
  execve(name[0], name, 0x0);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1060 <seteuid@plt>
xor    %edi,%edi
call   1050 <setegid@plt>
lea    0xe9c(%rip),%rax
mov    %rax,-0x20(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x20(%rbp),%rdi
lea    -0x20(%rbp),%rsi
xor    %edx,%edx
call   1030 <execve@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
xor    %edi,%edi
call   1060 <seteuid@plt>
xor    %edi,%edi
call   1050 <setegid@plt>
lea    0xea7(%rip),%rdi
mov    %rdi,(%rsp)
movq   $0x0,0x8(%rsp)
mov    %rsp,%rsi
xor    %edx,%edx
call   1030 <execve@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"/bin/sh\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [2 x i8*]
store i32 0, i32* %1
%3 = call i32 @seteuid(i32 0)
%4 = call i32 @setegid(i32 0)
%5 = getelementptr inbounds [2 x i8*], [2 x i8*]* %2, i64 0, i64 0
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8** %5
%6 = getelementptr inbounds [2 x i8*], [2 x i8*]* %2, i64 0, i64 1
store i8* null, i8** %6
%7 = getelementptr inbounds [2 x i8*], [2 x i8*]* %2, i64 0, i64 0
%8 = load i8*, i8** %7
%9 = getelementptr inbounds [2 x i8*], [2 x i8*]* %2, i64 0, i64 0
%10 = call i32 @execve(i8* %8, i8** %9, i32 0)
%11 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [8 x i8] c"/bin/sh\00"
define i32 @main() {
%1 = alloca [2 x i8*]
%2 = tail call i32 @seteuid(i32 0)
%3 = tail call i32 @setegid(i32 0)
%4 = bitcast [2 x i8*]* %1 to i8*
%5 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 0
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8** %5
%6 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 1
store i8* null, i8** %6
%7 = call i32 @execve(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8** %5, i32 0)
%8 = call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
struct plainstring {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ cstr_loaddouble(char *, double);
int plainstring_greater(struct plainstring const *, char *);
int plainstring_greater_double(const struct plainstring *this_string,
                               double d) {
  char buffer[0xFF];
  cstr_loaddouble(buffer, d);
  return plainstring_greater(this_string, buffer);
}


x86 assembly (clang, -O0):
<plainstring_greater_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
lea    -0x110(%rbp),%rdi
movsd  -0x10(%rbp),%xmm0
call   1040 <cstr_loaddouble@plt>
mov    -0x8(%rbp),%rdi
lea    -0x110(%rbp),%rsi
call   1030 <plainstring_greater@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<plainstring_greater_double>:
push   %r14
push   %rbx
sub    $0x108,%rsp
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %r14,%rdi
call   1040 <cstr_loaddouble@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <plainstring_greater@plt>
add    $0x108,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.plainstring = type { i32 }
define i32 @plainstring_greater_double(%struct.plainstring* %0, double %1) {
%3 = alloca %struct.plainstring*
%4 = alloca double
%5 = alloca [255 x i8]
store %struct.plainstring* %0, %struct.plainstring** %3
store double %1, double* %4
%6 = getelementptr inbounds [255 x i8], [255 x i8]* %5, i64 0, i64 0
%7 = load double, double* %4
%8 = call i32 @cstr_loaddouble(i8* %6, double %7)
%9 = load %struct.plainstring*, %struct.plainstring** %3
%10 = getelementptr inbounds [255 x i8], [255 x i8]* %5, i64 0, i64 0
%11 = call i32 @plainstring_greater(%struct.plainstring* %9, i8* %10)
ret i32 %11
}

LLVM IR (-O2):
%struct.plainstring = type { i32 }
define i32 @plainstring_greater_double(%struct.plainstring* %0, double %1) {
%3 = alloca [255 x i8]
%4 = getelementptr inbounds [255 x i8], [255 x i8]* %3, i64 0, i64 0
%5 = call i32 @cstr_loaddouble(i8* %4, double %1)
%6 = call i32 @plainstring_greater(%struct.plainstring* %0, i8* %4)
ret i32 %6
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int create_cascade_homotopy(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(164, a, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<create_cascade_homotopy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0xa4,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_cascade_homotopy>:
mov    $0xa4,%edi
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @create_cascade_homotopy() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc(i32 164, i32* %5, i32* %6, double* %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @create_cascade_homotopy() {
%1 = tail call i32 @_ada_use_c2phc(i32 164, i32* undef, i32* undef, double* undef)
ret i32 %1
}
/* Variables and functions */
int funcC();
int funcB() { return funcC(); }


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

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

LLVM IR (-O0):
define i32 @funcB() {
%1 = call i32 (...) @funcC()
ret i32 %1
}

LLVM IR (-O2):
define i32 @funcB() {
%1 = tail call i32 (...) @funcC()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ g();
unsigned short f(unsigned short a, unsigned short b) {
  if (a == (b & 0xff00))
    g();
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
movzwl -0x4(%rbp),%eax
movzwl -0x6(%rbp),%ecx
and    $0xff00,%ecx
cmp    %ecx,%eax
jne    1143 <f+0x33>
mov    $0x0,%al
call   1030 <g@plt>
movzwl -0x2(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
and    $0xff00,%esi
cmp    %di,%si
jne    1127 <f+0x17>
push   %rax
xor    %eax,%eax
call   1030 <g@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define zeroext i16 @f(i16 zeroext %0, i16 zeroext %1) {
%3 = alloca i16
%4 = alloca i16
%5 = alloca i16
store i16 %0, i16* %4
store i16 %1, i16* %5
%6 = load i16, i16* %4
%7 = zext i16 %6 to i32
%8 = load i16, i16* %5
%9 = zext i16 %8 to i32
%10 = and i32 %9, 65280
%11 = icmp eq i32 %7, %10
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = call i32 (...) @g()
br label %14
14: ; preds = %12, %2
%15 = load i16, i16* %3
ret i16 %15
}

LLVM IR (-O2):
define zeroext i16 @f(i16 zeroext %0, i16 zeroext %1) {
%3 = and i16 %1, -256
%4 = icmp eq i16 %3, %0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @g()
br label %7
7: ; preds = %5, %2
ret i16 undef
}
/* Variables and functions */
int /*<<< orphan*/ early_puts(char *);
int /*<<< orphan*/ virtio_init();
unsigned long _sclp_setup(unsigned long deactivate) {
  if (deactivate)
    return 0;
  early_puts("_sclp_setup\n");
  virtio_init();
  return 0;
}


x86 assembly (clang, -O0):
<_sclp_setup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1144 <_sclp_setup+0x24>
movq   $0x0,-0x8(%rbp)
jmp    115f <_sclp_setup+0x3f>
lea    0xeb5(%rip),%rdi
call   1030 <early_puts@plt>
mov    $0x0,%al
call   1040 <virtio_init@plt>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_sclp_setup>:
test   %rdi,%rdi
je     1128 <_sclp_setup+0x8>
xor    %eax,%eax
ret
push   %rax
lea    0xed0(%rip),%rdi
call   1030 <early_puts@plt>
xor    %eax,%eax
call   1040 <virtio_init@plt>
add    $0x8,%rsp
xor    %eax,%eax
ret

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

LLVM IR (-O2):
@.str = [13 x i8] c"_sclp_setup\0A\00"
define i64 @_sclp_setup(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = tail call i32 @early_puts(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 (...) @virtio_init()
br label %6
6: ; preds = %1, %3
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ CL_Quit();
void CL_Quit_f(void) { CL_Quit(); }


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

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

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

LLVM IR (-O2):
define void @CL_Quit_f() {
%1 = tail call i32 (...) @CL_Quit()
ret void
}
double div_df(double *p, double *q) {
  double d1 = *p;
  double d2 = *q;
  __asm__("# reg %x0, %x1" : "+v"(d1), "+v"(d2));
  return d1 / d2;
}


x86 assembly (clang, -O0):
<div_df>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
divsd  -0x20(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<div_df>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
divsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @div_df(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca double
%6 = alloca double
store double* %0, double** %3
store double* %1, double** %4
%7 = load double*, double** %3
%8 = load double, double* %7
store double %8, double* %5
%9 = load double*, double** %4
%10 = load double, double* %9
store double %10, double* %6
%11 = load double, double* %5
%12 = load double, double* %6
%13 = call { double, double } asm "# reg ${0:x}, ${1:x}", "=v,=v,0,1,~{dirflag},~{fpsr},~{flags}"(double %11, double %12)
%14 = extractvalue { double, double } %13, 0
%15 = extractvalue { double, double } %13, 1
store double %14, double* %5
store double %15, double* %6
%16 = load double, double* %5
%17 = load double, double* %6
%18 = fdiv double %16, %17
ret double %18
}

LLVM IR (-O2):
define double @div_df(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
%5 = tail call { double, double } asm "# reg ${0:x}, ${1:x}", "=v,=v,0,1,~{dirflag},~{fpsr},~{flags}"(double %3, double %4)
%6 = extractvalue { double, double } %5, 0
%7 = extractvalue { double, double } %5, 1
%8 = fdiv double %6, %7
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ sleep2(int);
int main(void) { sleep2(1); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <sleep2@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @sleep2(i32 1)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @sleep2(i32 1)
ret i32 0
}
/* Variables and functions */
scalar_t__ ReallocPtr(char *, int);
unsigned char *gReallocPtr(char *thisPtr, int size) {
  unsigned char *p = (unsigned char *)ReallocPtr(thisPtr, size);
  return p;
}


x86 assembly (clang, -O0):
<gReallocPtr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <ReallocPtr@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gReallocPtr>:
jmp    1030 <ReallocPtr@plt>

LLVM IR (-O0):
define i8* @gReallocPtr(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i64 @ReallocPtr(i8* %6, i32 %7)
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %5
%10 = load i8*, i8** %5
ret i8* %10
}

LLVM IR (-O2):
define i8* @gReallocPtr(i8* %0, i32 %1) {
%3 = tail call i64 @ReallocPtr(i8* %0, i32 %1)
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
int sys$clref(unsigned int efn) {
  return ({
    unsigned long resultvar;
    register long int _a1 asm("rdi") = (long)(efn);
    asm volatile("movq %1, %%rax\n\t"
                 "int $0x81\n\t"
                 : "=a"(resultvar)
                 : "i"(9), "r"(_a1)
                 : "memory", "cc", "r11", "cx");
    (long)resultvar;
  });
}


x86 assembly (clang, -O0):
<sys$clref>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x9,%rax
int    $0x81
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys$clref>:
mov    %edi,%edi
mov    $0x9,%rax
int    $0x81
ret

LLVM IR (-O0):
define i32 @"sys$clref"(i32 %0) {
%2 = alloca i32
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i32 %0, i32* %2
%6 = load i32, i32* %2
%7 = zext i32 %6 to i64
store i64 %7, i64* %4
%8 = load i64, i64* %4
%9 = call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x81\0A\09", "={ax},i,{rdi},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 9, i64 %8)
store i64 %9, i64* %3
%10 = load i64, i64* %3
store i64 %10, i64* %5
%11 = load i64, i64* %5
%12 = trunc i64 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @"sys$clref"(i32 %0) {
%2 = zext i32 %0 to i64
%3 = tail call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x81\0A\09", "={ax},i,{rdi},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 9, i64 %2)
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int /*<<< orphan*/ cmd;
};
typedef TYPE_1__ osd_cmd_t;

/* Variables and functions */
int /*<<< orphan*/ OSD_Hide;
int /*<<< orphan*/ OSD_SEND_CMD;
int ioctl(int, int /*<<< orphan*/, TYPE_1__ *);
int OSDHide(int dev) {
  osd_cmd_t dc;
  dc.cmd = OSD_Hide;
  return ioctl(dev, OSD_SEND_CMD, &dc);
}


x86 assembly (clang, -O0):
<OSDHide>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eb6(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebf(%rip),%rax
mov    (%rax),%esi
lea    -0x8(%rbp),%rdx
call   1030 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OSDHide>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%eax
mov    %eax,(%rsp)
mov    0x2ecc(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rdx
call   1030 <ioctl@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32 }
@OSD_Hide = global i32 0
@OSD_SEND_CMD = global i32 0
define i32 @OSDHide(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.TYPE_3__
store i32 %0, i32* %2
%4 = load i32, i32* @OSD_Hide
%5 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i32 0, i32 0
store i32 %4, i32* %5
%6 = load i32, i32* %2
%7 = load i32, i32* @OSD_SEND_CMD
%8 = call i32 @ioctl(i32 %6, i32 %7, %struct.TYPE_3__* %3)
ret i32 %8
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32 }
@OSD_Hide = global i32 0
@OSD_SEND_CMD = global i32 0
define i32 @OSDHide(i32 %0) {
%2 = alloca %struct.TYPE_3__
%3 = bitcast %struct.TYPE_3__* %2 to i8*
%4 = load i32, i32* @OSD_Hide
%5 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %2, i64 0, i32 0
store i32 %4, i32* %5
%6 = load i32, i32* @OSD_SEND_CMD
%7 = call i32 @ioctl(i32 %0, i32 %6, %struct.TYPE_3__* %2)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ HplMsp430InterruptP__Port25__default__fired();
void HplMsp430InterruptP__Port25__fired(void) {
  HplMsp430InterruptP__Port25__default__fired();
}


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

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

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

LLVM IR (-O2):
define void @HplMsp430InterruptP__Port25__fired() {
%1 = tail call i32 (...) @HplMsp430InterruptP__Port25__default__fired()
ret void
}
void Msp430TimerCapComP__0__Timer__overflow(void) {}


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

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

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

LLVM IR (-O2):
define void @Msp430TimerCapComP__0__Timer__overflow() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar(int);
void ft_putnbr(int nb) {
  if (nb < 0) {
    ft_putchar('-');
    nb = nb * -1;
  }
  if (nb >= 10) {
    ft_putnbr(nb / 10);
    ft_putnbr(nb % 10);
  } else
    ft_putchar(nb + '0');
}


x86 assembly (clang, -O0):
<ft_putnbr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1146 <ft_putnbr+0x26>
mov    $0x2d,%edi
call   1030 <ft_putchar@plt>
imul   $0xffffffff,-0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jl     1179 <ft_putnbr+0x59>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1040 <ft_putnbr@plt>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
call   1040 <ft_putnbr@plt>
jmp    1184 <ft_putnbr+0x64>
mov    -0x4(%rbp),%edi
add    $0x30,%edi
call   1030 <ft_putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putnbr>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebp
mov    $0xcccccccd,%r14d
test   %ebp,%ebp
jns    113c <ft_putnbr+0x1c>
mov    $0x2d,%edi
call   1030 <ft_putchar@plt>
neg    %ebp
cmp    $0xa,%ebp
jb     115f <ft_putnbr+0x3f>
mov    %ebp,%ebx
imul   %r14,%rbx
shr    $0x23,%rbx
mov    %ebx,%edi
call   1040 <ft_putnbr@plt>
add    %ebx,%ebx
lea    (%rbx,%rbx,4),%eax
sub    %eax,%ebp
test   %ebp,%ebp
jns    113c <ft_putnbr+0x1c>
jmp    1130 <ft_putnbr+0x10>
add    $0x30,%ebp
mov    %ebp,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <ft_putchar@plt>

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

LLVM IR (-O2):
define void @ft_putnbr(i32 %0) {
br label %2
2: ; preds = %11, %1
%3 = phi i32 [ %0, %1 ], [ %13, %11 ]
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @ft_putchar(i32 45)
%7 = sub nsw i32 0, %3
br label %8
8: ; preds = %5, %2
%9 = phi i32 [ %7, %5 ], [ %3, %2 ]
%10 = icmp ugt i32 %9, 9
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = udiv i32 %9, 10
tail call void @ft_putnbr(i32 %12)
%13 = urem i32 %9, 10
br label %2
14: ; preds = %8
%15 = add nuw nsw i32 %9, 48
%16 = tail call i32 @ft_putchar(i32 %15)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, double *);
double get_weight(void) {
  double value = 0.0;
  printf("Please enter Weight: ");
  scanf("%lf", &value);
  return value;
}


x86 assembly (clang, -O0):
<get_weight>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
lea    0xed3(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_weight>:
push   %rax
movq   $0x0,(%rsp)
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
lea    0xeda(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
movsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Please enter Weight: \00"
@.str.1 = [4 x i8] c"%lf\00"
define double @get_weight() {
%1 = alloca double
store double 0.000000e+00, double* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%4 = load double, double* %1
ret double %4
}

LLVM IR (-O2):
@.str = [22 x i8] c"Please enter Weight: \00"
@.str.1 = [4 x i8] c"%lf\00"
define double @get_weight() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
store double 0.000000e+00, double* %1
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%5 = load double, double* %1
ret double %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ XcmBigEndian();
int /*<<< orphan*/ XcmValueUInt16Swap(int /*<<< orphan*/);
uint16_t XcmValueUInt16(uint16_t val) {
  if (!XcmBigEndian())
    val = XcmValueUInt16Swap(val);
  return val;
}


x86 assembly (clang, -O0):
<XcmValueUInt16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <XcmBigEndian@plt>
cmp    $0x0,%eax
jne    1146 <XcmValueUInt16+0x26>
mov    -0x4(%rbp),%edi
call   1030 <XcmValueUInt16Swap@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<XcmValueUInt16>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <XcmBigEndian@plt>
test   %eax,%eax
je     1132 <XcmValueUInt16+0x12>
mov    %ebx,%eax
pop    %rbx
ret
mov    %ebx,%edi
pop    %rbx
jmp    1030 <XcmValueUInt16Swap@plt>

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

LLVM IR (-O2):
define i32 @XcmValueUInt16(i32 %0) {
%2 = tail call i32 (...) @XcmBigEndian()
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @XcmValueUInt16Swap(i32 %0)
br label %6
6: ; preds = %4, %1
%7 = phi i32 [ %0, %1 ], [ %5, %4 ]
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ internal_fiat_secp256k1_msat(uintptr_t);
void fiat_secp256k1_msat(uint64_t out1[5]) {
  internal_fiat_secp256k1_msat((uintptr_t)out1);
}


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

x86 assembly (clang, -O2):
<fiat_secp256k1_msat>:
jmp    1030 <internal_fiat_secp256k1_msat@plt>

LLVM IR (-O0):
define void @fiat_secp256k1_msat(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = ptrtoint i32* %3 to i64
%5 = call i32 @internal_fiat_secp256k1_msat(i64 %4)
ret void
}

LLVM IR (-O2):
define void @fiat_secp256k1_msat(i32* %0) {
%2 = ptrtoint i32* %0 to i64
%3 = tail call i32 @internal_fiat_secp256k1_msat(i64 %2)
ret void
}
/* Variables and functions */
scalar_t__ isTwin(int);
int /*<<< orphan*/ printf(char *, int);
void testTwin(int number) {
  if (isTwin(number))
    printf("%d is a twin prime\n", number);
  else
    printf("%d is not a twin prime\n", number);
}


x86 assembly (clang, -O0):
<testTwin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <isTwin@plt>
cmp    $0x0,%rax
je     1151 <testTwin+0x31>
mov    -0x4(%rbp),%esi
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
jmp    1160 <testTwin+0x40>
mov    -0x4(%rbp),%esi
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testTwin>:
push   %rbx
mov    %edi,%ebx
call   1040 <isTwin@plt>
test   %rax,%rax
lea    0xee2(%rip),%rax
lea    0xec7(%rip),%rdi
cmove  %rax,%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"%d is a twin prime\0A\00"
@.str.1 = [24 x i8] c"%d is not a twin prime\0A\00"
define void @testTwin(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @isTwin(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %7)
br label %12
9: ; preds = %1
%10 = load i32, i32* %2
%11 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %10)
br label %12
12: ; preds = %9, %6
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"%d is a twin prime\0A\00"
@.str.1 = [24 x i8] c"%d is not a twin prime\0A\00"
define void @testTwin(i32 %0) {
%2 = tail call i64 @isTwin(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0)
%5 = tail call i32 @printf(i8* %4, i32 %0)
ret void
}
/* Variables and functions */
int *calloc(int, int);
int foo2() {
  int *a = calloc(3, sizeof(int));
  a[0] = 1;
  a[1] = 2;
  a[2] = 3;
  return a[0] + a[1] + a[2];
}


x86 assembly (clang, -O0):
<foo2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x3,%edi
mov    $0x4,%esi
call   1030 <calloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x8(%rbp),%rax
movl   $0x2,0x4(%rax)
mov    -0x8(%rbp),%rax
movl   $0x3,0x8(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x8(%rbp),%rcx
add    0x4(%rcx),%eax
mov    -0x8(%rbp),%rcx
add    0x8(%rcx),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo2>:
push   %rax
mov    $0x3,%edi
mov    $0x4,%esi
call   1030 <calloc@plt>
mov    $0x6,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @foo2() {
%1 = alloca i32*
%2 = call i32* @calloc(i32 3, i32 4)
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = getelementptr inbounds i32, i32* %3, i64 0
store i32 1, i32* %4
%5 = load i32*, i32** %1
%6 = getelementptr inbounds i32, i32* %5, i64 1
store i32 2, i32* %6
%7 = load i32*, i32** %1
%8 = getelementptr inbounds i32, i32* %7, i64 2
store i32 3, i32* %8
%9 = load i32*, i32** %1
%10 = getelementptr inbounds i32, i32* %9, i64 0
%11 = load i32, i32* %10
%12 = load i32*, i32** %1
%13 = getelementptr inbounds i32, i32* %12, i64 1
%14 = load i32, i32* %13
%15 = add nsw i32 %11, %14
%16 = load i32*, i32** %1
%17 = getelementptr inbounds i32, i32* %16, i64 2
%18 = load i32, i32* %17
%19 = add nsw i32 %15, %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @foo2() {
%1 = tail call i32* @calloc(i32 3, i32 4)
ret i32 6
}
/* Variables and functions */
int /*<<< orphan*/ SIGFPE;
int /*<<< orphan*/ signal(int /*<<< orphan*/, void (*)(int));
void floating_point_exception_handler(int whatever) {
  signal(SIGFPE, floating_point_exception_handler);
}


x86 assembly (clang, -O0):
<floating_point_exception_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
mov    0x2ebd(%rip),%rsi
call   1030 <signal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<floating_point_exception_handler>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
mov    0x2ec8(%rip),%rsi
jmp    1030 <signal@plt>

LLVM IR (-O0):
@SIGFPE = global i32 0
define void @floating_point_exception_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @SIGFPE
%4 = call i32 @signal(i32 %3, void (i32)* @floating_point_exception_handler)
ret void
}

LLVM IR (-O2):
@SIGFPE = global i32 0
define void @floating_point_exception_handler(i32 %0) {
%2 = load i32, i32* @SIGFPE
%3 = tail call i32 @signal(i32 %2, void (i32)* @floating_point_exception_handler)
ret void
}
/* Type definitions */
typedef int uint32_t;
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(float *, int *, int);
float modbus_get_float(const uint16_t *src) {
  float f;
  uint32_t i;
  i = (((uint32_t)src[1]) << 16) + src[0];
  memcpy(&f, &i, sizeof(float));
  return f;
}


x86 assembly (clang, -O0):
<modbus_get_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
shl    $0x10,%eax
mov    -0x8(%rbp),%rcx
add    (%rcx),%eax
mov    %eax,-0x10(%rbp)
lea    -0xc(%rbp),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
movss  -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<modbus_get_float>:
push   %rax
mov    0x4(%rdi),%eax
shl    $0x10,%eax
add    (%rdi),%eax
mov    %eax,(%rsp)
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
movss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @modbus_get_float(i32* %0) {
%2 = alloca i32*
%3 = alloca float
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = getelementptr inbounds i32, i32* %5, i64 1
%7 = load i32, i32* %6
%8 = shl i32 %7, 16
%9 = load i32*, i32** %2
%10 = getelementptr inbounds i32, i32* %9, i64 0
%11 = load i32, i32* %10
%12 = add nsw i32 %8, %11
store i32 %12, i32* %4
%13 = call i32 @memcpy(float* %3, i32* %4, i32 4)
%14 = load float, float* %3
ret float %14
}

LLVM IR (-O2):
define float @modbus_get_float(i32* nocapture %0) {
%2 = alloca float
%3 = alloca i32
%4 = bitcast float* %2 to i8*
%5 = bitcast i32* %3 to i8*
%6 = getelementptr inbounds i32, i32* %0, i64 1
%7 = load i32, i32* %6
%8 = shl i32 %7, 16
%9 = load i32, i32* %0
%10 = add nsw i32 %8, %9
store i32 %10, i32* %3
%11 = call i32 @memcpy(float* %2, i32* %3, i32 4)
%12 = load float, float* %2
ret float %12
}
int test_imm_72uint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0x72 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_72uint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 114
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}