xunge/DecIR huggingface dataset:
/* Type definitions */
typedef float uint16_t;

/* Variables and functions */
float powf(float, float);
float pitch_bend_to_ratio(uint16_t bend) {
  return powf(2.0f, (bend - 8192.0f) / (8192.0f * 6.0f));
}


x86 assembly (clang, -O0):
<pitch_bend_to_ratio>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm1
movss  0xede(%rip),%xmm0
subss  %xmm0,%xmm1
movss  0xece(%rip),%xmm0
divss  %xmm0,%xmm1
movss  0xebe(%rip),%xmm0
call   1030 <powf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pitch_bend_to_ratio>:
addss  0xee8(%rip),%xmm0
divss  0xee4(%rip),%xmm0
jmp    1030 <exp2f@plt>

LLVM IR (-O0):
define float @pitch_bend_to_ratio(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fsub float %3, 8.192000e+03
%5 = fdiv float %4, 4.915200e+04
%6 = call float @powf(float 2.000000e+00, float %5)
ret float %6
}

LLVM IR (-O2):
define float @pitch_bend_to_ratio(float %0) {
%2 = fadd float %0, -8.192000e+03
%3 = fdiv float %2, 4.915200e+04
%4 = tail call float @exp2f(float %3)
ret float %4
}
D(l) { return l >= ' ' && l <= '\~'; }


