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

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int);
int /*<<< orphan*/ stderr;
int rtlsdr_rpc_read_eeprom(void *dev, uint8_t *data, uint8_t offset,
                           uint16_t len) {
  fprintf(stderr, "[u] %s,%u\n",
          "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/TA1DB/librtlsdr/refs/heads/master/src/"
          "rtlsdr_rpc.c",
          736);
  return -1;
}


x86 assembly (clang, -O0):
<rtlsdr_rpc_read_eeprom>:
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    0x2eb3(%rip),%rax
mov    (%rax),%edi
lea    0xeca(%rip),%rsi
lea    0xece(%rip),%rdx
mov    $0x2e0,%ecx
call   1030 <fprintf@plt>
mov    $0xffffffff,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtlsdr_rpc_read_eeprom>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
lea    0xee3(%rip),%rdx
mov    $0x2e0,%ecx
call   1030 <fprintf@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [11 x i8] c"[u] %s,%u\0A\00"
@.str.1 = [141 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/TA1DB/librtlsdr/refs/heads/master/src/rtlsdr_rpc.c\00"
define i32 @rtlsdr_rpc_read_eeprom(i8* %0, i32* %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i32* %1, i32** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([141 x i8], [141 x i8]* @.str.1, i64 0, i64 0), i32 736)
ret i32 -1
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [11 x i8] c"[u] %s,%u\0A\00"
@.str.1 = [141 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/TA1DB/librtlsdr/refs/heads/master/src/rtlsdr_rpc.c\00"
define i32 @rtlsdr_rpc_read_eeprom(i8* nocapture readnone %0, i32* nocapture readnone %1, i32 %2, i32 %3) {
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([141 x i8], [141 x i8]* @.str.1, i64 0, i64 0), i32 736)
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() { printf("Hello World!!\n"); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%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>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [14 x i8] c"Hello World!!\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))
ret i32 0
}
void gtk_text_iter_equal() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_iter_equal() {
ret void
}
int chkquota(fsname, mntpt, qnp)
char *fsname, *mntpt;
register struct quotaname *qnp;
{
  int errs = 0;
  errs = chkquota_ufs(fsname, mntpt, qnp);
  return (errs);
}


x86 assembly (clang, -O0):
<chkquota>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x0,%al
call   1030 <chkquota_ufs@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.quotaname = type opaque
define i32 @chkquota(i8* %0, i8* %1, %struct.quotaname* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca %struct.quotaname*
%7 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store %struct.quotaname* %2, %struct.quotaname** %6
store i32 0, i32* %7
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = load %struct.quotaname*, %struct.quotaname** %6
%11 = call i32 (i8*, i8*, %struct.quotaname*, ...) bitcast (i32 (...)* @chkquota_ufs to i32 (i8*, i8*, %struct.quotaname*, ...)*)(i8* %8, i8* %9, %struct.quotaname* %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
ret i32 %12
}

LLVM IR (-O2):
%struct.quotaname = type opaque
define i32 @chkquota(i8* %0, i8* %1, %struct.quotaname* %2) {
%4 = tail call i32 (i8*, i8*, %struct.quotaname*, ...) bitcast (i32 (...)* @chkquota_ufs to i32 (i8*, i8*, %struct.quotaname*, ...)*)(i8* %0, i8* %1, %struct.quotaname* %2)
ret i32 %4
}
int ht_integercmp(void *k1, void *k2) { return (*((int *)k1) == *((int *)k2)); }


x86 assembly (clang, -O0):
<ht_integercmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ht_integercmp>:
mov    (%rdi),%ecx
xor    %eax,%eax
cmp    (%rsi),%ecx
sete   %al
ret

LLVM IR (-O0):
define i32 @ht_integercmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = icmp eq i32 %7, %10
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @ht_integercmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp eq i32 %4, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, char const *, char const *);
const char *fix_name(const char *name, const char *prefix) {
  static char buf[64];
  snprintf(buf, sizeof(buf), "%s%s", prefix, name);
  return buf;
}


x86 assembly (clang, -O0):
<fix_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%r8
lea    0x2f11(%rip),%rdi
mov    $0x40,%esi
lea    0xec5(%rip),%rdx
call   1030 <snprintf@plt>
lea    0x2ef9(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fix_name>:
push   %rbx
mov    %rsi,%rcx
mov    %rdi,%r8
lea    0x2f22(%rip),%rbx
lea    0xedb(%rip),%rdx
mov    %rbx,%rdi
mov    $0x40,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@fix_name.buf = internal global [64 x i8] zeroinitializer
@.str = [5 x i8] c"%s%s\00"
define i8* @fix_name(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i8*, i8** %3
%7 = call i32 @snprintf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @fix_name.buf, i64 0, i64 0), i32 64, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
ret i8* getelementptr inbounds ([64 x i8], [64 x i8]* @fix_name.buf, i64 0, i64 0)
}

LLVM IR (-O2):
@fix_name.buf = internal global [64 x i8] zeroinitializer
@.str = [5 x i8] c"%s%s\00"
define i8* @fix_name(i8* %0, i8* %1) {
%3 = tail call i32 @snprintf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @fix_name.buf, i64 0, i64 0), i32 64, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %0)
ret i8* getelementptr inbounds ([64 x i8], [64 x i8]* @fix_name.buf, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ __print_float(float);
int /*<<< orphan*/ __print_int(int);
void pr(int a, float b) {
  __print_int(a);
  __print_float(b);
}


x86 assembly (clang, -O0):
<pr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <__print_int@plt>
movss  -0x8(%rbp),%xmm0
call   1030 <__print_float@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pr>:
push   %rax
movss  %xmm0,0x4(%rsp)
call   1040 <__print_int@plt>
movss  0x4(%rsp),%xmm0
pop    %rax
jmp    1030 <__print_float@plt>

LLVM IR (-O0):
define void @pr(i32 %0, float %1) {
%3 = alloca i32
%4 = alloca float
store i32 %0, i32* %3
store float %1, float* %4
%5 = load i32, i32* %3
%6 = call i32 @__print_int(i32 %5)
%7 = load float, float* %4
%8 = call i32 @__print_float(float %7)
ret void
}

LLVM IR (-O2):
define void @pr(i32 %0, float %1) {
%3 = tail call i32 @__print_int(i32 %0)
%4 = tail call i32 @__print_float(float %1)
ret void
}
int *NewInt(size, message)
int size;
char *message;
{
  int *ptr;
  if (size <= 0)
    size = 1;
  ptr = (int *)Calloc((unsigned)size, (unsigned)sizeof(int), message);
  return (ptr);
}


x86 assembly (clang, -O0):
<NewInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jg     1130 <NewInt+0x20>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    $0x4,%esi
mov    $0x0,%al
call   1030 <Calloc@plt>
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<NewInt>:
push   %rax
mov    %rsi,%rdx
test   %edi,%edi
mov    $0x1,%eax
cmovle %eax,%edi
mov    $0x4,%esi
xor    %eax,%eax
call   1030 <Calloc@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i32* @NewInt(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32*
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i32, i32* %3
%7 = icmp sle i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 1, i32* %3
br label %9
9: ; preds = %8, %2
%10 = load i32, i32* %3
%11 = load i8*, i8** %4
%12 = call i32 (i32, i32, i8*, ...) bitcast (i32 (...)* @Calloc to i32 (i32, i32, i8*, ...)*)(i32 %10, i32 4, i8* %11)
%13 = sext i32 %12 to i64
%14 = inttoptr i64 %13 to i32*
store i32* %14, i32** %5
%15 = load i32*, i32** %5
ret i32* %15
}

LLVM IR (-O2):
define i32* @NewInt(i32 %0, i8* %1) {
%3 = icmp sgt i32 %0, 1
%4 = select i1 %3, i32 %0, i32 1
%5 = tail call i32 (i32, i32, i8*, ...) bitcast (i32 (...)* @Calloc to i32 (i32, i32, i8*, ...)*)(i32 %4, i32 4, i8* %1)
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
ret i32* %7
}
void displayPathtoPrincess(int m, char grid[101][101]) {}


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

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

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

LLVM IR (-O2):
define void @displayPathtoPrincess(i32 %0, [101 x i8]* nocapture %1) {
ret void
}
double fract1_15_to_float(unsigned short val) { return (double)val / 0x8000; }


x86 assembly (clang, -O0):
<fract1_15_to_float>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  0xee5(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fract1_15_to_float>:
cvtsi2sd %edi,%xmm0
mulsd  0xef4(%rip),%xmm0
ret

LLVM IR (-O0):
define double @fract1_15_to_float(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = uitofp i16 %3 to double
%5 = fdiv double %4, 3.276800e+04
ret double %5
}

LLVM IR (-O2):
define double @fract1_15_to_float(i16 zeroext %0) {
%2 = uitofp i16 %0 to double
%3 = fmul double %2, 0x3F00000000000000
ret double %3
}
int ds_selftest_pebs(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ds_selftest_pebs() {
ret i32 0
}
/* Variables and functions */
int cpuid(int);
int is_cpu_rev_a0(void) { return (cpuid(1) & 0xffff) == 0x0f10; }


x86 assembly (clang, -O0):
<is_cpu_rev_a0>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <cpuid@plt>
and    $0xffff,%eax
cmp    $0xf10,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_cpu_rev_a0>:
push   %rax
mov    $0x1,%edi
call   1030 <cpuid@plt>
movzwl %ax,%ecx
xor    %eax,%eax
cmp    $0xf10,%ecx
sete   %al
pop    %rcx
ret

LLVM IR (-O0):
define i32 @is_cpu_rev_a0() {
%1 = call i32 @cpuid(i32 1)
%2 = and i32 %1, 65535
%3 = icmp eq i32 %2, 3856
%4 = zext i1 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @is_cpu_rev_a0() {
%1 = tail call i32 @cpuid(i32 1)
%2 = and i32 %1, 65535
%3 = icmp eq i32 %2, 3856
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
unsigned long GetHeight57();
unsigned long getheight() { return GetHeight57(); }


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

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

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

LLVM IR (-O2):
define i64 @getheight() {
%1 = tail call i64 (...) @GetHeight57()
ret i64 %1
}
int calc(int x) { return 3 + (x * 4); }


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

x86 assembly (clang, -O2):
<calc>:
lea    0x3(,%rdi,4),%eax
ret

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

LLVM IR (-O2):
define i32 @calc(i32 %0) {
%2 = shl nsw i32 %0, 2
%3 = or i32 %2, 3
ret i32 %3
}
void g_strrstr_len() {}


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

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

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

LLVM IR (-O2):
define void @g_strrstr_len() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close_rtc_dev();
int /*<<< orphan*/ close_serial_dev();
int /*<<< orphan*/ close_snd_dev();
void cleanup(void) {
  close_rtc_dev();
  close_snd_dev();
  close_serial_dev();
}


x86 assembly (clang, -O0):
<cleanup>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <close_rtc_dev@plt>
mov    $0x0,%al
call   1030 <close_snd_dev@plt>
mov    $0x0,%al
call   1050 <close_serial_dev@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cleanup>:
push   %rax
xor    %eax,%eax
call   1040 <close_rtc_dev@plt>
xor    %eax,%eax
call   1030 <close_snd_dev@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <close_serial_dev@plt>

LLVM IR (-O0):
define void @cleanup() {
%1 = call i32 (...) @close_rtc_dev()
%2 = call i32 (...) @close_snd_dev()
%3 = call i32 (...) @close_serial_dev()
ret void
}

LLVM IR (-O2):
define void @cleanup() {
%1 = tail call i32 (...) @close_rtc_dev()
%2 = tail call i32 (...) @close_snd_dev()
%3 = tail call i32 (...) @close_serial_dev()
ret void
}
int Vec_FltSortCompare2(float *pp1, float *pp2) {
  if (*pp1 > *pp2)
    return -1;
  if (*pp1 < *pp2)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<Vec_FltSortCompare2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x18(%rbp),%rax
ucomiss (%rax),%xmm0
jbe    112d <Vec_FltSortCompare2+0x2d>
movl   $0xffffffff,-0x4(%rbp)
jmp    1159 <Vec_FltSortCompare2+0x59>
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm1
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm0
ucomiss %xmm1,%xmm0
jbe    1152 <Vec_FltSortCompare2+0x52>
movl   $0x1,-0x4(%rbp)
jmp    1159 <Vec_FltSortCompare2+0x59>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Vec_FltSortCompare2>:
movss  (%rdi),%xmm0
movss  (%rsi),%xmm1
xor    %ecx,%ecx
ucomiss %xmm0,%xmm1
seta   %cl
ucomiss %xmm1,%xmm0
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @Vec_FltSortCompare2(float* %0, float* %1) {
%3 = alloca i32
%4 = alloca float*
%5 = alloca float*
store float* %0, float** %4
store float* %1, float** %5
%6 = load float*, float** %4
%7 = load float, float* %6
%8 = load float*, float** %5
%9 = load float, float* %8
%10 = fcmp ogt float %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 float*, float** %4
%14 = load float, float* %13
%15 = load float*, float** %5
%16 = load float, float* %15
%17 = fcmp olt float %14, %16
br i1 %17, label %18, label %19
18: ; preds = %12
store i32 1, i32* %3
br label %20
19: ; preds = %12
store i32 0, i32* %3
br label %20
20: ; preds = %19, %18, %11
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @Vec_FltSortCompare2(float* nocapture %0, float* nocapture %1) {
%3 = load float, float* %0
%4 = load float, float* %1
%5 = fcmp ogt float %3, %4
%6 = fcmp olt float %3, %4
%7 = zext i1 %6 to i32
%8 = select i1 %5, i32 -1, i32 %7
ret i32 %8
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
int S_ISDIR(int /*<<< orphan*/);
int fstat(int, struct stat *);
int is_directory_fd(int fd) {
  struct stat st;
  return (fstat(fd, &st) == -1) ? -1 : S_ISDIR(st.st_mode);
}


x86 assembly (clang, -O0):
<is_directory_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
call   1040 <fstat@plt>
cmp    $0xffffffff,%eax
jne    114d <is_directory_fd+0x2d>
mov    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1158 <is_directory_fd+0x38>
mov    -0x8(%rbp),%edi
call   1030 <S_ISDIR@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_directory_fd>:
push   %rax
mov    %rsp,%rsi
call   1040 <fstat@plt>
cmp    $0xffffffff,%eax
je     1137 <is_directory_fd+0x17>
mov    (%rsp),%edi
pop    %rax
jmp    1030 <S_ISDIR@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @is_directory_fd(i32 %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @fstat(i32 %0, %struct.stat* %2)
%5 = icmp eq i32 %4, -1
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = tail call i32 @S_ISDIR(i32 %8)
br label %10
10: ; preds = %1, %6
%11 = phi i32 [ %9, %6 ], [ -1, %1 ]
ret i32 %11
}
int address(int instruction) { return instruction & 0x03ffffff; }


x86 assembly (clang, -O0):
<address>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x3ffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<address>:
mov    %edi,%eax
and    $0x3ffffff,%eax
ret

LLVM IR (-O0):
define i32 @address(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 67108863
ret i32 %4
}

LLVM IR (-O2):
define i32 @address(i32 %0) {
%2 = and i32 %0, 67108863
ret i32 %2
}
int compara(void *x1, void *x2) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @compara(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
unsigned int hashString(char *str) {
  unsigned int hash = 5381;
  int c;
  while ((c = *str++)) {
    hash = ((hash << 5) + hash) + c;
  }
  return hash;
}


x86 assembly (clang, -O0):
<hashString>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1505,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x10(%rbp)
cmp    $0x0,%eax
je     1141 <hashString+0x41>
mov    -0xc(%rbp),%eax
shl    $0x5,%eax
add    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    110f <hashString+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hashString>:
mov    (%rdi),%cl
test   %cl,%cl
je     1138 <hashString+0x38>
add    $0x1,%rdi
mov    $0x1505,%edx
mov    %edx,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl %cl,%ecx
shl    $0x5,%eax
add    %edx,%eax
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
mov    %eax,%edx
test   %cl,%cl
jne    1120 <hashString+0x20>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i32 @hashString(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %9, %4 ], [ %0, %1 ]
%7 = phi i32 [ %11, %4 ], [ 5381, %1 ]
%8 = sext i8 %5 to i32
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = mul i32 %7, 33
%11 = add i32 %10, %8
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 5381, %1 ], [ %11, %4 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char const *);
void errorMsg(const char *errorMessage) {
  printf("%s\n", errorMessage);
  exit(1);
}


x86 assembly (clang, -O0):
<errorMsg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<errorMsg>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @errorMsg(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
int stop_grid_computing() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @stop_grid_computing() {
ret i32 0
}
void tmrSetInterval(unsigned short count) {
  asm("cli");
  outb(0x40, count & 0xFF);
  outb(0x40, count >> 8);
  asm("sti");
}


x86 assembly (clang, -O0):
<tmrSetInterval>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
cli
movzwl -0x2(%rbp),%esi
and    $0xff,%esi
mov    $0x40,%edi
mov    $0x0,%al
call   1030 <outb@plt>
movzwl -0x2(%rbp),%esi
sar    $0x8,%esi
mov    $0x40,%edi
mov    $0x0,%al
call   1030 <outb@plt>
sti
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tmrSetInterval>:
push   %rbx
mov    %edi,%ebx
cli
movzbl %bl,%esi
mov    $0x40,%edi
xor    %eax,%eax
call   1030 <outb@plt>
shr    $0x8,%ebx
mov    $0x40,%edi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <outb@plt>
sti
pop    %rbx
ret

LLVM IR (-O0):
define void @tmrSetInterval(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, 255
%6 = call i32 (i32, i32, ...) bitcast (i32 (...)* @outb to i32 (i32, i32, ...)*)(i32 64, i32 %5)
%7 = load i16, i16* %2
%8 = zext i16 %7 to i32
%9 = ashr i32 %8, 8
%10 = call i32 (i32, i32, ...) bitcast (i32 (...)* @outb to i32 (i32, i32, ...)*)(i32 64, i32 %9)
ret void
}

LLVM IR (-O2):
define void @tmrSetInterval(i16 zeroext %0) {
tail call void asm sideeffect "cli", "~{dirflag},~{fpsr},~{flags}"()
%2 = zext i16 %0 to i32
%3 = and i32 %2, 255
%4 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @outb to i32 (i32, i32, ...)*)(i32 64, i32 %3)
%5 = lshr i32 %2, 8
%6 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @outb to i32 (i32, i32, ...)*)(i32 64, i32 %5)
tail call void asm sideeffect "sti", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
void initExpTab(void) { ; }


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

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

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

LLVM IR (-O2):
define void @initExpTab() {
ret void
}
/* Variables and functions */
size_t PartitionDispositionRipetitionR(int /*<<< orphan*/, int *, int *, size_t,
                                       size_t, int /*<<< orphan*/);
int /*<<< orphan*/ free(int *);
scalar_t__ malloc(size_t);
size_t PartitionDispositionRipetition(int *val, size_t n, size_t k) {
  size_t count;
  int *sol = (int *)malloc(n * sizeof(int));
  count = PartitionDispositionRipetitionR(0, val, sol, n, k, 0);
  free(sol);
  return (count);
}


x86 assembly (clang, -O0):
<PartitionDispositionRipetition>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
shl    $0x2,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
xor    %r9d,%r9d
mov    %r9d,%edi
call   1050 <PartitionDispositionRipetitionR@plt>
mov    %rax,-0x20(%rbp)
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PartitionDispositionRipetition>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%r15
lea    0x0(,%rsi,4),%rdi
call   1040 <malloc@plt>
mov    %rax,%r12
xor    %edi,%edi
mov    %r15,%rsi
mov    %rax,%rdx
mov    %rbx,%rcx
mov    %r14,%r8
xor    %r9d,%r9d
call   1050 <PartitionDispositionRipetitionR@plt>
mov    %rax,%rbx
mov    %r12,%rdi
call   1030 <free@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i64 @PartitionDispositionRipetition(i32* %0, i64 %1, i64 %2) {
%4 = alloca i32*
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i32*
store i32* %0, i32** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%9 = load i64, i64* %5
%10 = mul i64 %9, 4
%11 = call i64 @malloc(i64 %10)
%12 = inttoptr i64 %11 to i32*
store i32* %12, i32** %8
%13 = load i32*, i32** %4
%14 = load i32*, i32** %8
%15 = load i64, i64* %5
%16 = load i64, i64* %6
%17 = call i64 @PartitionDispositionRipetitionR(i32 0, i32* %13, i32* %14, i64 %15, i64 %16, i32 0)
store i64 %17, i64* %7
%18 = load i32*, i32** %8
%19 = call i32 @free(i32* %18)
%20 = load i64, i64* %7
ret i64 %20
}

LLVM IR (-O2):
define i64 @PartitionDispositionRipetition(i32* %0, i64 %1, i64 %2) {
%4 = shl i64 %1, 2
%5 = tail call i64 @malloc(i64 %4)
%6 = inttoptr i64 %5 to i32*
%7 = tail call i64 @PartitionDispositionRipetitionR(i32 0, i32* %0, i32* %6, i64 %1, i64 %2, i32 0)
%8 = tail call i32 @free(i32* %6)
ret i64 %7
}
void input_null_free(void *data) {}


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

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

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

LLVM IR (-O2):
define void @input_null_free(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ inputTaker(int);
int numberGenerator();
int /*<<< orphan*/ printf(char *);
int main() {
  int number;
  printf("\nThinking for a number....");
  number = numberGenerator();
  printf("\nThinking completed.");
  inputTaker(number);
  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 <printf@plt>
mov    $0x0,%al
call   1040 <numberGenerator@plt>
mov    %eax,-0x8(%rbp)
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
call   1050 <inputTaker@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <numberGenerator@plt>
mov    %eax,%ebx
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
mov    %ebx,%edi
call   1050 <inputTaker@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"\0AThinking for a number....\00"
@.str.1 = [21 x i8] c"\0AThinking completed.\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @numberGenerator()
store i32 %4, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%6 = load i32, i32* %2
%7 = call i32 @inputTaker(i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"\0AThinking for a number....\00"
@.str.1 = [21 x i8] c"\0AThinking completed.\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @numberGenerator()
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @inputTaker(i32 %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int i2c_close(int fd) {
  close(fd);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @i2c_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ PowerManagerP__1__ResourceDefaultOwner__requested();
void ArbiterP__2__ResourceDefaultOwner__requested(void) {
  PowerManagerP__1__ResourceDefaultOwner__requested();
}


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

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

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

LLVM IR (-O2):
define void @ArbiterP__2__ResourceDefaultOwner__requested() {
%1 = tail call i32 (...) @PowerManagerP__1__ResourceDefaultOwner__requested()
ret void
}
int sub(int number) {
  number--;
  return number;
}


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

x86 assembly (clang, -O2):
<sub>:
lea    -0x1(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @sub(i32 %0) {
%2 = add nsw i32 %0, -1
ret i32 %2
}
void foo(void) {
#pragma acc parallel loop tile(2, 3)
  for (short i = 0; i < 10; ++i)
    for (short j = 0; j < 10; ++j)
      ;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movw   $0x0,-0x2(%rbp)
movswl -0x2(%rbp),%eax
cmp    $0xa,%eax
jge    1156 <foo+0x56>
movw   $0x0,-0x4(%rbp)
movswl -0x4(%rbp),%eax
cmp    $0xa,%eax
jge    1140 <foo+0x40>
jmp    112f <foo+0x2f>
mov    -0x4(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0x4(%rbp)
jmp    111d <foo+0x1d>
jmp    1145 <foo+0x45>
mov    -0x2(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0x2(%rbp)
jmp    110a <foo+0xa>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @foo() {
ret void
}
int test10(int j) { return (j & 3) | 1; }


x86 assembly (clang, -O0):
<test10>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x3,%eax
or     $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test10>:
and    $0x2,%edi
lea    0x1(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @test10(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 3
%5 = or i32 %4, 1
ret i32 %5
}

LLVM IR (-O2):
define i32 @test10(i32 %0) {
%2 = and i32 %0, 2
%3 = or i32 %2, 1
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fread(unsigned int *, int, int, int /*<<< orphan*/ *);
unsigned int get_byte(FILE *s) {
  unsigned int tmp;
  fread(&tmp, sizeof(char), 1, s);
  return tmp & 0xFF;
}


x86 assembly (clang, -O0):
<get_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
lea    -0xc(%rbp),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   1030 <fread@plt>
mov    -0xc(%rbp),%eax
and    $0xff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_byte>:
push   %rax
mov    %rdi,%rcx
lea    0x4(%rsp),%rdi
mov    $0x1,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
movzbl 0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @get_byte(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @fread(i32* %3, i32 1, i32 1, i32* %4)
%6 = load i32, i32* %3
%7 = and i32 %6, 255
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_byte(i32* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @fread(i32* %2, i32 1, i32 1, i32* %0)
%5 = load i32, i32* %2
%6 = and i32 %5, 255
ret i32 %6
}
/* Variables and functions */
float value_noise_1d(float);
float call_vnoise1(float x) { return value_noise_1d(x); }


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

x86 assembly (clang, -O2):
<call_vnoise1>:
jmp    1030 <value_noise_1d@plt>

LLVM IR (-O0):
define float @call_vnoise1(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @value_noise_1d(float %3)
ret float %4
}

LLVM IR (-O2):
define float @call_vnoise1(float %0) {
%2 = tail call float @value_noise_1d(float %0)
ret float %2
}
/* Variables and functions */
int OK;
int fixterm() { return (OK); }


x86 assembly (clang, -O0):
<fixterm>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fixterm>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@OK = global i32 0
define i32 @fixterm() {
%1 = load i32, i32* @OK
ret i32 %1
}

LLVM IR (-O2):
@OK = global i32 0
define i32 @fixterm() {
%1 = load i32, i32* @OK
ret i32 %1
}
int f() {
  int x;
  return 1;
}


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

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

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

LLVM IR (-O2):
define i32 @f() {
ret i32 1
}
void allocate_conv(void) { return; }


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

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

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

LLVM IR (-O2):
define void @allocate_conv() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int Total_Pets;
  int Cats;
  int Dogs;
  int Ponies;
  int Others;
  Cats = 2;
  Dogs = 1;
  Ponies = 1;
  Others = 46;
  Total_Pets = Cats + Dogs + Ponies + Others;
  printf("We have %d pets in total", Total_Pets);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
movl   $0x2e,-0x18(%rbp)
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
add    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [25 x i8] c"We have %d pets in total\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i32 2, i32* %3
store i32 1, i32* %4
store i32 1, i32* %5
store i32 46, i32* %6
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = add nsw i32 %7, %8
%10 = load i32, i32* %5
%11 = add nsw i32 %9, %10
%12 = load i32, i32* %6
%13 = add nsw i32 %11, %12
store i32 %13, i32* %2
%14 = load i32, i32* %2
%15 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"We have %d pets in total\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 50)
ret i32 0
}
void free_dmatrix(double **m, int num_row) {
  int i;
  for (i = num_row - 1; i >= 0; i--)
    free(m[i]);
  free(m);
}


x86 assembly (clang, -O0):
<free_dmatrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jl     1151 <free_dmatrix+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1128 <free_dmatrix+0x18>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_dmatrix>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
test   %esi,%esi
jle    1146 <free_dmatrix+0x36>
mov    %esi,%ebx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    -0x2(%rbx),%eax
mov    (%r14,%rax,8),%rdi
call   1030 <free@plt>
add    $0xffffffffffffffff,%rbx
cmp    $0x1,%rbx
ja     1130 <free_dmatrix+0x20>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_dmatrix(double** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ %5, %4 ], [ %8, %6 ]
%8 = add nsw i64 %7, -1
%9 = and i64 %8, 4294967295
%10 = getelementptr inbounds double*, double** %0, i64 %9
%11 = bitcast double** %10 to i8**
%12 = load i8*, i8** %11
tail call void @free(i8* %12)
%13 = icmp ugt i64 %7, 1
br i1 %13, label %6, label %14
14: ; preds = %6, %2
%15 = bitcast double** %0 to i8*
tail call void @free(i8* %15)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void say_hi() { printf("Hi baby!"); }


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

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

LLVM IR (-O0):
@.str = [9 x i8] c"Hi baby!\00"
define void @say_hi() {
%1 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"Hi baby!\00"
define void @say_hi() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void lib_freeze(int v0) { printf("freeze  %d \n", v0); }


x86 assembly (clang, -O0):
<lib_freeze>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lib_freeze>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [13 x i8] c"freeze %d \0A\00"
define void @lib_freeze(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
double RAND_MAX;
double rand();
int randint(int min, int max) {
  return (min + (int)((max + 1) * (rand() / (RAND_MAX + 1.0))));
}


x86 assembly (clang, -O0):
<randint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    -0x14(%rbp),%eax
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
movsd  0xeb3(%rip),%xmm2
mov    0x2e94(%rip),%rcx
addsd  (%rcx),%xmm2
divsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
add    %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randint>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
add    $0x1,%esi
cvtsi2sd %esi,%xmm0
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
mov    0x2eb6(%rip),%rax
movsd  (%rax),%xmm1
addsd  0xec2(%rip),%xmm1
divsd  %xmm1,%xmm0
mulsd  0x8(%rsp),%xmm0
cvttsd2si %xmm0,%eax
add    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define i32 @randint(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 = add nsw i32 %6, 1
%8 = sitofp i32 %7 to double
%9 = call double (...) @rand()
%10 = load double, double* @RAND_MAX
%11 = fadd double %10, 1.000000e+00
%12 = fdiv double %9, %11
%13 = fmul double %8, %12
%14 = fptosi double %13 to i32
%15 = add nsw i32 %5, %14
ret i32 %15
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define i32 @randint(i32 %0, i32 %1) {
%3 = add nsw i32 %1, 1
%4 = sitofp i32 %3 to double
%5 = tail call double (...) @rand()
%6 = load double, double* @RAND_MAX
%7 = fadd double %6, 1.000000e+00
%8 = fdiv double %5, %7
%9 = fmul double %8, %4
%10 = fptosi double %9 to i32
%11 = add nsw i32 %10, %0
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct timeval {
  int /*<<< orphan*/ tv_usec;
  int /*<<< orphan*/ tv_sec;
};

/* Variables and functions */
int settimeofday(struct timeval *, void *);
int stime(time_t *t) {
  struct timeval tv = {.tv_sec = *t, .tv_usec = 0};
  return settimeofday(&tv, (void *)0);
}


x86 assembly (clang, -O0):
<stime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <settimeofday@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stime>:
push   %rax
movl   $0x0,(%rsp)
mov    (%rdi),%eax
mov    %eax,0x4(%rsp)
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <settimeofday@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i32 @stime(i32* %0) {
%2 = alloca i32*
%3 = alloca %struct.timeval
store i32* %0, i32** %2
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
store i32 0, i32* %4
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
%6 = load i32*, i32** %2
%7 = load i32, i32* %6
store i32 %7, i32* %5
%8 = call i32 @settimeofday(%struct.timeval* %3, i8* null)
ret i32 %8
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i32 @stime(i32* nocapture %0) {
%2 = alloca %struct.timeval
%3 = bitcast %struct.timeval* %2 to i8*
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 0
store i32 0, i32* %4
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 1
%6 = load i32, i32* %0
store i32 %6, i32* %5
%7 = call i32 @settimeofday(%struct.timeval* %2, i8* null)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ process_seperate();
int main() { process_seperate(); }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @process_seperate()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @process_seperate()
ret i32 0
}