xunge/DecIR huggingface dataset:
int main(int argc, char **argv) {
  int x;
  double r = argc;
  if (0 <= r) {
    x = 7;
  } else {
    x = 42;
  }
  return x;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     113a <main+0x3a>
movl   $0x7,-0x14(%rbp)
jmp    1141 <main+0x41>
movl   $0x2a,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
test   %edi,%edi
mov    $0x7,%ecx
mov    $0x2a,%eax
cmovns %ecx,%eax
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* %4
%9 = sitofp i32 %8 to double
store double %9, double* %7
%10 = load double, double* %7
%11 = fcmp ole double 0.000000e+00, %10
br i1 %11, label %12, label %13
12: ; preds = %2
store i32 7, i32* %6
br label %14
13: ; preds = %2
store i32 42, i32* %6
br label %14
14: ; preds = %13, %12
%15 = load i32, i32* %6
ret i32 %15
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = icmp sgt i32 %0, -1
%4 = select i1 %3, i32 7, i32 42
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ f_uint_1(unsigned int const);
int /*<<< orphan*/ sink(int /*<<< orphan*/);
void test_uint_cst(void) {
  const unsigned max = (0x7fffffff * 2U + 1);
  sink(f_uint_1(0));
  sink(f_uint_1(1));
  if (max < 0xffffffffffffffffUL) {
    sink(f_uint_1(max - 1));
    sink(f_uint_1(max));
  }
}


x86 assembly (clang, -O0):
<test_uint_cst>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xffffffff,-0x4(%rbp)
xor    %edi,%edi
call   1040 <f_uint_1@plt>
mov    %eax,%edi
call   1030 <sink@plt>
mov    $0x1,%edi
call   1040 <f_uint_1@plt>
mov    %eax,%edi
call   1030 <sink@plt>
mov    $0xfffffffe,%edi
call   1040 <f_uint_1@plt>
mov    %eax,%edi
call   1030 <sink@plt>
mov    $0xffffffff,%edi
call   1040 <f_uint_1@plt>
mov    %eax,%edi
call   1030 <sink@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_uint_cst>:
push   %rax
xor    %edi,%edi
call   1040 <f_uint_1@plt>
mov    %eax,%edi
call   1030 <sink@plt>
mov    $0x1,%edi
call   1040 <f_uint_1@plt>
mov    %eax,%edi
call   1030 <sink@plt>
mov    $0xfffffffe,%edi
call   1040 <f_uint_1@plt>
mov    %eax,%edi
call   1030 <sink@plt>
mov    $0xffffffff,%edi
call   1040 <f_uint_1@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <sink@plt>

LLVM IR (-O0):
define void @test_uint_cst() {
%1 = alloca i32
store i32 -1, i32* %1
%2 = call i32 @f_uint_1(i32 0)
%3 = call i32 @sink(i32 %2)
%4 = call i32 @f_uint_1(i32 1)
%5 = call i32 @sink(i32 %4)
%6 = call i32 @f_uint_1(i32 -2)
%7 = call i32 @sink(i32 %6)
%8 = call i32 @f_uint_1(i32 -1)
%9 = call i32 @sink(i32 %8)
ret void
}

LLVM IR (-O2):
define void @test_uint_cst() {
%1 = tail call i32 @f_uint_1(i32 0)
%2 = tail call i32 @sink(i32 %1)
%3 = tail call i32 @f_uint_1(i32 1)
%4 = tail call i32 @sink(i32 %3)
%5 = tail call i32 @f_uint_1(i32 -2)
%6 = tail call i32 @sink(i32 %5)
%7 = tail call i32 @f_uint_1(i32 -1)
%8 = tail call i32 @sink(i32 %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __pthread_mutex_unlock(void *);
scalar_t__ __pthread_spin_trylock(void *);
void __mutex_unlock_solid(void *lock) {
  if (__pthread_spin_trylock(lock) != 0)
    return;
  __pthread_mutex_unlock(lock);
}


x86 assembly (clang, -O0):
<__mutex_unlock_solid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <__pthread_spin_trylock@plt>
cmp    $0x0,%rax
je     1144 <__mutex_unlock_solid+0x24>
jmp    114d <__mutex_unlock_solid+0x2d>
mov    -0x8(%rbp),%rdi
call   1030 <__pthread_mutex_unlock@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__mutex_unlock_solid>:
push   %rbx
mov    %rdi,%rbx
call   1040 <__pthread_spin_trylock@plt>
test   %rax,%rax
je     1130 <__mutex_unlock_solid+0x10>
pop    %rbx
ret
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <__pthread_mutex_unlock@plt>

LLVM IR (-O0):
define void @__mutex_unlock_solid(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @__pthread_spin_trylock(i8* %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
br label %10
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = call i32 @__pthread_mutex_unlock(i8* %8)
br label %10
10: ; preds = %7, %6
ret void
}

LLVM IR (-O2):
define void @__mutex_unlock_solid(i8* %0) {
%2 = tail call i64 @__pthread_spin_trylock(i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @__pthread_mutex_unlock(i8* %0)
br label %6
6: ; preds = %1, %4
ret void
}
void do___latex_manual(void) {}


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

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

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

LLVM IR (-O2):
define void @do___latex_manual() {
ret void
}
int test_imm_EBint64_lowword_reg(long long val) {
  return ((val) & (0xEB << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_EBint64_lowword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 235
%5 = icmp ne i64 %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_EBint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 235
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
float linear_alpha(long iter, long length, float alpha) {
  return (alpha * (float)(length - iter) / (float)length);
}


x86 assembly (clang, -O0):
<linear_alpha>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
mov    -0x10(%rbp),%rax
sub    -0x8(%rbp),%rax
cvtsi2ss %rax,%xmm1
mulss  %xmm1,%xmm0
cvtsi2ssq -0x10(%rbp),%xmm1
divss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<linear_alpha>:
cvtsi2ss %rsi,%xmm1
sub    %rdi,%rsi
cvtsi2ss %rsi,%xmm2
mulss  %xmm2,%xmm0
divss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @linear_alpha(i64 %0, i64 %1, float %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca float
store i64 %0, i64* %4
store i64 %1, i64* %5
store float %2, float* %6
%7 = load float, float* %6
%8 = load i64, i64* %5
%9 = load i64, i64* %4
%10 = sub nsw i64 %8, %9
%11 = sitofp i64 %10 to float
%12 = fmul float %7, %11
%13 = load i64, i64* %5
%14 = sitofp i64 %13 to float
%15 = fdiv float %12, %14
ret float %15
}

LLVM IR (-O2):
define float @linear_alpha(i64 %0, i64 %1, float %2) {
%4 = sub nsw i64 %1, %0
%5 = sitofp i64 %4 to float
%6 = fmul float %5, %2
%7 = sitofp i64 %1 to float
%8 = fdiv float %6, %7
ret float %8
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int stat(char const *, struct stat *);
int folder_exists(const char *folder) {
  struct stat st;
  return stat(folder, &st) != -1;
}


x86 assembly (clang, -O0):
<folder_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0xffffffff,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<folder_exists>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @folder_exists(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @stat(i8* %4, %struct.stat* %3)
%6 = icmp ne i32 %5, -1
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @folder_exists(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp ne i32 %4, -1
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print_node_parenthesised(int depth, char *name, char *value,
                              void *client_data) {
  printf("( %s )", name);
}


x86 assembly (clang, -O0):
<print_node_parenthesised>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"( %s )\00"
define void @print_node_parenthesised(i32 %0, i8* %1, i8* nocapture readnone %2, i8* nocapture readnone %3) {
%5 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
void StrCpy(char *pDest, char *pSrc) {
  while ((*pDest++ = *pSrc++) != '\0') {
    ;
  }
}


x86 assembly (clang, -O0):
<StrCpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     113f <StrCpy+0x3f>
jmp    110c <StrCpy+0xc>
pop    %rbp
ret

x86 assembly (clang, -O2):
<StrCpy>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rsi,%rax,1),%ecx
mov    %cl,(%rdi,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <StrCpy+0x10>
ret

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

LLVM IR (-O2):
define void @StrCpy(i8* nocapture writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %8, %3 ]
%5 = phi i8* [ %1, %2 ], [ %6, %3 ]
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %5
%8 = getelementptr inbounds i8, i8* %4, i64 1
store i8 %7, i8* %4
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ stdlib_strided_dmeanvarpn(int /*<<< orphan*/ const,
                                             double const, double const *,
                                             int /*<<< orphan*/ const, double *,
                                             int /*<<< orphan*/ const);
void stdlib_strided_dmeanvar(const int64_t N, const double correction,
                             const double *X, const int64_t strideX,
                             double *Out, const int64_t strideOut) {
  stdlib_strided_dmeanvarpn(N, correction, X, strideX, Out, strideOut);
}


x86 assembly (clang, -O0):
<stdlib_strided_dmeanvar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8d,-0x2c(%rbp)
mov    -0x4(%rbp),%edi
movsd  -0x10(%rbp),%xmm0
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
mov    -0x28(%rbp),%rcx
mov    -0x2c(%rbp),%r8d
call   1030 <stdlib_strided_dmeanvarpn@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stdlib_strided_dmeanvar>:
jmp    1030 <stdlib_strided_dmeanvarpn@plt>

LLVM IR (-O0):
define void @stdlib_strided_dmeanvar(i32 %0, double %1, double* %2, i32 %3, double* %4, i32 %5) {
%7 = alloca i32
%8 = alloca double
%9 = alloca double*
%10 = alloca i32
%11 = alloca double*
%12 = alloca i32
store i32 %0, i32* %7
store double %1, double* %8
store double* %2, double** %9
store i32 %3, i32* %10
store double* %4, double** %11
store i32 %5, i32* %12
%13 = load i32, i32* %7
%14 = load double, double* %8
%15 = load double*, double** %9
%16 = load i32, i32* %10
%17 = load double*, double** %11
%18 = load i32, i32* %12
%19 = call i32 @stdlib_strided_dmeanvarpn(i32 %13, double %14, double* %15, i32 %16, double* %17, i32 %18)
ret void
}

LLVM IR (-O2):
define void @stdlib_strided_dmeanvar(i32 %0, double %1, double* %2, i32 %3, double* %4, i32 %5) {
%7 = tail call i32 @stdlib_strided_dmeanvarpn(i32 %0, double %1, double* %2, i32 %3, double* %4, i32 %5)
ret void
}
/* Variables and functions */
scalar_t__ CallBack4(int, void *, void *, char *, int *);
int UniqueName2(int nameSpaceCode, const char *baseName, char *finalName,
                int *suffixNumPtr) {
  return (int)CallBack4(76, (void *)nameSpaceCode, (void *)baseName, finalName,
                        suffixNumPtr);
}


x86 assembly (clang, -O0):
<UniqueName2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
movslq -0x4(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    $0x4c,%edi
call   1030 <CallBack4@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UniqueName2>:
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rdx
movslq %edi,%rsi
mov    $0x4c,%edi
jmp    1030 <CallBack4@plt>

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

LLVM IR (-O2):
define i32 @UniqueName2(i32 %0, i8* %1, i8* %2, i32* %3) {
%5 = sext i32 %0 to i64
%6 = inttoptr i64 %5 to i8*
%7 = tail call i64 @CallBack4(i32 76, i8* %6, i8* %1, i8* %2, i32* %3)
%8 = trunc i64 %7 to i32
ret i32 %8
}
void ctf_forceload(void) {}


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

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

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

LLVM IR (-O2):
define void @ctf_forceload() {
ret void
}
/* Type definitions */
typedef int uint32_t;
typedef int uint16_t;

/* Variables and functions */
void __prussintc_set_cmr(volatile uint32_t *pruintc_io, uint16_t sysevt,
                         uint16_t channel) {
  pruintc_io[(0x400 + (sysevt & ~(0x3))) >> 2] |=
      ((channel & 0xF) << ((sysevt & 0x3) << 3));
}


x86 assembly (clang, -O0):
<__prussintc_set_cmr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%esi
and    $0xf,%esi
mov    -0xc(%rbp),%ecx
and    $0x3,%ecx
shl    $0x3,%ecx
shl    %cl,%esi
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
and    $0xfffffffc,%ecx
add    $0x400,%ecx
sar    $0x2,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%edx
or     %esi,%edx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<__prussintc_set_cmr>:
and    $0xf,%edx
lea    0x0(,%rsi,8),%ecx
shl    %cl,%edx
add    $0x400,%esi
sar    $0x2,%esi
movslq %esi,%rax
or     %edx,(%rdi,%rax,4)
ret

LLVM IR (-O0):
define void @__prussintc_set_cmr(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = and i32 %7, 15
%9 = load i32, i32* %5
%10 = and i32 %9, 3
%11 = shl i32 %10, 3
%12 = shl i32 %8, %11
%13 = load i32*, i32** %4
%14 = load i32, i32* %5
%15 = and i32 %14, -4
%16 = add nsw i32 1024, %15
%17 = ashr i32 %16, 2
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i32, i32* %13, i64 %18
%20 = load volatile i32, i32* %19
%21 = or i32 %20, %12
store volatile i32 %21, i32* %19
ret void
}

LLVM IR (-O2):
define void @__prussintc_set_cmr(i32* %0, i32 %1, i32 %2) {
%4 = and i32 %2, 15
%5 = shl i32 %1, 3
%6 = and i32 %5, 24
%7 = shl nuw nsw i32 %4, %6
%8 = add i32 %1, 1024
%9 = ashr i32 %8, 2
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %0, i64 %10
%12 = load volatile i32, i32* %11
%13 = or i32 %12, %7
store volatile i32 %13, i32* %11
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void ft_strdel(char **as) {
  if (as != NULL) {
    free(*as);
    *as = NULL;
  }
}


x86 assembly (clang, -O0):
<ft_strdel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     113e <ft_strdel+0x2e>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strdel>:
test   %rdi,%rdi
je     1129 <ft_strdel+0x19>
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <free@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @ft_strdel(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 %10
5: ; preds = %1
%6 = load i8**, i8*** %2
%7 = load i8*, i8** %6
%8 = call i32 @free(i8* %7)
%9 = load i8**, i8*** %2
store i8* null, i8** %9
br label %10
10: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @ft_strdel(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
%5 = tail call i32 @free(i8* %4)
store i8* null, i8** %0
br label %6
6: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ db(int);
void nop() { db(0x90); }


x86 assembly (clang, -O0):
<nop>:
push   %rbp
mov    %rsp,%rbp
mov    $0x90,%edi
call   1030 <db@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<nop>:
mov    $0x90,%edi
jmp    1030 <db@plt>

LLVM IR (-O0):
define void @nop() {
%1 = call i32 @db(i32 144)
ret void
}

LLVM IR (-O2):
define void @nop() {
%1 = tail call i32 @db(i32 144)
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef unsigned long long uint32_t;

/* Variables and functions */
uint32_t fdt32_to_cpu(uint32_t x) {
  return (((unsigned long long)((uint8_t *)&x)[0]) << 24) |
         (((unsigned long long)((uint8_t *)&x)[1]) << 16) |
         (((unsigned long long)((uint8_t *)&x)[2]) << 8) |
         ((unsigned long long)((uint8_t *)&x)[3]);
}


x86 assembly (clang, -O0):
<fdt32_to_cpu>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x18,%rax
mov    0x0(%rbp),%rcx
shl    $0x10,%rcx
or     %rcx,%rax
mov    0x8(%rbp),%rcx
shl    $0x8,%rcx
or     %rcx,%rax
or     0x10(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @fdt32_to_cpu(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = getelementptr inbounds i64, i64* %2, i64 0
%4 = load i64, i64* %3
%5 = shl i64 %4, 24
%6 = getelementptr inbounds i64, i64* %2, i64 1
%7 = load i64, i64* %6
%8 = shl i64 %7, 16
%9 = or i64 %5, %8
%10 = getelementptr inbounds i64, i64* %2, i64 2
%11 = load i64, i64* %10
%12 = shl i64 %11, 8
%13 = or i64 %9, %12
%14 = getelementptr inbounds i64, i64* %2, i64 3
%15 = load i64, i64* %14
%16 = or i64 %13, %15
ret i64 %16
}

LLVM IR (-O2):
define i64 @fdt32_to_cpu(i64 %0) {
ret i64 poison
}
/* Variables and functions */
int /*<<< orphan*/ menuUsuario();
int /*<<< orphan*/ setarAcentuacao();
int main(void) {
  setarAcentuacao();
  menuUsuario();
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @setarAcentuacao()
%2 = tail call i32 (...) @menuUsuario()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
int main(void) {
  fprintf(stdout, "Standard output\n");
  fprintf(stderr, "Standard error\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
lea    0xed1(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
lea    0xecd(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
lea    0xedb(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [17 x i8] c"Standard output\0A\00"
@stderr = global i32 0
@.str.1 = [16 x i8] c"Standard error\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @stdout
%3 = call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stderr
%5 = call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [17 x i8] c"Standard output\0A\00"
@stderr = global i32 0
@.str.1 = [16 x i8] c"Standard error\0A\00"
define i32 @main() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
void net_save16(unsigned char data[2], unsigned short num) {
  data[0] = num >> 8;
  data[1] = num >> 0;
}


x86 assembly (clang, -O0):
<net_save16>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
movzwl -0xa(%rbp),%eax
sar    $0x8,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
movzwl -0xa(%rbp),%eax
sar    $0x0,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<net_save16>:
rol    $0x8,%si
mov    %si,(%rdi)
ret

LLVM IR (-O0):
define void @net_save16(i8* %0, i16 zeroext %1) {
%3 = alloca i8*
%4 = alloca i16
store i8* %0, i8** %3
store i16 %1, i16* %4
%5 = load i16, i16* %4
%6 = zext i16 %5 to i32
%7 = ashr i32 %6, 8
%8 = trunc i32 %7 to i8
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 0
store i8 %8, i8* %10
%11 = load i16, i16* %4
%12 = zext i16 %11 to i32
%13 = ashr i32 %12, 0
%14 = trunc i32 %13 to i8
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i64 1
store i8 %14, i8* %16
ret void
}

LLVM IR (-O2):
define void @net_save16(i8* nocapture writeonly %0, i16 zeroext %1) {
%3 = lshr i16 %1, 8
%4 = trunc i16 %3 to i8
store i8 %4, i8* %0
%5 = trunc i16 %1 to i8
%6 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %5, i8* %6
ret void
}
void setupAudioSystem() {}


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

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

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

LLVM IR (-O2):
define void @setupAudioSystem() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void print_blank(int blanks_len) {
  while (blanks_len--) {
    putchar('^');
  }
}


x86 assembly (clang, -O0):
<print_blank>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
je     113e <print_blank+0x2e>
mov    $0x5e,%edi
call   1030 <putchar@plt>
jmp    111b <print_blank+0xb>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @print_blank(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %5, %3 ], [ %0, %1 ]
%5 = add nsw i32 %4, -1
%6 = tail call i32 @putchar(i8 signext 94)
%7 = icmp eq i32 %5, 0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
/* Type definitions */
struct frame_headers {
  int dummy;
};

/* Variables and functions */
size_t dng_get_header_size(struct frame_headers *frame_headers) {
  return 65536;
}


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

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

LLVM IR (-O0):
%struct.frame_headers = type { i32 }
define i64 @dng_get_header_size(%struct.frame_headers* %0) {
%2 = alloca %struct.frame_headers*
store %struct.frame_headers* %0, %struct.frame_headers** %2
ret i64 65536
}

LLVM IR (-O2):
%struct.frame_headers = type { i32 }
define i64 @dng_get_header_size(%struct.frame_headers* nocapture readnone %0) {
ret i64 65536
}
/* Variables and functions */
int /*<<< orphan*/ permute(int *, int /*<<< orphan*/, int, int *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int mat[8] = {0, 1, 2, 3, 4, 5, 6, 7};
  int count = 0;
  int length = 8;
  permute(mat, 0, length, &count);
  printf("\n%d\n", count);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec8(%rip),%rax
mov    %rax,-0x8(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x8,-0x28(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%edx
xor    %esi,%esi
lea    -0x24(%rbp),%rcx
call   1030 <permute@plt>
mov    -0x24(%rbp),%esi
lea    0xea2(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movl   $0x0,0xc(%rsp)
lea    0x10(%rsp),%rdi
lea    0xc(%rsp),%rcx
xor    %esi,%esi
mov    $0x8,%edx
call   1030 <permute@plt>
mov    0xc(%rsp),%esi
lea    0xebb(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x38,%rsp
ret

LLVM IR (-O0):
@__const.main.mat = [8 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7]
@.str = [5 x i8] c"\0A%d\0A\00"
define i32 @main() {
%1 = alloca [8 x i32]
%2 = alloca i32
%3 = alloca i32
%4 = bitcast [8 x i32]* %1 to i8*
store i32 0, i32* %2
store i32 8, i32* %3
%5 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 0
%6 = load i32, i32* %3
%7 = call i32 @permute(i32* %5, i32 0, i32 %6, i32* %2)
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@__const.main.mat = [8 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7]
@.str = [5 x i8] c"\0A%d\0A\00"
define i32 @main() {
%1 = alloca [8 x i32]
%2 = alloca i32
%3 = bitcast [8 x i32]* %1 to i8*
%4 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%5 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 0
%6 = call i32 @permute(i32* %5, i32 0, i32 8, i32* %2)
%7 = load i32, i32* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}
int test_imm_29uint16_reg(unsigned short val) {
  return ((val) & (-0x29 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_29uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xffffffd7,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_29uint16_reg>:
test   $0xffd7,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_29uint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, -41
%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_29uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -41
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int f(int);
int g(int n) {
  if (n <= 1)
    return 1;
  else
    return f(n - 1) + g(n - 2);
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jg     1141 <g+0x21>
movl   $0x1,-0x4(%rbp)
jmp    1164 <g+0x44>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <f@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1040 <g@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
push   %rbp
push   %rbx
push   %rax
mov    $0x1,%ebp
cmp    $0x2,%edi
jl     1145 <g+0x35>
mov    %edi,%ebx
add    $0x2,%ebx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    -0x3(%rbx),%edi
call   1030 <f@plt>
add    %eax,%ebp
add    $0xfffffffe,%ebx
cmp    $0x3,%ebx
ja     1130 <g+0x20>
add    $0x1,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @g(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %13, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = add nsw i32 %4, -1
%7 = tail call i32 @f(i32 %6)
%8 = add nsw i32 %4, -2
%9 = add nsw i32 %7, %5
%10 = icmp ult i32 %4, 4
br i1 %10, label %11, label %3
11: ; preds = %3
%12 = add i32 %9, 1
br label %13
13: ; preds = %11, %1
%14 = phi i32 [ 1, %1 ], [ %12, %11 ]
ret i32 %14
}
const char *Call_Definition(void) {
  return "struct Call {\n"
         "  var (*call_with)(var, var);\n"
         "};\n";
}


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

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

LLVM IR (-O0):
@.str = [48 x i8] c"struct Call {\0A var (*call_with)(var, var);\0A};\0A\00"
define i8* @Call_Definition() {
ret i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [48 x i8] c"struct Call {\0A var (*call_with)(var, var);\0A};\0A\00"
define i8* @Call_Definition() {
ret i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void lex_feature_delete(char *f) {
  if (f) {
    free(f);
  }
}


x86 assembly (clang, -O0):
<lex_feature_delete>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <lex_feature_delete+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lex_feature_delete>:
test   %rdi,%rdi
je     111a <lex_feature_delete+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @lex_feature_delete(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 %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @free(i8* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @lex_feature_delete(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
void TkTextPrintIndex(line, ch, string) int line;
int ch;
char *string;
{ sprintf(string, "%d.%d", line + 1, ch); }


x86 assembly (clang, -O0):
<TkTextPrintIndex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
add    $0x1,%edx
mov    -0x8(%rbp),%ecx
lea    0xeca(%rip),%rsi
mov    $0x0,%al
call   1030 <sprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TkTextPrintIndex>:
mov    %rdx,%rax
mov    %esi,%ecx
lea    0x1(%rdi),%edx
lea    0xee1(%rip),%rsi
mov    %rax,%rdi
xor    %eax,%eax
jmp    1030 <sprintf@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"%d.%d\00"
define void @TkTextPrintIndex(i32 %0, i32 %1, i8* nocapture writeonly %2) {
%4 = add nsw i32 %0, 1
%5 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %2, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %1)
ret void
}
/* Variables and functions */
int write_block(int, int /*<<< orphan*/, int /*<<< orphan*/,
                int /*<<< orphan*/);
int left_rot(void) { return write_block(98, 0, 0, 0); }


x86 assembly (clang, -O0):
<left_rot>:
push   %rbp
mov    %rsp,%rbp
mov    $0x62,%edi
xor    %ecx,%ecx
mov    %ecx,%esi
mov    %ecx,%edx
call   1030 <write_block@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<left_rot>:
mov    $0x62,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <write_block@plt>

LLVM IR (-O0):
define i32 @left_rot() {
%1 = call i32 @write_block(i32 98, i32 0, i32 0, i32 0)
ret i32 %1
}

LLVM IR (-O2):
define i32 @left_rot() {
%1 = tail call i32 @write_block(i32 98, i32 0, i32 0, i32 0)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_file_type_error() {
  printf("\x1B[31m"
         "I can only read ppm type P3\n"
         "\x1B[0m");
}


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

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

LLVM IR (-O0):
@.str = [38 x i8] c"\1B[31mI can only read ppm type P3\0A\1B[0m\00"
define void @print_file_type_error() {
%1 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [38 x i8] c"\1B[31mI can only read ppm type P3\0A\1B[0m\00"
define void @print_file_type_error() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
ret void
}
unsigned short int f38(unsigned short int x, long int y) {
  return (x >> y) | (x << ((-y) & (8 * 2 - 1)));
}


x86 assembly (clang, -O0):
<f38>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
movzwl -0x2(%rbp),%eax
mov    -0x10(%rbp),%rcx
sar    %cl,%eax
movzwl -0x2(%rbp),%edx
xor    %ecx,%ecx
sub    -0x10(%rbp),%rcx
and    $0xf,%rcx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f38>:
mov    %rsi,%rcx
mov    %edi,%eax
shr    %cl,%eax
neg    %cl
and    $0xf,%cl
shl    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define zeroext i16 @f38(i16 zeroext %0, i64 %1) {
%3 = alloca i16
%4 = alloca i64
store i16 %0, i16* %3
store i64 %1, i64* %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = load i64, i64* %4
%8 = trunc i64 %7 to i32
%9 = ashr i32 %6, %8
%10 = load i16, i16* %3
%11 = zext i16 %10 to i32
%12 = load i64, i64* %4
%13 = sub nsw i64 0, %12
%14 = and i64 %13, 15
%15 = trunc i64 %14 to i32
%16 = shl i32 %11, %15
%17 = or i32 %9, %16
%18 = trunc i32 %17 to i16
ret i16 %18
}

LLVM IR (-O2):
define zeroext i16 @f38(i16 zeroext %0, i64 %1) {
%3 = zext i16 %0 to i32
%4 = trunc i64 %1 to i32
%5 = lshr i32 %3, %4
%6 = sub i32 0, %4
%7 = and i32 %6, 15
%8 = shl nuw nsw i32 %3, %7
%9 = or i32 %8, %5
%10 = trunc i32 %9 to i16
ret i16 %10
}
long gettid_cached(void) {
  static __thread long tid;
  if (!tid)
    tid = gettid();
  return tid;
}


x86 assembly (clang, -O0):
<gettid_cached>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0x2ea1(%rip),%rdi
call   1040 <__tls_get_addr@plt>
mov    0x0(%rax),%rax
cmp    $0x0,%rax
jne    1169 <gettid_cached+0x49>
xor    %eax,%eax
call   1030 <gettid@plt>
cltq
mov    %rax,-0x8(%rbp)
lea    0x2e77(%rip),%rdi
call   1040 <__tls_get_addr@plt>
mov    -0x8(%rbp),%rcx
mov    %rcx,0x0(%rax)
lea    0x2e60(%rip),%rdi
call   1040 <__tls_get_addr@plt>
mov    0x0(%rax),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gettid_cached>:
push   %rbx
lea    0x2ea8(%rip),%rdi
call   1040 <__tls_get_addr@plt>
mov    0x0(%rax),%rcx
test   %rcx,%rcx
jne    1150 <gettid_cached+0x30>
mov    %rax,%rbx
xor    %eax,%eax
call   1030 <gettid@plt>
movslq %eax,%rcx
mov    %rbx,%rax
mov    %rcx,0x0(%rbx)
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@gettid_cached.tid = internal thread_local global i64 0
define i64 @gettid_cached() {
%1 = load i64, i64* @gettid_cached.tid
%2 = icmp ne i64 %1, 0
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = call i32 (...) @gettid()
%5 = sext i32 %4 to i64
store i64 %5, i64* @gettid_cached.tid
br label %6
6: ; preds = %3, %0
%7 = load i64, i64* @gettid_cached.tid
ret i64 %7
}

LLVM IR (-O2):
@gettid_cached.tid = internal thread_local unnamed_addr global i64 0
define i64 @gettid_cached() {
%1 = load i64, i64* @gettid_cached.tid
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = tail call i32 (...) @gettid()
%5 = sext i32 %4 to i64
store i64 %5, i64* @gettid_cached.tid
br label %6
6: ; preds = %3, %0
%7 = phi i64 [ %5, %3 ], [ %1, %0 ]
ret i64 %7
}
int main(void) {
  double three = 3.0;
  double sixteen = 16.0;
  if (three * three == 9.0 && sixteen / 2.0 == 8.0) {
    return 42;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movsd  0xefd(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xee8(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  0xec9(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    117c <main+0x7c>
jp     117c <main+0x7c>
movsd  -0x18(%rbp),%xmm0
movsd  0xecc(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xeb8(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    117c <main+0x7c>
jp     117c <main+0x7c>
movl   $0x2a,-0x4(%rbp)
jmp    1183 <main+0x83>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
store i32 0, i32* %1
store double 3.000000e+00, double* %2
store double 1.600000e+01, double* %3
%4 = load double, double* %2
%5 = load double, double* %2
%6 = fmul double %4, %5
%7 = fcmp oeq double %6, 9.000000e+00
br i1 %7, label %8, label %13
8: ; preds = %0
%9 = load double, double* %3
%10 = fdiv double %9, 2.000000e+00
%11 = fcmp oeq double %10, 8.000000e+00
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 42, i32* %1
br label %14
13: ; preds = %8, %0
store i32 0, i32* %1
br label %14
14: ; preds = %13, %12
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
define i32 @main() {
ret i32 42
}
int socket_simgen_idle(void *gen, int idlems) { return 0; }


x86 assembly (clang, -O0):
<socket_simgen_idle>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @socket_simgen_idle(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
ret i32 0
}

LLVM IR (-O2):
define i32 @socket_simgen_idle(i8* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
char *getString();
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  char *minha_string = getString();
  if (minha_string)
    printf("%s\n", minha_string);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getString@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1155 <main+0x35>
mov    -0x10(%rbp),%rsi
lea    0xeb0(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <getString@plt>
test   %rax,%rax
je     113c <main+0x1c>
lea    0xecc(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i8* (...) @getString()
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = load i8*, i8** %2
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %7)
br label %9
9: ; preds = %6, %0
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = tail call i8* (...) @getString()
%2 = icmp eq i8* %1, null
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
br label %5
5: ; preds = %3, %0
ret i32 0
}
double fdbl(double x) { return x + x; }


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

x86 assembly (clang, -O2):
<fdbl>:
addsd  %xmm0,%xmm0
ret

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

LLVM IR (-O2):
define double @fdbl(double %0) {
%2 = fadd double %0, %0
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ derefAssignment(int *);
int *getNull();
int *getPtr();
void ternaryAssignment(char cond) {
  static int x;
  int *p = cond ? getNull() : getPtr();
  derefAssignment(p);
}


x86 assembly (clang, -O0):
<ternaryAssignment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x0,%eax
je     115b <ternaryAssignment+0x2b>
mov    $0x0,%al
call   1040 <getNull@plt>
mov    %rax,-0x18(%rbp)
jmp    1166 <ternaryAssignment+0x36>
mov    $0x0,%al
call   1050 <getPtr@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <derefAssignment@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ternaryAssignment>:
push   %rax
xor    %eax,%eax
test   %dil,%dil
je     113f <ternaryAssignment+0xf>
call   1040 <getNull@plt>
jmp    1144 <ternaryAssignment+0x14>
call   1050 <getPtr@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <derefAssignment@plt>

LLVM IR (-O0):
@ternaryAssignment.x = internal global i32 0
define void @ternaryAssignment(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32*
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32* (...) @getNull()
br label %11
9: ; preds = %1
%10 = call i32* (...) @getPtr()
br label %11
11: ; preds = %9, %7
%12 = phi i32* [ %8, %7 ], [ %10, %9 ]
store i32* %12, i32** %3
%13 = load i32*, i32** %3
%14 = call i32 @derefAssignment(i32* %13)
ret void
}

LLVM IR (-O2):
define void @ternaryAssignment(i8 signext %0) {
%2 = icmp eq i8 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32* (...) @getNull()
br label %7
5: ; preds = %1
%6 = tail call i32* (...) @getPtr()
br label %7
7: ; preds = %5, %3
%8 = phi i32* [ %4, %3 ], [ %6, %5 ]
%9 = tail call i32 @derefAssignment(i32* %8)
ret void
}
int libcall_global_pointer(int uno, void *dos) {
  if (dos == &libcall_global_pointer) {
    return 13;
  } else {
    return mystery() * uno;
  }
}


x86 assembly (clang, -O0):
<libcall_global_pointer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eba(%rip),%rax
cmp    %rax,-0x10(%rbp)
jne    113c <libcall_global_pointer+0x2c>
movl   $0xd,-0x4(%rbp)
jmp    114a <libcall_global_pointer+0x3a>
mov    $0x0,%al
call   1030 <mystery@plt>
imul   -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<libcall_global_pointer>:
push   %rbx
cmp    0x2ec8(%rip),%rsi
je     1128 <libcall_global_pointer+0x18>
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <mystery@plt>
imul   %ebx,%eax
pop    %rbx
ret
mov    $0xd,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @libcall_global_pointer(i32 %0, i8* readnone %1) {
%3 = icmp eq i8* %1, bitcast (i32 (i32, i8*)* @libcall_global_pointer to i8*)
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = tail call i32 (...) @mystery()
%6 = mul nsw i32 %5, %0
br label %7
7: ; preds = %2, %4
%8 = phi i32 [ %6, %4 ], [ 13, %2 ]
ret i32 %8
}