xunge/DecIR huggingface dataset:
/* Variables and functions */
void *memcpy(void *, void const *, size_t);
void *n_malloc(size_t);
int /*<<< orphan*/ nomem();
void *n_memdup(const void *ptr, size_t size) {
  register void *new;
  if ((new = n_malloc(size)) == NULL) {
    nomem();
    return NULL;
  }
  return memcpy(new, ptr, size);
}


x86 assembly (clang, -O0):
<n_memdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <n_malloc@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jne    116b <n_memdup+0x3b>
mov    $0x0,%al
call   1040 <nomem@plt>
movq   $0x0,-0x8(%rbp)
jmp    1188 <n_memdup+0x58>
mov    -0x20(%rbp),%rdi
mov    %rdi,-0x28(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<n_memdup>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rsi,%rdi
call   1050 <n_malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     115b <n_memdup+0x2b>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <memcpy@plt>
jmp    1162 <n_memdup+0x32>
xor    %eax,%eax
call   1040 <nomem@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @n_memdup(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @n_malloc(i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @nomem()
br label %8
7: ; preds = %2
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %3, i8* align 1 %0, i64 %1, i1 false)
br label %8
8: ; preds = %7, %5
ret i8* %3
}
int nps_cluster_logic_to_phys(int cluster) { return cluster; }


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

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

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

LLVM IR (-O2):
define i32 @nps_cluster_logic_to_phys(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
scalar_t__ memmem(char const *, int /*<<< orphan*/, char const *,
                  int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
char *strstr(const char *haystack, const char *needle) {
  return ((char *)memmem(haystack, strlen(haystack), needle, strlen(needle)));
}


x86 assembly (clang, -O0):
<strstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x28(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    %eax,%ecx
call   1040 <memmem@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strstr>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %eax,%ebp
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14,%rdx
mov    %eax,%ecx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <memmem@plt>

LLVM IR (-O0):
define i8* @strstr(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @strlen(i8* %6)
%8 = load i8*, i8** %4
%9 = load i8*, i8** %4
%10 = call i32 @strlen(i8* %9)
%11 = call i64 @memmem(i8* %5, i32 %7, i8* %8, i32 %10)
%12 = inttoptr i64 %11 to i8*
ret i8* %12
}

LLVM IR (-O2):
define i8* @strstr(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @strlen(i8* %1)
%5 = tail call i64 @memmem(i8* %0, i32 %3, i8* %1, i32 %4)
%6 = inttoptr i64 %5 to i8*
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ pubrealloc(void *, int /*<<< orphan*/, char *);
void phkfree(void *ptr) { pubrealloc(ptr, 0, " in free():"); }


x86 assembly (clang, -O0):
<phkfree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
lea    0xed7(%rip),%rdx
call   1030 <pubrealloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<phkfree>:
lea    0xee9(%rip),%rdx
xor    %esi,%esi
jmp    1030 <pubrealloc@plt>

LLVM IR (-O0):
@.str = [12 x i8] c" in free():\00"
define void @phkfree(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @pubrealloc(i8* %3, i32 0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c" in free():\00"
define void @phkfree(i8* %0) {
%2 = tail call i32 @pubrealloc(i8* %0, i32 0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}
int comp(const void *a, const void *b) { return (*(int *)a - *(int *)b); }


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

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

LLVM IR (-O0):
define i32 @comp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @comp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
void ff_hevc_put_hevc_uni_epel_v24_10_avx2() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_epel_v24_10_avx2() {
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 check_incorrect_usage(int argc, char **argv) {
  if (argc != 3) {
    fprintf(stderr, "Incorrect usage\nUsage: %s [port-number] [out|file]\n",
            *argv);
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<check_incorrect_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x4(%rbp)
je     1163 <check_incorrect_usage+0x43>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xeb0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e7c(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_incorrect_usage>:
cmp    $0x3,%edi
jne    1126 <check_incorrect_usage+0x6>
ret
push   %rax
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
mov    (%rsi),%rdx
lea    0xec6(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [52 x i8] c"Incorrect usage\0AUsage: %s [port-number] [out|file]\0A\00"
@EXIT_FAILURE = global i32 0
define void @check_incorrect_usage(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 = icmp ne i32 %5, 3
br i1 %6, label %7, label %14
7: ; preds = %2
%8 = load i32, i32* @stderr
%9 = load i8**, i8*** %4
%10 = load i8*, i8** %9
%11 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = load i32, i32* @EXIT_FAILURE
%13 = call i32 @exit(i32 %12)
unreachable
14: ; preds = %2
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [52 x i8] c"Incorrect usage\0AUsage: %s [port-number] [out|file]\0A\00"
@EXIT_FAILURE = global i32 0
define void @check_incorrect_usage(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 3
br i1 %3, label %10, label %4
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %1
%7 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @exit(i32 %8)
unreachable
10: ; preds = %2
ret void
}
void ASN1_BIT_STRING_set(void) {}


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

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

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

LLVM IR (-O2):
define void @ASN1_BIT_STRING_set() {
ret void
}
/* Variables and functions */
float q8_sqrt(float);
float qsqrt(float f) { return (q8_sqrt(f)); }


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

x86 assembly (clang, -O2):
<qsqrt>:
jmp    1030 <q8_sqrt@plt>

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

LLVM IR (-O2):
define float @qsqrt(float %0) {
%2 = tail call float @q8_sqrt(float %0)
ret float %2
}
/* Type definitions */
struct list_head {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ INIT_LIST_HEAD(struct list_head *);
int /*<<< orphan*/ list_replace(struct list_head *, struct list_head *);
void list_replace_init(struct list_head *old_node, struct list_head *new_node) {
  list_replace(old_node, new_node);
  INIT_LIST_HEAD(old_node);
}


x86 assembly (clang, -O0):
<list_replace_init>:
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   1040 <list_replace@plt>
mov    -0x8(%rbp),%rdi
call   1030 <INIT_LIST_HEAD@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<list_replace_init>:
push   %rbx
mov    %rdi,%rbx
call   1040 <list_replace@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <INIT_LIST_HEAD@plt>

LLVM IR (-O0):
%struct.list_head = type { i32 }
define void @list_replace_init(%struct.list_head* %0, %struct.list_head* %1) {
%3 = alloca %struct.list_head*
%4 = alloca %struct.list_head*
store %struct.list_head* %0, %struct.list_head** %3
store %struct.list_head* %1, %struct.list_head** %4
%5 = load %struct.list_head*, %struct.list_head** %3
%6 = load %struct.list_head*, %struct.list_head** %4
%7 = call i32 @list_replace(%struct.list_head* %5, %struct.list_head* %6)
%8 = load %struct.list_head*, %struct.list_head** %3
%9 = call i32 @INIT_LIST_HEAD(%struct.list_head* %8)
ret void
}

LLVM IR (-O2):
%struct.list_head = type { i32 }
define void @list_replace_init(%struct.list_head* %0, %struct.list_head* %1) {
%3 = tail call i32 @list_replace(%struct.list_head* %0, %struct.list_head* %1)
%4 = tail call i32 @INIT_LIST_HEAD(%struct.list_head* %0)
ret void
}
int test_imm_C7uint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0xC7 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_C7uint64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
shr    $0x10,%rdx
and    $0xc7,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_C7uint64_midword_reg>:
test   $0xc70000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_C7uint64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 16
%5 = and i64 %4, 199
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_C7uint64_midword_reg(i64 %0) {
%2 = and i64 %0, 13041664
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
char *strcpy(char *dest, const char *src) {
  char *d = dest;
  while ((*dest++ = *src++))
    ;
  return d;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     1143 <strcpy+0x43>
jmp    1114 <strcpy+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rsi,%rcx,1),%edx
mov    %dl,(%rax,%rcx,1)
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <strcpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %1, %2 ], [ %6, %3 ]
%5 = phi i8* [ %0, %2 ], [ %8, %3 ]
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = load i8, i8* %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %7, i8* %5
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i8* %0
}
/* Variables and functions */
int forkexecwaitvp(int /*<<< orphan*/, char const **);
int /*<<< orphan*/ path_rsync();
int exec_rsync_argv(const char **argv) {
  return forkexecwaitvp(path_rsync(), argv);
}


x86 assembly (clang, -O0):
<exec_rsync_argv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <path_rsync@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%rsi
call   1040 <forkexecwaitvp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exec_rsync_argv>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <path_rsync@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <forkexecwaitvp@plt>

LLVM IR (-O0):
define i32 @exec_rsync_argv(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 (...) @path_rsync()
%4 = load i8**, i8*** %2
%5 = call i32 @forkexecwaitvp(i32 %3, i8** %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @exec_rsync_argv(i8** %0) {
%2 = tail call i32 (...) @path_rsync()
%3 = tail call i32 @forkexecwaitvp(i32 %2, i8** %0)
ret i32 %3
}
int ep93xx_i2s_acquire(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ep93xx_i2s_acquire() {
ret i32 0
}
/* Variables and functions */
size_t write_byte(char *ptr, unsigned char value) {
  *ptr = value;
  return sizeof(char);
}


x86 assembly (clang, -O0):
<write_byte>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @write_byte(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* %4
%6 = load i8*, i8** %3
store i8 %5, i8* %6
ret i64 1
}

LLVM IR (-O2):
define i64 @write_byte(i8* nocapture writeonly %0, i8 zeroext %1) {
store i8 %1, i8* %0
ret i64 1
}
/* Type definitions */
typedef unsigned long long uint64_t;

/* Variables and functions */
uint64_t load64_r1(const unsigned char *x) {
  unsigned long long r = 0, i;
  for (i = 0; i < 8; ++i) {
    r |= (unsigned long long)x[i] << 8 * i;
  }
  return r;
}


x86 assembly (clang, -O0):
<load64_r1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x8,-0x18(%rbp)
jae    1153 <load64_r1+0x53>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
mov    -0x18(%rbp),%rcx
shl    $0x3,%rcx
shl    %cl,%rax
or     -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1118 <load64_r1+0x18>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<load64_r1>:
mov    (%rdi),%rax
ret

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

LLVM IR (-O2):
define i64 @load64_r1(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i64
%7 = shl nuw nsw i64 %6, 8
%8 = or i64 %7, %3
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = zext i8 %10 to i64
%12 = shl nuw nsw i64 %11, 16
%13 = or i64 %12, %8
%14 = getelementptr inbounds i8, i8* %0, i64 3
%15 = load i8, i8* %14
%16 = zext i8 %15 to i64
%17 = shl nuw nsw i64 %16, 24
%18 = or i64 %17, %13
%19 = getelementptr inbounds i8, i8* %0, i64 4
%20 = load i8, i8* %19
%21 = zext i8 %20 to i64
%22 = shl nuw nsw i64 %21, 32
%23 = or i64 %22, %18
%24 = getelementptr inbounds i8, i8* %0, i64 5
%25 = load i8, i8* %24
%26 = zext i8 %25 to i64
%27 = shl nuw nsw i64 %26, 40
%28 = or i64 %27, %23
%29 = getelementptr inbounds i8, i8* %0, i64 6
%30 = load i8, i8* %29
%31 = zext i8 %30 to i64
%32 = shl nuw nsw i64 %31, 48
%33 = or i64 %32, %28
%34 = getelementptr inbounds i8, i8* %0, i64 7
%35 = load i8, i8* %34
%36 = zext i8 %35 to i64
%37 = shl nuw i64 %36, 56
%38 = or i64 %37, %33
ret i64 %38
}
int check_Dchar(char c) {
  unsigned char uc = (unsigned char)c;
  if (uc >= 0x81 && uc <= 0x9f) {
    return 1;
  } else if (uc >= 0xe0 && uc <= 0xef) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<check_Dchar>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
mov    %al,-0x6(%rbp)
movzbl -0x6(%rbp),%eax
cmp    $0x81,%eax
jl     113a <check_Dchar+0x3a>
movzbl -0x6(%rbp),%eax
cmp    $0x9f,%eax
jg     113a <check_Dchar+0x3a>
movl   $0x1,-0x4(%rbp)
jmp    1170 <check_Dchar+0x70>
movzbl -0x6(%rbp),%eax
cmp    $0xe0,%eax
jl     1164 <check_Dchar+0x64>
movzbl -0x6(%rbp),%eax
cmp    $0xef,%eax
jg     1164 <check_Dchar+0x64>
movl   $0x1,-0x4(%rbp)
jmp    1170 <check_Dchar+0x70>
jmp    1169 <check_Dchar+0x69>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_Dchar>:
lea    0x7f(%rdi),%eax
cmp    $0x1f,%al
setb   %al
and    $0xf0,%dil
cmp    $0xe0,%dil
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @check_Dchar(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
%5 = load i8, i8* %3
store i8 %5, i8* %4
%6 = load i8, i8* %4
%7 = zext i8 %6 to i32
%8 = icmp sge i32 %7, 129
br i1 %8, label %9, label %14
9: ; preds = %1
%10 = load i8, i8* %4
%11 = zext i8 %10 to i32
%12 = icmp sle i32 %11, 159
br i1 %12, label %13, label %14
13: ; preds = %9
store i32 1, i32* %2
br label %25
14: ; preds = %9, %1
%15 = load i8, i8* %4
%16 = zext i8 %15 to i32
%17 = icmp sge i32 %16, 224
br i1 %17, label %18, label %23
18: ; preds = %14
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = icmp sle i32 %20, 239
br i1 %21, label %22, label %23
22: ; preds = %18
store i32 1, i32* %2
br label %25
23: ; preds = %18, %14
br label %24
24: ; preds = %23
store i32 0, i32* %2
br label %25
25: ; preds = %24, %22, %13
%26 = load i32, i32* %2
ret i32 %26
}

LLVM IR (-O2):
define i32 @check_Dchar(i8 signext %0) {
%2 = add i8 %0, 127
%3 = icmp ult i8 %2, 31
%4 = and i8 %0, -16
%5 = icmp eq i8 %4, -32
%6 = or i1 %3, %5
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int tc_log_debug_init(char *);
int tc_log_init(void) { return tc_log_debug_init("TC_DEBUG"); }


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

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

LLVM IR (-O0):
@.str = [9 x i8] c"TC_DEBUG\00"
define i32 @tc_log_init() {
%1 = call i32 @tc_log_debug_init(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [9 x i8] c"TC_DEBUG\00"
define i32 @tc_log_init() {
%1 = tail call i32 @tc_log_debug_init(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
void setbits(unsigned x, int p, int n, unsigned *y) {
  *y = (*y & (~0 << n)) | (x >> (p - n + 1));
}


x86 assembly (clang, -O0):
<setbits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    -0xc(%rbp),%ecx
mov    $0xffffffff,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    -0xc(%rbp),%ecx
add    $0x1,%ecx
shr    %cl,%eax
mov    -0x1c(%rbp),%ecx
or     %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<setbits>:
mov    %rcx,%rax
mov    %edx,%ecx
mov    (%rax),%edx
shr    %cl,%edx
shl    %cl,%edx
sub    %ecx,%esi
lea    0x1(%rsi),%ecx
shr    %cl,%edi
or     %edx,%edi
mov    %edi,(%rax)
ret

LLVM IR (-O0):
define void @setbits(i32 %0, i32 %1, i32 %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32* %3, i32** %8
%9 = load i32*, i32** %8
%10 = load i32, i32* %9
%11 = load i32, i32* %7
%12 = shl i32 -1, %11
%13 = and i32 %10, %12
%14 = load i32, i32* %5
%15 = load i32, i32* %6
%16 = load i32, i32* %7
%17 = sub nsw i32 %15, %16
%18 = add nsw i32 %17, 1
%19 = lshr i32 %14, %18
%20 = or i32 %13, %19
%21 = load i32*, i32** %8
store i32 %20, i32* %21
ret void
}

LLVM IR (-O2):
define void @setbits(i32 %0, i32 %1, i32 %2, i32* nocapture %3) {
%5 = load i32, i32* %3
%6 = shl nsw i32 -1, %2
%7 = and i32 %5, %6
%8 = add i32 %1, 1
%9 = sub i32 %8, %2
%10 = lshr i32 %0, %9
%11 = or i32 %7, %10
store i32 %11, i32* %3
ret void
}
void foo003(int p) {}


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
define void @foo003(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_parser_sourcefile(char *, char *);
int /*<<< orphan*/ test_parser_verify_entity(int /*<<< orphan*/, char *,
                                             char *);
void test_brainfuck_comment_entities() {
  test_parser_verify_entity(test_parser_sourcefile("brainfuck", " #comment"),
                            "#comment", "#comment");
}


x86 assembly (clang, -O0):
<test_brainfuck_comment_entities>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed8(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
mov    %eax,%edi
lea    0xecb(%rip),%rdx
mov    %rdx,%rsi
call   1040 <test_parser_verify_entity@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_brainfuck_comment_entities>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xedb(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
lea    0xed0(%rip),%rdx
mov    %eax,%edi
mov    %rdx,%rsi
pop    %rax
jmp    1040 <test_parser_verify_entity@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"brainfuck\00"
@.str.1 = [10 x i8] c" #comment\00"
@.str.2 = [9 x i8] c"#comment\00"
define void @test_brainfuck_comment_entities() {
%1 = call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test_parser_verify_entity(i32 %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"brainfuck\00"
@.str.1 = [10 x i8] c" #comment\00"
@.str.2 = [9 x i8] c"#comment\00"
define void @test_brainfuck_comment_entities() {
%1 = tail call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test_parser_verify_entity(i32 %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
ret void
}
remove(s) char *s;
{ return unlink(s); }


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

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

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

LLVM IR (-O2):
define i32 @remove(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @unlink to i32 (i8*, ...)*)(i8* %0)
ret i32 %2
}
/* Variables and functions */
scalar_t__ malloc(scalar_t__);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *contactString(char *a, char *b) {
  char *s = (char *)malloc(strlen(a) + strlen(b) + 1);
  strcpy(s, a);
  strcat(s, b);
  return s;
}


x86 assembly (clang, -O0):
<contactString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rdi
add    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1060 <strcat@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<contactString>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r12
call   1040 <strlen@plt>
mov    %rax,%r15
mov    %r14,%rdi
call   1040 <strlen@plt>
lea    (%r15,%rax,1),%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r12,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <strcat@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @contactString(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i64 @strlen(i8* %6)
%8 = load i8*, i8** %4
%9 = call i64 @strlen(i8* %8)
%10 = add nsw i64 %7, %9
%11 = add nsw i64 %10, 1
%12 = call i64 @malloc(i64 %11)
%13 = inttoptr i64 %12 to i8*
store i8* %13, i8** %5
%14 = load i8*, i8** %5
%15 = load i8*, i8** %3
%16 = call i32 @strcpy(i8* %14, i8* %15)
%17 = load i8*, i8** %5
%18 = load i8*, i8** %4
%19 = call i32 @strcat(i8* %17, i8* %18)
%20 = load i8*, i8** %5
ret i8* %20
}

LLVM IR (-O2):
define i8* @contactString(i8* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = add i64 %3, 1
%6 = add i64 %5, %4
%7 = tail call i64 @malloc(i64 %6)
%8 = inttoptr i64 %7 to i8*
%9 = tail call i32 @strcpy(i8* %8, i8* %0)
%10 = tail call i32 @strcat(i8* %8, i8* %1)
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void lexic_error() {
  fprintf(stderr, "invalid character in input\n");
  abort();
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [28 x i8] c"invalid character in input\0A\00"
define void @lexic_error() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [28 x i8] c"invalid character in input\0A\00"
define void @lexic_error() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
scalar_t__ EAGAIN;
scalar_t__ errno;
int write(int, unsigned char *, size_t);
int cf_socket_write(int sd, unsigned char *buf, size_t n) {
  int result = -1;
  do {
    result = write(sd, buf, n);
  } while (result == -1 && errno == EAGAIN);
  return result;
}


x86 assembly (clang, -O0):
<cf_socket_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0xffffffff,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <write@plt>
mov    %eax,-0x1c(%rbp)
xor    %eax,%eax
cmpl   $0xffffffff,-0x1c(%rbp)
mov    %al,-0x1d(%rbp)
jne    1166 <cf_socket_write+0x56>
mov    0x2e8d(%rip),%rax
mov    (%rax),%rax
mov    0x2e73(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
mov    %al,-0x1d(%rbp)
mov    -0x1d(%rbp),%al
test   $0x1,%al
jne    112a <cf_socket_write+0x1a>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cf_socket_write>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x2eb9(%rip),%r15
mov    0x2ea2(%rip),%r12
xchg   %ax,%ax
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <write@plt>
cmp    $0xffffffff,%eax
jne    114b <cf_socket_write+0x3b>
mov    (%r12),%rcx
cmp    %rcx,(%r15)
je     1130 <cf_socket_write+0x20>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@errno = global i64 0
@EAGAIN = global i64 0
define i32 @cf_socket_write(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
store i32 -1, i32* %7
br label %8
8: ; preds = %20, %3
%9 = load i32, i32* %4
%10 = load i8*, i8** %5
%11 = load i64, i64* %6
%12 = call i32 @write(i32 %9, i8* %10, i64 %11)
store i32 %12, i32* %7
br label %13
13: ; preds = %8
%14 = load i32, i32* %7
%15 = icmp eq i32 %14, -1
br i1 %15, label %16, label %20
16: ; preds = %13
%17 = load i64, i64* @errno
%18 = load i64, i64* @EAGAIN
%19 = icmp eq i64 %17, %18
br label %20
20: ; preds = %16, %13
%21 = phi i1 [ false, %13 ], [ %19, %16 ]
br i1 %21, label %8, label %22
22: ; preds = %20
%23 = load i32, i32* %7
ret i32 %23
}

LLVM IR (-O2):
@errno = global i64 0
@EAGAIN = global i64 0
define i32 @cf_socket_write(i32 %0, i8* nocapture %1, i64 %2) {
br label %4
4: ; preds = %4, %3
%5 = tail call i32 @write(i32 %0, i8* %1, i64 %2)
%6 = icmp eq i32 %5, -1
%7 = load i64, i64* @errno
%8 = load i64, i64* @EAGAIN
%9 = icmp eq i64 %7, %8
%10 = select i1 %6, i1 %9, i1 false
br i1 %10, label %4, label %11
11: ; preds = %4
ret i32 %5
}
/* Variables and functions */
int main_imanager_req();
int d2mce_set_resource_manager() { return main_imanager_req(); }


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

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

LLVM IR (-O0):
define i32 @d2mce_set_resource_manager() {
%1 = call i32 (...) @main_imanager_req()
ret i32 %1
}

LLVM IR (-O2):
define i32 @d2mce_set_resource_manager() {
%1 = tail call i32 (...) @main_imanager_req()
ret i32 %1
}
void AKSC_ThetaFilter(void) {}


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

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

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

LLVM IR (-O2):
define void @AKSC_ThetaFilter() {
ret void
}
/* Variables and functions */
int f426(int *);
int f427(int *p) { return f426(p); }


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

x86 assembly (clang, -O2):
<f427>:
jmp    1030 <f426@plt>

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

LLVM IR (-O2):
define i32 @f427(i32* %0) {
%2 = tail call i32 @f426(i32* %0)
ret i32 %2
}
void av_fifo_alloc() {}


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

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

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

LLVM IR (-O2):
define void @av_fifo_alloc() {
ret void
}
double obd_convert_11(int a, int b) { return (double)(100 * a) / 255.0f; }


x86 assembly (clang, -O0):
<obd_convert_11>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
imul   $0x64,-0x4(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  0xee6(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<obd_convert_11>:
imul   $0x64,%edi,%eax
cvtsi2sd %eax,%xmm0
divsd  0xef1(%rip),%xmm0
ret

LLVM IR (-O0):
define double @obd_convert_11(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 = mul nsw i32 100, %5
%7 = sitofp i32 %6 to double
%8 = fdiv double %7, 2.550000e+02
ret double %8
}

LLVM IR (-O2):
define double @obd_convert_11(i32 %0, i32 %1) {
%3 = mul nsw i32 %0, 100
%4 = sitofp i32 %3 to double
%5 = fdiv double %4, 2.550000e+02
ret double %5
}
void wpas_dbus_signal_network_selected(struct wpa_supplicant *wpa_s, int id) {}


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

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

LLVM IR (-O0):
%struct.wpa_supplicant = type opaque
define void @wpas_dbus_signal_network_selected(%struct.wpa_supplicant* %0, i32 %1) {
%3 = alloca %struct.wpa_supplicant*
%4 = alloca i32
store %struct.wpa_supplicant* %0, %struct.wpa_supplicant** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
%struct.wpa_supplicant = type opaque
define void @wpas_dbus_signal_network_selected(%struct.wpa_supplicant* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
double cos(int /*<<< orphan*/);
int /*<<< orphan*/ toRadians(double);
double cosDegrees(double angle) { return cos(toRadians(angle)); }


x86 assembly (clang, -O0):
<cosDegrees>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <toRadians@plt>
mov    %eax,%edi
call   1030 <cos@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cosDegrees>:
push   %rax
call   1040 <toRadians@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <cos@plt>

LLVM IR (-O0):
define double @cosDegrees(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @toRadians(double %3)
%5 = call double @cos(i32 %4)
ret double %5
}

LLVM IR (-O2):
define double @cosDegrees(double %0) {
%2 = tail call i32 @toRadians(double %0)
%3 = tail call double @cos(i32 %2)
ret double %3
}
unsigned int crunch(key)
char *key;
{
  unsigned int sum = 0;
  int s;
  for (s = 0; *key; s++)
    sum += *key++;
  return (sum + s);
}


x86 assembly (clang, -O0):
<crunch>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1149 <crunch+0x49>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <crunch+0x16>
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<crunch>:
mov    (%rdi),%cl
xor    %eax,%eax
test   %cl,%cl
je     112d <crunch+0x2d>
xor    %edx,%edx
nopw   0x0(%rax,%rax,1)
mov    %edx,%r8d
movsbl %cl,%esi
lea    (%r8,%rsi,1),%edx
movzbl 0x1(%rdi,%rax,1),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1110 <crunch+0x10>
add    %esi,%r8d
add    %r8d,%eax
ret

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

LLVM IR (-O2):
define i32 @crunch(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %17, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %13, %4 ], [ %2, %1 ]
%6 = phi i32 [ %12, %4 ], [ 0, %1 ]
%7 = phi i32 [ %11, %4 ], [ 0, %1 ]
%8 = phi i8* [ %9, %4 ], [ %0, %1 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = sext i8 %5 to i32
%11 = add i32 %7, %10
%12 = add nuw nsw i32 %6, 1
%13 = load i8, i8* %9
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4
%16 = add i32 %12, %11
br label %17
17: ; preds = %15, %1
%18 = phi i32 [ %16, %15 ], [ 0, %1 ]
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ clrtoeol();
int /*<<< orphan*/ curs_set(int /*<<< orphan*/);
char getch();
int /*<<< orphan*/ move(int, int);
int /*<<< orphan*/ noecho();
char in() {
  curs_set(0);
  noecho();
  char c = getch();
  move(1, 5);
  clrtoeol();
  move(2, 7);
  clrtoeol();
  return c;
}


x86 assembly (clang, -O0):
<in>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
call   1060 <curs_set@plt>
mov    $0x0,%al
call   1050 <noecho@plt>
mov    $0x0,%al
call   1030 <getch@plt>
mov    %al,-0x1(%rbp)
mov    $0x1,%edi
mov    $0x5,%esi
call   1070 <move@plt>
mov    $0x0,%al
call   1040 <clrtoeol@plt>
mov    $0x2,%edi
mov    $0x7,%esi
call   1070 <move@plt>
mov    $0x0,%al
call   1040 <clrtoeol@plt>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<in>:
push   %rbx
xor    %edi,%edi
call   1060 <curs_set@plt>
xor    %eax,%eax
call   1050 <noecho@plt>
xor    %eax,%eax
call   1030 <getch@plt>
mov    %eax,%ebx
mov    $0x1,%edi
mov    $0x5,%esi
call   1070 <move@plt>
xor    %eax,%eax
call   1040 <clrtoeol@plt>
mov    $0x2,%edi
mov    $0x7,%esi
call   1070 <move@plt>
xor    %eax,%eax
call   1040 <clrtoeol@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @in() {
%1 = alloca i8
%2 = call i32 @curs_set(i32 0)
%3 = call i32 (...) @noecho()
%4 = call signext i8 (...) @getch()
store i8 %4, i8* %1
%5 = call i32 @move(i32 1, i32 5)
%6 = call i32 (...) @clrtoeol()
%7 = call i32 @move(i32 2, i32 7)
%8 = call i32 (...) @clrtoeol()
%9 = load i8, i8* %1
ret i8 %9
}

LLVM IR (-O2):
define signext i8 @in() {
%1 = tail call i32 @curs_set(i32 0)
%2 = tail call i32 (...) @noecho()
%3 = tail call signext i8 (...) @getch()
%4 = tail call i32 @move(i32 1, i32 5)
%5 = tail call i32 (...) @clrtoeol()
%6 = tail call i32 @move(i32 2, i32 7)
%7 = tail call i32 (...) @clrtoeol()
ret i8 %3
}
/* Type definitions */
struct stat {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
scalar_t__ stat(char *, struct stat *);
void file_exist() {
  FILE *fd;
  struct stat sbuf;
  if (stat("structure.txt", &sbuf) < 0) {
    fd = fopen("structure.txt", "w+");
    fclose(fd);
  }
}


x86 assembly (clang, -O0):
<file_exist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <stat@plt>
cmp    $0x0,%rax
jge    1172 <file_exist+0x42>
lea    0xea7(%rip),%rdi
lea    0xeae(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_exist>:
push   %rax
lea    0xec8(%rip),%rdi
mov    %rsp,%rsi
call   1040 <stat@plt>
test   %rax,%rax
js     1147 <file_exist+0x17>
pop    %rax
ret
lea    0xeb2(%rip),%rdi
lea    0xeb9(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rdi
call   1030 <fclose@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@.str = [14 x i8] c"structure.txt\00"
@.str.1 = [3 x i8] c"w+\00"
define void @file_exist() {
%1 = alloca i32*
%2 = alloca %struct.stat
%3 = call i64 @stat(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), %struct.stat* %2)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %0
%6 = call i32* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %6, i32** %1
%7 = load i32*, i32** %1
%8 = call i32 @fclose(i32* %7)
br label %9
9: ; preds = %5, %0
ret void
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@.str = [14 x i8] c"structure.txt\00"
@.str.1 = [3 x i8] c"w+\00"
define void @file_exist() {
%1 = alloca %struct.stat
%2 = bitcast %struct.stat* %1 to i8*
%3 = call i64 @stat(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), %struct.stat* %1)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = call i32* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @fclose(i32* %6)
br label %8
8: ; preds = %5, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ nsc_assert(int);
void random_harvest(void) {
  nsc_assert(0 && "This function is unimplemented.");
  ;
}


x86 assembly (clang, -O0):
<random_harvest>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_harvest>:
xor    %edi,%edi
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
define void @random_harvest() {
%1 = call i32 @nsc_assert(i32 0)
ret void
}

LLVM IR (-O2):
define void @random_harvest() {
%1 = tail call i32 @nsc_assert(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ rem_str_ft(char *, scalar_t__);
char *rmv_spc(char *);
char *spc_slt(char *);
scalar_t__ strlen(char *);
char *rmv_slt(char *argstr) {
  char *fnt_cln = rmv_spc(argstr);
  char *spl_str = spc_slt(fnt_cln);
  rem_str_ft(argstr, (strlen(argstr) - strlen(fnt_cln)) + strlen(spl_str));
  free(fnt_cln);
  return spl_str;
}


x86 assembly (clang, -O0):
<rmv_slt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1070 <rmv_spc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1060 <spc_slt@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strlen@plt>
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <strlen@plt>
mov    %rax,%rcx
mov    -0x30(%rbp),%rax
sub    %rcx,%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x28(%rbp),%rsi
mov    -0x20(%rbp),%rdi
add    %rax,%rsi
call   1040 <rem_str_ft@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rmv_slt>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdi,%r12
call   1070 <rmv_spc@plt>
mov    %rax,%r14
mov    %rax,%rdi
call   1060 <spc_slt@plt>
mov    %rax,%r15
mov    %r12,%rdi
call   1050 <strlen@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1050 <strlen@plt>
sub    %rax,%rbx
mov    %r15,%rdi
call   1050 <strlen@plt>
add    %rax,%rbx
mov    %r12,%rdi
mov    %rbx,%rsi
call   1040 <rem_str_ft@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %r15,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @rmv_slt(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i8* @rmv_spc(i8* %5)
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = call i8* @spc_slt(i8* %7)
store i8* %8, i8** %4
%9 = load i8*, i8** %2
%10 = load i8*, i8** %2
%11 = call i64 @strlen(i8* %10)
%12 = load i8*, i8** %3
%13 = call i64 @strlen(i8* %12)
%14 = sub nsw i64 %11, %13
%15 = load i8*, i8** %4
%16 = call i64 @strlen(i8* %15)
%17 = add nsw i64 %14, %16
%18 = call i32 @rem_str_ft(i8* %9, i64 %17)
%19 = load i8*, i8** %3
%20 = call i32 @free(i8* %19)
%21 = load i8*, i8** %4
ret i8* %21
}

LLVM IR (-O2):
define i8* @rmv_slt(i8* %0) {
%2 = tail call i8* @rmv_spc(i8* %0)
%3 = tail call i8* @spc_slt(i8* %2)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%5 = tail call i64 @strlen(i8* dereferenceable(1) %2)
%6 = sub i64 %4, %5
%7 = tail call i64 @strlen(i8* dereferenceable(1) %3)
%8 = add nsw i64 %6, %7
%9 = tail call i32 @rem_str_ft(i8* %0, i64 %8)
%10 = tail call i32 @free(i8* %2)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ xip_fpo_less_flt(int *, float, float);
int xil_fpo_less_flt(float a, float b) {
  int res_int;
  xip_fpo_less_flt(&res_int, a, b);
  return res_int;
}


x86 assembly (clang, -O0):
<xil_fpo_less_flt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
lea    -0xc(%rbp),%rdi
call   1030 <xip_fpo_less_flt@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xil_fpo_less_flt>:
push   %rax
lea    0x4(%rsp),%rdi
call   1030 <xip_fpo_less_flt@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @xil_fpo_less_flt(float %0, float %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @xip_fpo_less_flt(i32* %3, float %0, float %1)
%6 = load i32, i32* %3
ret i32 %6
}