xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ getaddrinfodnsresolution(char *);
int /*<<< orphan*/ printf(char *, char *);
void inetDNSResolution(char *domain) {
  printf("Inet Domain name %s resolves to:\n", domain);
  getaddrinfodnsresolution(domain);
  return;
}


x86 assembly (clang, -O0):
<inetDNSResolution>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <getaddrinfodnsresolution@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inetDNSResolution>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <getaddrinfodnsresolution@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"Inet Domain name %s resolves to:\0A\00"
define void @inetDNSResolution(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i8*, i8** %2
%6 = call i32 @getaddrinfodnsresolution(i8* %5)
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"Inet Domain name %s resolves to:\0A\00"
define void @inetDNSResolution(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @getaddrinfodnsresolution(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gettimeofday_op(int /*<<< orphan*/, int /*<<< orphan*/);
void init_timer() { gettimeofday_op(0, 0); }


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

x86 assembly (clang, -O2):
<init_timer>:
xor    %edi,%edi
xor    %esi,%esi
jmp    1030 <gettimeofday_op@plt>

LLVM IR (-O0):
define void @init_timer() {
%1 = call i32 @gettimeofday_op(i32 0, i32 0)
ret void
}

LLVM IR (-O2):
define void @init_timer() {
%1 = tail call i32 @gettimeofday_op(i32 0, i32 0)
ret void
}
/* Type definitions */
struct oscap_string {
  int dummy;
};
struct oscap_buffer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ oscap_buffer_append_binary_data(struct oscap_buffer *,
                                                   char *, int);
void oscap_string_append_char(struct oscap_string *s, char c) {
  oscap_buffer_append_binary_data((struct oscap_buffer *)s, &c, 1);
}


x86 assembly (clang, -O0):
<oscap_string_append_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x9(%rbp),%rsi
mov    $0x1,%edx
call   1030 <oscap_buffer_append_binary_data@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<oscap_string_append_char>:
push   %rax
mov    %sil,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
call   1030 <oscap_buffer_append_binary_data@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.oscap_string = type { i32 }
%struct.oscap_buffer = type { i32 }
define void @oscap_string_append_char(%struct.oscap_string* %0, i8 signext %1) {
%3 = alloca %struct.oscap_string*
%4 = alloca i8
store %struct.oscap_string* %0, %struct.oscap_string** %3
store i8 %1, i8* %4
%5 = load %struct.oscap_string*, %struct.oscap_string** %3
%6 = bitcast %struct.oscap_string* %5 to %struct.oscap_buffer*
%7 = call i32 @oscap_buffer_append_binary_data(%struct.oscap_buffer* %6, i8* %4, i32 1)
ret void
}

LLVM IR (-O2):
%struct.oscap_string = type { i32 }
%struct.oscap_buffer = type { i32 }
define void @oscap_string_append_char(%struct.oscap_string* %0, i8 signext %1) {
%3 = alloca i8
store i8 %1, i8* %3
%4 = bitcast %struct.oscap_string* %0 to %struct.oscap_buffer*
%5 = call i32 @oscap_buffer_append_binary_data(%struct.oscap_buffer* %4, i8* %3, i32 1)
ret void
}
int _usb_stor_dbg(const struct us_data *us, const char *fmt, ...) { return 1; }


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

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

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

LLVM IR (-O2):
%struct.us_data = type opaque
define i32 @_usb_stor_dbg(%struct.us_data* nocapture readnone %0, i8* nocapture readnone %1, ...) {
ret i32 1
}
/* Variables and functions */
int rand();
int deal(void) {
  int deck[] = {2, 3, 4, 5, 6, 7, 8, 9, 10, 10, 10, 10, 11};
  return deck[rand() % 13];
}


x86 assembly (clang, -O0):
<deal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x40(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x34,%edx
call   1030 <memcpy@plt>
mov    $0x0,%al
call   1040 <rand@plt>
mov    $0xd,%ecx
cltd
idiv   %ecx
movslq %edx,%rax
mov    -0x40(%rbp,%rax,4),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<deal>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x4ec4ec4f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,2),%edx
lea    (%rcx,%rdx,4),%ecx
sub    %ecx,%eax
cltq
lea    0xec1(%rip),%rcx
mov    (%rcx,%rax,4),%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.deal.deck = [13 x i32] [i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 10, i32 10, i32 10, i32 11]
define i32 @deal() {
%1 = alloca [13 x i32]
%2 = bitcast [13 x i32]* %1 to i8*
%3 = call i32 (...) @rand()
%4 = srem i32 %3, 13
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds [13 x i32], [13 x i32]* %1, i64 0, i64 %5
%7 = load i32, i32* %6
ret i32 %7
}

LLVM IR (-O2):
@__const.deal.deck = [13 x i32] [i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 10, i32 10, i32 10, i32 11]
define i32 @deal() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 13
%3 = sext i32 %2 to i64
%4 = getelementptr inbounds [13 x i32], [13 x i32]* @__const.deal.deck, i64 0, i64 %3
%5 = load i32, i32* %4
ret i32 %5
}
int fn6(int a, int b, int m) {
  int tem1 = m & b;
  int tem2 = a & ~m;
  return tem1 | tem2;
}


x86 assembly (clang, -O0):
<fn6>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
or     -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn6>:
mov    %esi,%eax
xor    %edi,%eax
and    %edx,%eax
xor    %edi,%eax
ret

LLVM IR (-O0):
define i32 @fn6(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = load i32, i32* %6
%10 = load i32, i32* %5
%11 = and i32 %9, %10
store i32 %11, i32* %7
%12 = load i32, i32* %4
%13 = load i32, i32* %6
%14 = xor i32 %13, -1
%15 = and i32 %12, %14
store i32 %15, i32* %8
%16 = load i32, i32* %7
%17 = load i32, i32* %8
%18 = or i32 %16, %17
ret i32 %18
}

LLVM IR (-O2):
define i32 @fn6(i32 %0, i32 %1, i32 %2) {
%4 = and i32 %2, %1
%5 = xor i32 %2, -1
%6 = and i32 %5, %0
%7 = or i32 %4, %6
ret i32 %7
}
int gb18030_range_lookup(unsigned char *s, int *found) {
  *found = 0;
  return 0;
}


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

x86 assembly (clang, -O2):
<gb18030_range_lookup>:
movl   $0x0,(%rsi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @gb18030_range_lookup(i8* nocapture readnone %0, i32* nocapture writeonly %1) {
store i32 0, i32* %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void func_libb() { puts("Greeting from libb!!\n"); }


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

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

LLVM IR (-O0):
@.str = [22 x i8] c"Greeting from libb!!\0A\00"
define void @func_libb() {
%1 = call i32 @puts(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"Greeting from libb!!\0A\00"
define void @func_libb() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret void
}
int voice_chat_recording_level(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @voice_chat_recording_level() {
ret i32 0
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int stat(char const *, struct stat *);
int txc_libc_stat(const char *path, struct stat *buf) {
  return stat(path, buf);
}


x86 assembly (clang, -O0):
<txc_libc_stat>:
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 <stat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<txc_libc_stat>:
jmp    1030 <stat@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @txc_libc_stat(i8* %0, %struct.stat* %1) {
%3 = alloca i8*
%4 = alloca %struct.stat*
store i8* %0, i8** %3
store %struct.stat* %1, %struct.stat** %4
%5 = load i8*, i8** %3
%6 = load %struct.stat*, %struct.stat** %4
%7 = call i32 @stat(i8* %5, %struct.stat* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @txc_libc_stat(i8* nocapture %0, %struct.stat* nocapture %1) {
%3 = tail call i32 @stat(i8* %0, %struct.stat* %1)
ret i32 %3
}
/* Variables and functions */
unsigned char nuc_comp(unsigned char);
int /*<<< orphan*/ util_breverse(unsigned char *, long);
void nuc_ids_revcomp(unsigned char *nuc_ids, long len) {
  long i;
  util_breverse(nuc_ids, len);
  for (i = 0; i < len; i++) {
    nuc_ids[i] = nuc_comp(nuc_ids[i]);
  }
}


x86 assembly (clang, -O0):
<nuc_ids_revcomp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <util_breverse@plt>
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    1182 <nuc_ids_revcomp+0x62>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movzbl (%rax,%rcx,1),%edi
call   1040 <nuc_comp@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1145 <nuc_ids_revcomp+0x25>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nuc_ids_revcomp>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
call   1030 <util_breverse@plt>
test   %r14,%r14
jle    1157 <nuc_ids_revcomp+0x37>
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
movzbl (%r15,%rbx,1),%edi
call   1040 <nuc_comp@plt>
mov    %al,(%r15,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1140 <nuc_ids_revcomp+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @nuc_ids_revcomp(i8* %0, i64 %1) {
%3 = tail call i32 @util_breverse(i8* %0, i64 %1)
%4 = icmp sgt i64 %1, 0
br i1 %4, label %5, label %12
5: ; preds = %2, %5
%6 = phi i64 [ %10, %5 ], [ 0, %2 ]
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = tail call zeroext i8 @nuc_comp(i8 zeroext %8)
store i8 %9, i8* %7
%10 = add nuw nsw i64 %6, 1
%11 = icmp eq i64 %10, %1
br i1 %11, label %12, label %5
12: ; preds = %5, %2
ret void
}
/* Variables and functions */
int rand();
void tabInit(int *tab, int size, int start) {
  for (int i = start; i < size; i++)
    tab[i] = rand() % 100;
}


x86 assembly (clang, -O0):
<tabInit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115c <tabInit+0x4c>
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1128 <tabInit+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tabInit>:
push   %r15
push   %r14
push   %rbx
cmp    %esi,%edx
jge    115f <tabInit+0x4f>
mov    %esi,%r15d
movslq %edx,%rax
lea    (%rdi,%rax,4),%r14
sub    %edx,%r15d
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rcx
add    %edx,%ecx
imul   $0x64,%ecx,%ecx
sub    %ecx,%eax
mov    %eax,(%r14,%rbx,4)
add    $0x1,%rbx
cmp    %ebx,%r15d
jne    1130 <tabInit+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @tabInit(i32* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %2, %1
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = sext i32 %2 to i64
br label %8
7: ; preds = %8, %3
ret void
8: ; preds = %5, %8
%9 = phi i64 [ %6, %5 ], [ %13, %8 ]
%10 = tail call i32 (...) @rand()
%11 = srem i32 %10, 100
%12 = getelementptr inbounds i32, i32* %0, i64 %9
store i32 %11, i32* %12
%13 = add nsw i64 %9, 1
%14 = trunc i64 %13 to i32
%15 = icmp eq i32 %14, %1
br i1 %15, label %7, label %8
}
int hexc_val(int c) {
  if (c >= 'a')
    return c - 'a' + 10;
  if (c >= 'A')
    return c - 'A' + 10;
  return c - '0';
}


x86 assembly (clang, -O0):
<hexc_val>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x61,-0x8(%rbp)
jl     1122 <hexc_val+0x22>
mov    -0x8(%rbp),%eax
sub    $0x61,%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
jmp    1146 <hexc_val+0x46>
cmpl   $0x41,-0x8(%rbp)
jl     113d <hexc_val+0x3d>
mov    -0x8(%rbp),%eax
sub    $0x41,%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
jmp    1146 <hexc_val+0x46>
mov    -0x8(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hexc_val>:
cmp    $0x41,%edi
mov    $0xffffffc9,%eax
mov    $0xffffffd0,%ecx
cmovge %eax,%ecx
cmp    $0x61,%edi
mov    $0xffffffa9,%eax
cmovl  %ecx,%eax
add    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @hexc_val(i32 %0) {
%2 = icmp sgt i32 %0, 96
%3 = icmp sgt i32 %0, 64
%4 = select i1 %3, i32 -55, i32 -48
%5 = select i1 %2, i32 -87, i32 %4
%6 = add nsw i32 %5, %0
ret i32 %6
}
void update() {}


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

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

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

LLVM IR (-O2):
define void @update() {
ret void
}
/* Type definitions */
typedef scalar_t__ int8_t;

/* Variables and functions */
void clear_buf(int8_t *buf) {
  int i;
  int j;
  for (i = 0; i < 8; i++)
    for (j = 0; j < 1024; j++)
      *(buf + i * 1024 + j) = 0;
}


x86 assembly (clang, -O0):
<clear_buf>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x8,-0xc(%rbp)
jge    116e <clear_buf+0x6e>
movl   $0x0,-0x10(%rbp)
cmpl   $0x400,-0x10(%rbp)
jge    115b <clear_buf+0x5b>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
shl    $0xa,%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
movq   $0x0,(%rax,%rcx,8)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1120 <clear_buf+0x20>
jmp    1160 <clear_buf+0x60>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <clear_buf+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_buf>:
push   %rax
mov    $0x10000,%edx
xor    %esi,%esi
call   1030 <memset@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @clear_buf(i64* nocapture writeonly %0) {
%2 = bitcast i64* %0 to i8*
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("Initial file edit ");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [19 x i8] c"Initial file edit \00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"Initial file edit \00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ show();
int main() { show(); }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @show()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @show()
ret i32 0
}
void pr_list_end(void) {}


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

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

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

LLVM IR (-O2):
define void @pr_list_end() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ do_nothing(double);
int main(int argc, char const *argv[]) {
  do_nothing(99.60);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  0xed2(%rip),%xmm0
call   1030 <do_nothing@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xee7(%rip),%xmm0
call   1030 <do_nothing@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @do_nothing(double 0x4058E66666666666)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @do_nothing(double 0x4058E66666666666)
ret i32 0
}
/* Type definitions */
typedef char wchar_t;
struct _Locale_numeric {
  int dummy;
};

/* Variables and functions */
const wchar_t *_WLocale_true(struct _Locale_numeric *lnum
                             __attribute__((__unused__)),
                             wchar_t *buf __attribute__((__unused__)),
                             size_t bufSize __attribute__((__unused__))) {
  return L"true";
}


x86 assembly (clang, -O0):
<_WLocale_true>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xee9(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct._Locale_numeric = type { i32 }
@.str = [5 x i32] [i32 116, i32 114, i32 117, i32 101, i32 0]
define i8* @_WLocale_true(%struct._Locale_numeric* %0, i8* %1, i64 %2) {
%4 = alloca %struct._Locale_numeric*
%5 = alloca i8*
%6 = alloca i64
store %struct._Locale_numeric* %0, %struct._Locale_numeric** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
ret i8* bitcast ([5 x i32]* @.str to i8*)
}

LLVM IR (-O2):
%struct._Locale_numeric = type { i32 }
@.str = [5 x i32] [i32 116, i32 114, i32 117, i32 101, i32 0]
define i8* @_WLocale_true(%struct._Locale_numeric* nocapture readnone %0, i8* nocapture readnone %1, i64 %2) {
ret i8* bitcast ([5 x i32]* @.str to i8*)
}
int test_imm_90int64_highword_mem(long long *val) {
  return ((*val >> 32) & (0x90 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_90int64_highword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
sar    $0x20,%rdx
and    $0x90,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_90int64_highword_mem>:
testb  $0x90,0x4(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_90int64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 618475290624
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ xfree(char *);
char *xstrdup(char *);
int test_xstrdup(void) {
  char *p;
  if ((p = xstrdup("test")) == NULL)
    return -1;
  if (strcmp(p, "test") != 0) {
    xfree(p);
    return -1;
  }
  xfree(p);
  return 0;
}


x86 assembly (clang, -O0):
<test_xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1040 <xstrdup@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    115e <test_xstrdup+0x2e>
movl   $0xffffffff,-0x4(%rbp)
jmp    119d <test_xstrdup+0x6d>
mov    -0x10(%rbp),%rdi
lea    0xe97(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
je     118d <test_xstrdup+0x5d>
mov    -0x10(%rbp),%rdi
call   1030 <xfree@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    119d <test_xstrdup+0x6d>
mov    -0x10(%rbp),%rdi
call   1030 <xfree@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_xstrdup>:
push   %r14
push   %rbx
push   %rax
lea    0xec5(%rip),%rdi
call   1040 <xstrdup@plt>
test   %rax,%rax
je     1169 <test_xstrdup+0x39>
mov    %rax,%rbx
lea    0xeb1(%rip),%rsi
mov    %rax,%rdi
call   1050 <strcmp@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <xfree@plt>
neg    %r14
sbb    %eax,%eax
jmp    116e <test_xstrdup+0x3e>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"test\00"
define i32 @test_xstrdup() {
%1 = tail call i8* @xstrdup(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i8* %1, null
br i1 %2, label %8, label %3
3: ; preds = %0
%4 = tail call i64 @strcmp(i8* %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%5 = icmp ne i64 %4, 0
%6 = tail call i32 @xfree(i8* %1)
%7 = sext i1 %5 to i32
br label %8
8: ; preds = %3, %0
%9 = phi i32 [ -1, %0 ], [ %7, %3 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ mvaddch(int, int, char);
void println(int start, int line, char *str) {
  int i = start;
  for (; *str != '\0'; ++i) {
    mvaddch(line, i, *str);
    str++;
  }
}


x86 assembly (clang, -O0):
<println>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1164 <println+0x54>
mov    -0x8(%rbp),%edi
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rax
movsbl (%rax),%edx
call   1030 <mvaddch@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1128 <println+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<println>:
push   %rbp
push   %r14
push   %rbx
mov    (%rdx),%al
test   %al,%al
je     114b <println+0x3b>
mov    %rdx,%rbx
mov    %esi,%r14d
mov    %edi,%ebp
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
movsbl %al,%edx
mov    %r14d,%edi
mov    %ebp,%esi
call   1030 <mvaddch@plt>
add    $0x1,%ebp
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <println+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @println(i32 %0, i32 %1, i8* nocapture %2) {
%4 = load i8, i8* %2
%5 = icmp eq i8 %4, 0
br i1 %5, label %15, label %6
6: ; preds = %3, %6
%7 = phi i8 [ %13, %6 ], [ %4, %3 ]
%8 = phi i32 [ %12, %6 ], [ %0, %3 ]
%9 = phi i8* [ %11, %6 ], [ %2, %3 ]
%10 = tail call i32 @mvaddch(i32 %1, i32 %8, i8 signext %7)
%11 = getelementptr inbounds i8, i8* %9, i64 1
%12 = add nsw i32 %8, 1
%13 = load i8, i8* %11
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %6
15: ; preds = %6, %3
ret void
}
char bracketdir(char b) {
  switch (b) {
  case '<':
  case '(':
  case '[':
  case '{':
    return -1;
  case '>':
  case ')':
  case ']':
  case '}':
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<bracketdir>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
mov    %eax,-0x8(%rbp)
sub    $0x28,%eax
je     1196 <bracketdir+0x96>
jmp    111f <bracketdir+0x1f>
mov    -0x8(%rbp),%eax
sub    $0x29,%eax
je     119f <bracketdir+0x9f>
jmp    1130 <bracketdir+0x30>
mov    -0x8(%rbp),%eax
sub    $0x3c,%eax
je     1196 <bracketdir+0x96>
jmp    1141 <bracketdir+0x41>
mov    -0x8(%rbp),%eax
sub    $0x3e,%eax
je     119f <bracketdir+0x9f>
jmp    1152 <bracketdir+0x52>
mov    -0x8(%rbp),%eax
sub    $0x5b,%eax
je     1196 <bracketdir+0x96>
jmp    1163 <bracketdir+0x63>
mov    -0x8(%rbp),%eax
sub    $0x5d,%eax
je     119f <bracketdir+0x9f>
jmp    1174 <bracketdir+0x74>
mov    -0x8(%rbp),%eax
sub    $0x7b,%eax
je     1196 <bracketdir+0x96>
jmp    1185 <bracketdir+0x85>
mov    -0x8(%rbp),%eax
sub    $0x7d,%eax
je     119f <bracketdir+0x9f>
jmp    11a8 <bracketdir+0xa8>
movb   $0xff,-0x1(%rbp)
jmp    11ac <bracketdir+0xac>
movb   $0x1,-0x1(%rbp)
jmp    11ac <bracketdir+0xac>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bracketdir>:
mov    $0xff,%al
lea    -0x28(%rdi),%ecx
cmp    $0x35,%ecx
ja     112a <bracketdir+0x2a>
movabs $0x8000000100001,%rdx
bt     %rcx,%rdx
jb     1136 <bracketdir+0x36>
movabs $0x20000000400002,%rdx
bt     %rcx,%rdx
jb     1134 <bracketdir+0x34>
cmp    $0x7b,%edi
je     1136 <bracketdir+0x36>
cmp    $0x7d,%edi
jne    1137 <bracketdir+0x37>
mov    $0x1,%al
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define signext i8 @bracketdir(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %8 [
i32 60, label %6
i32 40, label %6
i32 91, label %6
i32 123, label %6
i32 62, label %7
i32 41, label %7
i32 93, label %7
i32 125, label %7
]
6: ; preds = %1, %1, %1, %1
store i8 -1, i8* %2
br label %9
7: ; preds = %1, %1, %1, %1
store i8 1, i8* %2
br label %9
8: ; preds = %1
store i8 0, i8* %2
br label %9
9: ; preds = %8, %7, %6
%10 = load i8, i8* %2
ret i8 %10
}

LLVM IR (-O2):
define signext i8 @bracketdir(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %4 [
i32 60, label %5
i32 40, label %5
i32 91, label %5
i32 123, label %5
i32 62, label %3
i32 41, label %3
i32 93, label %3
i32 125, label %3
]
3: ; preds = %1, %1, %1, %1
br label %5
4: ; preds = %1
br label %5
5: ; preds = %1, %1, %1, %1, %4, %3
%6 = phi i8 [ 0, %4 ], [ 1, %3 ], [ -1, %1 ], [ -1, %1 ], [ -1, %1 ], [ -1, %1 ]
ret i8 %6
}
/* Variables and functions */
int /*<<< orphan*/ strlcat(char *, char const *, size_t);
void uninitvar_strlcat(char *Ct, const char *S, size_t N) {
  char *ct;
  char *s;
  size_t n1, n2;
  (void)strlcat(ct, s, n1);
  (void)strlcat(ct, S, N);
  (void)strlcat(Ct, s, N);
  (void)strlcat(Ct, S, n2);
  (void)strlcat(Ct, S, N);
}


x86 assembly (clang, -O0):
<uninitvar_strlcat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x30(%rbp),%rdx
call   1030 <strlcat@plt>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <strlcat@plt>
mov    -0x8(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <strlcat@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x38(%rbp),%rdx
call   1030 <strlcat@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <strlcat@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uninitvar_strlcat>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
call   1030 <strlcat@plt>
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <strlcat@plt>
mov    %rbx,%rdi
mov    %r14,%rdx
call   1030 <strlcat@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <strlcat@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <strlcat@plt>

LLVM IR (-O0):
define void @uninitvar_strlcat(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%11 = load i8*, i8** %7
%12 = load i8*, i8** %8
%13 = load i64, i64* %9
%14 = call i32 @strlcat(i8* %11, i8* %12, i64 %13)
%15 = load i8*, i8** %7
%16 = load i8*, i8** %5
%17 = load i64, i64* %6
%18 = call i32 @strlcat(i8* %15, i8* %16, i64 %17)
%19 = load i8*, i8** %4
%20 = load i8*, i8** %8
%21 = load i64, i64* %6
%22 = call i32 @strlcat(i8* %19, i8* %20, i64 %21)
%23 = load i8*, i8** %4
%24 = load i8*, i8** %5
%25 = load i64, i64* %10
%26 = call i32 @strlcat(i8* %23, i8* %24, i64 %25)
%27 = load i8*, i8** %4
%28 = load i8*, i8** %5
%29 = load i64, i64* %6
%30 = call i32 @strlcat(i8* %27, i8* %28, i64 %29)
ret void
}

LLVM IR (-O2):
define void @uninitvar_strlcat(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @strlcat(i8* undef, i8* undef, i64 undef)
%5 = tail call i32 @strlcat(i8* undef, i8* %1, i64 %2)
%6 = tail call i32 @strlcat(i8* %0, i8* undef, i64 %2)
%7 = tail call i32 @strlcat(i8* %0, i8* %1, i64 undef)
%8 = tail call i32 @strlcat(i8* %0, i8* %1, i64 %2)
ret void
}
int webOpenDB(char *dbfile) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @webOpenDB(i8* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ OPENSSL_cleanse(int /*<<< orphan*/ *, size_t);
void keygen_cleanBuffer(uint8_t *buffer, size_t length) {
  if (buffer != NULL && length > 0) {
    OPENSSL_cleanse(buffer, length);
  }
}


x86 assembly (clang, -O0):
<keygen_cleanBuffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1143 <keygen_cleanBuffer+0x33>
cmpq   $0x0,-0x10(%rbp)
jbe    1143 <keygen_cleanBuffer+0x33>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <OPENSSL_cleanse@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<keygen_cleanBuffer>:
test   %rdi,%rdi
je     111f <keygen_cleanBuffer+0xf>
test   %rsi,%rsi
je     111f <keygen_cleanBuffer+0xf>
jmp    1030 <OPENSSL_cleanse@plt>
ret

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

LLVM IR (-O2):
define void @keygen_cleanBuffer(i32* %0, i64 %1) {
%3 = icmp ne i32* %0, null
%4 = icmp ne i64 %1, 0
%5 = and i1 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @OPENSSL_cleanse(i32* %0, i64 %1)
br label %8
8: ; preds = %6, %2
ret void
}
void XkbCopyKeyType() {}


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

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

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

LLVM IR (-O2):
define void @XkbCopyKeyType() {
ret void
}
unsigned int _mapper_index_from_abs_coords(unsigned int ax, unsigned int ay,
                                           unsigned int max_depth,
                                           unsigned int current_depth) {
  int index = 0;
  index = (ax & (1 << (max_depth - current_depth))) ? 1 : 0;
  index += (ay & (1 << (max_depth - current_depth))) ? 2 : 0;
  return index;
}


x86 assembly (clang, -O0):
<_mapper_index_from_abs_coords>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x4(%rbp),%edx
mov    -0xc(%rbp),%ecx
sub    -0x10(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
and    %eax,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
sub    -0x10(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
and    %eax,%edx
xor    %eax,%eax
mov    $0x2,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_mapper_index_from_abs_coords>:
sub    %ecx,%edx
mov    %edx,%ecx
shr    %cl,%edi
and    $0x1,%edi
xor    %eax,%eax
bt     %edx,%esi
setb   %al
lea    (%rdi,%rax,2),%eax
ret

LLVM IR (-O0):
define i32 @_mapper_index_from_abs_coords(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
store i32 0, i32* %9
%10 = load i32, i32* %5
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = sub i32 %11, %12
%14 = shl i32 1, %13
%15 = and i32 %10, %14
%16 = icmp ne i32 %15, 0
%17 = zext i1 %16 to i64
%18 = select i1 %16, i32 1, i32 0
store i32 %18, i32* %9
%19 = load i32, i32* %6
%20 = load i32, i32* %7
%21 = load i32, i32* %8
%22 = sub i32 %20, %21
%23 = shl i32 1, %22
%24 = and i32 %19, %23
%25 = icmp ne i32 %24, 0
%26 = zext i1 %25 to i64
%27 = select i1 %25, i32 2, i32 0
%28 = load i32, i32* %9
%29 = add nsw i32 %28, %27
store i32 %29, i32* %9
%30 = load i32, i32* %9
ret i32 %30
}

LLVM IR (-O2):
define i32 @_mapper_index_from_abs_coords(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = sub i32 %2, %3
%6 = shl nuw i32 1, %5
%7 = lshr i32 %0, %5
%8 = and i32 %7, 1
%9 = and i32 %6, %1
%10 = icmp eq i32 %9, 0
%11 = select i1 %10, i32 0, i32 2
%12 = or i32 %11, %8
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/ *);
void *thread_function(void *arg) {
  pthread_exit(NULL);
  return NULL;
}


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

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

LLVM IR (-O0):
define i8* @thread_function(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @pthread_exit(i32* null)
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @thread_function(i8* nocapture readnone %0) {
%2 = tail call i32 @pthread_exit(i32* null)
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ benchmark();
int /*<<< orphan*/ initialise_board();
int /*<<< orphan*/ start_trigger();
int /*<<< orphan*/ stop_trigger();
int main(void) {
  int i;
  initialise_board();
  start_trigger();
  for (i = 0; i < (4096 >> 0); i++)
    benchmark();
  stop_trigger();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <initialise_board@plt>
mov    $0x0,%al
call   1030 <start_trigger@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x1000,-0x8(%rbp)
jge    1186 <main+0x46>
mov    $0x0,%al
call   1050 <benchmark@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1164 <main+0x24>
mov    $0x0,%al
call   1040 <stop_trigger@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1060 <initialise_board@plt>
xor    %eax,%eax
call   1030 <start_trigger@plt>
mov    $0x1000,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1050 <benchmark@plt>
add    $0xffffffff,%ebx
jne    1160 <main+0x20>
xor    %eax,%eax
call   1040 <stop_trigger@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @initialise_board()
%4 = call i32 (...) @start_trigger()
store i32 0, i32* %2
br label %5
5: ; preds = %10, %0
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 4096
br i1 %7, label %8, label %13
8: ; preds = %5
%9 = call i32 (...) @benchmark()
br label %10
10: ; preds = %8
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 1
store i32 %12, i32* %2
br label %5
13: ; preds = %5
%14 = call i32 (...) @stop_trigger()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @initialise_board()
%2 = tail call i32 (...) @start_trigger()
br label %3
3: ; preds = %0, %3
%4 = phi i32 [ 0, %0 ], [ %6, %3 ]
%5 = tail call i32 (...) @benchmark()
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, 4096
br i1 %7, label %8, label %3
8: ; preds = %3
%9 = tail call i32 (...) @stop_trigger()
ret i32 0
}
/* Variables and functions */
double RAND_MAX;
scalar_t__ rand();
double fRand(double fMin, double fMax) {
  double f = (double)rand() / RAND_MAX;
  return fMin + f * (fMax - fMin);
}


x86 assembly (clang, -O0):
<fRand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2eb3(%rip),%rax
divsd  (%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
subsd  -0x8(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fRand>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
xorps  %xmm1,%xmm1
cvtsi2sd %rax,%xmm1
mov    0x2eb2(%rip),%rax
divsd  (%rax),%xmm1
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm2
subsd  %xmm2,%xmm0
mulsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define double @fRand(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = call i64 (...) @rand()
%7 = sitofp i64 %6 to double
%8 = load double, double* @RAND_MAX
%9 = fdiv double %7, %8
store double %9, double* %5
%10 = load double, double* %3
%11 = load double, double* %5
%12 = load double, double* %4
%13 = load double, double* %3
%14 = fsub double %12, %13
%15 = call double @llvm.fmuladd.f64(double %11, double %14, double %10)
ret double %15
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define double @fRand(double %0, double %1) {
%3 = tail call i64 (...) @rand()
%4 = sitofp i64 %3 to double
%5 = load double, double* @RAND_MAX
%6 = fdiv double %4, %5
%7 = fsub double %1, %0
%8 = tail call double @llvm.fmuladd.f64(double %6, double %7, double %0)
ret double %8
}
/* Variables and functions */
char *strchr(char const *, int);
char *strrchr(char const *, int);
int /*<<< orphan*/ test_assert(int);
int main(void) {
  int FORWARD = 1;
  char *a = "baba";
  char *(*f)(const char *s, int c) = strchr;
  if (FORWARD) {
    f = strrchr;
  }
  char *x = f(a, 'b');
  test_assert(x == a + 2);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
lea    0xed3(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0x2ea0(%rip),%rax
mov    %rax,-0x18(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1151 <main+0x41>
mov    0x2e93(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rdi
mov    $0x62,%esi
call   *%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
add    $0x2,%rcx
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <test_assert@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [5 x i8] c"baba\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8* (i8*, i32)*
%5 = alloca i8*
store i32 0, i32* %1
store i32 1, i32* %2
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %3
store i8* (i8*, i32)* @strchr, i8* (i8*, i32)** %4
%6 = load i32, i32* %2
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %0
store i8* (i8*, i32)* @strrchr, i8* (i8*, i32)** %4
br label %9
9: ; preds = %8, %0
%10 = load i8* (i8*, i32)*, i8* (i8*, i32)** %4
%11 = load i8*, i8** %3
%12 = call i8* %10(i8* %11, i32 98)
store i8* %12, i8** %5
%13 = load i8*, i8** %5
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i64 2
%16 = icmp eq i8* %13, %15
%17 = zext i1 %16 to i32
%18 = call i32 @test_assert(i32 %17)
%19 = load i32, i32* %1
ret i32 %19
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @test_assert(i32 1)
ret i32 0
}
char *_get_snes_rom_speed(int speed) {
  if (speed == 0)
    return "\"200ns\"";
  else
    return "\"120ns\"";
}


x86 assembly (clang, -O0):
<_get_snes_rom_speed>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1121 <_get_snes_rom_speed+0x21>
lea    0xee8(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    112c <_get_snes_rom_speed+0x2c>
lea    0xee0(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_get_snes_rom_speed>:
test   %edi,%edi
lea    0xef7(%rip),%rcx
lea    0xef8(%rip),%rax
cmove  %rcx,%rax
ret

LLVM IR (-O0):
@.str = [8 x i8] c"\22200ns\22\00"
@.str.1 = [8 x i8] c"\22120ns\22\00"
define i8* @_get_snes_rom_speed(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8** %2
br label %8
7: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %8
8: ; preds = %7, %6
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
@.str = [8 x i8] c"\22200ns\22\00"
@.str.1 = [8 x i8] c"\22120ns\22\00"
define i8* @_get_snes_rom_speed(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0)
ret i8* %3
}