xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ bif_register_arity2(char const *, float (*)(float, float));
void nanocalc_register_bif_arity2(const char *name,
                                  float (*fun)(float, float)) {
  bif_register_arity2(name, fun);
}


x86 assembly (clang, -O0):
<nanocalc_register_bif_arity2>:
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 <bif_register_arity2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nanocalc_register_bif_arity2>:
jmp    1030 <bif_register_arity2@plt>

LLVM IR (-O0):
define void @nanocalc_register_bif_arity2(i8* %0, float (float, float)* %1) {
%3 = alloca i8*
%4 = alloca float (float, float)*
store i8* %0, i8** %3
store float (float, float)* %1, float (float, float)** %4
%5 = load i8*, i8** %3
%6 = load float (float, float)*, float (float, float)** %4
%7 = call i32 @bif_register_arity2(i8* %5, float (float, float)* %6)
ret void
}

LLVM IR (-O2):
define void @nanocalc_register_bif_arity2(i8* %0, float (float, float)* %1) {
%3 = tail call i32 @bif_register_arity2(i8* %0, float (float, float)* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_escaped(char *, int);
int /*<<< orphan*/ printf(char *);
void print_link(char *link) {
  printf("\t\t<link href=\"");
  print_escaped(link, true);
  printf("\"></link>\n");
}


x86 assembly (clang, -O0):
<print_link>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1040 <print_escaped@plt>
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_link>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1050 <print_escaped@plt>
lea    0xebb(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"\09\09<link href=\22\00"
@.str.1 = [11 x i8] c"\22></link>\0A\00"
define void @print_link(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 @print_escaped(i8* %4, i32 1)
%6 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"\09\09<link href=\22\00"
@str = [10 x i8] c"\22></link>\00"
define void @print_link(i8* %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @print_escaped(i8* %0, i32 1)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ drucke(int);
int main() {
  drucke(1);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @drucke(i32 1)
ret i32 0
}
char *strclr(char *str) {
  str[0] = 0;
  return str;
}


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

x86 assembly (clang, -O2):
<strclr>:
mov    %rdi,%rax
movb   $0x0,(%rdi)
ret

LLVM IR (-O0):
define i8* @strclr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
store i8 0, i8* %4
%5 = load i8*, i8** %2
ret i8* %5
}

LLVM IR (-O2):
define i8* @strclr(i8* returned writeonly %0) {
store i8 0, i8* %0
ret i8* %0
}
void reverse(int *num, int s, int t) {
  int tmp;
  while (s < t) {
    tmp = num[s];
    num[s] = num[t];
    num[t] = tmp;
    s++;
    t--;
  }
}


x86 assembly (clang, -O0):
<reverse>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1163 <reverse+0x63>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    110e <reverse+0xe>
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse>:
cmp    %edx,%esi
jge    112e <reverse+0x2e>
movslq %esi,%rax
movslq %edx,%rcx
add    $0x1,%rax
xchg   %ax,%ax
mov    -0x4(%rdi,%rax,4),%edx
mov    (%rdi,%rcx,4),%esi
mov    %esi,-0x4(%rdi,%rax,4)
mov    %edx,(%rdi,%rcx,4)
add    $0xffffffffffffffff,%rcx
lea    0x1(%rax),%rdx
cmp    %rcx,%rax
mov    %rdx,%rax
jl     1110 <reverse+0x10>
ret

LLVM IR (-O0):
define void @reverse(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
br label %8
8: ; preds = %12, %3
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %36
12: ; preds = %8
%13 = load i32*, i32** %4
%14 = load i32, i32* %5
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
store i32 %17, i32* %7
%18 = load i32*, i32** %4
%19 = load i32, i32* %6
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %18, i64 %20
%22 = load i32, i32* %21
%23 = load i32*, i32** %4
%24 = load i32, i32* %5
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %23, i64 %25
store i32 %22, i32* %26
%27 = load i32, i32* %7
%28 = load i32*, i32** %4
%29 = load i32, i32* %6
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds i32, i32* %28, i64 %30
store i32 %27, i32* %31
%32 = load i32, i32* %5
%33 = add nsw i32 %32, 1
store i32 %33, i32* %5
%34 = load i32, i32* %6
%35 = add nsw i32 %34, -1
store i32 %35, i32* %6
br label %8
36: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @reverse(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %18
5: ; preds = %3
%6 = sext i32 %1 to i64
%7 = sext i32 %2 to i64
br label %8
8: ; preds = %5, %8
%9 = phi i64 [ %7, %5 ], [ %16, %8 ]
%10 = phi i64 [ %6, %5 ], [ %15, %8 ]
%11 = getelementptr inbounds i32, i32* %0, i64 %10
%12 = load i32, i32* %11
%13 = getelementptr inbounds i32, i32* %0, i64 %9
%14 = load i32, i32* %13
store i32 %14, i32* %11
store i32 %12, i32* %13
%15 = add nsw i64 %10, 1
%16 = add nsw i64 %9, -1
%17 = icmp slt i64 %15, %16
br i1 %17, label %8, label %18
18: ; preds = %8, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
__attribute__((always_)) void tu_addstr(const char *str) { fputs(str, stdout); }


x86 assembly (clang, -O0):
<tu_addstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb9(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tu_addstr>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
jmp    1030 <fputs@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @tu_addstr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @stdout
%5 = call i32 @fputs(i8* %3, i32 %4)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @tu_addstr(i8* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fputs(i8* %0, i32 %2)
ret void
}
double bound(double x, double l, double u) {
  if (x < l)
    return l;
  if (x > u)
    return u;
  return x;
}


x86 assembly (clang, -O0):
<bound>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1136 <bound+0x36>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    115f <bound+0x5f>
movsd  -0x10(%rbp),%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    1155 <bound+0x55>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    115f <bound+0x5f>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<bound>:
minsd  %xmm0,%xmm2
cmpltsd %xmm1,%xmm0
movapd %xmm0,%xmm3
andnpd %xmm2,%xmm3
andpd  %xmm1,%xmm0
orpd   %xmm3,%xmm0
ret

LLVM IR (-O0):
define double @bound(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
%8 = load double, double* %5
%9 = load double, double* %6
%10 = fcmp olt double %8, %9
br i1 %10, label %11, label %13
11: ; preds = %3
%12 = load double, double* %6
store double %12, double* %4
br label %21
13: ; preds = %3
%14 = load double, double* %5
%15 = load double, double* %7
%16 = fcmp ogt double %14, %15
br i1 %16, label %17, label %19
17: ; preds = %13
%18 = load double, double* %7
store double %18, double* %4
br label %21
19: ; preds = %13
%20 = load double, double* %5
store double %20, double* %4
br label %21
21: ; preds = %19, %17, %11
%22 = load double, double* %4
ret double %22
}

LLVM IR (-O2):
define double @bound(double %0, double %1, double %2) {
%4 = fcmp olt double %0, %1
%5 = fcmp ogt double %0, %2
%6 = select i1 %5, double %2, double %0
%7 = select i1 %4, double %1, double %6
ret double %7
}
__attribute__((always_)) void set_cpu_numa_mem(int cpu, int node) {}


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

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

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

LLVM IR (-O2):
define void @set_cpu_numa_mem(i32 %0, i32 %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ perror(char *);
void closeFile(FILE *file) {
  int ret = fclose(file);
  if (ret == -1) {
    perror("Cannot close file");
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<closeFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
jne    116c <closeFile+0x3c>
lea    0xea7(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e7b(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<closeFile>:
push   %rax
call   1030 <fclose@plt>
cmp    $0xffffffff,%eax
je     113d <closeFile+0xd>
pop    %rax
ret
lea    0xebc(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"Cannot close file\00"
@EXIT_FAILURE = global i32 0
define void @closeFile(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @fclose(i32* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = call i32 @perror(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%10 = load i32, i32* @EXIT_FAILURE
%11 = call i32 @exit(i32 %10)
unreachable
12: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"Cannot close file\00"
@EXIT_FAILURE = global i32 0
define void @closeFile(i32* nocapture %0) {
%2 = tail call i32 @fclose(i32* %0)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
8: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ srandom(int);
void beefrandinitdef_() { srandom(1); }


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

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

LLVM IR (-O0):
define void @beefrandinitdef_() {
%1 = call i32 @srandom(i32 1)
ret void
}

LLVM IR (-O2):
define void @beefrandinitdef_() {
%1 = tail call i32 @srandom(i32 1)
ret void
}
void uDMAControlBaseSet(void *pControlTable) {

  ;
  ;
  (*((volatile unsigned long *)(0x400FF008))) = (unsigned long)pControlTable;
}


x86 assembly (clang, -O0):
<uDMAControlBaseSet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    $0x400ff008,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<uDMAControlBaseSet>:
mov    %rdi,0x400ff008
40
ret

LLVM IR (-O0):
define void @uDMAControlBaseSet(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i64
store volatile i64 %4, i64* inttoptr (i64 1074786312 to i64*)
ret void
}

LLVM IR (-O2):
define void @uDMAControlBaseSet(i8* %0) {
%2 = ptrtoint i8* %0 to i64
store volatile i64 %2, i64* inttoptr (i64 1074786312 to i64*)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fgets_or_exit(char *, int, int /*<<< orphan*/ *);
void skip_headers(FILE *client) {
  char buf[255];
  while (buf[0] != '\r' && buf[1] != '\n')
    fgets_or_exit(buf, 255, client);
}


x86 assembly (clang, -O0):
<skip_headers>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %rdi,-0x8(%rbp)
movsbl -0x110(%rbp),%ecx
xor    %eax,%eax
cmp    $0xd,%ecx
mov    %al,-0x111(%rbp)
je     114a <skip_headers+0x3a>
movsbl -0x10f(%rbp),%eax
cmp    $0xa,%eax
setne  %al
mov    %al,-0x111(%rbp)
mov    -0x111(%rbp),%al
test   $0x1,%al
jne    115d <skip_headers+0x4d>
jmp    1177 <skip_headers+0x67>
lea    -0x110(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0xff,%esi
call   1030 <fgets_or_exit@plt>
jmp    111f <skip_headers+0xf>
add    $0x120,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @skip_headers(i32* %0) {
%2 = alloca i32*
%3 = alloca [255 x i8]
store i32* %0, i32** %2
br label %4
4: ; preds = %16, %1
%5 = getelementptr inbounds [255 x i8], [255 x i8]* %3, i64 0, i64 0
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp ne i32 %7, 13
br i1 %8, label %9, label %14
9: ; preds = %4
%10 = getelementptr inbounds [255 x i8], [255 x i8]* %3, i64 0, i64 1
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp ne i32 %12, 10
br label %14
14: ; preds = %9, %4
%15 = phi i1 [ false, %4 ], [ %13, %9 ]
br i1 %15, label %16, label %20
16: ; preds = %14
%17 = getelementptr inbounds [255 x i8], [255 x i8]* %3, i64 0, i64 0
%18 = load i32*, i32** %2
%19 = call i32 @fgets_or_exit(i8* %17, i32 255, i32* %18)
br label %4
20: ; preds = %14
ret void
}

LLVM IR (-O2):
define void @skip_headers(i32* %0) {
ret void
}
void acmpEnable(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ alphasort;
int scandir(char const *, struct dirent ***, int /*<<< orphan*/,
            int /*<<< orphan*/);
int scandir_sorted(const char *dirstr, struct dirent ***namelst) {
  return scandir(dirstr, namelst, 0, alphasort);
}


x86 assembly (clang, -O0):
<scandir_sorted>:
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    0x2eb1(%rip),%rax
mov    (%rax),%ecx
xor    %edx,%edx
call   1030 <scandir@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scandir_sorted>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%ecx
xor    %edx,%edx
jmp    1030 <scandir@plt>

LLVM IR (-O0):
%struct.dirent = type { i32 }
@alphasort = global i32 0
define i32 @scandir_sorted(i8* %0, %struct.dirent*** %1) {
%3 = alloca i8*
%4 = alloca %struct.dirent***
store i8* %0, i8** %3
store %struct.dirent*** %1, %struct.dirent**** %4
%5 = load i8*, i8** %3
%6 = load %struct.dirent***, %struct.dirent**** %4
%7 = load i32, i32* @alphasort
%8 = call i32 @scandir(i8* %5, %struct.dirent*** %6, i32 0, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
%struct.dirent = type { i32 }
@alphasort = global i32 0
define i32 @scandir_sorted(i8* %0, %struct.dirent*** %1) {
%3 = load i32, i32* @alphasort
%4 = tail call i32 @scandir(i8* %0, %struct.dirent*** %1, i32 0, i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
int hex_chunk(char buffer[4 + 1], int source) {
  sprintf(buffer, "%04X", source);
  return 0;
}


x86 assembly (clang, -O0):
<hex_chunk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xed3(%rip),%rsi
call   1030 <sprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hex_chunk>:
push   %rax
mov    %esi,%edx
lea    0xee6(%rip),%rsi
call   1030 <sprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%04X\00"
define i32 @hex_chunk(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%04X\00"
define i32 @hex_chunk(i8* nocapture writeonly %0, i32 %1) {
%3 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int db_enum_end(char **);
int pi_db_enum_end(char **pe) { return db_enum_end(pe); }


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

x86 assembly (clang, -O2):
<pi_db_enum_end>:
jmp    1030 <db_enum_end@plt>

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

LLVM IR (-O2):
define i32 @pi_db_enum_end(i8** %0) {
%2 = tail call i32 @db_enum_end(i8** %0)
ret i32 %2
}
double deltat_wim(double tempk) {
  double result;
  result = 0.3225 * tempk - 91.743;
  if (result < 1) {
    result = 1.0;
  } else if (result > 13) {
    result = 13.0;
  }
  return result;
}


x86 assembly (clang, -O0):
<deltat_wim>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xef2(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeee(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xecd(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1150 <deltat_wim+0x50>
movsd  0xeba(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1179 <deltat_wim+0x79>
movsd  -0x10(%rbp),%xmm0
movsd  0xebb(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1174 <deltat_wim+0x74>
movsd  0xea9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1179 <deltat_wim+0x79>
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<deltat_wim>:
mulsd  0xef8(%rip),%xmm0
addsd  0xef8(%rip),%xmm0
movsd  0xef8(%rip),%xmm1
ucomisd %xmm0,%xmm1
ja     1134 <deltat_wim+0x34>
ucomisd 0xef2(%rip),%xmm0
movapd %xmm0,%xmm1
jbe    1134 <deltat_wim+0x34>
movsd  0xee4(%rip),%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @deltat_wim(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = call double @llvm.fmuladd.f64(double 3.225000e-01, double %4, double 0xC056EF8D4FDF3B64)
store double %5, double* %3
%6 = load double, double* %3
%7 = fcmp olt double %6, 1.000000e+00
br i1 %7, label %8, label %9
8: ; preds = %1
store double 1.000000e+00, double* %3
br label %14
9: ; preds = %1
%10 = load double, double* %3
%11 = fcmp ogt double %10, 1.300000e+01
br i1 %11, label %12, label %13
12: ; preds = %9
store double 1.300000e+01, double* %3
br label %13
13: ; preds = %12, %9
br label %14
14: ; preds = %13, %8
%15 = load double, double* %3
ret double %15
}

LLVM IR (-O2):
define double @deltat_wim(double %0) {
%2 = tail call double @llvm.fmuladd.f64(double %0, double 3.225000e-01, double 0xC056EF8D4FDF3B64)
%3 = fcmp olt double %2, 1.000000e+00
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = fcmp ogt double %2, 1.300000e+01
br i1 %5, label %6, label %7
6: ; preds = %4
br label %7
7: ; preds = %1, %4, %6
%8 = phi double [ 1.300000e+01, %6 ], [ %2, %4 ], [ 1.000000e+00, %1 ]
ret double %8
}
/* Type definitions */
struct ether_addr {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ETH_ALEN;
int memcmp(struct ether_addr const *, struct ether_addr const *,
           int /*<<< orphan*/);
int ether_addr_compare(const struct ether_addr *a, const struct ether_addr *b) {
  return memcmp(a, b, ETH_ALEN);
}


x86 assembly (clang, -O0):
<ether_addr_compare>:
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    0x2eb9(%rip),%rax
mov    (%rax),%edx
call   1030 <memcmp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ether_addr_compare>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edx
jmp    1030 <memcmp@plt>

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

LLVM IR (-O2):
%struct.ether_addr = type { i32 }
@ETH_ALEN = global i32 0
define i32 @ether_addr_compare(%struct.ether_addr* %0, %struct.ether_addr* %1) {
%3 = load i32, i32* @ETH_ALEN
%4 = tail call i32 @memcmp(%struct.ether_addr* %0, %struct.ether_addr* %1, i32 %3)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ int8_t;

/* Variables and functions */
int terminal_measure8(int /*<<< orphan*/ const *);
int terminal_measure(const char *s) {
  return terminal_measure8((const int8_t *)s);
}


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

x86 assembly (clang, -O2):
<terminal_measure>:
jmp    1030 <terminal_measure8@plt>

LLVM IR (-O0):
define i32 @terminal_measure(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = call i32 @terminal_measure8(i32* %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @terminal_measure(i8* %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 @terminal_measure8(i32* %2)
ret i32 %3
}
double sept(double v) {
  return (quad(v)) * (cub(v));
  __builtin_unreachable();
}


x86 assembly (clang, -O0):
<sept>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x1,%al
call   1030 <quad@plt>
mov    %eax,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x1,%al
call   1040 <cub@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
imul   %ecx,%eax
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sept>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
mov    $0x1,%al
call   1030 <quad@plt>
mov    %eax,%ebx
movsd  0x8(%rsp),%xmm0
mov    $0x1,%al
call   1040 <cub@plt>
imul   %ebx,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @sept(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 (double, ...) bitcast (i32 (...)* @quad to i32 (double, ...)*)(double %3)
%5 = load double, double* %2
%6 = call i32 (double, ...) bitcast (i32 (...)* @cub to i32 (double, ...)*)(double %5)
%7 = mul nsw i32 %4, %6
%8 = sitofp i32 %7 to double
ret double %8
}

LLVM IR (-O2):
define double @sept(double %0) {
%2 = tail call i32 (double, ...) bitcast (i32 (...)* @quad to i32 (double, ...)*)(double %0)
%3 = tail call i32 (double, ...) bitcast (i32 (...)* @cub to i32 (double, ...)*)(double %0)
%4 = mul nsw i32 %3, %2
%5 = sitofp i32 %4 to double
ret double %5
}
/* Variables and functions */
scalar_t__ malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *CopyName(const char *s) {
  char *t = (char *)malloc(strlen(s) + 1);
  strcpy(t, s);
  return t;
}


x86 assembly (clang, -O0):
<CopyName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CopyName>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @CopyName(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i64 @malloc(i64 %6)
%8 = inttoptr i64 %7 to i8*
store i8* %8, i8** %3
%9 = load i8*, i8** %3
%10 = load i8*, i8** %2
%11 = call i32 @strcpy(i8* %9, i8* %10)
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
define i8* @CopyName(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i64 @malloc(i64 %3)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @strcpy(i8* %5, i8* %0)
ret i8* %5
}
/* Type definitions */
struct sockaddr_in {
  int dummy;
};
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ server;

/* Variables and functions */
scalar_t__ bind(char, struct sockaddr *, int);
int /*<<< orphan*/ perror(char *);
int Server_Bind(struct sockaddr_in server, char socket_desc) {
  if (bind(socket_desc, (struct sockaddr *)&server, sizeof(server)) < 0) {
    perror("bind failed. Error");
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<Server_Bind>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
lea    -0x8(%rbp),%rsi
mov    $0x4,%edx
movsbl %al,%edi
call   1030 <bind@plt>
cmp    $0x0,%rax
jge    1167 <Server_Bind+0x47>
lea    0xeaa(%rip),%rdi
call   1040 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    116e <Server_Bind+0x4e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Server_Bind>:
push   %rax
mov    %esi,%eax
mov    %edi,(%rsp)
mov    %rsp,%rsi
mov    %eax,%edi
mov    $0x4,%edx
call   1030 <bind@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
js     1141 <Server_Bind+0x21>
pop    %rcx
ret
lea    0xeb8(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.sockaddr_in = type { i32 }
%struct.sockaddr = type { i32 }
@.str = [19 x i8] c"bind failed. Error\00"
define i32 @Server_Bind(i32 %0, i8 signext %1) {
%3 = alloca i32
%4 = alloca %struct.sockaddr_in
%5 = alloca i8
%6 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i32 0, i32 0
store i32 %0, i32* %6
store i8 %1, i8* %5
%7 = load i8, i8* %5
%8 = bitcast %struct.sockaddr_in* %4 to %struct.sockaddr*
%9 = call i64 @bind(i8 signext %7, %struct.sockaddr* %8, i32 4)
%10 = icmp slt i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 @perror(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %14
13: ; preds = %2
store i32 0, i32* %3
br label %14
14: ; preds = %13, %11
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32 }
%struct.sockaddr = type { i32 }
@.str = [19 x i8] c"bind failed. Error\00"
define i32 @Server_Bind(i32 %0, i8 signext %1) {
%3 = alloca %struct.sockaddr_in
%4 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 0
store i32 %0, i32* %4
%5 = bitcast %struct.sockaddr_in* %3 to %struct.sockaddr*
%6 = call i64 @bind(i8 signext %1, %struct.sockaddr* %5, i32 4)
%7 = icmp slt i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @perror(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %2, %8
%11 = phi i32 [ 1, %8 ], [ 0, %2 ]
ret i32 %11
}
/* Variables and functions */
void *grfio_reads(char const *, int /*<<< orphan*/ *);
void *grfio_read(const char *fname) { return grfio_reads(fname, NULL); }


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

x86 assembly (clang, -O2):
<grfio_read>:
xor    %esi,%esi
jmp    1030 <grfio_reads@plt>

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

LLVM IR (-O2):
define i8* @grfio_read(i8* %0) {
%2 = tail call i8* @grfio_reads(i8* %0, i32* null)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "Usage: aotool -l <exe or dylib> <out.aot>\n");
  fprintf(stderr, "       aotool -c <file.c> <out.aot>\n");
  fprintf(stderr, "       aotool -d <file.c>\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [43 x i8] c"Usage: aotool -l <exe or dylib> <out.aot>\0A\00"
@.str.1 = [37 x i8] c" aotool -c <file.c> <out.aot>\0A\00"
@.str.2 = [27 x i8] c" aotool -d <file.c>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [43 x i8] c"Usage: aotool -l <exe or dylib> <out.aot>\0A\00"
@.str.1 = [37 x i8] c" aotool -c <file.c> <out.aot>\0A\00"
@.str.2 = [27 x i8] c" aotool -d <file.c>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ lin_rsk_close(int const);
void deinit_raw_socket(const int sockfd) { lin_rsk_close(sockfd); }


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

x86 assembly (clang, -O2):
<deinit_raw_socket>:
jmp    1030 <lin_rsk_close@plt>

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

LLVM IR (-O2):
define void @deinit_raw_socket(i32 %0) {
%2 = tail call i32 @lin_rsk_close(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, float);
int /*<<< orphan*/ read_temp(float *, char *);
int /*<<< orphan*/ stdout;
void print_status(char *fileName) {
  float temp;
  if (!read_temp(&temp, fileName)) {
    printf(">Temperature: %.1f C\n", temp);
    fflush(stdout);
  }
}


x86 assembly (clang, -O0):
<print_status>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdi
call   1050 <read_temp@plt>
cmp    $0x0,%eax
jne    1171 <print_status+0x41>
movss  -0xc(%rbp),%xmm0
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e76(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_status>:
push   %rax
mov    %rdi,%rsi
lea    0x4(%rsp),%rdi
call   1050 <read_temp@plt>
test   %eax,%eax
je     1144 <print_status+0x14>
pop    %rax
ret
movss  0x4(%rsp),%xmm0
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e83(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [22 x i8] c">Temperature: %.1f C\0A\00"
@stdout = global i32 0
define void @print_status(i8* %0) {
%2 = alloca i8*
%3 = alloca float
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @read_temp(float* %3, i8* %4)
%6 = icmp ne i32 %5, 0
br i1 %6, label %12, label %7
7: ; preds = %1
%8 = load float, float* %3
%9 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), float %8)
%10 = load i32, i32* @stdout
%11 = call i32 @fflush(i32 %10)
br label %12
12: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c">Temperature: %.1f C\0A\00"
@stdout = global i32 0
define void @print_status(i8* %0) {
%2 = alloca float
%3 = bitcast float* %2 to i8*
%4 = call i32 @read_temp(float* %2, i8* %0)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load float, float* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), float %7)
%9 = load i32, i32* @stdout
%10 = call i32 @fflush(i32 %9)
br label %11
11: ; preds = %6, %1
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int depth;
};
typedef TYPE_1__ XVisualInfo;

/* Variables and functions */
void set_XVisualInfo_depth(void *_p, int _v) {
  ((XVisualInfo *)_p)->depth = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XVisualInfo_depth>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XVisualInfo_depth(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XVisualInfo_depth(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _int2str(long, char *);
char *int2str(long val, char *out) {
  _int2str(val, out);
  return out;
}


x86 assembly (clang, -O0):
<int2str>:
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 <_int2str@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<int2str>:
push   %rbx
mov    %rsi,%rbx
call   1030 <_int2str@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @int2str(i64 %0, i8* returned %1) {
%3 = tail call i32 @_int2str(i64 %0, i8* %1)
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ get_new_string(char *, int, char *, int, int);
void get_string(char *prompt, int length, char *result, int line) {
  get_new_string(prompt, length, result, line, 5);
}


x86 assembly (clang, -O0):
<get_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    $0x5,%r8d
call   1030 <get_new_string@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_string>:
mov    $0x5,%r8d
jmp    1030 <get_new_string@plt>

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

LLVM IR (-O2):
define void @get_string(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = tail call i32 @get_new_string(i8* %0, i32 %1, i8* %2, i32 %3, i32 5)
ret void
}
/* Type definitions */
struct ptree_node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct ptree_node *);
void ptree_node_free(struct ptree_node *node) { free(node); }


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

x86 assembly (clang, -O2):
<ptree_node_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.ptree_node = type { i32 }
define void @ptree_node_free(%struct.ptree_node* nocapture %0) {
%2 = tail call i32 @free(%struct.ptree_node* %0)
ret void
}
int IsKoreanHanme(const unsigned char *cp, int *pdxChar) {
  if ((*cp >= 0xb0 && *cp <= 0xc8) &&
      (*(cp + 1) >= 0xa1 && *(cp + 1) <= 0xfe)) {
    *pdxChar = 11;
    return 2;
  }
  return 0;
}


x86 assembly (clang, -O0):
<IsKoreanHanme>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
cmp    $0xb0,%eax
jl     116c <IsKoreanHanme+0x6c>
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
cmp    $0xc8,%eax
jg     116c <IsKoreanHanme+0x6c>
mov    -0x10(%rbp),%rax
movzbl 0x1(%rax),%eax
cmp    $0xa1,%eax
jl     116c <IsKoreanHanme+0x6c>
mov    -0x10(%rbp),%rax
movzbl 0x1(%rax),%eax
cmp    $0xfe,%eax
jg     116c <IsKoreanHanme+0x6c>
mov    -0x18(%rbp),%rax
movl   $0xb,(%rax)
movl   $0x2,-0x4(%rbp)
jmp    1173 <IsKoreanHanme+0x73>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsKoreanHanme>:
mov    (%rdi),%cl
add    $0x50,%cl
xor    %eax,%eax
cmp    $0x18,%cl
ja     1122 <IsKoreanHanme+0x22>
mov    0x1(%rdi),%cl
add    $0x1,%cl
cmp    $0xa2,%cl
jb     1122 <IsKoreanHanme+0x22>
movl   $0xb,(%rsi)
mov    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @IsKoreanHanme(i8* %0, i32* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32*
store i8* %0, i8** %4
store i32* %1, i32** %5
%6 = load i8*, i8** %4
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = icmp sge i32 %8, 176
br i1 %9, label %10, label %29
10: ; preds = %2
%11 = load i8*, i8** %4
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = icmp sle i32 %13, 200
br i1 %14, label %15, label %29
15: ; preds = %10
%16 = load i8*, i8** %4
%17 = getelementptr inbounds i8, i8* %16, i64 1
%18 = load i8, i8* %17
%19 = zext i8 %18 to i32
%20 = icmp sge i32 %19, 161
br i1 %20, label %21, label %29
21: ; preds = %15
%22 = load i8*, i8** %4
%23 = getelementptr inbounds i8, i8* %22, i64 1
%24 = load i8, i8* %23
%25 = zext i8 %24 to i32
%26 = icmp sle i32 %25, 254
br i1 %26, label %27, label %29
27: ; preds = %21
%28 = load i32*, i32** %5
store i32 11, i32* %28
store i32 2, i32* %3
br label %30
29: ; preds = %21, %15, %10, %2
store i32 0, i32* %3
br label %30
30: ; preds = %29, %27
%31 = load i32, i32* %3
ret i32 %31
}

LLVM IR (-O2):
define i32 @IsKoreanHanme(i8* nocapture %0, i32* nocapture writeonly %1) {
%3 = load i8, i8* %0
%4 = add i8 %3, 80
%5 = icmp ult i8 %4, 25
br i1 %5, label %6, label %12
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %0, i64 1
%8 = load i8, i8* %7
%9 = add i8 %8, 1
%10 = icmp ult i8 %9, -94
br i1 %10, label %12, label %11
11: ; preds = %6
store i32 11, i32* %1
br label %12
12: ; preds = %2, %6, %11
%13 = phi i32 [ 2, %11 ], [ 0, %6 ], [ 0, %2 ]
ret i32 %13
}
/* Type definitions */
typedef int /*<<< orphan*/ SVCXPRT;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ svc_destroy(int /*<<< orphan*/ *);
int /*<<< orphan*/ *svcraw_create();
int main(int argn, char *argc[]) {
  int run_mode = 0;
  int test_status = 1;
  SVCXPRT *svcr = NULL;
  svcr = svcraw_create();
  test_status = (svcr != NULL) ? 0 : 1;
  svc_destroy(svcr);
  printf("%d\n", test_status);
  return test_status;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x1,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    $0x0,%al
call   1030 <svcraw_create@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
mov    %eax,-0x18(%rbp)
mov    -0x20(%rbp),%rdi
call   1050 <svc_destroy@plt>
mov    -0x18(%rbp),%esi
lea    0xe71(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <svcraw_create@plt>
xor    %ebx,%ebx
test   %rax,%rax
sete   %bl
mov    %rax,%rdi
call   1050 <svc_destroy@plt>
lea    0xeb1(%rip),%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i32 1, i32* %7
store i32* null, i32** %8
%9 = call i32* (...) @svcraw_create()
store i32* %9, i32** %8
%10 = load i32*, i32** %8
%11 = icmp ne i32* %10, null
%12 = zext i1 %11 to i64
%13 = select i1 %11, i32 0, i32 1
store i32 %13, i32* %7
%14 = load i32*, i32** %8
%15 = call i32 @svc_destroy(i32* %14)
%16 = load i32, i32* %7
%17 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %16)
%18 = load i32, i32* %7
ret i32 %18
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32* (...) @svcraw_create()
%4 = icmp eq i32* %3, null
%5 = zext i1 %4 to i32
%6 = tail call i32 @svc_destroy(i32* %3)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ stm_free2(void *, int /*<<< orphan*/, size_t);
void stm_free(void *addr, size_t size) { stm_free2(addr, 0, size); }


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

x86 assembly (clang, -O2):
<stm_free>:
mov    %rsi,%rdx
xor    %esi,%esi
jmp    1030 <stm_free2@plt>

LLVM IR (-O0):
define void @stm_free(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i32 @stm_free2(i8* %5, i32 0, i64 %6)
ret void
}

LLVM IR (-O2):
define void @stm_free(i8* %0, i64 %1) {
%3 = tail call i32 @stm_free2(i8* %0, i32 0, i64 %1)
ret void
}
/* Variables and functions */
float __infer_nondet_float();
float fmodf(float x, float y) { return __infer_nondet_float(); }


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

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

LLVM IR (-O0):
define float @fmodf(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = call float (...) @__infer_nondet_float()
ret float %5
}

LLVM IR (-O2):
define float @fmodf(float %0, float %1) {
%3 = tail call float (...) @__infer_nondet_float()
ret float %3
}
int test() { return 5.0 < 5.0 - 0.1; }


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

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

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

LLVM IR (-O2):
define i32 @test() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, long long, int);
int fun_call_align_ll_4(int a, long long b, int c) {
  printf("a = %d, b = %lld, c = %d\n", a, b, c);
  return a + b + c;
}


x86 assembly (clang, -O0):
<fun_call_align_ll_4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
movslq -0x4(%rbp),%rax
add    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun_call_align_ll_4>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xedd(%rip),%rdi
mov    %ebp,%esi
mov    %rbx,%rdx
mov    %r14d,%ecx
call   1030 <printf@plt>
add    %ebp,%ebx
add    %r14d,%ebx
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [26 x i8] c"a = %d, b = %lld, c = %d\0A\00"
define i32 @fun_call_align_ll_4(i32 %0, i64 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i64
%6 = alloca i32
store i32 %0, i32* %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i64, i64* %5
%9 = load i32, i32* %6
%10 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %7, i64 %8, i32 %9)
%11 = load i32, i32* %4
%12 = sext i32 %11 to i64
%13 = load i64, i64* %5
%14 = add nsw i64 %12, %13
%15 = load i32, i32* %6
%16 = sext i32 %15 to i64
%17 = add nsw i64 %14, %16
%18 = trunc i64 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
@.str = [26 x i8] c"a = %d, b = %lld, c = %d\0A\00"
define i32 @fun_call_align_ll_4(i32 %0, i64 %1, i32 %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %0, i64 %1, i32 %2)
%5 = trunc i64 %1 to i32
%6 = add i32 %5, %0
%7 = add i32 %6, %2
ret i32 %7
}