xunge/DecIR huggingface dataset:
/* Variables and functions */
unsigned int rand();
int iRandomFromRange(unsigned int from, unsigned int to) {
  int retNum = rand() % (to - from) + from;
  return retNum;
}


x86 assembly (clang, -O0):
<iRandomFromRange>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
xor    %edx,%edx
div    %ecx
add    -0x4(%rbp),%edx
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iRandomFromRange>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
sub    %ebp,%ebx
xor    %edx,%edx
div    %ebx
add    %edx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @iRandomFromRange(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = call i32 (...) @rand()
%7 = load i32, i32* %4
%8 = load i32, i32* %3
%9 = sub i32 %7, %8
%10 = urem i32 %6, %9
%11 = load i32, i32* %3
%12 = add i32 %10, %11
store i32 %12, i32* %5
%13 = load i32, i32* %5
ret i32 %13
}

LLVM IR (-O2):
define i32 @iRandomFromRange(i32 %0, i32 %1) {
%3 = tail call i32 (...) @rand()
%4 = sub i32 %1, %0
%5 = urem i32 %3, %4
%6 = add i32 %5, %0
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char *, int);
char *new_file(char *tempfile, char *cur_dir, int file_num) {
  sprintf(tempfile, "%s/file%03d", cur_dir, file_num);
  return tempfile;
}


x86 assembly (clang, -O0):
<new_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
lea    0xecb(%rip),%rsi
call   1030 <sprintf@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<new_file>:
push   %rbx
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %rdi,%rbx
lea    0xee0(%rip),%rsi
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"%s/file%03d\00"
define i8* @new_file(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @sprintf(i8* %7, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %8, i32 %9)
%11 = load i8*, i8** %4
ret i8* %11
}

LLVM IR (-O2):
@.str = [12 x i8] c"%s/file%03d\00"
define i8* @new_file(i8* returned writeonly %0, i8* %1, i32 %2) {
%4 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %2)
ret i8* %0
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
int lstat(char const *, struct stat *);
int /*<<< orphan*/ mode_native_to_git(int /*<<< orphan*/);
int git_lstat(const char *path, struct stat *buf) {
  int rc = lstat(path, buf);
  if (rc == 0)
    buf->st_mode = mode_native_to_git(buf->st_mode);
  return rc;
}


