xunge/DecIR huggingface dataset:
int *utworz(int wym) { return (int(*)[wym])malloc(wym * wym * sizeof(int)); }


x86 assembly (clang, -O0):
<utworz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
movslq %eax,%rdi
shl    $0x2,%rdi
call   1030 <malloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<utworz>:
imul   %edi,%edi
shl    $0x2,%rdi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i32* @utworz(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = zext i32 %3 to i64
%5 = load i32, i32* %2
%6 = load i32, i32* %2
%7 = mul nsw i32 %5, %6
%8 = sext i32 %7 to i64
%9 = mul i64 %8, 4
%10 = call i8* @malloc(i64 %9)
%11 = bitcast i8* %10 to i32*
ret i32* %11
}

LLVM IR (-O2):
define noalias i32* @utworz(i32 %0) {
%2 = mul nsw i32 %0, %0
%3 = zext i32 %2 to i64
%4 = shl nuw nsw i64 %3, 2
%5 = tail call i8* @malloc(i64 %4)
%6 = bitcast i8* %5 to i32*
ret i32* %6
}
/* Variables and functions */
int /*<<< orphan*/ test_assert(int);
int main(void) {
  char a[] = "Hello, world";
  int *p = (int *)a + 3;
  *p = 0;
  test_assert(a[2] == 'l');
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x11(%rbp)
mov    0xed8(%rip),%eax
mov    %eax,-0x9(%rbp)
mov    0xed3(%rip),%al
mov    %al,-0x5(%rbp)
lea    -0x11(%rbp),%rax
add    $0xc,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movl   $0x0,(%rax)
movsbl -0xf(%rbp),%eax
cmp    $0x6c,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <test_assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <test_assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.a = [13 x i8] c"Hello, world\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [13 x i8]
%3 = alloca i32*
store i32 0, i32* %1
%4 = bitcast [13 x i8]* %2 to i8*
%5 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 0
%6 = bitcast i8* %5 to i32*
%7 = getelementptr inbounds i32, i32* %6, i64 3
store i32* %7, i32** %3
%8 = load i32*, i32** %3
store i32 0, i32* %8
%9 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 2
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 108
%13 = zext i1 %12 to i32
%14 = call i32 @test_assert(i32 %13)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @test_assert(i32 1)
ret i32 0
}
int shortRunLengthAtfrom(int i, int runArray) {
  return ((unsigned)((((int *)runArray))[i]) >> 16);
}


