xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ hash(char *);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char text[202];
  scanf("%[^\n]s", text);
  printf("%ld", hash(text));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xd0(%rbp),%rsi
lea    0xeb0(%rip),%rdi
call   1050 <scanf@plt>
lea    -0xd0(%rbp),%rdi
call   1030 <hash@plt>
mov    %eax,%esi
lea    0xe9d(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0xd0,%rsp
lea    0xec1(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1030 <hash@plt>
lea    0xeae(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0xd0,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"%[^\0A]s\00"
@.str.1 = [4 x i8] c"%ld\00"
define i32 @main() {
%1 = alloca [202 x i8]
%2 = getelementptr inbounds [202 x i8], [202 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @hash(i8* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret i32 0
}
int lineCount() { return 1; }


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

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

LLVM IR (-O0):
define i32 @lineCount() {
ret i32 1
}

LLVM IR (-O2):
define i32 @lineCount() {
ret i32 1
}
void initializePlateform() {}


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

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

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

LLVM IR (-O2):
define void @initializePlateform() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
uint8_t *aeron_cache_line_align_buffer(uint8_t *buffer) {
  size_t remainder = ((size_t)buffer) % (64u);
  return 0 == remainder ? buffer : (buffer + ((64u) - remainder));
}


x86 assembly (clang, -O0):
<aeron_cache_line_align_buffer>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0x3f,%rax
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
cmp    -0x10(%rbp),%rax
jne    112d <aeron_cache_line_align_buffer+0x2d>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1145 <aeron_cache_line_align_buffer+0x45>
mov    -0x8(%rbp),%rax
mov    $0x40,%ecx
sub    -0x10(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<aeron_cache_line_align_buffer>:
mov    %edi,%eax
and    $0x3f,%eax
mov    $0x40,%ecx
sub    %rax,%rcx
test   %rax,%rax
cmove  %rax,%rcx
lea    (%rdi,%rcx,4),%rax
ret

LLVM IR (-O0):
define i32* @aeron_cache_line_align_buffer(i32* %0) {
%2 = alloca i32*
%3 = alloca i64
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = ptrtoint i32* %4 to i64
%6 = urem i64 %5, 64
store i64 %6, i64* %3
%7 = load i64, i64* %3
%8 = icmp eq i64 0, %7
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = load i32*, i32** %2
br label %16
11: ; preds = %1
%12 = load i32*, i32** %2
%13 = load i64, i64* %3
%14 = sub i64 64, %13
%15 = getelementptr inbounds i32, i32* %12, i64 %14
br label %16
16: ; preds = %11, %9
%17 = phi i32* [ %10, %9 ], [ %15, %11 ]
ret i32* %17
}

LLVM IR (-O2):
define i32* @aeron_cache_line_align_buffer(i32* %0) {
%2 = ptrtoint i32* %0 to i64
%3 = and i64 %2, 63
%4 = icmp eq i64 %3, 0
%5 = sub nuw nsw i64 64, %3
%6 = select i1 %4, i64 0, i64 %5
%7 = getelementptr i32, i32* %0, i64 %6
ret i32* %7
}
/* Variables and functions */
long lrint(long double);
long lrintl(long double a1) { return lrint(a1); }


x86 assembly (clang, -O0):
<lrintl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <lrint@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lrintl>:
jmp    1030 <lrint@plt>

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

LLVM IR (-O2):
define i64 @lrintl(x86_fp80 %0) {
%2 = tail call i64 @lrint(x86_fp80 %0)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ Webcam_End();
void GB_CameraEnd(void) { Webcam_End(); }


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

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

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

LLVM IR (-O2):
define void @GB_CameraEnd() {
%1 = tail call i32 (...) @Webcam_End()
ret void
}
unsigned long long __atomic_load_8(const volatile void *atom, int memorder) {
  return *(volatile unsigned long long *)atom;
}


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

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

LLVM IR (-O0):
define i64 @__atomic_load_8(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 = bitcast i8* %5 to i64*
%7 = load volatile i64, i64* %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @__atomic_load_8(i8* %0, i32 %1) {
%3 = bitcast i8* %0 to i64*
%4 = load volatile i64, i64* %3
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ getline(char **, size_t *, int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
char *read_command(void) {
  char *line = NULL;
  size_t bufsize = 0;
  getline(&line, &bufsize, stdin);
  return line;
}


x86 assembly (clang, -O0):
<read_command>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    0x2eb9(%rip),%rax
mov    (%rax),%edx
lea    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <getline@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_command>:
sub    $0x18,%rsp
movq   $0x0,0x8(%rsp)
movq   $0x0,0x10(%rsp)
mov    0x2ebb(%rip),%rax
mov    (%rax),%edx
lea    0x8(%rsp),%rdi
lea    0x10(%rsp),%rsi
call   1030 <getline@plt>
mov    0x8(%rsp),%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@stdin = global i32 0
define i8* @read_command() {
%1 = alloca i8*
%2 = alloca i64
store i8* null, i8** %1
store i64 0, i64* %2
%3 = load i32, i32* @stdin
%4 = call i32 @getline(i8** %1, i64* %2, i32 %3)
%5 = load i8*, i8** %1
ret i8* %5
}

LLVM IR (-O2):
@stdin = global i32 0
define i8* @read_command() {
%1 = alloca i8*
%2 = alloca i64
%3 = bitcast i8** %1 to i8*
store i8* null, i8** %1
%4 = bitcast i64* %2 to i8*
store i64 0, i64* %2
%5 = load i32, i32* @stdin
%6 = call i32 @getline(i8** %1, i64* %2, i32 %5)
%7 = load i8*, i8** %1
ret i8* %7
}
/* Variables and functions */
int rand();
int generate_solution_position(int max_posible, int SLA) {
  if (SLA == 0) {
    return rand() % (max_posible + 1);
  }
  if (SLA == 1) {
    return rand() % max_posible + 1;
  }
}


x86 assembly (clang, -O0):
<generate_solution_position>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1140 <generate_solution_position+0x30>
mov    $0x0,%al
call   1030 <rand@plt>
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
cltd
idiv   %ecx
mov    %edx,-0x4(%rbp)
jmp    115b <generate_solution_position+0x4b>
cmpl   $0x1,-0xc(%rbp)
jne    115b <generate_solution_position+0x4b>
mov    $0x0,%al
call   1030 <rand@plt>
cltd
idivl  -0x8(%rbp)
add    $0x1,%edx
mov    %edx,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generate_solution_position>:
push   %rbx
mov    %edi,%ebx
cmp    $0x1,%esi
je     112d <generate_solution_position+0x1d>
test   %esi,%esi
jne    113c <generate_solution_position+0x2c>
xor    %eax,%eax
call   1030 <rand@plt>
add    $0x1,%ebx
cltd
idiv   %ebx
mov    %edx,%eax
pop    %rbx
ret
xor    %eax,%eax
call   1030 <rand@plt>
cltd
idiv   %ebx
mov    %edx,%eax
add    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @generate_solution_position(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = call i32 (...) @rand()
%10 = load i32, i32* %4
%11 = add nsw i32 %10, 1
%12 = srem i32 %9, %11
store i32 %12, i32* %3
br label %21
13: ; preds = %2
%14 = load i32, i32* %5
%15 = icmp eq i32 %14, 1
br i1 %15, label %16, label %21
16: ; preds = %13
%17 = call i32 (...) @rand()
%18 = load i32, i32* %4
%19 = srem i32 %17, %18
%20 = add nsw i32 %19, 1
store i32 %20, i32* %3
br label %21
21: ; preds = %8, %16, %13
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
define i32 @generate_solution_position(i32 %0, i32 %1) {
switch i32 %1, label %11 [
i32 0, label %3
i32 1, label %7
]
3: ; preds = %2
%4 = tail call i32 (...) @rand()
%5 = add nsw i32 %0, 1
%6 = srem i32 %4, %5
br label %11
7: ; preds = %2
%8 = tail call i32 (...) @rand()
%9 = srem i32 %8, %0
%10 = add nsw i32 %9, 1
br label %11
11: ; preds = %2, %3, %7
%12 = phi i32 [ %6, %3 ], [ %10, %7 ], [ undef, %2 ]
ret i32 %12
}
/* Variables and functions */
int foo(int);
int entrypoint() { return foo(16); }


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

x86 assembly (clang, -O2):
<entrypoint>:
mov    $0x10,%edi
jmp    1030 <foo@plt>

LLVM IR (-O0):
define i32 @entrypoint() {
%1 = call i32 @foo(i32 16)
ret i32 %1
}

LLVM IR (-O2):
define i32 @entrypoint() {
%1 = tail call i32 @foo(i32 16)
ret i32 %1
}
int leftChildIndex(int index) { return 2 * index + 1; }


x86 assembly (clang, -O0):
<leftChildIndex>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<leftChildIndex>:
lea    (%rdi,%rdi,1),%eax
add    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @leftChildIndex(i32 %0) {
%2 = shl nsw i32 %0, 1
%3 = or i32 %2, 1
ret i32 %3
}
char *new_string(string)
char *string;
{
  char *buf;
  if ((buf = (char *)calloc((unsigned)(strlen(string) + 1), sizeof(char))) == 0)
    return 0;
  strcpy(buf, string);
  return buf;
}


x86 assembly (clang, -O0):
<new_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x1,%rax
mov    %eax,%eax
mov    %eax,%edi
mov    $0x1,%esi
call   1050 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1172 <new_string+0x42>
movq   $0x0,-0x8(%rbp)
jmp    1187 <new_string+0x57>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<new_string>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%edi
mov    $0x1,%esi
call   1050 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     115c <new_string+0x2c>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @new_string(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @strlen(i8* %5)
%7 = add i64 %6, 1
%8 = trunc i64 %7 to i32
%9 = zext i32 %8 to i64
%10 = call i8* @calloc(i64 %9, i64 1)
store i8* %10, i8** %4
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %13
12: ; preds = %1
store i8* null, i8** %2
br label %18
13: ; preds = %1
%14 = load i8*, i8** %4
%15 = load i8*, i8** %3
%16 = call i8* @strcpy(i8* %14, i8* %15)
%17 = load i8*, i8** %4
store i8* %17, i8** %2
br label %18
18: ; preds = %13, %12
%19 = load i8*, i8** %2
ret i8* %19
}

LLVM IR (-O2):
define i8* @new_string(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add i64 %2, 1
%4 = and i64 %3, 4294967295
%5 = tail call i8* @calloc(i64 %4, i64 1)
%6 = icmp eq i8* %5, null
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i8* @strcpy(i8* %5, i8* dereferenceable(1) %0)
br label %9
9: ; preds = %1, %7
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
void printdouble(double num) { printf("%g", num); }


x86 assembly (clang, -O0):
<printdouble>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%g\00"
define void @printdouble(double %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), double %0)
ret void
}
void start_vet(char vet[], int size) {
  int i;
  for (i = 0; i < size - 1; ++i)
    vet[i] = ' ';
  vet[i] = '\0';
}


x86 assembly (clang, -O0):
<start_vet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    113d <start_vet+0x3d>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movb   $0x20,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <start_vet+0x12>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<start_vet>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
cmp    $0x2,%esi
jl     1133 <start_vet+0x23>
mov    %esi,%ebx
add    $0xffffffff,%ebx
mov    %r14,%rdi
mov    $0x20,%esi
mov    %rbx,%rdx
call   1030 <memset@plt>
jmp    1135 <start_vet+0x25>
xor    %ebx,%ebx
movb   $0x0,(%r14,%rbx,1)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @start_vet(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 1
br i1 %3, label %4, label %9
4: ; preds = %2
%5 = add nsw i32 %1, -1
%6 = zext i32 %5 to i64
%7 = add nsw i32 %1, -1
%8 = zext i32 %7 to i64
br label %9
9: ; preds = %4, %2
%10 = phi i64 [ 0, %2 ], [ %8, %4 ]
%11 = getelementptr inbounds i8, i8* %0, i64 %10
store i8 0, i8* %11
ret void
}
/* Variables and functions */
scalar_t__ asuint64(double);
int isok_nofenv_d(double ygot, double ywant) {
  return asuint64(ygot) == asuint64(ywant);
}


x86 assembly (clang, -O0):
<isok_nofenv_d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <asuint64@plt>
mov    %rax,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <asuint64@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isok_nofenv_d>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm1,0x8(%rsp)
call   1030 <asuint64@plt>
mov    %rax,%rbx
movsd  0x8(%rsp),%xmm0
call   1030 <asuint64@plt>
xor    %ecx,%ecx
cmp    %rax,%rbx
sete   %cl
mov    %ecx,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @isok_nofenv_d(double %0, double %1) {
%3 = tail call i64 @asuint64(double %0)
%4 = tail call i64 @asuint64(double %1)
%5 = icmp eq i64 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
void advance_buffer(uint8_t **buf, int val) { *buf += val; }


x86 assembly (clang, -O0):
<advance_buffer>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
movslq %edx,%rdx
shl    $0x2,%rdx
add    %rdx,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<advance_buffer>:
movslq %esi,%rax
shl    $0x2,%rax
add    %rax,(%rdi)
ret

LLVM IR (-O0):
define void @advance_buffer(i32** %0, i32 %1) {
%3 = alloca i32**
%4 = alloca i32
store i32** %0, i32*** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32**, i32*** %3
%7 = load i32*, i32** %6
%8 = sext i32 %5 to i64
%9 = getelementptr inbounds i32, i32* %7, i64 %8
store i32* %9, i32** %6
ret void
}

LLVM IR (-O2):
define void @advance_buffer(i32** nocapture %0, i32 %1) {
%3 = load i32*, i32** %0
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %3, i64 %4
store i32* %5, i32** %0
ret void
}
/* Type definitions */
struct mcs {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct mcs *);
void destroy_mcs(struct mcs *l) { free(l); }


x86 assembly (clang, -O0):
<destroy_mcs>:
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):
<destroy_mcs>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.mcs = type { i32 }
define void @destroy_mcs(%struct.mcs* nocapture %0) {
%2 = tail call i32 @free(%struct.mcs* %0)
ret void
}
void do_fallthrough() {
  for (int i = 0; i < 10; ++i) {
    int j = 0;
    do {
      if (i < 8)
        break;
      j++;
    } while (j < 2);
  }
}


x86 assembly (clang, -O0):
<do_fallthrough>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jge    1151 <do_fallthrough+0x51>
movl   $0x0,-0x8(%rbp)
cmpl   $0x8,-0x4(%rbp)
jge    112b <do_fallthrough+0x2b>
jmp    113e <do_fallthrough+0x3e>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jl     111c <do_fallthrough+0x1c>
jmp    1143 <do_fallthrough+0x43>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <do_fallthrough+0xb>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @do_fallthrough() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ pthread_setname_np(char *);
int /*<<< orphan*/ stderr;
void *Thread(void *a) {
  pthread_setname_np("child thread");
  fprintf(stderr, "Hello from pthread\n");
  return NULL;
}


x86 assembly (clang, -O0):
<Thread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <pthread_setname_np@plt>
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
lea    0xec5(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Thread>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <pthread_setname_np@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
lea    0xed0(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"child thread\00"
@stderr = global i32 0
@.str.1 = [20 x i8] c"Hello from pthread\0A\00"
define i8* @Thread(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @pthread_setname_np(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stderr
%5 = call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
ret i8* null
}

LLVM IR (-O2):
@.str = [13 x i8] c"child thread\00"
@stderr = global i32 0
@.str.1 = [20 x i8] c"Hello from pthread\0A\00"
define noalias i8* @Thread(i8* nocapture readnone %0) {
%2 = tail call i32 @pthread_setname_np(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ O_WRONLY;
int open(char const *, int /*<<< orphan*/);
int FODevice(const char *id) {
  const char *fn = "/dev/dsp";
  if (id)
    fn = id;
  return (open(fn, O_WRONLY));
}


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

x86 assembly (clang, -O2):
<FODevice>:
test   %rdi,%rdi
lea    0xee6(%rip),%rax
cmove  %rax,%rdi
mov    0x2eb3(%rip),%rax
mov    (%rax),%esi
jmp    1030 <open@plt>

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

LLVM IR (-O2):
@.str = [9 x i8] c"/dev/dsp\00"
@O_WRONLY = global i32 0
define i32 @FODevice(i8* %0) {
%2 = icmp eq i8* %0, null
%3 = select i1 %2, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %0
%4 = load i32, i32* @O_WRONLY
%5 = tail call i32 @open(i8* %3, i32 %4)
ret i32 %5
}
/* Variables and functions */
scalar_t__ close(int);
int /*<<< orphan*/ complain(char *, char const *);
int /*<<< orphan*/ exit(int);
void doclose(const char *path, int fd) {
  if (close(fd)) {
    complain("%s: close", path);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<doclose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <close@plt>
cmp    $0x0,%rax
je     116b <doclose+0x3b>
mov    -0x8(%rbp),%rsi
lea    0xea4(%rip),%rdi
call   1050 <complain@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<doclose>:
push   %rbx
mov    %rdi,%rbx
mov    %esi,%edi
call   1030 <close@plt>
test   %rax,%rax
jne    1142 <doclose+0x12>
pop    %rbx
ret
lea    0xeb7(%rip),%rdi
mov    %rbx,%rsi
call   1050 <complain@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"%s: close\00"
define void @doclose(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 = call i64 @close(i32 %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i8*, i8** %3
%10 = call i32 @complain(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %2
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"%s: close\00"
define void @doclose(i8* %0, i32 %1) {
%3 = tail call i64 @close(i32 %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @complain(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0)
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pushNarray(char *, unsigned int);
void pushcomplex4array(void *x, int n) {
  pushNarray((char *)x, (unsigned int)(n * 4));
}


x86 assembly (clang, -O0):
<pushcomplex4array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
shl    $0x2,%esi
call   1030 <pushNarray@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pushcomplex4array>:
shl    $0x2,%esi
jmp    1030 <pushNarray@plt>

LLVM IR (-O0):
define void @pushcomplex4array(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 = mul nsw i32 %6, 4
%8 = call i32 @pushNarray(i8* %5, i32 %7)
ret void
}

LLVM IR (-O2):
define void @pushcomplex4array(i8* %0, i32 %1) {
%3 = shl nsw i32 %1, 2
%4 = tail call i32 @pushNarray(i8* %0, i32 %3)
ret void
}
/* Type definitions */
struct event_base {
  int dummy;
};
struct evconnlistener {
  int dummy;
};

/* Variables and functions */
struct event_base *evconnlistener_get_base(struct evconnlistener *);
int /*<<< orphan*/ event_base_loopexit(struct event_base *,
                                       int /*<<< orphan*/ *);
void on_acc_error(struct evconnlistener *listener, void *arg) {
  struct event_base *base = evconnlistener_get_base(listener);
  event_base_loopexit(base, NULL);
}


x86 assembly (clang, -O0):
<on_acc_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <evconnlistener_get_base@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <event_base_loopexit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<on_acc_error>:
push   %rax
call   1040 <evconnlistener_get_base@plt>
mov    %rax,%rdi
xor    %esi,%esi
pop    %rax
jmp    1030 <event_base_loopexit@plt>

LLVM IR (-O0):
%struct.evconnlistener = type { i32 }
%struct.event_base = type { i32 }
define void @on_acc_error(%struct.evconnlistener* %0, i8* %1) {
%3 = alloca %struct.evconnlistener*
%4 = alloca i8*
%5 = alloca %struct.event_base*
store %struct.evconnlistener* %0, %struct.evconnlistener** %3
store i8* %1, i8** %4
%6 = load %struct.evconnlistener*, %struct.evconnlistener** %3
%7 = call %struct.event_base* @evconnlistener_get_base(%struct.evconnlistener* %6)
store %struct.event_base* %7, %struct.event_base** %5
%8 = load %struct.event_base*, %struct.event_base** %5
%9 = call i32 @event_base_loopexit(%struct.event_base* %8, i32* null)
ret void
}

LLVM IR (-O2):
%struct.evconnlistener = type { i32 }
%struct.event_base = type { i32 }
define void @on_acc_error(%struct.evconnlistener* %0, i8* nocapture readnone %1) {
%3 = tail call %struct.event_base* @evconnlistener_get_base(%struct.evconnlistener* %0)
%4 = tail call i32 @event_base_loopexit(%struct.event_base* %3, i32* null)
ret void
}
void RTNetIPv6PseudoChecksum(void) {}


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

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

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

LLVM IR (-O2):
define void @RTNetIPv6PseudoChecksum() {
ret void
}
void OCSP_SIGNATURE_new(void) {}


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

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

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

LLVM IR (-O2):
define void @OCSP_SIGNATURE_new() {
ret void
}
/* Variables and functions */
int day_of_year(int, int, int);
int /*<<< orphan*/ month_day(int, int, int *, int *);
int /*<<< orphan*/ printf(char *, int, ...);
int main(void) {
  int day, mon, dat;
  day = day_of_year(1981, 10, 2);
  printf("%d\n", day);
  month_day(1981, 81, &mon, &dat);
  printf("%d,%d", mon, dat);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x7bd,%edi
mov    $0xa,%esi
mov    $0x2,%edx
call   1050 <day_of_year@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xea0(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x7bd,%edi
mov    $0x51,%esi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1030 <month_day@plt>
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
lea    0xe79(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x7bd,%edi
mov    $0xa,%esi
mov    $0x2,%edx
call   1050 <day_of_year@plt>
lea    0xeb4(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x4(%rsp),%rdx
mov    %rsp,%rcx
mov    $0x7bd,%edi
mov    $0x51,%esi
call   1030 <month_day@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
lea    0xe8a(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [6 x i8] c"%d,%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 @day_of_year(i32 1981, i32 10, i32 2)
%6 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = call i32 @month_day(i32 1981, i32 81, i32* %1, i32* %2)
%8 = load i32, i32* %1
%9 = load i32, i32* %2
%10 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %8, i32 %9)
ret i32 0
}
/* Variables and functions */
scalar_t__ RAND_MAX;
double rand();
unsigned int rand_between(unsigned int lo, unsigned int hi) {
  return lo + (int)(rand() / ((double)RAND_MAX / (hi - lo + 1) + 1));
}


x86 assembly (clang, -O0):
<rand_between>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
call   1030 <rand@plt>
mov    -0xc(%rbp),%eax
mov    0x2eb3(%rip),%rcx
cvtsi2sdq (%rcx),%xmm1
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%edx
sub    %edx,%ecx
add    $0x1,%ecx
cvtsi2sd %rcx,%xmm2
divsd  %xmm2,%xmm1
movsd  0xeaa(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_between>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
mov    0x2ec3(%rip),%rax
cvtsi2sdq (%rax),%xmm1
sub    %ebp,%ebx
add    $0x1,%ebx
cvtsi2sd %rbx,%xmm2
divsd  %xmm2,%xmm1
addsd  0xec0(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define i32 @rand_between(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 = call double (...) @rand()
%7 = load i64, i64* @RAND_MAX
%8 = sitofp i64 %7 to double
%9 = load i32, i32* %4
%10 = load i32, i32* %3
%11 = sub i32 %9, %10
%12 = add i32 %11, 1
%13 = uitofp i32 %12 to double
%14 = fdiv double %8, %13
%15 = fadd double %14, 1.000000e+00
%16 = fdiv double %6, %15
%17 = fptosi double %16 to i32
%18 = add i32 %5, %17
ret i32 %18
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define i32 @rand_between(i32 %0, i32 %1) {
%3 = tail call double (...) @rand()
%4 = load i64, i64* @RAND_MAX
%5 = sitofp i64 %4 to double
%6 = sub i32 1, %0
%7 = add i32 %6, %1
%8 = uitofp i32 %7 to double
%9 = fdiv double %5, %8
%10 = fadd double %9, 1.000000e+00
%11 = fdiv double %3, %10
%12 = fptosi double %11 to i32
%13 = add i32 %12, %0
ret i32 %13
}
void BUF_strlcat(void) {}


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

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

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

LLVM IR (-O2):
define void @BUF_strlcat() {
ret void
}
unsigned xrop3_249_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = D ^ S;
  stk2 = ~stk2;
  stk1 = T | stk2;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_249_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
or     -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_249_1_0>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
mov    %esi,%ecx
shl    $0x8,%ecx
or     %esi,%ecx
mov    %eax,%edx
xor    $0xffffff00,%edx
or     %ecx,%edx
not    %eax
and    %edx,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_249_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %5
%23 = load i32, i32* %6
%24 = xor i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %9
%26 = xor i32 %25, -1
store i32 %26, i32* %9
%27 = load i32, i32* %7
%28 = load i32, i32* %9
%29 = or i32 %27, %28
store i32 %29, i32* %8
%30 = load i32, i32* %8
%31 = load i32, i32* %6
%32 = xor i32 %31, -1
%33 = and i32 %30, %32
%34 = load i32, i32* %5
%35 = load i32, i32* %6
%36 = and i32 %34, %35
%37 = or i32 %33, %36
ret i32 %37
}

LLVM IR (-O2):
define i32 @xrop3_249_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i32 %4, -256
%8 = or i32 %6, %7
%9 = xor i32 %4, -1
%10 = and i32 %8, %9
%11 = or i32 %10, %3
ret i32 %11
}
void foo177() {}


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

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

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

LLVM IR (-O2):
define void @foo177() {
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(double *, int *, int);
double u64_to_f64(uint64_t x) {
  uint64_t v = ((uint64_t)0x3ff << 52) | (x >> 12);
  double d;
  memcpy(&d, &v, sizeof d);
  return d - 1.0;
}


x86 assembly (clang, -O0):
<u64_to_f64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
sar    $0xc,%ecx
or     %ecx,%eax
mov    %eax,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x8,%edx
call   1030 <memcpy@plt>
movsd  -0x10(%rbp),%xmm0
movsd  0xebb(%rip),%xmm1
subsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<u64_to_f64>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
lea    0x14(%rsp),%rsi
mov    $0x8,%edx
call   1030 <memcpy@plt>
movsd  0x8(%rsp),%xmm0
addsd  0xeca(%rip),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @u64_to_f64(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca double
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = ashr i32 %5, 12
%7 = or i32 poison, %6
store i32 %7, i32* %3
%8 = call i32 @memcpy(double* %4, i32* %3, i32 8)
%9 = load double, double* %4
%10 = fsub double %9, 1.000000e+00
ret double %10
}

LLVM IR (-O2):
define double @u64_to_f64(i32 %0) {
%2 = alloca i32
%3 = alloca double
%4 = bitcast i32* %2 to i8*
%5 = bitcast double* %3 to i8*
%6 = call i32 @memcpy(double* %3, i32* %2, i32 8)
%7 = load double, double* %3
%8 = fadd double %7, -1.000000e+00
ret double %8
}
void dskbwr_(int *lun, int *lflag) { return; }


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

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

LLVM IR (-O0):
define void @dskbwr_(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 @dskbwr_(i32* nocapture %0, i32* nocapture %1) {
ret void
}
/* Type definitions */
struct timespec {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ EINVAL;
int /*<<< orphan*/ errno;
int settime(struct timespec const *ts) {
  errno = EINVAL;
  return -1;
}


x86 assembly (clang, -O0):
<settime>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    0x2ec9(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec8(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<settime>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%eax
mov    0x2ed0(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
%struct.timespec = type { i32 }
@EINVAL = global i32 0
@errno = global i32 0
define i32 @settime(%struct.timespec* %0) {
%2 = alloca %struct.timespec*
store %struct.timespec* %0, %struct.timespec** %2
%3 = load i32, i32* @EINVAL
store i32 %3, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
@EINVAL = global i32 0
@errno = global i32 0
define i32 @settime(%struct.timespec* nocapture readnone %0) {
%2 = load i32, i32* @EINVAL
store i32 %2, i32* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ UPnPResponse_AVTransport_Stop(void *);
int /*<<< orphan*/ printf(char *, unsigned int);
void UPnPAVTransport_Stop(void *upnptoken, unsigned int InstanceID) {
  printf("Invoke: UPnPAVTransport_Stop(%u);\r\n", InstanceID);
  UPnPResponse_AVTransport_Stop(upnptoken);
}


x86 assembly (clang, -O0):
<UPnPAVTransport_Stop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xec7(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <UPnPResponse_AVTransport_Stop@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UPnPAVTransport_Stop>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <UPnPResponse_AVTransport_Stop@plt>

LLVM IR (-O0):
@.str = [36 x i8] c"Invoke: UPnPAVTransport_Stop(%u);\0D\0A\00"
define void @UPnPAVTransport_Stop(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 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i8*, i8** %3
%8 = call i32 @UPnPResponse_AVTransport_Stop(i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [36 x i8] c"Invoke: UPnPAVTransport_Stop(%u);\0D\0A\00"
define void @UPnPAVTransport_Stop(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %1)
%4 = tail call i32 @UPnPResponse_AVTransport_Stop(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SIGINT;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ signal(int /*<<< orphan*/, void (*)(int));
void sigintHandler(int sig_num) {
  signal(SIGINT, sigintHandler);
  printf("\b\b  \n\033[?25h");
  exit(0);
}


x86 assembly (clang, -O0):
<sigintHandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
mov    0x2e9d(%rip),%rsi
call   1040 <signal@plt>
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<sigintHandler>:
push   %rax
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
mov    0x2ea7(%rip),%rsi
call   1040 <signal@plt>
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@SIGINT = global i32 0
@.str = [12 x i8] c"\08\08 \0A\1B[?25h\00"
define void @sigintHandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @SIGINT
%4 = call i32 @signal(i32 %3, void (i32)* @sigintHandler)
%5 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@SIGINT = global i32 0
@.str = [12 x i8] c"\08\08 \0A\1B[?25h\00"
define void @sigintHandler(i32 %0) {
%2 = load i32, i32* @SIGINT
%3 = tail call i32 @signal(i32 %2, void (i32)* @sigintHandler)
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ dbr_abort(int);
int /*<<< orphan*/ dbr_mesg(char *, size_t);
void *malloc(size_t);
void *xmalloc(size_t size) {
  void *value = malloc(size);
  if (value == NULL) {
    dbr_mesg("Error: virtual memory exhausted (%i bytes requested).\n", size);
    dbr_abort(2);
  }
  return value;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    116e <xmalloc+0x3e>
mov    -0x8(%rbp),%rsi
lea    0xea1(%rip),%rdi
call   1040 <dbr_mesg@plt>
mov    $0x2,%edi
call   1050 <dbr_abort@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    115d <xmalloc+0x2d>
lea    0xeb5(%rip),%rdi
mov    %r14,%rsi
call   1040 <dbr_mesg@plt>
mov    $0x2,%edi
call   1050 <dbr_abort@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [55 x i8] c"Error: virtual memory exhausted (%i bytes requested).\0A\00"
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i64, i64* %2
%10 = call i32 @dbr_mesg(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i64 %9)
%11 = call i32 @dbr_abort(i32 2)
br label %12
12: ; preds = %8, %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@.str = [55 x i8] c"Error: virtual memory exhausted (%i bytes requested).\0A\00"
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @dbr_mesg(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i64 %0)
%6 = tail call i32 @dbr_abort(i32 2)
br label %7
7: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ hal_delay(int);
int /*<<< orphan*/ hal_usr_led_print4(int);
void hal_assert() {
  while (1) {
    hal_usr_led_print4(0xF);
    hal_delay(1);
    hal_usr_led_print4(0x0);
    hal_delay(1);
  }
}


x86 assembly (clang, -O0):
<hal_assert>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <hal_assert+0x9>
mov    $0xf,%edi
call   1030 <hal_usr_led_print4@plt>
mov    $0x1,%edi
call   1040 <hal_delay@plt>
xor    %edi,%edi
call   1030 <hal_usr_led_print4@plt>
mov    $0x1,%edi
call   1040 <hal_delay@plt>
jmp    1129 <hal_assert+0x9>

x86 assembly (clang, -O2):
<hal_assert>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0xf,%edi
call   1030 <hal_usr_led_print4@plt>
mov    $0x1,%edi
call   1040 <hal_delay@plt>
xor    %edi,%edi
call   1030 <hal_usr_led_print4@plt>
mov    $0x1,%edi
call   1040 <hal_delay@plt>
jmp    1130 <hal_assert+0x10>

LLVM IR (-O0):
define void @hal_assert() {
br label %1
1: ; preds = %0, %1
%2 = call i32 @hal_usr_led_print4(i32 15)
%3 = call i32 @hal_delay(i32 1)
%4 = call i32 @hal_usr_led_print4(i32 0)
%5 = call i32 @hal_delay(i32 1)
br label %1
}

LLVM IR (-O2):
define void @hal_assert() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 @hal_usr_led_print4(i32 15)
%3 = tail call i32 @hal_delay(i32 1)
%4 = tail call i32 @hal_usr_led_print4(i32 0)
%5 = tail call i32 @hal_delay(i32 1)
br label %1
}
int msm_fsusb_rpc_init(struct msm_otg_ops *ops) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.msm_otg_ops = type opaque
define i32 @msm_fsusb_rpc_init(%struct.msm_otg_ops* nocapture readnone %0) {
ret i32 0
}
void car_fini(struct mm *mm) {}


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

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

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

LLVM IR (-O2):
%struct.mm = type opaque
define void @car_fini(%struct.mm* nocapture %0) {
ret void
}