xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ strrchr(char const *, int);
void uninitvar_strrchr(const char *s, int c) {
  char *str;
  int character;
  (void)strrchr(str, c);
  (void)strrchr(s, character);
  (void)strrchr(s, c);
}


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

x86 assembly (clang, -O2):
<uninitvar_strrchr>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <strrchr@plt>
mov    %rbx,%rdi
call   1030 <strrchr@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <strrchr@plt>

LLVM IR (-O0):
define void @uninitvar_strrchr(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = load i8*, i8** %5
%8 = load i32, i32* %4
%9 = call i32 @strrchr(i8* %7, i32 %8)
%10 = load i8*, i8** %3
%11 = load i32, i32* %6
%12 = call i32 @strrchr(i8* %10, i32 %11)
%13 = load i8*, i8** %3
%14 = load i32, i32* %4
%15 = call i32 @strrchr(i8* %13, i32 %14)
ret void
}

LLVM IR (-O2):
define void @uninitvar_strrchr(i8* %0, i32 %1) {
%3 = tail call i32 @strrchr(i8* undef, i32 %1)
%4 = tail call i32 @strrchr(i8* %0, i32 undef)
%5 = tail call i32 @strrchr(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ xiStub();
void t1_DumpText(void) { xiStub(); }


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

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

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

LLVM IR (-O2):
define void @t1_DumpText() {
%1 = tail call i32 (...) @xiStub()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128d;

/* Variables and functions */
int /*<<< orphan*/ _mm_or_pd(int /*<<< orphan*/, int /*<<< orphan*/);
__m128d test_mm_or_pd(__m128d A, __m128d B) { return _mm_or_pd(A, B); }


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

x86 assembly (clang, -O2):
<test_mm_or_pd>:
jmp    1030 <_mm_or_pd@plt>

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

LLVM IR (-O2):
define i32 @test_mm_or_pd(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_or_pd(i32 %0, i32 %1)
ret i32 %3
}
isreg(as) char *as;
{
  register char *s;
  s = as;
  if (s[0] == 'r' && s[1] >= '0' && s[1] <= '4' && s[2] == 0)
    return (s[1] - '0');
  return (-1);
}


x86 assembly (clang, -O0):
<isreg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x72,%eax
jne    1166 <isreg+0x66>
mov    -0x18(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x30,%eax
jl     1166 <isreg+0x66>
mov    -0x18(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x34,%eax
jg     1166 <isreg+0x66>
mov    -0x18(%rbp),%rax
movsbl 0x2(%rax),%eax
cmp    $0x0,%eax
jne    1166 <isreg+0x66>
mov    -0x18(%rbp),%rax
movsbl 0x1(%rax),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    116d <isreg+0x6d>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isreg>:
mov    $0xffffffff,%eax
cmpb   $0x72,(%rdi)
jne    1122 <isreg+0x22>
movzbl 0x1(%rdi),%ecx
lea    -0x30(%rcx),%edx
cmp    $0x4,%dl
ja     1122 <isreg+0x22>
add    $0xffffffd0,%ecx
xor    %eax,%eax
cmp    0x2(%rdi),%al
sbb    %eax,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @isreg(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
store i8* %5, i8** %4
%6 = load i8*, i8** %4
%7 = getelementptr inbounds i8, i8* %6, i64 0
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 114
br i1 %10, label %11, label %35
11: ; preds = %1
%12 = load i8*, i8** %4
%13 = getelementptr inbounds i8, i8* %12, i64 1
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp sge i32 %15, 48
br i1 %16, label %17, label %35
17: ; preds = %11
%18 = load i8*, i8** %4
%19 = getelementptr inbounds i8, i8* %18, i64 1
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = icmp sle i32 %21, 52
br i1 %22, label %23, label %35
23: ; preds = %17
%24 = load i8*, i8** %4
%25 = getelementptr inbounds i8, i8* %24, i64 2
%26 = load i8, i8* %25
%27 = sext i8 %26 to i32
%28 = icmp eq i32 %27, 0
br i1 %28, label %29, label %35
29: ; preds = %23
%30 = load i8*, i8** %4
%31 = getelementptr inbounds i8, i8* %30, i64 1
%32 = load i8, i8* %31
%33 = sext i8 %32 to i32
%34 = sub nsw i32 %33, 48
store i32 %34, i32* %2
br label %36
35: ; preds = %23, %17, %11, %1
store i32 -1, i32* %2
br label %36
36: ; preds = %35, %29
%37 = load i32, i32* %2
ret i32 %37
}

LLVM IR (-O2):
define i32 @isreg(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 114
br i1 %3, label %4, label %16
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = add i8 %6, -48
%8 = icmp ult i8 %7, 5
br i1 %8, label %9, label %16
9: ; preds = %4
%10 = zext i8 %6 to i32
%11 = getelementptr inbounds i8, i8* %0, i64 2
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
%14 = add nsw i32 %10, -48
%15 = select i1 %13, i32 %14, i32 -1
br label %16
16: ; preds = %9, %1, %4
%17 = phi i32 [ -1, %4 ], [ -1, %1 ], [ %15, %9 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ unrom_switchprg(unsigned char);
void unrom_access(unsigned int address, unsigned char data) {
  if (address > 0x7fff && address < 0x10000)
    unrom_switchprg(data);
}


x86 assembly (clang, -O0):
<unrom_access>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
cmpl   $0x7fff,-0x4(%rbp)
jbe    1144 <unrom_access+0x34>
cmpl   $0x10000,-0x4(%rbp)
jae    1144 <unrom_access+0x34>
movzbl -0x5(%rbp),%edi
call   1030 <unrom_switchprg@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unrom_access>:
and    $0xffff8000,%edi
cmp    $0x8000,%edi
jne    1127 <unrom_access+0x17>
movzbl %sil,%edi
jmp    1030 <unrom_switchprg@plt>
ret

LLVM IR (-O0):
define void @unrom_access(i32 %0, i8 zeroext %1) {
%3 = alloca i32
%4 = alloca i8
store i32 %0, i32* %3
store i8 %1, i8* %4
%5 = load i32, i32* %3
%6 = icmp ugt i32 %5, 32767
br i1 %6, label %7, label %13
7: ; preds = %2
%8 = load i32, i32* %3
%9 = icmp ult i32 %8, 65536
br i1 %9, label %10, label %13
10: ; preds = %7
%11 = load i8, i8* %4
%12 = call i32 @unrom_switchprg(i8 zeroext %11)
br label %13
13: ; preds = %10, %7, %2
ret void
}

LLVM IR (-O2):
define void @unrom_access(i32 %0, i8 zeroext %1) {
%3 = and i32 %0, -32768
%4 = icmp eq i32 %3, 32768
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @unrom_switchprg(i8 zeroext %1)
br label %7
7: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gen_disk(int, int, int /*<<< orphan*/ *, int);
int main(int argc, char *argv[]) {
  gen_disk(-1, 1, NULL, 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xffffffff,%edi
mov    $0x1,%ecx
xor    %eax,%eax
mov    %eax,%edx
mov    %ecx,%esi
call   1030 <gen_disk@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @gen_disk(i32 -1, i32 1, i32* null, i32 1)
ret i32 0
}
char *pwfrdev_shortdesc(void) {
  return "compute a secret key based on properties of the current device";
}


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

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

LLVM IR (-O0):
@.str = [63 x i8] c"compute a secret key based on properties of the current device\00"
define i8* @pwfrdev_shortdesc() {
ret i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [63 x i8] c"compute a secret key based on properties of the current device\00"
define i8* @pwfrdev_shortdesc() {
ret i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, size_t,
                           char const *);
int /*<<< orphan*/ stderr;
void spx_utils_die_(const char *msg, const char *file, size_t line) {
  fprintf(stderr, "SPX Fatal error at %s:%lu - %s\n", file, line, msg);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<spx_utils_die_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%r8
lea    0xeb0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e7c(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<spx_utils_die_>:
push   %rax
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%r8
mov    0x2eaf(%rip),%rax
mov    (%rax),%edi
lea    0xec6(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [32 x i8] c"SPX Fatal error at %s:%lu - %s\0A\00"
@EXIT_FAILURE = global i32 0
define void @spx_utils_die_(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = load i8*, i8** %4
%11 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %8, i64 %9, i8* %10)
%12 = load i32, i32* @EXIT_FAILURE
%13 = call i32 @exit(i32 %12)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [32 x i8] c"SPX Fatal error at %s:%lu - %s\0A\00"
@EXIT_FAILURE = global i32 0
define void @spx_utils_die_(i8* %0, i8* %1, i64 %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %1, i64 %2, i8* %0)
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
}
float cosf(float x) {
  float r;
  if (isinf(x))
    return __domain_error();
  __asm__ __volatile__("fcos" : "=t"(r) : "0"(x));
  return r;
}


x86 assembly (clang, -O0):
<cosf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    $0x1,%al
call   1040 <isinf@plt>
cmp    $0x0,%eax
je     115b <cosf+0x3b>
mov    $0x0,%al
call   1030 <__domain_error@plt>
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1181 <cosf+0x61>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
flds   -0x10(%rbp)
fcos
fstps  -0x14(%rbp)
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cosf>:
sub    $0x18,%rsp
movss  %xmm0,0xc(%rsp)
cvtss2sd %xmm0,%xmm0
mov    $0x1,%al
call   1040 <isinf@plt>
test   %eax,%eax
je     114c <cosf+0x2c>
xor    %eax,%eax
call   1030 <__domain_error@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
add    $0x18,%rsp
ret
movss  0xc(%rsp),%xmm0
movss  %xmm0,0x14(%rsp)
flds   0x14(%rsp)
fcos
fstps  0x10(%rsp)
movss  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define float @cosf(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca float
store float %0, float* %3
%5 = load float, float* %3
%6 = fpext float %5 to double
%7 = call i32 (double, ...) bitcast (i32 (...)* @isinf to i32 (double, ...)*)(double %6)
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = call i32 (...) @__domain_error()
%11 = sitofp i32 %10 to float
store float %11, float* %2
br label %16
12: ; preds = %1
%13 = load float, float* %3
%14 = call float asm sideeffect "fcos", "={st},0,~{dirflag},~{fpsr},~{flags}"(float %13)
store float %14, float* %4
%15 = load float, float* %4
store float %15, float* %2
br label %16
16: ; preds = %12, %9
%17 = load float, float* %2
ret float %17
}

LLVM IR (-O2):
define float @cosf(float %0) {
%2 = fpext float %0 to double
%3 = tail call i32 (double, ...) bitcast (i32 (...)* @isinf to i32 (double, ...)*)(double %2)
%4 = icmp eq i32 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = tail call i32 (...) @__domain_error()
%7 = sitofp i32 %6 to float
br label %10
8: ; preds = %1
%9 = tail call float asm sideeffect "fcos", "={st},0,~{dirflag},~{fpsr},~{flags}"(float %0)
br label %10
10: ; preds = %8, %5
%11 = phi float [ %7, %5 ], [ %9, %8 ]
ret float %11
}
int rb_isblank(int c) { return c == ' ' || c == '\t'; }


x86 assembly (clang, -O0):
<rb_isblank>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1120 <rb_isblank+0x20>
cmpl   $0x9,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rb_isblank>:
cmp    $0x20,%edi
sete   %al
cmp    $0x9,%edi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @rb_isblank(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 32
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 9
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ true, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @rb_isblank(i32 %0) {
%2 = icmp eq i32 %0, 32
%3 = icmp eq i32 %0, 9
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
void ResSetDirectory(char *a) {}


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

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

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

LLVM IR (-O2):
define void @ResSetDirectory(i8* nocapture %0) {
ret void
}
/* Variables and functions */
size_t test_strlen(const char *s) {
  const char *sc;
  for (sc = s; *sc != '\0'; ++sc)
    ;
  return sc - s;
}


x86 assembly (clang, -O0):
<test_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1136 <test_strlen+0x36>
jmp    1125 <test_strlen+0x25>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <test_strlen+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_strlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <test_strlen+0x10>
ret

LLVM IR (-O0):
define i64 @test_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 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %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
ret i64 %19
}

LLVM IR (-O2):
define i64 @test_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
ret i64 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ buffer;

/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, char *, int);
int bof(char *str) {
  char buffer[12];
  strncpy(buffer, str, sizeof(buffer));
  return 1;
}


x86 assembly (clang, -O0):
<bof>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x14(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0xc,%edx
call   1030 <strncpy@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bof>:
sub    $0x18,%rsp
mov    %rdi,%rsi
lea    0xc(%rsp),%rdi
mov    $0xc,%edx
call   1030 <strncpy@plt>
mov    $0x1,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @bof(i8* %0) {
%2 = alloca i8*
%3 = alloca [12 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [12 x i8], [12 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @strncpy(i8* %4, i8* %5, i32 12)
ret i32 1
}

LLVM IR (-O2):
define i32 @bof(i8* %0) {
%2 = alloca [12 x i8]
%3 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 0
%4 = call i32 @strncpy(i8* %3, i8* %0, i32 12)
ret i32 1
}
int isdots(char *name) {
  return name[0] == '.' &&
         (name[1] == '\0' || name[1] == '.' && name[2] == '\0');
}


x86 assembly (clang, -O0):
<isdots>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x2e,%ecx
mov    %al,-0x9(%rbp)
jne    1166 <isdots+0x66>
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0xa(%rbp)
je     1160 <isdots+0x60>
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%ecx
xor    %eax,%eax
cmp    $0x2e,%ecx
mov    %al,-0xb(%rbp)
jne    115a <isdots+0x5a>
mov    -0x8(%rbp),%rax
movsbl 0x2(%rax),%eax
cmp    $0x0,%eax
sete   %al
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isdots>:
xor    %eax,%eax
cmpb   $0x2e,(%rdi)
jne    111c <isdots+0x1c>
mov    0x1(%rdi),%cl
test   %cl,%cl
je     111d <isdots+0x1d>
cmp    $0x2e,%cl
jne    111c <isdots+0x1c>
xor    %eax,%eax
cmpb   $0x0,0x2(%rdi)
sete   %al
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @isdots(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 46
br i1 %7, label %8, label %30
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 0
br i1 %13, label %28, label %14
14: ; preds = %8
%15 = load i8*, i8** %2
%16 = getelementptr inbounds i8, i8* %15, i64 1
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp eq i32 %18, 46
br i1 %19, label %20, label %26
20: ; preds = %14
%21 = load i8*, i8** %2
%22 = getelementptr inbounds i8, i8* %21, i64 2
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = icmp eq i32 %24, 0
br label %26
26: ; preds = %20, %14
%27 = phi i1 [ false, %14 ], [ %25, %20 ]
br label %28
28: ; preds = %26, %8
%29 = phi i1 [ true, %8 ], [ %27, %26 ]
br label %30
30: ; preds = %28, %1
%31 = phi i1 [ false, %1 ], [ %29, %28 ]
%32 = zext i1 %31 to i32
ret i32 %32
}

LLVM IR (-O2):
define i32 @isdots(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 46
br i1 %3, label %4, label %13
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
switch i8 %6, label %12 [
i8 0, label %13
i8 46, label %7
]
7: ; preds = %4
%8 = getelementptr inbounds i8, i8* %0, i64 2
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
%11 = zext i1 %10 to i32
br label %13
12: ; preds = %4
br label %13
13: ; preds = %4, %12, %7, %1
%14 = phi i32 [ 0, %1 ], [ 1, %4 ], [ %11, %7 ], [ 0, %12 ]
ret i32 %14
}
int atomCmp(register const void *a1, register const void *a2) {
  return ((*(int *)a1) - (*(int *)a2));
}


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

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

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

LLVM IR (-O2):
define i32 @atomCmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
void _removelast2(path) char *path;
{
  register char *p;
  for (p = path + strlen(path); *--p != '/' && p >= path;)
    *p = '\0';
}


x86 assembly (clang, -O0):
<_removelast2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x10(%rbp)
movsbl -0x1(%rax),%ecx
xor    %eax,%eax
cmp    $0x2f,%ecx
mov    %al,-0x19(%rbp)
je     116a <_removelast2+0x5a>
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
setae  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    117a <_removelast2+0x6a>
jmp    1186 <_removelast2+0x76>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
jmp    113b <_removelast2+0x2b>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_removelast2>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cmpb   $0x2f,-0x1(%rbx,%rax,1)
je     1155 <_removelast2+0x45>
lea    (%rbx,%rax,1),%rcx
add    $0xffffffffffffffff,%rcx
cmp    %rbx,%rcx
jb     1155 <_removelast2+0x45>
add    %rbx,%rax
add    $0xfffffffffffffffe,%rax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movb   $0x0,0x1(%rax)
cmpb   $0x2f,(%rax)
je     1155 <_removelast2+0x45>
lea    -0x1(%rax),%rcx
cmp    %rbx,%rax
mov    %rcx,%rax
jae    1140 <_removelast2+0x30>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @_removelast2(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = getelementptr inbounds i8, i8* %0, i64 %2
%4 = getelementptr inbounds i8, i8* %3, i64 -1
%5 = load i8, i8* %4
%6 = icmp ne i8 %5, 47
%7 = icmp uge i8* %4, %0
%8 = and i1 %6, %7
br i1 %8, label %9, label %16
9: ; preds = %1, %9
%10 = phi i8* [ %11, %9 ], [ %4, %1 ]
store i8 0, i8* %10
%11 = getelementptr inbounds i8, i8* %10, i64 -1
%12 = load i8, i8* %11
%13 = icmp ne i8 %12, 47
%14 = icmp uge i8* %11, %0
%15 = and i1 %13, %14
br i1 %15, label %9, label %16
16: ; preds = %9, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void print_help() {
  fprintf(stdout, "Usage: stress [options] [packet_interval]\n\n");
  fprintf(stdout, "-e\t\techo received data\n");
  fprintf(stdout, "-n\t\ttest noise (only when testing locally)\n");
}


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

x86 assembly (clang, -O2):
<print_help>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xefd(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf07(%rip),%rsi
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [44 x i8] c"Usage: stress [options] [packet_interval]\0A\0A\00"
@.str.1 = [24 x i8] c"-e\09\09echo received data\0A\00"
@.str.2 = [44 x i8] c"-n\09\09test noise (only when testing locally)\0A\00"
define void @print_help() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @stdout
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [44 x i8] c"Usage: stress [options] [packet_interval]\0A\0A\00"
@.str.1 = [24 x i8] c"-e\09\09echo received data\0A\00"
@.str.2 = [44 x i8] c"-n\09\09test noise (only when testing locally)\0A\00"
define void @print_help() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @stdout
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ MyFree(void *);
void SzFree(void *p, void *address) {
  (void)p;
  ;
  MyFree(address);
}


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

x86 assembly (clang, -O2):
<SzFree>:
mov    %rsi,%rdi
jmp    1030 <MyFree@plt>

LLVM IR (-O0):
define void @SzFree(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 @MyFree(i8* %6)
ret void
}

LLVM IR (-O2):
define void @SzFree(i8* nocapture readnone %0, i8* %1) {
%3 = tail call i32 @MyFree(i8* %1)
ret void
}
int gcdGen(int m, int n) {
  if (n == 0) {
    return m;
  } else {
    return gcdGen(n, m % n);
  }
}


x86 assembly (clang, -O0):
<gcdGen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1133 <gcdGen+0x23>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1147 <gcdGen+0x37>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%esi
call   1030 <gcdGen@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcdGen>:
mov    %edi,%eax
test   %esi,%esi
je     111d <gcdGen+0x1d>
mov    %esi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <gcdGen+0x10>
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @gcdGen(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 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %4
store i32 %9, i32* %3
br label %16
10: ; preds = %2
%11 = load i32, i32* %5
%12 = load i32, i32* %4
%13 = load i32, i32* %5
%14 = srem i32 %12, %13
%15 = call i32 @gcdGen(i32 %11, i32 %14)
store i32 %15, i32* %3
br label %16
16: ; preds = %10, %8
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @gcdGen(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = phi i32 [ %5, %4 ], [ %0, %2 ]
%7 = srem i32 %6, %5
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %0, %2 ], [ %5, %4 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ frag_four();
int /*<<< orphan*/ frag_one();
int /*<<< orphan*/ frag_three();
int /*<<< orphan*/ frag_two();
int main(int argc, char const *argv[]) {
  frag_one();
  frag_two();
  frag_three();
  frag_four();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1050 <frag_one@plt>
mov    $0x0,%al
call   1060 <frag_two@plt>
mov    $0x0,%al
call   1040 <frag_three@plt>
mov    $0x0,%al
call   1030 <frag_four@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <frag_one@plt>
xor    %eax,%eax
call   1060 <frag_two@plt>
xor    %eax,%eax
call   1040 <frag_three@plt>
xor    %eax,%eax
call   1030 <frag_four@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @frag_one()
%7 = call i32 (...) @frag_two()
%8 = call i32 (...) @frag_three()
%9 = call i32 (...) @frag_four()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @frag_one()
%4 = tail call i32 (...) @frag_two()
%5 = tail call i32 (...) @frag_three()
%6 = tail call i32 (...) @frag_four()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ __string_file(int /*<<< orphan*/ *, char *, char *, size_t);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int vfprintf(int /*<<< orphan*/, char const *, int /*<<< orphan*/);
int vsprintf(char *str, const char *fmt, va_list args) {
  FILE tmpfile;
  int r;
  size_t len = 0x7fffffff;
  r = vfprintf(__string_file(&tmpfile, str, "w", len), fmt, args);
  fclose(&tmpfile);
  return r;
}


x86 assembly (clang, -O0):
<vsprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movq   $0x7fffffff,-0x28(%rbp)
7f
mov    -0x8(%rbp),%rsi
mov    -0x28(%rbp),%rcx
lea    -0x18(%rbp),%rdi
lea    0xea2(%rip),%rdx
call   1040 <__string_file@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1050 <vfprintf@plt>
mov    %eax,-0x1c(%rbp)
lea    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x1c(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vsprintf>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %edx,%ebp
mov    %rsi,%rbx
mov    %rdi,%rsi
lea    0xeb9(%rip),%rdx
lea    0xc(%rsp),%r14
mov    $0x7fffffff,%ecx
mov    %r14,%rdi
call   1040 <__string_file@plt>
mov    %eax,%edi
mov    %rbx,%rsi
mov    %ebp,%edx
call   1050 <vfprintf@plt>
mov    %eax,%ebx
mov    %r14,%rdi
call   1030 <fclose@plt>
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"w\00"
define i32 @vsprintf(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
store i64 2147483647, i64* %9
%10 = load i8*, i8** %4
%11 = load i64, i64* %9
%12 = call i32 @__string_file(i32* %7, i8* %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i64 %11)
%13 = load i8*, i8** %5
%14 = load i32, i32* %6
%15 = call i32 @vfprintf(i32 %12, i8* %13, i32 %14)
store i32 %15, i32* %8
%16 = call i32 @fclose(i32* %7)
%17 = load i32, i32* %8
ret i32 %17
}

LLVM IR (-O2):
@.str = [2 x i8] c"w\00"
define i32 @vsprintf(i8* %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = call i32 @__string_file(i32* %4, i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i64 2147483647)
%7 = call i32 @vfprintf(i32 %6, i8* %1, i32 %2)
%8 = call i32 @fclose(i32* %4)
ret i32 %7
}
/* Variables and functions */
int first_one(int /*<<< orphan*/);
int /*<<< orphan*/ h_to_line(unsigned long long, int);
int flip_index_h(int x) { return first_one(h_to_line(1ULL << x, x)); }


x86 assembly (clang, -O0):
<flip_index_h>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
mov    $0x1,%edi
shl    %cl,%rdi
mov    -0x4(%rbp),%esi
call   1030 <h_to_line@plt>
mov    %eax,%edi
call   1040 <first_one@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flip_index_h>:
push   %rax
mov    %edi,%ecx
mov    $0x1,%edi
shl    %cl,%rdi
mov    %ecx,%esi
call   1030 <h_to_line@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <first_one@plt>

LLVM IR (-O0):
define i32 @flip_index_h(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = zext i32 %3 to i64
%5 = shl i64 1, %4
%6 = load i32, i32* %2
%7 = call i32 @h_to_line(i64 %5, i32 %6)
%8 = call i32 @first_one(i32 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @flip_index_h(i32 %0) {
%2 = zext i32 %0 to i64
%3 = shl nuw i64 1, %2
%4 = tail call i32 @h_to_line(i64 %3, i32 %0)
%5 = tail call i32 @first_one(i32 %4)
ret i32 %5
}
/* Variables and functions */
char *_strstr(char const *, char const *, void *);
char *hfuzz_strstr(const char *haystack, const char *needle, void *addr) {
  return _strstr(haystack, needle, addr);
}


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

x86 assembly (clang, -O2):
<hfuzz_strstr>:
jmp    1030 <_strstr@plt>

LLVM IR (-O0):
define i8* @hfuzz_strstr(i8* %0, i8* %1, i8* %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** %5
%9 = load i8*, i8** %6
%10 = call i8* @_strstr(i8* %7, i8* %8, i8* %9)
ret i8* %10
}

LLVM IR (-O2):
define i8* @hfuzz_strstr(i8* %0, i8* %1, i8* %2) {
%4 = tail call i8* @_strstr(i8* %0, i8* %1, i8* %2)
ret i8* %4
}
/* Variables and functions */
scalar_t__ isalpha(int);
scalar_t__ isdigit(int);
int isTokenChar(int start, int c) {
  return (isalpha(c) || c == '_' || (!start && isdigit(c)));
}


x86 assembly (clang, -O0):
<isTokenChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <isalpha@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
jne    117e <isTokenChar+0x5e>
mov    $0x1,%al
cmpl   $0x5f,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     117e <isTokenChar+0x5e>
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0xa(%rbp)
jne    1178 <isTokenChar+0x58>
mov    -0x8(%rbp),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isTokenChar>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    %esi,%edi
call   1040 <isalpha@plt>
mov    %rax,%rcx
mov    $0x1,%eax
cmp    $0x5f,%ebx
je     1158 <isTokenChar+0x38>
test   %rcx,%rcx
jne    1158 <isTokenChar+0x38>
xor    %eax,%eax
test   %ebp,%ebp
jne    1158 <isTokenChar+0x38>
mov    %ebx,%edi
call   1030 <isdigit@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @isTokenChar(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 = call i64 @isalpha(i32 %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %20, label %8
8: ; preds = %2
%9 = load i32, i32* %4
%10 = icmp eq i32 %9, 95
br i1 %10, label %20, label %11
11: ; preds = %8
%12 = load i32, i32* %3
%13 = icmp ne i32 %12, 0
br i1 %13, label %18, label %14
14: ; preds = %11
%15 = load i32, i32* %4
%16 = call i64 @isdigit(i32 %15)
%17 = icmp ne i64 %16, 0
br label %18
18: ; preds = %14, %11
%19 = phi i1 [ false, %11 ], [ %17, %14 ]
br label %20
20: ; preds = %18, %8, %2
%21 = phi i1 [ true, %8 ], [ true, %2 ], [ %19, %18 ]
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
define i32 @isTokenChar(i32 %0, i32 %1) {
%3 = tail call i64 @isalpha(i32 %1)
%4 = icmp ne i64 %3, 0
%5 = icmp eq i32 %1, 95
%6 = or i1 %5, %4
br i1 %6, label %13, label %7
7: ; preds = %2
%8 = icmp eq i32 %0, 0
br i1 %8, label %9, label %13
9: ; preds = %7
%10 = tail call i64 @isdigit(i32 %1)
%11 = icmp ne i64 %10, 0
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %7, %9, %2
%14 = phi i32 [ 1, %2 ], [ 0, %7 ], [ %12, %9 ]
ret i32 %14
}
int suma(int a, int b) {
  int c;
  c = a + b;
  return c;
}


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

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

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

LLVM IR (-O2):
define i32 @suma(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Type definitions */
typedef int uint8_t;
typedef int uint64_t;

/* Variables and functions */
uint64_t from_bytes(uint8_t from[8]) {
  uint64_t to = 0;
  for (int i = 0; i < 8; i++) {
    to = (to << 8) | from[i];
  }
  return to;
}


x86 assembly (clang, -O0):
<from_bytes>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x8,-0x10(%rbp)
jge    1142 <from_bytes+0x42>
mov    -0xc(%rbp),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
movslq -0x10(%rbp),%rdx
or     (%rcx,%rdx,4),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <from_bytes+0x16>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<from_bytes>:
mov    0x10(%rdi),%ecx
mov    0x14(%rdi),%eax
shl    $0x10,%ecx
shl    $0x8,%eax
or     %ecx,%eax
or     0x18(%rdi),%eax
shl    $0x8,%eax
or     0x1c(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @from_bytes(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 4
%3 = load i32, i32* %2
%4 = getelementptr inbounds i32, i32* %0, i64 5
%5 = load i32, i32* %4
%6 = shl i32 %3, 16
%7 = shl i32 %5, 8
%8 = or i32 %6, %7
%9 = getelementptr inbounds i32, i32* %0, i64 6
%10 = load i32, i32* %9
%11 = or i32 %10, %8
%12 = shl i32 %11, 8
%13 = getelementptr inbounds i32, i32* %0, i64 7
%14 = load i32, i32* %13
%15 = or i32 %14, %12
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ HARD_RESET_NOW();
extern void arch_reset(char mode) { HARD_RESET_NOW(); }


x86 assembly (clang, -O0):
<arch_reset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x0,%al
call   1030 <HARD_RESET_NOW@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @arch_reset(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 (...) @HARD_RESET_NOW()
ret void
}

LLVM IR (-O2):
define void @arch_reset(i8 signext %0) {
%2 = tail call i32 (...) @HARD_RESET_NOW()
ret void
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ mjpeg_error_exit1(char *, unsigned long);
void *checked_malloc(size_t size) {
  void *p;
  if ((p = malloc(size)) == NULL)
    mjpeg_error_exit1("Memory allocation failed (%lu bytes needed)",
                      (unsigned long)size);
  return p;
}


x86 assembly (clang, -O0):
<checked_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1153 <checked_malloc+0x33>
mov    -0x8(%rbp),%rsi
lea    0xeb2(%rip),%rdi
call   1040 <mjpeg_error_exit1@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checked_malloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1143 <checked_malloc+0x23>
lea    0xec5(%rip),%rdi
mov    %r14,%rsi
call   1040 <mjpeg_error_exit1@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [44 x i8] c"Memory allocation failed (%lu bytes needed)\00"
define i8* @checked_malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i64, i64* %2
%9 = call i32 @mjpeg_error_exit1(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i64 %8)
br label %10
10: ; preds = %7, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [44 x i8] c"Memory allocation failed (%lu bytes needed)\00"
define noalias i8* @checked_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @mjpeg_error_exit1(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i64 %0)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
logerr(fmt, a1, a2, a3, a4, a5, a6, a7, a8, a9) char *fmt;
long a1, a2, a3, a4, a5, a6, a7, a8, a9;
{ _dolog(1, fmt, a1, a2, a3, a4, a5, a6, a7, a8, a9); }


x86 assembly (clang, -O0):
<logerr>:
push   %rbp
mov    %rsp,%rbp
push   %r14
push   %rbx
sub    $0x60,%rsp
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x28(%rbp)
mov    %rdx,-0x30(%rbp)
mov    %rcx,-0x38(%rbp)
mov    %r8,-0x40(%rbp)
mov    %r9,-0x48(%rbp)
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x30(%rbp),%rcx
mov    -0x38(%rbp),%r8
mov    -0x40(%rbp),%r9
mov    -0x48(%rbp),%r14
mov    0x10(%rbp),%rbx
mov    0x18(%rbp),%r11
mov    0x20(%rbp),%r10
mov    0x28(%rbp),%rax
mov    $0x1,%edi
mov    %r14,(%rsp)
mov    %rbx,0x8(%rsp)
mov    %r11,0x10(%rsp)
mov    %r10,0x18(%rsp)
mov    %rax,0x20(%rsp)
mov    $0x0,%al
call   1030 <_dolog@plt>
mov    -0x14(%rbp),%eax
add    $0x60,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

x86 assembly (clang, -O2):
<logerr>:
sub    $0x28,%rsp
mov    %r8,%rax
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
movaps 0x30(%rsp),%xmm0
movaps 0x40(%rsp),%xmm1
movups %xmm1,0x18(%rsp)
movups %xmm0,0x8(%rsp)
mov    %r9,(%rsp)
mov    $0x1,%edi
mov    %rax,%r9
xor    %eax,%eax
call   1030 <_dolog@plt>
add    $0x28,%rsp
ret

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

LLVM IR (-O2):
define i32 @logerr(i8* %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5, i64 %6, i64 %7, i64 %8, i64 %9) {
%11 = tail call i32 (i32, i8*, i64, i64, i64, i64, i64, i64, i64, i64, i64, ...) bitcast (i32 (...)* @_dolog to i32 (i32, i8*, i64, i64, i64, i64, i64, i64, i64, i64, i64, ...)*)(i32 1, i8* %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5, i64 %6, i64 %7, i64 %8, i64 %9)
ret i32 undef
}
int f1(int a, int b) { return (a > b) | -(b > a); }


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x8(%rbp),%ecx
cmp    -0x4(%rbp),%ecx
setg   %cl
and    $0x1,%cl
movzbl %cl,%edx
xor    %ecx,%ecx
sub    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
xor    %ecx,%ecx
cmp    %esi,%edi
setg   %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

LLVM IR (-O0):
define i32 @f1(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 = icmp sgt i32 %5, %6
%8 = zext i1 %7 to i32
%9 = load i32, i32* %4
%10 = load i32, i32* %3
%11 = icmp sgt i32 %9, %10
%12 = zext i1 %11 to i32
%13 = sub nsw i32 0, %12
%14 = or i32 %8, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @f1(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = zext i1 %3 to i32
%5 = icmp sgt i32 %1, %0
%6 = select i1 %5, i32 -1, i32 %4
ret i32 %6
}
/* Type definitions */
typedef scalar_t__ uint32_t;
typedef scalar_t__ uint16_t;
typedef int /*<<< orphan*/ int8_t;

/* Variables and functions */
void PutPixel16(int8_t *pData, uint32_t pixel) {
  *(uint16_t *)pData = (uint16_t)pixel;
}


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

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

LLVM IR (-O0):
define void @PutPixel16(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
store i32* %0, i32** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i32*, i32** %3
%7 = bitcast i32* %6 to i64*
store i64 %5, i64* %7
ret void
}

LLVM IR (-O2):
define void @PutPixel16(i32* nocapture writeonly %0, i64 %1) {
%3 = bitcast i32* %0 to i64*
store i64 %1, i64* %3
ret void
}