xunge/DecIR huggingface dataset:
char *ft_strcat(char *s1, const char *s2) {
  char *tmp;
  tmp = s1;
  while (*tmp)
    tmp++;
  while (*s2)
    *tmp++ = *s2++;
  *tmp = 0;
  return (s1);
}


x86 assembly (clang, -O0):
<ft_strcat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1132 <ft_strcat+0x32>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <ft_strcat+0x14>
jmp    1137 <ft_strcat+0x37>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     116b <ft_strcat+0x6b>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
jmp    1137 <ft_strcat+0x37>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strcat>:
mov    %rdi,%rax
mov    %rdi,%rcx
cs nopw 0x0(%rax,%rax,1)
mov    %rcx,%rdi
add    $0x1,%rcx
cmpb   $0x0,(%rdi)
jne    1110 <ft_strcat+0x10>
mov    (%rsi),%dl
test   %dl,%dl
je     1146 <ft_strcat+0x46>
mov    $0xffffffffffffffff,%rdi
nopl   0x0(%rax)
mov    %dl,(%rcx,%rdi,1)
movzbl 0x2(%rsi,%rdi,1),%edx
add    $0x1,%rdi
test   %dl,%dl
jne    1130 <ft_strcat+0x30>
add    %rdi,%rcx
mov    %rcx,%rdi
movb   $0x0,(%rdi)
ret

LLVM IR (-O0):
define i8* @ft_strcat(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 = %11, %2
%8 = load i8*, i8** %5
%9 = load i8, i8* %8
%10 = icmp ne i8 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %7
%12 = load i8*, i8** %5
%13 = getelementptr inbounds i8, i8* %12, i32 1
store i8* %13, i8** %5
br label %7
14: ; preds = %7
br label %15
15: ; preds = %19, %14
%16 = load i8*, i8** %4
%17 = load i8, i8* %16
%18 = icmp ne i8 %17, 0
br i1 %18, label %19, label %25
19: ; preds = %15
%20 = load i8*, i8** %4
%21 = getelementptr inbounds i8, i8* %20, i32 1
store i8* %21, i8** %4
%22 = load i8, i8* %20
%23 = load i8*, i8** %5
%24 = getelementptr inbounds i8, i8* %23, i32 1
store i8* %24, i8** %5
store i8 %22, i8* %23
br label %15
25: ; preds = %15
%26 = load i8*, i8** %5
store i8 0, i8* %26
%27 = load i8*, i8** %3
ret i8* %27
}

