xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ chdir(char *);
int errno;
int internal_cd(int argc, char **argv) {
  if (!chdir(argv[1] ? argv[1] : "/"))
    return 0;
  return errno;
}


x86 assembly (clang, -O0):
<internal_cd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,0x8(%rax)
je     113f <internal_cd+0x2f>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
jmp    114f <internal_cd+0x3f>
lea    0xeba(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    114f <internal_cd+0x3f>
mov    -0x18(%rbp),%rdi
call   1030 <chdir@plt>
cmp    $0x0,%eax
jne    116d <internal_cd+0x5d>
movl   $0x0,-0x4(%rbp)
jmp    1179 <internal_cd+0x69>
mov    0x2e6c(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<internal_cd>:
push   %rax
mov    0x8(%rsi),%rax
test   %rax,%rax
lea    0xee1(%rip),%rdi
cmovne %rax,%rdi
call   1030 <chdir@plt>
test   %eax,%eax
je     1135 <internal_cd+0x25>
mov    0x2ead(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"/\00"
@errno = global i32 0
define i32 @internal_cd(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = load i8*, i8** %7
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %14
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
br label %15
14: ; preds = %2
br label %15
15: ; preds = %14, %10
%16 = phi i8* [ %13, %10 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), %14 ]
%17 = call i32 @chdir(i8* %16)
%18 = icmp ne i32 %17, 0
br i1 %18, label %20, label %19
19: ; preds = %15
store i32 0, i32* %3
br label %22
20: ; preds = %15
%21 = load i32, i32* @errno
store i32 %21, i32* %3
br label %22
22: ; preds = %20, %19
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
@.str = [2 x i8] c"/\00"
@errno = global i32 0
define i32 @internal_cd(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = icmp eq i8* %4, null
%6 = select i1 %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* %4
%7 = tail call i32 @chdir(i8* %6)
%8 = icmp eq i32 %7, 0
%9 = load i32, i32* @errno
%10 = select i1 %8, i32 0, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ pstrcpy(char *, int, char const *);
scalar_t__ strlen(char *);
char *pstrcat(char *buf, int buf_size, const char *s) {
  int len;
  len = (int)strlen(buf);
  if (len < buf_size)
    pstrcpy(buf + len, buf_size - len, s);
  return buf;
}


x86 assembly (clang, -O0):
<pstrcat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1165 <pstrcat+0x45>
mov    -0x8(%rbp),%rdi
movslq -0x1c(%rbp),%rax
add    %rax,%rdi
mov    -0xc(%rbp),%esi
sub    -0x1c(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <pstrcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pstrcat>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %esi,%ebp
mov    %rdi,%rbx
call   1040 <strlen@plt>
cmp    %ebp,%eax
jge    1147 <pstrcat+0x27>
movslq %eax,%rdi
add    %rbx,%rdi
sub    %eax,%ebp
mov    %ebp,%esi
mov    %r14,%rdx
call   1030 <pstrcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @pstrcat(i8* returned %0, i32 %1, i8* %2) {
%4 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%5 = trunc i64 %4 to i32
%6 = icmp slt i32 %5, %1
br i1 %6, label %7, label %13
7: ; preds = %3
%8 = shl i64 %4, 32
%9 = ashr exact i64 %8, 32
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = sub nsw i32 %1, %5
%12 = tail call i32 @pstrcpy(i8* %10, i32 %11, i8* %2)
br label %13
13: ; preds = %7, %3
ret i8* %0
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int random();
void randaddr(uint8_t *addr) {
  int *r1 = (int *)addr;
  int r2 = random();
  *r1 = random();
  addr[0] <<= 1;
  addr[4] = r2 >> 8;
  addr[5] = r2;
}


x86 assembly (clang, -O0):
<randaddr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <random@plt>
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1030 <random@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
shl    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x14(%rbp),%ecx
sar    $0x8,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x10(%rax)
mov    -0x14(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x14(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randaddr>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <random@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1030 <random@plt>
add    %eax,%eax
mov    %eax,(%rbx)
mov    %ebp,%eax
sar    $0x8,%eax
mov    %eax,0x10(%rbx)
mov    %ebp,0x14(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @randaddr(i32* %0) {
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
store i32* %5, i32** %3
%6 = call i32 (...) @random()
store i32 %6, i32* %4
%7 = call i32 (...) @random()
%8 = load i32*, i32** %3
store i32 %7, i32* %8
%9 = load i32*, i32** %2
%10 = getelementptr inbounds i32, i32* %9, i64 0
%11 = load i32, i32* %10
%12 = shl i32 %11, 1
store i32 %12, i32* %10
%13 = load i32, i32* %4
%14 = ashr i32 %13, 8
%15 = load i32*, i32** %2
%16 = getelementptr inbounds i32, i32* %15, i64 4
store i32 %14, i32* %16
%17 = load i32, i32* %4
%18 = load i32*, i32** %2
%19 = getelementptr inbounds i32, i32* %18, i64 5
store i32 %17, i32* %19
ret void
}

LLVM IR (-O2):
define void @randaddr(i32* nocapture writeonly %0) {
%2 = tail call i32 (...) @random()
%3 = tail call i32 (...) @random()
%4 = shl i32 %3, 1
store i32 %4, i32* %0
%5 = ashr i32 %2, 8
%6 = getelementptr inbounds i32, i32* %0, i64 4
store i32 %5, i32* %6
%7 = getelementptr inbounds i32, i32* %0, i64 5
store i32 %2, i32* %7
ret void
}
int test_imm_16uint64_lowword_reg(unsigned long long val) {
  return ((val) & (0x16 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_16uint64_lowword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
and    $0x16,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_16uint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 22
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int port_io_read_byte(int);
int /*<<< orphan*/ port_io_write_byte(int, short const);
int _vga_get_cursor_position_offset(void) {
  const short CURSOR_POSITION_HIGH_BYTE_REGISTER = 14;
  const short CURSOR_POSITION_LOW_BYTE_REGISTER = 15;
  int offset = 0;
  port_io_write_byte(0x3D4, CURSOR_POSITION_HIGH_BYTE_REGISTER);
  offset = port_io_read_byte(0x3D5) << 8;
  port_io_write_byte(0x3D4, CURSOR_POSITION_LOW_BYTE_REGISTER);
  offset += port_io_read_byte(0x3D5);
  return offset * 2;
}


x86 assembly (clang, -O0):
<_vga_get_cursor_position_offset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movw   $0xe,-0x2(%rbp)
movw   $0xf,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x3d4,%edi
mov    $0xe,%esi
call   1040 <port_io_write_byte@plt>
mov    $0x3d5,%edi
call   1030 <port_io_read_byte@plt>
shl    $0x8,%eax
mov    %eax,-0x8(%rbp)
mov    $0x3d4,%edi
mov    $0xf,%esi
call   1040 <port_io_write_byte@plt>
mov    $0x3d5,%edi
call   1030 <port_io_read_byte@plt>
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_vga_get_cursor_position_offset>:
push   %rbx
mov    $0x3d4,%edi
mov    $0xe,%esi
call   1040 <port_io_write_byte@plt>
mov    $0x3d5,%edi
call   1030 <port_io_read_byte@plt>
mov    %eax,%ebx
shl    $0x8,%ebx
mov    $0x3d4,%edi
mov    $0xf,%esi
call   1040 <port_io_write_byte@plt>
mov    $0x3d5,%edi
call   1030 <port_io_read_byte@plt>
add    %ebx,%eax
add    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @_vga_get_cursor_position_offset() {
%1 = alloca i16
%2 = alloca i16
%3 = alloca i32
store i16 14, i16* %1
store i16 15, i16* %2
store i32 0, i32* %3
%4 = call i32 @port_io_write_byte(i32 980, i16 signext 14)
%5 = call i32 @port_io_read_byte(i32 981)
%6 = shl i32 %5, 8
store i32 %6, i32* %3
%7 = call i32 @port_io_write_byte(i32 980, i16 signext 15)
%8 = call i32 @port_io_read_byte(i32 981)
%9 = load i32, i32* %3
%10 = add nsw i32 %9, %8
store i32 %10, i32* %3
%11 = load i32, i32* %3
%12 = mul nsw i32 %11, 2
ret i32 %12
}

LLVM IR (-O2):
define i32 @_vga_get_cursor_position_offset() {
%1 = tail call i32 @port_io_write_byte(i32 980, i16 signext 14)
%2 = tail call i32 @port_io_read_byte(i32 981)
%3 = shl i32 %2, 8
%4 = tail call i32 @port_io_write_byte(i32 980, i16 signext 15)
%5 = tail call i32 @port_io_read_byte(i32 981)
%6 = add nsw i32 %5, %3
%7 = shl nsw i32 %6, 1
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Een tab is \\t\n");
  printf("Een backspace is \\b\n");
  printf("Een quote is \\\"\n");
  printf("Een backslash is \\\\\n");
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xeea(%rip),%rdi
call   1030 <puts@plt>
lea    0xef2(%rip),%rdi
call   1030 <puts@plt>
lea    0xef6(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Een tab is \\t\0A\00"
@.str.1 = [21 x i8] c"Een backspace is \\b\0A\00"
@.str.2 = [17 x i8] c"Een quote is \\\22\0A\00"
@.str.3 = [21 x i8] c"Een backslash is \\\\\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [14 x i8] c"Een tab is \\t\00"
@str.4 = [20 x i8] c"Een backspace is \\b\00"
@str.5 = [16 x i8] c"Een quote is \\\22\00"
@str.6 = [20 x i8] c"Een backslash is \\\\\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.6, i64 0, i64 0))
ret i32 0
}
char nibble_to_char(int nibble) {
  static char map[] = {'0', '1', '2', '3', '4', '5', '6', '7',
                       '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'};
  return map[nibble];
}


x86 assembly (clang, -O0):
<nibble_to_char>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rcx
lea    0x2f1e(%rip),%rax
movsbl (%rax,%rcx,1),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nibble_to_char>:
movslq %edi,%rax
lea    0xef6(%rip),%rcx
mov    (%rax,%rcx,1),%al
ret

LLVM IR (-O0):
@nibble_to_char.map = internal global [16 x i8] c"0123456789ABCDEF"
define signext i8 @nibble_to_char(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds [16 x i8], [16 x i8]* @nibble_to_char.map, i64 0, i64 %4
%6 = load i8, i8* %5
ret i8 %6
}

LLVM IR (-O2):
@nibble_to_char.map = internal unnamed_addr constant [16 x i8] c"0123456789ABCDEF"
define signext i8 @nibble_to_char(i32 %0) {
%2 = sext i32 %0 to i64
%3 = getelementptr inbounds [16 x i8], [16 x i8]* @nibble_to_char.map, i64 0, i64 %2
%4 = load i8, i8* %3
ret i8 %4
}
void gdk_region_equal() {}


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

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

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

LLVM IR (-O2):
define void @gdk_region_equal() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
double pn_double(double f) {
  printf("%f\n", f);
  return f;
}


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

x86 assembly (clang, -O2):
<pn_double>:
push   %rax
movsd  %xmm0,(%rsp)
lea    0xee3(%rip),%rdi
call   1030 <printf@plt>
movsd  (%rsp),%xmm0
pop    %rax
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%f\0A\00"
define double @pn_double(double returned %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %0)
ret double %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void PrintUsage(void) {
  printf("zSkeleton v.%i by Alex Darby\n based on smd2md4 v.%i by Gongo\n"
         "usage: zSkeleton <configName.cfg> [options]\n"
         "options:\n"
         "  --help,-h,-?    this help message\n",
         1, 10);
}


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

x86 assembly (clang, -O2):
<PrintUsage>:
lea    0xee9(%rip),%rdi
mov    $0x1,%esi
mov    $0xa,%edx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [151 x i8] c"zSkeleton v.%i by Alex Darby\0A based on smd2md4 v.%i by Gongo\0Ausage: zSkeleton <configName.cfg> [options]\0Aoptions:\0A --help,-h,-? this help message\0A\00"
define void @PrintUsage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([151 x i8], [151 x i8]* @.str, i64 0, i64 0), i32 1, i32 10)
ret void
}

LLVM IR (-O2):
@.str = [151 x i8] c"zSkeleton v.%i by Alex Darby\0A based on smd2md4 v.%i by Gongo\0Ausage: zSkeleton <configName.cfg> [options]\0Aoptions:\0A --help,-h,-? this help message\0A\00"
define void @PrintUsage() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([151 x i8], [151 x i8]* @.str, i64 0, i64 0), i32 1, i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int main() {
  float num = 11.0309f;
  printf("%2.4f\n", num);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xed9(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
lea    0xecc(%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
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"%2.4f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), float 0x40260FD220000000)
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t op_mod(uint32_t a, uint32_t b) { return a % b; }


x86 assembly (clang, -O0):
<op_mod>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_mod>:
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @op_mod(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 = srem i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @op_mod(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
ret i32 %3
}
/* Variables and functions */
unsigned long long tsc();
unsigned long long tsc_timer_(void) { return tsc(); }


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

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

LLVM IR (-O0):
define i64 @tsc_timer_() {
%1 = call i64 (...) @tsc()
ret i64 %1
}

LLVM IR (-O2):
define i64 @tsc_timer_() {
%1 = tail call i64 (...) @tsc()
ret i64 %1
}
/* Variables and functions */
int /*<<< orphan*/ grecs_line_acc_grow_char(int /*<<< orphan*/);
int /*<<< orphan*/ wordsplit_c_unquote_char(int);
void grecs_line_acc_grow_char_unescape(int c) {
  if (c != '\n')
    grecs_line_acc_grow_char(wordsplit_c_unquote_char(c));
}


x86 assembly (clang, -O0):
<grecs_line_acc_grow_char_unescape>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
je     1144 <grecs_line_acc_grow_char_unescape+0x24>
mov    -0x4(%rbp),%edi
call   1030 <wordsplit_c_unquote_char@plt>
mov    %eax,%edi
call   1040 <grecs_line_acc_grow_char@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<grecs_line_acc_grow_char_unescape>:
cmp    $0xa,%edi
jne    1126 <grecs_line_acc_grow_char_unescape+0x6>
ret
push   %rax
call   1030 <wordsplit_c_unquote_char@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <grecs_line_acc_grow_char@plt>

LLVM IR (-O0):
define void @grecs_line_acc_grow_char_unescape(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 10
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32, i32* %2
%7 = call i32 @wordsplit_c_unquote_char(i32 %6)
%8 = call i32 @grecs_line_acc_grow_char(i32 %7)
br label %9
9: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @grecs_line_acc_grow_char_unescape(i32 %0) {
%2 = icmp eq i32 %0, 10
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 @wordsplit_c_unquote_char(i32 %0)
%5 = tail call i32 @grecs_line_acc_grow_char(i32 %4)
br label %6
6: ; preds = %3, %1
ret void
}
int main() {
  unsigned char arg = 0x1;
  unsigned char out = 0;
  __asm__("rorb $1, %%al;" : "=a"(out) : "a"(arg));
  return (out == 0x80);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movb   $0x1,-0x5(%rbp)
movb   $0x0,-0x6(%rbp)
mov    -0x5(%rbp),%al
ror    %al
mov    %al,-0x6(%rbp)
movzbl -0x6(%rbp),%eax
cmp    $0x80,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x1,%al
ror    %al
xor    %ecx,%ecx
cmp    $0x80,%al
sete   %cl
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8
store i32 0, i32* %1
store i8 1, i8* %2
store i8 0, i8* %3
%4 = load i8, i8* %2
%5 = call i8 asm "rorb $$1, %al;", "={ax},{ax},~{dirflag},~{fpsr},~{flags}"(i8 %4)
store i8 %5, i8* %3
%6 = load i8, i8* %3
%7 = zext i8 %6 to i32
%8 = icmp eq i32 %7, 128
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i8 asm "rorb $$1, %al;", "={ax},{ax},~{dirflag},~{fpsr},~{flags}"(i8 1)
%2 = icmp eq i8 %1, -128
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
long umfpack_zi_scale(double *, double *, double *, double *, void *);
void umf4zscal_(double x[], double xz[], double b[], double bz[],
                void **Numeric, long *status) {
  *status = umfpack_zi_scale(x, xz, b, bz, *Numeric);
}


x86 assembly (clang, -O0):
<umf4zscal_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%rax
mov    (%rax),%r8
call   1030 <umfpack_zi_scale@plt>
mov    %rax,%rcx
mov    -0x30(%rbp),%rax
mov    %rcx,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<umf4zscal_>:
push   %rbx
mov    %r9,%rbx
mov    (%r8),%r8
call   1030 <umfpack_zi_scale@plt>
mov    %rax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @umf4zscal_(double* %0, double* %1, double* %2, double* %3, i8** %4, i64* %5) {
%7 = alloca double*
%8 = alloca double*
%9 = alloca double*
%10 = alloca double*
%11 = alloca i8**
%12 = alloca i64*
store double* %0, double** %7
store double* %1, double** %8
store double* %2, double** %9
store double* %3, double** %10
store i8** %4, i8*** %11
store i64* %5, i64** %12
%13 = load double*, double** %7
%14 = load double*, double** %8
%15 = load double*, double** %9
%16 = load double*, double** %10
%17 = load i8**, i8*** %11
%18 = load i8*, i8** %17
%19 = call i64 @umfpack_zi_scale(double* %13, double* %14, double* %15, double* %16, i8* %18)
%20 = load i64*, i64** %12
store i64 %19, i64* %20
ret void
}

LLVM IR (-O2):
define void @umf4zscal_(double* %0, double* %1, double* %2, double* %3, i8** nocapture %4, i64* nocapture writeonly %5) {
%7 = load i8*, i8** %4
%8 = tail call i64 @umfpack_zi_scale(double* %0, double* %1, double* %2, double* %3, i8* %7)
store i64 %8, i64* %5
ret void
}
void set_eflags(unsigned long eflags) {
  asm volatile("subq $128, %%rsp\n\t"
               "pushq %0\n\t"
               "popfq\n\t"
               "addq $128, %%rsp" ::"r"(eflags)
               : "flags", "memory");
}


x86 assembly (clang, -O0):
<set_eflags>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
sub    $0x80,%rsp
push   %rax
popf
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_eflags>:
sub    $0x80,%rsp
push   %rdi
popf
add    $0x80,%rsp
ret

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

LLVM IR (-O2):
define void @set_eflags(i64 %0) {
tail call void asm sideeffect "subq $$128, %rsp\0A\09pushq $0\0A\09popfq\0A\09addq $$128, %rsp", "r,~{flags},~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  printf("%s\n", -2 < -2 ? "a" : "b");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xee5(%rip),%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [2 x i8] c"b\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct stat {
  int st_mtime;
};

/* Variables and functions */
scalar_t__ stat(char const *, struct stat *);
unsigned mtime(const char *path) {
  struct stat s;
  if (stat(path, &s) == 0) {
    return s.st_mtime;
  }
  return 0;
}


x86 assembly (clang, -O0):
<mtime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
jne    113e <mtime+0x2e>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1145 <mtime+0x35>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mtime>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
jne    1126 <mtime+0x16>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @mtime(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 eq i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%10 = load i32, i32* %9
store i32 %10, i32* %2
br label %12
11: ; preds = %1
store i32 0, i32* %2
br label %12
12: ; preds = %11, %8
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @mtime(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
%6 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%7 = load i32, i32* %6
%8 = select i1 %5, i32 %7, i32 0
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void thread_kill() { exit(1); }


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

x86 assembly (clang, -O2):
<thread_kill>:
push   %rax
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @thread_kill() {
%1 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @thread_kill() {
%1 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ F_OK;
int access(char *, int /*<<< orphan*/);
int fexists(char *filename) { return access(filename, F_OK) != -1; }


x86 assembly (clang, -O0):
<fexists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
call   1030 <access@plt>
cmp    $0xffffffff,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fexists>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
call   1030 <access@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@F_OK = global i32 0
define i32 @fexists(i8* nocapture %0) {
%2 = load i32, i32* @F_OK
%3 = tail call i32 @access(i8* %0, i32 %2)
%4 = icmp ne i32 %3, -1
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ TestIfBadThingHitsGoodThing(int, int, int /*<<< orphan*/);
void TestIfBadThingTouchesFriend(int x, int y) {
  TestIfBadThingHitsGoodThing(x, y, 0);
}


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

x86 assembly (clang, -O2):
<TestIfBadThingTouchesFriend>:
xor    %edx,%edx
jmp    1030 <TestIfBadThingHitsGoodThing@plt>

LLVM IR (-O0):
define void @TestIfBadThingTouchesFriend(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 @TestIfBadThingHitsGoodThing(i32 %5, i32 %6, i32 0)
ret void
}

LLVM IR (-O2):
define void @TestIfBadThingTouchesFriend(i32 %0, i32 %1) {
%3 = tail call i32 @TestIfBadThingHitsGoodThing(i32 %0, i32 %1, i32 0)
ret void
}
/* Variables and functions */
char getch();
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ ungetch(char);
int main(void) {
  ungetch('a');
  ungetch('b');
  putchar(getch());
  putchar(getch());
  putchar('\n');
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x61,%edi
call   1040 <ungetch@plt>
mov    $0x62,%edi
call   1040 <ungetch@plt>
mov    $0x0,%al
call   1050 <getch@plt>
movsbl %al,%edi
call   1030 <putchar@plt>
mov    $0x0,%al
call   1050 <getch@plt>
movsbl %al,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x61,%edi
call   1040 <ungetch@plt>
mov    $0x62,%edi
call   1040 <ungetch@plt>
xor    %eax,%eax
call   1050 <getch@plt>
movsbl %al,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1050 <getch@plt>
movsbl %al,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @ungetch(i8 signext 97)
%3 = call i32 @ungetch(i8 signext 98)
%4 = call signext i8 (...) @getch()
%5 = call i32 @putchar(i8 signext %4)
%6 = call signext i8 (...) @getch()
%7 = call i32 @putchar(i8 signext %6)
%8 = call i32 @putchar(i8 signext 10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @ungetch(i8 signext 97)
%2 = tail call i32 @ungetch(i8 signext 98)
%3 = tail call signext i8 (...) @getch()
%4 = tail call i32 @putchar(i8 signext %3)
%5 = tail call signext i8 (...) @getch()
%6 = tail call i32 @putchar(i8 signext %5)
%7 = tail call i32 @putchar(i8 signext 10)
ret i32 0
}
void print_progr_pm(char perc_f, char perc_t, char *size_f, char *size_t,
                    char *bps, char eta_s, char eta_m, char eta_h) {
  printf(
      "\rFile: %3d%% of %s @ %s/s  |  Total: %3d%% of %s ETA %02d:%02d:%02d   ",
      perc_f, size_f, bps, perc_t, size_t, eta_h, eta_m, eta_s);
  return;
}


x86 assembly (clang, -O0):
<print_progr_pm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %r9b,%al
mov    0x18(%rbp),%r9b
mov    0x10(%rbp),%r9b
mov    %dil,-0x1(%rbp)
mov    %sil,-0x2(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    %al,-0x21(%rbp)
movsbl -0x1(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
movsbl -0x2(%rbp),%r8d
mov    -0x18(%rbp),%r9
movsbl 0x18(%rbp),%r11d
movsbl 0x10(%rbp),%r10d
movsbl -0x21(%rbp),%eax
lea    0xe9c(%rip),%rdi
mov    %r11d,(%rsp)
mov    %r10d,0x8(%rsp)
mov    %eax,0x10(%rsp)
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_progr_pm>:
push   %rbx
mov    %r9d,%r10d
mov    %rcx,%r9
mov    %esi,%eax
mov    %edi,%esi
movsbl 0x18(%rsp),%r11d
movsbl 0x10(%rsp),%ebx
sub    $0x8,%rsp
lea    0xecf(%rip),%rdi
mov    %r8,%rcx
mov    %eax,%r8d
xor    %eax,%eax
push   %r10
push   %rbx
push   %r11
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [71 x i8] c"\0DFile: %3d%% of %s @ %s/s | Total: %3d%% of %s ETA %02d:%02d:%02d \00"
define void @print_progr_pm(i8 signext %0, i8 signext %1, i8* %2, i8* %3, i8* %4, i8 signext %5, i8 signext %6, i8 signext %7) {
%9 = alloca i8
%10 = alloca i8
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i8
%15 = alloca i8
%16 = alloca i8
store i8 %0, i8* %9
store i8 %1, i8* %10
store i8* %2, i8** %11
store i8* %3, i8** %12
store i8* %4, i8** %13
store i8 %5, i8* %14
store i8 %6, i8* %15
store i8 %7, i8* %16
%17 = load i8, i8* %9
%18 = sext i8 %17 to i32
%19 = load i8*, i8** %11
%20 = load i8*, i8** %13
%21 = load i8, i8* %10
%22 = sext i8 %21 to i32
%23 = load i8*, i8** %12
%24 = load i8, i8* %16
%25 = sext i8 %24 to i32
%26 = load i8, i8* %15
%27 = sext i8 %26 to i32
%28 = load i8, i8* %14
%29 = sext i8 %28 to i32
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0), i32 %18, i8* %19, i8* %20, i32 %22, i8* %23, i32 %25, i32 %27, i32 %29)
ret void
}

LLVM IR (-O2):
@.str = [71 x i8] c"\0DFile: %3d%% of %s @ %s/s | Total: %3d%% of %s ETA %02d:%02d:%02d \00"
define void @print_progr_pm(i8 signext %0, i8 signext %1, i8* %2, i8* %3, i8* %4, i8 signext %5, i8 signext %6, i8 signext %7) {
%9 = sext i8 %0 to i32
%10 = sext i8 %1 to i32
%11 = sext i8 %7 to i32
%12 = sext i8 %6 to i32
%13 = sext i8 %5 to i32
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0), i32 %9, i8* %2, i8* %4, i32 %10, i8* %3, i32 %11, i32 %12, i32 %13)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ newline();
int /*<<< orphan*/ output_label_name(char *);
int /*<<< orphan*/ output_label_terminator();
void declare_entry_point(char *symbol_name) {
  output_label_name(symbol_name);
  output_label_terminator();
  newline();
}


x86 assembly (clang, -O0):
<declare_entry_point>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <output_label_name@plt>
mov    $0x0,%al
call   1050 <output_label_terminator@plt>
mov    $0x0,%al
call   1030 <newline@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<declare_entry_point>:
push   %rax
call   1040 <output_label_name@plt>
xor    %eax,%eax
call   1050 <output_label_terminator@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <newline@plt>

LLVM IR (-O0):
define void @declare_entry_point(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @output_label_name(i8* %3)
%5 = call i32 (...) @output_label_terminator()
%6 = call i32 (...) @newline()
ret void
}

LLVM IR (-O2):
define void @declare_entry_point(i8* %0) {
%2 = tail call i32 @output_label_name(i8* %0)
%3 = tail call i32 (...) @output_label_terminator()
%4 = tail call i32 (...) @newline()
ret void
}
void emit_name_definition(struct processor_explicatory_state *process_state,
                          struct modern_stream *stream, void *stream_state,
                          struct modern_vfile *vfile, void *vfile_state) {}


x86 assembly (clang, -O0):
<emit_name_definition>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.processor_explicatory_state = type opaque
%struct.modern_stream = type opaque
%struct.modern_vfile = type opaque
define void @emit_name_definition(%struct.processor_explicatory_state* %0, %struct.modern_stream* %1, i8* %2, %struct.modern_vfile* %3, i8* %4) {
%6 = alloca %struct.processor_explicatory_state*
%7 = alloca %struct.modern_stream*
%8 = alloca i8*
%9 = alloca %struct.modern_vfile*
%10 = alloca i8*
store %struct.processor_explicatory_state* %0, %struct.processor_explicatory_state** %6
store %struct.modern_stream* %1, %struct.modern_stream** %7
store i8* %2, i8** %8
store %struct.modern_vfile* %3, %struct.modern_vfile** %9
store i8* %4, i8** %10
ret void
}

LLVM IR (-O2):
%struct.processor_explicatory_state = type opaque
%struct.modern_stream = type opaque
%struct.modern_vfile = type opaque
define void @emit_name_definition(%struct.processor_explicatory_state* nocapture %0, %struct.modern_stream* nocapture %1, i8* nocapture %2, %struct.modern_vfile* nocapture %3, i8* nocapture %4) {
ret void
}
/* Type definitions */
struct UC_Continuation {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ UC_Continuation_dump_string(char *,
                                               struct UC_Continuation *);
int /*<<< orphan*/ printk(char *);
void UC_Continuation_dump(struct UC_Continuation *ucont) {
  char temp[1024];
  UC_Continuation_dump_string(temp, ucont);
  printk(temp);
}


x86 assembly (clang, -O0):
<UC_Continuation_dump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x410(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <UC_Continuation_dump_string@plt>
lea    -0x410(%rbp),%rdi
call   1030 <printk@plt>
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UC_Continuation_dump>:
push   %rbx
sub    $0x400,%rsp
mov    %rdi,%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <UC_Continuation_dump_string@plt>
mov    %rbx,%rdi
call   1030 <printk@plt>
add    $0x400,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.UC_Continuation = type { i32 }
define void @UC_Continuation_dump(%struct.UC_Continuation* %0) {
%2 = alloca %struct.UC_Continuation*
%3 = alloca [1024 x i8]
store %struct.UC_Continuation* %0, %struct.UC_Continuation** %2
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%5 = load %struct.UC_Continuation*, %struct.UC_Continuation** %2
%6 = call i32 @UC_Continuation_dump_string(i8* %4, %struct.UC_Continuation* %5)
%7 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%8 = call i32 @printk(i8* %7)
ret void
}

LLVM IR (-O2):
%struct.UC_Continuation = type { i32 }
define void @UC_Continuation_dump(%struct.UC_Continuation* %0) {
%2 = alloca [1024 x i8]
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%4 = call i32 @UC_Continuation_dump_string(i8* %3, %struct.UC_Continuation* %0)
%5 = call i32 @printk(i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mat3d_rotateQuatVec_new(double *, double *);
void mat3d_rotateQuat_new(double matrix[9], double x, double y, double z,
                          double w) {
  double quat[4] = {x, y, z, w};
  mat3d_rotateQuatVec_new(matrix, quat);
}


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

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

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

LLVM IR (-O2):
define void @mat3d_rotateQuat_new(double* %0, double %1, double %2, double %3, double %4) {
%6 = alloca [4 x double]
%7 = bitcast [4 x double]* %6 to i8*
%8 = getelementptr inbounds [4 x double], [4 x double]* %6, i64 0, i64 0
store double %1, double* %8
%9 = getelementptr inbounds [4 x double], [4 x double]* %6, i64 0, i64 1
store double %2, double* %9
%10 = getelementptr inbounds [4 x double], [4 x double]* %6, i64 0, i64 2
store double %3, double* %10
%11 = getelementptr inbounds [4 x double], [4 x double]* %6, i64 0, i64 3
store double %4, double* %11
%12 = call i32 @mat3d_rotateQuatVec_new(double* %0, double* %8)
ret void
}
int mdp4_dsi_cmd_on(struct platform_device *pdev) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.platform_device = type opaque
define i32 @mdp4_dsi_cmd_on(%struct.platform_device* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t second(uint32_t x, uint32_t y) { return y; }


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

x86 assembly (clang, -O2):
<second>:
mov    %esi,%eax
ret

LLVM IR (-O0):
define i32 @second(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
ret i32 %5
}

LLVM IR (-O2):
define i32 @second(i32 %0, i32 returned %1) {
ret i32 %1
}
void g_type_check_instance_cast() {}


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

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

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

LLVM IR (-O2):
define void @g_type_check_instance_cast() {
ret void
}
void __attribute__((always_)) mck_global_irq_enable() {}


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

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

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

LLVM IR (-O2):
define void @mck_global_irq_enable() {
ret void
}
int odnan_(double *din) {
  int ret_val;
  extern int odsnan_(double *, double *);
  ret_val = odsnan_(din, din);
  return ret_val;
}


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

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

LLVM IR (-O0):
define i32 @odnan_(double* %0) {
%2 = alloca double*
%3 = alloca i32
store double* %0, double** %2
%4 = load double*, double** %2
%5 = load double*, double** %2
%6 = call i32 @odsnan_(double* %4, double* %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @odnan_(double* %0) {
%2 = tail call i32 @odsnan_(double* %0, double* %0)
ret i32 %2
}
/* Variables and functions */
char toupper(char);
void standardize_character(char *character) {
  *character = toupper(*character);
  if ((*character) == ' ') {
    *character = '#';
  }
}


x86 assembly (clang, -O0):
<standardize_character>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <toupper@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jne    1147 <standardize_character+0x37>
mov    -0x8(%rbp),%rax
movb   $0x23,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<standardize_character>:
push   %rbx
mov    %rdi,%rbx
movsbl (%rdi),%edi
call   1030 <toupper@plt>
cmp    $0x20,%al
movzbl %al,%eax
mov    $0x23,%ecx
cmovne %eax,%ecx
mov    %cl,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @standardize_character(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = tail call signext i8 @toupper(i8 signext %2)
%4 = icmp eq i8 %3, 32
%5 = select i1 %4, i8 35, i8 %3
store i8 %5, i8* %0
ret void
}
/* Variables and functions */
int main(int argc, char **argv) {
  int *ptr = NULL;
  *ptr = 0;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32* null, i32** %6
%7 = load i32*, i32** %6
store i32 0, i32* %7
ret i32 0
}

LLVM IR (-O2):
int test_imm_B6int8_mem(signed char *val) {
  return ((*val) & (-0xB6 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_B6int8_mem>:
movsbl (%rdi),%eax
test   $0xffffff4a,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_B6int8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, -182
%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_B6int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = and i32 %3, -182
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 -40, i32 -20
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ scadinline(char *);
void fivesides(void) { scadinline("$fn = 5;\n"); }


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"$fn = 5;\0A\00"
define void @fivesides() {
%1 = call i32 @scadinline(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"$fn = 5;\0A\00"
define void @fivesides() {
%1 = tail call i32 @scadinline(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}