xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ getinfo_(long long *, long long *);
void GetInfo(int *num_atoms, int *num_states) {
  long long natoms64, nstates64;
  getinfo_(&natoms64, &nstates64);
  *num_atoms = natoms64;
  *num_states = nstates64;
}


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

x86 assembly (clang, -O2):
<GetInfo>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1030 <getinfo_@plt>
mov    0x10(%rsp),%eax
mov    %eax,(%rbx)
mov    0x8(%rsp),%eax
mov    %eax,(%r14)
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @GetInfo(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i64
%6 = alloca i64
store i32* %0, i32** %3
store i32* %1, i32** %4
%7 = call i32 @getinfo_(i64* %5, i64* %6)
%8 = load i64, i64* %5
%9 = trunc i64 %8 to i32
%10 = load i32*, i32** %3
store i32 %9, i32* %10
%11 = load i64, i64* %6
%12 = trunc i64 %11 to i32
%13 = load i32*, i32** %4
store i32 %12, i32* %13
ret void
}

LLVM IR (-O2):
define void @GetInfo(i32* nocapture writeonly %0, i32* nocapture writeonly %1) {
%3 = alloca i64
%4 = alloca i64
%5 = bitcast i64* %3 to i8*
%6 = bitcast i64* %4 to i8*
%7 = call i32 @getinfo_(i64* %3, i64* %4)
%8 = load i64, i64* %3
%9 = trunc i64 %8 to i32
store i32 %9, i32* %0
%10 = load i64, i64* %4
%11 = trunc i64 %10 to i32
store i32 %11, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int tlib2func() {
  printf("This is T2\n");
  return 2;
}


x86 assembly (clang, -O0):
<tlib2func>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tlib2func>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x2,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"This is T2\0A\00"
define i32 @tlib2func() {
%1 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 2
}

LLVM IR (-O2):
@str = [11 x i8] c"This is T2\00"
define i32 @tlib2func() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
ret i32 2
}
/* Variables and functions */
int log(long);
double BIC(double logLikelihood, int nParams, long nData, int chiSquareUsed) {
  double minustwo_logLikelihood, bic;
  if (chiSquareUsed)
    minustwo_logLikelihood = logLikelihood;
  else
    minustwo_logLikelihood = -2.0 * logLikelihood;
  bic = minustwo_logLikelihood + nParams * log(nData);
  return bic;
}


