xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int i, n;
  printf("Enter n:");
  scanf("%d", &n);
  for (i = 1; i <= n; i++) {
    printf("Li Xin\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
lea    0xec7(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1178 <main+0x58>
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1152 <main+0x32>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
lea    0xec6(%rip),%rdi
call   1040 <printf@plt>
lea    0xec3(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
cmpl   $0x0,0x4(%rsp)
jle    1171 <main+0x41>
xor    %ebp,%ebp
lea    0xeac(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
add    $0x1,%ebp
cmp    0x4(%rsp),%ebp
jl     1160 <main+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"Enter n:\00"
@.str.1 = [3 x i8] c"%d\00"
@str = [7 x i8] c"Li Xin\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = icmp slt i32 %5, 1
br i1 %6, label %13, label %7
7: ; preds = %0, %7
%8 = phi i32 [ %10, %7 ], [ 1, %0 ]
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%10 = add nuw nsw i32 %8, 1
%11 = load i32, i32* %1
%12 = icmp slt i32 %8, %11
br i1 %12, label %7, label %13
13: ; preds = %7, %0
ret i32 0
}
/* Variables and functions */
void *memchr(char const *, int /*<<< orphan*/, size_t);
size_t Common_strnlen(const char *start, size_t maxlen) {
  if (start == NULL)
    return 0;
  void *_p2 = memchr(start, 0, maxlen);
  if (_p2) {
    return (size_t)_p2 - (size_t)start;
  } else {
    return maxlen;
  }
}


x86 assembly (clang, -O0):
<Common_strnlen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1138 <Common_strnlen+0x28>
movq   $0x0,-0x8(%rbp)
jmp    1172 <Common_strnlen+0x62>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rdx
xor    %esi,%esi
call   1030 <memchr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     116a <Common_strnlen+0x5a>
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
mov    %rax,-0x8(%rbp)
jmp    1172 <Common_strnlen+0x62>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Common_strnlen>:
test   %rdi,%rdi
je     113e <Common_strnlen+0x2e>
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memchr@plt>
mov    %rax,%rcx
sub    %rbx,%rax
test   %rcx,%rcx
cmove  %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @Common_strnlen(i8* %0, i64 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %11, label %4
4: ; preds = %2
%5 = tail call i8* @memchr(i8* %0, i32 0, i64 %1)
%6 = icmp eq i8* %5, null
%7 = ptrtoint i8* %5 to i64
%8 = ptrtoint i8* %0 to i64
%9 = sub i64 %7, %8
%10 = select i1 %6, i64 %1, i64 %9
br label %11
11: ; preds = %2, %4
%12 = phi i64 [ %10, %4 ], [ 0, %2 ]
ret i64 %12
}
double expf__(double x) { return x * x + 6. * x; }


x86 assembly (clang, -O0):
<expf__>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
movsd  0xee5(%rip),%xmm1
mulsd  -0x8(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<expf__>:
movsd  0xef8(%rip),%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @expf__(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = load double, double* %2
%6 = fmul double 6.000000e+00, %5
%7 = call double @llvm.fmuladd.f64(double %3, double %4, double %6)
ret double %7
}

LLVM IR (-O2):
define double @expf__(double %0) {
%2 = fmul double %0, 6.000000e+00
%3 = tail call double @llvm.fmuladd.f64(double %0, double %0, double %2)
ret double %3
}
void outputWord(aWord) int aWord;
{
  outputByte(aWord & 0xFF);
  outputByte((aWord >> 8) & 0xFF);
}


x86 assembly (clang, -O0):
<outputWord>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
and    $0xff,%edi
mov    $0x0,%al
call   1030 <outputByte@plt>
mov    -0x4(%rbp),%edi
sar    $0x8,%edi
and    $0xff,%edi
mov    $0x0,%al
call   1030 <outputByte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outputWord>:
push   %rbx
mov    %edi,%ebx
movzbl %bl,%edi
xor    %eax,%eax
call   1030 <outputByte@plt>
movzbl %bh,%edi
xor    %eax,%eax
pop    %rbx
jmp    1030 <outputByte@plt>

LLVM IR (-O0):
define void @outputWord(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 255
%5 = call i32 (i32, ...) bitcast (i32 (...)* @outputByte to i32 (i32, ...)*)(i32 %4)
%6 = load i32, i32* %2
%7 = ashr i32 %6, 8
%8 = and i32 %7, 255
%9 = call i32 (i32, ...) bitcast (i32 (...)* @outputByte to i32 (i32, ...)*)(i32 %8)
ret void
}

LLVM IR (-O2):
define void @outputWord(i32 %0) {
%2 = and i32 %0, 255
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @outputByte to i32 (i32, ...)*)(i32 %2)
%4 = lshr i32 %0, 8
%5 = and i32 %4, 255
%6 = tail call i32 (i32, ...) bitcast (i32 (...)* @outputByte to i32 (i32, ...)*)(i32 %5)
ret void
}
void EVP_CIPHER_set_asn1_iv(void) {}


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

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

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

LLVM IR (-O2):
define void @EVP_CIPHER_set_asn1_iv() {
ret void
}
int netsnmp_generic_replace_row(void *table, void *old_row, void *new_row) {}


x86 assembly (clang, -O0):
<netsnmp_generic_replace_row>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @netsnmp_generic_replace_row(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ __u32;

/* Variables and functions */
int ceph_frag_bits(int /*<<< orphan*/);
int /*<<< orphan*/ ceph_frag_make(int, int);
int ceph_frag_value(int /*<<< orphan*/);
__u32 ceph_frag_right_child(__u32 f) {
  return ceph_frag_make(ceph_frag_bits(f) + 1,
                        ceph_frag_value(f) |
                            (0x1000000 >> (1 + ceph_frag_bits(f))));
}


x86 assembly (clang, -O0):
<ceph_frag_right_child>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <ceph_frag_bits@plt>
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <ceph_frag_value@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <ceph_frag_bits@plt>
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edi
mov    %eax,%ecx
add    $0x1,%ecx
mov    $0x1000000,%eax
sar    %cl,%eax
or     %eax,%esi
call   1040 <ceph_frag_make@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ceph_frag_right_child>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebx
call   1030 <ceph_frag_bits@plt>
lea    0x1(%rax),%r14d
mov    %ebx,%edi
call   1050 <ceph_frag_value@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1030 <ceph_frag_bits@plt>
lea    0x1(%rax),%ecx
mov    $0x1000000,%esi
shr    %cl,%esi
or     %ebp,%esi
mov    %r14d,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <ceph_frag_make@plt>

LLVM IR (-O0):
define i32 @ceph_frag_right_child(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @ceph_frag_bits(i32 %3)
%5 = add nsw i32 %4, 1
%6 = load i32, i32* %2
%7 = call i32 @ceph_frag_value(i32 %6)
%8 = load i32, i32* %2
%9 = call i32 @ceph_frag_bits(i32 %8)
%10 = add nsw i32 1, %9
%11 = ashr i32 16777216, %10
%12 = or i32 %7, %11
%13 = call i32 @ceph_frag_make(i32 %5, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @ceph_frag_right_child(i32 %0) {
%2 = tail call i32 @ceph_frag_bits(i32 %0)
%3 = add nsw i32 %2, 1
%4 = tail call i32 @ceph_frag_value(i32 %0)
%5 = tail call i32 @ceph_frag_bits(i32 %0)
%6 = add nsw i32 %5, 1
%7 = lshr i32 16777216, %6
%8 = or i32 %7, %4
%9 = tail call i32 @ceph_frag_make(i32 %3, i32 %8)
ret i32 %9
}
unsigned int hash(char *str) {
  unsigned int hash = 5381;
  int c;
  while (0 != (c = *str++))
    hash = ((hash << 5) + hash) + c;
  return hash;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1505,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%ecx
mov    %ecx,-0x10(%rbp)
xor    %eax,%eax
cmp    %ecx,%eax
je     1142 <hash+0x42>
mov    -0xc(%rbp),%eax
shl    $0x5,%eax
add    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    110f <hash+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1138 <hash+0x38>
add    $0x1,%rdi
mov    $0x1505,%edx
mov    %edx,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl %cl,%ecx
shl    $0x5,%eax
add    %edx,%eax
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
mov    %eax,%edx
test   %cl,%cl
jne    1120 <hash+0x20>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i32 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %9, %4 ], [ %0, %1 ]
%7 = phi i32 [ %11, %4 ], [ 5381, %1 ]
%8 = sext i8 %5 to i32
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = mul i32 %7, 33
%11 = add i32 %10, %8
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 5381, %1 ], [ %11, %4 ]
ret i32 %15
}
void dumpstate_board(void) {}


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

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

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

LLVM IR (-O2):
define void @dumpstate_board() {
ret void
}
/* Variables and functions */
char tolower(char);
void string_to_lower(char *str) {
  for (; *str; ++str)
    *str = tolower(*str);
}


x86 assembly (clang, -O0):
<string_to_lower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114e <string_to_lower+0x3e>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <tolower@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <string_to_lower+0xc>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @string_to_lower(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call signext i8 @tolower(i8 signext %5)
store i8 %7, i8* %6
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ nop_f();
void usb_reconnect(void) {
  int i;
  (*(volatile unsigned short *)((0x24100000) + 0xc)) &= ~1;
  for (i = 0; i < 10000; i++)
    nop_f();
  (*(volatile unsigned short *)((0x24100000) + 0xc)) |= 1;
}


x86 assembly (clang, -O0):
<usb_reconnect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x2410000c,%eax
mov    (%rax),%ax
movzwl %ax,%eax
and    $0xfffffffe,%eax
mov    %ax,%cx
mov    $0x2410000c,%eax
mov    %cx,(%rax)
movl   $0x0,-0x4(%rbp)
cmpl   $0x2710,-0x4(%rbp)
jge    115a <usb_reconnect+0x4a>
mov    $0x0,%al
call   1030 <nop_f@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1138 <usb_reconnect+0x28>
mov    $0x2410000c,%eax
mov    (%rax),%ax
movzwl %ax,%eax
or     $0x1,%eax
mov    %ax,%cx
mov    $0x2410000c,%eax
mov    %cx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usb_reconnect>:
push   %rbx
andw   $0xfffe,0x2410000c
24 fe
mov    $0x2710,%ebx
nop
xor    %eax,%eax
call   1030 <nop_f@plt>
add    $0xffffffff,%ebx
jne    1120 <usb_reconnect+0x10>
orw    $0x1,0x2410000c
24 01
pop    %rbx
ret

LLVM IR (-O0):
define void @usb_reconnect() {
%1 = alloca i32
%2 = load volatile i16, i16* inttoptr (i64 605028364 to i16*)
%3 = zext i16 %2 to i32
%4 = and i32 %3, -2
%5 = trunc i32 %4 to i16
store volatile i16 %5, i16* inttoptr (i64 605028364 to i16*)
store i32 0, i32* %1
br label %6
6: ; preds = %11, %0
%7 = load i32, i32* %1
%8 = icmp slt i32 %7, 10000
br i1 %8, label %9, label %14
9: ; preds = %6
%10 = call i32 (...) @nop_f()
br label %11
11: ; preds = %9
%12 = load i32, i32* %1
%13 = add nsw i32 %12, 1
store i32 %13, i32* %1
br label %6
14: ; preds = %6
%15 = load volatile i16, i16* inttoptr (i64 605028364 to i16*)
%16 = zext i16 %15 to i32
%17 = or i32 %16, 1
%18 = trunc i32 %17 to i16
store volatile i16 %18, i16* inttoptr (i64 605028364 to i16*)
ret void
}

LLVM IR (-O2):
define void @usb_reconnect() {
%1 = load volatile i16, i16* inttoptr (i64 605028364 to i16*)
%2 = and i16 %1, -2
store volatile i16 %2, i16* inttoptr (i64 605028364 to i16*)
br label %3
3: ; preds = %0, %3
%4 = phi i32 [ 0, %0 ], [ %6, %3 ]
%5 = tail call i32 (...) @nop_f()
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, 10000
br i1 %7, label %8, label %3
8: ; preds = %3
%9 = load volatile i16, i16* inttoptr (i64 605028364 to i16*)
%10 = or i16 %9, 1
store volatile i16 %10, i16* inttoptr (i64 605028364 to i16*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int bcstrfree(char *s) {
  free(s);
  return (0);
}


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

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

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

LLVM IR (-O2):
define i32 @bcstrfree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret i32 0
}
/* Variables and functions */
int strlen(char *);
char *suffix_extract(char *filename, char *prefix) {
  return filename + strlen(prefix);
}


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

x86 assembly (clang, -O2):
<suffix_extract>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1030 <strlen@plt>
cltq
add    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @suffix_extract(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @strlen(i8* %6)
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %5, i64 %8
ret i8* %9
}

LLVM IR (-O2):
define i8* @suffix_extract(i8* readnone %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
ret i8* %5
}
void draw_line(int x1, int y1, int x2, int y2, int cl) {}


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

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

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

LLVM IR (-O2):
define void @draw_line(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
ret void
}
__attribute__((no, noclone)) int f4(signed char x, signed char y) {
  return (x + y) & 0x78;
}


x86 assembly (clang, -O0):
<f4>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
movsbl -0x2(%rbp),%ecx
add    %ecx,%eax
and    $0x78,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4>:
lea    (%rdi,%rsi,1),%eax
and    $0x78,%eax
ret

LLVM IR (-O0):
define i32 @f4(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = load i8, i8* %4
%8 = sext i8 %7 to i32
%9 = add nsw i32 %6, %8
%10 = and i32 %9, 120
ret i32 %10
}

LLVM IR (-O2):
define i32 @f4(i8 signext %0, i8 signext %1) {
%3 = zext i8 %0 to i32
%4 = zext i8 %1 to i32
%5 = add nuw nsw i32 %4, %3
%6 = and i32 %5, 120
ret i32 %6
}
/* Variables and functions */
void *lwrealloc_var(void *, size_t);
void *lwrealloc(void *mem, size_t size) {
  ((void)0);
  return lwrealloc_var(mem, size);
}


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

x86 assembly (clang, -O2):
<lwrealloc>:
jmp    1030 <lwrealloc_var@plt>

LLVM IR (-O0):
define i8* @lwrealloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i8* @lwrealloc_var(i8* %5, i64 %6)
ret i8* %7
}

LLVM IR (-O2):
define i8* @lwrealloc(i8* %0, i64 %1) {
%3 = tail call i8* @lwrealloc_var(i8* %0, i64 %1)
ret i8* %3
}
/* Variables and functions */
int intel_ich_gpio_set(int, int);
int intel_ich_gpio20_raise(void) { return intel_ich_gpio_set(20, 1); }


x86 assembly (clang, -O0):
<intel_ich_gpio20_raise>:
push   %rbp
mov    %rsp,%rbp
mov    $0x14,%edi
mov    $0x1,%esi
call   1030 <intel_ich_gpio_set@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<intel_ich_gpio20_raise>:
mov    $0x14,%edi
mov    $0x1,%esi
jmp    1030 <intel_ich_gpio_set@plt>

LLVM IR (-O0):
define i32 @intel_ich_gpio20_raise() {
%1 = call i32 @intel_ich_gpio_set(i32 20, i32 1)
ret i32 %1
}

LLVM IR (-O2):
define i32 @intel_ich_gpio20_raise() {
%1 = tail call i32 @intel_ich_gpio_set(i32 20, i32 1)
ret i32 %1
}
int base128_blksize_enc() { return 8; }


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

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

LLVM IR (-O0):
define i32 @base128_blksize_enc() {
ret i32 8
}

LLVM IR (-O2):
define i32 @base128_blksize_enc() {
ret i32 8
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fread(int /*<<< orphan*/ *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ swap32(int /*<<< orphan*/);
int read32(FILE *fp, uint32_t *res) {
  if (fread(res, sizeof *res, 1, fp) < 1) {
    return -1;
  }
  *res = swap32(*res);
  return 0;
}


x86 assembly (clang, -O0):
<read32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
cmp    $0x1,%eax
jge    115c <read32+0x3c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1176 <read32+0x56>
mov    -0x18(%rbp),%rax
mov    (%rax),%edi
call   1040 <swap32@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read32>:
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%rcx
mov    %rsi,%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
test   %eax,%eax
jle    114a <read32+0x2a>
mov    (%rbx),%edi
call   1040 <swap32@plt>
mov    %eax,(%rbx)
xor    %eax,%eax
pop    %rbx
ret
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @read32(i32* %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32*
store i32* %0, i32** %4
store i32* %1, i32** %5
%6 = load i32*, i32** %5
%7 = load i32*, i32** %4
%8 = call i32 @fread(i32* %6, i32 4, i32 1, i32* %7)
%9 = icmp slt i32 %8, 1
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 -1, i32* %3
br label %16
11: ; preds = %2
%12 = load i32*, i32** %5
%13 = load i32, i32* %12
%14 = call i32 @swap32(i32 %13)
%15 = load i32*, i32** %5
store i32 %14, i32* %15
store i32 0, i32* %3
br label %16
16: ; preds = %11, %10
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @read32(i32* nocapture %0, i32* nocapture %1) {
%3 = tail call i32 @fread(i32* %1, i32 4, i32 1, i32* %0)
%4 = icmp slt i32 %3, 1
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = load i32, i32* %1
%7 = tail call i32 @swap32(i32 %6)
store i32 %7, i32* %1
br label %8
8: ; preds = %2, %5
%9 = phi i32 [ 0, %5 ], [ -1, %2 ]
ret i32 %9
}
/* Variables and functions */
char *strdup(char const *);
scalar_t__ strlen(char const *);
char *sstrdup(const char *str) {
  if (str != NULL && strlen(str))
    return (strdup(str));
  return (NULL);
}


x86 assembly (clang, -O0):
<sstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     115c <sstrdup+0x3c>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x0,%rax
je     115c <sstrdup+0x3c>
mov    -0x10(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x8(%rbp)
jmp    1164 <sstrdup+0x44>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sstrdup>:
test   %rdi,%rdi
je     111f <sstrdup+0xf>
cmpb   $0x0,(%rdi)
je     111f <sstrdup+0xf>
jmp    1030 <strdup@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define noalias i8* @sstrdup(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i8* @strdup(i8* %0)
br label %8
8: ; preds = %1, %3, %6
%9 = phi i8* [ %7, %6 ], [ null, %3 ], [ null, %1 ]
ret i8* %9
}
/* Type definitions */
typedef int /*<<< orphan*/ x;

/* Variables and functions */
int /*<<< orphan*/ bar(int *);
int /*<<< orphan*/ memset(int *, int /*<<< orphan*/, int);
void foo(void) {
  int x[8] __attribute__((aligned(128)));
  memset(x, 0, sizeof(x));
  bar(x);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
and    $0xffffffffffffff80,%rsp
sub    $0x80,%rsp
mov    %rsp,%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1040 <memset@plt>
mov    %rsp,%rdi
call   1030 <bar@plt>
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
and    $0xffffffffffffff80,%rsp
sub    $0x80,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1040 <memset@plt>
mov    %rbx,%rdi
call   1030 <bar@plt>
lea    -0x8(%rbp),%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @foo() {
%1 = alloca [8 x i32]
%2 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 0
%3 = call i32 @memset(i32* %2, i32 0, i32 32)
%4 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 0
%5 = call i32 @bar(i32* %4)
ret void
}

LLVM IR (-O2):
define void @foo() {
%1 = alloca [8 x i32]
%2 = bitcast [8 x i32]* %1 to i8*
%3 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 0
%4 = call i32 @memset(i32* %3, i32 0, i32 32)
%5 = call i32 @bar(i32* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strchr(char *, int /*<<< orphan*/);
int /*<<< orphan*/ strcpy(int /*<<< orphan*/, char const *);
char *strcat(char *s1, const char *s2) {
  strcpy(strchr(s1, 0), s2);
  return s1;
}


x86 assembly (clang, -O0):
<strcat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1040 <strchr@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcat>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %esi,%esi
call   1040 <strchr@plt>
mov    %eax,%edi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @strcat(i8* returned %0, i8* %1) {
%3 = tail call i32 @strchr(i8* %0, i32 0)
%4 = tail call i32 @strcpy(i32 %3, i8* %1)
ret i8* %0
}
int main() {
  signed int i, j;
  i = j;
  i++;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ syscall1(int);
void pthread_exit() { syscall1(507); }


x86 assembly (clang, -O0):
<pthread_exit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1fb,%edi
call   1030 <syscall1@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pthread_exit>:
mov    $0x1fb,%edi
jmp    1030 <syscall1@plt>

LLVM IR (-O0):
define void @pthread_exit() {
%1 = call i32 @syscall1(i32 507)
ret void
}

LLVM IR (-O2):
define void @pthread_exit() {
%1 = tail call i32 @syscall1(i32 507)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void btlza_free(void *ptr) { free(ptr); }


x86 assembly (clang, -O0):
<btlza_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):
<btlza_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @btlza_free(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 @btlza_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
scalar_t__ eb128_compose_264(int /*<<< orphan*/ const,
                             int /*<<< orphan*/ const);
bool eb128i_equal_264(const uint64_t alo, const int64_t ahi, const uint64_t blo,
                      const int64_t bhi) {
  return eb128_compose_264(alo, ahi) == eb128_compose_264(blo, bhi);
}


x86 assembly (clang, -O0):
<eb128i_equal_264>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <eb128_compose_264@plt>
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <eb128_compose_264@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eb128i_equal_264>:
push   %rbp
push   %r14
push   %rbx
mov    %ecx,%r14d
mov    %edx,%ebp
call   1030 <eb128_compose_264@plt>
mov    %rax,%rbx
mov    %ebp,%edi
mov    %r14d,%esi
call   1030 <eb128_compose_264@plt>
xor    %ecx,%ecx
cmp    %rax,%rbx
sete   %cl
mov    %ecx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @eb128i_equal_264(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = call i64 @eb128_compose_264(i32 %9, i32 %10)
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = call i64 @eb128_compose_264(i32 %12, i32 %13)
%15 = icmp eq i64 %11, %14
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @eb128i_equal_264(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i64 @eb128_compose_264(i32 %0, i32 %1)
%6 = tail call i64 @eb128_compose_264(i32 %2, i32 %3)
%7 = icmp eq i64 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
double usec_to_sec(double usec) { return (usec / (1000 * 1000)); }


x86 assembly (clang, -O0):
<usec_to_sec>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<usec_to_sec>:
divsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @usec_to_sec(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double %3, 1.000000e+06
ret double %4
}

LLVM IR (-O2):
define double @usec_to_sec(double %0) {
%2 = fdiv double %0, 1.000000e+06
ret double %2
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
void htole16(uint16_t num, uint8_t *out) {
  out[0] = num & 0xFF;
  out[1] = (num >> 8) & 0xFF;
}


x86 assembly (clang, -O0):
<htole16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
and    $0xff,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<htole16>:
mov    %edi,%eax
movzbl %al,%ecx
mov    %ecx,(%rsi)
movzbl %ah,%eax
mov    %eax,0x4(%rsi)
ret

LLVM IR (-O0):
define void @htole16(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 = and i32 %5, 255
%7 = load i32*, i32** %4
%8 = getelementptr inbounds i32, i32* %7, i64 0
store i32 %6, i32* %8
%9 = load i32, i32* %3
%10 = ashr i32 %9, 8
%11 = and i32 %10, 255
%12 = load i32*, i32** %4
%13 = getelementptr inbounds i32, i32* %12, i64 1
store i32 %11, i32* %13
ret void
}

LLVM IR (-O2):
define void @htole16(i32 %0, i32* nocapture writeonly %1) {
%3 = and i32 %0, 255
store i32 %3, i32* %1
%4 = lshr i32 %0, 8
%5 = and i32 %4, 255
%6 = getelementptr inbounds i32, i32* %1, i64 1
store i32 %5, i32* %6
ret void
}
/* Variables and functions */
int Scl_ConHasInSlews_(int /*<<< orphan*/);
int /*<<< orphan*/ Scl_ConReadMan();
int Scl_ConHasInSlews() { return Scl_ConHasInSlews_(Scl_ConReadMan()); }


x86 assembly (clang, -O0):
<Scl_ConHasInSlews>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <Scl_ConReadMan@plt>
mov    %eax,%edi
call   1030 <Scl_ConHasInSlews_@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Scl_ConHasInSlews>:
push   %rax
xor    %eax,%eax
call   1040 <Scl_ConReadMan@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <Scl_ConHasInSlews_@plt>

LLVM IR (-O0):
define i32 @Scl_ConHasInSlews() {
%1 = call i32 (...) @Scl_ConReadMan()
%2 = call i32 @Scl_ConHasInSlews_(i32 %1)
ret i32 %2
}

LLVM IR (-O2):
define i32 @Scl_ConHasInSlews() {
%1 = tail call i32 (...) @Scl_ConReadMan()
%2 = tail call i32 @Scl_ConHasInSlews_(i32 %1)
ret i32 %2
}
char *libhacVersion(void) { return "v0.2.4-13-gdeff7b2"; }


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

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

LLVM IR (-O0):
@.str = [19 x i8] c"v0.2.4-13-gdeff7b2\00"
define i8* @libhacVersion() {
ret i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [19 x i8] c"v0.2.4-13-gdeff7b2\00"
define i8* @libhacVersion() {
ret i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int const uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t rotl(const uint32_t value, uint8_t rot) {
  return (value << rot) | (value >> (32 - rot));
}


x86 assembly (clang, -O0):
<rotl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x20,%ecx
sub    -0x8(%rbp),%ecx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotl>:
mov    %esi,%ecx
mov    %edi,%eax
shl    %cl,%eax
neg    %cl
sar    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @rotl(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 = shl i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub nsw i32 32, %9
%11 = ashr i32 %8, %10
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @rotl(i32 %0, i32 %1) {
%3 = shl i32 %0, %1
%4 = sub nsw i32 32, %1
%5 = ashr i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
/* Type definitions */
struct byte_array {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct byte_array *);
void byte_array_free(struct byte_array *a) { free(a); }


x86 assembly (clang, -O0):
<byte_array_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):
<byte_array_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.byte_array = type { i32 }
define void @byte_array_free(%struct.byte_array* nocapture %0) {
%2 = tail call i32 @free(%struct.byte_array* %0)
ret void
}
/* Variables and functions */
int first();
int main() { return first() - 1001; }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @first()
%2 = add nsw i32 %1, -1001
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ SIGPROF;
int /*<<< orphan*/ SIG_DFL;
scalar_t__ SIG_ERR;
scalar_t__ signal(int /*<<< orphan*/, int /*<<< orphan*/);
int remove_sigprof_handler(void) {
  if (signal(SIGPROF, SIG_DFL) == SIG_ERR)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<remove_sigprof_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
mov    0x2ea8(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
mov    0x2ea2(%rip),%rcx
cmp    (%rcx),%rax
jne    114b <remove_sigprof_handler+0x3b>
movl   $0xffffffff,-0x4(%rbp)
jmp    1152 <remove_sigprof_handler+0x42>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_sigprof_handler>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
mov    0x2eaf(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
mov    0x2ea9(%rip),%rdx
xor    %ecx,%ecx
cmp    (%rdx),%rax
sete   %cl
neg    %ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@SIGPROF = global i32 0
@SIG_DFL = global i32 0
@SIG_ERR = global i64 0
define i32 @remove_sigprof_handler() {
%1 = alloca i32
%2 = load i32, i32* @SIGPROF
%3 = load i32, i32* @SIG_DFL
%4 = call i64 @signal(i32 %2, i32 %3)
%5 = load i64, i64* @SIG_ERR
%6 = icmp eq i64 %4, %5
br i1 %6, label %7, label %8
7: ; preds = %0
store i32 -1, i32* %1
br label %9
8: ; preds = %0
store i32 0, i32* %1
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
@SIGPROF = global i32 0
@SIG_DFL = global i32 0
@SIG_ERR = global i64 0
define i32 @remove_sigprof_handler() {
%1 = load i32, i32* @SIGPROF
%2 = load i32, i32* @SIG_DFL
%3 = tail call i64 @signal(i32 %1, i32 %2)
%4 = load i64, i64* @SIG_ERR
%5 = icmp eq i64 %3, %4
%6 = sext i1 %5 to i32
ret i32 %6
}
int test_imm_20int64_highword_mem(long long *val) {
  return ((*val >> 32) & (0x20 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_20int64_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, 32
%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_20int64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 137438953472
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void copy(char *to, char *from) {
  int i = 0;
  while ((to[i] = from[i]) != '\0')
    i++;
}


x86 assembly (clang, -O0):
<copy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    -0x8(%rbp),%rcx
movslq -0x14(%rbp),%rdx
mov    %al,(%rcx,%rdx,1)
movsbl %al,%eax
cmp    $0x0,%eax
je     1143 <copy+0x43>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <copy+0x13>
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rsi,%rax,1),%ecx
mov    %cl,(%rdi,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <copy+0x10>
ret

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

LLVM IR (-O2):
define void @copy(i8* nocapture writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ %9, %3 ], [ 0, %2 ]
%5 = getelementptr inbounds i8, i8* %1, i64 %4
%6 = load i8, i8* %5
%7 = getelementptr inbounds i8, i8* %0, i64 %4
store i8 %6, i8* %7
%8 = icmp eq i8 %6, 0
%9 = add nuw i64 %4, 1
br i1 %8, label %10, label %3
10: ; preds = %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ *strstr(char *, char *);
int AT_EXP_READY(const unsigned char *RESP) {
  if (RESP == NULL)
    return (0);
  if (strstr((char *)RESP, "READY") != NULL) {
    return (1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<AT_EXP_READY>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1133 <AT_EXP_READY+0x23>
movl   $0x0,-0x4(%rbp)
jmp    1160 <AT_EXP_READY+0x50>
mov    -0x10(%rbp),%rdi
lea    0xec2(%rip),%rsi
call   1030 <strstr@plt>
cmp    $0x0,%rax
je     1159 <AT_EXP_READY+0x49>
movl   $0x1,-0x4(%rbp)
jmp    1160 <AT_EXP_READY+0x50>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AT_EXP_READY>:
test   %rdi,%rdi
je     1132 <AT_EXP_READY+0x22>
push   %rax
lea    0xee3(%rip),%rsi
call   1030 <strstr@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"READY\00"
define i32 @AT_EXP_READY(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i32* @strstr(i8* %0, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%5 = icmp ne i32* %4, null
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %8
}
unsigned char *data_read_u32(unsigned char *dp, unsigned int *nump) {
  *nump = (dp[0] << 24) | (dp[1] << 16) | (dp[2] << 8) | dp[3];
  return dp + 4;
}


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

x86 assembly (clang, -O2):
<data_read_u32>:
mov    (%rdi),%eax
bswap  %eax
mov    %eax,(%rsi)
lea    0x4(%rdi),%rax
ret

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

LLVM IR (-O2):
define i8* @data_read_u32(i8* %0, i32* nocapture writeonly %1) {
%3 = load i8, i8* %0
%4 = zext i8 %3 to i32
%5 = shl nuw i32 %4, 24
%6 = getelementptr inbounds i8, i8* %0, i64 1
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = shl nuw nsw i32 %8, 16
%10 = or i32 %9, %5
%11 = getelementptr inbounds i8, i8* %0, i64 2
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = shl nuw nsw i32 %13, 8
%15 = or i32 %10, %14
%16 = getelementptr inbounds i8, i8* %0, i64 3
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = or i32 %15, %18
store i32 %19, i32* %1
%20 = getelementptr inbounds i8, i8* %0, i64 4
ret i8* %20
}
void XtGetErrorDatabaseText() {}


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

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

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

LLVM IR (-O2):
define void @XtGetErrorDatabaseText() {
ret void
}