x86 assembly (clang, -O0):
<git_lstat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <lstat@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    115d <git_lstat+0x3d>
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
call   1040 <mode_native_to_git@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<git_lstat>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
call   1030 <lstat@plt>
mov    %eax,%ebp
test   %eax,%eax
jne    113a <git_lstat+0x1a>
mov    (%rbx),%edi
call   1040 <mode_native_to_git@plt>
mov    %eax,(%rbx)
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @git_lstat(i8* %0, %struct.stat* %1) {
%3 = alloca i8*
%4 = alloca %struct.stat*
%5 = alloca i32
store i8* %0, i8** %3
store %struct.stat* %1, %struct.stat** %4
%6 = load i8*, i8** %3
%7 = load %struct.stat*, %struct.stat** %4
%8 = call i32 @lstat(i8* %6, %struct.stat* %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %18
11: ; preds = %2
%12 = load %struct.stat*, %struct.stat** %4
%13 = getelementptr inbounds %struct.stat, %struct.stat* %12, i32 0, i32 0
%14 = load i32, i32* %13
%15 = call i32 @mode_native_to_git(i32 %14)
%16 = load %struct.stat*, %struct.stat** %4
%17 = getelementptr inbounds %struct.stat, %struct.stat* %16, i32 0, i32 0
store i32 %15, i32* %17
br label %18
18: ; preds = %11, %2
%19 = load i32, i32* %5
ret i32 %19
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @git_lstat(i8* nocapture %0, %struct.stat* nocapture %1) {
%3 = tail call i32 @lstat(i8* %0, %struct.stat* %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = getelementptr inbounds %struct.stat, %struct.stat* %1, i64 0, i32 0
%7 = load i32, i32* %6
%8 = tail call i32 @mode_native_to_git(i32 %7)
store i32 %8, i32* %6
br label %9
9: ; preds = %5, %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ execve(char *, int /*<<< orphan*/ *, int /*<<< orphan*/ *);
void secret_shell() { execve("/bin/sh", NULL, NULL); }


x86 assembly (clang, -O0):
<secret_shell>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
xor    %eax,%eax
mov    %eax,%edx
mov    %rdx,%rsi
call   1030 <execve@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<secret_shell>:
lea    0xee9(%rip),%rdi
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <execve@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"/bin/sh\00"
define void @secret_shell() {
%1 = call i32 @execve(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32* null, i32* null)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"/bin/sh\00"
define void @secret_shell() {
%1 = tail call i32 @execve(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32* null, i32* null)
ret void
}
unsigned long f2(unsigned long x, int y) { return x << (y & 63); }


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
and    $0x3f,%ecx
mov    %ecx,%ecx
shl    %cl,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
mov    %esi,%ecx
mov    %rdi,%rax
shl    %cl,%rax
ret

LLVM IR (-O0):
define i64 @f2(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%5 = load i64, i64* %3
%6 = load i32, i32* %4
%7 = and i32 %6, 63
%8 = zext i32 %7 to i64
%9 = shl i64 %5, %8
ret i64 %9
}

LLVM IR (-O2):
define i64 @f2(i64 %0, i32 %1) {
%3 = and i32 %1, 63
%4 = zext i32 %3 to i64
%5 = shl i64 %0, %4
ret i64 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ XEvent;

/* Variables and functions */
int /*<<< orphan*/ do_EnterNotify(int /*<<< orphan*/ *);
void do_LeaveNotify(XEvent *eventp) { do_EnterNotify(eventp); }


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

x86 assembly (clang, -O2):
<do_LeaveNotify>:
jmp    1030 <do_EnterNotify@plt>

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

LLVM IR (-O2):
define void @do_LeaveNotify(i32* %0) {
%2 = tail call i32 @do_EnterNotify(i32* %0)
ret void
}
/* Variables and functions */
int strcmp(char *, char *);
int mycmp(const void *v1, const void *v2) {
  char *s1 = *(char **)v1;
  char *s2 = *(char **)v2;
  return strcmp(s1, s2);
}


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

x86 assembly (clang, -O2):
<mycmp>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @mycmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i8**
%9 = load i8*, i8** %8
store i8* %9, i8** %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i8**
%12 = load i8*, i8** %11
store i8* %12, i8** %6
%13 = load i8*, i8** %5
%14 = load i8*, i8** %6
%15 = call i32 @strcmp(i8* %13, i8* %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @mycmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}
void switchFreq(_Bool isHigh) {
  int is_high = (isHigh ? 1 : 0);
  switch_freq(is_high);
}


x86 assembly (clang, -O0):
<switchFreq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
and    $0x1,%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x0,%al
call   1030 <switch_freq@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @switchFreq(i1 zeroext %0) {
%2 = alloca i8
%3 = alloca i32
%4 = zext i1 %0 to i8
store i8 %4, i8* %2
%5 = load i8, i8* %2
%6 = trunc i8 %5 to i1
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 1, i32 0
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = call i32 (i32, ...) bitcast (i32 (...)* @switch_freq to i32 (i32, ...)*)(i32 %9)
ret void
}

LLVM IR (-O2):
define void @switchFreq(i1 zeroext %0) {
%2 = zext i1 %0 to i32
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @switch_freq to i32 (i32, ...)*)(i32 %2)
ret void
}
/* Variables and functions */
int b();
int c() { return b() + 1; }


x86 assembly (clang, -O0):
<c>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <b@plt>
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<c>:
push   %rax
xor    %eax,%eax
call   1030 <b@plt>
add    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @c() {
%1 = call i32 (...) @b()
%2 = add nsw i32 %1, 1
ret i32 %2
}

LLVM IR (-O2):
define i32 @c() {
%1 = tail call i32 (...) @b()
%2 = add nsw i32 %1, 1
ret i32 %2
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t assemble(uint8_t a, uint8_t b) {
  uint16_t a16 = (a << 8);
  uint16_t concat = a16 | b;
  return concat;
}


x86 assembly (clang, -O0):
<assemble>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<assemble>:
mov    %edi,%eax
shl    $0x8,%eax
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @assemble(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = shl i32 %7, 8
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = load i32, i32* %4
%11 = or i32 %9, %10
store i32 %11, i32* %6
%12 = load i32, i32* %6
ret i32 %12
}

LLVM IR (-O2):
define i32 @assemble(i32 %0, i32 %1) {
%3 = shl i32 %0, 8
%4 = or i32 %3, %1
ret i32 %4
}
/* Variables and functions */
int isxdigit(int ch) {
  return (ch >= 'A' && ch <= 'F') || (ch >= 'a' && ch <= 'f') ||
         (ch >= '0' && ch <= '9');
}


x86 assembly (clang, -O0):
<isxdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x41,-0x4(%rbp)
jl     1120 <isxdigit+0x20>
mov    $0x1,%al
cmpl   $0x46,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1158 <isxdigit+0x58>
cmpl   $0x61,-0x4(%rbp)
jl     1139 <isxdigit+0x39>
mov    $0x1,%al
cmpl   $0x66,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1158 <isxdigit+0x58>
xor    %eax,%eax
cmpl   $0x30,-0x4(%rbp)
mov    %al,-0x6(%rbp)
jl     1152 <isxdigit+0x52>
cmpl   $0x39,-0x4(%rbp)
setle  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isxdigit>:
mov    %edi,%eax
and    $0xffffffdf,%eax
add    $0xffffffbf,%eax
cmp    $0x6,%eax
setb   %al
add    $0xffffffd0,%edi
cmp    $0xa,%edi
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @isxdigit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 65
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 70
br i1 %7, label %22, label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = icmp sge i32 %9, 97
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp sle i32 %12, 102
br i1 %13, label %22, label %14
14: ; preds = %11, %8
%15 = load i32, i32* %2
%16 = icmp sge i32 %15, 48
br i1 %16, label %17, label %20
17: ; preds = %14
%18 = load i32, i32* %2
%19 = icmp sle i32 %18, 57
br label %20
20: ; preds = %17, %14
%21 = phi i1 [ false, %14 ], [ %19, %17 ]
br label %22
22: ; preds = %20, %11, %5
%23 = phi i1 [ true, %11 ], [ true, %5 ], [ %21, %20 ]
%24 = zext i1 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
define i32 @isxdigit(i32 %0) {
%2 = and i32 %0, -33
%3 = add i32 %2, -65
%4 = icmp ult i32 %3, 6
%5 = add i32 %0, -48
%6 = icmp ult i32 %5, 10
%7 = or i1 %6, %4
%8 = zext i1 %7 to i32
ret i32 %8
}
unsigned long rho_ruby_get_time(unsigned long rDate) { return 0; }


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

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

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

LLVM IR (-O2):
define i64 @rho_ruby_get_time(i64 %0) {
ret i64 0
}
int number_of_digits_int(int num) {
  int digits = 0;
  if (num < 0) {
    num *= -1;
  }
  while (num != 0) {
    digits += 1;
    num /= 10;
  }
  return digits;
}


x86 assembly (clang, -O0):
<number_of_digits_int>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    111f <number_of_digits_int+0x1f>
imul   $0xffffffff,-0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1124 <number_of_digits_int+0x24>
cmpl   $0x0,-0x4(%rbp)
je     114a <number_of_digits_int+0x4a>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    1124 <number_of_digits_int+0x24>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<number_of_digits_int>:
test   %edi,%edi
je     1133 <number_of_digits_int+0x33>
mov    %edi,%ecx
neg    %ecx
cmovs  %edi,%ecx
xor    %eax,%eax
nopl   (%rax)
add    $0x1,%eax
movslq %ecx,%rdx
imul   $0x66666667,%rdx,%rcx
mov    %rcx,%rsi
shr    $0x3f,%rsi
sar    $0x22,%rcx
add    %esi,%ecx
add    $0x9,%edx
cmp    $0x12,%edx
ja     1110 <number_of_digits_int+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @number_of_digits_int(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
br label %5
5: ; preds = %3, %5
%6 = phi i32 [ %8, %5 ], [ 0, %3 ]
%7 = phi i32 [ %9, %5 ], [ %4, %3 ]
%8 = add nuw nsw i32 %6, 1
%9 = sdiv i32 %7, 10
%10 = add i32 %7, 9
%11 = icmp ult i32 %10, 19
br i1 %11, label %12, label %5
12: ; preds = %5, %1
%13 = phi i32 [ 0, %1 ], [ %8, %5 ]
ret i32 %13
}
int batadv_nc_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @batadv_nc_init() {
ret i32 0
}
const char *_Locale_negative_sign(struct _Locale_monetary *__DUMMY_PAR) {
  return "";
}


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

x86 assembly (clang, -O2):
<_Locale_negative_sign>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
%struct._Locale_monetary = type opaque
@.str = [1 x i8] zeroinitializer
define i8* @_Locale_negative_sign(%struct._Locale_monetary* %0) {
%2 = alloca %struct._Locale_monetary*
store %struct._Locale_monetary* %0, %struct._Locale_monetary** %2
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
%struct._Locale_monetary = type opaque
@.str = [1 x i8] zeroinitializer
define i8* @_Locale_negative_sign(%struct._Locale_monetary* nocapture readnone %0) {
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ quit(int);
int write(int, char *, int);
void w(char ch) {
  if (write(1, &ch, 1) != 1)
    quit(2);
}


x86 assembly (clang, -O0):
<w>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x1,%edx
lea    -0x1(%rbp),%rsi
mov    %edx,%edi
call   1030 <write@plt>
cmp    $0x1,%eax
je     1151 <w+0x31>
mov    $0x2,%edi
call   1040 <quit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<w>:
push   %rax
mov    %dil,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
call   1030 <write@plt>
cmp    $0x1,%eax
jne    1141 <w+0x21>
pop    %rax
ret
mov    $0x2,%edi
pop    %rax
jmp    1040 <quit@plt>

LLVM IR (-O0):
define void @w(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @write(i32 1, i8* %2, i32 1)
%4 = icmp ne i32 %3, 1
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @quit(i32 2)
br label %7
7: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @w(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @write(i32 1, i8* %2, i32 1)
%4 = icmp eq i32 %3, 1
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @quit(i32 2)
br label %7
7: ; preds = %5, %1
ret void
}
void addon_delay(long ms) {
  void status_delay(long ms);
  status_delay(ms);
}


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

x86 assembly (clang, -O2):
<addon_delay>:
jmp    1030 <status_delay@plt>

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

LLVM IR (-O2):
define void @addon_delay(i64 %0) {
tail call void @status_delay(i64 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ system(char *);
int print_menu_hdr(char *header) {
  system("clear");
  printf("\n\t\t\t*****************************************************\n");
  printf("\t\t\t\t EMPLOYEE %s MENU \n", header);
  printf("\t\t\t*****************************************************\n");
}


x86 assembly (clang, -O0):
<print_menu_hdr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <system@plt>
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rsi
lea    0xef0(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xea8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_menu_hdr>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rdi
call   1040 <system@plt>
lea    0xed7(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb3(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xebb(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"clear\00"
@.str.1 = [59 x i8] c"\0A\09\09\09*****************************************************\0A\00"
@.str.2 = [24 x i8] c"\09\09\09\09 EMPLOYEE %s MENU \0A\00"
@.str.3 = [58 x i8] c"\09\09\09*****************************************************\0A\00"
define i32 @print_menu_hdr(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.1, i64 0, i64 0))
%6 = load i8*, i8** %3
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i8* %6)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.3, i64 0, i64 0))
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
@.str = [6 x i8] c"clear\00"
@.str.2 = [24 x i8] c"\09\09\09\09 EMPLOYEE %s MENU \0A\00"
@str = [58 x i8] c"\0A\09\09\09*****************************************************\00"
@str.4 = [57 x i8] c"\09\09\09*****************************************************\00"
define i32 @print_menu_hdr(i8* %0) {
%2 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i8* %0)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @str.4, i64 0, i64 0))
ret i32 undef
}
void thread_fence(void) { __sync_synchronize(); }


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

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

LLVM IR (-O0):
define void @thread_fence() {
fence seq_cst
ret void
}

LLVM IR (-O2):
define void @thread_fence() {
fence seq_cst
ret void
}
/* Variables and functions */
bool can_go_r(int w, int x, int n) { return x + n < w; }


x86 assembly (clang, -O0):
<can_go_r>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<can_go_r>:
add    %edx,%esi
xor    %eax,%eax
cmp    %edi,%esi
setl   %al
ret

LLVM IR (-O0):
define i32 @can_go_r(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = load i32, i32* %6
%9 = add nsw i32 %7, %8
%10 = load i32, i32* %4
%11 = icmp slt i32 %9, %10
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @can_go_r(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %2, %1
%5 = icmp slt i32 %4, %0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void reverse(char str[], int i) {
  if (str[i] == '\0')
    return;
  else
    reverse(str, i + 1);
  printf("%c", str[i]);
}


x86 assembly (clang, -O0):
<reverse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
jne    1149 <reverse+0x29>
jmp    1170 <reverse+0x50>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
add    $0x1,%esi
call   1030 <reverse@plt>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
lea    0xe99(%rip),%rdi
movsbl (%rax,%rcx,1),%esi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse>:
push   %r14
push   %rbx
push   %rax
movslq %esi,%rbx
cmpb   $0x0,(%rdi,%rbx,1)
je     1150 <reverse+0x30>
mov    %rdi,%r14
lea    0x1(%rbx),%esi
call   1030 <reverse@plt>
movsbl (%r14,%rbx,1),%esi
lea    0xebc(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <printf@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define void @reverse(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 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %2
br label %24
13: ; preds = %2
%14 = load i8*, i8** %3
%15 = load i32, i32* %4
%16 = add nsw i32 %15, 1
br label %17
17: ; preds = %13
%18 = load i8*, i8** %3
%19 = load i32, i32* %4
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8, i8* %18, i64 %20
%22 = load i8, i8* %21
%23 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %22)
br label %24
24: ; preds = %17, %12
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @reverse(i8* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %2, %8
ret void
8: ; preds = %2
%9 = add nsw i32 %1, 1
tail call void @reverse(i8* %0, i32 %9)
%10 = load i8, i8* %4
%11 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %10)
br label %7
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
__attribute__((always_)) uint64_t increment_mwindow_head(uint64_t head) {
  head++;
  return (head | (head >> (4))) & (15);
}


x86 assembly (clang, -O0):
<increment_mwindow_head>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sar    $0x4,%ecx
or     %ecx,%eax
and    $0xf,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<increment_mwindow_head>:
lea    0x1(%rdi),%ecx
mov    %ecx,%eax
shr    $0x4,%eax
or     %ecx,%eax
and    $0xf,%eax
ret

LLVM IR (-O0):
define i32 @increment_mwindow_head(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = load i32, i32* %2
%7 = ashr i32 %6, 4
%8 = or i32 %5, %7
%9 = and i32 %8, 15
ret i32 %9
}

LLVM IR (-O2):
define i32 @increment_mwindow_head(i32 %0) {
%2 = add nsw i32 %0, 1
%3 = lshr i32 %2, 4
%4 = or i32 %3, %2
%5 = and i32 %4, 15
ret i32 %5
}
const char *unqlite_lib_copyright(void) {
  return "Copyright (C) Symisc Systems, S.U.A.R.L [Mrad Chems Eddine "
         "<chm@symisc.net>] 2012-2013, http://unqlite.org/";
}


x86 assembly (clang, -O0):
<unqlite_lib_copyright>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unqlite_lib_copyright>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [108 x i8] c"Copyright (C) Symisc Systems, S.U.A.R.L [Mrad Chems Eddine <chm@symisc.net>] 2012-2013, http://unqlite.org/\00"
define i8* @unqlite_lib_copyright() {
ret i8* getelementptr inbounds ([108 x i8], [108 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [108 x i8] c"Copyright (C) Symisc Systems, S.U.A.R.L [Mrad Chems Eddine <chm@symisc.net>] 2012-2013, http://unqlite.org/\00"
define i8* @unqlite_lib_copyright() {
ret i8* getelementptr inbounds ([108 x i8], [108 x i8]* @.str, i64 0, i64 0)
}
void RandomFunc(unsigned long input[1], unsigned long output[1]) {
  unsigned long state[1];
  unsigned long local1;
  {
    state[0UL] = (input[0UL] & 914778474UL) << 7UL;
    local1 = 0UL;
    while (local1 < input[1UL]) {
      state[0UL] &= state[local1];
      local1++;
    }
    output[0UL] = state[0UL] & 690137161UL;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
and    $0x3686696a,%rax
shl    $0x7,%rax
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x8(%rbp),%rcx
cmp    0x8(%rcx),%rax
jae    115d <RandomFunc+0x5d>
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp,%rax,8),%rax
and    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1129 <RandomFunc+0x29>
mov    -0x18(%rbp),%rcx
and    $0x2922a849,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
mov    (%rdi),%eax
shl    $0x7,%eax
and    $0x120a000,%eax
mov    %rax,(%rsi)
ret

LLVM IR (-O0):
define void @RandomFunc(i64* %0, i64* %1) {
%3 = alloca i64*
%4 = alloca i64*
%5 = alloca [1 x i64]
%6 = alloca i64
store i64* %0, i64** %3
store i64* %1, i64** %4
%7 = load i64*, i64** %3
%8 = getelementptr inbounds i64, i64* %7, i64 0
%9 = load i64, i64* %8
%10 = and i64 %9, 914778474
%11 = shl i64 %10, 7
%12 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
store i64 %11, i64* %12
store i64 0, i64* %6
br label %13
13: ; preds = %19, %2
%14 = load i64, i64* %6
%15 = load i64*, i64** %3
%16 = getelementptr inbounds i64, i64* %15, i64 1
%17 = load i64, i64* %16
%18 = icmp ult i64 %14, %17
br i1 %18, label %19, label %28
19: ; preds = %13
%20 = load i64, i64* %6
%21 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 %20
%22 = load i64, i64* %21
%23 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
%24 = load i64, i64* %23
%25 = and i64 %24, %22
store i64 %25, i64* %23
%26 = load i64, i64* %6
%27 = add i64 %26, 1
store i64 %27, i64* %6
br label %13
28: ; preds = %13
%29 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
%30 = load i64, i64* %29
%31 = and i64 %30, 690137161
%32 = load i64*, i64** %4
%33 = getelementptr inbounds i64, i64* %32, i64 0
store i64 %31, i64* %33
ret void
}

LLVM IR (-O2):
define void @RandomFunc(i64* nocapture %0, i64* nocapture writeonly %1) {
%3 = load i64, i64* %0
%4 = shl i64 %3, 7
%5 = and i64 %4, 18915328
store i64 %5, i64* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ removeStringTrailingNewline(char *);
int /*<<< orphan*/ strcpy(char *, char *);
int main(int argc, char *argv[]) {
  char ptr[100];
  strcpy(ptr, "abcd\n");
  printf("%s", ptr);
  removeStringTrailingNewline(ptr);
  printf("%s", ptr);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x80(%rbp),%rdi
lea    0xeac(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x80(%rbp),%rsi
lea    0xea2(%rip),%rdi
call   1040 <printf@plt>
lea    -0x80(%rbp),%rdi
call   1050 <removeStringTrailingNewline@plt>
lea    -0x80(%rbp),%rsi
lea    0xe89(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x68,%rsp
lea    0xec2(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
lea    0xeb6(%rip),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1050 <removeStringTrailingNewline@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [6 x i8] c"abcd\0A\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [100 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%8 = call i32 @strcpy(i8* %7, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%10 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %9)
%11 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%12 = call i32 @removeStringTrailingNewline(i8* %11)
%13 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%14 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"abcd\0A\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [100 x i8]
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%5 = call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%7 = call i32 @removeStringTrailingNewline(i8* %4)
%8 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 0
}
/* Variables and functions */
scalar_t__ cbrt(double);
float fcbrt(float x) { return ((float)cbrt((double)x)); }


x86 assembly (clang, -O0):
<fcbrt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
call   1030 <cbrt@plt>
cvtsi2ss %rax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fcbrt>:
push   %rax
cvtss2sd %xmm0,%xmm0
call   1030 <cbrt@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @fcbrt(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = call i64 @cbrt(double %4)
%6 = sitofp i64 %5 to float
ret float %6
}

LLVM IR (-O2):
define float @fcbrt(float %0) {
%2 = fpext float %0 to double
%3 = tail call i64 @cbrt(double %2)
%4 = sitofp i64 %3 to float
ret float %4
}
/* Type definitions */
typedef int uint64_t;
typedef scalar_t__ int64_t;

/* Variables and functions */
scalar_t__ sqrti(int);
int64_t isqrt64(int64_t val) { return sqrti((uint64_t)val << 12); }


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

x86 assembly (clang, -O2):
<isqrt64>:
shl    $0xc,%edi
jmp    1030 <sqrti@plt>

LLVM IR (-O0):
define i64 @isqrt64(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
%5 = shl i32 %4, 12
%6 = call i64 @sqrti(i32 %5)
ret i64 %6
}

LLVM IR (-O2):
define i64 @isqrt64(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = shl i32 %2, 12
%4 = tail call i64 @sqrti(i32 %3)
ret i64 %4
}
int fibonacci(int n) {
  if (n == 0) {
    return 0;
  } else if (n == 1) {
    return 1;
  } else {
    return fibonacci(n - 2) + fibonacci(n - 1);
  }
}


x86 assembly (clang, -O0):
<fibonacci>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <fibonacci+0x21>
movl   $0x0,-0x4(%rbp)
jmp    116a <fibonacci+0x5a>
cmpl   $0x1,-0x8(%rbp)
jne    1147 <fibonacci+0x37>
movl   $0x1,-0x4(%rbp)
jmp    116a <fibonacci+0x5a>
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fibonacci@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fibonacci@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fibonacci>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %ebp,%ebp
cmp    $0x2,%ebx
jb     1132 <fibonacci+0x22>
nopl   0x0(%rax)
lea    -0x2(%rbx),%edi
call   1030 <fibonacci@plt>
add    %eax,%ebp
add    $0xffffffff,%ebx
cmp    $0x2,%ebx
jae    1120 <fibonacci+0x10>
add    %ebp,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fibonacci(i32 %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i32 [ 0, %1 ], [ %10, %6 ]
%4 = phi i32 [ %0, %1 ], [ %9, %6 ]
%5 = icmp ult i32 %4, 2
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = add nsw i32 %4, -2
%8 = tail call i32 @fibonacci(i32 %7)
%9 = add nsw i32 %4, -1
%10 = add nsw i32 %8, %3
br label %2
11: ; preds = %2
%12 = add nsw i32 %4, %3
ret i32 %12
}
void roadmap_device_events_os_term() {}


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

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

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

LLVM IR (-O2):
define void @roadmap_device_events_os_term() {
ret void
}
void XtGetSelectionTimeout() {}


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

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

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

LLVM IR (-O2):
define void @XtGetSelectionTimeout() {
ret void
}
correct_pob_for_btl(nn) int nn;
{
  if (nn == -999999)
    return 0;
  else if (nn < 0)
    return (-nn);
  else
    return (nn);
}


x86 assembly (clang, -O0):
<correct_pob_for_btl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0xfff0bdc1,-0x8(%rbp)
jne    1120 <correct_pob_for_btl+0x20>
movl   $0x0,-0x4(%rbp)
jmp    113d <correct_pob_for_btl+0x3d>
cmpl   $0x0,-0x8(%rbp)
jge    1137 <correct_pob_for_btl+0x37>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    113d <correct_pob_for_btl+0x3d>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<correct_pob_for_btl>:
mov    %edi,%ecx
neg    %ecx
cmovs  %edi,%ecx
xor    %eax,%eax
cmp    $0xfff0bdc1,%edi
cmovne %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @correct_pob_for_btl(i32 %0) {
%2 = icmp eq i32 %0, -999999
%3 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
%4 = select i1 %2, i32 0, i32 %3
ret i32 %4
}
/* Variables and functions */
int f();
int wflags() { return f(); }


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

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

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

LLVM IR (-O2):
define i32 @wflags() {
%1 = tail call i32 (...) @f()
ret i32 %1
}
/* Type definitions */
typedef int int16_t;

/* Variables and functions */
int16_t endian_rev16s(int16_t data) {
  return ((data >> 8) & 0x00ff) | ((data & 0x00ff) << 8);
}


x86 assembly (clang, -O0):
<endian_rev16s>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    -0x4(%rbp),%ecx
and    $0xff,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<endian_rev16s>:
rol    $0x8,%di
movzwl %di,%eax
ret

LLVM IR (-O0):
define i32 @endian_rev16s(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 8
%5 = and i32 %4, 255
%6 = load i32, i32* %2
%7 = and i32 %6, 255
%8 = shl i32 %7, 8
%9 = or i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @endian_rev16s(i32 %0) {
%2 = trunc i32 %0 to i16
%3 = tail call i16 @llvm.bswap.i16(i16 %2)
%4 = zext i16 %3 to i32
ret i32 %4
}
int exponen(int m) {
  int i, ex;
  ex = 1;
  for (i = 0; i < m; i++)
    ex = ex * 2;
  return (ex);
}


x86 assembly (clang, -O0):
<exponen>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1138 <exponen+0x38>
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1115 <exponen+0x15>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<exponen>:
test   %edi,%edi
jle    1118 <exponen+0x18>
lea    -0x1(%rdi),%eax
mov    %edi,%ecx
and    $0x7,%ecx
cmp    $0x7,%eax
jae    111e <exponen+0x1e>
mov    $0x1,%eax
jmp    1138 <exponen+0x38>
mov    $0x1,%eax
ret
and    $0xfffffff8,%edi
mov    $0x1,%eax
cs nopw 0x0(%rax,%rax,1)
shl    $0x8,%eax
add    $0xfffffff8,%edi
jne    1130 <exponen+0x30>
test   %ecx,%ecx
je     1147 <exponen+0x47>
nopl   0x0(%rax)
add    %eax,%eax
add    $0xffffffff,%ecx
jne    1140 <exponen+0x40>
ret

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

LLVM IR (-O2):
define i32 @exponen(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %25
3: ; preds = %1
%4 = add i32 %0, -1
%5 = and i32 %0, 7
%6 = icmp ult i32 %4, 7
br i1 %6, label %15, label %7
7: ; preds = %3
%8 = and i32 %0, -8
br label %9
9: ; preds = %9, %7
%10 = phi i32 [ 1, %7 ], [ %12, %9 ]
%11 = phi i32 [ 0, %7 ], [ %13, %9 ]
%12 = shl i32 %10, 8
%13 = add i32 %11, 8
%14 = icmp eq i32 %13, %8
br i1 %14, label %15, label %9
15: ; preds = %9, %3
%16 = phi i32 [ undef, %3 ], [ %12, %9 ]
%17 = phi i32 [ 1, %3 ], [ %12, %9 ]
%18 = icmp eq i32 %5, 0
br i1 %18, label %25, label %19
19: ; preds = %15, %19
%20 = phi i32 [ %22, %19 ], [ %17, %15 ]
%21 = phi i32 [ %23, %19 ], [ 0, %15 ]
%22 = shl nsw i32 %20, 1
%23 = add i32 %21, 1
%24 = icmp eq i32 %23, %5
br i1 %24, label %25, label %19
25: ; preds = %15, %19, %1
%26 = phi i32 [ 1, %1 ], [ %16, %15 ], [ %22, %19 ]
ret i32 %26
}
/* Variables and functions */
int /*<<< orphan*/ STDIN_FILENO;
int waitinput(int /*<<< orphan*/, unsigned int);
int waitinput_stdin(unsigned msec) { return waitinput(STDIN_FILENO, msec); }


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

x86 assembly (clang, -O2):
<waitinput_stdin>:
mov    %edi,%esi
mov    0x2ec7(%rip),%rax
mov    (%rax),%edi
jmp    1030 <waitinput@plt>

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

LLVM IR (-O2):
@STDIN_FILENO = global i32 0
define i32 @waitinput_stdin(i32 %0) {
%2 = load i32, i32* @STDIN_FILENO
%3 = tail call i32 @waitinput(i32 %2, i32 %0)
ret i32 %3
}
void setLongWord(int value, char *bytes) {
  bytes[0] = value & 0xff;
  bytes[1] = ((value & 0xff00) >> 8) & 0xff;
  bytes[2] = ((value & 0xff0000) >> 16) & 0xff;
  bytes[3] = ((value & 0xff000000) >> 24) & 0xff;
}


x86 assembly (clang, -O0):
<setLongWord>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x4(%rbp),%eax
and    $0xff00,%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x4(%rbp),%eax
and    $0xff0000,%eax
sar    $0x10,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x4(%rbp),%eax
and    $0xff000000,%eax
shr    $0x18,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<setLongWord>:
mov    %edi,(%rsi)
ret

LLVM IR (-O0):
define void @setLongWord(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = and i32 %5, 255
%7 = trunc i32 %6 to i8
%8 = load i8*, i8** %4
%9 = getelementptr inbounds i8, i8* %8, i64 0
store i8 %7, i8* %9
%10 = load i32, i32* %3
%11 = and i32 %10, 65280
%12 = ashr i32 %11, 8
%13 = and i32 %12, 255
%14 = trunc i32 %13 to i8
%15 = load i8*, i8** %4
%16 = getelementptr inbounds i8, i8* %15, i64 1
store i8 %14, i8* %16
%17 = load i32, i32* %3
%18 = and i32 %17, 16711680
%19 = ashr i32 %18, 16
%20 = and i32 %19, 255
%21 = trunc i32 %20 to i8
%22 = load i8*, i8** %4
%23 = getelementptr inbounds i8, i8* %22, i64 2
store i8 %21, i8* %23
%24 = load i32, i32* %3
%25 = and i32 %24, -16777216
%26 = lshr i32 %25, 24
%27 = and i32 %26, 255
%28 = trunc i32 %27 to i8
%29 = load i8*, i8** %4
%30 = getelementptr inbounds i8, i8* %29, i64 3
store i8 %28, i8* %30
ret void
}

LLVM IR (-O2):
define void @setLongWord(i32 %0, i8* nocapture writeonly %1) {
%3 = trunc i32 %0 to i8
store i8 %3, i8* %1
%4 = lshr i32 %0, 8
%5 = trunc i32 %4 to i8
%6 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %5, i8* %6
%7 = lshr i32 %0, 16
%8 = trunc i32 %7 to i8
%9 = getelementptr inbounds i8, i8* %1, i64 2
store i8 %8, i8* %9
%10 = lshr i32 %0, 24
%11 = trunc i32 %10 to i8
%12 = getelementptr inbounds i8, i8* %1, i64 3
store i8 %11, i8* %12
ret void
}
/* Variables and functions */
int getpgrp(int /*<<< orphan*/);
int _ast_getpgrp(void) { return (getpgrp(0)); }


x86 assembly (clang, -O0):
<_ast_getpgrp>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <getpgrp@plt>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @_ast_getpgrp() {
%1 = tail call i32 @getpgrp(i32 0)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ HardFault_reason();
int /*<<< orphan*/ StackUnwind();
int /*<<< orphan*/ TRACE_DEBUG(char *, int /*<<< orphan*/);
int /*<<< orphan*/ __DMB();
int /*<<< orphan*/ __ISB();
void HardFault_Handler(void) {
  TRACE_DEBUG("\n\rHardFault at address 0X%x\n\r", StackUnwind());
  __ISB();
  __DMB();
  HardFault_reason();
}


x86 assembly (clang, -O0):
<HardFault_Handler>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <StackUnwind@plt>
mov    %eax,%esi
lea    0xe9c(%rip),%rdi
call   1060 <TRACE_DEBUG@plt>
mov    $0x0,%al
call   1030 <__ISB@plt>
mov    $0x0,%al
call   1070 <__DMB@plt>
mov    $0x0,%al
call   1040 <HardFault_reason@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<HardFault_Handler>:
push   %rax
xor    %eax,%eax
call   1050 <StackUnwind@plt>
lea    0xea1(%rip),%rdi
mov    %eax,%esi
call   1060 <TRACE_DEBUG@plt>
xor    %eax,%eax
call   1030 <__ISB@plt>
xor    %eax,%eax
call   1070 <__DMB@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <HardFault_reason@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"\0A\0DHardFault at address 0X%x\0A\0D\00"
define void @HardFault_Handler() {
%1 = call i32 (...) @StackUnwind()
%2 = call i32 @TRACE_DEBUG(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = call i32 (...) @__ISB()
%4 = call i32 (...) @__DMB()
%5 = call i32 (...) @HardFault_reason()
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"\0A\0DHardFault at address 0X%x\0A\0D\00"
define void @HardFault_Handler() {
%1 = tail call i32 (...) @StackUnwind()
%2 = tail call i32 @TRACE_DEBUG(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (...) @__ISB()
%4 = tail call i32 (...) @__DMB()
%5 = tail call i32 (...) @HardFault_reason()
ret void
}