x86 assembly (clang, -O0):
<BIC>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     1140 <BIC+0x30>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    1152 <BIC+0x42>
movsd  0xeb8(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <log@plt>
movsd  -0x40(%rbp),%xmm0
mov    %eax,%ecx
mov    -0x34(%rbp),%eax
imul   %ecx,%eax
cvtsi2sd %eax,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BIC>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
test   %edx,%edx
jne    1123 <BIC+0x13>
mulsd  0xedd(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %rsi,%rdi
call   1030 <log@plt>
imul   %ebx,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @BIC(double %0, i32 %1, i64 %2, i32 %3) {
%5 = alloca double
%6 = alloca i32
%7 = alloca i64
%8 = alloca i32
%9 = alloca double
%10 = alloca double
store double %0, double* %5
store i32 %1, i32* %6
store i64 %2, i64* %7
store i32 %3, i32* %8
%11 = load i32, i32* %8
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %4
%14 = load double, double* %5
store double %14, double* %9
br label %18
15: ; preds = %4
%16 = load double, double* %5
%17 = fmul double -2.000000e+00, %16
store double %17, double* %9
br label %18
18: ; preds = %15, %13
%19 = load double, double* %9
%20 = load i32, i32* %6
%21 = load i64, i64* %7
%22 = call i32 @log(i64 %21)
%23 = mul nsw i32 %20, %22
%24 = sitofp i32 %23 to double
%25 = fadd double %19, %24
store double %25, double* %10
%26 = load double, double* %10
ret double %26
}

LLVM IR (-O2):
define double @BIC(double %0, i32 %1, i64 %2, i32 %3) {
%5 = icmp eq i32 %3, 0
%6 = fmul double %0, -2.000000e+00
%7 = select i1 %5, double %6, double %0
%8 = tail call i32 @log(i64 %2)
%9 = mul nsw i32 %8, %1
%10 = sitofp i32 %9 to double
%11 = fadd double %7, %10
ret double %11
}
double f3_prime(double x) { return 3.0 * x * x - 2.0 * x - 3.0; }


x86 assembly (clang, -O0):
<f3_prime>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
movsd  0xee5(%rip),%xmm1
mulsd  -0x8(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xeb1(%rip),%xmm1
subsd  %xmm1,%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @f3_prime(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double 3.000000e+00, %3
%5 = load double, double* %2
%6 = load double, double* %2
%7 = fmul double 2.000000e+00, %6
%8 = fneg double %7
%9 = call double @llvm.fmuladd.f64(double %4, double %5, double %8)
%10 = fsub double %9, 3.000000e+00
ret double %10
}

LLVM IR (-O2):
define double @f3_prime(double %0) {
%2 = fmul double %0, 3.000000e+00
%3 = fmul double %0, -2.000000e+00
%4 = tail call double @llvm.fmuladd.f64(double %2, double %0, double %3)
%5 = fadd double %4, -3.000000e+00
ret double %5
}
int test_imm_F1int64_midword_mem(long long *val) {
  return ((*val >> 16) & (0xF1 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_F1int64_midword_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, 16
%6 = and i64 %5, 241
%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_F1int64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 15794176
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void ft_strclr(char *s) {
  if (s) {
    while (*s)
      *s++ = '\0';
  }
}


x86 assembly (clang, -O0):
<ft_strclr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1141 <ft_strclr+0x41>
jmp    1118 <ft_strclr+0x18>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     113c <ft_strclr+0x3c>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x0,(%rax)
jmp    1118 <ft_strclr+0x18>
jmp    1141 <ft_strclr+0x41>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strclr>:
test   %rdi,%rdi
je     111d <ft_strclr+0x1d>
cmpb   $0x0,(%rdi)
je     111d <ft_strclr+0x1d>
add    $0x1,%rdi
xchg   %ax,%ax
movb   $0x0,-0x1(%rdi)
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <ft_strclr+0x10>
ret

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

LLVM IR (-O2):
define void @ft_strclr(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %3, %6
%7 = phi i8* [ %8, %6 ], [ %0, %3 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
store i8 0, i8* %7
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %6
11: ; preds = %6, %3, %1
ret void
}
int test_imm_5Duint8_reg(unsigned char val) {
  return ((val) & (-0x5D << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_5Duint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xffffffa3,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_5Duint8_reg>:
test   $0xa3,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_5Duint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -93
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void swap(int *arr, int index1, int index2) {
  int temp = arr[index1];
  arr[index1] = arr[index2];
  arr[index2] = temp;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
movslq %edx,%rdx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
ret

LLVM IR (-O0):
define void @swap(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** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = load i32, i32* %11
store i32 %12, i32* %7
%13 = load i32*, i32** %4
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
%18 = load i32*, i32** %4
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %18, i64 %20
store i32 %17, i32* %21
%22 = load i32, i32* %7
%23 = load i32*, i32** %4
%24 = load i32, i32* %6
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %23, i64 %25
store i32 %22, i32* %26
ret void
}

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t intlen(uint32_t x) {
  uint32_t len = 0;
  for (; x; x /= 10) {
    len++;
  }
  return len;
}


x86 assembly (clang, -O0):
<intlen>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1134 <intlen+0x34>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    110e <intlen+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<intlen>:
xor    %eax,%eax
test   %edi,%edi
je     1132 <intlen+0x32>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%eax
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rdi
add    %edx,%edi
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1110 <intlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @intlen(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = phi i32 [ %7, %3 ], [ %0, %1 ]
%6 = add nuw nsw i32 %4, 1
%7 = sdiv i32 %5, 10
%8 = add i32 %5, 9
%9 = icmp ult i32 %8, 19
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void exit_runloop() { abort(); }


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

x86 assembly (clang, -O2):
<exit_runloop>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @exit_runloop() {
%1 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define void @exit_runloop() {
%1 = tail call i32 (...) @abort()
unreachable
}
void g_thread_pool_free() {}


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

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

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

LLVM IR (-O2):
define void @g_thread_pool_free() {
ret void
}
/* Variables and functions */
int linkat(int /*<<< orphan*/, char *, int, char *, int /*<<< orphan*/);
int main(void) { return linkat(0, "a", 1, "b", 0); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %r8d,%r8d
lea    0xed7(%rip),%rsi
mov    $0x1,%edx
lea    0xecd(%rip),%rcx
mov    %r8d,%edi
call   1030 <linkat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
lea    0xee9(%rip),%rsi
lea    0xee4(%rip),%rcx
xor    %edi,%edi
mov    $0x1,%edx
xor    %r8d,%r8d
jmp    1030 <linkat@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"a\00"
@.str.1 = [2 x i8] c"b\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @linkat(i32 0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 0)
ret i32 %2
}

LLVM IR (-O2):
@.str = [2 x i8] c"a\00"
@.str.1 = [2 x i8] c"b\00"
define i32 @main() {
%1 = tail call i32 @linkat(i32 0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 0)
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ RSA;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ ASN1_ITEM_rptr(int /*<<< orphan*/);
int ASN1_item_i2d_fp(int /*<<< orphan*/, int /*<<< orphan*/ *,
                     int /*<<< orphan*/ *);
int /*<<< orphan*/ RSAPublicKey;
int i2d_RSAPublicKey_fp(FILE *fp, RSA *rsa) {
  return ASN1_item_i2d_fp(ASN1_ITEM_rptr(RSAPublicKey), fp, rsa);
}


x86 assembly (clang, -O0):
<i2d_RSAPublicKey_fp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
call   1030 <ASN1_ITEM_rptr@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <ASN1_item_i2d_fp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2d_RSAPublicKey_fp>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    0x2ec7(%rip),%rax
mov    (%rax),%edi
call   1030 <ASN1_ITEM_rptr@plt>
mov    %eax,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <ASN1_item_i2d_fp@plt>

LLVM IR (-O0):
@RSAPublicKey = global i32 0
define i32 @i2d_RSAPublicKey_fp(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32, i32* @RSAPublicKey
%6 = call i32 @ASN1_ITEM_rptr(i32 %5)
%7 = load i32*, i32** %3
%8 = load i32*, i32** %4
%9 = call i32 @ASN1_item_i2d_fp(i32 %6, i32* %7, i32* %8)
ret i32 %9
}

LLVM IR (-O2):
@RSAPublicKey = global i32 0
define i32 @i2d_RSAPublicKey_fp(i32* %0, i32* %1) {
%3 = load i32, i32* @RSAPublicKey
%4 = tail call i32 @ASN1_ITEM_rptr(i32 %3)
%5 = tail call i32 @ASN1_item_i2d_fp(i32 %4, i32* %0, i32* %1)
ret i32 %5
}
void swap_colors(unsigned char *a, unsigned char *b) {
  unsigned char t = *a;
  *a = *b;
  *b = t;
}


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

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

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

LLVM IR (-O2):
define void @swap_colors(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
store i8 %4, i8* %0
store i8 %3, i8* %1
ret void
}
int main() {
  unsigned long t1 = 1;
  unsigned long t2 = 2;
  return t1 + t2;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movq   $0x1,-0x10(%rbp)
movq   $0x2,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    -0x18(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, ...);
void usage(char *arg) {
  printf("Get DNS name from IP.\n");
  printf("Usage: %s <IP>\n", arg);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xed2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb9(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"Get DNS name from IP.\0A\00"
@.str.1 = [16 x i8] c"Usage: %s <IP>\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str.1 = [16 x i8] c"Usage: %s <IP>\0A\00"
@str = [22 x i8] c"Get DNS name from IP.\00"
define void @usage(i8* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
int main(void) {
  int x = 0;
  "hi0"[0] + x++ + "hi1"[0] + x++ + "hi2"[0];
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"hi0\00"
@.str.1 = [4 x i8] c"hi1\00"
@.str.2 = [4 x i8] c"hi2\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = load i8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
%4 = sext i8 %3 to i32
%5 = load i32, i32* %2
%6 = add nsw i32 %5, 1
store i32 %6, i32* %2
%7 = add nsw i32 %4, %5
%8 = load i8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0)
%9 = sext i8 %8 to i32
%10 = add nsw i32 %7, %9
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 1
store i32 %12, i32* %2
%13 = add nsw i32 %10, %11
%14 = load i8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0)
%15 = sext i8 %14 to i32
%16 = add nsw i32 %13, %15
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int abs(int);
int taa_h264_quote_uvlc(int);
unsigned taa_h264_quote_level(int v) {
  int code = abs(v) * 2;
  if (v > 0)
    code--;
  return taa_h264_quote_uvlc(code);
}


x86 assembly (clang, -O0):
<taa_h264_quote_level>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <abs@plt>
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    114c <taa_h264_quote_level+0x2c>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <taa_h264_quote_uvlc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<taa_h264_quote_level>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
add    %eax,%eax
xor    %ecx,%ecx
test   %edi,%edi
setg   %cl
sub    %ecx,%eax
mov    %eax,%edi
jmp    1030 <taa_h264_quote_uvlc@plt>

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

LLVM IR (-O2):
define i32 @taa_h264_quote_level(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
%3 = shl nuw nsw i32 %2, 1
%4 = icmp sgt i32 %0, 0
%5 = sext i1 %4 to i32
%6 = add nsw i32 %3, %5
%7 = tail call i32 @taa_h264_quote_uvlc(i32 %6)
ret i32 %7
}
int fun380() { return 380; }


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

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

LLVM IR (-O0):
define i32 @fun380() {
ret i32 380
}

LLVM IR (-O2):
define i32 @fun380() {
ret i32 380
}
void ft_add_test_case(char **data, char *str, char *to_find) {
  data[0] = str;
  data[1] = to_find;
}


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

x86 assembly (clang, -O2):
<ft_add_test_case>:
mov    %rsi,(%rdi)
mov    %rdx,0x8(%rdi)
ret

LLVM IR (-O0):
define void @ft_add_test_case(i8** %0, i8* %1, i8* %2) {
%4 = alloca i8**
%5 = alloca i8*
%6 = alloca i8*
store i8** %0, i8*** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %5
%8 = load i8**, i8*** %4
%9 = getelementptr inbounds i8*, i8** %8, i64 0
store i8* %7, i8** %9
%10 = load i8*, i8** %6
%11 = load i8**, i8*** %4
%12 = getelementptr inbounds i8*, i8** %11, i64 1
store i8* %10, i8** %12
ret void
}

LLVM IR (-O2):
define void @ft_add_test_case(i8** nocapture writeonly %0, i8* %1, i8* %2) {
store i8* %1, i8** %0
%4 = getelementptr inbounds i8*, i8** %0, i64 1
store i8* %2, i8** %4
ret void
}
/* Variables and functions */
int add(int, int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  printf("%d\n", add(2, 3));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2,%edi
mov    $0x3,%esi
call   1030 <add@plt>
lea    0xec9(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\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 @add(i32 2, i32 3)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @add(i32 2, i32 3)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void sal_free(void *ptr) { free(ptr); }


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

x86 assembly (clang, -O2):
<sal_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @sal_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ saveaddr(int, void *);
void saveaddrsep_wrap(const char *p, void *ptr) {
  int c;
  while ((c = *p++) != 0) {
    if (c == ' ')
      c = '\n';
    saveaddr(c, ptr);
  }
}


x86 assembly (clang, -O0):
<saveaddrsep_wrap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     1160 <saveaddrsep_wrap+0x50>
cmpl   $0x20,-0x14(%rbp)
jne    114f <saveaddrsep_wrap+0x3f>
movl   $0xa,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <saveaddr@plt>
jmp    1120 <saveaddrsep_wrap+0x10>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<saveaddrsep_wrap>:
push   %rbp
push   %r14
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     114e <saveaddrsep_wrap+0x3e>
mov    %rsi,%r14
mov    %rdi,%rbx
add    $0x1,%rbx
mov    $0xa,%ebp
nopl   0x0(%rax)
cmp    $0x20,%al
movzbl %al,%eax
cmove  %ebp,%eax
movsbl %al,%edi
mov    %r14,%rsi
call   1030 <saveaddr@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <saveaddrsep_wrap+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @saveaddrsep_wrap(i8* nocapture %0, i8* %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %13, %5 ], [ %3, %2 ]
%7 = phi i8* [ %8, %5 ], [ %0, %2 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = icmp eq i8 %6, 32
%10 = select i1 %9, i8 10, i8 %6
%11 = sext i8 %10 to i32
%12 = tail call i32 @saveaddr(i32 %11, i8* %1)
%13 = load i8, i8* %8
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %2
ret void
}
void *test_anti_range_52(int n) {
  extern void *alloc_anti_range_52(int) __attribute__((alloc_size(1)));
  if ((-0x7fffffff - 1) + 2 <= n && n <= 12)
    n = (-0x7fffffff - 1) + 2 - 1;
  return alloc_anti_range_52(n);
}


x86 assembly (clang, -O0):
<test_anti_range_52>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x80000002,%eax
cmp    -0x4(%rbp),%eax
jg     113a <test_anti_range_52+0x2a>
cmpl   $0xc,-0x4(%rbp)
jg     113a <test_anti_range_52+0x2a>
movl   $0x80000001,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <alloc_anti_range_52@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_anti_range_52>:
lea    0x7ffffffe(%rdi),%eax
cmp    $0x8000000b,%eax
mov    $0x80000001,%eax
cmovb  %eax,%edi
jmp    1030 <alloc_anti_range_52@plt>

LLVM IR (-O0):
define i8* @test_anti_range_52(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 -2147483646, %3
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 12
br i1 %7, label %8, label %9
8: ; preds = %5
store i32 -2147483647, i32* %2
br label %9
9: ; preds = %8, %5, %1
%10 = load i32, i32* %2
%11 = call i8* @alloc_anti_range_52(i32 %10)
ret i8* %11
}

LLVM IR (-O2):
define i8* @test_anti_range_52(i32 %0) {
%2 = add i32 %0, 2147483646
%3 = icmp ult i32 %2, -2147483637
%4 = select i1 %3, i32 -2147483647, i32 %0
%5 = tail call i8* @alloc_anti_range_52(i32 %4)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar_fd(char const, int);
void ft_putstr_fd(char const *s, int fd) {
  int i;
  if (s) {
    i = 0;
    while (s[i]) {
      ft_putchar_fd(s[i++], fd);
    }
  }
}


x86 assembly (clang, -O0):
<ft_putstr_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     116d <ft_putstr_fd+0x5d>
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1168 <ft_putstr_fd+0x58>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x10(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%al
mov    -0xc(%rbp),%esi
movsbl %al,%edi
call   1030 <ft_putchar_fd@plt>
jmp    1131 <ft_putstr_fd+0x21>
jmp    116d <ft_putstr_fd+0x5d>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putstr_fd>:
push   %rbp
push   %rbx
push   %rax
test   %rdi,%rdi
je     1145 <ft_putstr_fd+0x35>
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     1145 <ft_putstr_fd+0x35>
mov    %esi,%ebp
add    $0x1,%rbx
nopw   0x0(%rax,%rax,1)
movsbl %al,%edi
mov    %ebp,%esi
call   1030 <ft_putchar_fd@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <ft_putstr_fd+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @ft_putstr_fd(i8* %0, i32 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %15, label %4
4: ; preds = %2
%5 = load i8, i8* %0
%6 = icmp eq i8 %5, 0
br i1 %6, label %15, label %7
7: ; preds = %4, %7
%8 = phi i64 [ %10, %7 ], [ 0, %4 ]
%9 = phi i8 [ %13, %7 ], [ %5, %4 ]
%10 = add nuw i64 %8, 1
%11 = tail call i32 @ft_putchar_fd(i8 signext %9, i32 %1)
%12 = getelementptr inbounds i8, i8* %0, i64 %10
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %7
15: ; preds = %7, %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _movdir64b(void *, void const *);
void test_dir64b(void *dst, const void *src) { _movdir64b(dst, src); }


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

x86 assembly (clang, -O2):
<test_dir64b>:
jmp    1030 <_movdir64b@plt>

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

LLVM IR (-O2):
define void @test_dir64b(i8* %0, i8* %1) {
%3 = tail call i32 @_movdir64b(i8* %0, i8* %1)
ret void
}
/* Type definitions */
struct nvme_id_ctrl {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __show_nvme_id_ctrl(struct nvme_id_ctrl *, unsigned int,
                                       int /*<<< orphan*/ *);
void show_nvme_id_ctrl(struct nvme_id_ctrl *ctrl, unsigned int mode) {
  __show_nvme_id_ctrl(ctrl, mode, NULL);
}


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

x86 assembly (clang, -O2):
<show_nvme_id_ctrl>:
xor    %edx,%edx
jmp    1030 <__show_nvme_id_ctrl@plt>

LLVM IR (-O0):
%struct.nvme_id_ctrl = type { i32 }
define void @show_nvme_id_ctrl(%struct.nvme_id_ctrl* %0, i32 %1) {
%3 = alloca %struct.nvme_id_ctrl*
%4 = alloca i32
store %struct.nvme_id_ctrl* %0, %struct.nvme_id_ctrl** %3
store i32 %1, i32* %4
%5 = load %struct.nvme_id_ctrl*, %struct.nvme_id_ctrl** %3
%6 = load i32, i32* %4
%7 = call i32 @__show_nvme_id_ctrl(%struct.nvme_id_ctrl* %5, i32 %6, i32* null)
ret void
}

LLVM IR (-O2):
%struct.nvme_id_ctrl = type { i32 }
define void @show_nvme_id_ctrl(%struct.nvme_id_ctrl* %0, i32 %1) {
%3 = tail call i32 @__show_nvme_id_ctrl(%struct.nvme_id_ctrl* %0, i32 %1, i32* null)
ret void
}
/* Type definitions */
struct sched_param {
  int dummy;
};
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int __syscall_sched_setscheduler(int /*<<< orphan*/, int,
                                 struct sched_param const *);
int sched_setscheduler(pid_t pid, int policy, const struct sched_param *p) {
  return (__syscall_sched_setscheduler(pid, policy, p));
}


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

x86 assembly (clang, -O2):
<sched_setscheduler>:
jmp    1030 <__syscall_sched_setscheduler@plt>

LLVM IR (-O0):
%struct.sched_param = type { i32 }
define i32 @sched_setscheduler(i32 %0, i32 %1, %struct.sched_param* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca %struct.sched_param*
store i32 %0, i32* %4
store i32 %1, i32* %5
store %struct.sched_param* %2, %struct.sched_param** %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load %struct.sched_param*, %struct.sched_param** %6
%10 = call i32 @__syscall_sched_setscheduler(i32 %7, i32 %8, %struct.sched_param* %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.sched_param = type { i32 }
define i32 @sched_setscheduler(i32 %0, i32 %1, %struct.sched_param* %2) {
%4 = tail call i32 @__syscall_sched_setscheduler(i32 %0, i32 %1, %struct.sched_param* %2)
ret i32 %4
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
uint8_t *_vr_strchr(uint8_t *p, uint8_t *last, uint8_t c) {
  while (p < last) {
    if (*p == c) {
      return p;
    }
    p++;
  }
  return NULL;
}


x86 assembly (clang, -O0):
<_vr_strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    114d <_vr_strchr+0x4d>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
cmp    -0x20(%rbp),%rax
jne    113c <_vr_strchr+0x3c>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1155 <_vr_strchr+0x55>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <_vr_strchr+0x10>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_vr_strchr>:
cmp    %rsi,%rdi
jae    111e <_vr_strchr+0x1e>
mov    %rdi,%rax
nopl   0x0(%rax,%rax,1)
cmp    %rdx,(%rax)
je     1120 <_vr_strchr+0x20>
add    $0x8,%rax
cmp    %rsi,%rax
jb     1110 <_vr_strchr+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64* @_vr_strchr(i64* %0, i64* readnone %1, i64 %2) {
%4 = icmp ult i64* %0, %1
br i1 %4, label %5, label %12
5: ; preds = %3, %9
%6 = phi i64* [ %10, %9 ], [ %0, %3 ]
%7 = load i64, i64* %6
%8 = icmp eq i64 %7, %2
br i1 %8, label %12, label %9
9: ; preds = %5
%10 = getelementptr inbounds i64, i64* %6, i64 1
%11 = icmp ult i64* %10, %1
br i1 %11, label %5, label %12
12: ; preds = %5, %9, %3
%13 = phi i64* [ null, %3 ], [ null, %9 ], [ %6, %5 ]
ret i64* %13
}
int test_imm_55int32_reg(int val) { return ((val) & (0x55 << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_55int32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x55,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_55int32_reg>:
test   $0x55,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_55int32_reg(i32 %0) {
%2 = and i32 %0, 85
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void output_indent(int outputindent) {
  int i = 0;
  for (i = 0; i < outputindent; i++) {
    putchar('	');
  }
}


x86 assembly (clang, -O0):
<output_indent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    114d <output_indent+0x3d>
mov    $0x9,%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1129 <output_indent+0x19>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<output_indent>:
push   %rbx
test   %edi,%edi
jle    112f <output_indent+0x1f>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x9,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1120 <output_indent+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @output_indent(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %3
br label %4
4: ; preds = %10, %1
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %13
8: ; preds = %4
%9 = call i32 @putchar(i8 signext 9)
br label %10
10: ; preds = %8
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
br label %4
13: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @output_indent(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i32 @putchar(i8 signext 9)
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
void CG_DrawAmmoWarning(void) { return; }


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

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

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

LLVM IR (-O2):
define void @CG_DrawAmmoWarning() {
ret void
}
int conv_endian(int x) {
  return ((x & 0xff000000) >> 24) + ((x & 0x00ff0000) >> 8) +
         ((x & 0x0000ff00) << 8) + ((x & 0x000000ff) << 24);
}


x86 assembly (clang, -O0):
<conv_endian>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff000000,%eax
shr    $0x18,%eax
mov    -0x4(%rbp),%ecx
and    $0xff0000,%ecx
sar    $0x8,%ecx
add    %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff00,%ecx
shl    $0x8,%ecx
add    %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff,%ecx
shl    $0x18,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<conv_endian>:
mov    %edi,%eax
bswap  %eax
ret

LLVM IR (-O0):
define i32 @conv_endian(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, -16777216
%5 = lshr i32 %4, 24
%6 = load i32, i32* %2
%7 = and i32 %6, 16711680
%8 = ashr i32 %7, 8
%9 = add i32 %5, %8
%10 = load i32, i32* %2
%11 = and i32 %10, 65280
%12 = shl i32 %11, 8
%13 = add i32 %9, %12
%14 = load i32, i32* %2
%15 = and i32 %14, 255
%16 = shl i32 %15, 24
%17 = add i32 %13, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @conv_endian(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar(char const);
void ft_putstr(char const *str) {
  int i;
  i = 0;
  while (str[i] != '\0') {
    ft_putchar(str[i]);
    i++;
  }
}


x86 assembly (clang, -O0):
<ft_putstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1157 <ft_putstr+0x47>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <ft_putchar@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <ft_putstr+0x13>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @ft_putstr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8 [ %10, %4 ], [ %2, %1 ]
%7 = tail call i32 @ft_putchar(i8 signext %6)
%8 = add nuw i64 %5, 1
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print() { printf("42"); }


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

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

LLVM IR (-O0):
@.str = [3 x i8] c"42\00"
define void @print() {
%1 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"42\00"
define void @print() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}