xunge/DecIR huggingface dataset:
/* Type definitions */
struct kdtree {
  int dummy;
};

/* Variables and functions */
int kd_insert(struct kdtree *, double *, void *);
int kd_insert3(struct kdtree *tree, double x, double y, double z, void *data) {
  double buf[3];
  buf[0] = x;
  buf[1] = y;
  buf[2] = z;
  return kd_insert(tree, buf, data);
}


x86 assembly (clang, -O0):
<kd_insert3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
mov    %rsi,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x40(%rbp),%rsi
mov    -0x28(%rbp),%rdx
call   1030 <kd_insert@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kd_insert3>:
sub    $0x18,%rsp
mov    %rsi,%rdx
movsd  %xmm0,(%rsp)
movsd  %xmm1,0x8(%rsp)
movsd  %xmm2,0x10(%rsp)
mov    %rsp,%rsi
call   1030 <kd_insert@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.kdtree = type { i32 }
define i32 @kd_insert3(%struct.kdtree* %0, double %1, double %2, double %3, i8* %4) {
%6 = alloca %struct.kdtree*
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca i8*
%11 = alloca [3 x double]
store %struct.kdtree* %0, %struct.kdtree** %6
store double %1, double* %7
store double %2, double* %8
store double %3, double* %9
store i8* %4, i8** %10
%12 = load double, double* %7
%13 = getelementptr inbounds [3 x double], [3 x double]* %11, i64 0, i64 0
store double %12, double* %13
%14 = load double, double* %8
%15 = getelementptr inbounds [3 x double], [3 x double]* %11, i64 0, i64 1
store double %14, double* %15
%16 = load double, double* %9
%17 = getelementptr inbounds [3 x double], [3 x double]* %11, i64 0, i64 2
store double %16, double* %17
%18 = load %struct.kdtree*, %struct.kdtree** %6
%19 = getelementptr inbounds [3 x double], [3 x double]* %11, i64 0, i64 0
%20 = load i8*, i8** %10
%21 = call i32 @kd_insert(%struct.kdtree* %18, double* %19, i8* %20)
ret i32 %21
}

LLVM IR (-O2):
%struct.kdtree = type { i32 }
define i32 @kd_insert3(%struct.kdtree* %0, double %1, double %2, double %3, i8* %4) {
%6 = alloca [3 x double]
%7 = bitcast [3 x double]* %6 to i8*
%8 = getelementptr inbounds [3 x double], [3 x double]* %6, i64 0, i64 0
store double %1, double* %8
%9 = getelementptr inbounds [3 x double], [3 x double]* %6, i64 0, i64 1
store double %2, double* %9
%10 = getelementptr inbounds [3 x double], [3 x double]* %6, i64 0, i64 2
store double %3, double* %10
%11 = call i32 @kd_insert(%struct.kdtree* %0, double* %8, i8* %4)
ret i32 %11
}
/* Variables and functions */
char *concat_path(char *, char const *);
char *getenv(char *);
char *home_path(const char *rel_path) {
  static char *home = NULL;
  if (!home) {
    home = getenv("HOME");
    if (!home)
      home = "/";
  }
  return concat_path(home, rel_path);
}


