xunge/DecIR huggingface dataset:
/* Variables and functions */
unsigned long strlen(char *);
unsigned long HeaderLength(char *header) { return strlen(header) + 1; }


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

x86 assembly (clang, -O2):
<HeaderLength>:
push   %rax
call   1030 <strlen@plt>
add    $0x1,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @HeaderLength(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strlen(i8* %3)
%5 = add i64 %4, 1
ret i64 %5
}

LLVM IR (-O2):
define i64 @HeaderLength(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add i64 %2, 1
ret i64 %3
}
unsigned int more(unsigned int a) {
  unsigned int i;
  for (i = 0; i < a; i++) {
  }
  return a + 10;
}


x86 assembly (clang, -O0):
<more>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jae    112d <more+0x2d>
jmp    111f <more+0x1f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <more+0xe>
mov    -0x4(%rbp),%eax
add    $0xa,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @more(i32 %0) {
%2 = add i32 %0, 10
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ assertTrue(char *, int);
int compute(void *, int);
void test() {
  void *p = 0;
  int x = compute(p, 41);
  assertTrue("x == 82", x == 82);
  ;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x29,%esi
call   1040 <compute@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x52,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xeac(%rip),%rdi
call   1030 <assertTrue@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rax
xor    %edi,%edi
mov    $0x29,%esi
call   1040 <compute@plt>
xor    %esi,%esi
cmp    $0x52,%eax
sete   %sil
lea    0xec3(%rip),%rdi
pop    %rax
jmp    1030 <assertTrue@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"x == 82\00"
define void @test() {
%1 = alloca i8*
%2 = alloca i32
store i8* null, i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @compute(i8* %3, i32 41)
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp eq i32 %5, 82
%7 = zext i1 %6 to i32
%8 = call i32 @assertTrue(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"x == 82\00"
define void @test() {
%1 = tail call i32 @compute(i8* null, i32 41)
%2 = icmp eq i32 %1, 82
%3 = zext i1 %2 to i32
%4 = tail call i32 @assertTrue(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ zeroize(int /*<<< orphan*/ *, int);
void zeroize_stack(void) {
  uint8_t z[1024];
  zeroize(z, 1024);
}


x86 assembly (clang, -O0):
<zeroize_stack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1000,%rsp
lea    -0x1000(%rbp),%rdi
mov    $0x400,%esi
call   1030 <zeroize@plt>
add    $0x1000,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zeroize_stack>:
sub    $0x1008,%rsp
mov    %rsp,%rdi
mov    $0x400,%esi
call   1030 <zeroize@plt>
add    $0x1008,%rsp
ret

LLVM IR (-O0):
define void @zeroize_stack() {
%1 = alloca [1024 x i32]
%2 = getelementptr inbounds [1024 x i32], [1024 x i32]* %1, i64 0, i64 0
%3 = call i32 @zeroize(i32* %2, i32 1024)
ret void
}

LLVM IR (-O2):
define void @zeroize_stack() {
%1 = alloca [1024 x i32]
%2 = bitcast [1024 x i32]* %1 to i8*
%3 = getelementptr inbounds [1024 x i32], [1024 x i32]* %1, i64 0, i64 0
%4 = call i32 @zeroize(i32* %3, i32 1024)
ret void
}
int __ffs(unsigned long x) {
  int r;
  asm("	bsfl	%1, %0;"
      "	jnz	1f;"
      "	movl	$-1, %0;"
      "1:"
      : "=r"(r)
      : "rm"(x));
  return r + 1;
}


x86 assembly (clang, -O0):
<__ffs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
bsf    -0x18(%rbp),%eax
jne    111f <__ffs+0x1f>
mov    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define i32 @__ffs(i64 %0) {
%2 = alloca i64
%3 = alloca i32
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i32 asm "\09bsfl\09$1, $0;\09jnz\091f;\09movl\09$$-1, $0;1:", "=r,rm,~{dirflag},~{fpsr},~{flags}"(i64 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = add nsw i32 %6, 1
ret i32 %7
}

LLVM IR (-O2):
/* Variables and functions */
int omp_get_num_threads();
int omp_get_thread_num();
int /*<<< orphan*/ printf(char *, int);
int main() {
  int nthreads, tid;
#pragma omp parallel private(nthreads, tid)
  {
    tid = omp_get_thread_num();
    printf("Hello %d\n", tid);
    if (tid == 0) {
      nthreads = omp_get_num_threads();
      printf("Number is : %d\n", nthreads);
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <omp_get_thread_num@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xead(%rip),%rdi
call   1040 <printf@plt>
cmpl   $0x0,-0xc(%rbp)
jne    117b <main+0x4b>
mov    $0x0,%al
call   1050 <omp_get_num_threads@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe94(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <omp_get_thread_num@plt>
mov    %eax,%ebx
lea    0xebf(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
test   %ebx,%ebx
jne    1161 <main+0x31>
xor    %eax,%eax
call   1050 <omp_get_num_threads@plt>
lea    0xeb0(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"Hello %d\0A\00"
@.str.1 = [16 x i8] c"Number is : %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (...) @omp_get_thread_num()
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %3
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %0
%10 = call i32 (...) @omp_get_num_threads()
store i32 %10, i32* %2
%11 = load i32, i32* %2
%12 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %11)
br label %13
13: ; preds = %9, %0
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
@.str = [10 x i8] c"Hello %d\0A\00"
@.str.1 = [16 x i8] c"Number is : %d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @omp_get_thread_num()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = icmp eq i32 %1, 0
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = tail call i32 (...) @omp_get_num_threads()
%6 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %5)
br label %7
7: ; preds = %4, %0
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ z_streamp;

/* Variables and functions */
int /*<<< orphan*/ Z_DEFAULT_COMPRESSION;
int deflateInit(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ initialize(int /*<<< orphan*/);
extern int ssh_hans_zlib_deflateInit(z_streamp s) {
  initialize(s);
  return deflateInit(s, Z_DEFAULT_COMPRESSION);
}


x86 assembly (clang, -O0):
<ssh_hans_zlib_deflateInit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <initialize@plt>
mov    -0x4(%rbp),%edi
mov    0x2ea3(%rip),%rax
mov    (%rax),%esi
call   1040 <deflateInit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ssh_hans_zlib_deflateInit>:
push   %rbx
mov    %edi,%ebx
call   1030 <initialize@plt>
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
mov    %ebx,%edi
pop    %rbx
jmp    1040 <deflateInit@plt>

LLVM IR (-O0):
@Z_DEFAULT_COMPRESSION = global i32 0
define i32 @ssh_hans_zlib_deflateInit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @initialize(i32 %3)
%5 = load i32, i32* %2
%6 = load i32, i32* @Z_DEFAULT_COMPRESSION
%7 = call i32 @deflateInit(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
@Z_DEFAULT_COMPRESSION = global i32 0
define i32 @ssh_hans_zlib_deflateInit(i32 %0) {
%2 = tail call i32 @initialize(i32 %0)
%3 = load i32, i32* @Z_DEFAULT_COMPRESSION
%4 = tail call i32 @deflateInit(i32 %0, i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Project scope has yet to be defined; see README for details.\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 = [62 x i8] c"Project scope has yet to be defined; see README for details.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [61 x i8] c"Project scope has yet to be defined; see README for details.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct genlist {
  int dummy;
};
struct fc_sockaddr_list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ genlist_sort(struct genlist *,
                                int (*)(void const *, void const *));
void fc_sockaddr_list_sort(struct fc_sockaddr_list *tthis,
                           int (*compar)(const union fc_sockaddr *const *,
                                         const union fc_sockaddr *const *)) {
  genlist_sort((struct genlist *)tthis,
               (int (*)(const void *, const void *))compar);
}


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

x86 assembly (clang, -O2):
<fc_sockaddr_list_sort>:
jmp    1030 <genlist_sort@plt>

LLVM IR (-O0):
%struct.fc_sockaddr_list = type { i32 }
%union.fc_sockaddr = type opaque
%struct.genlist = type { i32 }
define void @fc_sockaddr_list_sort(%struct.fc_sockaddr_list* %0, i32 (%union.fc_sockaddr**, %union.fc_sockaddr**)* %1) {
%3 = alloca %struct.fc_sockaddr_list*
%4 = alloca i32 (%union.fc_sockaddr**, %union.fc_sockaddr**)*
store %struct.fc_sockaddr_list* %0, %struct.fc_sockaddr_list** %3
store i32 (%union.fc_sockaddr**, %union.fc_sockaddr**)* %1, i32 (%union.fc_sockaddr**, %union.fc_sockaddr**)** %4
%5 = load %struct.fc_sockaddr_list*, %struct.fc_sockaddr_list** %3
%6 = bitcast %struct.fc_sockaddr_list* %5 to %struct.genlist*
%7 = load i32 (%union.fc_sockaddr**, %union.fc_sockaddr**)*, i32 (%union.fc_sockaddr**, %union.fc_sockaddr**)** %4
%8 = bitcast i32 (%union.fc_sockaddr**, %union.fc_sockaddr**)* %7 to i32 (i8*, i8*)*
%9 = call i32 @genlist_sort(%struct.genlist* %6, i32 (i8*, i8*)* %8)
ret void
}

LLVM IR (-O2):
%struct.fc_sockaddr_list = type { i32 }
%union.fc_sockaddr = type opaque
%struct.genlist = type { i32 }
define void @fc_sockaddr_list_sort(%struct.fc_sockaddr_list* %0, i32 (%union.fc_sockaddr**, %union.fc_sockaddr**)* %1) {
%3 = bitcast %struct.fc_sockaddr_list* %0 to %struct.genlist*
%4 = bitcast i32 (%union.fc_sockaddr**, %union.fc_sockaddr**)* %1 to i32 (i8*, i8*)*
%5 = tail call i32 @genlist_sort(%struct.genlist* %3, i32 (i8*, i8*)* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ use_buf_malloc(int *, int);
int *wrap_malloc(int, int);
void call_malloc(int len, int what) {
  int grow = len * what;
  int *malloc_buf = wrap_malloc(sizeof(int), grow);
  use_buf_malloc(malloc_buf, grow);
}


x86 assembly (clang, -O0):
<call_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
mov    $0x4,%edi
call   1030 <wrap_malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <use_buf_malloc@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_malloc>:
push   %rbx
mov    %esi,%ebx
imul   %edi,%ebx
mov    $0x4,%edi
mov    %ebx,%esi
call   1030 <wrap_malloc@plt>
mov    %rax,%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1040 <use_buf_malloc@plt>

LLVM IR (-O0):
define void @call_malloc(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32*
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = mul nsw i32 %7, %8
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = call i32* @wrap_malloc(i32 4, i32 %10)
store i32* %11, i32** %6
%12 = load i32*, i32** %6
%13 = load i32, i32* %5
%14 = call i32 @use_buf_malloc(i32* %12, i32 %13)
ret void
}

LLVM IR (-O2):
define void @call_malloc(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
%4 = tail call i32* @wrap_malloc(i32 4, i32 %3)
%5 = tail call i32 @use_buf_malloc(i32* %4, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printSomeSpaces(unsigned int spcs) {
  for (int i = 0; i < spcs; i++) {
    printf(" ");
  }
}


x86 assembly (clang, -O0):
<printSomeSpaces>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jae    1148 <printSomeSpaces+0x38>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <printSomeSpaces+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printSomeSpaces>:
push   %rbx
test   %edi,%edi
je     112f <printSomeSpaces+0x1f>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1120 <printSomeSpaces+0x10>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
define void @printSomeSpaces(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %10, %1
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = icmp ult i32 %5, %6
br i1 %7, label %8, label %13
8: ; preds = %4
%9 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
br label %4
13: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @printSomeSpaces(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %4
3: ; preds = %4, %1
ret void
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 0, %1 ]
%6 = tail call i32 @putchar(i32 32)
%7 = add nuw i32 %5, 1
%8 = icmp eq i32 %7, %0
br i1 %8, label %3, label %4
}
int main() {
  char test[] = "123";
  return test[0] + test[1];
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    0xeef(%rip),%eax
mov    %eax,-0x8(%rbp)
movsbl -0x8(%rbp),%eax
movsbl -0x7(%rbp),%ecx
add    %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.test = [4 x i8] c"123\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x i8]
store i32 0, i32* %1
%3 = bitcast [4 x i8]* %2 to i8*
%4 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 1
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = add nsw i32 %6, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @main() {
ret i32 99
}
/* Variables and functions */
scalar_t__ cfl();
int /*<<< orphan*/ printf(char *, char *, char *);
int main(void) {
  printf("\nНизът %s%s", cfl() ? "" : "НЕ ", "се извежда от граматиката!");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <cfl@plt>
mov    %rax,%rcx
lea    0xed1(%rip),%rsi
lea    0xecf(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%rsi
lea    0xeaa(%rip),%rdi
lea    0xeba(%rip),%rdx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <cfl@plt>
test   %rax,%rax
lea    0xedf(%rip),%rax
lea    0xedd(%rip),%rsi
cmove  %rax,%rsi
lea    0xebc(%rip),%rdi
lea    0xecc(%rip),%rdx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"\0A\D0\9D\D0\B8\D0\B7\D1\8A\D1\82 %s%s\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [6 x i8] c"\D0\9D\D0\95 \00"
@.str.3 = [49 x i8] c"\D1\81\D0\B5 \D0\B8\D0\B7\D0\B2\D0\B5\D0\B6\D0\B4\D0\B0 \D0\BE\D1\82 \D0\B3\D1\80\D0\B0\D0\BC\D0\B0\D1\82\D0\B8\D0\BA\D0\B0\D1\82\D0\B0!\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @cfl()
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i64
%5 = select i1 %3, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0)
%6 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %5, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"\0A\D0\9D\D0\B8\D0\B7\D1\8A\D1\82 %s%s\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [6 x i8] c"\D0\9D\D0\95 \00"
@.str.3 = [49 x i8] c"\D1\81\D0\B5 \D0\B8\D0\B7\D0\B2\D0\B5\D0\B6\D0\B4\D0\B0 \D0\BE\D1\82 \D0\B3\D1\80\D0\B0\D0\BC\D0\B0\D1\82\D0\B8\D0\BA\D0\B0\D1\82\D0\B0!\00"
define i32 @main() {
%1 = tail call i64 (...) @cfl()
%2 = icmp eq i64 %1, 0
%3 = select i1 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %3, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ tan(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(int argc, char *argv[]) {
  srand(time(NULL));
  while (1) {
    tan(rand());
  }
  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)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
mov    $0x0,%al
call   1060 <rand@plt>
mov    %eax,%edi
call   1050 <tan@plt>
jmp    1166 <main+0x26>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
nop
xor    %eax,%eax
call   1060 <rand@plt>
mov    %eax,%edi
call   1050 <tan@plt>
jmp    1150 <main+0x10>

LLVM IR (-O0):
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 @time(i32* null)
%7 = call i32 @srand(i32 %6)
br label %8
8: ; preds = %2, %8
%9 = call i32 (...) @rand()
%10 = call i32 @tan(i32 %9)
br label %8
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @time(i32* null)
%4 = tail call i32 @srand(i32 %3)
br label %5
5: ; preds = %2, %5
%6 = tail call i32 (...) @rand()
%7 = tail call i32 @tan(i32 %6)
br label %5
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
void *malloc(size_t);
void *xmalloc(size_t size) {
  void *addr = malloc(size);
  assert(addr != NULL);
  return addr;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   1030 <assert@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = load i8*, i8** %3
ret i8* %10
}

LLVM IR (-O2):
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp ne i8* %2, null
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
ret i8* %2
}
/* Type definitions */
struct volperm_cmdline_parser_params {
  int dummy;
};
struct volperm_args_info {
  int dummy;
};

/* Variables and functions */
int volperm_cmdline_parser_internal(int, char **, struct volperm_args_info *,
                                    struct volperm_cmdline_parser_params *,
                                    int /*<<< orphan*/);
int volperm_cmdline_parser_ext(int argc, char **argv,
                               struct volperm_args_info *args_info,
                               struct volperm_cmdline_parser_params *params) {
  int result;
  result = volperm_cmdline_parser_internal(argc, argv, args_info, params, 0);
  return result;
}


x86 assembly (clang, -O0):
<volperm_cmdline_parser_ext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
xor    %r8d,%r8d
call   1030 <volperm_cmdline_parser_internal@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<volperm_cmdline_parser_ext>:
xor    %r8d,%r8d
jmp    1030 <volperm_cmdline_parser_internal@plt>

LLVM IR (-O0):
%struct.volperm_args_info = type { i32 }
%struct.volperm_cmdline_parser_params = type { i32 }
define i32 @volperm_cmdline_parser_ext(i32 %0, i8** %1, %struct.volperm_args_info* %2, %struct.volperm_cmdline_parser_params* %3) {
%5 = alloca i32
%6 = alloca i8**
%7 = alloca %struct.volperm_args_info*
%8 = alloca %struct.volperm_cmdline_parser_params*
%9 = alloca i32
store i32 %0, i32* %5
store i8** %1, i8*** %6
store %struct.volperm_args_info* %2, %struct.volperm_args_info** %7
store %struct.volperm_cmdline_parser_params* %3, %struct.volperm_cmdline_parser_params** %8
%10 = load i32, i32* %5
%11 = load i8**, i8*** %6
%12 = load %struct.volperm_args_info*, %struct.volperm_args_info** %7
%13 = load %struct.volperm_cmdline_parser_params*, %struct.volperm_cmdline_parser_params** %8
%14 = call i32 @volperm_cmdline_parser_internal(i32 %10, i8** %11, %struct.volperm_args_info* %12, %struct.volperm_cmdline_parser_params* %13, i32 0)
store i32 %14, i32* %9
%15 = load i32, i32* %9
ret i32 %15
}

LLVM IR (-O2):
%struct.volperm_args_info = type { i32 }
%struct.volperm_cmdline_parser_params = type { i32 }
define i32 @volperm_cmdline_parser_ext(i32 %0, i8** %1, %struct.volperm_args_info* %2, %struct.volperm_cmdline_parser_params* %3) {
%5 = tail call i32 @volperm_cmdline_parser_internal(i32 %0, i8** %1, %struct.volperm_args_info* %2, %struct.volperm_cmdline_parser_params* %3, i32 0)
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
void smpte_fec_set_na(uint8_t *p_fec, uint8_t na) { p_fec[14] = na; }


x86 assembly (clang, -O0):
<smpte_fec_set_na>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x38(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<smpte_fec_set_na>:
mov    %esi,0x38(%rdi)
ret

LLVM IR (-O0):
define void @smpte_fec_set_na(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 = getelementptr inbounds i32, i32* %6, i64 14
store i32 %5, i32* %7
ret void
}

LLVM IR (-O2):
define void @smpte_fec_set_na(i32* nocapture writeonly %0, i32 %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 14
store i32 %1, i32* %3
ret void
}
long lrintl(long double x) {
  long retval = 0l;
  __asm__ __volatile__("fistpl %0" : "=m"(retval) : "t"(x) : "st");
  return retval;
}


x86 assembly (clang, -O0):
<lrintl>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
movq   $0x0,-0x18(%rbp)
fldt   -0x10(%rbp)
fistpl -0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lrintl>:
fldt   0x8(%rsp)
movq   $0x0,-0x8(%rsp)
fistpl -0x8(%rsp)
mov    -0x8(%rsp),%rax
ret

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

LLVM IR (-O2):
define i64 @lrintl(x86_fp80 %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
store i64 0, i64* %2
%4 = load i64, i64* %2
ret i64 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ endmntent(int /*<<< orphan*/ *);
void endmntentp(FILE **p) {
  if (*p)
    endmntent(*p);
}


x86 assembly (clang, -O0):
<endmntentp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1136 <endmntentp+0x26>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <endmntent@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<endmntentp>:
mov    (%rdi),%rdi
test   %rdi,%rdi
je     111d <endmntentp+0xd>
jmp    1030 <endmntent@plt>
ret

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

LLVM IR (-O2):
define void @endmntentp(i32** nocapture %0) {
%2 = load i32*, i32** %0
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @endmntent(i32* %2)
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
int strtol(char *, char **, int);
int parse_integer(char *str, int *integer) {
  int n;
  char *end;
  if (str == NULL)
    return 0;
  n = strtol(str, &end, 10);
  if (end == str)
    return 0;
  *integer = n;
  return 1;
}


x86 assembly (clang, -O0):
<parse_integer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1137 <parse_integer+0x27>
movl   $0x0,-0x4(%rbp)
jmp    1176 <parse_integer+0x66>
mov    -0x10(%rbp),%rdi
lea    -0x28(%rbp),%rsi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x10(%rbp),%rax
jne    1166 <parse_integer+0x56>
movl   $0x0,-0x4(%rbp)
jmp    1176 <parse_integer+0x66>
mov    -0x1c(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_integer>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
xor    %ebp,%ebp
test   %rdi,%rdi
je     1143 <parse_integer+0x33>
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0x8(%rsp),%rsi
mov    $0xa,%edx
call   1030 <strtol@plt>
cmp    %rbx,0x8(%rsp)
je     1143 <parse_integer+0x33>
mov    %eax,(%r14)
mov    $0x1,%ebp
mov    %ebp,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @parse_integer(i8* %0, i32* nocapture writeonly %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = icmp eq i8* %0, null
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = call i32 @strtol(i8* %0, i8** %3, i32 10)
%8 = load i8*, i8** %3
%9 = icmp eq i8* %8, %0
br i1 %9, label %11, label %10
10: ; preds = %6
store i32 %7, i32* %1
br label %11
11: ; preds = %6, %2, %10
%12 = phi i32 [ 1, %10 ], [ 0, %2 ], [ 0, %6 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int unaddr_test3(int *val_p) {
  int x = 1;
  printf("testing access after free\n");
  return (*val_p & x) ? 1 : 0;
}


x86 assembly (clang, -O0):
<unaddr_test3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
and    -0xc(%rbp),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unaddr_test3>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
call   1030 <puts@plt>
mov    (%rbx),%eax
and    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"testing access after free\0A\00"
define i32 @unaddr_test3(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
store i32 1, i32* %3
%4 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%5 = load i32*, i32** %2
%6 = load i32, i32* %5
%7 = load i32, i32* %3
%8 = and i32 %6, %7
%9 = icmp ne i32 %8, 0
%10 = zext i1 %9 to i64
%11 = select i1 %9, i32 1, i32 0
ret i32 %11
}

LLVM IR (-O2):
@str = [26 x i8] c"testing access after free\00"
define i32 @unaddr_test3(i32* nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%3 = load i32, i32* %0
%4 = and i32 %3, 1
ret i32 %4
}
/* Variables and functions */
unsigned int getCPUID();
unsigned int getPROCID() {
  unsigned int procID;
  procID = getCPUID();
  if ((((procID >> 4) >> 12) & 0x0f) == 5) {
    return (procID & 0x03F);
  } else {
    return procID;
  }
}


x86 assembly (clang, -O0):
<getPROCID>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getCPUID@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shr    $0x4,%eax
shr    $0xc,%eax
and    $0xf,%eax
cmp    $0x5,%eax
jne    1145 <getPROCID+0x35>
mov    -0x8(%rbp),%eax
and    $0x3f,%eax
mov    %eax,-0x4(%rbp)
jmp    114b <getPROCID+0x3b>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getPROCID>:
push   %rax
xor    %eax,%eax
call   1030 <getCPUID@plt>
mov    %eax,%ecx
and    $0xf0000,%ecx
mov    %eax,%edx
and    $0x3f,%edx
cmp    $0x50000,%ecx
cmove  %edx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @getPROCID() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @getCPUID()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = lshr i32 %4, 4
%6 = lshr i32 %5, 12
%7 = and i32 %6, 15
%8 = icmp eq i32 %7, 5
br i1 %8, label %9, label %12
9: ; preds = %0
%10 = load i32, i32* %2
%11 = and i32 %10, 63
store i32 %11, i32* %1
br label %14
12: ; preds = %0
%13 = load i32, i32* %2
store i32 %13, i32* %1
br label %14
14: ; preds = %12, %9
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
define i32 @getPROCID() {
%1 = tail call i32 (...) @getCPUID()
%2 = and i32 %1, 983040
%3 = icmp eq i32 %2, 327680
%4 = and i32 %1, 63
%5 = select i1 %3, i32 %4, i32 %1
ret i32 %5
}
/* Variables and functions */
int const SIGPIPE;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int const, char *);
int /*<<< orphan*/ stderr;
void __attribute__((noreturn)) do_signal(const int sig) {
  fprintf(stderr, "send: UNEXPECTED SIGNAL %d%s- terminating\n", sig,
          sig == SIGPIPE ? " [SIGPIPE]" : "");
  fflush(stderr);
  exit(100);
}


x86 assembly (clang, -O0):
<do_signal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
mov    -0x4(%rbp),%esi
mov    0x2e87(%rip),%rax
mov    (%rax),%r8d
lea    0xecf(%rip),%rcx
lea    0xec9(%rip),%rax
cmp    %r8d,%esi
cmove  %rax,%rcx
lea    0xe90(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e64(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    $0x64,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<do_signal>:
push   %rbx
mov    %edi,%edx
mov    0x2ea6(%rip),%rbx
mov    (%rbx),%edi
test   %edx,%edx
lea    0xee6(%rip),%rax
lea    0xede(%rip),%rcx
cmove  %rax,%rcx
lea    0xea9(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
call   1040 <fflush@plt>
mov    $0x64,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [43 x i8] c"send: UNEXPECTED SIGNAL %d%s- terminating\0A\00"
@SIGPIPE = constant i32 0
@.str.1 = [11 x i8] c" [SIGPIPE]\00"
@.str.2 = [1 x i8] zeroinitializer
define void @do_signal(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = load i32, i32* %2
%5 = load i32, i32* %2
%6 = load i32, i32* @SIGPIPE
%7 = icmp eq i32 %5, %6
%8 = zext i1 %7 to i64
%9 = select i1 %7, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0)
%10 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 %4, i8* %9)
%11 = load i32, i32* @stderr
%12 = call i32 @fflush(i32 %11)
%13 = call i32 @exit(i32 100)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [43 x i8] c"send: UNEXPECTED SIGNAL %d%s- terminating\0A\00"
@SIGPIPE = constant i32 0
@.str.1 = [11 x i8] c" [SIGPIPE]\00"
@.str.2 = [1 x i8] zeroinitializer
define void @do_signal(i32 %0) {
%2 = load i32, i32* @stderr
%3 = icmp eq i32 %0, 0
%4 = select i1 %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0)
%5 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %4)
%6 = load i32, i32* @stderr
%7 = tail call i32 @fflush(i32 %6)
%8 = tail call i32 @exit(i32 100)
unreachable
}
void buzzer_init(void) {
  (*(volatile unsigned int *)0x7F0080A0) &= ~((0x3 << (14 * 2)));
  (*(volatile unsigned int *)0x7F0080A0) |= ((1 << (14 * 2)));
}


x86 assembly (clang, -O0):
<buzzer_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7f0080a0,%eax
mov    (%rax),%ecx
and    $0xcfffffff,%ecx
mov    $0x7f0080a0,%eax
mov    %ecx,(%rax)
mov    $0x7f0080a0,%eax
mov    (%rax),%ecx
or     $0x10000000,%ecx
mov    $0x7f0080a0,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<buzzer_init>:
andl   $0xcfffffff,0x7f0080a0
ff ff ff cf
orl    $0x10000000,0x7f0080a0
ret

LLVM IR (-O0):
define void @buzzer_init() {
%1 = load volatile i32, i32* inttoptr (i64 2130739360 to i32*)
%2 = and i32 %1, -805306369
store volatile i32 %2, i32* inttoptr (i64 2130739360 to i32*)
%3 = load volatile i32, i32* inttoptr (i64 2130739360 to i32*)
%4 = or i32 %3, 268435456
store volatile i32 %4, i32* inttoptr (i64 2130739360 to i32*)
ret void
}

LLVM IR (-O2):
define void @buzzer_init() {
%1 = load volatile i32, i32* inttoptr (i64 2130739360 to i32*)
%2 = and i32 %1, -805306369
store volatile i32 %2, i32* inttoptr (i64 2130739360 to i32*)
%3 = load volatile i32, i32* inttoptr (i64 2130739360 to i32*)
%4 = or i32 %3, 268435456
store volatile i32 %4, i32* inttoptr (i64 2130739360 to i32*)
ret void
}
/* Variables and functions */
scalar_t__ round(double volatile);
int main() {
  volatile double val = 1.0;
  return (int)round(val);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xed9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <round@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
movabs $0x3ff0000000000000,%rax
mov    %rax,-0x8(%rsp)
movsd  -0x8(%rsp),%xmm0
jmp    1030 <round@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca double
store i32 0, i32* %1
store volatile double 1.000000e+00, double* %2
%3 = load volatile double, double* %2
%4 = call i64 @round(double %3)
%5 = trunc i64 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
store volatile double 1.000000e+00, double* %1
%3 = load volatile double, double* %1
%4 = tail call i64 @round(double %3)
%5 = trunc i64 %4 to i32
ret i32 %5
}
int exists_character(char *buffer, int c) {
  int position = 1;
  if (!buffer)
    return 0;
  while (*buffer) {
    if (*buffer++ == c)
      return position;
    position++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<exists_character>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x1,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1129 <exists_character+0x29>
movl   $0x0,-0x4(%rbp)
jmp    1176 <exists_character+0x76>
jmp    112e <exists_character+0x2e>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     116f <exists_character+0x6f>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
cmp    -0x14(%rbp),%eax
jne    1161 <exists_character+0x61>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1176 <exists_character+0x76>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    112e <exists_character+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<exists_character>:
xor    %eax,%eax
test   %rdi,%rdi
je     1133 <exists_character+0x33>
mov    (%rdi),%dl
test   %dl,%dl
je     1133 <exists_character+0x33>
mov    $0x1,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl %dl,%edx
cmp    %esi,%edx
je     1134 <exists_character+0x34>
movzbl (%rdi,%rcx,1),%edx
add    $0x1,%rcx
test   %dl,%dl
jne    1120 <exists_character+0x20>
ret
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @exists_character(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 1, i32* %6
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %10, label %9
9: ; preds = %2
store i32 0, i32* %3
br label %28
10: ; preds = %2
br label %11
11: ; preds = %24, %10
%12 = load i8*, i8** %4
%13 = load i8, i8* %12
%14 = icmp ne i8 %13, 0
br i1 %14, label %15, label %27
15: ; preds = %11
%16 = load i8*, i8** %4
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %4
%18 = load i8, i8* %16
%19 = sext i8 %18 to i32
%20 = load i32, i32* %5
%21 = icmp eq i32 %19, %20
br i1 %21, label %22, label %24
22: ; preds = %15
%23 = load i32, i32* %6
store i32 %23, i32* %3
br label %28
24: ; preds = %15
%25 = load i32, i32* %6
%26 = add nsw i32 %25, 1
store i32 %26, i32* %6
br label %11
27: ; preds = %11
store i32 0, i32* %3
br label %28
28: ; preds = %27, %22, %9
%29 = load i32, i32* %3
ret i32 %29
}

LLVM IR (-O2):
define i32 @exists_character(i8* %0, i32 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %18, label %4
4: ; preds = %2
%5 = load i8, i8* %0
%6 = icmp eq i8 %5, 0
br i1 %6, label %18, label %7
7: ; preds = %4, %13
%8 = phi i8 [ %16, %13 ], [ %5, %4 ]
%9 = phi i32 [ %15, %13 ], [ 1, %4 ]
%10 = phi i8* [ %14, %13 ], [ %0, %4 ]
%11 = sext i8 %8 to i32
%12 = icmp eq i32 %11, %1
br i1 %12, label %18, label %13
13: ; preds = %7
%14 = getelementptr inbounds i8, i8* %10, i64 1
%15 = add nuw nsw i32 %9, 1
%16 = load i8, i8* %14
%17 = icmp eq i8 %16, 0
br i1 %17, label %18, label %7
18: ; preds = %7, %13, %4, %2
%19 = phi i32 [ 0, %2 ], [ 0, %4 ], [ %9, %7 ], [ 0, %13 ]
ret i32 %19
}
const char *__attribute__((short_call)) __attribute__((section(".test.a")))
__attribute__((no)) strong_s2(void) {
  return "strong_s2";
}


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"strong_s2\00"
define i8* @strong_s2() section ".test.a" {
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [10 x i8] c"strong_s2\00"
define i8* @strong_s2() section ".test.a" {
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ fctl_biased_fb2(void *, unsigned char);
void ctl_biased_fb2(void *d, unsigned char uc) {
  fctl_biased_fb2(d, uc / 127.0);
}


x86 assembly (clang, -O0):
<ctl_biased_fb2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
movzbl -0x9(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  0xeca(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
movzbl %al,%esi
call   1030 <fctl_biased_fb2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ctl_biased_fb2>:
cvtsi2sd %esi,%xmm0
divsd  0xee4(%rip),%xmm0
cvttsd2si %xmm0,%eax
movzbl %al,%esi
jmp    1030 <fctl_biased_fb2@plt>

LLVM IR (-O0):
define void @ctl_biased_fb2(i8* %0, i8 zeroext %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 = zext i8 %6 to i32
%8 = sitofp i32 %7 to double
%9 = fdiv double %8, 1.270000e+02
%10 = fptoui double %9 to i8
%11 = call i32 @fctl_biased_fb2(i8* %5, i8 zeroext %10)
ret void
}

LLVM IR (-O2):
define void @ctl_biased_fb2(i8* %0, i8 zeroext %1) {
%3 = uitofp i8 %1 to double
%4 = fdiv double %3, 1.270000e+02
%5 = fptoui double %4 to i8
%6 = tail call i32 @fctl_biased_fb2(i8* %0, i8 zeroext %5)
ret void
}
void start_lcd_thread(void) {}


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

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

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

LLVM IR (-O2):
define void @start_lcd_thread() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cpu_loop();
int main() {
  cpu_loop();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @cpu_loop()
ret i32 0
}
/* Variables and functions */
bool test_case_2(void) {
  if (2 + 2 == 5)
    return true;
  else
    return false;
}


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

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

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

LLVM IR (-O2):
define i32 @test_case_2() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void labelXAxis(int N) {
  printf("\n           ");
  for (int xLabel = 0; xLabel < N; xLabel++) {
    printf("M[0][%d]               ", xLabel);
  }
}


x86 assembly (clang, -O0):
<labelXAxis>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    115b <labelXAxis+0x4b>
mov    -0x8(%rbp),%esi
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1130 <labelXAxis+0x20>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<labelXAxis>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebx
lea    0xee3(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
test   %ebx,%ebx
jle    1153 <labelXAxis+0x43>
lea    0xede(%rip),%r14
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x1,%ebp
cmp    %ebp,%ebx
jne    1140 <labelXAxis+0x30>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [13 x i8] c"\0A \00"
@.str.1 = [24 x i8] c"M[0][%d] \00"
define void @labelXAxis(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %5
5: ; preds = %12, %1
%6 = load i32, i32* %3
%7 = load i32, i32* %2
%8 = icmp slt i32 %6, %7
br i1 %8, label %9, label %15
9: ; preds = %5
%10 = load i32, i32* %3
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %10)
br label %12
12: ; preds = %9
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %5
15: ; preds = %5
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"\0A \00"
@.str.1 = [24 x i8] c"M[0][%d] \00"
define void @labelXAxis(i32 %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%3 = icmp sgt i32 %0, 0
br i1 %3, label %5, label %4
4: ; preds = %5, %1
ret void
5: ; preds = %1, %5
%6 = phi i32 [ %8, %5 ], [ 0, %1 ]
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = add nuw nsw i32 %6, 1
%9 = icmp eq i32 %8, %0
br i1 %9, label %4, label %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void rgph_u32x4_murmur32v_data64(double const *, size_t, uintptr_t,
                                 int /*<<< orphan*/ *);
void rgph_u32x4_murmur32v_f64a(const double *key, size_t len, uintptr_t seed,
                               uint32_t *h) {
  return rgph_u32x4_murmur32v_data64(key, len, seed, h);
}


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

x86 assembly (clang, -O2):
<rgph_u32x4_murmur32v_f64a>:
jmp    1030 <rgph_u32x4_murmur32v_data64@plt>

LLVM IR (-O0):
define void @rgph_u32x4_murmur32v_f64a(double* %0, i64 %1, i64 %2, i32* %3) {
%5 = alloca double*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i32*
store double* %0, double** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i32* %3, i32** %8
%9 = load double*, double** %5
%10 = load i64, i64* %6
%11 = load i64, i64* %7
%12 = load i32*, i32** %8
ret void
}

LLVM IR (-O2):
define void @rgph_u32x4_murmur32v_f64a(double* %0, i64 %1, i64 %2, i32* %3) {
tail call void @rgph_u32x4_murmur32v_data64(double* %0, i64 %1, i64 %2, i32* %3)
ret void
}