xunge/DecIR huggingface dataset:
int main(int argc, char *argv[]) {
  char b[10];
  int len = atoi(argv[1]);
  (void)memcpy(b, "1020202020202", len);
  (void)printf("%*.*s\n", len, len, b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    $0x0,%al
call   1050 <atoi@plt>
mov    %eax,-0x20(%rbp)
lea    -0x1a(%rbp),%rdi
movslq -0x20(%rbp),%rdx
lea    0xe99(%rip),%rsi
call   1040 <memcpy@plt>
mov    -0x20(%rbp),%esi
mov    -0x20(%rbp),%edx
lea    -0x1a(%rbp),%rcx
lea    0xe91(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    0x8(%rsi),%rdi
xor    %eax,%eax
call   1050 <atoi@plt>
movslq %eax,%rbx
lea    0xeb4(%rip),%rsi
lea    0xe(%rsp),%r14
mov    %r14,%rdi
mov    %rbx,%rdx
call   1040 <memcpy@plt>
lea    0xeab(%rip),%rdi
mov    %ebx,%esi
mov    %ebx,%edx
mov    %r14,%rcx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [14 x i8] c"1020202020202\00"
@.str.1 = [7 x i8] c"%*.*s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [10 x i8]
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i8**, i8*** %5
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = load i8*, i8** %9
%11 = call i32 (i8*, ...) bitcast (i32 (...)* @atoi to i32 (i8*, ...)*)(i8* %10)
store i32 %11, i32* %7
%12 = getelementptr inbounds [10 x i8], [10 x i8]* %6, i64 0, i64 0
%13 = load i32, i32* %7
%14 = sext i32 %13 to i64
%15 = load i32, i32* %7
%16 = load i32, i32* %7
%17 = getelementptr inbounds [10 x i8], [10 x i8]* %6, i64 0, i64 0
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %15, i32 %16, i8* %17)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"1020202020202\00"
@.str.1 = [7 x i8] c"%*.*s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [10 x i8]
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 (i8*, ...) bitcast (i32 (...)* @atoi to i32 (i8*, ...)*)(i8* %6)
%8 = sext i32 %7 to i64
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %7, i32 %7, i8* %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EVP_sha512();
unsigned char *crypto_hash(unsigned char const *, size_t, size_t *,
                           int /*<<< orphan*/);
unsigned char *crypto_sha512(const unsigned char *bytes, size_t len,
                             size_t *olen) {
  return crypto_hash(bytes, len, olen, EVP_sha512());
}


x86 assembly (clang, -O0):
<crypto_sha512>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    $0x0,%al
call   1040 <EVP_sha512@plt>
mov    -0x30(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    %eax,%ecx
call   1030 <crypto_hash@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crypto_sha512>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <EVP_sha512@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
mov    %eax,%ecx
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <crypto_hash@plt>

LLVM IR (-O0):
define i8* @crypto_sha512(i8* %0, i64 %1, i64* %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64*
store i8* %0, i8** %4
store i64 %1, i64* %5
store i64* %2, i64** %6
%7 = load i8*, i8** %4
%8 = load i64, i64* %5
%9 = load i64*, i64** %6
%10 = call i32 (...) @EVP_sha512()
%11 = call i8* @crypto_hash(i8* %7, i64 %8, i64* %9, i32 %10)
ret i8* %11
}

LLVM IR (-O2):
define i8* @crypto_sha512(i8* %0, i64 %1, i64* %2) {
%4 = tail call i32 (...) @EVP_sha512()
%5 = tail call i8* @crypto_hash(i8* %0, i64 %1, i64* %2, i32 %4)
ret i8* %5
}
long double rintl(long double x) {
  long double retval = 0.0L;
  __asm__ __volatile__("frndint;" : "=t"(retval) : "0"(x));
  return retval;
}


x86 assembly (clang, -O0):
<rintl>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldz
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
frndint
fstpt  -0x20(%rbp)
fldt   -0x20(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rintl>:
fldt   0x8(%rsp)
frndint
ret

LLVM IR (-O0):
define x86_fp80 @rintl(x86_fp80 %0) {
%2 = alloca x86_fp80
%3 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
store x86_fp80 0xK00000000000000000000, x86_fp80* %3
%4 = load x86_fp80, x86_fp80* %2
%5 = call x86_fp80 asm sideeffect "frndint;", "={st},0,~{dirflag},~{fpsr},~{flags}"(x86_fp80 %4)
store x86_fp80 %5, x86_fp80* %3
%6 = load x86_fp80, x86_fp80* %3
ret x86_fp80 %6
}

LLVM IR (-O2):
define x86_fp80 @rintl(x86_fp80 %0) {
%2 = tail call x86_fp80 asm sideeffect "frndint;", "={st},0,~{dirflag},~{fpsr},~{flags}"(x86_fp80 %0)
ret x86_fp80 %2
}
/* Variables and functions */
int /*<<< orphan*/ UINT_MAX;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ sleep(int /*<<< orphan*/);
void go_dormant(int sock) {
  close(sock);
  for (;;)
    sleep(UINT_MAX);
}


x86 assembly (clang, -O0):
<go_dormant>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
call   1040 <sleep@plt>
jmp    1133 <go_dormant+0x13>

x86 assembly (clang, -O2):
<go_dormant>:
push   %rbx
call   1030 <close@plt>
mov    0x2ebb(%rip),%rbx
nopl   (%rax)
mov    (%rbx),%edi
call   1040 <sleep@plt>
jmp    1130 <go_dormant+0x10>

LLVM IR (-O0):
@UINT_MAX = global i32 0
define void @go_dormant(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @close(i32 %3)
br label %5
5: ; preds = %5, %1
%6 = load i32, i32* @UINT_MAX
%7 = call i32 @sleep(i32 %6)
br label %5
}

LLVM IR (-O2):
@UINT_MAX = global i32 0
define void @go_dormant(i32 %0) {
%2 = tail call i32 @close(i32 %0)
br label %3
3: ; preds = %3, %1
%4 = load i32, i32* @UINT_MAX
%5 = tail call i32 @sleep(i32 %4)
br label %3
}
int test_imm_04int64_highword_mem(long long *val) {
  return ((*val >> 32) & (0x04 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_04int64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 17179869184
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void foo248() {}


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

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

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

LLVM IR (-O2):
define void @foo248() {
ret void
}
float TH_lerpf(float a, float b, float weight) { return a + weight * (b - a); }


x86 assembly (clang, -O0):
<TH_lerpf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
movss  -0x8(%rbp),%xmm2
subss  -0x4(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<TH_lerpf>:
subss  %xmm0,%xmm1
mulss  %xmm2,%xmm1
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @TH_lerpf(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %6
%9 = load float, float* %5
%10 = load float, float* %4
%11 = fsub float %9, %10
%12 = call float @llvm.fmuladd.f32(float %8, float %11, float %7)
ret float %12
}

LLVM IR (-O2):
define float @TH_lerpf(float %0, float %1, float %2) {
%4 = fsub float %1, %0
%5 = tail call float @llvm.fmuladd.f32(float %2, float %4, float %0)
ret float %5
}
/* Variables and functions */
scalar_t__ getpid();
size_t GetMagickThreadSignature(void) { return ((size_t)getpid()); }


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

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

LLVM IR (-O0):
define i64 @GetMagickThreadSignature() {
%1 = call i64 (...) @getpid()
ret i64 %1
}

LLVM IR (-O2):
define i64 @GetMagickThreadSignature() {
%1 = tail call i64 (...) @getpid()
ret i64 %1
}
/* Type definitions */
typedef int uint32_t;
typedef scalar_t__ ui32Base;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
int _PWMGenValid(int);
void PWMGenEnable(uint32_t ui32Base, uint32_t ui32Gen) {
  ASSERT((ui32Base == 0x40028000) || (ui32Base == 0x40029000));
  ASSERT(_PWMGenValid(ui32Gen));
  (*((volatile uint32_t *)(((ui32Base) + (ui32Gen)) + 0x00000000))) |=
      0x00000001;
}


x86 assembly (clang, -O0):
<PWMGenEnable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x1,%al
cmpl   $0x40028000,-0x4(%rbp)
mov    %al,-0x9(%rbp)
je     114d <PWMGenEnable+0x2d>
cmpl   $0x40029000,-0x4(%rbp)
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <ASSERT@plt>
mov    -0x8(%rbp),%edi
call   1030 <_PWMGenValid@plt>
mov    %eax,%edi
call   1040 <ASSERT@plt>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    $0x0,%eax
cltq
mov    (%rax),%ecx
or     $0x1,%ecx
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PWMGenEnable>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    %edi,%eax
and    $0xffffefff,%eax
xor    %edi,%edi
cmp    $0x40028000,%eax
sete   %dil
call   1040 <ASSERT@plt>
mov    %ebx,%edi
call   1030 <_PWMGenValid@plt>
mov    %eax,%edi
call   1040 <ASSERT@plt>
movslq %ebx,%rax
movslq %ebp,%rcx
orl    $0x1,(%rax,%rcx,1)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @PWMGenEnable(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 = icmp eq i32 %5, 1073905664
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 1073909760
br label %10
10: ; preds = %7, %2
%11 = phi i1 [ true, %2 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
%13 = call i32 @ASSERT(i32 %12)
%14 = load i32, i32* %4
%15 = call i32 @_PWMGenValid(i32 %14)
%16 = call i32 @ASSERT(i32 %15)
%17 = load i32, i32* %3
%18 = load i32, i32* %4
%19 = add nsw i32 %17, %18
%20 = add nsw i32 %19, 0
%21 = sext i32 %20 to i64
%22 = inttoptr i64 %21 to i32*
%23 = load volatile i32, i32* %22
%24 = or i32 %23, 1
store volatile i32 %24, i32* %22
ret void
}

LLVM IR (-O2):
define void @PWMGenEnable(i32 %0, i32 %1) {
%3 = and i32 %0, -4097
%4 = icmp eq i32 %3, 1073905664
%5 = zext i1 %4 to i32
%6 = tail call i32 @ASSERT(i32 %5)
%7 = tail call i32 @_PWMGenValid(i32 %1)
%8 = tail call i32 @ASSERT(i32 %7)
%9 = add nsw i32 %1, %0
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %10 to i32*
%12 = load volatile i32, i32* %11
%13 = or i32 %12, 1
store volatile i32 %13, i32* %11
ret void
}
/* Variables and functions */
double fabs(double);
int elems_neq(double a, double b) {
  if (fabs((double)(a - b) / (double)a) > 1.e-7)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<elems_neq>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
movaps 0xeec(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  0xed0(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1146 <elems_neq+0x46>
movl   $0x1,-0x4(%rbp)
jmp    114d <elems_neq+0x4d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<elems_neq>:
movapd %xmm0,%xmm2
subsd  %xmm1,%xmm2
divsd  %xmm0,%xmm2
andpd  0xeec(%rip),%xmm2
xor    %eax,%eax
ucomisd 0xef2(%rip),%xmm2
seta   %al
ret

LLVM IR (-O0):
define i32 @elems_neq(double %0, double %1) {
%3 = alloca i32
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %4
%7 = load double, double* %5
%8 = fsub double %6, %7
%9 = load double, double* %4
%10 = fdiv double %8, %9
%11 = call double @llvm.fabs.f64(double %10)
%12 = fcmp ogt double %11, 0x3E7AD7F29ABCAF48
br i1 %12, label %13, label %14
13: ; preds = %2
store i32 1, i32* %3
br label %15
14: ; preds = %2
store i32 0, i32* %3
br label %15
15: ; preds = %14, %13
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @elems_neq(double %0, double %1) {
%3 = fsub double %0, %1
%4 = fdiv double %3, %0
%5 = tail call double @llvm.fabs.f64(double %4)
%6 = fcmp ogt double %5, 0x3E7AD7F29ABCAF48
%7 = zext i1 %6 to i32
ret i32 %7
}
int log2_int32(unsigned num) { return 31 - __builtin_clz(num); }


x86 assembly (clang, -O0):
<log2_int32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
bsr    %eax,%ecx
xor    $0x1f,%ecx
mov    $0x1f,%eax
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<log2_int32>:
bsr    %edi,%eax
ret

LLVM IR (-O0):
define i32 @log2_int32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @llvm.ctlz.i32(i32 %3, i1 true)
%5 = sub nsw i32 31, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @log2_int32(i32 %0) {
%2 = tail call i32 @llvm.ctlz.i32(i32 %0, i1 true)
%3 = xor i32 %2, 31
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ floor(double);
long iRound(int /*<<< orphan*/);
long int iFloor(double f) { return iRound(floor(f)); }


x86 assembly (clang, -O0):
<iFloor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <floor@plt>
mov    %eax,%edi
call   1030 <iRound@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iFloor>:
push   %rax
call   1040 <floor@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <iRound@plt>

LLVM IR (-O0):
define i64 @iFloor(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @floor(double %3)
%5 = call i64 @iRound(i32 %4)
ret i64 %5
}

LLVM IR (-O2):
define i64 @iFloor(double %0) {
%2 = tail call i32 @floor(double %0)
%3 = tail call i64 @iRound(i32 %2)
ret i64 %3
}
void clear_page_q(void *page) {
  asm volatile("movl $4096/8,%%ecx\n\t"
               "xorl %%eax,%%eax\n\t"
               "rep stosq\n\t" ::"D"(page));
}


x86 assembly (clang, -O0):
<clear_page_q>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x200,%ecx
xor    %eax,%eax
rep stos %rax,%es:(%rdi)
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_page_q>:
mov    $0x200,%ecx
xor    %eax,%eax
rep stos %rax,%es:(%rdi)
ret

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

LLVM IR (-O2):
define void @clear_page_q(i8* %0) {
tail call void asm sideeffect "movl $$4096/8,%ecx\0A\09xorl %eax,%eax\0A\09rep stosq\0A\09", "{di},~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret void
}
void d(char *b) { __builtin_memset(b, 0, 400); }


x86 assembly (clang, -O0):
<d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x190,%edx
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<d>:
mov    $0x190,%edx
xor    %esi,%esi
jmp    1030 <memset@plt>

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

LLVM IR (-O2):
define void @d(i8* nocapture writeonly %0) {
tail call void @llvm.memset.p0i8.i64(i8* align 1 dereferenceable(400) %0, i8 0, i64 400, i1 false)
ret void
}
void xen_balloon_init(void) {}


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

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

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

LLVM IR (-O2):
define void @xen_balloon_init() {
ret void
}
/* Variables and functions */
int fabs(double);
int /*<<< orphan*/ isfinite(double);
int equal(double a, double b) {
  if (!isfinite(a) || !isfinite(b))
    return 0;
  return fabs(a - b) < 1e-5;
  if (a == 0 && b == 0)
    return 1;
}


x86 assembly (clang, -O0):
<equal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <isfinite@plt>
cmp    $0x0,%eax
je     1158 <equal+0x38>
movsd  -0x18(%rbp),%xmm0
call   1040 <isfinite@plt>
cmp    $0x0,%eax
jne    1164 <equal+0x44>
movl   $0x0,-0x4(%rbp)
jmp    118e <equal+0x6e>
movsd  -0x10(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
call   1030 <fabs@plt>
cvtsi2sd %eax,%xmm1
movsd  0xe81(%rip),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<equal>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm1,(%rsp)
movsd  %xmm0,0x8(%rsp)
call   1040 <isfinite@plt>
xor    %ebx,%ebx
test   %eax,%eax
je     1160 <equal+0x40>
movsd  (%rsp),%xmm0
call   1040 <isfinite@plt>
test   %eax,%eax
je     1160 <equal+0x40>
movsd  0x8(%rsp),%xmm0
subsd  (%rsp),%xmm0
call   1030 <fabs@plt>
xor    %ebx,%ebx
test   %eax,%eax
setle  %bl
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @equal(double %0, double %1) {
%3 = alloca i32
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %4
%7 = call i32 @isfinite(double %6)
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load double, double* %5
%11 = call i32 @isfinite(double %10)
%12 = icmp ne i32 %11, 0
br i1 %12, label %14, label %13
13: ; preds = %9, %2
store i32 0, i32* %3
br label %22
14: ; preds = %9
%15 = load double, double* %4
%16 = load double, double* %5
%17 = fsub double %15, %16
%18 = call i32 @fabs(double %17)
%19 = sitofp i32 %18 to double
%20 = fcmp olt double %19, 1.000000e-05
%21 = zext i1 %20 to i32
store i32 %21, i32* %3
br label %22
22: ; preds = %14, %13
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
define i32 @equal(double %0, double %1) {
%3 = tail call i32 @isfinite(double %0)
%4 = icmp eq i32 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2
%6 = tail call i32 @isfinite(double %1)
%7 = icmp eq i32 %6, 0
br i1 %7, label %13, label %8
8: ; preds = %5
%9 = fsub double %0, %1
%10 = tail call i32 @fabs(double %9)
%11 = icmp slt i32 %10, 1
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %2, %5, %8
%14 = phi i32 [ %12, %8 ], [ 0, %5 ], [ 0, %2 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ brc(int, char);
int /*<<< orphan*/ extra_padding(int);
void cud(int pn) {
  brc(pn, 'B');
  extra_padding(2);
}


x86 assembly (clang, -O0):
<cud>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x42,%esi
call   1040 <brc@plt>
mov    $0x2,%edi
call   1030 <extra_padding@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cud>:
push   %rax
mov    $0x42,%esi
call   1040 <brc@plt>
mov    $0x2,%edi
pop    %rax
jmp    1030 <extra_padding@plt>

LLVM IR (-O0):
define void @cud(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @brc(i32 %3, i8 signext 66)
%5 = call i32 @extra_padding(i32 2)
ret void
}

LLVM IR (-O2):
define void @cud(i32 %0) {
%2 = tail call i32 @brc(i32 %0, i8 signext 66)
%3 = tail call i32 @extra_padding(i32 2)
ret void
}
char base64_encode_value(char value_in) {
  static const char *encoding =
      "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
  return value_in > 63 ? '=' : encoding[(int)value_in];
}


x86 assembly (clang, -O0):
<base64_encode_value>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x3f,%eax
jle    1124 <base64_encode_value+0x24>
mov    $0x3d,%eax
mov    %eax,-0x8(%rbp)
jmp    1139 <base64_encode_value+0x39>
mov    0x2ef5(%rip),%rax
movsbl -0x1(%rbp),%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<base64_encode_value>:
mov    $0x3d,%al
cmp    $0x3f,%dil
jg     1116 <base64_encode_value+0x16>
movsbq %dil,%rax
lea    0xeed(%rip),%rcx
mov    (%rax,%rcx,1),%al
ret

LLVM IR (-O0):
@base64_encode_value.encoding = internal global i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i32 0, i32 0)
@.str = [65 x i8] c"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\00"
define signext i8 @base64_encode_value(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sgt i32 %4, 63
br i1 %5, label %6, label %7
6: ; preds = %1
br label %15
7: ; preds = %1
%8 = load i8*, i8** @base64_encode_value.encoding
%9 = load i8, i8* %2
%10 = sext i8 %9 to i32
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %8, i64 %11
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
br label %15
15: ; preds = %7, %6
%16 = phi i32 [ 61, %6 ], [ %14, %7 ]
%17 = trunc i32 %16 to i8
ret i8 %17
}

LLVM IR (-O2):
@.str = [65 x i8] c"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\00"
define signext i8 @base64_encode_value(i8 signext %0) {
%2 = icmp sgt i8 %0, 63
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = sext i8 %0 to i64
%5 = getelementptr inbounds [65 x i8], [65 x i8]* @.str, i64 0, i64 %4
%6 = load i8, i8* %5
br label %7
7: ; preds = %1, %3
%8 = phi i8 [ %6, %3 ], [ 61, %1 ]
ret i8 %8
}
/* Variables and functions */
bool selectDefault(const char *name) { return name[0] != '.'; }


x86 assembly (clang, -O0):
<selectDefault>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<selectDefault>:
xor    %eax,%eax
cmpb   $0x2e,(%rdi)
setne  %al
ret

LLVM IR (-O0):
define i32 @selectDefault(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 ne i32 %6, 46
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @selectDefault(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp ne i8 %2, 46
%4 = zext i1 %3 to i32
ret i32 %4
}
unsigned bit(int n) {
  unsigned result = 1u << n;
  return result;
}


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

x86 assembly (clang, -O2):
<bit>:
mov    %edi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @bit(i32 %0) {
%2 = shl nuw i32 1, %0
ret i32 %2
}
/* Variables and functions */
int code_table_3_1(unsigned char **);
int flag_table_3_10(unsigned char **sec) {
  unsigned char *gds;
  gds = sec[3];
  switch (code_table_3_1(sec)) {
  case 100:
    return gds[33];
  }
  return -1;
}


x86 assembly (clang, -O0):
<flag_table_3_10>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <code_table_3_1@plt>
sub    $0x64,%eax
jne    114f <flag_table_3_10+0x3f>
jmp    113f <flag_table_3_10+0x2f>
mov    -0x18(%rbp),%rax
movzbl 0x21(%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1156 <flag_table_3_10+0x46>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flag_table_3_10>:
push   %rbx
mov    0x18(%rdi),%rbx
call   1030 <code_table_3_1@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
cmp    $0x64,%ecx
jne    112a <flag_table_3_10+0x1a>
movzbl 0x21(%rbx),%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @flag_table_3_10(i8** %0) {
%2 = alloca i32
%3 = alloca i8**
%4 = alloca i8*
store i8** %0, i8*** %3
%5 = load i8**, i8*** %3
%6 = getelementptr inbounds i8*, i8** %5, i64 3
%7 = load i8*, i8** %6
store i8* %7, i8** %4
%8 = load i8**, i8*** %3
%9 = call i32 @code_table_3_1(i8** %8)
switch i32 %9, label %15 [
i32 100, label %10
]
10: ; preds = %1
%11 = load i8*, i8** %4
%12 = getelementptr inbounds i8, i8* %11, i64 33
%13 = load i8, i8* %12
%14 = zext i8 %13 to i32
store i32 %14, i32* %2
br label %16
15: ; preds = %1
store i32 -1, i32* %2
br label %16
16: ; preds = %15, %10
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
define i32 @flag_table_3_10(i8** %0) {
%2 = getelementptr inbounds i8*, i8** %0, i64 3
%3 = load i8*, i8** %2
%4 = tail call i32 @code_table_3_1(i8** %0)
%5 = icmp eq i32 %4, 100
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = getelementptr inbounds i8, i8* %3, i64 33
%8 = load i8, i8* %7
%9 = zext i8 %8 to i32
br label %10
10: ; preds = %1, %6
%11 = phi i32 [ %9, %6 ], [ -1, %1 ]
ret i32 %11
}
/* Variables and functions */
char *adjust_unit(double *);
int /*<<< orphan*/ printf(char *, char const *, double, char const *, int);
void report_order(const char *prefix, int order) {
  double f = (1ULL << order);
  const char *unit = adjust_unit(&f);
  printf("%s %.2f %s (2^%i Bytes)\n", prefix, f, unit, order);
}


x86 assembly (clang, -O0):
<report_order>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%cl
mov    $0x1,%eax
shl    %cl,%rax
movq   %rax,%xmm0
movaps 0xeba(%rip),%xmm1
punpckldq %xmm1,%xmm0
movapd 0xebe(%rip),%xmm1
subpd  %xmm1,%xmm0
movaps %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
lea    -0x18(%rbp),%rdi
call   1040 <adjust_unit@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rsi
movsd  -0x18(%rbp),%xmm0
mov    -0x20(%rbp),%rdx
mov    -0xc(%rbp),%ecx
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<report_order>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    $0x1,%eax
mov    %ebx,%ecx
shl    %cl,%rax
movq   %rax,%xmm0
punpckldq 0xec3(%rip),%xmm0
subpd  0xecb(%rip),%xmm0
mov    %rdi,%r14
movapd %xmm0,%xmm1
unpckhpd %xmm0,%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,(%rsp)
mov    %rsp,%rdi
call   1040 <adjust_unit@plt>
movsd  (%rsp),%xmm0
lea    0xeb3(%rip),%rdi
mov    %r14,%rsi
mov    %rax,%rdx
mov    %ebx,%ecx
call   1030 <printf@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [25 x i8] c"%s %.2f %s (2^%i Bytes)\0A\00"
define void @report_order(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca double
%6 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = zext i32 %7 to i64
%9 = shl i64 1, %8
%10 = uitofp i64 %9 to double
store double %10, double* %5
%11 = call i8* @adjust_unit(double* %5)
store i8* %11, i8** %6
%12 = load i8*, i8** %3
%13 = load double, double* %5
%14 = load i8*, i8** %6
%15 = load i32, i32* %4
%16 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %12, double %13, i8* %14, i32 %15)
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"%s %.2f %s (2^%i Bytes)\0A\00"
define void @report_order(i8* %0, i32 %1) {
%3 = alloca double
%4 = bitcast double* %3 to i8*
%5 = zext i32 %1 to i64
%6 = shl nuw i64 1, %5
%7 = uitofp i64 %6 to double
store double %7, double* %3
%8 = call i8* @adjust_unit(double* %3)
%9 = load double, double* %3
%10 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %0, double %9, i8* %8, i32 %1)
ret void
}
/* Variables and functions */
void *callback(void *v) {
  double d = 0.0f;
  int i = d;
  while (i++)
    ;
  return NULL;
}


x86 assembly (clang, -O0):
<callback>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
cvttsd2si -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x14(%rbp)
cmp    $0x0,%eax
je     1131 <callback+0x31>
jmp    1118 <callback+0x18>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @callback(i8* %0) {
%2 = alloca i8*
%3 = alloca double
%4 = alloca i32
store i8* %0, i8** %2
store double 0.000000e+00, double* %3
%5 = load double, double* %3
%6 = fptosi double %5 to i32
store i32 %6, i32* %4
br label %7
7: ; preds = %11, %1
%8 = load i32, i32* %4
%9 = add nsw i32 %8, 1
store i32 %9, i32* %4
%10 = icmp ne i32 %8, 0
br i1 %10, label %11, label %12
11: ; preds = %7
br label %7
12: ; preds = %7
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @callback(i8* nocapture readnone %0) {
ret i8* null
}
unsigned int bar(void) { return 32768; }


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

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

LLVM IR (-O0):
define i32 @bar() {
ret i32 32768
}

LLVM IR (-O2):
define i32 @bar() {
ret i32 32768
}
/* Variables and functions */
int /*<<< orphan*/ sub_fun(char *);
int sub_fun2(int, int);
int fun(char x) {
  int y;
  (void)y;
  x = x + 1;
  sub_fun(((&x)));
  sub_fun2(10, 20);
  y = sub_fun2(10, 20);
  ;
  x = x + 1;
  return x;
}


x86 assembly (clang, -O0):
<fun>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x1,%eax
mov    %al,-0x1(%rbp)
lea    -0x1(%rbp),%rdi
call   1030 <sub_fun@plt>
mov    $0xa,%edi
mov    $0x14,%esi
call   1040 <sub_fun2@plt>
mov    $0xa,%edi
mov    $0x14,%esi
call   1040 <sub_fun2@plt>
mov    %eax,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x1,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun>:
push   %rax
add    $0x1,%dil
mov    %dil,0x7(%rsp)
lea    0x7(%rsp),%rdi
call   1030 <sub_fun@plt>
mov    $0xa,%edi
mov    $0x14,%esi
call   1040 <sub_fun2@plt>
mov    $0xa,%edi
mov    $0x14,%esi
call   1040 <sub_fun2@plt>
mov    0x7(%rsp),%al
add    $0x1,%al
movsbl %al,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @fun(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
%4 = load i32, i32* %3
%5 = load i8, i8* %2
%6 = sext i8 %5 to i32
%7 = add nsw i32 %6, 1
%8 = trunc i32 %7 to i8
store i8 %8, i8* %2
%9 = call i32 @sub_fun(i8* %2)
%10 = call i32 @sub_fun2(i32 10, i32 20)
%11 = call i32 @sub_fun2(i32 10, i32 20)
store i32 %11, i32* %3
%12 = load i8, i8* %2
%13 = sext i8 %12 to i32
%14 = add nsw i32 %13, 1
%15 = trunc i32 %14 to i8
store i8 %15, i8* %2
%16 = load i8, i8* %2
%17 = sext i8 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
define i32 @fun(i8 signext %0) {
%2 = alloca i8
%3 = add i8 %0, 1
store i8 %3, i8* %2
%4 = call i32 @sub_fun(i8* %2)
%5 = call i32 @sub_fun2(i32 10, i32 20)
%6 = call i32 @sub_fun2(i32 10, i32 20)
%7 = load i8, i8* %2
%8 = add i8 %7, 1
%9 = sext i8 %8 to i32
ret i32 %9
}
int isalpha(int ch) {
  return (ch >= 'A' && ch <= 'Z') || (ch >= 'a' && ch <= 'z');
}


x86 assembly (clang, -O0):
<isalpha>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x41,-0x4(%rbp)
jl     1120 <isalpha+0x20>
mov    $0x1,%al
cmpl   $0x5a,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    113f <isalpha+0x3f>
xor    %eax,%eax
cmpl   $0x61,-0x4(%rbp)
mov    %al,-0x6(%rbp)
jl     1139 <isalpha+0x39>
cmpl   $0x7a,-0x4(%rbp)
setle  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isalpha>:
and    $0xffffffdf,%edi
add    $0xffffffbf,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isalpha(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 65
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 90
br i1 %7, label %16, label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = icmp sge i32 %9, 97
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp sle i32 %12, 122
br label %14
14: ; preds = %11, %8
%15 = phi i1 [ false, %8 ], [ %13, %11 ]
br label %16
16: ; preds = %14, %5
%17 = phi i1 [ true, %5 ], [ %15, %14 ]
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @isalpha(i32 %0) {
%2 = and i32 %0, -33
%3 = add i32 %2, -65
%4 = icmp ult i32 %3, 26
%5 = zext i1 %4 to i32
ret i32 %5
}
__attribute__((no, noclone)) double trunc(double x) { return x; }


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

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

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

LLVM IR (-O2):
define double @trunc(double returned %0) {
ret double %0
}
void ExttAliasAuxTable(void) {}


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

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

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

LLVM IR (-O2):
define void @ExttAliasAuxTable() {
ret void
}
char *str1(char *p) {
  unsigned char i;
  while (*p++ == 0x20)
    ;
  p--;
  while (*p++ == 0x09)
    ;
  p--;
  return p;
}


x86 assembly (clang, -O0):
<str1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
cmp    $0x20,%eax
jne    1128 <str1+0x28>
jmp    1108 <str1+0x8>
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
cmp    $0x9,%eax
jne    1154 <str1+0x54>
jmp    1134 <str1+0x34>
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<str1>:
add    $0xffffffffffffffff,%rdi
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movzbl 0x1(%rdi),%eax
add    $0x1,%rdi
cmp    $0x20,%al
je     1110 <str1+0x10>
cmp    $0x9,%al
jne    112e <str1+0x2e>
lea    0x1(%rdi),%rax
cmpb   $0x9,0x1(%rdi)
mov    %rax,%rdi
je     1120 <str1+0x20>
ret
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @str1(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 %11 [
i8 32, label %2
i8 9, label %6
]
6: ; preds = %2, %6
%7 = phi i8* [ %8, %6 ], [ %3, %2 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 9
br i1 %10, label %6, label %11
11: ; preds = %2, %6
%12 = phi i8* [ %8, %6 ], [ %3, %2 ]
ret i8* %12
}
/* Variables and functions */
int /*<<< orphan*/ ERR_load_crypto_strings();
int /*<<< orphan*/ OpenSSL_add_all_algorithms();
int /*<<< orphan*/ SSL_library_init();
int /*<<< orphan*/ SSL_load_error_strings();
void initSSL() {
  SSL_library_init();
  OpenSSL_add_all_algorithms();
  SSL_load_error_strings();
  ERR_load_crypto_strings();
}


x86 assembly (clang, -O0):
<initSSL>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <SSL_library_init@plt>
mov    $0x0,%al
call   1040 <OpenSSL_add_all_algorithms@plt>
mov    $0x0,%al
call   1050 <SSL_load_error_strings@plt>
mov    $0x0,%al
call   1060 <ERR_load_crypto_strings@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<initSSL>:
push   %rax
xor    %eax,%eax
call   1030 <SSL_library_init@plt>
xor    %eax,%eax
call   1040 <OpenSSL_add_all_algorithms@plt>
xor    %eax,%eax
call   1050 <SSL_load_error_strings@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <ERR_load_crypto_strings@plt>

LLVM IR (-O0):
define void @initSSL() {
%1 = call i32 (...) @SSL_library_init()
%2 = call i32 (...) @OpenSSL_add_all_algorithms()
%3 = call i32 (...) @SSL_load_error_strings()
%4 = call i32 (...) @ERR_load_crypto_strings()
ret void
}

LLVM IR (-O2):
define void @initSSL() {
%1 = tail call i32 (...) @SSL_library_init()
%2 = tail call i32 (...) @OpenSSL_add_all_algorithms()
%3 = tail call i32 (...) @SSL_load_error_strings()
%4 = tail call i32 (...) @ERR_load_crypto_strings()
ret void
}
short f4_get_short() {
  short r = -22;
  return r;
}


x86 assembly (clang, -O0):
<f4_get_short>:
push   %rbp
mov    %rsp,%rbp
movw   $0xffea,-0x2(%rbp)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4_get_short>:
mov    $0xffea,%ax
ret

LLVM IR (-O0):
define signext i16 @f4_get_short() {
%1 = alloca i16
store i16 -22, i16* %1
%2 = load i16, i16* %1
ret i16 %2
}

LLVM IR (-O2):
define signext i16 @f4_get_short() {
ret i16 -22
}
void ext_exp2bol_exp() {}


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

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

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

LLVM IR (-O2):
define void @ext_exp2bol_exp() {
ret void
}
int xorbit(int word, int bit) { return (word ^ (1 << bit)); }


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

x86 assembly (clang, -O2):
<xorbit>:
mov    %edi,%eax
btc    %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @xorbit(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = xor i32 %3, %0
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
void write_line(FILE **cfg_file, char *line) {
  fprintf(*cfg_file, "%s\n", line);
}


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

x86 assembly (clang, -O2):
<write_line>:
mov    %rsi,%rdx
mov    (%rdi),%rdi
lea    0xee3(%rip),%rsi
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @write_line(i32** nocapture %0, i8* %1) {
%3 = load i32*, i32** %0
%4 = tail call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ kernelpanic(char *);
void ns_da() { kernelpanic("normal world DA\n"); }


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"normal world DA\0A\00"
define void @ns_da() {
%1 = call i32 @kernelpanic(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"normal world DA\0A\00"
define void @ns_da() {
%1 = tail call i32 @kernelpanic(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bftmap_example();
int /*<<< orphan*/ bftset_example();
int main() {
  bftmap_example();
  bftset_example();
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @bftmap_example()
%2 = tail call i32 (...) @bftset_example()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ test_and_verify(int);
void test_brightness(int max) {
  test_and_verify(0);
  test_and_verify(max);
  test_and_verify(max / 2);
}


x86 assembly (clang, -O0):
<test_brightness>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %edi,%edi
call   1030 <test_and_verify@plt>
mov    -0x4(%rbp),%edi
call   1030 <test_and_verify@plt>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <test_and_verify@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_brightness>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
call   1030 <test_and_verify@plt>
mov    %ebx,%edi
call   1030 <test_and_verify@plt>
mov    %ebx,%edi
shr    $0x1f,%edi
add    %ebx,%edi
sar    %edi
pop    %rbx
jmp    1030 <test_and_verify@plt>

LLVM IR (-O0):
define void @test_brightness(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @test_and_verify(i32 0)
%4 = load i32, i32* %2
%5 = call i32 @test_and_verify(i32 %4)
%6 = load i32, i32* %2
%7 = sdiv i32 %6, 2
%8 = call i32 @test_and_verify(i32 %7)
ret void
}

LLVM IR (-O2):
define void @test_brightness(i32 %0) {
%2 = tail call i32 @test_and_verify(i32 0)
%3 = tail call i32 @test_and_verify(i32 %0)
%4 = sdiv i32 %0, 2
%5 = tail call i32 @test_and_verify(i32 %4)
ret void
}
char *hash_plugin_detailed(void) {
  return ("desunix - DES(Unix) plugin\n"
          "------------------------\n"
          "Use this module to crack old crypt() passwords\n"
          "Input should be in form: \'user:hash\' or just hash. non-apr1 "
          ".htpasswd files are acceptable\n"
          "Known software that uses this password hashing method:\n"
          "Apache 1.x, Apache 2.x, old Unix boxes, WWWThreads\n"
          "\nAuthor: Milen Rangelov <gat3way@gat3way.eu>\n");
}


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

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

LLVM IR (-O0):
@.str = [342 x i8] c"desunix - DES(Unix) plugin\0A------------------------\0AUse this module to crack old crypt() passwords\0AInput should be in form: 'user:hash' or just hash. non-apr1 .htpasswd files are acceptable\0AKnown software that uses this password hashing method:\0AApache 1.x, Apache 2.x, old Unix boxes, WWWThreads\0A\0AAuthor: Milen Rangelov <gat3way@gat3way.eu>\0A\00"
define i8* @hash_plugin_detailed() {
ret i8* getelementptr inbounds ([342 x i8], [342 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [342 x i8] c"desunix - DES(Unix) plugin\0A------------------------\0AUse this module to crack old crypt() passwords\0AInput should be in form: 'user:hash' or just hash. non-apr1 .htpasswd files are acceptable\0AKnown software that uses this password hashing method:\0AApache 1.x, Apache 2.x, old Unix boxes, WWWThreads\0A\0AAuthor: Milen Rangelov <gat3way@gat3way.eu>\0A\00"
define i8* @hash_plugin_detailed() {
ret i8* getelementptr inbounds ([342 x i8], [342 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
void node_next_update(const uint8_t **str_ref, size_t *len) {
  ++*str_ref;
  --*len;
}


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

x86 assembly (clang, -O2):
<node_next_update>:
addq   $0x4,(%rdi)
addq   $0xffffffffffffffff,(%rsi)
ret

LLVM IR (-O0):
define void @node_next_update(i32** %0, i64* %1) {
%3 = alloca i32**
%4 = alloca i64*
store i32** %0, i32*** %3
store i64* %1, i64** %4
%5 = load i32**, i32*** %3
%6 = load i32*, i32** %5
%7 = getelementptr inbounds i32, i32* %6, i32 1
store i32* %7, i32** %5
%8 = load i64*, i64** %4
%9 = load i64, i64* %8
%10 = add i64 %9, -1
store i64 %10, i64* %8
ret void
}

LLVM IR (-O2):
define void @node_next_update(i32** nocapture %0, i64* nocapture %1) {
%3 = load i32*, i32** %0
%4 = getelementptr inbounds i32, i32* %3, i64 1
store i32* %4, i32** %0
%5 = load i64, i64* %1
%6 = add i64 %5, -1
store i64 %6, i64* %1
ret void
}
/* Variables and functions */
int dstrans(double const);
double df(double const x) { return 1 + dstrans((x + 1) / 2) * 2; }


x86 assembly (clang, -O0):
<df>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xee3(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  0xece(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <dstrans@plt>
shl    $0x1,%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<df>:
push   %rax
addsd  0xee7(%rip),%xmm0
mulsd  0xee7(%rip),%xmm0
call   1030 <dstrans@plt>
add    %eax,%eax
add    $0x1,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @df(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fadd double %3, 1.000000e+00
%5 = fdiv double %4, 2.000000e+00
%6 = call i32 @dstrans(double %5)
%7 = mul nsw i32 %6, 2
%8 = add nsw i32 1, %7
%9 = sitofp i32 %8 to double
ret double %9
}

LLVM IR (-O2):
define double @df(double %0) {
%2 = fadd double %0, 1.000000e+00
%3 = fmul double %2, 5.000000e-01
%4 = tail call i32 @dstrans(double %3)
%5 = shl nsw i32 %4, 1
%6 = or i32 %5, 1
%7 = sitofp i32 %6 to double
ret double %7
}