xunge/DecIR huggingface dataset:
int bitcount(unsigned x) {
  int i;
  for (i = 0; x; i++)
    x &= x - 1;
  return i;
}


x86 assembly (clang, -O0):
<bitcount>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1132 <bitcount+0x32>
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
and    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <bitcount+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitcount>:
xor    %eax,%eax
test   %edi,%edi
je     111c <bitcount+0x1c>
cs nopw 0x0(%rax,%rax,1)
lea    -0x1(%rdi),%ecx
add    $0x1,%eax
and    %edi,%ecx
mov    %ecx,%edi
jne    1110 <bitcount+0x10>
ret

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

LLVM IR (-O2):
define i32 @bitcount(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ 0, %1 ]
%5 = phi i32 [ %7, %3 ], [ %0, %1 ]
%6 = add i32 %5, -1
%7 = and i32 %6, %5
%8 = add nuw nsw i32 %4, 1
%9 = icmp eq i32 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ check_read_directory();
int /*<<< orphan*/ check_read_file();
int /*<<< orphan*/ puts(char *);
int main(void) {
  puts(":echo "
       "--a94e2gfwdd--");
  ;
  check_read_directory();
  check_read_file();
  puts("\n"
       "--a94e2gfwdd--");
  puts("$success");
  puts("$shudown");
  while (1)
    ;
  ;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <puts@plt>
mov    $0x0,%al
call   1040 <check_read_directory@plt>
mov    $0x0,%al
call   1050 <check_read_file@plt>
lea    0xeb5(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb9(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb6(%rip),%rdi
call   1030 <puts@plt>
jmp    117d <main+0x4d>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <check_read_directory@plt>
xor    %eax,%eax
call   1050 <check_read_file@plt>
lea    0xec3(%rip),%rdi
call   1030 <puts@plt>
lea    0xec7(%rip),%rdi
call   1030 <puts@plt>
lea    0xec4(%rip),%rdi
call   1030 <puts@plt>
nop
jmp    1170 <main+0x40>

LLVM IR (-O0):
@.str = [21 x i8] c":echo --a94e2gfwdd--\00"
@.str.1 = [16 x i8] c"\0A--a94e2gfwdd--\00"
@.str.2 = [9 x i8] c"$success\00"
@.str.3 = [9 x i8] c"$shudown\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @puts(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @check_read_directory()
%4 = call i32 (...) @check_read_file()
%5 = call i32 @puts(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @puts(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 @puts(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
br label %8
8: ; preds = %0, %8
br label %8
}

LLVM IR (-O2):
@.str = [21 x i8] c":echo --a94e2gfwdd--\00"
@.str.1 = [16 x i8] c"\0A--a94e2gfwdd--\00"
@.str.2 = [9 x i8] c"$success\00"
@.str.3 = [9 x i8] c"$shudown\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @check_read_directory()
%3 = tail call i32 (...) @check_read_file()
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
br label %7
7: ; preds = %0, %7
br label %7
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int int16_t;

/* Variables and functions */
void pack_add_16(uint8_t *buffer, int byteNr, int16_t value) {
  *((uint8_t *)(buffer + byteNr + 1)) = (uint8_t)(value >> 8);
  *((uint8_t *)(buffer + byteNr)) = (uint8_t)(value);
}


x86 assembly (clang, -O0):
<pack_add_16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
sar    $0x8,%eax
movslq %eax,%rdx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %rdx,0x8(%rax,%rcx,8)
movslq -0x10(%rbp),%rdx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
pop    %rbp
ret

x86 assembly (clang, -O2):
<pack_add_16>:
movslq %edx,%rax
sar    $0x8,%edx
movslq %edx,%rcx
movslq %esi,%rdx
mov    %rcx,0x8(%rdi,%rdx,8)
mov    %rax,(%rdi,%rdx,8)
ret

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

LLVM IR (-O2):
define void @pack_add_16(i64* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = ashr i32 %2, 8
%5 = sext i32 %4 to i64
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds i64, i64* %0, i64 %6
%8 = getelementptr inbounds i64, i64* %7, i64 1
store i64 %5, i64* %8
%9 = sext i32 %2 to i64
store i64 %9, i64* %7
ret void
}
unsigned int make_concrete(unsigned int p_aggregate, unsigned int p_cement,
                           unsigned int p_water) {
  return (p_aggregate + p_cement + p_water);
}


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

x86 assembly (clang, -O2):
<make_concrete>:
lea    (%rdi,%rsi,1),%eax
add    %edx,%eax
ret

LLVM IR (-O0):
define i32 @make_concrete(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 = add i32 %7, %8
%10 = load i32, i32* %6
%11 = add i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @make_concrete(i32 %0, i32 %1, i32 %2) {
%4 = add i32 %1, %0
%5 = add i32 %4, %2
ret i32 %5
}
/* Type definitions */
struct tag_async_net {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ connmgr_kill_connection(int);
int /*<<< orphan*/ default_sock_hup_handler(struct tag_async_net *, int,
                                            void *);
void sock_hup_handler(struct tag_async_net *asnet, int fd, void *info) {
  default_sock_hup_handler(asnet, fd, info);
  connmgr_kill_connection(fd);
}


x86 assembly (clang, -O0):
<sock_hup_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1040 <default_sock_hup_handler@plt>
mov    -0xc(%rbp),%edi
call   1030 <connmgr_kill_connection@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sock_hup_handler>:
push   %rbx
mov    %esi,%ebx
call   1040 <default_sock_hup_handler@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <connmgr_kill_connection@plt>

LLVM IR (-O0):
%struct.tag_async_net = type { i32 }
define void @sock_hup_handler(%struct.tag_async_net* %0, i32 %1, i8* %2) {
%4 = alloca %struct.tag_async_net*
%5 = alloca i32
%6 = alloca i8*
store %struct.tag_async_net* %0, %struct.tag_async_net** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load %struct.tag_async_net*, %struct.tag_async_net** %4
%8 = load i32, i32* %5
%9 = load i8*, i8** %6
%10 = call i32 @default_sock_hup_handler(%struct.tag_async_net* %7, i32 %8, i8* %9)
%11 = load i32, i32* %5
%12 = call i32 @connmgr_kill_connection(i32 %11)
ret void
}

LLVM IR (-O2):
%struct.tag_async_net = type { i32 }
define void @sock_hup_handler(%struct.tag_async_net* %0, i32 %1, i8* %2) {
%4 = tail call i32 @default_sock_hup_handler(%struct.tag_async_net* %0, i32 %1, i8* %2)
%5 = tail call i32 @connmgr_kill_connection(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
void show_usage(int ret) {
  fprintf(stderr, "\nERR:%d\nUsage: omnius-cli [msg_in_key] [msg_out_key]\n",
          ret);
  return;
}


x86 assembly (clang, -O0):
<show_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xed2(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_usage>:
mov    %edi,%edx
mov    0x2ec7(%rip),%rax
mov    (%rax),%edi
lea    0xede(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [54 x i8] c"\0AERR:%d\0AUsage: omnius-cli [msg_in_key] [msg_out_key]\0A\00"
define void @show_usage(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = load i32, i32* %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [54 x i8] c"\0AERR:%d\0AUsage: omnius-cli [msg_in_key] [msg_out_key]\0A\00"
define void @show_usage(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
size_t strxfrm(char *restrict dest, const char *restrict src, size_t n) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define i64 @strxfrm(i8* noalias nocapture readnone %0, i8* noalias nocapture readnone %1, i64 %2) {
ret i64 0
}
OP(dd, f3) {
  illegal_1();
  op_f3();
}


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <illegal_1@plt>
mov    $0x0,%al
call   1040 <op_f3@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OP>:
push   %rax
xor    %eax,%eax
call   1030 <illegal_1@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <op_f3@plt>

LLVM IR (-O0):
define i32 @OP(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = call i32 (...) @illegal_1()
%7 = call i32 (...) @op_f3()
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_1()
%4 = tail call i32 (...) @op_f3()
ret i32 undef
}
/* Variables and functions */
double sqrt(double);
double d_sqrt(double *x) { return (sqrt(*x)); }


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

x86 assembly (clang, -O2):
<d_sqrt>:
movsd  (%rdi),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1123 <d_sqrt+0x13>
sqrtsd %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

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

LLVM IR (-O2):
define double @d_sqrt(double* nocapture %0) {
%2 = load double, double* %0
%3 = tail call double @sqrt(double %2)
ret double %3
}
extern int func1(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @func1() {
ret i32 1
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t inverse_adjust_seed_16(uint32_t seed) { return seed ^ (seed << 16); }


x86 assembly (clang, -O0):
<inverse_adjust_seed_16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shl    $0x10,%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inverse_adjust_seed_16>:
mov    %edi,%eax
shl    $0x10,%eax
xor    %edi,%eax
ret

LLVM IR (-O0):
define i32 @inverse_adjust_seed_16(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = shl i32 %4, 16
%6 = xor i32 %3, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @inverse_adjust_seed_16(i32 %0) {
%2 = shl i32 %0, 16
%3 = xor i32 %2, %0
ret i32 %3
}
short mus_big_endian_short(unsigned char *inp) {
  short o;
  unsigned char *outp;
  outp = (unsigned char *)&o;
  outp[0] = inp[0];
  outp[1] = inp[1];
  return (o);
}


x86 assembly (clang, -O0):
<mus_big_endian_short>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
lea    -0xa(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x1(%rax)
movswl -0xa(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mus_big_endian_short>:
movzwl (%rdi),%eax
ret

LLVM IR (-O0):
define signext i16 @mus_big_endian_short(i8* %0) {
%2 = alloca i8*
%3 = alloca i16
%4 = alloca i8*
store i8* %0, i8** %2
%5 = bitcast i16* %3 to i8*
store i8* %5, i8** %4
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i64 0
%8 = load i8, i8* %7
%9 = load i8*, i8** %4
%10 = getelementptr inbounds i8, i8* %9, i64 0
store i8 %8, i8* %10
%11 = load i8*, i8** %2
%12 = getelementptr inbounds i8, i8* %11, i64 1
%13 = load i8, i8* %12
%14 = load i8*, i8** %4
%15 = getelementptr inbounds i8, i8* %14, i64 1
store i8 %13, i8* %15
%16 = load i16, i16* %3
ret i16 %16
}

LLVM IR (-O2):
define signext i16 @mus_big_endian_short(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = getelementptr inbounds i8, i8* %0, i64 1
%4 = load i8, i8* %3
%5 = zext i8 %4 to i16
%6 = shl nuw i16 %5, 8
%7 = zext i8 %2 to i16
%8 = or i16 %6, %7
ret i16 %8
}
/* Variables and functions */
size_t cm_argvlen(char const *const *argv) {
  size_t i = 0;
  while (*argv++)
    i++;
  return i;
}


x86 assembly (clang, -O0):
<cm_argvlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x8(%rbp)
cmpq   $0x0,(%rax)
je     113a <cm_argvlen+0x3a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <cm_argvlen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cm_argvlen>:
cmpq   $0x0,(%rdi)
je     1120 <cm_argvlen+0x20>
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
lea    0x1(%rcx),%rax
cmpq   $0x0,0x8(%rdi,%rcx,8)
mov    %rax,%rcx
jne    1110 <cm_argvlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @cm_argvlen(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8** [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = add i64 %5, 1
%9 = load i8*, i8** %7
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i64 [ 0, %1 ], [ %8, %4 ]
ret i64 %12
}
/* Variables and functions */
void set_null_dbl(double **x, int n) {
  for (int i = 0; i < n; ++i) {
    x[i] = NULL;
  }
}


x86 assembly (clang, -O0):
<set_null_dbl>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    113c <set_null_dbl+0x3c>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movq   $0x0,(%rax,%rcx,8)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <set_null_dbl+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_null_dbl>:
test   %esi,%esi
jle    1126 <set_null_dbl+0x16>
push   %rax
mov    %esi,%edx
shl    $0x3,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @set_null_dbl(double** nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = bitcast double** %0 to i8*
%6 = zext i32 %1 to i64
%7 = shl nuw nsw i64 %6, 3
br label %8
8: ; preds = %4, %2
ret void
}
const char *get_lame_short_version(void) {
  static const char *const str = "3"
                                 "."
                                 "98"
                                 "."
                                 "2";
  return str;
}


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

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

LLVM IR (-O0):
@get_lame_short_version.str = internal constant i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i32 0, i32 0)
@.str = [7 x i8] c"3.98.2\00"
define i8* @get_lame_short_version() {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i32 0, i32 0)
}

LLVM IR (-O2):
@.str = [7 x i8] c"3.98.2\00"
define i8* @get_lame_short_version() {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int wycc_type_flags(int);
int wycc_type_is_record(int id) {
  int flgs = wycc_type_flags(id);
  if (flgs & 128) {
    return 1;
  };
  return 0;
}


x86 assembly (clang, -O0):
<wycc_type_is_record>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <wycc_type_flags@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     1143 <wycc_type_is_record+0x33>
movl   $0x1,-0x4(%rbp)
jmp    114a <wycc_type_is_record+0x3a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wycc_type_is_record>:
push   %rax
call   1030 <wycc_type_flags@plt>
shr    $0x7,%eax
and    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @wycc_type_is_record(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = call i32 @wycc_type_flags(i32 %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = and i32 %7, 128
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %1
store i32 1, i32* %2
br label %12
11: ; preds = %1
store i32 0, i32* %2
br label %12
12: ; preds = %11, %10
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @wycc_type_is_record(i32 %0) {
%2 = tail call i32 @wycc_type_flags(i32 %0)
%3 = lshr i32 %2, 7
%4 = and i32 %3, 1
ret i32 %4
}
/* Variables and functions */
unsigned char inb(int);
int /*<<< orphan*/ outb(unsigned short, int);
unsigned char read_seq_b(unsigned short addr) {
  outb(addr, 0x3C4);
  return inb(0x3C5);
}


x86 assembly (clang, -O0):
<read_seq_b>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    $0x3c4,%esi
movzwl -0x2(%rbp),%edi
call   1030 <outb@plt>
mov    $0x3c5,%edi
call   1040 <inb@plt>
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_seq_b>:
push   %rax
mov    $0x3c4,%esi
call   1030 <outb@plt>
mov    $0x3c5,%edi
pop    %rax
jmp    1040 <inb@plt>

LLVM IR (-O0):
define zeroext i8 @read_seq_b(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = call i32 @outb(i16 zeroext %3, i32 964)
%5 = call zeroext i8 @inb(i32 965)
ret i8 %5
}

LLVM IR (-O2):
define zeroext i8 @read_seq_b(i16 zeroext %0) {
%2 = tail call i32 @outb(i16 zeroext %0, i32 964)
%3 = tail call zeroext i8 @inb(i32 965)
ret i8 %3
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int **alloc1(int const);
int **alloc2(int const);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ show_gaps(int const **, int const);
int main(void) {
  const int N = 16;
  const int **a2 = alloc2(N);
  show_gaps(a2, N);
  const int **a1 = alloc1(N);
  show_gaps(a1, N);
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x10,-0x8(%rbp)
mov    $0x10,%edi
call   1030 <alloc2@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x10,%esi
call   1040 <show_gaps@plt>
mov    $0x10,%edi
call   1050 <alloc1@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x10,%esi
call   1040 <show_gaps@plt>
mov    0x2e4b(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x10,%edi
call   1030 <alloc2@plt>
mov    %rax,%rdi
mov    $0x10,%esi
call   1040 <show_gaps@plt>
mov    $0x10,%edi
call   1050 <alloc1@plt>
mov    %rax,%rdi
mov    $0x10,%esi
call   1040 <show_gaps@plt>
mov    0x2e6a(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32**
%4 = alloca i32**
store i32 0, i32* %1
store i32 16, i32* %2
%5 = call i32** @alloc2(i32 16)
store i32** %5, i32*** %3
%6 = load i32**, i32*** %3
%7 = call i32 @show_gaps(i32** %6, i32 16)
%8 = call i32** @alloc1(i32 16)
store i32** %8, i32*** %4
%9 = load i32**, i32*** %4
%10 = call i32 @show_gaps(i32** %9, i32 16)
%11 = load i32, i32* @EXIT_SUCCESS
%12 = call i32 @exit(i32 %11)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32** @alloc2(i32 16)
%2 = tail call i32 @show_gaps(i32** %1, i32 16)
%3 = tail call i32** @alloc1(i32 16)
%4 = tail call i32 @show_gaps(i32** %3, i32 16)
%5 = load i32, i32* @EXIT_SUCCESS
%6 = tail call i32 @exit(i32 %5)
unreachable
}
void glUniformMatrix4x2fv(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glUniformMatrix4x2fv() {
ret void
}
cbuf8(f, n) { return (cbuf(f, n, 8)); }


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

x86 assembly (clang, -O2):
<cbuf8>:
mov    $0x8,%edx
xor    %eax,%eax
jmp    1030 <cbuf@plt>

LLVM IR (-O0):
define i32 @cbuf8(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 (i32, i32, i32, ...) bitcast (i32 (...)* @cbuf to i32 (i32, i32, i32, ...)*)(i32 %5, i32 %6, i32 8)
ret i32 %7
}

LLVM IR (-O2):
define i32 @cbuf8(i32 %0, i32 %1) {
%3 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @cbuf to i32 (i32, i32, i32, ...)*)(i32 %0, i32 %1, i32 8)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int test(int, int, int);
int main(void) {
  if (test(0x10, 0x20, 0x30) != 0x60)
    abort();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x10,%edi
mov    $0x20,%esi
mov    $0x30,%edx
call   1050 <test@plt>
cmp    $0x60,%eax
je     1163 <main+0x33>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x10,%edi
mov    $0x20,%esi
mov    $0x30,%edx
call   1050 <test@plt>
cmp    $0x60,%eax
jne    1151 <main+0x21>
xor    %edi,%edi
call   1040 <exit@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @test(i32 16, i32 32, i32 48)
%3 = icmp ne i32 %2, 96
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
%7 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @test(i32 16, i32 32, i32 48)
%2 = icmp eq i32 %1, 96
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = tail call i32 @exit(i32 0)
unreachable
}
void foo62() {}


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

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

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

LLVM IR (-O2):
define void @foo62() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ do_settype(char *);
void setbinary(void) { do_settype("binary"); }


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

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"binary\00"
define void @setbinary() {
%1 = tail call i32 @do_settype(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
int main(void) { return 99; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0x63,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 99
}
/* Variables and functions */
int /*<<< orphan*/ mul(unsigned long *, unsigned long *, int, int);
int main() {
  unsigned long z[2] = {1, 2};
  mul(&z[0], &z[1], 17, 42);
  return (z[0] == 17 * 42 && z[1] == 0) ? 0 : 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x20(%rbp),%rsi
add    $0x8,%rsi
mov    $0x11,%edx
mov    $0x2a,%ecx
call   1030 <mul@plt>
xor    %eax,%eax
cmpq   $0x2ca,-0x20(%rbp)
mov    %al,-0x21(%rbp)
jne    116e <main+0x5e>
cmpq   $0x0,-0x18(%rbp)
sete   %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%dl
mov    $0x1,%eax
xor    %ecx,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x8(%rsp),%rsi
mov    %rsp,%rdi
mov    $0x11,%edx
mov    $0x2a,%ecx
call   1030 <mul@plt>
mov    $0x2ca,%ecx
xor    (%rsp),%rcx
xor    %eax,%eax
or     0x8(%rsp),%rcx
setne  %al
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.z = [2 x i64] [i64 1, i64 2]
define i32 @main() {
%1 = alloca i32
%2 = alloca [2 x i64]
store i32 0, i32* %1
%3 = bitcast [2 x i64]* %2 to i8*
%4 = getelementptr inbounds [2 x i64], [2 x i64]* %2, i64 0, i64 0
%5 = getelementptr inbounds [2 x i64], [2 x i64]* %2, i64 0, i64 1
%6 = call i32 @mul(i64* %4, i64* %5, i32 17, i32 42)
%7 = getelementptr inbounds [2 x i64], [2 x i64]* %2, i64 0, i64 0
%8 = load i64, i64* %7
%9 = icmp eq i64 %8, 714
br i1 %9, label %10, label %14
10: ; preds = %0
%11 = getelementptr inbounds [2 x i64], [2 x i64]* %2, i64 0, i64 1
%12 = load i64, i64* %11
%13 = icmp eq i64 %12, 0
br label %14
14: ; preds = %10, %0
%15 = phi i1 [ false, %0 ], [ %13, %10 ]
%16 = zext i1 %15 to i64
%17 = select i1 %15, i32 0, i32 1
ret i32 %17
}

LLVM IR (-O2):
@__const.main.z = [2 x i64] [i64 1, i64 2]
define i32 @main() {
%1 = alloca [2 x i64]
%2 = bitcast [2 x i64]* %1 to i8*
%3 = getelementptr inbounds [2 x i64], [2 x i64]* %1, i64 0, i64 0
%4 = getelementptr inbounds [2 x i64], [2 x i64]* %1, i64 0, i64 1
%5 = call i32 @mul(i64* %3, i64* %4, i32 17, i32 42)
%6 = load i64, i64* %3
%7 = icmp ne i64 %6, 714
%8 = load i64, i64* %4
%9 = icmp ne i64 %8, 0
%10 = select i1 %7, i1 true, i1 %9
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char **, char *, char *);
void print_addr_v1(char ca[]) {
  printf("&ca: %p, &(ca[0]): %p, &(ca[1]): %p\n", &ca, &(ca[0]), &ca[1]);
}


x86 assembly (clang, -O0):
<print_addr_v1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0x8(%rbp),%rcx
add    $0x1,%rcx
lea    0xed1(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_addr_v1>:
push   %rax
mov    %rdi,%rdx
mov    %rdi,(%rsp)
lea    0x1(%rdi),%rcx
lea    0xedd(%rip),%rdi
mov    %rsp,%rsi
call   1030 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [37 x i8] c"&ca: %p, &(ca[0]): %p, &(ca[1]): %p\0A\00"
define void @print_addr_v1(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8** %2, i8* %4, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [37 x i8] c"&ca: %p, &(ca[0]): %p, &(ca[1]): %p\0A\00"
define void @print_addr_v1(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = getelementptr inbounds i8, i8* %0, i64 1
%4 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8** %2, i8* %0, i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void platform_main_end(int x, int flag) {
  if (!flag)
    printf("checksum = %x\n", x);
}


x86 assembly (clang, -O0):
<platform_main_end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1137 <platform_main_end+0x27>
mov    -0x4(%rbp),%esi
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<platform_main_end>:
test   %esi,%esi
je     1115 <platform_main_end+0x5>
ret
mov    %edi,%eax
lea    0xee2(%rip),%rdi
mov    %eax,%esi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"checksum = %x\0A\00"
define void @platform_main_end(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 = icmp ne i32 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load i32, i32* %3
%9 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %8)
br label %10
10: ; preds = %7, %2
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"checksum = %x\0A\00"
define void @platform_main_end(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %6
6: ; preds = %4, %2
ret void
}
int cmp(const int *a, const int *b) {
  if (*a > *b) {
    return 1;
  }
  if (*a == *b) {
    return 0;
  }
  return -1;
}


x86 assembly (clang, -O0):
<cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jle    112a <cmp+0x2a>
movl   $0x1,-0x4(%rbp)
jmp    114f <cmp+0x4f>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jne    1148 <cmp+0x48>
movl   $0x0,-0x4(%rbp)
jmp    114f <cmp+0x4f>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
xor    %edx,%edx
cmp    %ecx,%eax
setne  %dl
neg    %edx
cmp    %ecx,%eax
mov    $0x1,%eax
cmovle %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @cmp(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = icmp sgt i32 %3, %4
%6 = icmp ne i32 %3, %4
%7 = sext i1 %6 to i32
%8 = select i1 %5, i32 1, i32 %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void sequential_both() {
  while (1)
    assert(1);
  while (1)
    assert(1);
}


x86 assembly (clang, -O0):
<sequential_both>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <sequential_both+0x9>
mov    $0x1,%edi
call   1030 <assert@plt>
jmp    1119 <sequential_both+0x9>

x86 assembly (clang, -O2):
<sequential_both>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x1,%edi
call   1030 <assert@plt>
jmp    1120 <sequential_both+0x10>

LLVM IR (-O0):
define void @sequential_both() {
br label %1
1: ; preds = %0, %1
%2 = call i32 @assert(i32 1)
br label %1
}

LLVM IR (-O2):
define void @sequential_both() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 @assert(i32 1)
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void print_help(const char *progname, int status) {
  fprintf(stderr, "usage: %s FILE\n\n", progname);
  exit(status);
}


x86 assembly (clang, -O0):
<print_help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xebd(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0xc(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<print_help>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rdx
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
lea    0xeca(%rip),%rsi
call   1030 <fprintf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [17 x i8] c"usage: %s FILE\0A\0A\00"
define void @print_help(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %3
%7 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i32, i32* %4
%9 = call i32 @exit(i32 %8)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [17 x i8] c"usage: %s FILE\0A\0A\00"
define void @print_help(i8* %0, i32 %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = tail call i32 @exit(i32 %1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRCORE_N16_swap(char *, int, int);
void U_WMROFFSETCLIPRGN_swap(char *record, int torev) {
  U_WMRCORE_N16_swap(record, 2, torev);
}


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

x86 assembly (clang, -O2):
<U_WMROFFSETCLIPRGN_swap>:
mov    %esi,%edx
mov    $0x2,%esi
jmp    1030 <U_WMRCORE_N16_swap@plt>

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

LLVM IR (-O2):
define void @U_WMROFFSETCLIPRGN_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRCORE_N16_swap(i8* %0, i32 2, i32 %1)
ret void
}
char *prepln(out, in, pos, len)
char *out, *in;
int pos, len;
{
  memset(out, '\0', len + 1);
  return (strncpy(out, in + pos, len));
}


x86 assembly (clang, -O0):
<prepln>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%eax
add    $0x1,%eax
movslq %eax,%rdx
xor    %esi,%esi
call   1040 <memset@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movslq -0x14(%rbp),%rax
add    %rax,%rsi
movslq -0x18(%rbp),%rdx
call   1030 <strncpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prepln>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r15d
mov    %edx,%r14d
mov    %rsi,%rbp
mov    %rdi,%rbx
lea    0x1(%r15),%eax
movslq %eax,%rdx
xor    %esi,%esi
call   1040 <memset@plt>
movslq %r14d,%rax
add    %rax,%rbp
movslq %r15d,%rdx
mov    %rbx,%rdi
mov    %rbp,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <strncpy@plt>

LLVM IR (-O0):
define i8* @prepln(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load i32, i32* %8
%11 = add nsw i32 %10, 1
%12 = sext i32 %11 to i64
%13 = load i8*, i8** %5
%14 = load i8*, i8** %6
%15 = load i32, i32* %7
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %14, i64 %16
%18 = load i32, i32* %8
%19 = sext i32 %18 to i64
%20 = call i8* @strncpy(i8* %13, i8* %17, i64 %19)
ret i8* %20
}

LLVM IR (-O2):
define i8* @prepln(i8* returned %0, i8* nocapture %1, i32 %2, i32 %3) {
%5 = add nsw i32 %3, 1
%6 = sext i32 %5 to i64
tail call void @llvm.memset.p0i8.i64(i8* align 1 %0, i8 0, i64 %6, i1 false)
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i8, i8* %1, i64 %7
%9 = sext i32 %3 to i64
%10 = tail call i8* @strncpy(i8* dereferenceable(1) %0, i8* %8, i64 %9)
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ outb(int, int);
void fin_intr_pic1(void) { outb(0x20, 0x20); }


x86 assembly (clang, -O0):
<fin_intr_pic1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x20,%esi
mov    %esi,%edi
call   1030 <outb@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fin_intr_pic1>:
mov    $0x20,%edi
mov    $0x20,%esi
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @fin_intr_pic1() {
%1 = call i32 @outb(i32 32, i32 32)
ret void
}

LLVM IR (-O2):
define void @fin_intr_pic1() {
%1 = tail call i32 @outb(i32 32, i32 32)
ret void
}
int correctInput(int n, char tauler[6][7]) {
  if (n > 7)
    return 1;
  if (n <= 0)
    return -1;
  if (tauler[6 - 1][n - 1] == '-')
    return 0;
  else
    return 2;
}


x86 assembly (clang, -O0):
<correctInput>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x7,-0x8(%rbp)
jle    1121 <correctInput+0x21>
movl   $0x1,-0x4(%rbp)
jmp    1165 <correctInput+0x65>
cmpl   $0x0,-0x8(%rbp)
jg     1137 <correctInput+0x37>
movl   $0xffffffff,-0x4(%rbp)
jmp    1165 <correctInput+0x65>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl 0x23(%rax,%rcx,1),%eax
cmp    $0x2d,%eax
jne    115e <correctInput+0x5e>
movl   $0x0,-0x4(%rbp)
jmp    1165 <correctInput+0x65>
movl   $0x2,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<correctInput>:
mov    $0x1,%eax
cmp    $0x7,%edi
jg     111d <correctInput+0x1d>
test   %edi,%edi
jle    111e <correctInput+0x1e>
add    $0xffffffff,%edi
xor    %eax,%eax
cmpb   $0x2d,0x23(%rsi,%rdi,1)
setne  %al
add    %eax,%eax
ret
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @correctInput(i32 %0, [7 x i8]* nocapture %1) {
%3 = icmp sgt i32 %0, 7
br i1 %3, label %13, label %4
4: ; preds = %2
%5 = icmp slt i32 %0, 1
br i1 %5, label %13, label %6
6: ; preds = %4
%7 = add nsw i32 %0, -1
%8 = zext i32 %7 to i64
%9 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 5, i64 %8
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 45
%12 = select i1 %11, i32 0, i32 2
br label %13
13: ; preds = %6, %4, %2
%14 = phi i32 [ 1, %2 ], [ -1, %4 ], [ %12, %6 ]
ret i32 %14
}
long swapl(l)
long *l;
{
  union {
    long l;
    unsigned char c[4];
  } u;
  unsigned char temp;
  u.l = *l;
  temp = u.c[0];
  u.c[0] = u.c[3];
  u.c[3] = temp;
  temp = u.c[1];
  u.c[1] = u.c[2];
  u.c[2] = temp;
  return (u.l);
}


x86 assembly (clang, -O0):
<swapl>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%al
mov    %al,-0x11(%rbp)
mov    -0xd(%rbp),%al
mov    %al,-0x10(%rbp)
mov    -0x11(%rbp),%al
mov    %al,-0xd(%rbp)
mov    -0xf(%rbp),%al
mov    %al,-0x11(%rbp)
mov    -0xe(%rbp),%al
mov    %al,-0xf(%rbp)
mov    -0x11(%rbp),%al
mov    %al,-0xe(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<swapl>:
mov    (%rdi),%rax
mov    %eax,%ecx
shr    $0x18,%ecx
movabs $0xffffffff00000000,%rdx
ff ff ff
and    %rax,%rdx
mov    %eax,%esi
shl    $0x18,%esi
or     %rdx,%rsi
mov    %eax,%edx
shl    $0x8,%edx
and    $0xff0000,%edx
or     %rsi,%rdx
shr    $0x8,%rax
and    $0xff00,%eax
or     %rdx,%rax
or     %rcx,%rax
ret

LLVM IR (-O0):
%union.anon = type { i64 }
define i64 @swapl(i64* %0) {
%2 = alloca i64*
%3 = alloca %union.anon
%4 = alloca i8
store i64* %0, i64** %2
%5 = load i64*, i64** %2
%6 = load i64, i64* %5
%7 = bitcast %union.anon* %3 to i64*
store i64 %6, i64* %7
%8 = bitcast %union.anon* %3 to [4 x i8]*
%9 = getelementptr inbounds [4 x i8], [4 x i8]* %8, i64 0, i64 0
%10 = load i8, i8* %9
store i8 %10, i8* %4
%11 = bitcast %union.anon* %3 to [4 x i8]*
%12 = getelementptr inbounds [4 x i8], [4 x i8]* %11, i64 0, i64 3
%13 = load i8, i8* %12
%14 = bitcast %union.anon* %3 to [4 x i8]*
%15 = getelementptr inbounds [4 x i8], [4 x i8]* %14, i64 0, i64 0
store i8 %13, i8* %15
%16 = load i8, i8* %4
%17 = bitcast %union.anon* %3 to [4 x i8]*
%18 = getelementptr inbounds [4 x i8], [4 x i8]* %17, i64 0, i64 3
store i8 %16, i8* %18
%19 = bitcast %union.anon* %3 to [4 x i8]*
%20 = getelementptr inbounds [4 x i8], [4 x i8]* %19, i64 0, i64 1
%21 = load i8, i8* %20
store i8 %21, i8* %4
%22 = bitcast %union.anon* %3 to [4 x i8]*
%23 = getelementptr inbounds [4 x i8], [4 x i8]* %22, i64 0, i64 2
%24 = load i8, i8* %23
%25 = bitcast %union.anon* %3 to [4 x i8]*
%26 = getelementptr inbounds [4 x i8], [4 x i8]* %25, i64 0, i64 1
store i8 %24, i8* %26
%27 = load i8, i8* %4
%28 = bitcast %union.anon* %3 to [4 x i8]*
%29 = getelementptr inbounds [4 x i8], [4 x i8]* %28, i64 0, i64 2
store i8 %27, i8* %29
%30 = bitcast %union.anon* %3 to i64*
%31 = load i64, i64* %30
ret i64 %31
}

LLVM IR (-O2):
define i64 @swapl(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = lshr i64 %2, 24
%4 = and i64 %2, -4294967296
%5 = shl i64 %2, 24
%6 = and i64 %5, 4278190080
%7 = or i64 %6, %4
%8 = shl i64 %2, 8
%9 = and i64 %8, 16711680
%10 = or i64 %7, %9
%11 = lshr i64 %2, 8
%12 = and i64 %11, 65280
%13 = or i64 %10, %12
%14 = and i64 %3, 255
%15 = or i64 %13, %14
ret i64 %15
}
/* Variables and functions */
int /*<<< orphan*/ set_linux_file_name(char *);
int /*<<< orphan*/ tcp_illinois_register();
void module_register(void) {
  tcp_illinois_register();
  set_linux_file_name("tcp_illinois.c");
}


x86 assembly (clang, -O0):
<module_register>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <tcp_illinois_register@plt>
lea    0xece(%rip),%rdi
call   1040 <set_linux_file_name@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<module_register>:
push   %rax
xor    %eax,%eax
call   1030 <tcp_illinois_register@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1040 <set_linux_file_name@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"tcp_illinois.c\00"
define void @module_register() {
%1 = call i32 (...) @tcp_illinois_register()
%2 = call i32 @set_linux_file_name(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"tcp_illinois.c\00"
define void @module_register() {
%1 = tail call i32 (...) @tcp_illinois_register()
%2 = tail call i32 @set_linux_file_name(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int main() {
  char letter = 'H';
  printf("The first letter of my name is %c.\n", letter);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x48,-0x5(%rbp)
lea    0xed6(%rip),%rdi
movsbl -0x5(%rbp),%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [36 x i8] c"The first letter of my name is %c.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
store i8 72, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8 signext %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [36 x i8] c"The first letter of my name is %c.\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8 signext 72)
ret i32 0
}
int power_setup() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @power_setup() {
ret i32 0
}