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

/* Variables and functions */
int /*<<< orphan*/ get_program_name(char *, int);
int /*<<< orphan*/ my_system(char *, char *);
void disassemble_me() {
  char myname[1024];
  get_program_name(myname, sizeof(myname));
  my_system("objdump --disassemble --source %s", myname);
}


x86 assembly (clang, -O0):
<disassemble_me>:
push   %rbp
mov    %rsp,%rbp
sub    $0x400,%rsp
lea    -0x400(%rbp),%rdi
mov    $0x400,%esi
call   1040 <get_program_name@plt>
lea    -0x400(%rbp),%rsi
lea    0xeb6(%rip),%rdi
call   1030 <my_system@plt>
add    $0x400,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<disassemble_me>:
push   %rbx
sub    $0x400,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x400,%esi
call   1040 <get_program_name@plt>
lea    0xec1(%rip),%rdi
mov    %rbx,%rsi
call   1030 <my_system@plt>
add    $0x400,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [34 x i8] c"objdump --disassemble --source %s\00"
define void @disassemble_me() {
%1 = alloca [1024 x i8]
%2 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%3 = call i32 @get_program_name(i8* %2, i32 1024)
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%5 = call i32 @my_system(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"objdump --disassemble --source %s\00"
define void @disassemble_me() {
%1 = alloca [1024 x i8]
%2 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%3 = call i32 @get_program_name(i8* %2, i32 1024)
%4 = call i32 @my_system(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %2)
ret void
}
void UARTFIFODisable(unsigned int baseAdd) {
  (*((volatile unsigned int *)(baseAdd + (0x8)))) = 0;
}


x86 assembly (clang, -O0):
<UARTFIFODisable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x8,%eax
mov    %eax,%eax
movl   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTFIFODisable>:
add    $0x8,%edi
movl   $0x0,(%rdi)
ret

LLVM IR (-O0):
define void @UARTFIFODisable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, 8
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
store volatile i32 0, i32* %6
ret void
}

LLVM IR (-O2):
define void @UARTFIFODisable(i32 %0) {
%2 = add i32 %0, 8
%3 = zext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
store volatile i32 0, i32* %4
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fwrite(char const *, int, int /*<<< orphan*/,
                          int /*<<< orphan*/ *);
int /*<<< orphan*/ strlen(char const *);
void print(FILE *fp, const char *s) { fwrite(s, sizeof(char), strlen(s), fp); }


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%edx
mov    -0x8(%rbp),%rcx
mov    $0x1,%esi
call   1040 <fwrite@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    %eax,%edx
mov    %r14,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <fwrite@plt>

LLVM IR (-O0):
define void @print(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i8*, i8** %4
%7 = call i32 @strlen(i8* %6)
%8 = load i32*, i32** %3
%9 = call i32 @fwrite(i8* %5, i32 1, i32 %7, i32* %8)
ret void
}

LLVM IR (-O2):
define void @print(i32* nocapture %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @fwrite(i8* %1, i32 1, i32 %3, i32* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
size_t print_hexbin(int /*<<< orphan*/ *, double *, int);
size_t print_hexbin_double(FILE *fp, double value) {
  return print_hexbin(fp, &value, 8);
}


x86 assembly (clang, -O0):
<print_hexbin_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x8,%edx
call   1030 <print_hexbin@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_hexbin_double>:
push   %rax
movsd  %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0x8,%edx
call   1030 <print_hexbin@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i64 @print_hexbin_double(i32* %0, double %1) {
%3 = alloca i32*
%4 = alloca double
store i32* %0, i32** %3
store double %1, double* %4
%5 = load i32*, i32** %3
%6 = call i64 @print_hexbin(i32* %5, double* %4, i32 8)
ret i64 %6
}

LLVM IR (-O2):
define i64 @print_hexbin_double(i32* %0, double %1) {
%3 = alloca double
store double %1, double* %3
%4 = call i64 @print_hexbin(i32* %0, double* %3, i32 8)
ret i64 %4
}
/* Variables and functions */
int RAND_query_egd_bytes(char const *, int /*<<< orphan*/ *, int);
int RAND_status();
int RAND_egd_bytes(const char *path, int bytes) {
  int num;
  num = RAND_query_egd_bytes(path, NULL, bytes);
  if (num < 0)
    return -1;
  if (RAND_status() != 1)
    return -1;
  return num;
}


x86 assembly (clang, -O0):
<RAND_egd_bytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
xor    %eax,%eax
mov    %eax,%esi
call   1040 <RAND_query_egd_bytes@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jge    1158 <RAND_egd_bytes+0x38>
movl   $0xffffffff,-0x4(%rbp)
jmp    117a <RAND_egd_bytes+0x5a>
mov    $0x0,%al
call   1030 <RAND_status@plt>
cmp    $0x1,%eax
je     1174 <RAND_egd_bytes+0x54>
movl   $0xffffffff,-0x4(%rbp)
jmp    117a <RAND_egd_bytes+0x5a>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RAND_egd_bytes>:
push   %rbx
mov    %esi,%edx
xor    %esi,%esi
call   1040 <RAND_query_egd_bytes@plt>
test   %eax,%eax
js     1144 <RAND_egd_bytes+0x24>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <RAND_status@plt>
cmp    $0x1,%eax
mov    $0xffffffff,%eax
cmove  %ebx,%eax
pop    %rbx
ret
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @RAND_egd_bytes(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
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = call i32 @RAND_query_egd_bytes(i8* %7, i32* null, i32 %8)
store i32 %9, i32* %6
%10 = load i32, i32* %6
%11 = icmp slt i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %2
store i32 -1, i32* %3
br label %19
13: ; preds = %2
%14 = call i32 (...) @RAND_status()
%15 = icmp ne i32 %14, 1
br i1 %15, label %16, label %17
16: ; preds = %13
store i32 -1, i32* %3
br label %19
17: ; preds = %13
%18 = load i32, i32* %6
store i32 %18, i32* %3
br label %19
19: ; preds = %17, %16, %12
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
define i32 @RAND_egd_bytes(i8* %0, i32 %1) {
%3 = tail call i32 @RAND_query_egd_bytes(i8* %0, i32* null, i32 %1)
%4 = icmp slt i32 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i32 (...) @RAND_status()
%7 = icmp eq i32 %6, 1
%8 = select i1 %7, i32 %3, i32 -1
br label %9
9: ; preds = %5, %2
%10 = phi i32 [ -1, %2 ], [ %8, %5 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ locate(int, int);
int /*<<< orphan*/ printf(char *);
void report(int row, char *string) {
  locate(row, 42);
  printf(string);
}


x86 assembly (clang, -O0):
<report>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x2a,%esi
call   1040 <locate@plt>
mov    -0x10(%rbp),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<report>:
push   %rbx
mov    %rsi,%rbx
mov    $0x2a,%esi
call   1040 <locate@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
define void @report(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = call i32 @locate(i32 %5, i32 42)
%7 = load i8*, i8** %4
%8 = call i32 @printf(i8* %7)
ret void
}

LLVM IR (-O2):
define void @report(i32 %0, i8* nocapture %1) {
%3 = tail call i32 @locate(i32 %0, i32 42)
%4 = tail call i32 @printf(i8* dereferenceable(1) %1)
ret void
}
/* Variables and functions */
scalar_t__ memcmp(char *, char *, size_t);
int hash_key_compare(char *key1, size_t key1_len, char *key2, size_t key2_len) {
  if (key1_len == key2_len && *key1 == *key2 &&
      memcmp(key1, key2, key1_len) == 0) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<hash_key_compare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x28(%rbp),%rax
jne    1173 <hash_key_compare+0x63>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x20(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    1173 <hash_key_compare+0x63>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <memcmp@plt>
cmp    $0x0,%rax
jne    1173 <hash_key_compare+0x63>
movl   $0x1,-0x4(%rbp)
jmp    117a <hash_key_compare+0x6a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_key_compare>:
push   %rax
cmp    %rcx,%rsi
jne    112f <hash_key_compare+0x1f>
mov    (%rdi),%cl
cmp    (%rdx),%cl
jne    112f <hash_key_compare+0x1f>
mov    %rsi,%rax
mov    %rdx,%rsi
mov    %rax,%rdx
call   1030 <memcmp@plt>
test   %rax,%rax
je     1133 <hash_key_compare+0x23>
xor    %eax,%eax
pop    %rcx
ret
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @hash_key_compare(i8* %0, i64 %1, i8* %2, i64 %3) {
%5 = icmp eq i64 %1, %3
br i1 %5, label %6, label %13
6: ; preds = %4
%7 = load i8, i8* %0
%8 = load i8, i8* %2
%9 = icmp eq i8 %7, %8
br i1 %9, label %10, label %13
10: ; preds = %6
%11 = tail call i64 @memcmp(i8* %0, i8* %2, i64 %1)
%12 = icmp eq i64 %11, 0
br i1 %12, label %14, label %13
13: ; preds = %10, %6, %4
br label %14
14: ; preds = %10, %13
%15 = phi i32 [ 0, %13 ], [ 1, %10 ]
ret i32 %15
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
__attribute__((always_)) uint32_t ccIsPow2Int32(uint32_t v) {
  return ((v & (v - 1)) == 0);
}


x86 assembly (clang, -O0):
<ccIsPow2Int32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ccIsPow2Int32>:
lea    -0x1(%rdi),%ecx
xor    %eax,%eax
test   %ecx,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @ccIsPow2Int32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = sub nsw i32 %4, 1
%6 = and i32 %3, %5
%7 = icmp eq i32 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @ccIsPow2Int32(i32 %0) {
%2 = tail call i32 @llvm.ctpop.i32(i32 %0)
%3 = icmp ult i32 %2, 2
%4 = zext i1 %3 to i32
ret i32 %4
}
int ILibBase64EncodeLength(const int inputLen) {
  return ((inputLen * 4) / 3) + 5;
}


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

x86 assembly (clang, -O2):
<ILibBase64EncodeLength>:
shl    $0x2,%edi
movslq %edi,%rax
imul   $0x55555556,%rax,%rax
mov    %rax,%rcx
shr    $0x20,%rcx
shr    $0x3f,%rax
add    %ecx,%eax
add    $0x5,%eax
ret

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

LLVM IR (-O2):
define i32 @ILibBase64EncodeLength(i32 %0) {
%2 = shl nsw i32 %0, 2
%3 = sdiv i32 %2, 3
%4 = add nsw i32 %3, 5
ret i32 %4
}
/* Variables and functions */
unsigned int exynos_5410_gpio_read(unsigned int);
unsigned int odroid_xu_gpio_read_24() {
  unsigned int bank_offset = 0x0C40;
  unsigned int bit_index = 1;
  return (exynos_5410_gpio_read(bank_offset) >> bit_index) & 0x1;
}


x86 assembly (clang, -O0):
<odroid_xu_gpio_read_24>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xc40,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <exynos_5410_gpio_read@plt>
mov    -0x8(%rbp),%ecx
shr    %cl,%eax
and    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<odroid_xu_gpio_read_24>:
push   %rax
mov    $0xc40,%edi
call   1030 <exynos_5410_gpio_read@plt>
shr    %eax
and    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @odroid_xu_gpio_read_24() {
%1 = alloca i32
%2 = alloca i32
store i32 3136, i32* %1
store i32 1, i32* %2
%3 = load i32, i32* %1
%4 = call i32 @exynos_5410_gpio_read(i32 %3)
%5 = load i32, i32* %2
%6 = lshr i32 %4, %5
%7 = and i32 %6, 1
ret i32 %7
}

LLVM IR (-O2):
define i32 @odroid_xu_gpio_read_24() {
%1 = tail call i32 @exynos_5410_gpio_read(i32 3136)
%2 = lshr i32 %1, 1
%3 = and i32 %2, 1
ret i32 %3
}
/* Variables and functions */
void yield(void) {}


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

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

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

LLVM IR (-O2):
define void @yield() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ err(int, char *, char const *);
void *malloc(size_t);
extern void *checked_malloc(size_t size, int code, const char *str) {
  void *ptr = malloc(size);
  if (ptr == NULL)
    err(code, "%s", str);
  return ptr;
}


x86 assembly (clang, -O0):
<checked_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    115e <checked_malloc+0x3e>
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%rdx
lea    0xea7(%rip),%rsi
call   1030 <err@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checked_malloc>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %esi,%ebp
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1147 <checked_malloc+0x27>
lea    0xec3(%rip),%rsi
mov    %ebp,%edi
mov    %r14,%rdx
call   1030 <err@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define i8* @checked_malloc(i64 %0, i32 %1, i8* %2) {
%4 = alloca i64
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
store i64 %0, i64* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%8 = load i64, i64* %4
%9 = call i8* @malloc(i64 %8)
store i8* %9, i8** %7
%10 = load i8*, i8** %7
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %16
12: ; preds = %3
%13 = load i32, i32* %5
%14 = load i8*, i8** %6
%15 = call i32 @err(i32 %13, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %14)
br label %16
16: ; preds = %12, %3
%17 = load i8*, i8** %7
ret i8* %17
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define noalias i8* @checked_malloc(i64 %0, i32 %1, i8* %2) {
%4 = tail call i8* @malloc(i64 %0)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @err(i32 %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
br label %8
8: ; preds = %6, %3
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ putchar(char);
void print_cstring_array(char **array, size_t len) {
  size_t i;
  for (i = 0; i < len; i++)
    printf("%s | ", array[i]);
  putchar('\n');
}


x86 assembly (clang, -O0):
<print_cstring_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    116f <print_cstring_array+0x4f>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xea7(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1138 <print_cstring_array+0x18>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_cstring_array>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %rsi,%rsi
je     1155 <print_cstring_array+0x35>
mov    %rsi,%r12
mov    %rdi,%r14
xor    %ebx,%ebx
lea    0xec4(%rip),%r15
nopl   0x0(%rax)
mov    (%r14,%rbx,8),%rsi
mov    %r15,%rdi
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <print_cstring_array+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"%s | \00"
define void @print_cstring_array(i8** nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %11, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %9, %4 ], [ 0, %2 ]
%6 = getelementptr inbounds i8*, i8** %0, i64 %5
%7 = load i8*, i8** %6
%8 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = add nuw i64 %5, 1
%10 = icmp eq i64 %9, %1
br i1 %10, label %11, label %4
11: ; preds = %4, %2
%12 = tail call i32 @putchar(i8 signext 10)
ret void
}
/* Variables and functions */
scalar_t__ test_publish_ip6();
scalar_t__ test_query();
scalar_t__ test_scan();
int main() {
  int errors = 0;
  errors += test_publish_ip6();
  errors += test_query();
  errors += test_scan();
  return errors;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x0,%al
call   1040 <test_publish_ip6@plt>
mov    %rax,%rcx
movslq -0x8(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <test_query@plt>
mov    %rax,%rcx
movslq -0x8(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <test_scan@plt>
mov    %rax,%rcx
movslq -0x8(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <test_publish_ip6@plt>
mov    %rax,%r14
xor    %eax,%eax
call   1030 <test_query@plt>
mov    %rax,%rbx
add    %r14d,%ebx
xor    %eax,%eax
call   1050 <test_scan@plt>
add    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = call i64 (...) @test_publish_ip6()
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = add nsw i64 %5, %3
%7 = trunc i64 %6 to i32
store i32 %7, i32* %2
%8 = call i64 (...) @test_query()
%9 = load i32, i32* %2
%10 = sext i32 %9 to i64
%11 = add nsw i64 %10, %8
%12 = trunc i64 %11 to i32
store i32 %12, i32* %2
%13 = call i64 (...) @test_scan()
%14 = load i32, i32* %2
%15 = sext i32 %14 to i64
%16 = add nsw i64 %15, %13
%17 = trunc i64 %16 to i32
store i32 %17, i32* %2
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 (...) @test_publish_ip6()
%2 = tail call i64 (...) @test_query()
%3 = add i64 %2, %1
%4 = tail call i64 (...) @test_scan()
%5 = add i64 %3, %4
%6 = trunc i64 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ detab(char *);
int /*<<< orphan*/ settabs(int, char **, char *);
int main(int argc, char *argv[]) {
  char tabstop[250 + 1];
  settabs(argc, argv, tabstop);
  detab(tabstop);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    -0x110(%rbp),%rdx
call   1040 <settabs@plt>
lea    -0x110(%rbp),%rdi
call   1030 <detab@plt>
xor    %eax,%eax
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x100,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdx
call   1040 <settabs@plt>
mov    %rbx,%rdi
call   1030 <detab@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [251 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = load i8**, i8*** %5
%9 = getelementptr inbounds [251 x i8], [251 x i8]* %6, i64 0, i64 0
%10 = call i32 @settabs(i32 %7, i8** %8, i8* %9)
%11 = getelementptr inbounds [251 x i8], [251 x i8]* %6, i64 0, i64 0
%12 = call i32 @detab(i8* %11)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca [251 x i8]
%4 = getelementptr inbounds [251 x i8], [251 x i8]* %3, i64 0, i64 0
%5 = call i32 @settabs(i32 %0, i8** %1, i8* %4)
%6 = call i32 @detab(i8* %4)
ret i32 0
}
void consumer(int c[][5]) {}


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

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

LLVM IR (-O0):
define void @consumer([5 x i32]* %0) {
%2 = alloca [5 x i32]*
store [5 x i32]* %0, [5 x i32]** %2
ret void
}

LLVM IR (-O2):
define void @consumer([5 x i32]* nocapture %0) {
ret void
}
__attribute__((no)) unsigned int rxsbg_si_srl(unsigned int a, unsigned int b) {
  return a ^ (b >> 2);
}


x86 assembly (clang, -O0):
<rxsbg_si_srl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shr    $0x2,%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rxsbg_si_srl>:
mov    %esi,%eax
shr    $0x2,%eax
xor    %edi,%eax
ret

LLVM IR (-O0):
define i32 @rxsbg_si_srl(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 = lshr i32 %6, 2
%8 = xor i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @rxsbg_si_srl(i32 %0, i32 %1) {
%3 = lshr i32 %1, 2
%4 = xor i32 %3, %0
ret i32 %4
}
void g_async_queue_push_unlocked() {}


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

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

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

LLVM IR (-O2):
define void @g_async_queue_push_unlocked() {
ret void
}
void Expand_vars(void) {
  void *p;
  struct keywords *var;
}


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

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

LLVM IR (-O0):
%struct.keywords = type opaque
define void @Expand_vars() {
%1 = alloca i8*
%2 = alloca %struct.keywords*
ret void
}

LLVM IR (-O2):
%struct.keywords = type opaque
define void @Expand_vars() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *name) {
  (void)fprintf(stderr, "USAGE: %s { -r | -l } username password\n", name);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [41 x i8] c"USAGE: %s { -r | -l } username password\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [41 x i8] c"USAGE: %s { -r | -l } username password\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
/* Variables and functions */
int yahoo_M1Common(unsigned int, int);
int yahoo_f01_00(int Salt, int Parameter) {
  unsigned b = Salt * 0x36056CD7 + 0x4387;
  return yahoo_M1Common(b, Parameter);
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
imul   $0x36056cd7,-0x4(%rbp),%eax
add    $0x4387,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <yahoo_M1Common@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
imul   $0x36056cd7,%edi,%edi
add    $0x4387,%edi
jmp    1030 <yahoo_M1Common@plt>

LLVM IR (-O0):
define i32 @yahoo_f01_00(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = mul nsw i32 %6, 906325207
%8 = add nsw i32 %7, 17287
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = load i32, i32* %4
%11 = call i32 @yahoo_M1Common(i32 %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @yahoo_f01_00(i32 %0, i32 %1) {
%3 = mul nsw i32 %0, 906325207
%4 = add nsw i32 %3, 17287
%5 = tail call i32 @yahoo_M1Common(i32 %4, i32 %1)
ret i32 %5
}
int do_007() { return 7; }


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    $0x7,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
mov    $0x7,%eax
ret

LLVM IR (-O0):
define i32 @do_007() {
ret i32 7
}

LLVM IR (-O2):
define i32 @do_007() {
ret i32 7
}
/* Variables and functions */
char *alloca(int /*<<< orphan*/);
void test_alloca() {
  char *foo = alloca(0);
  for (unsigned i = 0; i < 100; i++) {
    foo[i] = 0;
  }
}


x86 assembly (clang, -O0):
<test_alloca>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
call   1030 <alloca@plt>
mov    %rax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x64,-0xc(%rbp)
jae    114d <test_alloca+0x3d>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
movb   $0x0,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112a <test_alloca+0x1a>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_alloca>:
push   %rax
xor    %edi,%edi
call   1030 <alloca@plt>
xorps  %xmm0,%xmm0
movups %xmm0,(%rax)
movups %xmm0,0x10(%rax)
movups %xmm0,0x20(%rax)
movups %xmm0,0x30(%rax)
movups %xmm0,0x40(%rax)
movups %xmm0,0x50(%rax)
movl   $0x0,0x60(%rax)
pop    %rax
ret

LLVM IR (-O0):
define void @test_alloca() {
%1 = alloca i8*
%2 = alloca i32
%3 = call i8* @alloca(i32 0)
store i8* %3, i8** %1
store i32 0, i32* %2
br label %4
4: ; preds = %12, %0
%5 = load i32, i32* %2
%6 = icmp ult i32 %5, 100
br i1 %6, label %7, label %15
7: ; preds = %4
%8 = load i8*, i8** %1
%9 = load i32, i32* %2
%10 = zext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
store i8 0, i8* %11
br label %12
12: ; preds = %7
%13 = load i32, i32* %2
%14 = add i32 %13, 1
store i32 %14, i32* %2
br label %4
15: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @test_alloca() {
%1 = tail call i8* @alloca(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ ugl_ExecBytecode();
int /*<<< orphan*/ ugl_InitBytecode();
int /*<<< orphan*/ ugl_ResolveSymbols();
int /*<<< orphan*/ ugl_WriteBytecodeCArray(int /*<<< orphan*/, char *);
int /*<<< orphan*/ ugl_read_filename(char *);
int main(void) {
  ugl_InitBytecode();
  ugl_read_filename("test.ugl");
  ugl_ResolveSymbols();
  ugl_ExecBytecode();
  ugl_WriteBytecodeCArray(stdout, "code");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <ugl_InitBytecode@plt>
lea    0xe9e(%rip),%rdi
call   1040 <ugl_read_filename@plt>
mov    $0x0,%al
call   1050 <ugl_ResolveSymbols@plt>
mov    $0x0,%al
call   1030 <ugl_ExecBytecode@plt>
mov    0x2e64(%rip),%rax
mov    (%rax),%edi
lea    0xe84(%rip),%rsi
call   1070 <ugl_WriteBytecodeCArray@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <ugl_InitBytecode@plt>
lea    0xea1(%rip),%rdi
call   1040 <ugl_read_filename@plt>
xor    %eax,%eax
call   1050 <ugl_ResolveSymbols@plt>
xor    %eax,%eax
call   1030 <ugl_ExecBytecode@plt>
mov    0x2e67(%rip),%rax
mov    (%rax),%edi
lea    0xe87(%rip),%rsi
call   1070 <ugl_WriteBytecodeCArray@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"test.ugl\00"
@stdout = global i32 0
@.str.1 = [5 x i8] c"code\00"
define i32 @main() {
%1 = call i32 (...) @ugl_InitBytecode()
%2 = call i32 @ugl_read_filename(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @ugl_ResolveSymbols()
%4 = call i32 (...) @ugl_ExecBytecode()
%5 = load i32, i32* @stdout
%6 = call i32 @ugl_WriteBytecodeCArray(i32 %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"test.ugl\00"
@stdout = global i32 0
@.str.1 = [5 x i8] c"code\00"
define i32 @main() {
%1 = tail call i32 (...) @ugl_InitBytecode()
%2 = tail call i32 @ugl_read_filename(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @ugl_ResolveSymbols()
%4 = tail call i32 (...) @ugl_ExecBytecode()
%5 = load i32, i32* @stdout
%6 = tail call i32 @ugl_WriteBytecodeCArray(i32 %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
int checkPrime(unsigned long int num) {
  for (unsigned long int j = 2; j < num; j++) {
    if (num % j == 0) {
      return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<checkPrime>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movq   $0x2,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1156 <checkPrime+0x56>
mov    -0x10(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x18(%rbp)
cmp    $0x0,%rdx
jne    1140 <checkPrime+0x40>
movl   $0x0,-0x4(%rbp)
jmp    115d <checkPrime+0x5d>
jmp    1145 <checkPrime+0x45>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1110 <checkPrime+0x10>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkPrime>:
mov    $0x1,%eax
cmp    $0x3,%rdi
jb     1155 <checkPrime+0x55>
xor    %eax,%eax
test   $0x1,%dil
je     1155 <checkPrime+0x55>
mov    $0x3,%eax
jmp    112f <checkPrime+0x2f>
nopw   0x0(%rax,%rax,1)
mov    %edi,%eax
xor    %edx,%edx
div    %ecx
lea    0x1(%rcx),%rax
test   %rdx,%rdx
je     114d <checkPrime+0x4d>
mov    %rax,%rcx
cmp    %rax,%rdi
je     114d <checkPrime+0x4d>
mov    %rdi,%rax
or     %rcx,%rax
shr    $0x20,%rax
je     1120 <checkPrime+0x20>
mov    %rdi,%rax
xor    %edx,%edx
div    %rcx
jmp    1126 <checkPrime+0x26>
xor    %eax,%eax
cmp    %rdi,%rcx
setae  %al
ret

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

LLVM IR (-O2):
define i32 @checkPrime(i64 %0) {
%2 = icmp ugt i64 %0, 2
br i1 %2, label %3, label %16
3: ; preds = %1
%4 = and i64 %0, 1
%5 = icmp eq i64 %4, 0
br i1 %5, label %16, label %6
6: ; preds = %3, %9
%7 = phi i64 [ %12, %9 ], [ 3, %3 ]
%8 = icmp eq i64 %7, %0
br i1 %8, label %13, label %9
9: ; preds = %6
%10 = urem i64 %0, %7
%11 = icmp eq i64 %10, 0
%12 = add nuw i64 %7, 1
br i1 %11, label %13, label %6
13: ; preds = %6, %9
%14 = icmp uge i64 %7, %0
%15 = zext i1 %14 to i32
br label %16
16: ; preds = %13, %3, %1
%17 = phi i32 [ 1, %1 ], [ 0, %3 ], [ %15, %13 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ compute(int);
int example_set_var2(int *array, int array_size) {
  compute(10);
  return 0;
}


x86 assembly (clang, -O0):
<example_set_var2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0xa,%edi
call   1030 <compute@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @example_set_var2(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = call i32 @compute(i32 10)
ret i32 0
}

LLVM IR (-O2):
define i32 @example_set_var2(i32* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @compute(i32 10)
ret i32 0
}
AX0RX1(r0, r1, x0, x1, p0, p1) unsigned int r0, r1;
unsigned int *p0, *p1;
{
  if ((((unsigned int *)10000000)[x0]) <= (p1[x1]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<AX0RX1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
movslq -0x10(%rbp),%rcx
mov    $0x989680,%eax
mov    (%rax,%rcx,4),%eax
mov    -0x28(%rbp),%rcx
movslq -0x14(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
ja     1141 <AX0RX1+0x41>
movl   $0x1,-0x4(%rbp)
jmp    1148 <AX0RX1+0x48>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<AX0RX1>:
movslq %edx,%rax
mov    0x989680(,%rax,4),%edx
movslq %ecx,%rcx
xor    %eax,%eax
cmp    (%r9,%rcx,4),%edx
setbe  %al
ret

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

LLVM IR (-O2):
define i32 @AX0RX1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture readnone %4, i32* nocapture %5) {
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* inttoptr (i64 10000000 to i32*), i64 %7
%9 = load i32, i32* %8
%10 = sext i32 %3 to i64
%11 = getelementptr inbounds i32, i32* %5, i64 %10
%12 = load i32, i32* %11
%13 = icmp ule i32 %9, %12
%14 = zext i1 %13 to i32
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ Sys_ReplaceProcess(char *);
int fork();
void Sys_DoStartProcess(char *cmdline) {
  switch (fork()) {
  case -1:
    break;
  case 0:
    Sys_ReplaceProcess(cmdline);
    break;
  }
}


x86 assembly (clang, -O0):
<Sys_DoStartProcess>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
call   1040 <fork@plt>
mov    %eax,%ecx
mov    %ecx,-0xc(%rbp)
sub    $0xffffffff,%eax
je     1156 <Sys_DoStartProcess+0x36>
jmp    1146 <Sys_DoStartProcess+0x26>
mov    -0xc(%rbp),%eax
test   %eax,%eax
je     115b <Sys_DoStartProcess+0x3b>
jmp    1164 <Sys_DoStartProcess+0x44>
jmp    1164 <Sys_DoStartProcess+0x44>
mov    -0x8(%rbp),%rdi
call   1030 <Sys_ReplaceProcess@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sys_DoStartProcess>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <fork@plt>
test   %eax,%eax
je     1131 <Sys_DoStartProcess+0x11>
pop    %rbx
ret
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <Sys_ReplaceProcess@plt>

LLVM IR (-O0):
define void @Sys_DoStartProcess(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @fork()
switch i32 %3, label %8 [
i32 -1, label %4
i32 0, label %5
]
4: ; preds = %1
br label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @Sys_ReplaceProcess(i8* %6)
br label %8
8: ; preds = %1, %5, %4
ret void
}

LLVM IR (-O2):
define void @Sys_DoStartProcess(i8* %0) {
%2 = tail call i32 (...) @fork()
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @Sys_ReplaceProcess(i8* %0)
br label %6
6: ; preds = %1, %4
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
void PreTraceHook(FILE *where) { return; }


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

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

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

LLVM IR (-O2):
define void @PreTraceHook(i32* nocapture %0) {
ret void
}
/* Variables and functions */
int getpid();
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  printf("Hello world from process ID %d\n", getpid());
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [32 x i8] c"Hello world from process ID %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @getpid()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
void security_socket_post_create(struct socket *sock, int family, int type,
                                 int protocol, int kern) {}


x86 assembly (clang, -O0):
<security_socket_post_create>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.socket = type opaque
define void @security_socket_post_create(%struct.socket* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca %struct.socket*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store %struct.socket* %0, %struct.socket** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
ret void
}

LLVM IR (-O2):
%struct.socket = type opaque
define void @security_socket_post_create(%struct.socket* nocapture %0, i32 %1, i32 %2, i32 %3, i32 %4) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo(int);
int main(void) {
  foo(1);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int search(int *, int, int);
int main() {
  int a[] = {2, 7, 4, 5, 1, 0};
  int size = 6;
  printf("%d\n", search(a, size, 5));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x10(%rbp)
movl   $0x6,-0x24(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
mov    $0x5,%edx
call   1040 <search@plt>
mov    %eax,%esi
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xee5(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x6,%esi
mov    $0x5,%edx
call   1040 <search@plt>
lea    0xec4(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@__const.main.a = [6 x i32] [i32 2, i32 7, i32 4, i32 5, i32 1, i32 0]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [6 x i32]
%2 = bitcast [6 x i32]* %1 to i8*
%3 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
%4 = call i32 @search(i32* %3, i32 6, i32 5)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ VT_Transmit(int /*<<< orphan*/);
void VT_Print(char *string) {
  while (*string) {
    VT_Transmit(*string++);
  }
}


x86 assembly (clang, -O0):
<VT_Print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <VT_Print+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <VT_Transmit@plt>
jmp    111c <VT_Print+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<VT_Print>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <VT_Print+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <VT_Transmit@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <VT_Print+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @VT_Print(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 @VT_Transmit(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
unsigned long gdb_hexbyte2dec(char *);
unsigned long gdb_hexword2dec(char *s) {
  int i;
  unsigned long r = 0;
  for (i = 3; i >= 0; i--) {
    r = (r << 8) + gdb_hexbyte2dec(s + i * 2);
  }
  return r;
}


x86 assembly (clang, -O0):
<gdb_hexword2dec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x18(%rbp)
movl   $0x3,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     1171 <gdb_hexword2dec+0x61>
mov    -0x18(%rbp),%rax
shl    $0x8,%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
cltq
add    %rax,%rdi
call   1030 <gdb_hexbyte2dec@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    112b <gdb_hexword2dec+0x1b>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gdb_hexword2dec>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdi,%r14
add    $0x6,%rdi
call   1030 <gdb_hexbyte2dec@plt>
mov    %rax,%r15
shl    $0x8,%r15
lea    0x4(%r14),%rdi
call   1030 <gdb_hexbyte2dec@plt>
mov    %rax,%r12
add    %r15,%r12
shl    $0x8,%r12
lea    0x2(%r14),%rdi
call   1030 <gdb_hexbyte2dec@plt>
mov    %rax,%rbx
add    %r12,%rbx
shl    $0x8,%rbx
mov    %r14,%rdi
call   1030 <gdb_hexbyte2dec@plt>
add    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i64 @gdb_hexword2dec(i8* %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 6
%3 = tail call i64 @gdb_hexbyte2dec(i8* %2)
%4 = shl i64 %3, 8
%5 = getelementptr inbounds i8, i8* %0, i64 4
%6 = tail call i64 @gdb_hexbyte2dec(i8* %5)
%7 = add i64 %6, %4
%8 = shl i64 %7, 8
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = tail call i64 @gdb_hexbyte2dec(i8* %9)
%11 = add i64 %10, %8
%12 = shl i64 %11, 8
%13 = tail call i64 @gdb_hexbyte2dec(i8* %0)
%14 = add i64 %13, %12
ret i64 %14
}
void init_audiodev(int dtype) {}


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

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

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

LLVM IR (-O2):
define void @init_audiodev(i32 %0) {
ret void
}