x86 assembly (clang, -O0):
<D>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <D+0x20>
cmpl   $0x7e,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<D>:
add    $0xffffffe0,%edi
xor    %eax,%eax
cmp    $0x5f,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @D(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 32
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 126
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @D(i32 %0) {
%2 = add i32 %0, -32
%3 = icmp ult i32 %2, 95
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/);
int /*<<< orphan*/ fopen(char *, char *);
void doexit(void) { fclose(fopen("stdio.tmp", "w")); }


x86 assembly (clang, -O0):
<doexit>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed8(%rip),%rsi
call   1040 <fopen@plt>
mov    %eax,%edi
call   1030 <fclose@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<doexit>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xedb(%rip),%rsi
call   1040 <fopen@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"stdio.tmp\00"
@.str.1 = [2 x i8] c"w\00"
define void @doexit() {
%1 = call i32 @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @fclose(i32 %1)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"stdio.tmp\00"
@.str.1 = [2 x i8] c"w\00"
define void @doexit() {
%1 = tail call i32 @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @fclose(i32 %1)
ret void
}
unsigned kol_mouse_pos() { asm volatile("int $0x40" ::"a"(37), "b"(0)); }


x86 assembly (clang, -O0):
<kol_mouse_pos>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    $0x25,%eax
xor    %ebx,%ebx
int    $0x40
mov    -0xc(%rbp),%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<kol_mouse_pos>:
push   %rbx
mov    $0x25,%eax
xor    %ebx,%ebx
int    $0x40
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @kol_mouse_pos() {
tail call void asm sideeffect "int $$0x40", "{ax},{bx},~{dirflag},~{fpsr},~{flags}"(i32 37, i32 0)
ret i32 undef
}
/* Variables and functions */
scalar_t__ tempnam(char *, char *);
char *unique_filename(char *path, char *prefix) {
  return ((char *)tempnam(path, prefix));
}


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

x86 assembly (clang, -O2):
<unique_filename>:
jmp    1030 <tempnam@plt>

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

LLVM IR (-O2):
define i8* @unique_filename(i8* %0, i8* %1) {
%3 = tail call i64 @tempnam(i8* %0, i8* %1)
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char *read_line(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ remove_leading_whitespace(char *);
char *read_vifminfo_line(FILE *fp, char buffer[]) {
  if ((buffer = read_line(fp, buffer)) != NULL) {
    remove_leading_whitespace(buffer);
  }
  return buffer;
}


x86 assembly (clang, -O0):
<read_vifminfo_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <read_line@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     1154 <read_vifminfo_line+0x34>
mov    -0x10(%rbp),%rdi
call   1040 <remove_leading_whitespace@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_vifminfo_line>:
push   %rbx
call   1030 <read_line@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1136 <read_vifminfo_line+0x16>
mov    %rbx,%rdi
call   1040 <remove_leading_whitespace@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @read_vifminfo_line(i32* %0, i8* %1) {
%3 = tail call i8* @read_line(i32* %0, i8* %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @remove_leading_whitespace(i8* %3)
br label %7
7: ; preds = %5, %2
ret i8* %3
}
/* Variables and functions */
int Bar10(int, int, int, int, int, int, int, int, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int total;
  total = Bar10(1, 2, 3, 4, 5, 6, 7, 8, 9, 0);
  printf("main: total = %d\n", total);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
mov    $0x4,%ecx
mov    $0x5,%r8d
mov    $0x6,%r9d
xor    %eax,%eax
movl   $0x7,(%rsp)
movl   $0x8,0x8(%rsp)
movl   $0x9,0x10(%rsp)
movl   $0x0,0x18(%rsp)
call   1030 <Bar10@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe7e(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
mov    $0x4,%ecx
mov    $0x5,%r8d
mov    $0x6,%r9d
push   $0x0
push   $0x9
push   $0x8
push   $0x7
call   1030 <Bar10@plt>
add    $0x20,%rsp
lea    0xea7(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [18 x i8] c"main: total = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @Bar10(i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 0)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
long int calculate_area(long int l, long int w) { return 2 * (l + w); }


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

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

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

LLVM IR (-O2):
define i64 @calculate_area(i64 %0, i64 %1) {
%3 = add nsw i64 %1, %0
%4 = shl nsw i64 %3, 1
ret i64 %4
}
void ble_rsp_gap_discover(const struct ble_msg_gap_discover_rsp_t *msg) {}


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

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

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

LLVM IR (-O2):
%struct.ble_msg_gap_discover_rsp_t = type opaque
define void @ble_rsp_gap_discover(%struct.ble_msg_gap_discover_rsp_t* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf_realnum(int /*<<< orphan*/ *, char *, double,
                                   char *);
void fprintf_double(FILE *s, char *m1, double x, char *m2) {
  fprintf_realnum(s, m1, x, m2);
}


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

x86 assembly (clang, -O2):
<fprintf_double>:
jmp    1030 <fprintf_realnum@plt>

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

LLVM IR (-O2):
define void @fprintf_double(i32* %0, i8* %1, double %2, i8* %3) {
%5 = tail call i32 @fprintf_realnum(i32* %0, i8* %1, double %2, i8* %3)
ret void
}
char *reshape(char *in) { return 0; }


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

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

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

LLVM IR (-O2):
define noalias i8* @reshape(i8* nocapture readnone %0) {
ret i8* null
}
int compare_int_values(const void *v1, const void *v2) {
  return *((int *)v1) - *((int *)v2);
}


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

x86 assembly (clang, -O2):
<compare_int_values>:
mov    (%rdi),%eax
sub    (%rsi),%eax
ret

LLVM IR (-O0):
define i32 @compare_int_values(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @compare_int_values(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Variables and functions */
scalar_t__ cl_get_name();
int /*<<< orphan*/ cl_set_userdata(void *);
void __cl_fixture_parallel_setup() { cl_set_userdata((void *)cl_get_name()); }


x86 assembly (clang, -O0):
<__cl_fixture_parallel_setup>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <cl_get_name@plt>
mov    %rax,%rdi
call   1040 <cl_set_userdata@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<__cl_fixture_parallel_setup>:
push   %rax
xor    %eax,%eax
call   1030 <cl_get_name@plt>
mov    %rax,%rdi
pop    %rax
jmp    1040 <cl_set_userdata@plt>

LLVM IR (-O0):
define void @__cl_fixture_parallel_setup() {
%1 = call i64 (...) @cl_get_name()
%2 = inttoptr i64 %1 to i8*
%3 = call i32 @cl_set_userdata(i8* %2)
ret void
}

LLVM IR (-O2):
define void @__cl_fixture_parallel_setup() {
%1 = tail call i64 (...) @cl_get_name()
%2 = inttoptr i64 %1 to i8*
%3 = tail call i32 @cl_set_userdata(i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(float **, float **, int);
void CopyMatrix(float m0[4][4], float m1[4][4]) {
  memcpy(m0, m1, 16 * sizeof(float));
}


x86 assembly (clang, -O0):
<CopyMatrix>:
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    $0x40,%edx
call   1030 <memcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CopyMatrix>:
mov    $0x40,%edx
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @CopyMatrix([4 x float]* %0, [4 x float]* %1) {
%3 = alloca [4 x float]*
%4 = alloca [4 x float]*
store [4 x float]* %0, [4 x float]** %3
store [4 x float]* %1, [4 x float]** %4
%5 = load [4 x float]*, [4 x float]** %3
%6 = bitcast [4 x float]* %5 to float**
%7 = load [4 x float]*, [4 x float]** %4
%8 = bitcast [4 x float]* %7 to float**
%9 = call i32 @memcpy(float** %6, float** %8, i32 64)
ret void
}

LLVM IR (-O2):
define void @CopyMatrix([4 x float]* %0, [4 x float]* %1) {
%3 = bitcast [4 x float]* %0 to float**
%4 = bitcast [4 x float]* %1 to float**
%5 = tail call i32 @memcpy(float** %3, float** %4, i32 64)
ret void
}
/* Variables and functions */
char *out_str(char *buf, char *end, const char *str) {
  while (*str) {
    if (buf >= end)
      return NULL;
    *buf++ = *str++;
  }
  return buf;
}


x86 assembly (clang, -O0):
<out_str>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmpb   $0x0,(%rax)
je     115f <out_str+0x5f>
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jb     1138 <out_str+0x38>
movq   $0x0,-0x8(%rbp)
jmp    1167 <out_str+0x67>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,(%rax)
jmp    1110 <out_str+0x10>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<out_str>:
mov    %rdi,%rax
mov    (%rdx),%cl
test   %cl,%cl
je     1126 <out_str+0x26>
add    $0x1,%rdx
nopl   (%rax)
cmp    %rsi,%rax
jae    1127 <out_str+0x27>
mov    %cl,(%rax)
add    $0x1,%rax
movzbl (%rdx),%ecx
add    $0x1,%rdx
test   %cl,%cl
jne    1110 <out_str+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8* @out_str(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
br label %8
8: ; preds = %17, %3
%9 = load i8*, i8** %7
%10 = load i8, i8* %9
%11 = icmp ne i8 %10, 0
br i1 %11, label %12, label %23
12: ; preds = %8
%13 = load i8*, i8** %5
%14 = load i8*, i8** %6
%15 = icmp uge i8* %13, %14
br i1 %15, label %16, label %17
16: ; preds = %12
store i8* null, i8** %4
br label %25
17: ; preds = %12
%18 = load i8*, i8** %7
%19 = getelementptr inbounds i8, i8* %18, i32 1
store i8* %19, i8** %7
%20 = load i8, i8* %18
%21 = load i8*, i8** %5
%22 = getelementptr inbounds i8, i8* %21, i32 1
store i8* %22, i8** %5
store i8 %20, i8* %21
br label %8
23: ; preds = %8
%24 = load i8*, i8** %5
store i8* %24, i8** %4
br label %25
25: ; preds = %23, %16
%26 = load i8*, i8** %4
ret i8* %26
}

LLVM IR (-O2):
define i8* @out_str(i8* writeonly %0, i8* readnone %1, i8* nocapture %2) {
%4 = load i8, i8* %2
%5 = icmp eq i8 %4, 0
br i1 %5, label %16, label %6
6: ; preds = %3, %11
%7 = phi i8 [ %14, %11 ], [ %4, %3 ]
%8 = phi i8* [ %12, %11 ], [ %2, %3 ]
%9 = phi i8* [ %13, %11 ], [ %0, %3 ]
%10 = icmp ult i8* %9, %1
br i1 %10, label %11, label %16
11: ; preds = %6
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = getelementptr inbounds i8, i8* %9, i64 1
store i8 %7, i8* %9
%14 = load i8, i8* %12
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %6
16: ; preds = %6, %11, %3
%17 = phi i8* [ %0, %3 ], [ %13, %11 ], [ null, %6 ]
ret i8* %17
}
/* Variables and functions */
int get_stcsbb4(int, int, int *);
int /*<<< orphan*/ printf(char *, int, int, int, int, int);
void print_stcsbb4(int a, int b, int mask) {
  int f, r;
  f = get_stcsbb4(a, b, &r);
  f &= mask;
  printf("stcsbb"
         " 4"
         " %08x %08x %08x %08x %08x\n",
         a, b, r, f, mask);
}


x86 assembly (clang, -O0):
<print_stcsbb4>:
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),%esi
lea    -0x14(%rbp),%rdx
call   1030 <get_stcsbb4@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
and    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%r8d
mov    -0xc(%rbp),%r9d
lea    0xe9c(%rip),%rdi
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_stcsbb4>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
lea    0xc(%rsp),%rdx
call   1030 <get_stcsbb4@plt>
and    %r14d,%eax
mov    0xc(%rsp),%ecx
lea    0xeb9(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
mov    %eax,%r8d
mov    %r14d,%r9d
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [35 x i8] c"stcsbb 4 %08x %08x %08x %08x %08x\0A\00"
define void @print_stcsbb4(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = call i32 @get_stcsbb4(i32 %9, i32 %10, i32* %8)
store i32 %11, i32* %7
%12 = load i32, i32* %6
%13 = load i32, i32* %7
%14 = and i32 %13, %12
store i32 %14, i32* %7
%15 = load i32, i32* %4
%16 = load i32, i32* %5
%17 = load i32, i32* %8
%18 = load i32, i32* %7
%19 = load i32, i32* %6
%20 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %15, i32 %16, i32 %17, i32 %18, i32 %19)
ret void
}

LLVM IR (-O2):
@.str = [35 x i8] c"stcsbb 4 %08x %08x %08x %08x %08x\0A\00"
define void @print_stcsbb4(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = call i32 @get_stcsbb4(i32 %0, i32 %1, i32* %4)
%7 = and i32 %6, %2
%8 = load i32, i32* %4
%9 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %8, i32 %7, i32 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ internal_fiat_p256_from_bytes(uintptr_t, uintptr_t);
void fiat_p256_from_bytes(uint32_t out1[8], const uint8_t arg1[32]) {
  internal_fiat_p256_from_bytes((uintptr_t)out1, (uintptr_t)arg1);
}


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

x86 assembly (clang, -O2):
<fiat_p256_from_bytes>:
jmp    1030 <internal_fiat_p256_from_bytes@plt>

LLVM IR (-O0):
define void @fiat_p256_from_bytes(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 = ptrtoint i32* %5 to i64
%7 = load i32*, i32** %4
%8 = ptrtoint i32* %7 to i64
%9 = call i32 @internal_fiat_p256_from_bytes(i64 %6, i64 %8)
ret void
}

LLVM IR (-O2):
define void @fiat_p256_from_bytes(i32* %0, i32* %1) {
%3 = ptrtoint i32* %0 to i64
%4 = ptrtoint i32* %1 to i64
%5 = tail call i32 @internal_fiat_p256_from_bytes(i64 %3, i64 %4)
ret void
}
/* Type definitions */
struct timezone {
  int /*<<< orphan*/ member_1;
  int /*<<< orphan*/ member_0;
};
struct timeval {
  double tv_sec;
  double tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, struct timezone *);
double ExecTime() {
  struct timeval TV;
  struct timezone TZ = {0, 0};
  gettimeofday(&TV, &TZ);
  return TV.tv_sec + TV.tv_usec / 1000000.0;
}


x86 assembly (clang, -O0):
<ExecTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x18(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1040 <memset@plt>
lea    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <gettimeofday@plt>
movsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  0xea9(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ExecTime>:
sub    $0x18,%rsp
movq   $0x0,(%rsp)
lea    0x8(%rsp),%rdi
mov    %rsp,%rsi
call   1030 <gettimeofday@plt>
movsd  0x10(%rsp),%xmm0
divsd  0xec9(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { double, double }
%struct.timezone = type { i32, i32 }
define double @ExecTime() {
%1 = alloca %struct.timeval
%2 = alloca %struct.timezone
%3 = bitcast %struct.timezone* %2 to i8*
%4 = call i32 @gettimeofday(%struct.timeval* %1, %struct.timezone* %2)
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%6 = load double, double* %5
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%8 = load double, double* %7
%9 = fdiv double %8, 1.000000e+06
%10 = fadd double %6, %9
ret double %10
}

LLVM IR (-O2):
%struct.timeval = type { double, double }
%struct.timezone = type { i32, i32 }
define double @ExecTime() {
%1 = alloca %struct.timeval
%2 = alloca i64
%3 = bitcast i64* %2 to %struct.timezone*
%4 = bitcast %struct.timeval* %1 to i8*
%5 = bitcast i64* %2 to i8*
store i64 0, i64* %2
%6 = call i32 @gettimeofday(%struct.timeval* %1, %struct.timezone* %3)
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%8 = load double, double* %7
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%10 = load double, double* %9
%11 = fdiv double %10, 1.000000e+06
%12 = fadd double %8, %11
ret double %12
}
unsigned long phys_to_bus(unsigned long phys) { return phys; }


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

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

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

LLVM IR (-O2):
define i64 @phys_to_bus(i64 returned %0) {
ret i64 %0
}
/* Variables and functions */
int /*<<< orphan*/ send_ctrl_cmd(int);
int /*<<< orphan*/ send_data_cmd(int);
void lcm_setpwm(unsigned int divider) {
  send_ctrl_cmd(0xC9);
  send_data_cmd(0x3E);
  send_data_cmd(0x00);
  send_data_cmd(0x00);
  send_data_cmd(0x01);
  send_data_cmd(0x0F | (divider << 4));
  send_data_cmd(0x02);
  send_data_cmd(0x1E);
  send_data_cmd(0x1E);
  send_data_cmd(0x00);
}


x86 assembly (clang, -O0):
<lcm_setpwm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0xc9,%edi
call   1040 <send_ctrl_cmd@plt>
mov    $0x3e,%edi
call   1030 <send_data_cmd@plt>
xor    %edi,%edi
call   1030 <send_data_cmd@plt>
xor    %edi,%edi
call   1030 <send_data_cmd@plt>
mov    $0x1,%edi
call   1030 <send_data_cmd@plt>
mov    -0x4(%rbp),%edi
shl    $0x4,%edi
or     $0xf,%edi
call   1030 <send_data_cmd@plt>
mov    $0x2,%edi
call   1030 <send_data_cmd@plt>
mov    $0x1e,%edi
call   1030 <send_data_cmd@plt>
mov    $0x1e,%edi
call   1030 <send_data_cmd@plt>
xor    %edi,%edi
call   1030 <send_data_cmd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcm_setpwm>:
push   %rbx
mov    %edi,%ebx
mov    $0xc9,%edi
call   1040 <send_ctrl_cmd@plt>
mov    $0x3e,%edi
call   1030 <send_data_cmd@plt>
xor    %edi,%edi
call   1030 <send_data_cmd@plt>
xor    %edi,%edi
call   1030 <send_data_cmd@plt>
mov    $0x1,%edi
call   1030 <send_data_cmd@plt>
shl    $0x4,%ebx
or     $0xf,%ebx
mov    %ebx,%edi
call   1030 <send_data_cmd@plt>
mov    $0x2,%edi
call   1030 <send_data_cmd@plt>
mov    $0x1e,%edi
call   1030 <send_data_cmd@plt>
mov    $0x1e,%edi
call   1030 <send_data_cmd@plt>
xor    %edi,%edi
pop    %rbx
jmp    1030 <send_data_cmd@plt>

LLVM IR (-O0):
define void @lcm_setpwm(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @send_ctrl_cmd(i32 201)
%4 = call i32 @send_data_cmd(i32 62)
%5 = call i32 @send_data_cmd(i32 0)
%6 = call i32 @send_data_cmd(i32 0)
%7 = call i32 @send_data_cmd(i32 1)
%8 = load i32, i32* %2
%9 = shl i32 %8, 4
%10 = or i32 15, %9
%11 = call i32 @send_data_cmd(i32 %10)
%12 = call i32 @send_data_cmd(i32 2)
%13 = call i32 @send_data_cmd(i32 30)
%14 = call i32 @send_data_cmd(i32 30)
%15 = call i32 @send_data_cmd(i32 0)
ret void
}

LLVM IR (-O2):
define void @lcm_setpwm(i32 %0) {
%2 = tail call i32 @send_ctrl_cmd(i32 201)
%3 = tail call i32 @send_data_cmd(i32 62)
%4 = tail call i32 @send_data_cmd(i32 0)
%5 = tail call i32 @send_data_cmd(i32 0)
%6 = tail call i32 @send_data_cmd(i32 1)
%7 = shl i32 %0, 4
%8 = or i32 %7, 15
%9 = tail call i32 @send_data_cmd(i32 %8)
%10 = tail call i32 @send_data_cmd(i32 2)
%11 = tail call i32 @send_data_cmd(i32 30)
%12 = tail call i32 @send_data_cmd(i32 30)
%13 = tail call i32 @send_data_cmd(i32 0)
ret void
}
unsigned test(unsigned k, unsigned b) {
  unsigned a[2];
  if (b < a[k]) {
    a[k] = b;
  }
  return a[0] + a[1];
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
cmp    -0x10(%rbp,%rcx,4),%eax
jae    1124 <test+0x24>
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
mov    %ecx,-0x10(%rbp,%rax,4)
mov    -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
mov    -0x4(%rsp),%eax
add    -0x8(%rsp),%eax
ret

LLVM IR (-O0):
define i32 @test(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [2 x i32]
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = zext i32 %7 to i64
%9 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 %8
%10 = load i32, i32* %9
%11 = icmp ult i32 %6, %10
br i1 %11, label %12, label %17
12: ; preds = %2
%13 = load i32, i32* %4
%14 = load i32, i32* %3
%15 = zext i32 %14 to i64
%16 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 %15
store i32 %13, i32* %16
br label %17
17: ; preds = %12, %2
%18 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
%19 = load i32, i32* %18
%20 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 1
%21 = load i32, i32* %20
%22 = add i32 %19, %21
ret i32 %22
}

LLVM IR (-O2):
define i32 @test(i32 %0, i32 %1) {
%3 = alloca [2 x i32]
%4 = bitcast [2 x i32]* %3 to i8*
%5 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
%6 = load i32, i32* %5
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 1
%8 = load i32, i32* %7
%9 = add i32 %8, %6
ret i32 %9
}
/* Variables and functions */
int omp_get_thread_num();
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
#pragma omp parallel
  {
    int id = omp_get_thread_num();
    printf("Hey, I'm thread #%d\n", id);
#pragma omp barrier
    printf("Thread #%d after barrier!\n", id);
  }
  printf("Done!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <omp_get_thread_num@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <omp_get_thread_num@plt>
mov    %eax,%ebx
lea    0xebf(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xec4(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xecf(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"Hey, I'm thread #%d\0A\00"
@.str.1 = [27 x i8] c"Thread #%d after barrier!\0A\00"
@.str.2 = [7 x i8] c"Done!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @omp_get_thread_num()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %2
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"Hey, I'm thread #%d\0A\00"
@.str.1 = [27 x i8] c"Thread #%d after barrier!\0A\00"
@str = [6 x i8] c"Done!\00"
define i32 @main() {
%1 = tail call i32 (...) @omp_get_thread_num()
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %1)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void end(char *msg) {
  fprintf(stderr, "crontab_setgid: %s\n", msg);
  exit(1);
}


x86 assembly (clang, -O0):
<end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<end>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [20 x i8] c"crontab_setgid: %s\0A\00"
define void @end(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [20 x i8] c"crontab_setgid: %s\0A\00"
define void @end(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ cmd;

/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, char *, char *);
int /*<<< orphan*/ system(char *);
void copy_key(char *keyfile, char *host) {
  char cmd[2048] = {0};
  snprintf(cmd, sizeof(cmd), "ssh-copy-id -i %s root@%s", keyfile, host);
  system(cmd);
}


x86 assembly (clang, -O0):
<copy_key>:
push   %rbp
mov    %rsp,%rbp
sub    $0x810,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x810(%rbp),%rdi
xor    %esi,%esi
mov    $0x800,%edx
call   1050 <memset@plt>
lea    -0x810(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%r8
mov    $0x800,%esi
lea    0xe8f(%rip),%rdx
call   1040 <snprintf@plt>
lea    -0x810(%rbp),%rdi
call   1030 <system@plt>
add    $0x810,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_key>:
push   %r15
push   %r14
push   %rbx
sub    $0x800,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsp,%r15
mov    $0x800,%edx
mov    %r15,%rdi
xor    %esi,%esi
call   1050 <memset@plt>
lea    0xea5(%rip),%rdx
mov    %r15,%rdi
mov    $0x800,%esi
mov    %rbx,%rcx
mov    %r14,%r8
call   1040 <snprintf@plt>
mov    %r15,%rdi
call   1030 <system@plt>
add    $0x800,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [26 x i8] c"ssh-copy-id -i %s root@%s\00"
define void @copy_key(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [2048 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = bitcast [2048 x i8]* %5 to i8*
%7 = getelementptr inbounds [2048 x i8], [2048 x i8]* %5, i64 0, i64 0
%8 = load i8*, i8** %3
%9 = load i8*, i8** %4
%10 = call i32 @snprintf(i8* %7, i32 2048, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %8, i8* %9)
%11 = getelementptr inbounds [2048 x i8], [2048 x i8]* %5, i64 0, i64 0
%12 = call i32 @system(i8* %11)
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"ssh-copy-id -i %s root@%s\00"
define void @copy_key(i8* %0, i8* %1) {
%3 = alloca [2048 x i8]
%4 = getelementptr inbounds [2048 x i8], [2048 x i8]* %3, i64 0, i64 0
%5 = call i32 @snprintf(i8* %4, i32 2048, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%6 = call i32 @system(i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ chainloader();
int /*<<< orphan*/ enable_a20();
int /*<<< orphan*/ enter_unreal();
int /*<<< orphan*/ gunzip(char *);
int /*<<< orphan*/ printf(char *);
int main() {
  enter_unreal();
  enable_a20();
  printf("\nQuafios ISO-Live bootstrap stage.\n");
  gunzip("RAMDISK.GZ");
  chainloader();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <enter_unreal@plt>
mov    $0x0,%al
call   1040 <enable_a20@plt>
lea    0xe8c(%rip),%rdi
call   1050 <printf@plt>
lea    0xea4(%rip),%rdi
call   1070 <gunzip@plt>
mov    $0x0,%al
call   1060 <chainloader@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <enter_unreal@plt>
xor    %eax,%eax
call   1050 <enable_a20@plt>
lea    0xea5(%rip),%rdi
call   1040 <puts@plt>
lea    0xe8e(%rip),%rdi
call   1070 <gunzip@plt>
xor    %eax,%eax
call   1060 <chainloader@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [36 x i8] c"\0AQuafios ISO-Live bootstrap stage.\0A\00"
@.str.1 = [11 x i8] c"RAMDISK.GZ\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @enter_unreal()
%3 = call i32 (...) @enable_a20()
%4 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @gunzip(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 (...) @chainloader()
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [11 x i8] c"RAMDISK.GZ\00"
@str = [35 x i8] c"\0AQuafios ISO-Live bootstrap stage.\00"
define i32 @main() {
%1 = tail call i32 (...) @enter_unreal()
%2 = tail call i32 (...) @enable_a20()
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @gunzip(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 (...) @chainloader()
ret i32 0
}
int to_line(cp)
int cp;
{
  int tdx, line;
  tdx = 0;
  line = 0;
  while (tdx <= cp) {
    tdx = 1 + fseekeol(tdx);
    line++;
  }
  return (line);
}


x86 assembly (clang, -O0):
<to_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     1153 <to_line+0x43>
mov    -0x8(%rbp),%edi
mov    $0x0,%al
call   1030 <fseekeol@plt>
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1129 <to_line+0x19>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_line>:
push   %rbp
push   %rbx
push   %rax
test   %edi,%edi
js     1133 <to_line+0x23>
mov    %edi,%ebx
xor    %ebp,%ebp
xor    %edi,%edi
nopl   (%rax)
xor    %eax,%eax
call   1030 <fseekeol@plt>
lea    0x1(%rax),%edi
add    $0x1,%ebp
cmp    %ebx,%eax
jl     1120 <to_line+0x10>
jmp    1135 <to_line+0x25>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @to_line(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ 0, %1 ]
%5 = phi i32 [ %7, %3 ], [ 0, %1 ]
%6 = tail call i32 (i32, ...) bitcast (i32 (...)* @fseekeol to i32 (i32, ...)*)(i32 %5)
%7 = add nsw i32 %6, 1
%8 = add nuw nsw i32 %4, 1
%9 = icmp slt i32 %6, %0
br i1 %9, label %3, label %10
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ kprintf(char *, int);
void isrHandle20() { kprintf("ISR %d.\n", 20); }


x86 assembly (clang, -O0):
<isrHandle20>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x14,%esi
call   1030 <kprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<isrHandle20>:
lea    0xee9(%rip),%rdi
mov    $0x14,%esi
jmp    1030 <kprintf@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"ISR %d.\0A\00"
define void @isrHandle20() {
%1 = call i32 @kprintf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 20)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"ISR %d.\0A\00"
define void @isrHandle20() {
%1 = tail call i32 @kprintf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 20)
ret void
}
float _start(void *arg) {
  unsigned int addr = (unsigned int)arg;
  return *(float *)&addr;
}


x86 assembly (clang, -O0):
<_start>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<_start>:
movd   %edi,%xmm0
ret

LLVM IR (-O0):
define float @_start(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = ptrtoint i8* %4 to i32
store i32 %5, i32* %3
%6 = bitcast i32* %3 to float*
%7 = load float, float* %6
ret float %7
}

LLVM IR (-O2):
define float @_start(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
%4 = bitcast i32 %3 to float
ret float %4
}
int FACOM_numberOfDigits(int number) {
  int numberOfDigits;
  for (numberOfDigits = 0; number > 0; numberOfDigits++, number /= 10)
    ;
  return numberOfDigits;
}


x86 assembly (clang, -O0):
<FACOM_numberOfDigits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1139 <FACOM_numberOfDigits+0x39>
jmp    111d <FACOM_numberOfDigits+0x1d>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    110e <FACOM_numberOfDigits+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<FACOM_numberOfDigits>:
xor    %eax,%eax
test   %edi,%edi
jle    1124 <FACOM_numberOfDigits+0x24>
mov    $0xcccccccd,%ecx
nopl   0x0(%rax,%rax,1)
add    $0x1,%eax
mov    %edi,%edx
imul   %rcx,%rdx
shr    $0x23,%rdx
cmp    $0x9,%edi
mov    %edx,%edi
ja     1110 <FACOM_numberOfDigits+0x10>
ret

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

LLVM IR (-O2):
define i32 @FACOM_numberOfDigits(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = phi i32 [ %7, %3 ], [ %0, %1 ]
%6 = add nuw nsw i32 %4, 1
%7 = udiv i32 %5, 10
%8 = icmp ult i32 %5, 10
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %10
}
/* Type definitions */
struct wl_resource {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ wl_resource_post_event(struct wl_resource *, int);
void wl_data_source_send_dnd_drop_performed(struct wl_resource *resource_) {
  wl_resource_post_event(resource_, 3);
}


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

x86 assembly (clang, -O2):
<wl_data_source_send_dnd_drop_performed>:
mov    $0x3,%esi
jmp    1030 <wl_resource_post_event@plt>

LLVM IR (-O0):
%struct.wl_resource = type { i32 }
define void @wl_data_source_send_dnd_drop_performed(%struct.wl_resource* %0) {
%2 = alloca %struct.wl_resource*
store %struct.wl_resource* %0, %struct.wl_resource** %2
%3 = load %struct.wl_resource*, %struct.wl_resource** %2
%4 = call i32 @wl_resource_post_event(%struct.wl_resource* %3, i32 3)
ret void
}

LLVM IR (-O2):
%struct.wl_resource = type { i32 }
define void @wl_data_source_send_dnd_drop_performed(%struct.wl_resource* %0) {
%2 = tail call i32 @wl_resource_post_event(%struct.wl_resource* %0, i32 3)
ret void
}
/* Type definitions */
struct cbor_buf {
  int dummy;
};

/* Variables and functions */
int cbor_expect_byte(struct cbor_buf *, int);
bool cbor_expect_null(struct cbor_buf *buf) {
  return cbor_expect_byte(buf, 0xf6);
}


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

x86 assembly (clang, -O2):
<cbor_expect_null>:
mov    $0xf6,%esi
jmp    1030 <cbor_expect_byte@plt>

LLVM IR (-O0):
%struct.cbor_buf = type { i32 }
define i32 @cbor_expect_null(%struct.cbor_buf* %0) {
%2 = alloca %struct.cbor_buf*
store %struct.cbor_buf* %0, %struct.cbor_buf** %2
%3 = load %struct.cbor_buf*, %struct.cbor_buf** %2
%4 = call i32 @cbor_expect_byte(%struct.cbor_buf* %3, i32 246)
ret i32 %4
}

LLVM IR (-O2):
%struct.cbor_buf = type { i32 }
define i32 @cbor_expect_null(%struct.cbor_buf* %0) {
%2 = tail call i32 @cbor_expect_byte(%struct.cbor_buf* %0, i32 246)
ret i32 %2
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ntohl(int /*<<< orphan*/);
uint32_t get_ingress_egress(uint8_t *hof) {
  uint8_t in_eg_bytes[4];
  int i;
  for (i = 0; i < 3; i++)
    in_eg_bytes[1 + i] = *(hof + 2 + i);
  in_eg_bytes[0] = 0;
  return ntohl(*(uint32_t *)(in_eg_bytes));
}


x86 assembly (clang, -O0):
<get_ingress_egress>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x34(%rbp)
cmpl   $0x3,-0x34(%rbp)
jge    1155 <get_ingress_egress+0x45>
mov    -0x8(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    0x10(%rax,%rcx,8),%rcx
mov    -0x34(%rbp),%eax
add    $0x1,%eax
cltq
mov    %rcx,-0x30(%rbp,%rax,8)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1123 <get_ingress_egress+0x13>
movq   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%edi
call   1030 <ntohl@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_ingress_egress>:
xor    %edi,%edi
jmp    1030 <ntohl@plt>

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

LLVM IR (-O2):
define i32 @get_ingress_egress(i64* nocapture readnone %0) {
%2 = tail call i32 @ntohl(i32 0)
ret i32 %2
}
/* Variables and functions */
void *b1(size_t);
void *c2(size_t n) { return b1(n); }


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

x86 assembly (clang, -O2):
<c2>:
jmp    1030 <b1@plt>

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

LLVM IR (-O2):
define i8* @c2(i64 %0) {
%2 = tail call i8* @b1(i64 %0)
ret i8* %2
}
sign(n) int n;
{
  if (n < 0)
    return -1;
  else if (n > 0)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<sign>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    111d <sign+0x1d>
movl   $0xffffffff,-0x4(%rbp)
jmp    113a <sign+0x3a>
cmpl   $0x0,-0x8(%rbp)
jle    1133 <sign+0x33>
movl   $0x1,-0x4(%rbp)
jmp    113a <sign+0x3a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sign>:
xor    %ecx,%ecx
test   %edi,%edi
setne  %cl
mov    $0xffffffff,%eax
cmovns %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @sign(i32 %0) {
%2 = icmp ne i32 %0, 0
%3 = zext i1 %2 to i32
%4 = icmp sgt i32 %0, -1
%5 = select i1 %4, i32 %3, i32 -1
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ __coverity_alloc__(int);
void *EC_GROUP_new_by_curve_name(int curve) { __coverity_alloc__(curve); }


x86 assembly (clang, -O0):
<EC_GROUP_new_by_curve_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <__coverity_alloc__@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EC_GROUP_new_by_curve_name>:
jmp    1030 <__coverity_alloc__@plt>

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

LLVM IR (-O2):
define noalias i8* @EC_GROUP_new_by_curve_name(i32 %0) {
%2 = tail call i32 @__coverity_alloc__(i32 %0)
ret i8* undef
}