x86 assembly (clang, -O0):
<shortRunLengthAtfrom>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movslq -0x8(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
shr    $0x10,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<shortRunLengthAtfrom>:
movslq %esi,%rax
movslq %edi,%rcx
movzwl 0x2(%rax,%rcx,4),%eax
ret

LLVM IR (-O0):
define i32 @shortRunLengthAtfrom(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 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
%8 = load i32, i32* %3
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i32, i32* %7, i64 %9
%11 = load i32, i32* %10
%12 = lshr i32 %11, 16
ret i32 %12
}

LLVM IR (-O2):
define i32 @shortRunLengthAtfrom(i32 %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = inttoptr i64 %3 to i32*
%5 = sext i32 %0 to i64
%6 = getelementptr inbounds i32, i32* %4, i64 %5
%7 = load i32, i32* %6
%8 = lshr i32 %7, 16
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ my_putstr2(char *);
void error_open(int openthis) {
  if (openthis == -1) {
    my_putstr2("\nError : Your open doesn't work and return -1 ");
    my_putstr2("This is why the program have stopped of himself\n\n");
    exit(-1);
  }
}


x86 assembly (clang, -O0):
<error_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
jne    1157 <error_open+0x37>
lea    0xec4(%rip),%rdi
call   1030 <my_putstr2@plt>
lea    0xee7(%rip),%rdi
call   1030 <my_putstr2@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<error_open>:
cmp    $0xffffffff,%edi
je     1126 <error_open+0x6>
ret
push   %rax
lea    0xed2(%rip),%rdi
call   1030 <my_putstr2@plt>
lea    0xef5(%rip),%rdi
call   1030 <my_putstr2@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [47 x i8] c"\0AError : Your open doesn't work and return -1 \00"
@.str.1 = [50 x i8] c"This is why the program have stopped of himself\0A\0A\00"
define void @error_open(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = call i32 @my_putstr2(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @my_putstr2(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @exit(i32 -1)
unreachable
9: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [47 x i8] c"\0AError : Your open doesn't work and return -1 \00"
@.str.1 = [50 x i8] c"This is why the program have stopped of himself\0A\0A\00"
define void @error_open(i32 %0) {
%2 = icmp eq i32 %0, -1
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = tail call i32 @my_putstr2(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @my_putstr2(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @exit(i32 -1)
unreachable
7: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ COLOR_GREEN;
int /*<<< orphan*/ ChangeColor(int /*<<< orphan*/);
void SetColorGreen() { ChangeColor(COLOR_GREEN); }


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

x86 assembly (clang, -O2):
<SetColorGreen>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <ChangeColor@plt>

LLVM IR (-O0):
@COLOR_GREEN = global i32 0
define void @SetColorGreen() {
%1 = load i32, i32* @COLOR_GREEN
%2 = call i32 @ChangeColor(i32 %1)
ret void
}

LLVM IR (-O2):
@COLOR_GREEN = global i32 0
define void @SetColorGreen() {
%1 = load i32, i32* @COLOR_GREEN
%2 = tail call i32 @ChangeColor(i32 %1)
ret void
}
void RTAvlrPVRemove(void) {}


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

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

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

LLVM IR (-O2):
define void @RTAvlrPVRemove() {
ret void
}
/* Variables and functions */
int __divdf3(int, int);
int __udivdi3(int a, int b) { return __divdf3(a, b); }


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

x86 assembly (clang, -O2):
<__udivdi3>:
jmp    1030 <__divdf3@plt>

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

LLVM IR (-O2):
define i32 @__udivdi3(i32 %0, i32 %1) {
%3 = tail call i32 @__divdf3(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ testCase(char *, char *, int);
void test2(void) {
  char haystack1[] = "THIS IS A TEST TEXT";
  char needle1[] = "TEST";
  testCase(haystack1, needle1, 10);
}


x86 assembly (clang, -O0):
<test2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xedc(%rip),%eax
mov    %eax,-0x10(%rbp)
mov    0xed7(%rip),%eax
mov    %eax,-0x25(%rbp)
mov    0xed2(%rip),%al
mov    %al,-0x21(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x25(%rbp),%rsi
mov    $0xa,%edx
call   1030 <testCase@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test2>:
sub    $0x28,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movl   $0x545845,0x20(%rsp)
movb   $0x0,0xc(%rsp)
movl   $0x54534554,0x8(%rsp)
54
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
mov    $0xa,%edx
call   1030 <testCase@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.test2.haystack1 = [20 x i8] c"THIS IS A TEST TEXT\00"
@__const.test2.needle1 = [5 x i8] c"TEST\00"
define void @test2() {
%1 = alloca [20 x i8]
%2 = alloca [5 x i8]
%3 = bitcast [20 x i8]* %1 to i8*
%4 = bitcast [5 x i8]* %2 to i8*
%5 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%6 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%7 = call i32 @testCase(i8* %5, i8* %6, i32 10)
ret void
}

LLVM IR (-O2):
@__const.test2.haystack1 = [20 x i8] c"THIS IS A TEST TEXT\00"
@__const.test2.needle1 = [5 x i8] c"TEST\00"
define void @test2() {
%1 = alloca [20 x i8]
%2 = alloca [5 x i8]
%3 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%5 = call i32 @testCase(i8* %3, i8* %4, i32 10)
ret void
}
void HammingDistance_NEON() {}


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

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

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

LLVM IR (-O2):
define void @HammingDistance_NEON() {
ret void
}
/* Type definitions */
struct group {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
struct group *getgrent(void) {
  ;
  errno = ENOSYS;
  return NULL;
  ;
}


x86 assembly (clang, -O0):
<getgrent>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec4(%rip),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getgrent>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.group = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define %struct.group* @getgrent() {
%1 = load i32, i32* @ENOSYS
store i32 %1, i32* @errno
ret %struct.group* null
}

LLVM IR (-O2):
%struct.group = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define noalias %struct.group* @getgrent() {
%1 = load i32, i32* @ENOSYS
store i32 %1, i32* @errno
ret %struct.group* null
}
/* Type definitions */
typedef scalar_t__ uint16_t;

/* Variables and functions */
float u16tof(uint16_t s) { return ((float)s) / ((float)(256)); }


x86 assembly (clang, -O0):
<u16tof>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cvtsi2ssq -0x8(%rbp),%xmm0
movss  0xeea(%rip),%xmm1
divss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<u16tof>:
cvtsi2ss %rdi,%xmm0
mulss  0xef3(%rip),%xmm0
ret

LLVM IR (-O0):
define float @u16tof(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = sitofp i64 %3 to float
%5 = fdiv float %4, 2.560000e+02
ret float %5
}

LLVM IR (-O2):
define float @u16tof(i64 %0) {
%2 = sitofp i64 %0 to float
%3 = fmul float %2, 3.906250e-03
ret float %3
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
bool errata_14() {
  if (*(uint32_t *)0x00FF0130 == 0x9ul) {
    if (*(uint32_t *)0x00FF0134 == 0x01ul) {
      return true;
    }
  }
  return false;
}


x86 assembly (clang, -O0):
<errata_14>:
push   %rbp
mov    %rsp,%rbp
mov    $0xff0130,%eax
movslq (%rax),%rax
cmp    $0x9,%rax
jne    1139 <errata_14+0x39>
mov    $0xff0134,%eax
movslq (%rax),%rax
cmp    $0x1,%rax
jne    1134 <errata_14+0x34>
movl   $0x1,-0x4(%rbp)
jmp    1140 <errata_14+0x40>
jmp    1139 <errata_14+0x39>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<errata_14>:
cmpl   $0x9,0xff0130
09
jne    1119 <errata_14+0x19>
mov    $0x1,%eax
cmpl   $0x1,0xff0134
01
je     111b <errata_14+0x1b>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @errata_14() {
%1 = alloca i32
%2 = load i32, i32* inttoptr (i64 16711984 to i32*)
%3 = sext i32 %2 to i64
%4 = icmp eq i64 %3, 9
br i1 %4, label %5, label %11
5: ; preds = %0
%6 = load i32, i32* inttoptr (i64 16711988 to i32*)
%7 = sext i32 %6 to i64
%8 = icmp eq i64 %7, 1
br i1 %8, label %9, label %10
9: ; preds = %5
store i32 1, i32* %1
br label %12
10: ; preds = %5
br label %11
11: ; preds = %10, %0
store i32 0, i32* %1
br label %12
12: ; preds = %11, %9
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
define i32 @errata_14() {
%1 = load i32, i32* inttoptr (i64 16711984 to i32*)
%2 = icmp eq i32 %1, 9
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = load i32, i32* inttoptr (i64 16711988 to i32*)
%5 = icmp eq i32 %4, 1
br i1 %5, label %7, label %6
6: ; preds = %3, %0
br label %7
7: ; preds = %3, %6
%8 = phi i32 [ 0, %6 ], [ 1, %3 ]
ret i32 %8
}
unsigned int getBuildNumber(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @getBuildNumber() {
ret i32 0
}
/* Variables and functions */
int rand();
int rl_skiplist_random_level() {
  int level = 1;
  while ((rand() & 0xFFFF) < (0.25 * 0xFFFF)) {
    level++;
  }
  return (level < 32) ? level : 32;
}


x86 assembly (clang, -O0):
<rl_skiplist_random_level>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
and    $0xffff,%eax
cvtsi2sd %eax,%xmm1
movsd  0xec9(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    114f <rl_skiplist_random_level+0x3f>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <rl_skiplist_random_level+0xf>
cmpl   $0x20,-0x4(%rbp)
jge    1164 <rl_skiplist_random_level+0x54>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1171 <rl_skiplist_random_level+0x61>
mov    $0x20,%eax
mov    %eax,-0x8(%rbp)
jmp    1171 <rl_skiplist_random_level+0x61>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rl_skiplist_random_level>:
push   %rbx
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %eax,%eax
call   1030 <rand@plt>
add    $0x1,%ebx
test   $0xc000,%eax
je     1120 <rl_skiplist_random_level+0x10>
cmp    $0x20,%ebx
mov    $0x20,%eax
cmovb  %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @rl_skiplist_random_level() {
%1 = alloca i32
store i32 1, i32* %1
br label %2
2: ; preds = %7, %0
%3 = call i32 (...) @rand()
%4 = and i32 %3, 65535
%5 = sitofp i32 %4 to double
%6 = fcmp olt double %5, 0x40CFFFE000000000
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32, i32* %1
%9 = add nsw i32 %8, 1
store i32 %9, i32* %1
br label %2
10: ; preds = %2
%11 = load i32, i32* %1
%12 = icmp slt i32 %11, 32
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = load i32, i32* %1
br label %16
15: ; preds = %10
br label %16
16: ; preds = %15, %13
%17 = phi i32 [ %14, %13 ], [ 32, %15 ]
ret i32 %17
}

LLVM IR (-O2):
define i32 @rl_skiplist_random_level() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 1, %0 ], [ %6, %1 ]
%3 = tail call i32 (...) @rand()
%4 = and i32 %3, 49152
%5 = icmp eq i32 %4, 0
%6 = add nuw nsw i32 %2, 1
br i1 %5, label %1, label %7
7: ; preds = %1
%8 = icmp ult i32 %2, 32
%9 = select i1 %8, i32 %2, i32 32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ test_msg(char *, int);
void sig_chld_handler(int signo) { test_msg("Receive signal %d\n", signo); }


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

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

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

LLVM IR (-O2):
@.str = [19 x i8] c"Receive signal %d\0A\00"
define void @sig_chld_handler(i32 %0) {
%2 = tail call i32 @test_msg(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sscanf(char const *, char *, unsigned int *);
unsigned int parseColor(const char *str) {
  unsigned c = 0;
  while (*str == ' ')
    ++str;
  if (*str == '#')
    sscanf(str + 1, "%x", &c);
  return c;
}


x86 assembly (clang, -O0):
<parseColor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jne    1144 <parseColor+0x34>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1123 <parseColor+0x13>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x23,%eax
jne    116c <parseColor+0x5c>
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
lea    0xe9d(%rip),%rsi
lea    -0xc(%rbp),%rdx
call   1030 <sscanf@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parseColor>:
push   %rax
movl   $0x0,0x4(%rsp)
nopl   0x0(%rax)
add    $0x1,%rdi
movzbl -0x1(%rdi),%eax
cmp    $0x20,%al
je     1120 <parseColor+0x10>
cmp    $0x23,%al
jne    1147 <parseColor+0x37>
lea    0xec9(%rip),%rsi
lea    0x4(%rsp),%rdx
call   1030 <sscanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%x\00"
define i32 @parseColor(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %9, %1
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 32
br i1 %8, label %9, label %12
9: ; preds = %4
%10 = load i8*, i8** %2
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %2
br label %4
12: ; preds = %4
%13 = load i8*, i8** %2
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 35
br i1 %16, label %17, label %21
17: ; preds = %12
%18 = load i8*, i8** %2
%19 = getelementptr inbounds i8, i8* %18, i64 1
%20 = call i32 @sscanf(i8* %19, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
br label %21
21: ; preds = %17, %12
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
@.str = [3 x i8] c"%x\00"
define i32 @parseColor(i8* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
br label %4
4: ; preds = %7, %1
%5 = phi i8* [ %0, %1 ], [ %8, %7 ]
%6 = load i8, i8* %5
switch i8 %6, label %13 [
i8 32, label %7
i8 35, label %9
]
7: ; preds = %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
br label %4
9: ; preds = %4
%10 = getelementptr inbounds i8, i8* %5, i64 1
%11 = call i32 @sscanf(i8* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%12 = load i32, i32* %2
br label %13
13: ; preds = %4, %9
%14 = phi i32 [ %12, %9 ], [ 0, %4 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("hello, world.\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
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 = alloca i32
store i32 0, i32* %1
%2 = 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
}
/* Variables and functions */
int SIG_BLOCK;
int SIG_SETMASK;
int SIG_UNBLOCK;
int rand();
int get_rand() {
  int r;
  r = rand();
  if ((r == SIG_BLOCK) || (r == SIG_SETMASK) || (r == SIG_UNBLOCK)) {
    r = get_rand();
  }
  return r;
}


x86 assembly (clang, -O0):
<get_rand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <rand@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2e94(%rip),%rcx
cmp    (%rcx),%eax
je     1168 <get_rand+0x48>
mov    -0x4(%rbp),%eax
mov    0x2e92(%rip),%rcx
cmp    (%rcx),%eax
je     1168 <get_rand+0x48>
mov    -0x4(%rbp),%eax
mov    0x2e88(%rip),%rcx
cmp    (%rcx),%eax
jne    1170 <get_rand+0x50>
call   1030 <get_rand@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_rand>:
push   %r15
push   %r14
push   %rbx
mov    0x2eb4(%rip),%rbx
mov    0x2ebd(%rip),%r14
mov    0x2ebe(%rip),%r15
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <rand@plt>
cmp    (%rbx),%eax
je     1130 <get_rand+0x20>
cmp    (%r14),%eax
je     1130 <get_rand+0x20>
cmp    (%r15),%eax
je     1130 <get_rand+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@SIG_BLOCK = global i32 0
@SIG_SETMASK = global i32 0
@SIG_UNBLOCK = global i32 0
define i32 @get_rand() {
%1 = alloca i32
%2 = call i32 (...) @rand()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = load i32, i32* @SIG_BLOCK
%5 = icmp eq i32 %3, %4
br i1 %5, label %14, label %6
6: ; preds = %0
%7 = load i32, i32* %1
%8 = load i32, i32* @SIG_SETMASK
%9 = icmp eq i32 %7, %8
br i1 %9, label %14, label %10
10: ; preds = %6
%11 = load i32, i32* %1
%12 = load i32, i32* @SIG_UNBLOCK
%13 = icmp eq i32 %11, %12
br i1 %13, label %14, label %16
14: ; preds = %10, %6, %0
%15 = call i32 @get_rand()
store i32 %15, i32* %1
br label %16
16: ; preds = %14, %10
%17 = load i32, i32* %1
ret i32 %17
}

LLVM IR (-O2):
@SIG_BLOCK = global i32 0
@SIG_SETMASK = global i32 0
@SIG_UNBLOCK = global i32 0
define i32 @get_rand() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @rand()
%3 = load i32, i32* @SIG_BLOCK
%4 = icmp eq i32 %2, %3
%5 = load i32, i32* @SIG_SETMASK
%6 = icmp eq i32 %2, %5
%7 = select i1 %4, i1 true, i1 %6
%8 = load i32, i32* @SIG_UNBLOCK
%9 = icmp eq i32 %2, %8
%10 = select i1 %7, i1 true, i1 %9
br i1 %10, label %1, label %11
11: ; preds = %1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void clearscr(void) {
  printf("\033[2J");
  printf("\033[H");
}


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

x86 assembly (clang, -O2):
<clearscr>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <printf@plt>
lea    0xee1(%rip),%rdi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"\1B[2J\00"
@.str.1 = [4 x i8] c"\1B[H\00"
define void @clearscr() {
%1 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"\1B[2J\00"
@.str.1 = [4 x i8] c"\1B[H\00"
define void @clearscr() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ author();
int /*<<< orphan*/ description();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ options();
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ usage();
int /*<<< orphan*/ version();
void help() {
  fprintf(stdout, "\x1b[34m"
                  "Program Name"
                  "\n\n"
                  "\x1b[0m");
  usage();
  description();
  options();
  author();
  version();
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
mov    0x2e75(%rip),%rax
mov    (%rax),%edi
lea    0xe8c(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1070 <usage@plt>
mov    $0x0,%al
call   1080 <description@plt>
mov    $0x0,%al
call   1030 <options@plt>
mov    $0x0,%al
call   1060 <author@plt>
mov    $0x0,%al
call   1050 <version@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<help>:
push   %rax
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
lea    0xe8f(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1070 <usage@plt>
xor    %eax,%eax
call   1080 <description@plt>
xor    %eax,%eax
call   1030 <options@plt>
xor    %eax,%eax
call   1060 <author@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <version@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [24 x i8] c"\1B[34mProgram Name\0A\0A\1B[0m\00"
define void @help() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @usage()
%4 = call i32 (...) @description()
%5 = call i32 (...) @options()
%6 = call i32 (...) @author()
%7 = call i32 (...) @version()
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [24 x i8] c"\1B[34mProgram Name\0A\0A\1B[0m\00"
define void @help() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @usage()
%4 = tail call i32 (...) @description()
%5 = tail call i32 (...) @options()
%6 = tail call i32 (...) @author()
%7 = tail call i32 (...) @version()
ret void
}
/* Variables and functions */
scalar_t__ ioctl_ReportASF(int, int /*<<< orphan*/ *, int *);
int GetASF(int i_fd) {
  int i_asf = 0;
  if (ioctl_ReportASF(i_fd, NULL, &i_asf) != 0) {
    return -1;
  }
  return i_asf;
}


x86 assembly (clang, -O0):
<GetASF>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%edi
xor    %eax,%eax
mov    %eax,%esi
lea    -0xc(%rbp),%rdx
call   1030 <ioctl_ReportASF@plt>
cmp    $0x0,%rax
je     1148 <GetASF+0x38>
movl   $0xffffffff,-0x4(%rbp)
jmp    114e <GetASF+0x3e>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetASF>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rdx
xor    %esi,%esi
call   1030 <ioctl_ReportASF@plt>
neg    %rax
sbb    %eax,%eax
or     0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @GetASF(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 = call i64 @ioctl_ReportASF(i32 %5, i32* null, i32* %4)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 -1, i32* %2
br label %11
9: ; preds = %1
%10 = load i32, i32* %4
store i32 %10, i32* %2
br label %11
11: ; preds = %9, %8
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @GetASF(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%4 = call i64 @ioctl_ReportASF(i32 %0, i32* null, i32* %2)
%5 = icmp eq i64 %4, 0
%6 = load i32, i32* %2
%7 = select i1 %5, i32 %6, i32 -1
ret i32 %7
}
/* Type definitions */
struct kvm {
  int dummy;
};

/* Variables and functions */
char *strncpy(char *, char *, size_t);
char *symbol_lookup(struct kvm *kvm, unsigned long addr, char *sym,
                    size_t size) {
  char *s = strncpy(sym, "<unknown>", size);
  sym[size - 1] = '\0';
  return s;
}


x86 assembly (clang, -O0):
<symbol_lookup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rdx
lea    0xec9(%rip),%rsi
call   1030 <strncpy@plt>
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
sub    $0x1,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<symbol_lookup>:
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%rbx
lea    0xedf(%rip),%rsi
mov    %rdx,%rdi
mov    %rcx,%rdx
call   1030 <strncpy@plt>
movb   $0x0,-0x1(%r14,%rbx,1)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.kvm = type { i32 }
@.str = [10 x i8] c"<unknown>\00"
define i8* @symbol_lookup(%struct.kvm* %0, i64 %1, i8* %2, i64 %3) {
%5 = alloca %struct.kvm*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i8*
store %struct.kvm* %0, %struct.kvm** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%10 = load i8*, i8** %7
%11 = load i64, i64* %8
%12 = call i8* @strncpy(i8* %10, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i64 %11)
store i8* %12, i8** %9
%13 = load i8*, i8** %7
%14 = load i64, i64* %8
%15 = sub i64 %14, 1
%16 = getelementptr inbounds i8, i8* %13, i64 %15
store i8 0, i8* %16
%17 = load i8*, i8** %9
ret i8* %17
}

LLVM IR (-O2):
%struct.kvm = type { i32 }
@.str = [10 x i8] c"<unknown>\00"
define i8* @symbol_lookup(%struct.kvm* nocapture readnone %0, i64 %1, i8* returned %2, i64 %3) {
%5 = tail call i8* @strncpy(i8* dereferenceable(1) %2, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i64 %3)
%6 = add i64 %3, -1
%7 = getelementptr inbounds i8, i8* %2, i64 %6
store i8 0, i8* %7
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ fizzBuzz(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  printf("Input n: ");
  scanf("%d", &n);
  fizzBuzz(n);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
lea    0xebf(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x4(%rbp),%edi
call   1040 <fizzBuzz@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
lea    0xec6(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1040 <fizzBuzz@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"Input n: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @fizzBuzz(i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"Input n: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @fizzBuzz(i32 %5)
ret i32 0
}
int cmp_uint_gt(const void *a, const void *b) {
  unsigned int a_ = *(unsigned int *)a;
  unsigned int b_ = *(unsigned int *)b;
  if (a_ > b_)
    return -1;
  if (a_ < b_)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<cmp_uint_gt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jbe    1136 <cmp_uint_gt+0x36>
movl   $0xffffffff,-0x4(%rbp)
jmp    1155 <cmp_uint_gt+0x55>
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jae    114e <cmp_uint_gt+0x4e>
movl   $0x1,-0x4(%rbp)
jmp    1155 <cmp_uint_gt+0x55>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_uint_gt>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%eax
setb   %cl
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @cmp_uint_gt(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 ugt i32 %4, %6
%8 = icmp ult i32 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ loop();
int /*<<< orphan*/ setup();
int main(void) {
  setup();
  for (;;) {
    loop();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <setup@plt>
mov    $0x0,%al
call   1030 <loop@plt>
jmp    1136 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <setup@plt>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <loop@plt>
jmp    1130 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @setup()
br label %3
3: ; preds = %3, %0
%4 = call i32 (...) @loop()
br label %3
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @setup()
br label %2
2: ; preds = %2, %0
%3 = tail call i32 (...) @loop()
br label %2
}
/* Variables and functions */
size_t bitstobytes(const size_t n_bits) {
  size_t out = n_bits / 8;
  return out + ((n_bits % 8) ? 1 : 0);
}


x86 assembly (clang, -O0):
<bitstobytes>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x3,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rsi
and    $0x7,%rsi
xor    %ecx,%ecx
mov    $0x1,%edx
cmp    $0x0,%rsi
cmovne %edx,%ecx
movslq %ecx,%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitstobytes>:
mov    %rdi,%rax
shr    $0x3,%rax
and    $0x7,%edi
cmp    $0x1,%rdi
sbb    $0xffffffffffffffff,%rax
ret

LLVM IR (-O0):
define i64 @bitstobytes(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = udiv i64 %4, 8
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = load i64, i64* %2
%8 = urem i64 %7, 8
%9 = icmp ne i64 %8, 0
%10 = zext i1 %9 to i64
%11 = select i1 %9, i32 1, i32 0
%12 = sext i32 %11 to i64
%13 = add i64 %6, %12
ret i64 %13
}

LLVM IR (-O2):
define i64 @bitstobytes(i64 %0) {
%2 = lshr i64 %0, 3
%3 = and i64 %0, 7
%4 = icmp ne i64 %3, 0
%5 = zext i1 %4 to i64
%6 = add nuw nsw i64 %2, %5
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
char *strdup(char const *);
char *xstrdup(const char *str) {
  char *result = strdup(str);
  if (!result) {
    fprintf(stderr, "Out of memory\n");
    exit(EXIT_FAILURE);
  }
  return result;
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strdup@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1177 <xstrdup+0x47>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
lea    0xe9c(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e68(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %rax
call   1050 <strdup@plt>
test   %rax,%rax
je     113d <xstrdup+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [15 x i8] c"Out of memory\0A\00"
@EXIT_FAILURE = global i32 0
define noalias i8* @xstrdup(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %1
ret i8* %2
}
BOOST_AUTO_TEST_CASE(arcsin) { TESTCASE1(arcsin, 0, 0); }


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

x86 assembly (clang, -O2):
<BOOST_AUTO_TEST_CASE>:
xor    %esi,%esi
xor    %edx,%edx
xor    %eax,%eax
jmp    1030 <TESTCASE1@plt>

LLVM IR (-O0):
define i32 @BOOST_AUTO_TEST_CASE(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @TESTCASE1 to i32 (i32, i32, i32, ...)*)(i32 %4, i32 0, i32 0)
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
define i32 @BOOST_AUTO_TEST_CASE(i32 %0) {
%2 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @TESTCASE1 to i32 (i32, i32, i32, ...)*)(i32 %0, i32 0, i32 0)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void free_expanded(char *expanded) { free(expanded); }


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

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

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

LLVM IR (-O2):
define void @free_expanded(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int main() {
  printf("bad_func_call\n");
  __asm__("mov $0x7777777777777777, %rax\n\t"
          "call *%rax");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movabs $0x7777777777777777,%rax
77 77 77
call   *%rax
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
movabs $0x7777777777777777,%rax
77 77 77
call   *%rax
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"bad_func_call\0A\00"
define i32 @main() {
%1 = call i32 (i8*, ...) @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"bad_func_call\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))
tail call void asm sideeffect "mov $$0x7777777777777777, %rax\0A\09call *%rax", "~{dirflag},~{fpsr},~{flags}"()
ret i32 0
}
unsigned long Read_LE_Uint32_unsigned(const unsigned char *p) {
  return ((unsigned long)p[0] << 0) | ((unsigned long)p[1] << 8) |
         ((unsigned long)p[2] << 16) | ((unsigned long)p[3] << 24);
}


x86 assembly (clang, -O0):
<Read_LE_Uint32_unsigned>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
shl    $0x0,%rax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x8,%rcx
or     %rcx,%rax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x10,%rcx
or     %rcx,%rax
mov    -0x8(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
shl    $0x18,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Read_LE_Uint32_unsigned>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
define i64 @Read_LE_Uint32_unsigned(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i64
%7 = shl i64 %6, 0
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = zext i8 %10 to i64
%12 = shl i64 %11, 8
%13 = or i64 %7, %12
%14 = load i8*, i8** %2
%15 = getelementptr inbounds i8, i8* %14, i64 2
%16 = load i8, i8* %15
%17 = zext i8 %16 to i64
%18 = shl i64 %17, 16
%19 = or i64 %13, %18
%20 = load i8*, i8** %2
%21 = getelementptr inbounds i8, i8* %20, i64 3
%22 = load i8, i8* %21
%23 = zext i8 %22 to i64
%24 = shl i64 %23, 24
%25 = or i64 %19, %24
ret i64 %25
}

LLVM IR (-O2):
define i64 @Read_LE_Uint32_unsigned(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i64
%7 = shl nuw nsw i64 %6, 8
%8 = or i64 %7, %3
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = zext i8 %10 to i64
%12 = shl nuw nsw i64 %11, 16
%13 = or i64 %8, %12
%14 = getelementptr inbounds i8, i8* %0, i64 3
%15 = load i8, i8* %14
%16 = zext i8 %15 to i64
%17 = shl nuw nsw i64 %16, 24
%18 = or i64 %13, %17
ret i64 %18
}
/* Type definitions */
struct gate {
  int dummy;
};

/* Variables and functions */
int and_op(struct gate const *);
int nand_op(const struct gate *gate) {
  int truth = and_op(gate);
  return truth == -1 ? truth : !truth;
}


x86 assembly (clang, -O0):
<nand_op>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <and_op@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
jne    113d <nand_op+0x2d>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    114e <nand_op+0x3e>
cmpl   $0x0,-0xc(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nand_op>:
push   %rax
call   1030 <and_op@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
cmp    $0xffffffff,%eax
cmovne %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.gate = type { i32 }
define i32 @nand_op(%struct.gate* %0) {
%2 = alloca %struct.gate*
%3 = alloca i32
store %struct.gate* %0, %struct.gate** %2
%4 = load %struct.gate*, %struct.gate** %2
%5 = call i32 @and_op(%struct.gate* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i32, i32* %3
br label %15
10: ; preds = %1
%11 = load i32, i32* %3
%12 = icmp ne i32 %11, 0
%13 = xor i1 %12, true
%14 = zext i1 %13 to i32
br label %15
15: ; preds = %10, %8
%16 = phi i32 [ %9, %8 ], [ %14, %10 ]
ret i32 %16
}

LLVM IR (-O2):
%struct.gate = type { i32 }
define i32 @nand_op(%struct.gate* %0) {
%2 = tail call i32 @and_op(%struct.gate* %0)
%3 = icmp eq i32 %2, -1
%4 = icmp eq i32 %2, 0
%5 = zext i1 %4 to i32
%6 = select i1 %3, i32 -1, i32 %5
ret i32 %6
}
float fSign(const float number) {
  if (number >= 0.0f) {
    return 1;
  } else {
    return -1;
  }
}


x86 assembly (clang, -O0):
<fSign>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     112c <fSign+0x2c>
movss  0xee2(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1139 <fSign+0x39>
movss  0xecc(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fSign>:
xorps  %xmm1,%xmm1
xor    %eax,%eax
ucomiss %xmm1,%xmm0
setb   %al
lea    0xeee(%rip),%rcx
movss  (%rcx,%rax,4),%xmm0
ret

LLVM IR (-O0):
define float @fSign(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fcmp oge float %4, 0.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store float 1.000000e+00, float* %2
br label %8
7: ; preds = %1
store float -1.000000e+00, float* %2
br label %8
8: ; preds = %7, %6
%9 = load float, float* %2
ret float %9
}

LLVM IR (-O2):
define float @fSign(float %0) {
%2 = fcmp ult float %0, 0.000000e+00
%3 = select i1 %2, float -1.000000e+00, float 1.000000e+00
ret float %3
}
int re_match(bufp, string, size, pos, regs)
struct re_pattern_buffer *bufp;
const char *string;
int size, pos;
struct re_registers *regs;
{
  return re_match_2(bufp, 0, 0, string, size, pos, regs, size);
}


x86 assembly (clang, -O0):
<re_match>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    -0x14(%rbp),%r8d
mov    -0x18(%rbp),%r9d
mov    -0x20(%rbp),%r10
mov    -0x14(%rbp),%eax
xor    %edx,%edx
mov    %edx,%esi
mov    %r10,(%rsp)
mov    %eax,0x8(%rsp)
mov    $0x0,%al
call   1030 <re_match_2@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<re_match>:
push   %rax
mov    %r8,%r10
mov    %ecx,%r9d
mov    %edx,%r8d
mov    %rsi,%rcx
xor    %esi,%esi
xor    %edx,%edx
xor    %eax,%eax
push   %r8
push   %r10
call   1030 <re_match_2@plt>
add    $0x10,%rsp
pop    %rcx
ret

LLVM IR (-O0):
%struct.re_pattern_buffer = type opaque
%struct.re_registers = type opaque
define i32 @re_match(%struct.re_pattern_buffer* %0, i8* %1, i32 %2, i32 %3, %struct.re_registers* %4) {
%6 = alloca %struct.re_pattern_buffer*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca %struct.re_registers*
store %struct.re_pattern_buffer* %0, %struct.re_pattern_buffer** %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store %struct.re_registers* %4, %struct.re_registers** %10
%11 = load %struct.re_pattern_buffer*, %struct.re_pattern_buffer** %6
%12 = load i8*, i8** %7
%13 = load i32, i32* %8
%14 = load i32, i32* %9
%15 = load %struct.re_registers*, %struct.re_registers** %10
%16 = load i32, i32* %8
%17 = call i32 (%struct.re_pattern_buffer*, i32, i32, i8*, i32, i32, %struct.re_registers*, i32, ...) bitcast (i32 (...)* @re_match_2 to i32 (%struct.re_pattern_buffer*, i32, i32, i8*, i32, i32, %struct.re_registers*, i32, ...)*)(%struct.re_pattern_buffer* %11, i32 0, i32 0, i8* %12, i32 %13, i32 %14, %struct.re_registers* %15, i32 %16)
ret i32 %17
}

LLVM IR (-O2):
%struct.re_pattern_buffer = type opaque
%struct.re_registers = type opaque
define i32 @re_match(%struct.re_pattern_buffer* %0, i8* %1, i32 %2, i32 %3, %struct.re_registers* %4) {
%6 = tail call i32 (%struct.re_pattern_buffer*, i32, i32, i8*, i32, i32, %struct.re_registers*, i32, ...) bitcast (i32 (...)* @re_match_2 to i32 (%struct.re_pattern_buffer*, i32, i32, i8*, i32, i32, %struct.re_registers*, i32, ...)*)(%struct.re_pattern_buffer* %0, i32 0, i32 0, i8* %1, i32 %2, i32 %3, %struct.re_registers* %4, i32 %2)
ret i32 %6
}
void BN_GF2m_mod_exp_arr(void) {}


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

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

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

LLVM IR (-O2):
define void @BN_GF2m_mod_exp_arr() {
ret void
}