xunge/DecIR huggingface dataset:
/* Variables and functions */
int C(int, int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  printf("%d\n", C(6, 2));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @C(i32 6, i32 2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
void s3c_nand_setname(char *name) {}


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

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

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

LLVM IR (-O2):
define void @s3c_nand_setname(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memmove(char *, char *, int);
int /*<<< orphan*/ puts(char *);
void memmoveTest() {
  char str[] = "memmove can be very useful......";
  memmove(str + 20, str + 15, 11);
  puts(str);
}


x86 assembly (clang, -O0):
<memmoveTest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x21,%edx
call   1040 <memcpy@plt>
lea    -0x30(%rbp),%rdi
add    $0x14,%rdi
lea    -0x30(%rbp),%rsi
add    $0xf,%rsi
mov    $0xb,%edx
call   1050 <memmove@plt>
lea    -0x30(%rbp),%rdi
call   1030 <puts@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memmoveTest>:
sub    $0x28,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,(%rsp)
movb   $0x0,0x20(%rsp)
lea    0x14(%rsp),%rdi
lea    0xf(%rsp),%rsi
mov    $0xb,%edx
call   1040 <memmove@plt>
mov    %rsp,%rdi
call   1030 <puts@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.memmoveTest.str = [33 x i8] c"memmove can be very useful......\00"
define void @memmoveTest() {
%1 = alloca [33 x i8]
%2 = bitcast [33 x i8]* %1 to i8*
%3 = getelementptr inbounds [33 x i8], [33 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds i8, i8* %3, i64 20
%5 = getelementptr inbounds [33 x i8], [33 x i8]* %1, i64 0, i64 0
%6 = getelementptr inbounds i8, i8* %5, i64 15
%7 = call i32 @memmove(i8* %4, i8* %6, i32 11)
%8 = getelementptr inbounds [33 x i8], [33 x i8]* %1, i64 0, i64 0
%9 = call i32 @puts(i8* %8)
ret void
}

LLVM IR (-O2):
@__const.memmoveTest.str = [33 x i8] c"memmove can be very useful......\00"
define void @memmoveTest() {
%1 = alloca [33 x i8]
%2 = getelementptr inbounds [33 x i8], [33 x i8]* %1, i64 0, i64 0
%3 = getelementptr inbounds [33 x i8], [33 x i8]* %1, i64 0, i64 20
%4 = getelementptr inbounds [33 x i8], [33 x i8]* %1, i64 0, i64 15
%5 = call i32 @memmove(i8* %3, i8* %4, i32 11)
%6 = call i32 @puts(i8* %2)
ret void
}
/* Variables and functions */
int dorun(char *, char **, int);
int runvp(char *name, char **argv) { return (dorun(name, argv, 1)); }


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

x86 assembly (clang, -O2):
<runvp>:
mov    $0x1,%edx
jmp    1030 <dorun@plt>

LLVM IR (-O0):
define i32 @runvp(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 = load i8**, i8*** %4
%7 = call i32 @dorun(i8* %5, i8** %6, i32 1)
ret i32 %7
}

LLVM IR (-O2):
define i32 @runvp(i8* %0, i8** %1) {
%3 = tail call i32 @dorun(i8* %0, i8** %1, i32 1)
ret i32 %3
}
/* Type definitions */
struct l_class_OC_Test2 {
  int dummy;
};
struct l_class_OC_Dummy {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _ZN5Test2C2Ev(struct l_class_OC_Test2 *);
void _ZN5DummyC2Ev(struct l_class_OC_Dummy *llvm_cbe_this) {
  struct l_class_OC_Dummy *llvm_cbe_this_2e_addr;
  struct l_class_OC_Dummy *llvm_cbe_this1;
  *(&llvm_cbe_this_2e_addr) = llvm_cbe_this;
  llvm_cbe_this1 = *(&llvm_cbe_this_2e_addr);
  _ZN5Test2C2Ev((((struct l_class_OC_Test2 *)llvm_cbe_this1)));
  return;
}


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

x86 assembly (clang, -O2):
<_ZN5DummyC2Ev>:
jmp    1030 <_ZN5Test2C2Ev@plt>

LLVM IR (-O0):
%struct.l_class_OC_Dummy = type { i32 }
%struct.l_class_OC_Test2 = type { i32 }
define void @_ZN5DummyC2Ev(%struct.l_class_OC_Dummy* %0) {
%2 = alloca %struct.l_class_OC_Dummy*
%3 = alloca %struct.l_class_OC_Dummy*
%4 = alloca %struct.l_class_OC_Dummy*
store %struct.l_class_OC_Dummy* %0, %struct.l_class_OC_Dummy** %2
%5 = load %struct.l_class_OC_Dummy*, %struct.l_class_OC_Dummy** %2
store %struct.l_class_OC_Dummy* %5, %struct.l_class_OC_Dummy** %3
%6 = load %struct.l_class_OC_Dummy*, %struct.l_class_OC_Dummy** %3
store %struct.l_class_OC_Dummy* %6, %struct.l_class_OC_Dummy** %4
%7 = load %struct.l_class_OC_Dummy*, %struct.l_class_OC_Dummy** %4
%8 = bitcast %struct.l_class_OC_Dummy* %7 to %struct.l_class_OC_Test2*
%9 = call i32 @_ZN5Test2C2Ev(%struct.l_class_OC_Test2* %8)
ret void
}

LLVM IR (-O2):
%struct.l_class_OC_Dummy = type { i32 }
%struct.l_class_OC_Test2 = type { i32 }
define void @_ZN5DummyC2Ev(%struct.l_class_OC_Dummy* %0) {
%2 = bitcast %struct.l_class_OC_Dummy* %0 to %struct.l_class_OC_Test2*
%3 = tail call i32 @_ZN5Test2C2Ev(%struct.l_class_OC_Test2* %2)
ret void
}
void sk_sort(void) {}


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

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

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

LLVM IR (-O2):
define void @sk_sort() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assem_debug(char *, int, int);
int /*<<< orphan*/ output_w32(int);
void emit_ftosizs(int s, int d) {
  assem_debug("ftosizs s%d,s%d\n", d, s);
  output_w32(0xeebd0ac0 | ((d & 14) << 11) | ((d & 1) << 22) | ((s & 14) >> 1) |
             ((s & 1) << 5));
}


x86 assembly (clang, -O0):
<emit_ftosizs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x4(%rbp),%edx
lea    0xec5(%rip),%rdi
call   1030 <assem_debug@plt>
mov    -0x8(%rbp),%edi
and    $0xe,%edi
shl    $0xb,%edi
or     $0xeebd0ac0,%edi
mov    -0x8(%rbp),%eax
and    $0x1,%eax
shl    $0x16,%eax
or     %eax,%edi
mov    -0x4(%rbp),%eax
and    $0xe,%eax
sar    $0x1,%eax
or     %eax,%edi
mov    -0x4(%rbp),%eax
and    $0x1,%eax
shl    $0x5,%eax
or     %eax,%edi
call   1040 <output_w32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_ftosizs>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xed2(%rip),%rdi
mov    %ebp,%edx
call   1030 <assem_debug@plt>
mov    %ebx,%eax
and    $0xe,%eax
shl    $0xb,%eax
and    $0x1,%ebx
shl    $0x16,%ebx
mov    %ebp,%ecx
shr    %ecx
and    $0x7,%ecx
shl    $0x5,%ebp
movzbl %bpl,%edi
or     %ecx,%edi
or     %ebx,%edi
or     %eax,%edi
or     $0xeebd0ac0,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <output_w32@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"ftosizs s%d,s%d\0A\00"
define void @emit_ftosizs(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = call i32 @assem_debug(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
%8 = load i32, i32* %4
%9 = and i32 %8, 14
%10 = shl i32 %9, 11
%11 = or i32 -289600832, %10
%12 = load i32, i32* %4
%13 = and i32 %12, 1
%14 = shl i32 %13, 22
%15 = or i32 %11, %14
%16 = load i32, i32* %3
%17 = and i32 %16, 14
%18 = ashr i32 %17, 1
%19 = or i32 %15, %18
%20 = load i32, i32* %3
%21 = and i32 %20, 1
%22 = shl i32 %21, 5
%23 = or i32 %19, %22
%24 = call i32 @output_w32(i32 %23)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"ftosizs s%d,s%d\0A\00"
define void @emit_ftosizs(i32 %0, i32 %1) {
%3 = tail call i32 @assem_debug(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %0)
%4 = shl i32 %1, 11
%5 = and i32 %4, 28672
%6 = shl i32 %1, 22
%7 = and i32 %6, 4194304
%8 = lshr i32 %0, 1
%9 = and i32 %8, 7
%10 = shl i32 %0, 5
%11 = and i32 %10, 32
%12 = or i32 %9, %11
%13 = or i32 %12, %7
%14 = or i32 %13, %5
%15 = or i32 %14, -289600832
%16 = tail call i32 @output_w32(i32 %15)
ret void
}
void foo449() {}


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

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

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

LLVM IR (-O2):
define void @foo449() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ findtarget(int, char *);
void xlcleanup(void) { findtarget(16, "not in a break loop"); }


x86 assembly (clang, -O0):
<xlcleanup>:
push   %rbp
mov    %rsp,%rbp
mov    $0x10,%edi
lea    0xee0(%rip),%rsi
call   1030 <findtarget@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<xlcleanup>:
lea    0xee9(%rip),%rsi
mov    $0x10,%edi
jmp    1030 <findtarget@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"not in a break loop\00"
define void @xlcleanup() {
%1 = call i32 @findtarget(i32 16, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"not in a break loop\00"
define void @xlcleanup() {
%1 = tail call i32 @findtarget(i32 16, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
size_t yuv422_sz(unsigned width, unsigned height) { return width * height * 2; }


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

x86 assembly (clang, -O2):
<yuv422_sz>:
imul   %esi,%edi
lea    (%rdi,%rdi,1),%eax
ret

LLVM IR (-O0):
define i64 @yuv422_sz(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 = mul i32 %5, %6
%8 = mul i32 %7, 2
%9 = zext i32 %8 to i64
ret i64 %9
}

LLVM IR (-O2):
define i64 @yuv422_sz(i32 %0, i32 %1) {
%3 = shl i32 %0, 1
%4 = mul i32 %3, %1
%5 = zext i32 %4 to i64
ret i64 %5
}
/* Variables and functions */
int strncmp(char *, char *, size_t);
size_t strnlen(char *, int);
int ice_cmp_str(const void *a, const void *b) {
  size_t sizemax = strnlen(*(char **)a, 512);
  return strncmp(*(char **)a, *(char **)b, sizemax);
}


x86 assembly (clang, -O0):
<ice_cmp_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    $0x200,%esi
call   1040 <strnlen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <strncmp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ice_cmp_str>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdi),%rdi
mov    $0x200,%esi
call   1040 <strnlen@plt>
mov    (%rbx),%rdi
mov    (%r14),%rsi
mov    %rax,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <strncmp@plt>

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

LLVM IR (-O2):
define i32 @ice_cmp_str(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = tail call i64 @strnlen(i8* %4, i32 512)
%6 = load i8*, i8** %3
%7 = bitcast i8* %1 to i8**
%8 = load i8*, i8** %7
%9 = tail call i32 @strncmp(i8* %6, i8* %8, i64 %5)
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void FreeHeap(void *a, long long n) { free(a); }


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

x86 assembly (clang, -O2):
<FreeHeap>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @FreeHeap(i8* nocapture %0, i64 %1) {
%3 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ NOROM_IntUnregister(int);
void stub1(uint32_t);
void SHA2IntUnregister(void) {
  ((void (*)(uint32_t ui32Interrupt))(
      (uint32_t *)(((uint32_t *)0x10000180)[12]))[5])(39);
  NOROM_IntUnregister(39);
}


x86 assembly (clang, -O0):
<SHA2IntUnregister>:
push   %rbp
mov    %rsp,%rbp
mov    $0x10000180,%eax
mov    0x60(%rax),%rax
mov    $0x27,%edi
call   *0x28(%rax)
mov    $0x27,%edi
call   1030 <NOROM_IntUnregister@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHA2IntUnregister>:
push   %rax
mov    0x100001e0,%rax
10
mov    $0x27,%edi
call   *0x28(%rax)
mov    $0x27,%edi
pop    %rax
jmp    1030 <NOROM_IntUnregister@plt>

LLVM IR (-O0):
define void @SHA2IntUnregister() {
%1 = load i64, i64* getelementptr inbounds (i64, i64* inttoptr (i64 268435840 to i64*), i64 12)
%2 = inttoptr i64 %1 to i64*
%3 = getelementptr inbounds i64, i64* %2, i64 5
%4 = load i64, i64* %3
%5 = inttoptr i64 %4 to void (i64)*
%6 = call i32 @NOROM_IntUnregister(i32 39)
ret void
}

LLVM IR (-O2):
define void @SHA2IntUnregister() {
%1 = load i64, i64* inttoptr (i64 268435936 to i64*)
%2 = inttoptr i64 %1 to i64*
%3 = getelementptr inbounds i64, i64* %2, i64 5
%4 = load i64, i64* %3
%5 = inttoptr i64 %4 to void (i64)*
tail call void %5(i64 39)
%6 = tail call i32 @NOROM_IntUnregister(i32 39)
ret void
}
long long __attribute__((no)) div(long long val) { return val / 32768; }


x86 assembly (clang, -O0):
<div>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x8000,%ecx
cqto
idiv   %rcx
pop    %rbp
ret

x86 assembly (clang, -O2):
<div>:
lea    0x7fff(%rdi),%rax
test   %rdi,%rdi
cmovns %rdi,%rax
sar    $0xf,%rax
ret

LLVM IR (-O0):
define i64 @div(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = sdiv i64 %3, 32768
ret i64 %4
}

LLVM IR (-O2):
define i64 @div(i64 %0) {
%2 = sdiv i64 %0, 32768
ret i64 %2
}
/* Type definitions */
typedef scalar_t__ uint16_t;
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
int16_t cmp16(uint16_t a, uint16_t b) { return (int16_t)(a - b); }


x86 assembly (clang, -O0):
<cmp16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
sub    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp16>:
mov    %rdi,%rax
sub    %esi,%eax
ret

LLVM IR (-O0):
define i32 @cmp16(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = sub nsw i64 %5, %6
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @cmp16(i64 %0, i64 %1) {
%3 = sub nsw i64 %0, %1
%4 = trunc i64 %3 to i32
ret i32 %4
}
char const *pubnub_uname(void) {
  return "POSIX"
         "-PubNub-C-core%2F"
         "3.1.0";
}


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

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

LLVM IR (-O0):
@.str = [28 x i8] c"POSIX-PubNub-C-core%2F3.1.0\00"
define i8* @pubnub_uname() {
ret i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [28 x i8] c"POSIX-PubNub-C-core%2F3.1.0\00"
define i8* @pubnub_uname() {
ret i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ scard_deinit();
int dev_redir_deinit(void) {
  scard_deinit();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @dev_redir_deinit() {
%1 = tail call i32 (...) @scard_deinit()
ret i32 0
}
void fill(unsigned long parms[]) {
  if (parms[1] == 0xFFFFFFFF)
    return;
  while (parms[1]--)
    *((unsigned long *)parms[0]++) = parms[2];
}


x86 assembly (clang, -O0):
<fill>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0xffffffff,%ecx
cmp    %rcx,0x8(%rax)
jne    1120 <fill+0x20>
jmp    1163 <fill+0x63>
jmp    1125 <fill+0x25>
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%rax
mov    %rax,%rdx
add    $0xffffffffffffffff,%rdx
mov    %rdx,0x8(%rcx)
cmp    $0x0,%rax
je     1163 <fill+0x63>
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%rcx
mov    -0x8(%rbp),%rdx
mov    (%rdx),%rax
mov    %rax,%rsi
add    $0x1,%rsi
mov    %rsi,(%rdx)
mov    %rcx,(%rax)
jmp    1125 <fill+0x25>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fill>:
mov    0x8(%rdi),%rax
mov    $0xffffffff,%ecx
cmp    %rcx,%rax
je     1138 <fill+0x38>
sub    $0x1,%rax
mov    %rax,0x8(%rdi)
jb     1138 <fill+0x38>
nopl   0x0(%rax,%rax,1)
mov    (%rdi),%rax
mov    0x10(%rdi),%rcx
lea    0x1(%rax),%rdx
mov    %rdx,(%rdi)
mov    %rcx,(%rax)
subq   $0x1,0x8(%rdi)
jae    1120 <fill+0x20>
ret

LLVM IR (-O0):
define void @fill(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = getelementptr inbounds i64, i64* %3, i64 1
%5 = load i64, i64* %4
%6 = icmp eq i64 %5, 4294967295
br i1 %6, label %7, label %8
7: ; preds = %1
br label %24
8: ; preds = %1
br label %9
9: ; preds = %15, %8
%10 = load i64*, i64** %2
%11 = getelementptr inbounds i64, i64* %10, i64 1
%12 = load i64, i64* %11
%13 = add i64 %12, -1
store i64 %13, i64* %11
%14 = icmp ne i64 %12, 0
br i1 %14, label %15, label %24
15: ; preds = %9
%16 = load i64*, i64** %2
%17 = getelementptr inbounds i64, i64* %16, i64 2
%18 = load i64, i64* %17
%19 = load i64*, i64** %2
%20 = getelementptr inbounds i64, i64* %19, i64 0
%21 = load i64, i64* %20
%22 = add i64 %21, 1
store i64 %22, i64* %20
%23 = inttoptr i64 %21 to i64*
store i64 %18, i64* %23
br label %9
24: ; preds = %7, %9
ret void
}

LLVM IR (-O2):
define void @fill(i64* nocapture %0) {
%2 = getelementptr inbounds i64, i64* %0, i64 1
%3 = load i64, i64* %2
%4 = icmp eq i64 %3, 4294967295
br i1 %4, label %18, label %5
5: ; preds = %1
%6 = add i64 %3, -1
store i64 %6, i64* %2
%7 = icmp eq i64 %3, 0
br i1 %7, label %18, label %8
8: ; preds = %5
%9 = getelementptr inbounds i64, i64* %0, i64 2
br label %10
10: ; preds = %8, %10
%11 = load i64, i64* %9
%12 = load i64, i64* %0
%13 = add i64 %12, 1
store i64 %13, i64* %0
%14 = inttoptr i64 %12 to i64*
store i64 %11, i64* %14
%15 = load i64, i64* %2
%16 = add i64 %15, -1
store i64 %16, i64* %2
%17 = icmp eq i64 %15, 0
br i1 %17, label %18, label %10
18: ; preds = %10, %5, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fast_bias(float, float);
float fast_gain(int /*<<< orphan*/, float);
float maya_contrast(float in_value, float in_contrast, float in_bias) {
  return fast_gain(fast_bias(in_value, in_bias), in_contrast);
}


x86 assembly (clang, -O0):
<maya_contrast>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
call   1030 <fast_bias@plt>
mov    %eax,%edi
movss  -0x8(%rbp),%xmm0
call   1040 <fast_gain@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<maya_contrast>:
push   %rax
movss  %xmm1,0x4(%rsp)
movaps %xmm2,%xmm1
call   1030 <fast_bias@plt>
mov    %eax,%edi
movss  0x4(%rsp),%xmm0
pop    %rax
jmp    1040 <fast_gain@plt>

LLVM IR (-O0):
define float @maya_contrast(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %6
%9 = call i32 @fast_bias(float %7, float %8)
%10 = load float, float* %5
%11 = call float @fast_gain(i32 %9, float %10)
ret float %11
}

LLVM IR (-O2):
define float @maya_contrast(float %0, float %1, float %2) {
%4 = tail call i32 @fast_bias(float %0, float %2)
%5 = tail call float @fast_gain(i32 %4, float %1)
ret float %5
}
int update_scf_depth(int depth) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @update_scf_depth(i32 %0) {
ret i32 1
}
/* Type definitions */
struct iam_leaf {
  int dummy;
};
struct iam_key {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ e_key(int /*<<< orphan*/);
int /*<<< orphan*/ e_keysize(int /*<<< orphan*/);
int /*<<< orphan*/ memcpy(int /*<<< orphan*/, struct iam_key const *,
                          int /*<<< orphan*/);
int /*<<< orphan*/ n_cur(struct iam_leaf *);
void __lvar_key_set(struct iam_leaf *l, const struct iam_key *k) {
  memcpy(e_key(n_cur(l)), k, e_keysize(n_cur(l)));
}


x86 assembly (clang, -O0):
<__lvar_key_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <n_cur@plt>
mov    %eax,%edi
call   1060 <e_key@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <n_cur@plt>
mov    %eax,%edi
call   1040 <e_keysize@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1050 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__lvar_key_set>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <n_cur@plt>
mov    %eax,%edi
call   1060 <e_key@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <n_cur@plt>
mov    %eax,%edi
call   1040 <e_keysize@plt>
mov    %ebp,%edi
mov    %r14,%rsi
mov    %eax,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <memcpy@plt>

LLVM IR (-O0):
%struct.iam_leaf = type { i32 }
%struct.iam_key = type { i32 }
define void @__lvar_key_set(%struct.iam_leaf* %0, %struct.iam_key* %1) {
%3 = alloca %struct.iam_leaf*
%4 = alloca %struct.iam_key*
store %struct.iam_leaf* %0, %struct.iam_leaf** %3
store %struct.iam_key* %1, %struct.iam_key** %4
%5 = load %struct.iam_leaf*, %struct.iam_leaf** %3
%6 = call i32 @n_cur(%struct.iam_leaf* %5)
%7 = call i32 @e_key(i32 %6)
%8 = load %struct.iam_key*, %struct.iam_key** %4
%9 = load %struct.iam_leaf*, %struct.iam_leaf** %3
%10 = call i32 @n_cur(%struct.iam_leaf* %9)
%11 = call i32 @e_keysize(i32 %10)
%12 = call i32 @memcpy(i32 %7, %struct.iam_key* %8, i32 %11)
ret void
}

LLVM IR (-O2):
%struct.iam_leaf = type { i32 }
%struct.iam_key = type { i32 }
define void @__lvar_key_set(%struct.iam_leaf* %0, %struct.iam_key* %1) {
%3 = tail call i32 @n_cur(%struct.iam_leaf* %0)
%4 = tail call i32 @e_key(i32 %3)
%5 = tail call i32 @n_cur(%struct.iam_leaf* %0)
%6 = tail call i32 @e_keysize(i32 %5)
%7 = tail call i32 @memcpy(i32 %4, %struct.iam_key* %1, i32 %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stop_and_wait();
void pipe_handle_pause(int x) {
  fprintf(stderr, "No reader to pipe we output data to, do something!\n");
  stop_and_wait();
}


x86 assembly (clang, -O0):
<pipe_handle_pause>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
lea    0xec5(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <stop_and_wait@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pipe_handle_pause>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <stop_and_wait@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [52 x i8] c"No reader to pipe we output data to, do something!\0A\00"
define void @pipe_handle_pause(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
%5 = call i32 (...) @stop_and_wait()
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [52 x i8] c"No reader to pipe we output data to, do something!\0A\00"
define void @pipe_handle_pause(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 (...) @stop_and_wait()
ret void
}
void rop3_87_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = T | S;
  stk1 = *D & stk2;
  stk1 = ~stk1;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_87_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0x9(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xc(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_87_0_0>:
or     %edx,%esi
and    (%rdi),%sil
not    %sil
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_87_0_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8, i8* %6
%10 = zext i8 %9 to i32
%11 = load i8, i8* %5
%12 = zext i8 %11 to i32
%13 = or i32 %10, %12
%14 = trunc i32 %13 to i8
store i8 %14, i8* %8
%15 = load i8*, i8** %4
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = load i8, i8* %8
%19 = zext i8 %18 to i32
%20 = and i32 %17, %19
%21 = trunc i32 %20 to i8
store i8 %21, i8* %7
%22 = load i8, i8* %7
%23 = zext i8 %22 to i32
%24 = xor i32 %23, -1
%25 = trunc i32 %24 to i8
store i8 %25, i8* %7
%26 = load i8, i8* %7
%27 = load i8*, i8** %4
store i8 %26, i8* %27
ret void
}

LLVM IR (-O2):
define void @rop3_87_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = or i8 %2, %1
%5 = load i8, i8* %0
%6 = and i8 %5, %4
%7 = xor i8 %6, -1
store i8 %7, i8* %0
ret void
}
func2(param) int param;
{ return param; }


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

x86 assembly (clang, -O2):
<func2>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @func2(i32 returned %0) {
ret i32 %0
}
__attribute__((destructor)) void done(void) {}


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

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

LLVM IR (-O0):
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @done, i8* null }]
define void @done() {
ret void
}

LLVM IR (-O2):
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @done, i8* null }]
define void @done() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void fun() {
  extern int c;
  printf("%d\n", c);
}


x86 assembly (clang, -O0):
<fun>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
lea    0xee0(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@c = external global i32
define void @fun() {
%1 = load i32, i32* @c
%2 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@c = external global i32
define void @fun() {
%1 = load i32, i32* @c
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int arm32_read_p15_c1();
int /*<<< orphan*/ arm32_write_p15_c1(int);
void arm32_mmu_disable(void) {
  uint32_t value = arm32_read_p15_c1();
  arm32_write_p15_c1(value & ~(1 << 0));
}


x86 assembly (clang, -O0):
<arm32_mmu_disable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <arm32_read_p15_c1@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
and    $0xfffffffe,%edi
call   1040 <arm32_write_p15_c1@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arm32_mmu_disable>:
push   %rax
xor    %eax,%eax
call   1030 <arm32_read_p15_c1@plt>
and    $0xfffffffe,%eax
mov    %eax,%edi
pop    %rax
jmp    1040 <arm32_write_p15_c1@plt>

LLVM IR (-O0):
define void @arm32_mmu_disable() {
%1 = alloca i32
%2 = call i32 (...) @arm32_read_p15_c1()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = and i32 %3, -2
%5 = call i32 @arm32_write_p15_c1(i32 %4)
ret void
}

LLVM IR (-O2):
define void @arm32_mmu_disable() {
%1 = tail call i32 (...) @arm32_read_p15_c1()
%2 = and i32 %1, -2
%3 = tail call i32 @arm32_write_p15_c1(i32 %2)
ret void
}
/* Variables and functions */
long long _strtoxl(char const *, char **, int, int);
long long int strtoll(const char *nptr, char **endptr, int base) {
  return _strtoxl(nptr, endptr, base, 1);
}


x86 assembly (clang, -O0):
<strtoll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    $0x1,%ecx
call   1030 <_strtoxl@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtoll>:
mov    $0x1,%ecx
jmp    1030 <_strtoxl@plt>

LLVM IR (-O0):
define i64 @strtoll(i8* %0, i8** %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i32
store i8* %0, i8** %4
store i8** %1, i8*** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8**, i8*** %5
%9 = load i32, i32* %6
%10 = call i64 @_strtoxl(i8* %7, i8** %8, i32 %9, i32 1)
ret i64 %10
}

LLVM IR (-O2):
define i64 @strtoll(i8* %0, i8** %1, i32 %2) {
%4 = tail call i64 @_strtoxl(i8* %0, i8** %1, i32 %2, i32 1)
ret i64 %4
}
int is_in_bound(int *arr, int size, int *ptr) {
  if (arr + size > ptr && ptr >= arr)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<is_in_bound>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
cmp    -0x20(%rbp),%rax
jbe    1142 <is_in_bound+0x42>
mov    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
jb     1142 <is_in_bound+0x42>
movl   $0x1,-0x4(%rbp)
jmp    1149 <is_in_bound+0x49>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_in_bound>:
movslq %esi,%rax
lea    (%rdi,%rax,4),%rax
cmp    %rdx,%rax
seta   %al
cmp    %rdi,%rdx
setae  %cl
and    %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @is_in_bound(i32* readnone %0, i32 %1, i32* readnone %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = icmp ugt i32* %5, %2
%7 = icmp uge i32* %2, %0
%8 = and i1 %7, %6
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
size_t size_to_mib(size_t sz) { return sz >> 20; }


x86 assembly (clang, -O0):
<size_to_mib>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x14,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<size_to_mib>:
mov    %rdi,%rax
shr    $0x14,%rax
ret

LLVM IR (-O0):
define i64 @size_to_mib(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 20
ret i64 %4
}

LLVM IR (-O2):
define i64 @size_to_mib(i64 %0) {
%2 = lshr i64 %0, 20
ret i64 %2
}
/* Variables and functions */
int strcmp(char const *, char const *);
int cmp_str(const void *apv, const void *bpv) {
  const char *a = *(const char *const *)apv;
  const char *b = *(const char *const *)bpv;
  return strcmp(a, b);
}


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

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

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

LLVM IR (-O2):
define i32 @cmp_str(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void checknum(int val) {
  if (val<1 | val> 9999) {
    printf("The number must be in range 1..9999\n");
    exit(0);
  }
}


x86 assembly (clang, -O0):
<checknum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%eax
cmpl   $0x270f,-0x4(%rbp)
setg   %cl
and    $0x1,%cl
movzbl %cl,%ecx
or     %ecx,%eax
cmp    $0x0,%eax
je     1165 <checknum+0x45>
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checknum>:
add    $0xffffd8f0,%edi
cmp    $0xffffd8f0,%edi
jbe    112f <checknum+0xf>
ret
push   %rax
lea    0xec9(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"The number must be in range 1..9999\0A\00"
define void @checknum(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 1
%5 = zext i1 %4 to i32
%6 = load i32, i32* %2
%7 = icmp sgt i32 %6, 9999
%8 = zext i1 %7 to i32
%9 = or i32 %5, %8
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %1
%12 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%13 = call i32 @exit(i32 0)
unreachable
14: ; preds = %1
ret void
}

LLVM IR (-O2):
@str = [36 x i8] c"The number must be in range 1..9999\00"
define void @checknum(i32 %0) {
%2 = add i32 %0, -10000
%3 = icmp ult i32 %2, -9999
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 0)
unreachable
7: ; preds = %1
ret void
}
reg0indreg1(r0, r1, x0, x1, p0, p1) unsigned int r0, r1;
unsigned int *p0, *p1;
{
  if (r0 <= (*p1))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<reg0indreg1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%eax
ja     1133 <reg0indreg1+0x33>
movl   $0x1,-0x4(%rbp)
jmp    113a <reg0indreg1+0x3a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reg0indreg1>:
xor    %eax,%eax
cmp    %edi,(%r9)
setae  %al
ret

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

LLVM IR (-O2):
define i32 @reg0indreg1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture readnone %4, i32* nocapture %5) {
%7 = load i32, i32* %5
%8 = icmp uge i32 %7, %0
%9 = zext i1 %8 to i32
ret i32 %9
}
int ft_numdigits(int n) {
  int i;
  i = 0;
  if (!n)
    return (1);
  while (n) {
    n /= 10;
    i++;
  }
  return (i);
}


x86 assembly (clang, -O0):
<ft_numdigits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1124 <ft_numdigits+0x24>
movl   $0x1,-0x4(%rbp)
jmp    1155 <ft_numdigits+0x55>
jmp    1129 <ft_numdigits+0x29>
cmpl   $0x0,-0x8(%rbp)
je     114f <ft_numdigits+0x4f>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1129 <ft_numdigits+0x29>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_numdigits>:
test   %edi,%edi
je     1133 <ft_numdigits+0x33>
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rdi
add    %edx,%edi
add    $0x1,%eax
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1110 <ft_numdigits+0x10>
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @ft_numdigits(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = sdiv i32 %5, 10
%7 = add nuw nsw i32 %4, 1
%8 = add i32 %5, 9
%9 = icmp ult i32 %8, 19
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 1, %1 ], [ %7, %3 ]
ret i32 %11
}
void post_sem(int *sem) { *sem = 1; }


x86 assembly (clang, -O0):
<post_sem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<post_sem>:
movl   $0x1,(%rdi)
ret

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

LLVM IR (-O2):
define void @post_sem(i32* nocapture writeonly %0) {
store i32 1, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ test_tca();
int /*<<< orphan*/ test_tca_speed();
int /*<<< orphan*/ test_tcapw();
int main() {
  test_tcapw();
  test_tca();
  test_tca_speed();
  printf("No test failed, tca_speed.log contains %d user speed test results.\n",
         1000);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <test_tcapw@plt>
mov    $0x0,%al
call   1050 <test_tca@plt>
mov    $0x0,%al
call   1040 <test_tca_speed@plt>
lea    0xe95(%rip),%rdi
mov    $0x3e8,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <test_tcapw@plt>
xor    %eax,%eax
call   1050 <test_tca@plt>
xor    %eax,%eax
call   1040 <test_tca_speed@plt>
lea    0xea3(%rip),%rdi
mov    $0x3e8,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [68 x i8] c"No test failed, tca_speed.log contains %d user speed test results.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_tcapw()
%3 = call i32 (...) @test_tca()
%4 = call i32 (...) @test_tca_speed()
%5 = call i32 @printf(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str, i64 0, i64 0), i32 1000)
ret i32 0
}

LLVM IR (-O2):
@.str = [68 x i8] c"No test failed, tca_speed.log contains %d user speed test results.\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @test_tcapw()
%2 = tail call i32 (...) @test_tca()
%3 = tail call i32 (...) @test_tca_speed()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str, i64 0, i64 0), i32 1000)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "fontbuild - build a font for use in Dream vs. "
                  "Dream.\n\tUsage: fontbuild font.png font.txt out.rf\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [97 x i8] c"fontbuild - build a font for use in Dream vs. Dream.\0A\09Usage: fontbuild font.png font.txt out.rf\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([97 x i8], [97 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [97 x i8] c"fontbuild - build a font for use in Dream vs. Dream.\0A\09Usage: fontbuild font.png font.txt out.rf\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([97 x i8], [97 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void usage() { puts("usage: copyright <in-file>"); }


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

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

LLVM IR (-O0):
@.str = [27 x i8] c"usage: copyright <in-file>\00"
define void @usage() {
%1 = call i32 @puts(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"usage: copyright <in-file>\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ getDouble(int, double *);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ solve(double);
int main(int argc, char **argv) {
  double y;
  getDouble(1, &y);
  printf("%lf", solve(y));
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%edi
lea    -0x18(%rbp),%rsi
call   1050 <getDouble@plt>
movsd  -0x18(%rbp),%xmm0
call   1030 <solve@plt>
mov    %eax,%esi
lea    0xe99(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e6d(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %rsp,%rsi
mov    $0x1,%edi
call   1050 <getDouble@plt>
movsd  (%rsp),%xmm0
call   1030 <solve@plt>
lea    0xeb1(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    0x2e83(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%lf\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 @getDouble(i32 1, double* %6)
%8 = load double, double* %6
%9 = call i32 @solve(double %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = load i32, i32* @EXIT_SUCCESS
ret i32 %11
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca double
%4 = bitcast double* %3 to i8*
%5 = call i32 @getDouble(i32 1, double* %3)
%6 = load double, double* %3
%7 = call i32 @solve(double %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32, i32* @EXIT_SUCCESS
ret i32 %9
}