x86 assembly (clang, -O0):
<home_path>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,0x2f04(%rip)
jne    116e <home_path+0x4e>
lea    0xebf(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,0x2eeb(%rip)
cmpq   $0x0,0x2ee3(%rip)
jne    1169 <home_path+0x49>
lea    0xea3(%rip),%rax
mov    %rax,0x2ecf(%rip)
jmp    116e <home_path+0x4e>
mov    0x2ec3(%rip),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <concat_path@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<home_path>:
push   %rbx
mov    %rdi,%rbx
mov    0x2f0d(%rip),%rdi
test   %rdi,%rdi
jne    1151 <home_path+0x31>
lea    0xec9(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
lea    0xebf(%rip),%rdi
cmovne %rax,%rdi
mov    %rdi,0x2ee7(%rip)
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <concat_path@plt>

LLVM IR (-O0):
@home_path.home = internal global i8* null
@.str = [5 x i8] c"HOME\00"
@.str.1 = [2 x i8] c"/\00"
define i8* @home_path(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** @home_path.home
%4 = icmp ne i8* %3, null
br i1 %4, label %11, label %5
5: ; preds = %1
%6 = call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i8* %6, i8** @home_path.home
%7 = load i8*, i8** @home_path.home
%8 = icmp ne i8* %7, null
br i1 %8, label %10, label %9
9: ; preds = %5
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8** @home_path.home
br label %10
10: ; preds = %9, %5
br label %11
11: ; preds = %10, %1
%12 = load i8*, i8** @home_path.home
%13 = load i8*, i8** %2
%14 = call i8* @concat_path(i8* %12, i8* %13)
ret i8* %14
}

LLVM IR (-O2):
@home_path.home = internal unnamed_addr global i8* null
@.str = [5 x i8] c"HOME\00"
@.str.1 = [2 x i8] c"/\00"
define i8* @home_path(i8* %0) {
%2 = load i8*, i8** @home_path.home
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i8* %5, null
%7 = select i1 %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* %5
store i8* %7, i8** @home_path.home
br label %8
8: ; preds = %4, %1
%9 = phi i8* [ %7, %4 ], [ %2, %1 ]
%10 = tail call i8* @concat_path(i8* %9, i8* %0)
ret i8* %10
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
char *setlocale(int category, const char *locale) {
  errno = ENOSYS;
  return NULL;
}


x86 assembly (clang, -O0):
<setlocale>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ed6(%rip),%rax
mov    (%rax),%ecx
mov    0x2ebd(%rip),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<setlocale>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
xor    %eax,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i8* @setlocale(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* @ENOSYS
store i32 %5, i32* @errno
ret i8* null
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define noalias i8* @setlocale(i32 %0, i8* nocapture readnone %1) {
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, long, char *, long);
void native_int_to_s(long recv, char *str, long buflen) {
  snprintf(str, buflen, "%ld", recv);
}


x86 assembly (clang, -O0):
<native_int_to_s>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x8(%rbp),%rcx
lea    0xec9(%rip),%rdx
call   1030 <snprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<native_int_to_s>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rax
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    %rax,%rdx
jmp    1030 <snprintf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%ld\00"
define void @native_int_to_s(i64 %0, i8* %1, i64 %2) {
%4 = tail call i32 @snprintf(i8* %1, i64 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ comm_put(char);
void xputc(char c) {
  if (c == '\n')
    comm_put('\r');
  comm_put(c);
}


x86 assembly (clang, -O0):
<xputc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0xa,%eax
jne    1135 <xputc+0x25>
mov    $0xd,%edi
call   1030 <comm_put@plt>
movsbl -0x1(%rbp),%edi
call   1030 <comm_put@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xputc>:
push   %rbx
mov    %edi,%ebx
cmp    $0xa,%bl
jne    1122 <xputc+0x12>
mov    $0xd,%edi
call   1030 <comm_put@plt>
movsbl %bl,%edi
pop    %rbx
jmp    1030 <comm_put@plt>

LLVM IR (-O0):
define void @xputc(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 10
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @comm_put(i8 signext 13)
br label %8
8: ; preds = %6, %1
%9 = load i8, i8* %2
%10 = call i32 @comm_put(i8 signext %9)
ret void
}

LLVM IR (-O2):
define void @xputc(i8 signext %0) {
%2 = icmp eq i8 %0, 10
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @comm_put(i8 signext 13)
br label %5
5: ; preds = %3, %1
%6 = tail call i32 @comm_put(i8 signext %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ receiver_send_morse(char *);
void source_off() { receiver_send_morse("CL"); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"CL\00"
define void @source_off() {
%1 = tail call i32 @receiver_send_morse(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}
int main() {
  unsigned long t1 = -1;
  return t1 & t1 == t1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movq   $0xffffffffffffffff,-0x10(%rbp)
ff
mov    -0x10(%rbp),%rax
mov    -0x10(%rbp),%rcx
cmp    -0x10(%rbp),%rcx
sete   %cl
and    $0x1,%cl
movzbl %cl,%ecx
movslq %ecx,%rcx
and    %rcx,%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
store i64 -1, i64* %2
%3 = load i64, i64* %2
%4 = load i64, i64* %2
%5 = load i64, i64* %2
%6 = icmp eq i64 %4, %5
%7 = zext i1 %6 to i32
%8 = sext i32 %7 to i64
%9 = and i64 %3, %8
%10 = trunc i64 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
void __malloc_lock() {}


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

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

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

LLVM IR (-O2):
define void @__malloc_lock() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, int, char *);
int /*<<< orphan*/ stderr;
int printError(int page, int line, char *message) {
  fprintf(stderr, "Error (p%d, line %d): %s\n", page, line, message);
  return (1);
}


x86 assembly (clang, -O0):
<printError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    0x2eb7(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
mov    -0x10(%rbp),%r8
lea    0xec4(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printError>:
push   %rax
mov    %rdx,%r8
mov    %esi,%ecx
mov    %edi,%edx
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
lea    0xed8(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [26 x i8] c"Error (p%d, line %d): %s\0A\00"
define i32 @printError(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* @stderr
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = load i8*, i8** %6
%11 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %9, i8* %10)
ret i32 1
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [26 x i8] c"Error (p%d, line %d): %s\0A\00"
define i32 @printError(i32 %0, i32 %1, i8* %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i8* %2)
ret i32 1
}
/* Variables and functions */
int binarySearch(int *, int /*<<< orphan*/, int);
int findMin(int *nums, int numsSize) {
  if (numsSize <= 0)
    return 0;
  int res = binarySearch(nums, 0, numsSize - 1);
  return nums[res];
}


x86 assembly (clang, -O0):
<findMin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jg     1135 <findMin+0x25>
movl   $0x0,-0x4(%rbp)
jmp    1157 <findMin+0x47>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
xor    %esi,%esi
call   1030 <binarySearch@plt>
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<findMin>:
test   %esi,%esi
jle    112b <findMin+0x1b>
push   %rbx
mov    %esi,%edx
mov    %rdi,%rbx
add    $0xffffffff,%edx
xor    %esi,%esi
call   1030 <binarySearch@plt>
cltq
mov    (%rbx,%rax,4),%eax
pop    %rbx
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @findMin(i32* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
%7 = load i32, i32* %5
%8 = icmp sle i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 0, i32* %3
br label %20
10: ; preds = %2
%11 = load i32*, i32** %4
%12 = load i32, i32* %5
%13 = sub nsw i32 %12, 1
%14 = call i32 @binarySearch(i32* %11, i32 0, i32 %13)
store i32 %14, i32* %6
%15 = load i32*, i32** %4
%16 = load i32, i32* %6
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i32, i32* %15, i64 %17
%19 = load i32, i32* %18
store i32 %19, i32* %3
br label %20
20: ; preds = %10, %9
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @findMin(i32* %0, i32 %1) {
%3 = icmp slt i32 %1, 1
br i1 %3, label %10, label %4
4: ; preds = %2
%5 = add nsw i32 %1, -1
%6 = tail call i32 @binarySearch(i32* %0, i32 0, i32 %5)
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
br label %10
10: ; preds = %2, %4
%11 = phi i32 [ %9, %4 ], [ 0, %2 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) { fprintf(stderr, "Usage: histogram file elf ...\n"); }


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [31 x i8] c"Usage: histogram file elf ...\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [31 x i8] c"Usage: histogram file elf ...\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ test63_HelloWorld_targ_test__I();
void test63_HelloWorld_pollen__run__E() {
  test63_HelloWorld_targ_test__I();
  exit(0);
}


x86 assembly (clang, -O0):
<test63_HelloWorld_pollen__run__E>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <test63_HelloWorld_targ_test__I@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<test63_HelloWorld_pollen__run__E>:
push   %rax
xor    %eax,%eax
call   1030 <test63_HelloWorld_targ_test__I@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @test63_HelloWorld_pollen__run__E() {
%1 = call i32 (...) @test63_HelloWorld_targ_test__I()
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @test63_HelloWorld_pollen__run__E() {
%1 = tail call i32 (...) @test63_HelloWorld_targ_test__I()
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int IN(int);
volatile unsigned char spiMasterReady(void) {
  return IN(0x01) & (1 << 4) ? 0 : 1;
}


x86 assembly (clang, -O0):
<spiMasterReady>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <IN@plt>
mov    %eax,%edx
and    $0x10,%edx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<spiMasterReady>:
push   %rax
mov    $0x1,%edi
call   1030 <IN@plt>
test   $0x10,%al
sete   %al
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i8 @spiMasterReady() {
%1 = call i32 @IN(i32 1)
%2 = and i32 %1, 16
%3 = icmp ne i32 %2, 0
%4 = zext i1 %3 to i64
%5 = select i1 %3, i32 0, i32 1
%6 = trunc i32 %5 to i8
ret i8 %6
}

LLVM IR (-O2):
define zeroext i8 @spiMasterReady() {
%1 = tail call i32 @IN(i32 1)
%2 = trunc i32 %1 to i8
%3 = lshr i8 %2, 4
%4 = and i8 %3, 1
%5 = xor i8 %4, 1
ret i8 %5
}
int sys_bind(tcp)
struct tcb *tcp;
{
  CDE_begin_socket_bind_or_connect(tcp);
}


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

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

LLVM IR (-O0):
%struct.tcb = type opaque
define i32 @sys_bind(%struct.tcb* %0) {
%2 = alloca i32
%3 = alloca %struct.tcb*
store %struct.tcb* %0, %struct.tcb** %3
%4 = load %struct.tcb*, %struct.tcb** %3
%5 = call i32 (%struct.tcb*, ...) bitcast (i32 (...)* @CDE_begin_socket_bind_or_connect to i32 (%struct.tcb*, ...)*)(%struct.tcb* %4)
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
%struct.tcb = type opaque
define i32 @sys_bind(%struct.tcb* %0) {
%2 = tail call i32 (%struct.tcb*, ...) bitcast (i32 (...)* @CDE_begin_socket_bind_or_connect to i32 (%struct.tcb*, ...)*)(%struct.tcb* %0)
ret i32 undef
}
SORU_5_PROTOTYPE() {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<SORU_5_PROTOTYPE>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <SORU_5_PROTOTYPE+0x9>
jmp    1109 <SORU_5_PROTOTYPE+0x9>

x86 assembly (clang, -O2):
<SORU_5_PROTOTYPE>:
jmp    1100 <SORU_5_PROTOTYPE>

LLVM IR (-O0):
define i32 @SORU_5_PROTOTYPE() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define i32 @SORU_5_PROTOTYPE() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
yyfree(void *ptr) { free((char *)ptr); }


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

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

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

LLVM IR (-O2):
define i32 @yyfree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret i32 undef
}
int rtapi_exit(int module_id) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @rtapi_exit(i32 %0) {
ret i32 0
}
int test_imm_A8uint8_reg(unsigned char val) {
  return ((val) & (0xA8 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_A8uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xa8,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_A8uint8_reg>:
test   $0xa8,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_A8uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -88
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
struct list_node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ list_del_(struct list_node *, char const *);
int /*<<< orphan*/ list_node_init(struct list_node *);
void list_del_init_(struct list_node *n, const char *abortstr) {
  list_del_(n, abortstr);
  list_node_init(n);
}


x86 assembly (clang, -O0):
<list_del_init_>:
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 <list_del_@plt>
mov    -0x8(%rbp),%rdi
call   1040 <list_node_init@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<list_del_init_>:
push   %rbx
mov    %rdi,%rbx
call   1030 <list_del_@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <list_node_init@plt>

LLVM IR (-O0):
%struct.list_node = type { i32 }
define void @list_del_init_(%struct.list_node* %0, i8* %1) {
%3 = alloca %struct.list_node*
%4 = alloca i8*
store %struct.list_node* %0, %struct.list_node** %3
store i8* %1, i8** %4
%5 = load %struct.list_node*, %struct.list_node** %3
%6 = load i8*, i8** %4
%7 = call i32 @list_del_(%struct.list_node* %5, i8* %6)
%8 = load %struct.list_node*, %struct.list_node** %3
%9 = call i32 @list_node_init(%struct.list_node* %8)
ret void
}

LLVM IR (-O2):
%struct.list_node = type { i32 }
define void @list_del_init_(%struct.list_node* %0, i8* %1) {
%3 = tail call i32 @list_del_(%struct.list_node* %0, i8* %1)
%4 = tail call i32 @list_node_init(%struct.list_node* %0)
ret void
}
void UART_RS485_SaveConfig(void) {}


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

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

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

LLVM IR (-O2):
define void @UART_RS485_SaveConfig() {
ret void
}
int kfd_iommu_bind_process_to_device(struct kfd_process_device *pdd) {
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.kfd_process_device = type opaque
define i32 @kfd_iommu_bind_process_to_device(%struct.kfd_process_device* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
struct timeval {
  double tv_sec;
  double tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double timestamp() {
  struct timeval tval;
  gettimeofday(&tval, NULL);
  return tval.tv_sec + (tval.tv_usec * 1.0e-6);
}


x86 assembly (clang, -O0):
<timestamp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
movsd  -0x10(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm0
movsd  0xec9(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timestamp>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movsd  0x10(%rsp),%xmm0
mulsd  0xed2(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { double, double }
define double @timestamp() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load double, double* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%6 = load double, double* %5
%7 = call double @llvm.fmuladd.f64(double %6, double 0x3EB0C6F7A0B5ED8D, double %4)
ret double %7
}

LLVM IR (-O2):
%struct.timeval = type { double, double }
define double @timestamp() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load double, double* %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%7 = load double, double* %6
%8 = tail call double @llvm.fmuladd.f64(double %7, double 0x3EB0C6F7A0B5ED8D, double %5)
ret double %8
}
int fun306() { return 306; }


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

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

LLVM IR (-O0):
define i32 @fun306() {
ret i32 306
}

LLVM IR (-O2):
define i32 @fun306() {
ret i32 306
}
/* Variables and functions */
void *memcpy(void *, void const *, size_t);
void *cnt_deque_memcpy(void *dest, const void *src, size_t n) {
  return memcpy(dest, src, n);
}


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

x86 assembly (clang, -O2):
<cnt_deque_memcpy>:
jmp    1030 <memcpy@plt>

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

LLVM IR (-O2):
define i8* @cnt_deque_memcpy(i8* returned writeonly %0, i8* nocapture %1, i64 %2) {
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %0, i8* align 1 %1, i64 %2, i1 false)
ret i8* %0
}
ISR(TIMER3_COMPC_vect) {
  DEBUG("ISR "
        "TIMER3_COMPC"
        " occured");
}


x86 assembly (clang, -O0):
<ISR>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
lea    0xede(%rip),%rdi
mov    $0x0,%al
call   1030 <DEBUG@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ISR>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <DEBUG@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"ISR TIMER3_COMPC occured\00"
define i32 @ISR(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @DEBUG to i32 (i8*, ...)*)(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* %2
ret i32 %5
}

LLVM IR (-O2):
@.str = [25 x i8] c"ISR TIMER3_COMPC occured\00"
define i32 @ISR(i32 %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @DEBUG to i32 (i8*, ...)*)(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ panic(char *);
void abort() { panic("abort called"); }


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

x86 assembly (clang, -O2):
<abort>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <panic@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"abort called\00"
define void @abort() {
%1 = call i32 @panic(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
unreachable
}

LLVM IR (-O2):
@.str = [13 x i8] c"abort called\00"
define void @abort() {
%1 = tail call i32 @panic(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
unreachable
}
void odp_cpu_pause(void) {}


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

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

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

LLVM IR (-O2):
define void @odp_cpu_pause() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void clear() {
  printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
}


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

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

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

LLVM IR (-O2):
@str = [27 x i8] c"\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\00"
define void @clear() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int d03(int);
int d04(int a) { return d03(d03(a)); }


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

x86 assembly (clang, -O2):
<d04>:
push   %rax
call   1030 <d03@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <d03@plt>

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

LLVM IR (-O2):
define i32 @d04(i32 %0) {
%2 = tail call i32 @d03(i32 %0)
%3 = tail call i32 @d03(i32 %2)
ret i32 %3
}
void diag_debugfs_init(void) {}


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

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

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

LLVM IR (-O2):
define void @diag_debugfs_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void output(int x) { printf("%d\n", x); }


x86 assembly (clang, -O0):
<output>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<output>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @output(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
int iskuuhaku(char a) {
  if (a == ' ' || a == '\t') {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<iskuuhaku>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x20,%eax
je     1124 <iskuuhaku+0x24>
movsbl -0x5(%rbp),%eax
cmp    $0x9,%eax
jne    1130 <iskuuhaku+0x30>
movl   $0x1,-0x4(%rbp)
jmp    1137 <iskuuhaku+0x37>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iskuuhaku>:
cmp    $0x20,%dil
sete   %al
cmp    $0x9,%dil
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @iskuuhaku(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 32
br i1 %6, label %11, label %7
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 9
br i1 %10, label %11, label %12
11: ; preds = %7, %1
store i32 1, i32* %2
br label %13
12: ; preds = %7
store i32 0, i32* %2
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @iskuuhaku(i8 signext %0) {
%2 = icmp eq i8 %0, 32
%3 = icmp eq i8 %0, 9
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
char *mostra_palavras(void *p1) {
  char *s1 = p1;
  return s1;
}


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

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

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

LLVM IR (-O2):
define i8* @mostra_palavras(i8* readnone returned %0) {
ret i8* %0
}
void quicksort(p, q) {
  int j;
  if (p < q) {
    j = partition(p, q + 1);
    quicksort(p, j - 1);
    quicksort(j + 1, q);
  }
}


x86 assembly (clang, -O0):
<quicksort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1169 <quicksort+0x49>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
add    $0x1,%esi
mov    $0x0,%al
call   1030 <partition@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
call   1040 <quicksort@plt>
mov    -0xc(%rbp),%edi
add    $0x1,%edi
mov    -0x8(%rbp),%esi
call   1040 <quicksort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quicksort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %esi,%edi
jge    1162 <quicksort+0x42>
mov    %esi,%r14d
mov    %edi,%ebx
lea    0x1(%r14),%r15d
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %ebx,%edi
mov    %r15d,%esi
xor    %eax,%eax
call   1030 <partition@plt>
mov    %eax,%ebp
lea    -0x1(%rbp),%esi
mov    %ebx,%edi
call   1040 <quicksort@plt>
add    $0x1,%ebp
mov    %ebp,%ebx
cmp    %r14d,%ebp
jl     1140 <quicksort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @quicksort(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = add nsw i32 %1, 1
br label %6
6: ; preds = %4, %6
%7 = phi i32 [ %0, %4 ], [ %10, %6 ]
%8 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @partition to i32 (i32, i32, ...)*)(i32 %7, i32 %5)
%9 = add nsw i32 %8, -1
tail call void @quicksort(i32 %7, i32 %9)
%10 = add nsw i32 %8, 1
%11 = icmp slt i32 %10, %1
br i1 %11, label %6, label %12
12: ; preds = %6, %2
ret void
}
/* Variables and functions */
int errno;
int /*<<< orphan*/ num_buf(int);
int /*<<< orphan*/ write_response(char *, int /*<<< orphan*/);
void errno_response() {
  int e = errno;
  write_response("errno", num_buf(e));
}


x86 assembly (clang, -O0):
<errno_response>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <num_buf@plt>
mov    %eax,%esi
lea    0xebb(%rip),%rdi
call   1030 <write_response@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<errno_response>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
call   1040 <num_buf@plt>
lea    0xeca(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <write_response@plt>

LLVM IR (-O0):
@errno = global i32 0
@.str = [6 x i8] c"errno\00"
define void @errno_response() {
%1 = alloca i32
%2 = load i32, i32* @errno
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = call i32 @num_buf(i32 %3)
%5 = call i32 @write_response(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@errno = global i32 0
@.str = [6 x i8] c"errno\00"
define void @errno_response() {
%1 = load i32, i32* @errno
%2 = tail call i32 @num_buf(i32 %1)
%3 = tail call i32 @write_response(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
char toupper(unsigned char);
char *uppercase(char *str) {
  char *r = str;
  assert(str != NULL);
  while (toupper((unsigned char)*str) != '\0')
    str++;
  return r;
}


x86 assembly (clang, -O0):
<uppercase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rax
movzbl (%rax),%edi
call   1030 <toupper@plt>
movsbl %al,%eax
cmp    $0x0,%eax
je     116f <uppercase+0x4f>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1146 <uppercase+0x26>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uppercase>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %edi,%edi
test   %r14,%r14
setne  %dil
call   1040 <assert@plt>
mov    %r14,%rbx
nopl   0x0(%rax,%rax,1)
movzbl (%rbx),%edi
call   1030 <toupper@plt>
add    $0x1,%rbx
test   %al,%al
jne    1140 <uppercase+0x20>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @uppercase(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
%5 = load i8*, i8** %2
%6 = icmp ne i8* %5, null
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
br label %9
9: ; preds = %15, %1
%10 = load i8*, i8** %2
%11 = load i8, i8* %10
%12 = call signext i8 @toupper(i8 zeroext %11)
%13 = sext i8 %12 to i32
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %9
%16 = load i8*, i8** %2
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %2
br label %9
18: ; preds = %9
%19 = load i8*, i8** %3
ret i8* %19
}

LLVM IR (-O2):
define i8* @uppercase(i8* returned %0) {
%2 = icmp ne i8* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
br label %5
5: ; preds = %5, %1
%6 = phi i8* [ %0, %1 ], [ %10, %5 ]
%7 = load i8, i8* %6
%8 = tail call signext i8 @toupper(i8 zeroext %7)
%9 = icmp eq i8 %8, 0
%10 = getelementptr inbounds i8, i8* %6, i64 1
br i1 %9, label %11, label %5
11: ; preds = %5
ret i8* %0
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
char _count_decimal_places(int64_t value) {
  char count = 1;
  while (value > 9) {
    value /= 10;
    count++;
  }
  return count;
}


x86 assembly (clang, -O0):
<_count_decimal_places>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movb   $0x1,-0x5(%rbp)
cmpl   $0x9,-0x4(%rbp)
jle    1130 <_count_decimal_places+0x30>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x5(%rbp),%al
add    $0x1,%al
mov    %al,-0x5(%rbp)
jmp    110b <_count_decimal_places+0xb>
movsbl -0x5(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_count_decimal_places>:
mov    $0x1,%al
cmp    $0xa,%edi
jl     1123 <_count_decimal_places+0x23>
mov    $0x1,%al
mov    $0xcccccccd,%ecx
xchg   %ax,%ax
mov    %edi,%edx
imul   %rcx,%rdx
shr    $0x23,%rdx
add    $0x1,%al
cmp    $0x63,%edi
mov    %edx,%edi
ja     1110 <_count_decimal_places+0x10>
ret

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

LLVM IR (-O2):
define signext i8 @_count_decimal_places(i32 %0) {
%2 = icmp sgt i32 %0, 9
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i8 [ %7, %3 ], [ 1, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = udiv i32 %5, 10
%7 = add i8 %4, 1
%8 = icmp ugt i32 %5, 99
br i1 %8, label %3, label %9
9: ; preds = %3, %1
%10 = phi i8 [ 1, %1 ], [ %7, %3 ]
ret i8 %10
}
void vfoo64(unsigned long long *a) {
  int i = 0;
  for (i = 0; i < 128; ++i)
    a[i] = __builtin_bswap64(a[i]);
}


x86 assembly (clang, -O0):
<vfoo64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x80,-0xc(%rbp)
jge    114c <vfoo64+0x4c>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
bswap  %rdx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <vfoo64+0x16>
pop    %rbp
ret

x86 assembly (clang, -O2):
<vfoo64>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%rdi,%rax,8),%rcx
bswap  %rcx
mov    0x8(%rdi,%rax,8),%rdx
mov    %rcx,(%rdi,%rax,8)
bswap  %rdx
mov    %rdx,0x8(%rdi,%rax,8)
mov    0x10(%rdi,%rax,8),%rcx
bswap  %rcx
mov    %rcx,0x10(%rdi,%rax,8)
mov    0x18(%rdi,%rax,8),%rcx
bswap  %rcx
mov    %rcx,0x18(%rdi,%rax,8)
add    $0x4,%rax
cmp    $0x80,%rax
jne    1110 <vfoo64+0x10>
ret

LLVM IR (-O0):
define void @vfoo64(i64* %0) {
%2 = alloca i64*
%3 = alloca i32
store i64* %0, i64** %2
store i32 0, i32* %3
store i32 0, i32* %3
br label %4
4: ; preds = %18, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 128
br i1 %6, label %7, label %21
7: ; preds = %4
%8 = load i64*, i64** %2
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i64, i64* %8, i64 %10
%12 = load i64, i64* %11
%13 = call i64 @llvm.bswap.i64(i64 %12)
%14 = load i64*, i64** %2
%15 = load i32, i32* %3
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i64, i64* %14, i64 %16
store i64 %13, i64* %17
br label %18
18: ; preds = %7
%19 = load i32, i32* %3
%20 = add nsw i32 %19, 1
store i32 %20, i32* %3
br label %4
21: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @vfoo64(i64* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %19, %2 ]
%4 = getelementptr inbounds i64, i64* %0, i64 %3
%5 = load i64, i64* %4
%6 = tail call i64 @llvm.bswap.i64(i64 %5)
store i64 %6, i64* %4
%7 = or i64 %3, 1
%8 = getelementptr inbounds i64, i64* %0, i64 %7
%9 = load i64, i64* %8
%10 = tail call i64 @llvm.bswap.i64(i64 %9)
store i64 %10, i64* %8
%11 = or i64 %3, 2
%12 = getelementptr inbounds i64, i64* %0, i64 %11
%13 = load i64, i64* %12
%14 = tail call i64 @llvm.bswap.i64(i64 %13)
store i64 %14, i64* %12
%15 = or i64 %3, 3
%16 = getelementptr inbounds i64, i64* %0, i64 %15
%17 = load i64, i64* %16
%18 = tail call i64 @llvm.bswap.i64(i64 %17)
store i64 %18, i64* %16
%19 = add nuw nsw i64 %3, 4
%20 = icmp eq i64 %19, 128
br i1 %20, label %21, label %2
21: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cgincstat(char *, int, int);
void cgincps(int a, int v) { cgincstat("add", a, v); }


x86 assembly (clang, -O0):
<cgincps>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xed5(%rip),%rdi
call   1030 <cgincstat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgincps>:
mov    %esi,%edx
mov    %edi,%esi
lea    0xee5(%rip),%rdi
jmp    1030 <cgincstat@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"add\00"
define void @cgincps(i32 %0, i32 %1) {
%3 = tail call i32 @cgincstat(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ IsPrime(int);
int FindNextPrime(int startNumb) {
  int numb = startNumb;
  while (!IsPrime(numb)) {
    numb++;
  }
  return numb;
}


x86 assembly (clang, -O0):
<FindNextPrime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <IsPrime@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    113e <FindNextPrime+0x2e>
jmp    114c <FindNextPrime+0x3c>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1121 <FindNextPrime+0x11>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FindNextPrime>:
push   %rbx
mov    %edi,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebx,%edi
call   1030 <IsPrime@plt>
add    $0x1,%ebx
test   %eax,%eax
je     1120 <FindNextPrime+0x10>
add    $0xffffffff,%ebx
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @FindNextPrime(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ %0, %1 ], [ %6, %2 ]
%4 = tail call i32 @IsPrime(i32 %3)
%5 = icmp eq i32 %4, 0
%6 = add nsw i32 %3, 1
br i1 %5, label %2, label %7
7: ; preds = %2
ret i32 %3
}
void cyttsp_swp_xy(short *x, short *y) { return; }


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

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

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

LLVM IR (-O2):
define void @cyttsp_swp_xy(i16* nocapture %0, i16* nocapture %1) {
ret void
}