xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ errexit(char *);
int tnabort(FILE *sfp, FILE *tfp, int c) {
  errexit("invalid state reached (aborting)\n");
}


x86 assembly (clang, -O0):
<tnabort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
lea    0xed6(%rip),%rdi
call   1030 <errexit@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [34 x i8] c"invalid state reached (aborting)\0A\00"
define i32 @tnabort(i32* %0, i32* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32 %2, i32* %7
%8 = call i32 @errexit(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
@.str = [34 x i8] c"invalid state reached (aborting)\0A\00"
define i32 @tnabort(i32* nocapture readnone %0, i32* nocapture readnone %1, i32 %2) {
%4 = tail call i32 @errexit(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
typedef char *uint32_t;

/* Variables and functions */
uint32_t cpuid_get_signature() {
  uint32_t sign;
  asm volatile("cpuid" : "=a"(sign) : "a"(1) : "ebx", "ecx", "edx");
  return sign;
}


x86 assembly (clang, -O0):
<cpuid_get_signature>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    $0x1,%eax
cpuid
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpuid_get_signature>:
push   %rbx
mov    $0x1,%eax
cpuid
pop    %rbx
ret

LLVM IR (-O0):
define i8* @cpuid_get_signature() {
%1 = alloca i8*
%2 = call i8* asm sideeffect "cpuid", "={ax},{ax},~{ebx},~{ecx},~{edx},~{dirflag},~{fpsr},~{flags}"(i32 1)
store i8* %2, i8** %1
%3 = load i8*, i8** %1
ret i8* %3
}

LLVM IR (-O2):
define i8* @cpuid_get_signature() {
%1 = tail call i8* asm sideeffect "cpuid", "={ax},{ax},~{ebx},~{ecx},~{edx},~{dirflag},~{fpsr},~{flags}"(i32 1)
ret i8* %1
}
int variable_test_bit(long nr, volatile const unsigned long *addr) {
  int oldbit;
  asm volatile("bt %2,%1\n\t"
               "sbb %0,%0"
               : "=r"(oldbit)
               : "m"(*(unsigned long *)addr), "Ir"(nr));
  return oldbit;
}


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

x86 assembly (clang, -O2):
<variable_test_bit>:
bt     %rdi,(%rsi)
sbb    %eax,%eax
ret

LLVM IR (-O0):
define i32 @variable_test_bit(i64 %0, i64* %1) {
%3 = alloca i64
%4 = alloca i64*
%5 = alloca i32
store i64 %0, i64* %3
store i64* %1, i64** %4
%6 = load i64*, i64** %4
%7 = load i64, i64* %3
%8 = call i32 asm sideeffect "bt $2,$1\0A\09sbb $0,$0", "=r,*m,Ir,~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %6, i64 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
define i32 @variable_test_bit(i64 %0, i64* %1) {
%3 = tail call i32 asm sideeffect "bt $2,$1\0A\09sbb $0,$0", "=r,*m,Ir,~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %1, i64 %0)
ret i32 %3
}
void g_param_spec_get_qdata() {}


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

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

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

LLVM IR (-O2):
define void @g_param_spec_get_qdata() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char const *argv[]) {
  printf("hello world");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [12 x i8] c"hello world\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void Array2Dfree(double **X, int m, int n) {
  int i;
  for (i = 0; i < m; i++)
    free(X[i]);
  free(X);
}


x86 assembly (clang, -O0):
<Array2Dfree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1154 <Array2Dfree+0x44>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1129 <Array2Dfree+0x19>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Array2Dfree>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1142 <Array2Dfree+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <Array2Dfree+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @Array2Dfree(double** nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %14
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %12, %7 ]
%9 = getelementptr inbounds double*, double** %0, i64 %8
%10 = bitcast double** %9 to i8**
%11 = load i8*, i8** %10
tail call void @free(i8* %11)
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %6
br i1 %13, label %14, label %7
14: ; preds = %7, %3
%15 = bitcast double** %0 to i8*
tail call void @free(i8* %15)
ret void
}
_Complex float test_cacosf(_Complex float x) { return __builtin_cacosf(x); }


x86 assembly (clang, -O0):
<test_cacosf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movlpd %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
movss  %xmm1,-0x18(%rbp)
movss  %xmm0,-0x14(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <cacosf@plt>
movlpd %xmm0,-0x20(%rbp)
movss  -0x20(%rbp),%xmm1
movss  -0x1c(%rbp),%xmm0
movss  %xmm1,-0x8(%rbp)
movss  %xmm0,-0x4(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_cacosf>:
jmp    1030 <cacosf@plt>

LLVM IR (-O0):
define <2 x float> @test_cacosf(<2 x float> %0) {
%2 = alloca { float, float }
%3 = alloca { float, float }
%4 = alloca { float, float }
%5 = alloca { float, float }
%6 = bitcast { float, float }* %3 to <2 x float>*
store <2 x float> %0, <2 x float>* %6
%7 = getelementptr inbounds { float, float }, { float, float }* %3, i32 0, i32 0
%8 = load float, float* %7
%9 = getelementptr inbounds { float, float }, { float, float }* %3, i32 0, i32 1
%10 = load float, float* %9
%11 = getelementptr inbounds { float, float }, { float, float }* %4, i32 0, i32 0
%12 = getelementptr inbounds { float, float }, { float, float }* %4, i32 0, i32 1
store float %8, float* %11
store float %10, float* %12
%13 = bitcast { float, float }* %4 to <2 x float>*
%14 = load <2 x float>, <2 x float>* %13
%15 = call <2 x float> @cacosf(<2 x float> %14)
%16 = bitcast { float, float }* %5 to <2 x float>*
store <2 x float> %15, <2 x float>* %16
%17 = getelementptr inbounds { float, float }, { float, float }* %5, i32 0, i32 0
%18 = load float, float* %17
%19 = getelementptr inbounds { float, float }, { float, float }* %5, i32 0, i32 1
%20 = load float, float* %19
%21 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 0
%22 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 1
store float %18, float* %21
store float %20, float* %22
%23 = bitcast { float, float }* %2 to <2 x float>*
%24 = load <2 x float>, <2 x float>* %23
ret <2 x float> %24
}

LLVM IR (-O2):
define <2 x float> @test_cacosf(<2 x float> %0) {
%2 = tail call <2 x float> @cacosf(<2 x float> %0)
ret <2 x float> %2
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int const);
int ind(uint16_t pc, const uint8_t *ram, char *buffer) {
  sprintf(buffer, "%02x, x", *ram);
  return 1;
}


x86 assembly (clang, -O0):
<ind>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
lea    0xecc(%rip),%rsi
call   1030 <sprintf@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ind>:
push   %rax
mov    %rdx,%rdi
mov    (%rsi),%edx
lea    0xee3(%rip),%rsi
call   1030 <sprintf@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"%02x, x\00"
define i32 @ind(i32 %0, i32* nocapture %1, i8* nocapture writeonly %2) {
%4 = load i32, i32* %1
%5 = tail call i32 @sprintf(i8* dereferenceable(1) %2, i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 1
}
char *dngettext__(domainname, msgid1, msgid2, n) const char *domainname;
const char *msgid1;
const char *msgid2;
unsigned long int n;
{ return dcngettext__(domainname, msgid1, msgid2, n, 1729); }


x86 assembly (clang, -O0):
<dngettext__>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x6c1,%r8d
mov    $0x0,%al
call   1030 <dcngettext__@plt>
cltq
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dngettext__>:
push   %rax
mov    $0x6c1,%r8d
xor    %eax,%eax
call   1030 <dcngettext__@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i8* @dngettext__(i8* %0, i8* %1, i8* %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i64
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i8*, i8** %7
%12 = load i64, i64* %8
%13 = call i32 (i8*, i8*, i8*, i64, i32, ...) bitcast (i32 (...)* @dcngettext__ to i32 (i8*, i8*, i8*, i64, i32, ...)*)(i8* %9, i8* %10, i8* %11, i64 %12, i32 1729)
%14 = sext i32 %13 to i64
%15 = inttoptr i64 %14 to i8*
ret i8* %15
}

LLVM IR (-O2):
define i8* @dngettext__(i8* %0, i8* %1, i8* %2, i64 %3) {
%5 = tail call i32 (i8*, i8*, i8*, i64, i32, ...) bitcast (i32 (...)* @dcngettext__ to i32 (i8*, i8*, i8*, i64, i32, ...)*)(i8* %0, i8* %1, i8* %2, i64 %3, i32 1729)
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i8*
ret i8* %7
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128d;

/* Variables and functions */
int /*<<< orphan*/ _mm_or_pd(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _mm_sqrt_pd(int /*<<< orphan*/);
__m128d t3(__m128d a, __m128d b) {
  a = _mm_sqrt_pd(a);
  b = _mm_sqrt_pd(b);
  return _mm_or_pd(a, b);
}


x86 assembly (clang, -O0):
<t3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <_mm_sqrt_pd@plt>
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <_mm_sqrt_pd@plt>
mov    %eax,-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):
<t3>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
call   1040 <_mm_sqrt_pd@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1040 <_mm_sqrt_pd@plt>
mov    %ebp,%edi
mov    %eax,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <_mm_or_pd@plt>

LLVM IR (-O0):
define i32 @t3(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 = call i32 @_mm_sqrt_pd(i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %4
%8 = call i32 @_mm_sqrt_pd(i32 %7)
store i32 %8, i32* %4
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = call i32 @_mm_or_pd(i32 %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @t3(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_sqrt_pd(i32 %0)
%4 = tail call i32 @_mm_sqrt_pd(i32 %1)
%5 = tail call i32 @_mm_or_pd(i32 %3, i32 %4)
ret i32 %5
}
void TM02_intr(void) {}


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

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

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

LLVM IR (-O2):
define void @TM02_intr() {
ret void
}
int alphabetic(const char c) {
  if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<alphabetic>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jl     1124 <alphabetic+0x24>
movsbl -0x5(%rbp),%eax
cmp    $0x7a,%eax
jle    113e <alphabetic+0x3e>
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
jl     114a <alphabetic+0x4a>
movsbl -0x5(%rbp),%eax
cmp    $0x5a,%eax
jg     114a <alphabetic+0x4a>
movl   $0x1,-0x4(%rbp)
jmp    1151 <alphabetic+0x51>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @alphabetic(i8 signext %0) {
%2 = and i8 %0, -33
%3 = add i8 %2, -65
%4 = icmp ult i8 %3, 26
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
char *strrchr(char const *, char);
int /*<<< orphan*/ sys_mkdir_real(char const *);
void sys_mkdir(const char *path) {
  char *last = strrchr(path, '/');
  if (last) {
    *last = 0;
    sys_mkdir(path);
    *last = '/';
  }
  sys_mkdir_real(path);
}


x86 assembly (clang, -O0):
<sys_mkdir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1170 <sys_mkdir+0x40>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rdi
call   1050 <sys_mkdir@plt>
mov    -0x10(%rbp),%rax
movb   $0x2f,(%rax)
mov    -0x8(%rbp),%rdi
call   1040 <sys_mkdir_real@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_mkdir>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0x2f,%esi
call   1030 <strrchr@plt>
test   %rax,%rax
je     1157 <sys_mkdir+0x27>
mov    %rax,%rbx
movb   $0x0,(%rax)
mov    %r14,%rdi
call   1050 <sys_mkdir@plt>
movb   $0x2f,(%rbx)
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <sys_mkdir_real@plt>

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

LLVM IR (-O2):
define void @sys_mkdir(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
br i1 %3, label %5, label %4
4: ; preds = %1
store i8 0, i8* %2
tail call void @sys_mkdir(i8* %0)
store i8 47, i8* %2
br label %5
5: ; preds = %4, %1
%6 = tail call i32 @sys_mkdir_real(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ hz_abort(char *);
void hz_check_alloc(const void *ptr) {
  if (ptr == NULL) {
    hz_abort("Allocation returned null");
  }
}


x86 assembly (clang, -O0):
<hz_check_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1133 <hz_check_alloc+0x23>
lea    0xed2(%rip),%rdi
call   1030 <hz_abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hz_check_alloc>:
test   %rdi,%rdi
je     1116 <hz_check_alloc+0x6>
ret
lea    0xee3(%rip),%rdi
jmp    1030 <hz_abort@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"Allocation returned null\00"
define void @hz_check_alloc(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @hz_abort(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"Allocation returned null\00"
define void @hz_check_alloc(i8* readnone %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @hz_abort(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Execute(void *);
void *EntryPoint(void *Arg) {
  Execute(Arg);
  return NULL;
}


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

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

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

LLVM IR (-O2):
define noalias i8* @EntryPoint(i8* %0) {
%2 = tail call i32 @Execute(i8* %0)
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void stdlib_free(void *rtdata, void *ptr) { free(ptr); }


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

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

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

LLVM IR (-O2):
define void @stdlib_free(i8* nocapture readnone %0, i8* nocapture %1) {
%3 = tail call i32 @free(i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SIGIO;
int /*<<< orphan*/ SIG_IGN;
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ gxprt(char *, int, int /*<<< orphan*/);
char *malloc(int);
int /*<<< orphan*/ signal(int /*<<< orphan*/, int /*<<< orphan*/);
void initialize(char **rbufpp) {
  if ((*rbufpp = malloc(4096)) == NULL) {
    gxprt("ERROR: can't malloc %d bytes. errno:%d\n", 4096, errno);
    exit(3);
  }
  signal(SIGIO, SIG_IGN);
}


x86 assembly (clang, -O0):
<initialize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1000,%edi
call   1050 <malloc@plt>
mov    -0x8(%rbp),%rcx
mov    %rax,(%rcx)
cmp    $0x0,%rax
jne    118b <initialize+0x4b>
mov    0x2e6a(%rip),%rax
mov    (%rax),%edx
lea    0xe89(%rip),%rdi
mov    $0x1000,%esi
call   1030 <gxprt@plt>
mov    $0x3,%edi
call   1060 <exit@plt>
mov    0x2e3e(%rip),%rax
mov    (%rax),%edi
mov    0x2e4d(%rip),%rax
mov    (%rax),%esi
call   1040 <signal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<initialize>:
push   %rbx
mov    %rdi,%rbx
mov    $0x1000,%edi
call   1050 <malloc@plt>
mov    %rax,(%rbx)
test   %rax,%rax
je     116e <initialize+0x2e>
mov    0x2e73(%rip),%rax
mov    (%rax),%edi
mov    0x2e82(%rip),%rax
mov    (%rax),%esi
pop    %rbx
jmp    1040 <signal@plt>
mov    0x2e63(%rip),%rax
mov    (%rax),%edx
lea    0xe82(%rip),%rdi
mov    $0x1000,%esi
call   1030 <gxprt@plt>
mov    $0x3,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [40 x i8] c"ERROR: can't malloc %d bytes. errno:%d\0A\00"
@errno = global i32 0
@SIGIO = global i32 0
@SIG_IGN = global i32 0
define void @initialize(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i8* @malloc(i32 4096)
%4 = load i8**, i8*** %2
store i8* %3, i8** %4
%5 = icmp eq i8* %3, null
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* @errno
%8 = call i32 @gxprt(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 4096, i32 %7)
%9 = call i32 @exit(i32 3)
unreachable
10: ; preds = %1
%11 = load i32, i32* @SIGIO
%12 = load i32, i32* @SIG_IGN
%13 = call i32 @signal(i32 %11, i32 %12)
ret void
}

LLVM IR (-O2):
@.str = [40 x i8] c"ERROR: can't malloc %d bytes. errno:%d\0A\00"
@errno = global i32 0
@SIGIO = global i32 0
@SIG_IGN = global i32 0
define void @initialize(i8** nocapture writeonly %0) {
%2 = tail call dereferenceable_or_null(4096) i8* @malloc(i32 4096)
store i8* %2, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @errno
%6 = tail call i32 @gxprt(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 4096, i32 %5)
%7 = tail call i32 @exit(i32 3)
unreachable
8: ; preds = %1
%9 = load i32, i32* @SIGIO
%10 = load i32, i32* @SIG_IGN
%11 = tail call i32 @signal(i32 %9, i32 %10)
ret void
}
int rdirDetect(char *str) {
  int count = 0;
  while (*str) {
    if (*str == '>' || *str == '<') {
      count++;
    }
    str++;
  }
  if (count > 0) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<rdirDetect>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1156 <rdirDetect+0x56>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3e,%eax
je     113c <rdirDetect+0x3c>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3c,%eax
jne    1145 <rdirDetect+0x45>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110f <rdirDetect+0xf>
cmpl   $0x0,-0x14(%rbp)
jle    116c <rdirDetect+0x6c>
movl   $0x1,-0x4(%rbp)
jmp    1173 <rdirDetect+0x73>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rdirDetect>:
xor    %ecx,%ecx
jmp    1117 <rdirDetect+0x17>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%ecx
add    $0x1,%rdi
movzbl (%rdi),%eax
cmp    $0x3c,%al
je     1110 <rdirDetect+0x10>
cmp    $0x3e,%al
je     1110 <rdirDetect+0x10>
test   %al,%al
jne    1113 <rdirDetect+0x13>
xor    %eax,%eax
test   %ecx,%ecx
setg   %al
ret

LLVM IR (-O0):
define i32 @rdirDetect(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 0, i32* %4
br label %5
5: ; preds = %22, %1
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %25
9: ; preds = %5
%10 = load i8*, i8** %3
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 62
br i1 %13, label %19, label %14
14: ; preds = %9
%15 = load i8*, i8** %3
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 60
br i1 %18, label %19, label %22
19: ; preds = %14, %9
%20 = load i32, i32* %4
%21 = add nsw i32 %20, 1
store i32 %21, i32* %4
br label %22
22: ; preds = %19, %14
%23 = load i8*, i8** %3
%24 = getelementptr inbounds i8, i8* %23, i32 1
store i8* %24, i8** %3
br label %5
25: ; preds = %5
%26 = load i32, i32* %4
%27 = icmp sgt i32 %26, 0
br i1 %27, label %28, label %29
28: ; preds = %25
store i32 1, i32* %2
br label %30
29: ; preds = %25
store i32 0, i32* %2
br label %30
30: ; preds = %29, %28
%31 = load i32, i32* %2
ret i32 %31
}

LLVM IR (-O2):
define i32 @rdirDetect(i8* nocapture %0) {
br label %2
2: ; preds = %8, %1
%3 = phi i8* [ %0, %1 ], [ %10, %8 ]
%4 = phi i32 [ 0, %1 ], [ %9, %8 ]
%5 = load i8, i8* %3
switch i8 %5, label %8 [
i8 0, label %11
i8 62, label %6
i8 60, label %6
]
6: ; preds = %2, %2
%7 = add nsw i32 %4, 1
br label %8
8: ; preds = %2, %6
%9 = phi i32 [ %7, %6 ], [ %4, %2 ]
%10 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
11: ; preds = %2
%12 = icmp sgt i32 %4, 0
%13 = zext i1 %12 to i32
ret i32 %13
}
int GetMagic(int chip_value, unsigned int *magic) {
  int result = -1;
  switch (chip_value) {
  case 8040:
    *magic = 0x1CE8040A;
    result = 0;
    break;
  case 8060:
    *magic = 0x1CE8060A;
    result = 0;
    break;
  default:
    break;
  }
  return result;
}


x86 assembly (clang, -O0):
<GetMagic>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xffffffff,-0x14(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
sub    $0x1f68,%eax
je     113b <GetMagic+0x3b>
jmp    1128 <GetMagic+0x28>
mov    -0x18(%rbp),%eax
sub    $0x1f7c,%eax
je     1151 <GetMagic+0x51>
jmp    1167 <GetMagic+0x67>
mov    -0x10(%rbp),%rax
movl   $0x1ce8040a,(%rax)
movl   $0x0,-0x14(%rbp)
jmp    116c <GetMagic+0x6c>
mov    -0x10(%rbp),%rax
movl   $0x1ce8060a,(%rax)
movl   $0x0,-0x14(%rbp)
jmp    116c <GetMagic+0x6c>
jmp    116c <GetMagic+0x6c>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetMagic>:
cmp    $0x1f68,%edi
je     111c <GetMagic+0x1c>
mov    $0xffffffff,%eax
cmp    $0x1f7c,%edi
jne    1125 <GetMagic+0x25>
mov    $0x1ce8060a,%eax
jmp    1121 <GetMagic+0x21>
mov    $0x1ce8040a,%eax
mov    %eax,(%rsi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @GetMagic(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
store i32 %0, i32* %3
store i32* %1, i32** %4
store i32 -1, i32* %5
%6 = load i32, i32* %3
switch i32 %6, label %11 [
i32 8040, label %7
i32 8060, label %9
]
7: ; preds = %2
%8 = load i32*, i32** %4
store i32 484967434, i32* %8
store i32 0, i32* %5
br label %12
9: ; preds = %2
%10 = load i32*, i32** %4
store i32 484967946, i32* %10
store i32 0, i32* %5
br label %12
11: ; preds = %2
br label %12
12: ; preds = %11, %9, %7
%13 = load i32, i32* %5
ret i32 %13
}

LLVM IR (-O2):
define i32 @GetMagic(i32 %0, i32* nocapture writeonly %1) {
switch i32 %0, label %6 [
i32 8040, label %4
i32 8060, label %3
]
3: ; preds = %2
br label %4
4: ; preds = %2, %3
%5 = phi i32 [ 484967946, %3 ], [ 484967434, %2 ]
store i32 %5, i32* %1
br label %6
6: ; preds = %4, %2
%7 = phi i32 [ -1, %2 ], [ 0, %4 ]
ret i32 %7
}
char *advance_line(char *at) {
  char test;
  while ((test = *at++) && test != '\n')
    ;
  return at;
}


x86 assembly (clang, -O0):
<advance_line>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%al
mov    %al,-0x9(%rbp)
movsbl %al,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0xa(%rbp)
je     113a <advance_line+0x3a>
movsbl -0x9(%rbp),%eax
cmp    $0xa,%eax
setne  %al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
test   $0x1,%al
jne    114a <advance_line+0x4a>
jmp    114f <advance_line+0x4f>
jmp    1108 <advance_line+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<advance_line>:
mov    %rdi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl (%rax),%ecx
add    $0x1,%rax
cmp    $0xa,%cl
je     1120 <advance_line+0x20>
test   %cl,%cl
jne    1110 <advance_line+0x10>
ret

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

LLVM IR (-O2):
define i8* @advance_line(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %4, %2 ]
%4 = getelementptr inbounds i8, i8* %3, i64 1
%5 = load i8, i8* %3
switch i8 %5, label %2 [
i8 10, label %6
i8 0, label %6
]
6: ; preds = %2, %2
ret i8* %4
}
/* Variables and functions */
long INLINE_SYSCALL_NCS(long, int, long, long, long, long, long, long);
long syscall(long int sysnum, long a, long b, long c, long d, long e, long f) {
  return INLINE_SYSCALL_NCS(sysnum, 6, a, b, c, d, e, f);
}


x86 assembly (clang, -O0):
<syscall>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9
mov    -0x30(%rbp),%r10
mov    0x10(%rbp),%rax
mov    $0x6,%esi
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1030 <INLINE_SYSCALL_NCS@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscall>:
push   %rax
mov    %r9,%rax
mov    %r8,%r9
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    $0x6,%esi
push   0x10(%rsp)
push   %rax
call   1030 <INLINE_SYSCALL_NCS@plt>
add    $0x10,%rsp
pop    %rcx
ret

LLVM IR (-O0):
define i64 @syscall(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5, i64 %6) {
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
%12 = alloca i64
%13 = alloca i64
%14 = alloca i64
store i64 %0, i64* %8
store i64 %1, i64* %9
store i64 %2, i64* %10
store i64 %3, i64* %11
store i64 %4, i64* %12
store i64 %5, i64* %13
store i64 %6, i64* %14
%15 = load i64, i64* %8
%16 = load i64, i64* %9
%17 = load i64, i64* %10
%18 = load i64, i64* %11
%19 = load i64, i64* %12
%20 = load i64, i64* %13
%21 = load i64, i64* %14
%22 = call i64 @INLINE_SYSCALL_NCS(i64 %15, i32 6, i64 %16, i64 %17, i64 %18, i64 %19, i64 %20, i64 %21)
ret i64 %22
}

LLVM IR (-O2):
define i64 @syscall(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5, i64 %6) {
%8 = tail call i64 @INLINE_SYSCALL_NCS(i64 %0, i32 6, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5, i64 %6)
ret i64 %8
}
/* Variables and functions */
int /*<<< orphan*/ reply(char *, scalar_t__);
int /*<<< orphan*/ sprintf(char *, char *, char *, int, char *);
scalar_t__ strlen(char *);
void do_fail(char *file, int line, char *reason) {
  char sbuf[2048];
  sbuf[0] = 'f';
  sprintf(sbuf + 1, "%s, line %d: %s", file, line, reason);
  reply(sbuf, 1 + strlen(sbuf + 1));
}


x86 assembly (clang, -O0):
<do_fail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x830,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
movb   $0x66,-0x820(%rbp)
lea    -0x820(%rbp),%rdi
add    $0x1,%rdi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%r8
lea    0xe96(%rip),%rsi
call   1050 <sprintf@plt>
lea    -0x820(%rbp),%rax
mov    %rax,-0x828(%rbp)
lea    -0x820(%rbp),%rdi
add    $0x1,%rdi
call   1030 <strlen@plt>
mov    -0x828(%rbp),%rdi
mov    %rax,%rsi
add    $0x1,%rsi
call   1040 <reply@plt>
add    $0x830,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_fail>:
push   %rbx
sub    $0x800,%rsp
mov    %rdx,%r8
mov    %esi,%ecx
mov    %rdi,%rdx
movb   $0x66,(%rsp)
lea    0x1(%rsp),%rbx
lea    0xeb0(%rip),%rsi
mov    %rbx,%rdi
call   1050 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
lea    0x1(%rax),%rsi
mov    %rsp,%rdi
call   1040 <reply@plt>
add    $0x800,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"%s, line %d: %s\00"
define void @do_fail(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
%7 = alloca [2048 x i8]
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%8 = getelementptr inbounds [2048 x i8], [2048 x i8]* %7, i64 0, i64 0
store i8 102, i8* %8
%9 = getelementptr inbounds [2048 x i8], [2048 x i8]* %7, i64 0, i64 0
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i8*, i8** %4
%12 = load i32, i32* %5
%13 = load i8*, i8** %6
%14 = call i32 @sprintf(i8* %10, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %11, i32 %12, i8* %13)
%15 = getelementptr inbounds [2048 x i8], [2048 x i8]* %7, i64 0, i64 0
%16 = getelementptr inbounds [2048 x i8], [2048 x i8]* %7, i64 0, i64 0
%17 = getelementptr inbounds i8, i8* %16, i64 1
%18 = call i64 @strlen(i8* %17)
%19 = add nsw i64 1, %18
%20 = call i32 @reply(i8* %15, i64 %19)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"%s, line %d: %s\00"
define void @do_fail(i8* %0, i32 %1, i8* %2) {
%4 = alloca [2048 x i8]
%5 = getelementptr inbounds [2048 x i8], [2048 x i8]* %4, i64 0, i64 0
store i8 102, i8* %5
%6 = getelementptr inbounds [2048 x i8], [2048 x i8]* %4, i64 0, i64 1
%7 = call i32 @sprintf(i8* %6, i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1, i8* %2)
%8 = call i64 @strlen(i8* %6)
%9 = add nsw i64 %8, 1
%10 = call i32 @reply(i8* %5, i64 %9)
ret void
}
/* Type definitions */
struct rlimit {
  int rlim_max;
};

/* Variables and functions */
int /*<<< orphan*/ RLIMIT_CORE;
int /*<<< orphan*/ setrlimit(int /*<<< orphan*/, struct rlimit *);
void enable_core(void) {
  struct rlimit cur_rlimit;
  cur_rlimit.rlim_max = 2000000;
  setrlimit(RLIMIT_CORE, &cur_rlimit);
}


x86 assembly (clang, -O0):
<enable_core>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1e8480,-0x8(%rbp)
mov    0x2ec2(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
call   1030 <setrlimit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<enable_core>:
push   %rax
movl   $0x1e8480,(%rsp)
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1030 <setrlimit@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.rlimit = type { i32 }
@RLIMIT_CORE = global i32 0
define void @enable_core() {
%1 = alloca %struct.rlimit
%2 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %1, i32 0, i32 0
store i32 2000000, i32* %2
%3 = load i32, i32* @RLIMIT_CORE
%4 = call i32 @setrlimit(i32 %3, %struct.rlimit* %1)
ret void
}

LLVM IR (-O2):
%struct.rlimit = type { i32 }
@RLIMIT_CORE = global i32 0
define void @enable_core() {
%1 = alloca %struct.rlimit
%2 = bitcast %struct.rlimit* %1 to i8*
%3 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %1, i64 0, i32 0
store i32 2000000, i32* %3
%4 = load i32, i32* @RLIMIT_CORE
%5 = call i32 @setrlimit(i32 %4, %struct.rlimit* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
void *emalloc(size_t s) {
  void *o = malloc(s);
  if (!o) {
    fprintf(stderr, "Memory allocation failed!\n");
    exit(EXIT_FAILURE);
  }
  return o;
}


x86 assembly (clang, -O0):
<emalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1177 <emalloc+0x47>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
lea    0xe9c(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e68(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emalloc>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     113d <emalloc+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [27 x i8] c"Memory allocation failed!\0A\00"
@EXIT_FAILURE = global i32 0
define i8* @emalloc(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 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %13, label %8
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* @EXIT_FAILURE
%12 = call i32 @exit(i32 %11)
unreachable
13: ; preds = %1
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [27 x i8] c"Memory allocation failed!\0A\00"
@EXIT_FAILURE = global i32 0
define noalias i8* @emalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ e_rts();
void e_rts_accu() { e_rts(); }


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

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

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

LLVM IR (-O2):
define void @e_rts_accu() {
%1 = tail call i32 (...) @e_rts()
ret void
}
/* Variables and functions */
int mfs_file_close(int);
int mfs_dir_close(int fd) { return mfs_file_close(fd); }


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

x86 assembly (clang, -O2):
<mfs_dir_close>:
jmp    1030 <mfs_file_close@plt>

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

LLVM IR (-O2):
define i32 @mfs_dir_close(i32 %0) {
%2 = tail call i32 @mfs_file_close(i32 %0)
ret i32 %2
}
/* Variables and functions */
int isalnum(int);
int iscntrl(int);
int isspace(int);
int ispunct(int c) {
  if (iscntrl(c) == 1)
    return 0;
  else if (isalnum(c) == 1)
    return 0;
  else if (isspace(c) == 1)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<ispunct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <iscntrl@plt>
cmp    $0x1,%eax
jne    1158 <ispunct+0x28>
movl   $0x0,-0x4(%rbp)
jmp    11a3 <ispunct+0x73>
mov    -0x8(%rbp),%edi
call   1040 <isalnum@plt>
cmp    $0x1,%eax
jne    1175 <ispunct+0x45>
movl   $0x0,-0x4(%rbp)
jmp    11a3 <ispunct+0x73>
mov    -0x8(%rbp),%edi
call   1050 <isspace@plt>
cmp    $0x1,%eax
jne    1192 <ispunct+0x62>
movl   $0x0,-0x4(%rbp)
jmp    11a3 <ispunct+0x73>
jmp    1197 <ispunct+0x67>
jmp    119c <ispunct+0x6c>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ispunct>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
call   1030 <iscntrl@plt>
xor    %ebx,%ebx
cmp    $0x1,%eax
je     115c <ispunct+0x2c>
mov    %ebp,%edi
call   1040 <isalnum@plt>
cmp    $0x1,%eax
je     115c <ispunct+0x2c>
mov    %ebp,%edi
call   1050 <isspace@plt>
xor    %ebx,%ebx
cmp    $0x1,%eax
setne  %bl
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @ispunct(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 @iscntrl(i32 %4)
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %21
8: ; preds = %1
%9 = load i32, i32* %3
%10 = call i32 @isalnum(i32 %9)
%11 = icmp eq i32 %10, 1
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 0, i32* %2
br label %21
13: ; preds = %8
%14 = load i32, i32* %3
%15 = call i32 @isspace(i32 %14)
%16 = icmp eq i32 %15, 1
br i1 %16, label %17, label %18
17: ; preds = %13
store i32 0, i32* %2
br label %21
18: ; preds = %13
br label %19
19: ; preds = %18
br label %20
20: ; preds = %19
store i32 1, i32* %2
br label %21
21: ; preds = %20, %17, %12, %7
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
define i32 @ispunct(i32 %0) {
%2 = tail call i32 @iscntrl(i32 %0)
%3 = icmp eq i32 %2, 1
br i1 %3, label %11, label %4
4: ; preds = %1
%5 = tail call i32 @isalnum(i32 %0)
%6 = icmp eq i32 %5, 1
br i1 %6, label %11, label %7
7: ; preds = %4
%8 = tail call i32 @isspace(i32 %0)
%9 = icmp ne i32 %8, 1
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %7, %4, %1
%12 = phi i32 [ 0, %1 ], [ 0, %4 ], [ %10, %7 ]
ret i32 %12
}
/* Variables and functions */
int *get_refcnt(unsigned char *ptr) {
  if (ptr == NULL)
    return NULL;
  else {
    int *res = (int *)(ptr - sizeof(int));
    return res;
  }
}


x86 assembly (clang, -O0):
<get_refcnt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1120 <get_refcnt+0x20>
movq   $0x0,-0x8(%rbp)
jmp    1134 <get_refcnt+0x34>
mov    -0x10(%rbp),%rax
add    $0xfffffffffffffffc,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_refcnt>:
lea    -0x4(%rdi),%rax
test   %rdi,%rdi
cmove  %rdi,%rax
ret

LLVM IR (-O0):
define i32* @get_refcnt(i8* %0) {
%2 = alloca i32*
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %8
7: ; preds = %1
store i32* null, i32** %2
br label %13
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 -4
%11 = bitcast i8* %10 to i32*
store i32* %11, i32** %4
%12 = load i32*, i32** %4
store i32* %12, i32** %2
br label %13
13: ; preds = %8, %7
%14 = load i32*, i32** %2
ret i32* %14
}

LLVM IR (-O2):
define i32* @get_refcnt(i8* readnone %0) {
%2 = icmp eq i8* %0, null
%3 = getelementptr inbounds i8, i8* %0, i64 -4
%4 = bitcast i8* %3 to i32*
%5 = select i1 %2, i32* null, i32* %4
ret i32* %5
}
void __attribute__((__no__)) copy(float *a, float *b) { *b = *a; }


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

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

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

LLVM IR (-O2):
define void @copy(float* nocapture %0, float* nocapture writeonly %1) {
%3 = load float, float* %0
store float %3, float* %1
ret void
}
int getN0(int drank, int dsize, int dnum) {
  int N0 = (dnum * drank) / dsize;
  return (N0);
}


x86 assembly (clang, -O0):
<getN0>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
imul   -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getN0>:
mov    %edi,%eax
imul   %edx,%eax
cltd
idiv   %esi
ret

LLVM IR (-O0):
define i32 @getN0(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = load i32, i32* %4
%10 = mul nsw i32 %8, %9
%11 = load i32, i32* %5
%12 = sdiv i32 %10, %11
store i32 %12, i32* %7
%13 = load i32, i32* %7
ret i32 %13
}

LLVM IR (-O2):
define i32 @getN0(i32 %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %2, %0
%5 = sdiv i32 %4, %1
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ g(int, int);
int f(int a) {
  if (a++ > 0)
    g(a, 3);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
jle    113c <f+0x2c>
mov    -0x8(%rbp),%edi
mov    $0x3,%esi
call   1030 <g@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
test   %edi,%edi
jle    1126 <f+0x16>
push   %rax
add    $0x1,%edi
mov    $0x3,%esi
call   1030 <g@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32 @f(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = add nsw i32 %4, 1
store i32 %5, i32* %3
%6 = icmp sgt i32 %4, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* %3
%9 = call i32 @g(i32 %8, i32 3)
br label %10
10: ; preds = %7, %1
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = add nuw nsw i32 %0, 1
%5 = tail call i32 @g(i32 %4, i32 3)
br label %6
6: ; preds = %3, %1
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ stress_double_put(double const);
double __attribute__((no))
stress_funccall_double_3(const double a, const double b, const double c) {
  stress_double_put(a);
  stress_double_put(b);
  stress_double_put(c);
  return a + b + c;
}


x86 assembly (clang, -O0):
<stress_funccall_double_3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <stress_double_put@plt>
movsd  -0x10(%rbp),%xmm0
call   1030 <stress_double_put@plt>
movsd  -0x18(%rbp),%xmm0
call   1030 <stress_double_put@plt>
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stress_funccall_double_3>:
sub    $0x18,%rsp
movsd  %xmm2,0x8(%rsp)
movsd  %xmm1,(%rsp)
movsd  %xmm0,0x10(%rsp)
call   1030 <stress_double_put@plt>
movsd  (%rsp),%xmm0
call   1030 <stress_double_put@plt>
movsd  0x8(%rsp),%xmm0
call   1030 <stress_double_put@plt>
movsd  0x10(%rsp),%xmm0
addsd  (%rsp),%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @stress_funccall_double_3(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = call i32 @stress_double_put(double %7)
%9 = load double, double* %5
%10 = call i32 @stress_double_put(double %9)
%11 = load double, double* %6
%12 = call i32 @stress_double_put(double %11)
%13 = load double, double* %4
%14 = load double, double* %5
%15 = fadd double %13, %14
%16 = load double, double* %6
%17 = fadd double %15, %16
ret double %17
}

LLVM IR (-O2):
define double @stress_funccall_double_3(double %0, double %1, double %2) {
%4 = tail call i32 @stress_double_put(double %0)
%5 = tail call i32 @stress_double_put(double %1)
%6 = tail call i32 @stress_double_put(double %2)
%7 = fadd double %0, %1
%8 = fadd double %7, %2
ret double %8
}