xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ __off_t;

/* Variables and functions */
int /*<<< orphan*/ dll_lseek(int, int /*<<< orphan*/, int);
__off_t __wrap_lseek(int fildes, __off_t offset, int whence) {
  return dll_lseek(fildes, offset, whence);
}


x86 assembly (clang, -O0):
<__wrap_lseek>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <dll_lseek@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__wrap_lseek>:
jmp    1030 <dll_lseek@plt>

LLVM IR (-O0):
define i32 @__wrap_lseek(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* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @dll_lseek(i32 %7, i32 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @__wrap_lseek(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @dll_lseek(i32 %0, i32 %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ print_uart0(char *);
void print_hello() { print_uart0("Hello world!\n"); }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"Hello world!\0A\00"
define void @print_hello() {
%1 = call i32 @print_uart0(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"Hello world!\0A\00"
define void @print_hello() {
%1 = tail call i32 @print_uart0(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}
void rho_ruby_holdValue(unsigned long val) {}


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

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

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

LLVM IR (-O2):
define void @rho_ruby_holdValue(i64 %0) {
ret void
}
/* Variables and functions */
void *fiemap_alloc() { return NULL; }


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

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

LLVM IR (-O0):
define i8* @fiemap_alloc() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @fiemap_alloc() {
ret i8* null
}
/* Type definitions */
typedef int /*<<< orphan*/ ipbuf;

/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, unsigned char);
const char *ip_sprintf_short(const unsigned int ip) {
  static char ipbuf[5];
  unsigned char *cip = (unsigned char *)&ip;
  snprintf(ipbuf, sizeof(ipbuf), ".%d", cip[3]);
  return ipbuf;
}


x86 assembly (clang, -O0):
<ip_sprintf_short>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
lea    0x2efb(%rip),%rdi
mov    $0x5,%esi
lea    0xec6(%rip),%rdx
movzbl 0x3(%rax),%ecx
call   1030 <snprintf@plt>
lea    0x2edf(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ip_sprintf_short>:
push   %rbx
mov    %edi,%ecx
shr    $0x18,%ecx
lea    0x2f0c(%rip),%rbx
lea    0xedc(%rip),%rdx
mov    %rbx,%rdi
mov    $0x5,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@ip_sprintf_short.ipbuf = internal global [5 x i8] zeroinitializer
@.str = [4 x i8] c".%d\00"
define i8* @ip_sprintf_short(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = bitcast i32* %2 to i8*
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i64 3
%7 = load i8, i8* %6
%8 = call i32 @snprintf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @ip_sprintf_short.ipbuf, i64 0, i64 0), i32 5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 zeroext %7)
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @ip_sprintf_short.ipbuf, i64 0, i64 0)
}

LLVM IR (-O2):
@ip_sprintf_short.ipbuf = internal global [5 x i8] zeroinitializer
@.str = [4 x i8] c".%d\00"
define i8* @ip_sprintf_short(i32 %0) {
%2 = lshr i32 %0, 24
%3 = trunc i32 %2 to i8
%4 = tail call i32 @snprintf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @ip_sprintf_short.ipbuf, i64 0, i64 0), i32 5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 zeroext %3)
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @ip_sprintf_short.ipbuf, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ lib_do_backtrace();
void lib_x(int i, ...) { lib_do_backtrace(); }


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

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

LLVM IR (-O0):
define void @lib_x(i32 %0, ...) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @lib_do_backtrace()
ret void
}

LLVM IR (-O2):
define void @lib_x(i32 %0, ...) {
%2 = tail call i32 (...) @lib_do_backtrace()
ret void
}
/* Variables and functions */
bool isLeapYear(int year) {
  return ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) ? true
                                                                   : false;
}


x86 assembly (clang, -O0):
<isLeapYear>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1134 <isLeapYear+0x34>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    $0x1,%al
cmp    $0x0,%edx
mov    %al,-0x5(%rbp)
jne    1148 <isLeapYear+0x48>
mov    -0x4(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isLeapYear>:
test   $0x3,%dil
jne    112c <isLeapYear+0x2c>
movslq %edi,%rax
imul   $0x51eb851f,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x25,%rax
add    %ecx,%eax
imul   $0x64,%eax,%ecx
mov    %edi,%edx
mov    $0x1,%eax
sub    %ecx,%edx
je     112c <isLeapYear+0x2c>
ret
imul   $0xc28f5c29,%edi,%ecx
add    $0x51eb850,%ecx
ror    $0x4,%ecx
xor    %eax,%eax
cmp    $0xa3d70b,%ecx
setb   %al
ret

LLVM IR (-O0):
define i32 @isLeapYear(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = srem i32 %3, 4
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %2
%8 = srem i32 %7, 100
%9 = icmp ne i32 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %6, %1
%11 = load i32, i32* %2
%12 = srem i32 %11, 400
%13 = icmp eq i32 %12, 0
br label %14
14: ; preds = %10, %6
%15 = phi i1 [ true, %6 ], [ %13, %10 ]
%16 = zext i1 %15 to i64
%17 = select i1 %15, i32 1, i32 0
ret i32 %17
}

LLVM IR (-O2):
define i32 @isLeapYear(i32 %0) {
%2 = and i32 %0, 3
%3 = icmp ne i32 %2, 0
%4 = srem i32 %0, 100
%5 = icmp eq i32 %4, 0
%6 = or i1 %3, %5
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = srem i32 %0, 400
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %1, %7
%12 = phi i32 [ %10, %7 ], [ 1, %1 ]
ret i32 %12
}
void sigUsr(int signo) { return; }


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ debug_file_size(int /*<<< orphan*/);
void cctools_debug_config_file_size(off_t size) { debug_file_size(size); }


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

x86 assembly (clang, -O2):
<cctools_debug_config_file_size>:
jmp    1030 <debug_file_size@plt>

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

LLVM IR (-O2):
define void @cctools_debug_config_file_size(i32 %0) {
%2 = tail call i32 @debug_file_size(i32 %0)
ret void
}
/* Variables and functions */
char *malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *new_str_copy(char *str) {
  char *p = malloc(strlen(str) + 1);
  strcpy(p, str);
  return p;
}


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

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

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

LLVM IR (-O2):
define i8* @new_str_copy(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = tail call i32 @strcpy(i8* %4, i8* %0)
ret i8* %4
}
/* Variables and functions */
scalar_t__ toupper(char);
char *strupper(char *Str) {
  char *ChPtr;
  for (ChPtr = Str; *ChPtr; ChPtr++)
    *ChPtr = (char)toupper(*ChPtr);
  return (Str);
}


x86 assembly (clang, -O0):
<strupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1156 <strupper+0x46>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <toupper@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <strupper+0x14>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strupper>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%al
test   %al,%al
je     1146 <strupper+0x36>
lea    0x1(%r14),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <toupper@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <strupper+0x20>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @strupper(i8* returned %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %9, %4 ], [ %0, %1 ]
%7 = tail call i64 @toupper(i8 signext %5)
%8 = trunc i64 %7 to i8
store i8 %8, i8* %6
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret i8* %0
}
/* Type definitions */
typedef int /*<<< orphan*/ socklen_t;

/* Variables and functions */
int errno;
int setsockopt(int, int, int, void const *, int /*<<< orphan*/);
int os_setsockopt(int s, int level, int optname, const void *optval,
                  int optlen) {
  int retval;
  retval = setsockopt(s, level, optname, optval, (socklen_t)optlen);
  if (retval == -1)
    retval = -errno;
  return retval;
}


x86 assembly (clang, -O0):
<os_setsockopt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
call   1030 <setsockopt@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0xffffffff,-0x20(%rbp)
jne    115a <os_setsockopt+0x4a>
xor    %eax,%eax
mov    0x2e8b(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<os_setsockopt>:
push   %rax
call   1030 <setsockopt@plt>
mov    0x2ec3(%rip),%rcx
xor    %edx,%edx
sub    (%rcx),%edx
cmp    $0xffffffff,%eax
cmove  %edx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@errno = global i32 0
define i32 @os_setsockopt(i32 %0, i32 %1, i32 %2, i8* %3, i32 %4) {
%6 = tail call i32 @setsockopt(i32 %0, i32 %1, i32 %2, i8* %3, i32 %4)
%7 = icmp eq i32 %6, -1
%8 = load i32, i32* @errno
%9 = sub nsw i32 0, %8
%10 = select i1 %7, i32 %9, i32 %6
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int librlc_rs_decode_cleanup(char *out_data) {
  free(out_data);
  return 0;
}


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

x86 assembly (clang, -O2):
<librlc_rs_decode_cleanup>:
push   %rax
call   1030 <free@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @librlc_rs_decode_cleanup(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret i32 0
}
/* Type definitions */
typedef scalar_t__ clock_t;

/* Variables and functions */
scalar_t__ clock();
void sleep(clock_t wait) {
  clock_t goal;
  goal = wait + clock();
  while (goal > clock())
    ;
}


x86 assembly (clang, -O0):
<sleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <clock@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    $0x0,%al
call   1030 <clock@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
cmp    %rcx,%rax
jle    115d <sleep+0x4d>
jmp    1139 <sleep+0x29>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sleep>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %eax,%eax
call   1030 <clock@plt>
mov    %rax,%rbx
add    %r14,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1030 <clock@plt>
cmp    %rax,%rbx
jg     1130 <sleep+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @sleep(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i64 (...) @clock()
%6 = add nsw i64 %4, %5
store i64 %6, i64* %3
br label %7
7: ; preds = %11, %1
%8 = load i64, i64* %3
%9 = call i64 (...) @clock()
%10 = icmp sgt i64 %8, %9
br i1 %10, label %11, label %12
11: ; preds = %7
br label %7
12: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @sleep(i64 %0) {
%2 = tail call i64 (...) @clock()
%3 = add nsw i64 %2, %0
br label %4
4: ; preds = %4, %1
%5 = tail call i64 (...) @clock()
%6 = icmp sgt i64 %3, %5
br i1 %6, label %4, label %7
7: ; preds = %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, size_t, char *, long long);
void formatInt64(char *buffer, size_t size, char *format, long long v) {
  snprintf(buffer, size, format, v);
}


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

x86 assembly (clang, -O2):
<formatInt64>:
jmp    1030 <snprintf@plt>

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

LLVM IR (-O2):
define void @formatInt64(i8* %0, i64 %1, i8* %2, i64 %3) {
%5 = tail call i32 @snprintf(i8* %0, i64 %1, i8* %2, i64 %3)
ret void
}
int quit() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @quit() {
ret i32 0
}
long long usuz() { return 0x7fffffff7fff0000LL; }


x86 assembly (clang, -O0):
<usuz>:
push   %rbp
mov    %rsp,%rbp
movabs $0x7fffffff7fff0000,%rax
ff ff 7f
pop    %rbp
ret

x86 assembly (clang, -O2):
<usuz>:
movabs $0x7fffffff7fff0000,%rax
ff ff 7f
ret

LLVM IR (-O0):
define i64 @usuz() {
ret i64 9223372034707226624
}

LLVM IR (-O2):
define i64 @usuz() {
ret i64 9223372034707226624
}
void gtk_widget_get_default_style() {}


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

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

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

LLVM IR (-O2):
define void @gtk_widget_get_default_style() {
ret void
}
double foo(double x, double y) { return x + y + 3; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  0xee0(%rip),%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
addsd  %xmm1,%xmm0
addsd  0xef4(%rip),%xmm0
ret

LLVM IR (-O0):
define double @foo(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 = load double, double* %4
%7 = fadd double %5, %6
%8 = fadd double %7, 3.000000e+00
ret double %8
}

LLVM IR (-O2):
define double @foo(double %0, double %1) {
%3 = fadd double %0, %1
%4 = fadd double %3, 3.000000e+00
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ ERA_D_T_FMT;
char *nl_langinfo(int /*<<< orphan*/);
char *langinfo_era_d_t_fmt() { return nl_langinfo(ERA_D_T_FMT); }


x86 assembly (clang, -O0):
<langinfo_era_d_t_fmt>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <nl_langinfo@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<langinfo_era_d_t_fmt>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <nl_langinfo@plt>

LLVM IR (-O0):
@ERA_D_T_FMT = global i32 0
define i8* @langinfo_era_d_t_fmt() {
%1 = load i32, i32* @ERA_D_T_FMT
%2 = call i8* @nl_langinfo(i32 %1)
ret i8* %2
}

LLVM IR (-O2):
@ERA_D_T_FMT = global i32 0
define i8* @langinfo_era_d_t_fmt() {
%1 = load i32, i32* @ERA_D_T_FMT
%2 = tail call i8* @nl_langinfo(i32 %1)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, float);
int main(void) {
  int F = 27;
  float C;
  C = (F - 32) / 1.8;
  printf("%i in Fahrenheit (F) is %f in Celsius (C)\n", F, C);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1b,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x20,%eax
cvtsi2sd %eax,%xmm0
movsd  0xec8(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%esi
movss  -0xc(%rbp),%xmm0
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeec(%rip),%rdi
movss  0xee0(%rip),%xmm0
mov    $0x1b,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [43 x i8] c"%i in Fahrenheit (F) is %f in Celsius (C)\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
store i32 0, i32* %1
store i32 27, i32* %2
%4 = load i32, i32* %2
%5 = sub nsw i32 %4, 32
%6 = sitofp i32 %5 to double
%7 = fdiv double %6, 1.800000e+00
%8 = fptrunc double %7 to float
store float %8, float* %3
%9 = load i32, i32* %2
%10 = load float, float* %3
%11 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 %9, float %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [43 x i8] c"%i in Fahrenheit (F) is %f in Celsius (C)\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 27, float 0xC00638E380000000)
ret i32 0
}
void gdb_recursion_test(int depth, int q1, int q2, int q3, int q4, int q5,
                        int q6) {
  int q = q1;
  q1 = q2;
  q2 = q3;
  q3 = q4;
  q4 = q5;
  q5 = q6;
  q6 = q;
  if (depth--)
    gdb_recursion_test(depth, q1, q2, q3, q4, q5, q6);
}


x86 assembly (clang, -O0):
<gdb_recursion_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
je     118c <gdb_recursion_test+0x7c>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    -0x18(%rbp),%r9d
mov    0x10(%rbp),%eax
mov    %eax,(%rsp)
call   1030 <gdb_recursion_test@plt>
add    $0x30,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @gdb_recursion_test(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
ret void
}
/* Variables and functions */
size_t reqbufalign(char *devpath) { return 0; }


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

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

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

LLVM IR (-O2):
define i64 @reqbufalign(i8* nocapture readnone %0) {
ret i64 0
}
void test(int a) {
  if (a > 0) {
    int b = a;
    b++;
  } else {
    int c = a;
    c--;
  }
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1125 <test+0x25>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1134 <test+0x34>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @test(i32 %0) {
ret void
}
int compare_double(const void *a, const void *b) {
  const double *da = (const double *)a;
  const double *db = (const double *)b;
  if (*da < *db)
    return 1;
  if (*da > *db)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<compare_double>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
jbe    1142 <compare_double+0x42>
movl   $0x1,-0x4(%rbp)
jmp    116b <compare_double+0x6b>
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x28(%rbp),%rax
ucomisd (%rax),%xmm0
jbe    1164 <compare_double+0x64>
movl   $0xffffffff,-0x4(%rbp)
jmp    116b <compare_double+0x6b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_double>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
xor    %ecx,%ecx
ucomisd %xmm1,%xmm0
seta   %cl
neg    %ecx
ucomisd %xmm0,%xmm1
mov    $0x1,%eax
cmovbe %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @compare_double(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = bitcast i8* %1 to double*
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp olt double %5, %6
%8 = fcmp ogt double %5, %6
%9 = sext i1 %8 to i32
%10 = select i1 %7, i32 1, i32 %9
ret i32 %10
}
void yy_1_MagicWordAutoCorrect(char *yytext, int yyleng) {
  ;
  ;
}


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

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

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

LLVM IR (-O2):
define void @yy_1_MagicWordAutoCorrect(i8* nocapture %0, i32 %1) {
ret void
}
void av_file_unmap() {}


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

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

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

LLVM IR (-O2):
define void @av_file_unmap() {
ret void
}
/* Variables and functions */
unsigned int to_lower(unsigned int);
bool is_upper(unsigned int ch) { return (to_lower(ch) != ch); }


x86 assembly (clang, -O0):
<is_upper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <to_lower@plt>
cmp    -0x4(%rbp),%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_upper>:
push   %rbx
mov    %edi,%ebx
call   1030 <to_lower@plt>
xor    %ecx,%ecx
cmp    %ebx,%eax
setne  %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @is_upper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @to_lower(i32 %3)
%5 = load i32, i32* %2
%6 = icmp ne i32 %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @is_upper(i32 %0) {
%2 = tail call i32 @to_lower(i32 %0)
%3 = icmp ne i32 %2, %0
%4 = zext i1 %3 to i32
ret i32 %4
}
int test_imm_0Aint16_mem(short *val) {
  return ((*val) & (0x0A << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_0Aint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%edx
and    $0xa,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_0Aint16_mem>:
testb  $0xa,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_0Aint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 10
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int lw_sock_connect(int *sock, char *ip, int port) { return 0; }


x86 assembly (clang, -O0):
<lw_sock_connect>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @lw_sock_connect(i32* %0, i8* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i32
store i32* %0, i32** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
ret i32 0
}

LLVM IR (-O2):
define i32 @lw_sock_connect(i32* nocapture readnone %0, i8* nocapture readnone %1, i32 %2) {
ret i32 0
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
int S_ISDIR(int /*<<< orphan*/);
scalar_t__ stat(char const *, struct stat *);
int is_dir(const char *path) {
  struct stat buf;
  if (stat(path, &buf))
    return (0);
  return (S_ISDIR(buf.st_mode));
}


x86 assembly (clang, -O0):
<is_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <stat@plt>
cmp    $0x0,%rax
je     114f <is_dir+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    115a <is_dir+0x3a>
mov    -0x18(%rbp),%edi
call   1030 <S_ISDIR@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_dir>:
push   %rax
mov    %rsp,%rsi
call   1040 <stat@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     1135 <is_dir+0x15>
pop    %rcx
ret
mov    (%rsp),%edi
call   1030 <S_ISDIR@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @is_dir(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @stat(i8* %5, %struct.stat* %4)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 0, i32* %2
br label %13
9: ; preds = %1
%10 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%11 = load i32, i32* %10
%12 = call i32 @S_ISDIR(i32 %11)
store i32 %12, i32* %2
br label %13
13: ; preds = %9, %8
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @is_dir(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = call i32 @S_ISDIR(i32 %8)
br label %10
10: ; preds = %1, %6
%11 = phi i32 [ %9, %6 ], [ 0, %1 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ copystring(char *);
int /*<<< orphan*/ test(char *, int);
int /*<<< orphan*/ test2(int /*<<< orphan*/, int);
int /*<<< orphan*/ test3(int, char *);
int f(char *name) {
  test(name, f(name));
  test3(f(name), name);
  test2(copystring(name), f(name));
  return 3;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <f@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1070 <test@plt>
mov    -0x8(%rbp),%rdi
call   1040 <f@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%rsi
call   1030 <test3@plt>
mov    -0x8(%rbp),%rdi
call   1050 <copystring@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <f@plt>
mov    -0xc(%rbp),%edi
mov    %eax,%esi
call   1060 <test2@plt>
mov    $0x3,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <f@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
call   1070 <test@plt>
mov    %rbx,%rdi
call   1040 <f@plt>
mov    $0x3,%edi
mov    %rbx,%rsi
call   1030 <test3@plt>
mov    %rbx,%rdi
call   1050 <copystring@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <f@plt>
mov    %ebp,%edi
mov    $0x3,%esi
call   1060 <test2@plt>
mov    $0x3,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @f(i8* %4)
%6 = call i32 @test(i8* %3, i32 %5)
%7 = load i8*, i8** %2
%8 = call i32 @f(i8* %7)
%9 = load i8*, i8** %2
%10 = call i32 @test3(i32 %8, i8* %9)
%11 = load i8*, i8** %2
%12 = call i32 @copystring(i8* %11)
%13 = load i8*, i8** %2
%14 = call i32 @f(i8* %13)
%15 = call i32 @test2(i32 %12, i32 %14)
ret i32 3
}

LLVM IR (-O2):
define i32 @f(i8* %0) {
%2 = tail call i32 @f(i8* %0)
%3 = tail call i32 @test(i8* %0, i32 3)
%4 = tail call i32 @f(i8* %0)
%5 = tail call i32 @test3(i32 3, i8* %0)
%6 = tail call i32 @copystring(i8* %0)
%7 = tail call i32 @f(i8* %0)
%8 = tail call i32 @test2(i32 %6, i32 3)
ret i32 3
}
/* Variables and functions */
int /*<<< orphan*/ _I8080_CALL();
void do0xDD() { _I8080_CALL(); }


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

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

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

LLVM IR (-O2):
define void @do0xDD() {
%1 = tail call i32 (...) @_I8080_CALL()
ret void
}
int test_imm_28int8_reg(signed char val) {
  return ((val) & (0x28 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_28int8_reg(i8 signext %0) {
%2 = and i8 %0, 40
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int cost(int x, int l) { return (l - x) * (l - x); }


x86 assembly (clang, -O0):
<cost>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
imul   %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cost>:
mov    %esi,%eax
sub    %edi,%eax
imul   %eax,%eax
ret

LLVM IR (-O0):
define i32 @cost(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 = sub nsw i32 %5, %6
%8 = load i32, i32* %4
%9 = load i32, i32* %3
%10 = sub nsw i32 %8, %9
%11 = mul nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @cost(i32 %0, i32 %1) {
%3 = sub nsw i32 %1, %0
%4 = mul nsw i32 %3, %3
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ const uint8_t;

/* Variables and functions */
int /*<<< orphan*/ h264avcc_get_nb_sps(int /*<<< orphan*/ const *);
int /*<<< orphan*/ const *h264avcc_get_spsh(int /*<<< orphan*/ const *,
                                            int /*<<< orphan*/);
uint8_t h264avcc_get_nb_pps(const uint8_t *p) {
  p = h264avcc_get_spsh(p, h264avcc_get_nb_sps(p));
  return p[0];
}


x86 assembly (clang, -O0):
<h264avcc_get_nb_pps>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <h264avcc_get_nb_sps@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1030 <h264avcc_get_spsh@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<h264avcc_get_nb_pps>:
push   %rbx
mov    %rdi,%rbx
call   1040 <h264avcc_get_nb_sps@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <h264avcc_get_spsh@plt>
mov    (%rax),%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @h264avcc_get_nb_pps(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @h264avcc_get_nb_sps(i32* %4)
%6 = call i32* @h264avcc_get_spsh(i32* %3, i32 %5)
store i32* %6, i32** %2
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 0
%9 = load i32, i32* %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @h264avcc_get_nb_pps(i32* %0) {
%2 = tail call i32 @h264avcc_get_nb_sps(i32* %0)
%3 = tail call i32* @h264avcc_get_spsh(i32* %0, i32 %2)
%4 = load i32, i32* %3
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ GLfloat;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
void matrix_copy(GLfloat cp[], GLfloat m[]) {
  memcpy(cp, m, sizeof(GLfloat) * 16);
}


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

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

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

LLVM IR (-O2):
define void @matrix_copy(i32* %0, i32* %1) {
%3 = tail call i32 @memcpy(i32* %0, i32* %1, i32 64)
ret void
}
void foo538(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo538(i32 %0) {
ret void
}
/* Type definitions */
typedef scalar_t__ time_t;

/* Variables and functions */
double difftime(time_t time1, time_t time0) {
  return (double)time1 - (double)time0;
}


x86 assembly (clang, -O0):
<difftime>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cvtsi2sdq -0x8(%rbp),%xmm0
cvtsi2sdq -0x10(%rbp),%xmm1
subsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<difftime>:
cvtsi2sd %rdi,%xmm0
cvtsi2sd %rsi,%xmm1
subsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @difftime(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = sitofp i64 %5 to double
%7 = load i64, i64* %4
%8 = sitofp i64 %7 to double
%9 = fsub double %6, %8
ret double %9
}

LLVM IR (-O2):
define double @difftime(i64 %0, i64 %1) {
%3 = sitofp i64 %0 to double
%4 = sitofp i64 %1 to double
%5 = fsub double %3, %4
ret double %5
}
unsigned long __attribute__((nonnull(1))) a_strhash(const unsigned char *str) {
  unsigned long hash = 5381;
  int c;
  while ((c = *str++))
    hash = ((hash << 5) + hash) + c;
  return hash;
}


x86 assembly (clang, -O0):
<a_strhash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1505,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     114a <a_strhash+0x4a>
mov    -0x10(%rbp),%rax
shl    $0x5,%rax
add    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <a_strhash+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<a_strhash>:
mov    (%rdi),%cl
test   %cl,%cl
je     112c <a_strhash+0x2c>
add    $0x1,%rdi
mov    $0x1505,%eax
nop
mov    %rax,%rdx
shl    $0x5,%rdx
add    %rax,%rdx
movzbl %cl,%eax
add    %rdx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <a_strhash+0x10>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i64 @a_strhash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = phi i64 [ %11, %4 ], [ 5381, %1 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = mul i64 %7, 33
%10 = zext i8 %5 to i64
%11 = add i64 %9, %10
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i64 [ 5381, %1 ], [ %11, %4 ]
ret i64 %15
}
/* Variables and functions */
int /*<<< orphan*/ mock_push(int /*<<< orphan*/);
int /*<<< orphan*/ pack_glXRenderLarge(int /*<<< orphan*/ *);
void glXRenderLarge() {
  { mock_push(pack_glXRenderLarge(NULL)); };
}


x86 assembly (clang, -O0):
<glXRenderLarge>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <pack_glXRenderLarge@plt>
mov    %eax,%edi
call   1030 <mock_push@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<glXRenderLarge>:
push   %rax
xor    %edi,%edi
call   1040 <pack_glXRenderLarge@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <mock_push@plt>

LLVM IR (-O0):
define void @glXRenderLarge() {
%1 = call i32 @pack_glXRenderLarge(i32* null)
%2 = call i32 @mock_push(i32 %1)
ret void
}

LLVM IR (-O2):
define void @glXRenderLarge() {
%1 = tail call i32 @pack_glXRenderLarge(i32* null)
%2 = tail call i32 @mock_push(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
scalar_t__ calloc(int, long);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, long);
int /*<<< orphan*/ stderr;
int *ivec_new_0(long n) {
  int *ret = (int *)calloc(sizeof(*ret), n);
  if (!ret) {
    fprintf(stderr, "ivec_new_0 %ld : out of memory\n", n);
    abort();
  }
  return ret;
}


x86 assembly (clang, -O0):
<ivec_new_0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0x4,%edi
call   1040 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1179 <ivec_new_0+0x49>
mov    0x2e80(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe93(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ivec_new_0>:
push   %rbx
mov    %rdi,%rbx
mov    $0x4,%edi
mov    %rbx,%rsi
call   1040 <calloc@plt>
test   %rax,%rax
je     1148 <ivec_new_0+0x18>
pop    %rbx
ret
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
lea    0xea8(%rip),%rsi
mov    %rbx,%rdx
call   1050 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [32 x i8] c"ivec_new_0 %ld : out of memory\0A\00"
define i32* @ivec_new_0(i64 %0) {
%2 = alloca i64
%3 = alloca i32*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i64 @calloc(i32 4, i64 %4)
%6 = inttoptr i64 %5 to i32*
store i32* %6, i32** %3
%7 = load i32*, i32** %3
%8 = icmp ne i32* %7, null
br i1 %8, label %14, label %9
9: ; preds = %1
%10 = load i32, i32* @stderr
%11 = load i64, i64* %2
%12 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i64 %11)
%13 = call i32 (...) @abort()
unreachable
14: ; preds = %1
%15 = load i32*, i32** %3
ret i32* %15
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [32 x i8] c"ivec_new_0 %ld : out of memory\0A\00"
define i32* @ivec_new_0(i64 %0) {
%2 = tail call i64 @calloc(i32 4, i64 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i64 %0)
%7 = tail call i32 (...) @abort()
unreachable
8: ; preds = %1
%9 = inttoptr i64 %2 to i32*
ret i32* %9
}
void poke(char value, short int seg, short int offset) {}


x86 assembly (clang, -O0):
<poke>:
push   %rbp
mov    %rsp,%rbp
mov    %dx,%ax
mov    %si,%cx
mov    %dil,%dl
mov    %dl,-0x1(%rbp)
mov    %cx,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @poke(i8 signext %0, i16 signext %1, i16 signext %2) {
%4 = alloca i8
%5 = alloca i16
%6 = alloca i16
store i8 %0, i8* %4
store i16 %1, i16* %5
store i16 %2, i16* %6
ret void
}

LLVM IR (-O2):
define void @poke(i8 signext %0, i16 signext %1, i16 signext %2) {
ret void
}
/* Variables and functions */
int *find(int *haystack, int size, int needle) { return NULL; }


x86 assembly (clang, -O0):
<find>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32* @find(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
ret i32* null
}

LLVM IR (-O2):
define noalias i32* @find(i32* nocapture readnone %0, i32 %1, i32 %2) {
ret i32* null
}