xunge/DecIR huggingface dataset:
unsigned bits_nozero_length(unsigned long frac) {
  register unsigned len;
  len = 0;
  while (frac) {
    len++;
    frac >>= 1;
  }
  return len;
}


x86 assembly (clang, -O0):
<bits_nozero_length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1134 <bits_nozero_length+0x34>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <bits_nozero_length+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bits_nozero_length>:
xor    %eax,%eax
test   %rdi,%rdi
je     111f <bits_nozero_length+0x1f>
mov    %rdi,%rcx
nopw   0x0(%rax,%rax,1)
add    $0x1,%eax
shr    %rcx
cmp    $0x1,%rdi
mov    %rcx,%rdi
ja     1110 <bits_nozero_length+0x10>
ret

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

LLVM IR (-O2):
define i32 @bits_nozero_length(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = phi i64 [ %7, %3 ], [ %0, %1 ]
%6 = add nuw nsw i32 %4, 1
%7 = lshr i64 %5, 1
%8 = icmp ult i64 %5, 2
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %10
}
int compare(const void *x, const void *y) {
  double da = *(const double *)x;
  double db = *(const double *)y;
  if (da == db)
    return 0;
  return (da > db) ? -1 : 1;
}


x86 assembly (clang, -O0):
<compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
ucomisd -0x28(%rbp),%xmm0
jne    1148 <compare+0x48>
jp     1148 <compare+0x48>
movl   $0x0,-0x4(%rbp)
jmp    1166 <compare+0x66>
movsd  -0x20(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
mov    $0x1,%eax
mov    $0xffffffff,%ecx
ucomisd %xmm1,%xmm0
cmova  %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare>:
movsd  (%rdi),%xmm0
xor    %eax,%eax
xor    %ecx,%ecx
ucomisd (%rsi),%xmm0
setbe  %cl
lea    -0x1(%rcx,%rcx,1),%ecx
cmovne %ecx,%eax
cmovp  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @compare(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca double
%7 = alloca double
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to double*
%10 = load double, double* %9
store double %10, double* %6
%11 = load i8*, i8** %5
%12 = bitcast i8* %11 to double*
%13 = load double, double* %12
store double %13, double* %7
%14 = load double, double* %6
%15 = load double, double* %7
%16 = fcmp oeq double %14, %15
br i1 %16, label %17, label %18
17: ; preds = %2
store i32 0, i32* %3
br label %24
18: ; preds = %2
%19 = load double, double* %6
%20 = load double, double* %7
%21 = fcmp ogt double %19, %20
%22 = zext i1 %21 to i64
%23 = select i1 %21, i32 -1, i32 1
store i32 %23, i32* %3
br label %24
24: ; preds = %18, %17
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = load double, double* %3
%5 = bitcast i8* %1 to double*
%6 = load double, double* %5
%7 = fcmp oeq double %4, %6
%8 = fcmp ogt double %4, %6
%9 = select i1 %8, i32 -1, i32 1
%10 = select i1 %7, i32 0, i32 %9
ret i32 %10
}
int getbit(unsigned int i, unsigned int n) { return ((n >> i) & 1); }


x86 assembly (clang, -O0):
<getbit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
shr    %cl,%eax
and    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getbit>:
mov    %esi,%eax
mov    %edi,%ecx
shr    %cl,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @getbit(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = lshr i32 %5, %6
%8 = and i32 %7, 1
ret i32 %8
}

LLVM IR (-O2):
define i32 @getbit(i32 %0, i32 %1) {
%3 = lshr i32 %1, %0
%4 = and i32 %3, 1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ test2();
main() { test2(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test2()
ret i32 0
}
int c_remove_(FileName)
char *FileName;
{
  int rc;
  rc = remove(FileName);
  return rc;
}


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

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

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

LLVM IR (-O2):
define i32 @c_remove_(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @remove to i32 (i8*, ...)*)(i8* %0)
ret i32 %2
}
signed char *range_schar(signed char *val, signed char min, signed char max) {
  if (*val < min || max < *val)
    __builtin_abort();
  return val;
}


x86 assembly (clang, -O0):
<range_schar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jl     114d <range_schar+0x3d>
movsbl -0xa(%rbp),%eax
mov    -0x8(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jge    1152 <range_schar+0x42>
call   1030 <abort@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<range_schar>:
push   %rax
mov    (%rdi),%al
cmp    %sil,%al
jl     1121 <range_schar+0x11>
cmp    %dl,%al
jg     1121 <range_schar+0x11>
mov    %rdi,%rax
pop    %rcx
ret
call   1030 <abort@plt>

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

LLVM IR (-O2):
define i8* @range_schar(i8* returned %0, i8 signext %1, i8 signext %2) {
%4 = load i8, i8* %0
%5 = icmp slt i8 %4, %1
%6 = icmp sgt i8 %4, %2
%7 = or i1 %5, %6
br i1 %7, label %8, label %9
8: ; preds = %3
tail call void @abort()
unreachable
9: ; preds = %3
ret i8* %0
}
/* Type definitions */
struct coro {
  int dummy;
};
struct aqueue {
  int dummy;
};

/* Variables and functions */
scalar_t__ aqueue_empty(struct aqueue *);
void const *aqueue_pop(struct aqueue *);
int /*<<< orphan*/ coro_yield(struct coro *);
const void *aqueue_await_pop(struct aqueue *aqueue, struct coro *coro) {
  while (aqueue_empty(aqueue))
    coro_yield(coro);
  return aqueue_pop(aqueue);
}


x86 assembly (clang, -O0):
<aqueue_await_pop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <aqueue_empty@plt>
cmp    $0x0,%rax
je     1161 <aqueue_await_pop+0x31>
mov    -0x10(%rbp),%rdi
call   1040 <coro_yield@plt>
jmp    1140 <aqueue_await_pop+0x10>
mov    -0x8(%rbp),%rdi
call   1050 <aqueue_pop@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aqueue_await_pop>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
nopw   0x0(%rax,%rax,1)
call   1030 <aqueue_empty@plt>
test   %rax,%rax
je     1157 <aqueue_await_pop+0x27>
mov    %r14,%rdi
call   1040 <coro_yield@plt>
mov    %rbx,%rdi
jmp    1140 <aqueue_await_pop+0x10>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <aqueue_pop@plt>

LLVM IR (-O0):
%struct.aqueue = type { i32 }
%struct.coro = type { i32 }
define i8* @aqueue_await_pop(%struct.aqueue* %0, %struct.coro* %1) {
%3 = alloca %struct.aqueue*
%4 = alloca %struct.coro*
store %struct.aqueue* %0, %struct.aqueue** %3
store %struct.coro* %1, %struct.coro** %4
br label %5
5: ; preds = %9, %2
%6 = load %struct.aqueue*, %struct.aqueue** %3
%7 = call i64 @aqueue_empty(%struct.aqueue* %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %5
%10 = load %struct.coro*, %struct.coro** %4
%11 = call i32 @coro_yield(%struct.coro* %10)
br label %5
12: ; preds = %5
%13 = load %struct.aqueue*, %struct.aqueue** %3
%14 = call i8* @aqueue_pop(%struct.aqueue* %13)
ret i8* %14
}

LLVM IR (-O2):
%struct.aqueue = type { i32 }
%struct.coro = type { i32 }
define i8* @aqueue_await_pop(%struct.aqueue* %0, %struct.coro* %1) {
%3 = tail call i64 @aqueue_empty(%struct.aqueue* %0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %2, %5
%6 = tail call i32 @coro_yield(%struct.coro* %1)
%7 = tail call i64 @aqueue_empty(%struct.aqueue* %0)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %5
9: ; preds = %5, %2
%10 = tail call i8* @aqueue_pop(%struct.aqueue* %0)
ret i8* %10
}
int main(void) {
  int a = -100;
  int b = 2;
  int c = 3;
  int d = 4;
  int e = 5;
  while (a) {
    a += b;
    b += c;
    c += d;
    d += e;
    e += c;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0xffffff9c,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
movl   $0x3,-0x10(%rbp)
movl   $0x4,-0x14(%rbp)
movl   $0x5,-0x18(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     116a <main+0x6a>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x14(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x18(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    112e <main+0x2e>
mov    -0x4(%rbp),%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 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i32 -100, i32* %2
store i32 2, i32* %3
store i32 3, i32* %4
store i32 4, i32* %5
store i32 5, i32* %6
br label %7
7: ; preds = %10, %0
%8 = load i32, i32* %2
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %26
10: ; preds = %7
%11 = load i32, i32* %3
%12 = load i32, i32* %2
%13 = add nsw i32 %12, %11
store i32 %13, i32* %2
%14 = load i32, i32* %4
%15 = load i32, i32* %3
%16 = add nsw i32 %15, %14
store i32 %16, i32* %3
%17 = load i32, i32* %5
%18 = load i32, i32* %4
%19 = add nsw i32 %18, %17
store i32 %19, i32* %4
%20 = load i32, i32* %6
%21 = load i32, i32* %5
%22 = add nsw i32 %21, %20
store i32 %22, i32* %5
%23 = load i32, i32* %4
%24 = load i32, i32* %6
%25 = add nsw i32 %24, %23
store i32 %25, i32* %6
br label %7
26: ; preds = %7
%27 = load i32, i32* %1
ret i32 %27
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
unsigned lower_byte(char b) { return b | 0x20; }


x86 assembly (clang, -O0):
<lower_byte>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
or     $0x20,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lower_byte>:
or     $0x20,%dil
movsbl %dil,%eax
ret

LLVM IR (-O0):
define i32 @lower_byte(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = or i32 %4, 32
ret i32 %5
}

LLVM IR (-O2):
define i32 @lower_byte(i8 signext %0) {
%2 = or i8 %0, 32
%3 = sext i8 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() { fprintf(stderr, "Usage: chname <hostname> <program> [args]\n"); }


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [43 x i8] c"Usage: chname <hostname> <program> [args]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [43 x i8] c"Usage: chname <hostname> <program> [args]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
ret void
}
void *string_to_data(char *str) {}


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

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

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

LLVM IR (-O2):
define noalias i8* @string_to_data(i8* nocapture readnone %0) {
ret i8* undef
}
/* Variables and functions */
scalar_t__ isspace(char const);
const char *skip_space(const char *str) {
  while (isspace(*str))
    str++;
  return str;
}


x86 assembly (clang, -O0):
<skip_space>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
je     1143 <skip_space+0x33>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <skip_space+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_space>:
push   %rbx
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
nopl   0x0(%rax,%rax,1)
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1030 <isspace@plt>
test   %rax,%rax
jne    1120 <skip_space+0x10>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @skip_space(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = load i8, i8* %3
%5 = tail call i64 @isspace(i8 signext %4)
%6 = icmp eq i64 %5, 0
%7 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_key_t;

/* Variables and functions */
void *kthread_getspecific(int /*<<< orphan*/);
void *pthread_getspecific(pthread_key_t key) {
  return kthread_getspecific(key);
}


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

x86 assembly (clang, -O2):
<pthread_getspecific>:
jmp    1030 <kthread_getspecific@plt>

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

LLVM IR (-O2):
define i8* @pthread_getspecific(i32 %0) {
%2 = tail call i8* @kthread_getspecific(i32 %0)
ret i8* %2
}
/* Variables and functions */
int Close(int);
int /*<<< orphan*/ chdir(char *);
int /*<<< orphan*/ jump2dos();
int /*<<< orphan*/ virfunc();
int close(int fd) {
  static int first = 0;
  if (!first) {
    first++;
    chdir("/");
    virfunc();
    jump2dos();
  }
  return Close(fd);
}


x86 assembly (clang, -O0):
<close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,0x2ef2(%rip)
jne    1181 <close+0x41>
mov    0x2ee6(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2edd(%rip)
lea    0xe92(%rip),%rdi
call   1040 <chdir@plt>
mov    $0x0,%al
call   1030 <virfunc@plt>
mov    $0x0,%al
call   1050 <jump2dos@plt>
mov    -0x4(%rbp),%edi
call   1060 <Close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close>:
push   %rbx
mov    %edi,%ebx
cmpb   $0x0,0x2efa(%rip)
jne    116d <close+0x2d>
movb   $0x1,0x2ef1(%rip)
lea    0xea6(%rip),%rdi
call   1040 <chdir@plt>
xor    %eax,%eax
call   1030 <virfunc@plt>
xor    %eax,%eax
call   1050 <jump2dos@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1060 <Close@plt>

LLVM IR (-O0):
@close.first = internal global i32 0
@.str = [2 x i8] c"/\00"
define i32 @close(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @close.first
%4 = icmp ne i32 %3, 0
br i1 %4, label %11, label %5
5: ; preds = %1
%6 = load i32, i32* @close.first
%7 = add nsw i32 %6, 1
store i32 %7, i32* @close.first
%8 = call i32 @chdir(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%9 = call i32 (...) @virfunc()
%10 = call i32 (...) @jump2dos()
br label %11
11: ; preds = %5, %1
%12 = load i32, i32* %2
%13 = call i32 @Close(i32 %12)
ret i32 %13
}

LLVM IR (-O2):
@close.first = internal unnamed_addr global i1 false
@.str = [2 x i8] c"/\00"
define i32 @close(i32 %0) {
%2 = load i1, i1* @close.first
br i1 %2, label %7, label %3
3: ; preds = %1
store i1 true, i1* @close.first
%4 = tail call i32 @chdir(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 (...) @virfunc()
%6 = tail call i32 (...) @jump2dos()
br label %7
7: ; preds = %3, %1
%8 = tail call i32 @Close(i32 %0)
ret i32 %8
}
/* Variables and functions */
int strlen(char *str) {
  char *ptr;
  for (ptr = str; ptr[0]; ptr++)
    ;
  return ptr - str;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1133 <strlen+0x33>
jmp    1122 <strlen+0x22>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @strlen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
%11 = trunc i64 %10 to i32
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ free(char *);
scalar_t__ malloc(size_t);
int /*<<< orphan*/ memset(char *, char, size_t);
char *strchr(char *, char);
int main(int argc, char **argv) {
  size_t size = 100;
  char fill = 'o';
  char *s = (char *)malloc(size);
  memset(s, fill, size);
  char c = 'o';
  char *r = strchr(s, c);
  assert(r == s);
  free(s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x64,-0x18(%rbp)
movb   $0x6f,-0x19(%rbp)
mov    -0x18(%rbp),%rdi
call   1070 <malloc@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x19(%rbp),%al
mov    -0x18(%rbp),%rdx
movsbl %al,%esi
call   1050 <memset@plt>
movb   $0x6f,-0x29(%rbp)
mov    -0x28(%rbp),%rdi
movsbl -0x29(%rbp),%esi
call   1040 <strchr@plt>
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
cmp    -0x28(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x64,%edi
call   1070 <malloc@plt>
mov    %rax,%rbx
mov    $0x64,%edx
mov    %rax,%rdi
mov    $0x6f,%esi
call   1050 <memset@plt>
mov    %rbx,%rdi
mov    $0x6f,%esi
call   1040 <strchr@plt>
xor    %edi,%edi
cmp    %rbx,%rax
sete   %dil
call   1060 <assert@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
%7 = alloca i8
%8 = alloca i8*
%9 = alloca i8
%10 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i64 100, i64* %6
store i8 111, i8* %7
%11 = load i64, i64* %6
%12 = call i64 @malloc(i64 %11)
%13 = inttoptr i64 %12 to i8*
store i8* %13, i8** %8
%14 = load i8*, i8** %8
%15 = load i8, i8* %7
%16 = load i64, i64* %6
%17 = call i32 @memset(i8* %14, i8 signext %15, i64 %16)
store i8 111, i8* %9
%18 = load i8*, i8** %8
%19 = load i8, i8* %9
%20 = call i8* @strchr(i8* %18, i8 signext %19)
store i8* %20, i8** %10
%21 = load i8*, i8** %10
%22 = load i8*, i8** %8
%23 = icmp eq i8* %21, %22
%24 = zext i1 %23 to i32
%25 = call i32 @assert(i32 %24)
%26 = load i8*, i8** %8
%27 = call i32 @free(i8* %26)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 @malloc(i64 100)
%4 = inttoptr i64 %3 to i8*
%5 = tail call i32 @memset(i8* %4, i8 signext 111, i64 100)
%6 = tail call i8* @strchr(i8* dereferenceable(1) %4, i8 signext 111)
%7 = icmp eq i8* %6, %4
%8 = zext i1 %7 to i32
%9 = tail call i32 @assert(i32 %8)
%10 = tail call i32 @free(i8* %4)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void output_end_table(FILE *f) { fprintf(f, "};\n"); }


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

x86 assembly (clang, -O2):
<output_end_table>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0x3,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"};\0A\00"
define void @output_end_table(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 3, i64 1, i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char *, char *, char *);
int /*<<< orphan*/ system(char *);
void compress_log() {
  char cmd[256];
  sprintf(cmd, "tar zcf %s -C %s %s", "/tmp/intangd.log.tar.gz", "/tmp/",
          "intangd.log.tmp");
  system(cmd);
}


x86 assembly (clang, -O0):
<compress_log>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
lea    -0x100(%rbp),%rdi
lea    0xec7(%rip),%rsi
lea    0xed4(%rip),%rdx
lea    0xee5(%rip),%rcx
lea    0xee4(%rip),%r8
call   1040 <sprintf@plt>
lea    -0x100(%rbp),%rdi
call   1030 <system@plt>
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compress_log>:
push   %rbx
sub    $0x100,%rsp
lea    0xed1(%rip),%rsi
lea    0xede(%rip),%rdx
lea    0xeef(%rip),%rcx
lea    0xeee(%rip),%r8
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"tar zcf %s -C %s %s\00"
@.str.1 = [24 x i8] c"/tmp/intangd.log.tar.gz\00"
@.str.2 = [6 x i8] c"/tmp/\00"
@.str.3 = [16 x i8] c"intangd.log.tmp\00"
define void @compress_log() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%5 = call i32 @system(i8* %4)
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"tar zcf %s -C %s %s\00"
@.str.1 = [24 x i8] c"/tmp/intangd.log.tar.gz\00"
@.str.2 = [6 x i8] c"/tmp/\00"
@.str.3 = [16 x i8] c"intangd.log.tmp\00"
define void @compress_log() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
%4 = call i32 @system(i8* %2)
ret void
}
/* Variables and functions */
int get_test_minsym();
int test_minsym(void) { return get_test_minsym(); }


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

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

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

LLVM IR (-O2):
define i32 @test_minsym() {
%1 = tail call i32 (...) @get_test_minsym()
ret i32 %1
}
int test3(int x) {
  int y;
  y = (sizeof(int) * 8) - 1;
  return -(x >> y);
}


x86 assembly (clang, -O0):
<test3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1f,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
mov    %eax,%ecx
xor    %eax,%eax
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test3>:
mov    %edi,%eax
shr    $0x1f,%eax
ret

LLVM IR (-O0):
define i32 @test3(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 31, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = ashr i32 %4, %5
%7 = sub nsw i32 0, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @test3(i32 %0) {
%2 = lshr i32 %0, 31
ret i32 %2
}
void swap_float(float *a, float *b) {
  float t = *a;
  *a = *b;
  *b = t;
}


x86 assembly (clang, -O0):
<swap_float>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x14(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap_float>:
movss  (%rdi),%xmm0
movss  (%rsi),%xmm1
movss  %xmm1,(%rdi)
movss  %xmm0,(%rsi)
ret

LLVM IR (-O0):
define void @swap_float(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
%5 = alloca float
store float* %0, float** %3
store float* %1, float** %4
%6 = load float*, float** %3
%7 = load float, float* %6
store float %7, float* %5
%8 = load float*, float** %4
%9 = load float, float* %8
%10 = load float*, float** %3
store float %9, float* %10
%11 = load float, float* %5
%12 = load float*, float** %4
store float %11, float* %12
ret void
}

LLVM IR (-O2):
define void @swap_float(float* nocapture %0, float* nocapture %1) {
%3 = load float, float* %0
%4 = load float, float* %1
store float %4, float* %0
store float %3, float* %1
ret void
}
void ufshcd_init_crypto(struct ufs_hba *hba) {}


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

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

LLVM IR (-O0):
%struct.ufs_hba = type opaque
define void @ufshcd_init_crypto(%struct.ufs_hba* %0) {
%2 = alloca %struct.ufs_hba*
store %struct.ufs_hba* %0, %struct.ufs_hba** %2
ret void
}

LLVM IR (-O2):
%struct.ufs_hba = type opaque
define void @ufshcd_init_crypto(%struct.ufs_hba* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_parser_sourcefile(char *, char *);
int /*<<< orphan*/ test_parser_verify_entity(int /*<<< orphan*/, char *,
                                             char *);
void test_scheme_comment_entities() {
  test_parser_verify_entity(test_parser_sourcefile("scheme", " ;comment"),
                            "comment", ";comment");
}


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

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"scheme\00"
@.str.1 = [10 x i8] c" ;comment\00"
@.str.2 = [8 x i8] c"comment\00"
@.str.3 = [9 x i8] c";comment\00"
define void @test_scheme_comment_entities() {
%1 = tail call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test_parser_verify_entity(i32 %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
ret void
}
void test23() {
  char src[1024];
  char buf[10];
  __builtin___memcpy_chk(buf, src, 11, __builtin_object_size(buf, 0));
  __builtin___memcpy_chk(buf, src, 11, __builtin_object_size(buf, 0));
}


x86 assembly (clang, -O0):
<test23>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
lea    -0x40a(%rbp),%rdi
lea    -0x400(%rbp),%rsi
mov    $0xb,%edx
mov    $0xa,%ecx
call   1030 <__memcpy_chk@plt>
lea    -0x40a(%rbp),%rdi
lea    -0x400(%rbp),%rsi
mov    $0xb,%edx
mov    $0xa,%ecx
call   1030 <__memcpy_chk@plt>
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test23>:
push   %r14
push   %rbx
sub    $0x418,%rsp
lea    0x6(%rsp),%r14
lea    0x10(%rsp),%rbx
mov    $0xb,%edx
mov    $0xa,%ecx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <__memcpy_chk@plt>
mov    $0xb,%edx
mov    $0xa,%ecx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <__memcpy_chk@plt>
add    $0x418,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @test23() {
%1 = alloca [1024 x i8]
%2 = alloca [10 x i8]
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%5 = call i8* @__memcpy_chk(i8* %3, i8* %4, i64 11, i64 10)
%6 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%8 = call i8* @__memcpy_chk(i8* %6, i8* %7, i64 11, i64 10)
ret void
}

LLVM IR (-O2):
define void @test23() {
%1 = alloca [1024 x i8]
%2 = alloca [10 x i8]
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%5 = call i8* @__memcpy_chk(i8* %4, i8* %3, i64 11, i64 10)
%6 = call i8* @__memcpy_chk(i8* %4, i8* %3, i64 11, i64 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int LZ4_free(void *LZ4_Data) {
  free(LZ4_Data);
  return (0);
}


x86 assembly (clang, -O0):
<LZ4_free>:
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):
<LZ4_free>:
push   %rax
call   1030 <free@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @LZ4_free(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 @LZ4_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ japi_quit();
void j_quit() { japi_quit(); }


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

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

LLVM IR (-O0):
define void @j_quit() {
%1 = call i32 (...) @japi_quit()
ret void
}

LLVM IR (-O2):
define void @j_quit() {
%1 = tail call i32 (...) @japi_quit()
ret void
}
int operator_add(int a, int b) { return a + b; }


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

x86 assembly (clang, -O2):
<operator_add>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @operator_add(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 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @operator_add(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printlines(int lines[1000]) {
  for (int i = 0; lines[i] > 0; i++)
    printf(" %d", lines[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<printlines>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jle    115c <printlines+0x4c>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xeb9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <printlines+0x13>
lea    0xea1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printlines>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%esi
test   %esi,%esi
jle    1154 <printlines+0x34>
mov    %rdi,%rbx
add    $0x4,%rbx
lea    0xec8(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%rbx),%esi
add    $0x4,%rbx
test   %esi,%esi
jg     1140 <printlines+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c" %d\00"
define void @printlines(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp sgt i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %6, %1
%5 = tail call i32 @putchar(i32 10)
ret void
6: ; preds = %1, %6
%7 = phi i64 [ %10, %6 ], [ 0, %1 ]
%8 = phi i32 [ %12, %6 ], [ %2, %1 ]
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = add nuw i64 %7, 1
%11 = getelementptr inbounds i32, i32* %0, i64 %10
%12 = load i32, i32* %11
%13 = icmp sgt i32 %12, 0
br i1 %13, label %6, label %4
}
char getTextualGrade(unsigned numericGrade) {
  char grade;
  if (numericGrade == 1) {
    grade = 'Z';
  } else if (numericGrade == 2) {
    grade = 'B';
  } else if (numericGrade == 3) {
    grade = 'C';
  } else if (numericGrade == 4) {
    grade = 'D';
  } else if (numericGrade == 5) {
    grade = 'E';
  } else if (numericGrade == 7) {
    grade = 'F';
  } else {
    grade = 'Z';
  }
  return grade;
}


x86 assembly (clang, -O0):
<getTextualGrade>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    111a <getTextualGrade+0x1a>
movb   $0x5a,-0x5(%rbp)
jmp    1196 <getTextualGrade+0x96>
cmpl   $0x2,-0x4(%rbp)
jne    112d <getTextualGrade+0x2d>
movb   $0x42,-0x5(%rbp)
jmp    1191 <getTextualGrade+0x91>
cmpl   $0x3,-0x4(%rbp)
jne    1140 <getTextualGrade+0x40>
movb   $0x43,-0x5(%rbp)
jmp    118c <getTextualGrade+0x8c>
cmpl   $0x4,-0x4(%rbp)
jne    1153 <getTextualGrade+0x53>
movb   $0x44,-0x5(%rbp)
jmp    1187 <getTextualGrade+0x87>
cmpl   $0x5,-0x4(%rbp)
jne    1166 <getTextualGrade+0x66>
movb   $0x45,-0x5(%rbp)
jmp    1182 <getTextualGrade+0x82>
cmpl   $0x7,-0x4(%rbp)
jne    1179 <getTextualGrade+0x79>
movb   $0x46,-0x5(%rbp)
jmp    117d <getTextualGrade+0x7d>
movb   $0x5a,-0x5(%rbp)
jmp    1182 <getTextualGrade+0x82>
jmp    1187 <getTextualGrade+0x87>
jmp    118c <getTextualGrade+0x8c>
jmp    1191 <getTextualGrade+0x91>
jmp    1196 <getTextualGrade+0x96>
movsbl -0x5(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getTextualGrade>:
lea    -0x10(,%rdi,8),%ecx
mov    %edi,%eax
add    $0xfffffffe,%eax
movabs $0x465a45444342,%rdx
shr    %cl,%rdx
cmp    $0x6,%eax
mov    $0x5a,%eax
cmovb  %edx,%eax
ret

LLVM IR (-O0):
define signext i8 @getTextualGrade(i32 %0) {
%2 = alloca i32
%3 = alloca i8
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %7
6: ; preds = %1
store i8 90, i8* %3
br label %33
7: ; preds = %1
%8 = load i32, i32* %2
%9 = icmp eq i32 %8, 2
br i1 %9, label %10, label %11
10: ; preds = %7
store i8 66, i8* %3
br label %32
11: ; preds = %7
%12 = load i32, i32* %2
%13 = icmp eq i32 %12, 3
br i1 %13, label %14, label %15
14: ; preds = %11
store i8 67, i8* %3
br label %31
15: ; preds = %11
%16 = load i32, i32* %2
%17 = icmp eq i32 %16, 4
br i1 %17, label %18, label %19
18: ; preds = %15
store i8 68, i8* %3
br label %30
19: ; preds = %15
%20 = load i32, i32* %2
%21 = icmp eq i32 %20, 5
br i1 %21, label %22, label %23
22: ; preds = %19
store i8 69, i8* %3
br label %29
23: ; preds = %19
%24 = load i32, i32* %2
%25 = icmp eq i32 %24, 7
br i1 %25, label %26, label %27
26: ; preds = %23
store i8 70, i8* %3
br label %28
27: ; preds = %23
store i8 90, i8* %3
br label %28
28: ; preds = %27, %26
br label %29
29: ; preds = %28, %22
br label %30
30: ; preds = %29, %18
br label %31
31: ; preds = %30, %14
br label %32
32: ; preds = %31, %10
br label %33
33: ; preds = %32, %6
%34 = load i8, i8* %3
ret i8 %34
}

LLVM IR (-O2):
define signext i8 @getTextualGrade(i32 %0) {
%2 = add i32 %0, -2
%3 = icmp ult i32 %2, 6
%4 = zext i32 %2 to i48
%5 = shl nuw nsw i48 %4, 3
%6 = lshr i48 77353523102530, %5
%7 = trunc i48 %6 to i8
%8 = select i1 %3, i8 %7, i8 90
ret i8 %8
}
void av_hwframe_get_buffer() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @answer_result() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SendInterrupt(int, int, int, int);
void ScuSendTimer0(void) { SendInterrupt(0x43, 0xC, 0x0008, 0x00000008); }


x86 assembly (clang, -O0):
<ScuSendTimer0>:
push   %rbp
mov    %rsp,%rbp
mov    $0x43,%edi
mov    $0xc,%esi
mov    $0x8,%ecx
mov    %ecx,%edx
call   1030 <SendInterrupt@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ScuSendTimer0>:
mov    $0x43,%edi
mov    $0xc,%esi
mov    $0x8,%edx
mov    $0x8,%ecx
jmp    1030 <SendInterrupt@plt>

LLVM IR (-O0):
define void @ScuSendTimer0() {
%1 = call i32 @SendInterrupt(i32 67, i32 12, i32 8, i32 8)
ret void
}

LLVM IR (-O2):
define void @ScuSendTimer0() {
%1 = tail call i32 @SendInterrupt(i32 67, i32 12, i32 8, i32 8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
void replace_word(char line[], char *start, char *end, char defn[]) {
  char endbuffer[100];
  strcpy(endbuffer, (end - 1));
  strcpy(start, defn);
  strcat(line, " ");
  strcat(line, endbuffer);
}


x86 assembly (clang, -O0):
<replace_word>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
lea    -0x90(%rbp),%rdi
mov    -0x18(%rbp),%rsi
add    $0xffffffffffffffff,%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rdi
lea    0xe99(%rip),%rsi
call   1040 <strcat@plt>
mov    -0x8(%rbp),%rdi
lea    -0x90(%rbp),%rsi
call   1040 <strcat@plt>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<replace_word>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x68,%rsp
mov    %rcx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
lea    -0x1(%rdx),%rsi
mov    %rsp,%r12
mov    %r12,%rdi
call   1030 <strcpy@plt>
mov    %r15,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
lea    0xeab(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcat@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
call   1040 <strcat@plt>
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
define void @replace_word(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca [100 x i8]
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %9, i64 0, i64 0
%11 = load i8*, i8** %7
%12 = getelementptr inbounds i8, i8* %11, i64 -1
%13 = call i32 @strcpy(i8* %10, i8* %12)
%14 = load i8*, i8** %6
%15 = load i8*, i8** %8
%16 = call i32 @strcpy(i8* %14, i8* %15)
%17 = load i8*, i8** %5
%18 = call i32 @strcat(i8* %17, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%19 = load i8*, i8** %5
%20 = getelementptr inbounds [100 x i8], [100 x i8]* %9, i64 0, i64 0
%21 = call i32 @strcat(i8* %19, i8* %20)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
define void @replace_word(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca [100 x i8]
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%7 = getelementptr inbounds i8, i8* %2, i64 -1
%8 = call i32 @strcpy(i8* %6, i8* %7)
%9 = call i32 @strcpy(i8* %1, i8* %3)
%10 = call i32 @strcat(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @strcat(i8* %0, i8* %6)
ret void
}
int insert2(int n, int m, int start, int end) {
  int left_submask = ~0 << (start + 1);
  int right_submask = ((1 << end) - 1);
  int mask = left_submask | right_submask;
  return (n & mask) | (m << end);
}


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

x86 assembly (clang, -O2):
<insert2>:
mov    %ecx,%r8d
lea    0x1(%rdx),%ecx
mov    $0xffffffff,%edx
shl    %cl,%edx
mov    $0xffffffff,%eax
mov    %r8d,%ecx
shl    %cl,%eax
not    %eax
or     %edx,%eax
and    %edi,%eax
shl    %cl,%esi
or     %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @insert2(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = add nsw i32 %2, 1
%6 = shl nsw i32 -1, %5
%7 = shl nsw i32 -1, %3
%8 = xor i32 %7, -1
%9 = or i32 %6, %8
%10 = and i32 %9, %0
%11 = shl i32 %1, %3
%12 = or i32 %10, %11
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print_fizzbuzz(char *message_buffer) { printf("%s\n", message_buffer); }


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

x86 assembly (clang, -O2):
<print_fizzbuzz>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @print_fizzbuzz(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}