LLVM IR (-O2):
define i8* @ft_strcat(i8* returned %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3
%9 = load i8, i8* %1
%10 = icmp eq i8 %9, 0
br i1 %10, label %19, label %11
11: ; preds = %8, %11
%12 = phi i8 [ %17, %11 ], [ %9, %8 ]
%13 = phi i8* [ %16, %11 ], [ %4, %8 ]
%14 = phi i8* [ %15, %11 ], [ %1, %8 ]
%15 = getelementptr inbounds i8, i8* %14, i64 1
%16 = getelementptr inbounds i8, i8* %13, i64 1
store i8 %12, i8* %13
%17 = load i8, i8* %15
%18 = icmp eq i8 %17, 0
br i1 %18, label %19, label %11
19: ; preds = %11, %8
%20 = phi i8* [ %4, %8 ], [ %16, %11 ]
store i8 0, i8* %20
ret i8* %0
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int htonl(int);
uint64_t htonll(uint64_t *value) {
  uint64_t vv = *((uint64_t *)value);
  int num = 42;
  if (*(char *)&num == 42)
    return (((uint64_t)htonl(vv)) << 32) + htonl(vv >> 32);
  else
    return vv;
}


x86 assembly (clang, -O0):
<htonll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
movl   $0x2a,-0x18(%rbp)
movsbl -0x18(%rbp),%eax
cmp    $0x2a,%eax
jne    1169 <htonll+0x59>
mov    -0x14(%rbp),%edi
call   1030 <htonl@plt>
mov    $0x20,%ecx
shl    %cl,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%edi
mov    $0x20,%ecx
sar    %cl,%edi
call   1030 <htonl@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    116f <htonll+0x5f>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<htonll>:
push   %rbx
mov    (%rdi),%ebx
mov    %ebx,%edi
call   1030 <htonl@plt>
call   1030 <htonl@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @htonll(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
store i32 %7, i32* %4
store i32 42, i32* %5
%8 = bitcast i32* %5 to i8*
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 42
br i1 %11, label %12, label %20
12: ; preds = %1
%13 = load i32, i32* %4
%14 = call i32 @htonl(i32 %13)
%15 = shl i32 %14, 32
%16 = load i32, i32* %4
%17 = ashr i32 %16, 32
%18 = call i32 @htonl(i32 %17)
%19 = add nsw i32 %15, %18
store i32 %19, i32* %2
br label %22
20: ; preds = %1
%21 = load i32, i32* %4
store i32 %21, i32* %2
br label %22
22: ; preds = %20, %12
%23 = load i32, i32* %2
ret i32 %23
}

LLVM IR (-O2):
define i32 @htonll(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @htonl(i32 %2)
%4 = tail call i32 @htonl(i32 poison)
ret i32 %2
}
/* Type definitions */
struct device {
  int dummy;
};
struct bcache_entry {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ bcache_entry_clean(struct bcache_entry *);
struct bcache_entry *bcache_find(struct device *, int);
void bcache_flush_block(struct device *device, int block) {
  struct bcache_entry *e;
  e = bcache_find(device, block);
  if (e)
    bcache_entry_clean(e);
}


x86 assembly (clang, -O0):
<bcache_flush_block>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <bcache_find@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1153 <bcache_flush_block+0x33>
mov    -0x18(%rbp),%rdi
call   1040 <bcache_entry_clean@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bcache_flush_block>:
push   %rax
call   1030 <bcache_find@plt>
test   %rax,%rax
je     1134 <bcache_flush_block+0x14>
mov    %rax,%rdi
pop    %rax
jmp    1040 <bcache_entry_clean@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.device = type { i32 }
%struct.bcache_entry = type { i32 }
define void @bcache_flush_block(%struct.device* %0, i32 %1) {
%3 = alloca %struct.device*
%4 = alloca i32
%5 = alloca %struct.bcache_entry*
store %struct.device* %0, %struct.device** %3
store i32 %1, i32* %4
%6 = load %struct.device*, %struct.device** %3
%7 = load i32, i32* %4
%8 = call %struct.bcache_entry* @bcache_find(%struct.device* %6, i32 %7)
store %struct.bcache_entry* %8, %struct.bcache_entry** %5
%9 = load %struct.bcache_entry*, %struct.bcache_entry** %5
%10 = icmp ne %struct.bcache_entry* %9, null
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load %struct.bcache_entry*, %struct.bcache_entry** %5
%13 = call i32 @bcache_entry_clean(%struct.bcache_entry* %12)
br label %14
14: ; preds = %11, %2
ret void
}

LLVM IR (-O2):
%struct.device = type { i32 }
%struct.bcache_entry = type { i32 }
define void @bcache_flush_block(%struct.device* %0, i32 %1) {
%3 = tail call %struct.bcache_entry* @bcache_find(%struct.device* %0, i32 %1)
%4 = icmp eq %struct.bcache_entry* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @bcache_entry_clean(%struct.bcache_entry* %3)
br label %7
7: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ memmove(char *, char *, int);
int /*<<< orphan*/ strcmp(char *, char *);
int main() {
  char str[] = "asd asd psd csd";
  char str2[] = "asd asd asd asd";
  memmove(str, str + 8, 7);
  assert(strcmp(str, str2));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeba(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeb7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xeb4(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xeb1(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x20(%rbp),%rsi
add    $0x8,%rsi
mov    $0x7,%edx
call   1050 <memmove@plt>
lea    -0x20(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   1030 <strcmp@plt>
mov    %eax,%edi
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movaps 0xec4(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x8(%rsp),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x7,%edx
call   1050 <memmove@plt>
lea    0xeb4(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
mov    %eax,%edi
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.str = [16 x i8] c"asd asd psd csd\00"
@__const.main.str2 = [16 x i8] c"asd asd asd asd\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [16 x i8]
%3 = alloca [16 x i8]
store i32 0, i32* %1
%4 = bitcast [16 x i8]* %2 to i8*
%5 = bitcast [16 x i8]* %3 to i8*
%6 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%8 = getelementptr inbounds i8, i8* %7, i64 8
%9 = call i32 @memmove(i8* %6, i8* %8, i32 7)
%10 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%11 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%12 = call i32 @strcmp(i8* %10, i8* %11)
%13 = call i32 @assert(i32 %12)
ret i32 0
}

LLVM IR (-O2):
@__const.main.str = [16 x i8] c"asd asd psd csd\00"
@__const.main.str2 = [16 x i8] c"asd asd asd asd\00"
define i32 @main() {
%1 = alloca [16 x i8]
%2 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%3 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 8
%4 = call i32 @memmove(i8* %2, i8* %3, i32 7)
%5 = call i32 @strcmp(i8* %2, i8* dereferenceable(16) getelementptr inbounds ([16 x i8], [16 x i8]* @__const.main.str2, i64 0, i64 0))
%6 = call i32 @assert(i32 %5)
ret i32 0
}
/* Type definitions */
struct idbm {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct idbm *);
void _idbm_free(struct idbm *db) { free(db); }


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

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

LLVM IR (-O0):
%struct.idbm = type { i32 }
define void @_idbm_free(%struct.idbm* %0) {
%2 = alloca %struct.idbm*
store %struct.idbm* %0, %struct.idbm** %2
%3 = load %struct.idbm*, %struct.idbm** %2
%4 = call i32 @free(%struct.idbm* %3)
ret void
}

LLVM IR (-O2):
%struct.idbm = type { i32 }
define void @_idbm_free(%struct.idbm* nocapture %0) {
%2 = tail call i32 @free(%struct.idbm* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *malloc(int);
void really(void) {
  int i;
  char *p = malloc(10);
  for (i = 0; i < 10; i++)
    p[i] = 'z';
  free(p);
  p[1] = 'z';
  p = malloc(10);
  p[2] = 'z';
  p[-1] = 'z';
}


x86 assembly (clang, -O0):
<really>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xa,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jge    1161 <really+0x41>
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
movb   $0x7a,(%rax,%rcx,1)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    113d <really+0x1d>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rax
movb   $0x7a,0x1(%rax)
mov    $0xa,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x7a,0x2(%rax)
mov    -0x10(%rbp),%rax
movb   $0x7a,-0x1(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<really>:
push   %rax
mov    $0xa,%edi
call   1040 <malloc@plt>
movabs $0x7a7a7a7a7a7a7a7a,%rcx
7a 7a 7a
mov    %rcx,(%rax)
movw   $0x7a7a,0x8(%rax)
mov    %rax,%rdi
pop    %rax
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @really() {
%1 = tail call dereferenceable_or_null(10) i8* @malloc(i32 10)
%2 = tail call i32 @free(i8* %1)
ret void
}
void sig_check_and_resume() { return; }


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

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

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

LLVM IR (-O2):
define void @sig_check_and_resume() {
ret void
}
void otrx_create_parse_options(int argc, char **argv) {}


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

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

LLVM IR (-O0):
define void @otrx_create_parse_options(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
ret void
}

LLVM IR (-O2):
define void @otrx_create_parse_options(i32 %0, i8** nocapture %1) {
ret void
}
int get32(unsigned char *dw) {
  return (*dw << 24) | (*(dw + 1) << 16) | (*(dw + 2) << 8) | *(dw + 3);
}


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

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

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

LLVM IR (-O2):
define i32 @get32(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = shl nuw i32 %3, 24
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 16
%9 = or i32 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl nuw nsw i32 %12, 8
%14 = or i32 %9, %13
%15 = getelementptr inbounds i8, i8* %0, i64 3
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = or i32 %14, %17
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ find_track(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdin;
int main() {
  char search_for[80];
  printf("Search for: ");
  fgets(search_for, 80, stdin);
  find_track(search_for);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    0xec1(%rip),%rdi
call   1040 <printf@plt>
lea    -0x50(%rbp),%rdi
mov    0x2e99(%rip),%rax
mov    (%rax),%edx
mov    $0x50,%esi
call   1050 <fgets@plt>
lea    -0x50(%rbp),%rdi
call   1030 <find_track@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x50,%rsp
lea    0xec4(%rip),%rdi
call   1040 <printf@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x50,%esi
call   1050 <fgets@plt>
mov    %rbx,%rdi
call   1030 <find_track@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Search for: \00"
@stdin = global i32 0
define i32 @main() {
%1 = alloca [80 x i8]
%2 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%3 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%4 = load i32, i32* @stdin
%5 = call i32 @fgets(i8* %3, i32 80, i32 %4)
%6 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%7 = call i32 @find_track(i8* %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"Search for: \00"
@stdin = global i32 0
define i32 @main() {
%1 = alloca [80 x i8]
%2 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stdin
%5 = call i32 @fgets(i8* %2, i32 80, i32 %4)
%6 = call i32 @find_track(i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "usage: sleep seconds\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [22 x i8] c"usage: sleep seconds\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [22 x i8] c"usage: sleep seconds\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
int tls13_client_certificate_recv(struct tls13_ctx *ctx) { return 1; }


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

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

LLVM IR (-O0):
%struct.tls13_ctx = type opaque
define i32 @tls13_client_certificate_recv(%struct.tls13_ctx* %0) {
%2 = alloca %struct.tls13_ctx*
store %struct.tls13_ctx* %0, %struct.tls13_ctx** %2
ret i32 1
}

LLVM IR (-O2):
%struct.tls13_ctx = type opaque
define i32 @tls13_client_certificate_recv(%struct.tls13_ctx* nocapture readnone %0) {
ret i32 1
}
/* Type definitions */
struct p7_timer_event {
  int dummy;
};
struct p7_minheap {
  int dummy;
};

/* Variables and functions */
scalar_t__ heap_peek_min(struct p7_minheap *);
struct p7_timer_event *timer_peek_earliest(struct p7_minheap *heap) {
  return (struct p7_timer_event *)heap_peek_min(heap);
}


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

x86 assembly (clang, -O2):
<timer_peek_earliest>:
jmp    1030 <heap_peek_min@plt>

LLVM IR (-O0):
%struct.p7_timer_event = type { i32 }
%struct.p7_minheap = type { i32 }
define %struct.p7_timer_event* @timer_peek_earliest(%struct.p7_minheap* %0) {
%2 = alloca %struct.p7_minheap*
store %struct.p7_minheap* %0, %struct.p7_minheap** %2
%3 = load %struct.p7_minheap*, %struct.p7_minheap** %2
%4 = call i64 @heap_peek_min(%struct.p7_minheap* %3)
%5 = inttoptr i64 %4 to %struct.p7_timer_event*
ret %struct.p7_timer_event* %5
}

LLVM IR (-O2):
%struct.p7_timer_event = type { i32 }
%struct.p7_minheap = type { i32 }
define %struct.p7_timer_event* @timer_peek_earliest(%struct.p7_minheap* %0) {
%2 = tail call i64 @heap_peek_min(%struct.p7_minheap* %0)
%3 = inttoptr i64 %2 to %struct.p7_timer_event*
ret %struct.p7_timer_event* %3
}
int do_209() { return 209; }


x86 assembly (clang, -O0):
<do_209>:
push   %rbp
mov    %rsp,%rbp
mov    $0xd1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @do_209() {
ret i32 209
}

LLVM IR (-O2):
define i32 @do_209() {
ret i32 209
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ IntEnable(int);
int /*<<< orphan*/ IntRegister(int, void (*)());
void ComparatorIntRegister(uint32_t ui32Base, uint32_t ui32Comp,
                           void (*pfnHandler)(void)) {
  ;
  ;
  IntRegister(41 + ui32Comp, pfnHandler);
  IntEnable(41 + ui32Comp);
  (*((volatile unsigned long *)(ui32Base + 0x00000008))) |= 1 << ui32Comp;
}


x86 assembly (clang, -O0):
<ComparatorIntRegister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x8(%rbp),%edi
add    $0x29,%edi
mov    -0x10(%rbp),%rsi
call   1040 <IntRegister@plt>
mov    -0x8(%rbp),%edi
add    $0x29,%edi
call   1030 <IntEnable@plt>
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
movslq %eax,%rdx
mov    -0x4(%rbp),%eax
add    $0x8,%eax
cltq
mov    (%rax),%rcx
or     %rdx,%rcx
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ComparatorIntRegister>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %edi,%r14d
lea    0x29(%rbx),%ebp
mov    %ebp,%edi
mov    %rdx,%rsi
call   1040 <IntRegister@plt>
mov    %ebp,%edi
call   1030 <IntEnable@plt>
mov    $0x1,%eax
mov    %ebx,%ecx
shl    %cl,%eax
cltq
movslq %r14d,%rcx
or     %rax,0x8(%rcx)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @ComparatorIntRegister(i32 %0, i32 %1, void ()* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca void ()*
store i32 %0, i32* %4
store i32 %1, i32* %5
store void ()* %2, void ()** %6
%7 = load i32, i32* %5
%8 = add nsw i32 41, %7
%9 = load void ()*, void ()** %6
%10 = bitcast void ()* %9 to void (...)*
%11 = call i32 @IntRegister(i32 %8, void (...)* %10)
%12 = load i32, i32* %5
%13 = add nsw i32 41, %12
%14 = call i32 @IntEnable(i32 %13)
%15 = load i32, i32* %5
%16 = shl i32 1, %15
%17 = sext i32 %16 to i64
%18 = load i32, i32* %4
%19 = add nsw i32 %18, 8
%20 = sext i32 %19 to i64
%21 = inttoptr i64 %20 to i64*
%22 = load volatile i64, i64* %21
%23 = or i64 %22, %17
store volatile i64 %23, i64* %21
ret void
}

LLVM IR (-O2):
define void @ComparatorIntRegister(i32 %0, i32 %1, void ()* %2) {
%4 = add nsw i32 %1, 41
%5 = bitcast void ()* %2 to void (...)*
%6 = tail call i32 @IntRegister(i32 %4, void (...)* %5)
%7 = tail call i32 @IntEnable(i32 %4)
%8 = shl nuw i32 1, %1
%9 = sext i32 %8 to i64
%10 = add nsw i32 %0, 8
%11 = sext i32 %10 to i64
%12 = inttoptr i64 %11 to i64*
%13 = load volatile i64, i64* %12
%14 = or i64 %13, %9
store volatile i64 %14, i64* %12
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int /*<<< orphan*/ *wcscat(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
wchar_t *Loopr_wcscat(wchar_t *s1, wchar_t *s2) { return wcscat(s1, s2); }


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

x86 assembly (clang, -O2):
<Loopr_wcscat>:
jmp    1030 <wcscat@plt>

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

LLVM IR (-O2):
define i32* @Loopr_wcscat(i32* %0, i32* %1) {
%3 = tail call i32* @wcscat(i32* %0, i32* %1)
ret i32* %3
}
long long d2lz(double a) { return (long long)a; }


x86 assembly (clang, -O0):
<d2lz>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
cvttsd2si -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d2lz>:
cvttsd2si %xmm0,%rax
ret

LLVM IR (-O0):
define i64 @d2lz(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fptosi double %3 to i64
ret i64 %4
}

LLVM IR (-O2):
define i64 @d2lz(double %0) {
%2 = fptosi double %0 to i64
ret i64 %2
}
/* Variables and functions */
int PAPI_remove_event(int, int);
void papif_remove_event__(int *EventSet, int *Event, int *check) {
  *check = PAPI_remove_event(*EventSet, *Event);
}


x86 assembly (clang, -O0):
<papif_remove_event__>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
call   1030 <PAPI_remove_event@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<papif_remove_event__>:
push   %rbx
mov    %rdx,%rbx
mov    (%rdi),%edi
mov    (%rsi),%esi
call   1030 <PAPI_remove_event@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @papif_remove_event__(i32* nocapture %0, i32* nocapture %1, i32* nocapture writeonly %2) {
%4 = load i32, i32* %0
%5 = load i32, i32* %1
%6 = tail call i32 @PAPI_remove_event(i32 %4, i32 %5)
store i32 %6, i32* %2
ret void
}
/* Variables and functions */
char *malloc(size_t);
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
size_t strlen(char const *);
char *strcopy(const char *src) {
  if (!src) {
    return NULL;
  }
  size_t len;
  char *result;
  len = strlen(src);
  result = malloc(len + 1);
  memcpy(result, src, len);
  result[len] = '\0';
  return result;
}


x86 assembly (clang, -O0):
<strcopy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <strcopy+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1197 <strcopy+0x67>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcopy>:
push   %r15
push   %r14
push   %rbx
test   %rdi,%rdi
je     1166 <strcopy+0x36>
mov    %rdi,%r14
call   1030 <strlen@plt>
mov    %rax,%r15
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
movb   $0x0,(%rbx,%r15,1)
jmp    1168 <strcopy+0x38>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @strcopy(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = tail call i64 @strlen(i8* %0)
%5 = add i64 %4, 1
%6 = tail call i8* @malloc(i64 %5)
%7 = tail call i32 @memcpy(i8* %6, i8* %0, i64 %4)
%8 = getelementptr inbounds i8, i8* %6, i64 %4
store i8 0, i8* %8
br label %9
9: ; preds = %1, %3
%10 = phi i8* [ %6, %3 ], [ null, %1 ]
ret i8* %10
}
/* Variables and functions */
char *memchr(char *, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
void nullpointerMemchr2(char *p, char *s) { p = memchr(s, 0, strlen(s)); }


x86 assembly (clang, -O0):
<nullpointerMemchr2>:
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
xor    %esi,%esi
call   1040 <memchr@plt>
mov    %rax,-0x8(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nullpointerMemchr2>:
push   %rbx
mov    %rsi,%rbx
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %eax,%edx
pop    %rbx
jmp    1040 <memchr@plt>

LLVM IR (-O0):
define void @nullpointerMemchr2(i8* %0, i8* %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** %4
%7 = call i32 @strlen(i8* %6)
%8 = call i8* @memchr(i8* %5, i32 0, i32 %7)
store i8* %8, i8** %3
ret void
}

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

/* Variables and functions */
int S_ISSOCK(int /*<<< orphan*/);
int C_S_ISSOCK(mode_t mode) { return S_ISSOCK(mode); }


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

x86 assembly (clang, -O2):
<C_S_ISSOCK>:
jmp    1030 <S_ISSOCK@plt>

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

LLVM IR (-O2):
define i32 @C_S_ISSOCK(i32 %0) {
%2 = tail call i32 @S_ISSOCK(i32 %0)
ret i32 %2
}
/* Variables and functions */
int tunemu_read(int, char *, int);
int tun_read(int fd, char *buf, int len) { return tunemu_read(fd, buf, len); }


x86 assembly (clang, -O0):
<tun_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <tunemu_read@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tun_read>:
jmp    1030 <tunemu_read@plt>

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

LLVM IR (-O2):
define i32 @tun_read(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @tunemu_read(i32 %0, i8* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ handle_33(int /*<<< orphan*/);
int gen_33(void) {
  handle_33(0);
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @gen_33() {
%1 = call i32 @handle_33(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @gen_33() {
%1 = tail call i32 @handle_33(i32 0)
ret i32 0
}
int is_uppercase(char c) { return (c >= 'A' && c <= 'Z'); }


x86 assembly (clang, -O0):
<is_uppercase>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x41,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <is_uppercase+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x5a,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_uppercase>:
add    $0xbf,%dil
xor    %eax,%eax
cmp    $0x1a,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @is_uppercase(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 65
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 90
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @is_uppercase(i8 signext %0) {
%2 = add i8 %0, -65
%3 = icmp ult i8 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
void arch_decomp_wdog(void) {}


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

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

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

LLVM IR (-O2):
define void @arch_decomp_wdog() {
ret void
}
int flat_set_persistent(unsigned long relval, unsigned long *persistent) {
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @flat_set_persistent(i64 %0, i64* %1) {
%3 = alloca i64
%4 = alloca i64*
store i64 %0, i64* %3
store i64* %1, i64** %4
ret i32 0
}

LLVM IR (-O2):
define i32 @flat_set_persistent(i64 %0, i64* nocapture readnone %1) {
ret i32 0
}
/* Type definitions */
struct game {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
struct game **importData(int /*<<< orphan*/ *, int *);
void main() {
  FILE *ifpData;
  struct game **cabinet;
  int *cabSize;
  cabSize = 0;
  cabinet = importData(ifpData, cabSize);
  return;
}


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

x86 assembly (clang, -O2):
<main>:
xor    %esi,%esi
jmp    1030 <importData@plt>

LLVM IR (-O0):
%struct.game = type { i32 }
define void @main() {
%1 = alloca i32*
%2 = alloca %struct.game**
%3 = alloca i32*
store i32* null, i32** %3
%4 = load i32*, i32** %1
%5 = load i32*, i32** %3
%6 = call %struct.game** @importData(i32* %4, i32* %5)
store %struct.game** %6, %struct.game*** %2
ret void
}

LLVM IR (-O2):
%struct.game = type { i32 }
define void @main() {
%1 = tail call %struct.game** @importData(i32* undef, i32* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_packet_unref() {
  printf("NOT IMPLEMENTED:"
         "pa_packet_unref"
         "\n");
}


x86 assembly (clang, -O0):
<pa_packet_unref>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [33 x i8] c"NOT IMPLEMENTED:pa_packet_unref\0A\00"
define i32 @pa_packet_unref() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [32 x i8] c"NOT IMPLEMENTED:pa_packet_unref\00"
define i32 @pa_packet_unref() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
scalar_t__ strncmp(char const *, char *, int);
bool is_help(const char *arg) {
  return strncmp(arg, "-h", 3) == 0 || strncmp(arg, "--help", 7) == 0;
}


x86 assembly (clang, -O0):
<is_help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
je     1162 <is_help+0x52>
mov    -0x8(%rbp),%rdi
lea    0xeb5(%rip),%rsi
mov    $0x7,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_help>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     114b <is_help+0x3b>
lea    0xed2(%rip),%rsi
mov    %rbx,%rdi
mov    $0x7,%edx
call   1030 <strncmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"-h\00"
@.str.1 = [7 x i8] c"--help\00"
define i32 @is_help(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strncmp(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i64 @strncmp(i8* %7, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 7)
%9 = icmp eq i64 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
@.str = [3 x i8] c"-h\00"
@.str.1 = [7 x i8] c"--help\00"
define i32 @is_help(i8* %0) {
%2 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 3)
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 7)
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() { printf("Boilerplate...\n"); }


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"Boilerplate...\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [15 x i8] c"Boilerplate...\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void destructor(void *buf) { free(buf); }


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

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

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

LLVM IR (-O2):
define void @destructor(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
double exp(double);
double qDBO(double DBO) {
  double q3, A = 102.6, B = -0.1101;
  if (DBO > 30) {
    return 2;
  } else {
    q3 = A * exp(B * DBO);
    return q3;
  }
}


x86 assembly (clang, -O0):
<qDBO>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  0xeeb(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xed6(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xebc(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1160 <qDBO+0x50>
movsd  0xec2(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1194 <qDBO+0x84>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x28(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qDBO>:
push   %rax
ucomisd 0xeef(%rip),%xmm0
jbe    1125 <qDBO+0x15>
movsd  0xedd(%rip),%xmm0
pop    %rax
ret
mulsd  0xee3(%rip),%xmm0
call   1030 <exp@plt>
mulsd  0xede(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @qDBO(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %3
store double 1.026000e+02, double* %5
store double -1.101000e-01, double* %6
%7 = load double, double* %3
%8 = fcmp ogt double %7, 3.000000e+01
br i1 %8, label %9, label %10
9: ; preds = %1
store double 2.000000e+00, double* %2
br label %18
10: ; preds = %1
%11 = load double, double* %5
%12 = load double, double* %6
%13 = load double, double* %3
%14 = fmul double %12, %13
%15 = call double @exp(double %14)
%16 = fmul double %11, %15
store double %16, double* %4
%17 = load double, double* %4
store double %17, double* %2
br label %18
18: ; preds = %10, %9
%19 = load double, double* %2
ret double %19
}

LLVM IR (-O2):
define double @qDBO(double %0) {
%2 = fcmp ogt double %0, 3.000000e+01
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = fmul double %0, -1.101000e-01
%5 = tail call double @exp(double %4)
%6 = fmul double %5, 1.026000e+02
br label %7
7: ; preds = %1, %3
%8 = phi double [ %6, %3 ], [ 2.000000e+00, %1 ]
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ memchr(void *, int, size_t);
void uninitvar_memchr(void) {
  void *cs;
  int c;
  size_t n;
  (void)memchr(cs, c, n);
}


x86 assembly (clang, -O0):
<uninitvar_memchr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <memchr@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uninitvar_memchr>:
jmp    1030 <memchr@plt>

LLVM IR (-O0):
define void @uninitvar_memchr() {
%1 = alloca i8*
%2 = alloca i32
%3 = alloca i64
%4 = load i8*, i8** %1
%5 = load i32, i32* %2
%6 = load i64, i64* %3
%7 = call i32 @memchr(i8* %4, i32 %5, i64 %6)
ret void
}

LLVM IR (-O2):
define void @uninitvar_memchr() {
%1 = tail call i32 @memchr(i8* undef, i32 undef, i64 undef)
ret void
}
void checkInputSanity(char *ip6Prefx) {}


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

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

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

LLVM IR (-O2):
define void @checkInputSanity(i8* nocapture %0) {
ret void
}
int CmpDoubles(const double *keyval, const double *datum) {
  if (*keyval < *datum)
    return (-1);
  if (*keyval > *datum)
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<CmpDoubles>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
jbe    1132 <CmpDoubles+0x32>
movl   $0xffffffff,-0x4(%rbp)
jmp    115b <CmpDoubles+0x5b>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
ucomisd (%rax),%xmm0
jbe    1154 <CmpDoubles+0x54>
movl   $0x1,-0x4(%rbp)
jmp    115b <CmpDoubles+0x5b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<CmpDoubles>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
xor    %ecx,%ecx
ucomisd %xmm1,%xmm0
seta   %cl
ucomisd %xmm0,%xmm1
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @CmpDoubles(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
%5 = fcmp olt double %3, %4
%6 = fcmp ogt double %3, %4
%7 = zext i1 %6 to i32
%8 = select i1 %5, i32 -1, i32 %7
ret i32 %8
}
void f2(char line[10], int pointer) {}


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

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

LLVM IR (-O0):
define void @f2(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
define void @f2(i8* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int maxXor(int, int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int res;
  int _l;
  scanf("%d", &_l);
  int _r;
  scanf("%d", &_r);
  res = maxXor(_l, _r);
  printf("%d", res);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
call   1050 <maxXor@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%5 = bitcast i32* %2 to i8*
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = call i32 @maxXor(i32 %7, i32 %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %9)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ test_cpu_reset();
int /*<<< orphan*/ test_mem_reset();
void test_reset() {
  test_cpu_reset();
  test_mem_reset();
}


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

x86 assembly (clang, -O2):
<test_reset>:
push   %rax
xor    %eax,%eax
call   1040 <test_cpu_reset@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <test_mem_reset@plt>

LLVM IR (-O0):
define void @test_reset() {
%1 = call i32 (...) @test_cpu_reset()
%2 = call i32 (...) @test_mem_reset()
ret void
}

LLVM IR (-O2):
define void @test_reset() {
%1 = tail call i32 (...) @test_cpu_reset()
%2 = tail call i32 (...) @test_mem_reset()
ret void
}