xunge/DecIR huggingface dataset:
/* Variables and functions */
char *int2binary(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main(int argc, const char *argv[]) {
  int n;
  printf("Digite um número: ");
  scanf("%d", &n);
  printf("O número %d em binário é %s\n", n, int2binary(n));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb9(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <int2binary@plt>
mov    -0x18(%rbp),%esi
mov    %rax,%rdx
lea    0xe98(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeca(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%ebx
mov    %ebx,%edi
call   1040 <int2binary@plt>
lea    0xeb1(%rip),%rdi
mov    %ebx,%esi
mov    %rax,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Digite um n\C3\BAmero: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [32 x i8] c"O n\C3\BAmero %d em bin\C3\A1rio \C3\A9 %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%9 = load i32, i32* %6
%10 = load i32, i32* %6
%11 = call i8* @int2binary(i32 %10)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), i32 %9, i8* %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"Digite um n\C3\BAmero: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [32 x i8] c"O n\C3\BAmero %d em bin\C3\A1rio \C3\A9 %s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%7 = load i32, i32* %3
%8 = call i8* @int2binary(i32 %7)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), i32 %7, i8* %8)
ret i32 0
}
const char *integck_get_title(void) { return "Test file system integrity"; }


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

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

LLVM IR (-O0):
@.str = [27 x i8] c"Test file system integrity\00"
define i8* @integck_get_title() {
ret i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [27 x i8] c"Test file system integrity\00"
define i8* @integck_get_title() {
ret i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() {
  unsigned int x = ~0xfff;
  int i = 0;
  for (; i < 32; ++i) {
    if (x % 2 == 1)
      printf("1\n");
    else
      printf("0\n");
    x = (x >> 1);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xfffff000,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x20,-0xc(%rbp)
jge    117a <main+0x6a>
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x1,%eax
jne    1157 <main+0x47>
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
jmp    1163 <main+0x53>
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112d <main+0x1d>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    $0xfffff000,%ebx
mov    $0x20,%ebp
lea    0xed8(%rip),%r14
lea    0xed3(%rip),%r15
nop
test   $0x1,%bl
mov    %r15,%rdi
cmove  %r14,%rdi
call   1030 <puts@plt>
shr    %ebx
add    $0xffffffff,%ebp
jne    1130 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"1\0A\00"
@.str.1 = [3 x i8] c"0\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 -4096, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %18, %0
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 32
br i1 %6, label %7, label %21
7: ; preds = %4
%8 = load i32, i32* %2
%9 = urem i32 %8, 2
%10 = icmp eq i32 %9, 1
br i1 %10, label %11, label %13
11: ; preds = %7
%12 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %15
13: ; preds = %7
%14 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %15
15: ; preds = %13, %11
%16 = load i32, i32* %2
%17 = lshr i32 %16, 1
store i32 %17, i32* %2
br label %18
18: ; preds = %15
%19 = load i32, i32* %3
%20 = add nsw i32 %19, 1
store i32 %20, i32* %3
br label %4
21: ; preds = %4
%22 = load i32, i32* %1
ret i32 %22
}

LLVM IR (-O2):
@str = [2 x i8] c"0\00"
@str.2 = [2 x i8] c"1\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %9, %1 ]
%3 = phi i32 [ -4096, %0 ], [ %8, %1 ]
%4 = and i32 %3, 1
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @str.2, i64 0, i64 0)
%7 = tail call i32 @puts(i8* dereferenceable(1) %6)
%8 = lshr i32 %3, 1
%9 = add nuw nsw i32 %2, 1
%10 = icmp eq i32 %9, 32
br i1 %10, label %11, label %1
11: ; preds = %1
ret i32 0
}
void asm_cabac_encode_ue_bypass(void *cb, int exp_bits, int val) {}


x86 assembly (clang, -O0):
<asm_cabac_encode_ue_bypass>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @asm_cabac_encode_ue_bypass(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret void
}

LLVM IR (-O2):
define void @asm_cabac_encode_ue_bypass(i8* nocapture %0, i32 %1, i32 %2) {
ret void
}
/* Variables and functions */
unsigned long proc_get_freq_kernel(unsigned int);
unsigned long sysfs_get_freq_kernel(unsigned int);
unsigned long cpufreq_get_freq_kernel(unsigned int cpu) {
  unsigned long ret = sysfs_get_freq_kernel(cpu);
  if (!ret)
    ret = proc_get_freq_kernel(cpu);
  return (ret);
}


x86 assembly (clang, -O0):
<cpufreq_get_freq_kernel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <sysfs_get_freq_kernel@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114e <cpufreq_get_freq_kernel+0x2e>
mov    -0x4(%rbp),%edi
call   1030 <proc_get_freq_kernel@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpufreq_get_freq_kernel>:
push   %rbx
mov    %edi,%ebx
call   1040 <sysfs_get_freq_kernel@plt>
test   %rax,%rax
je     112f <cpufreq_get_freq_kernel+0xf>
pop    %rbx
ret
mov    %ebx,%edi
pop    %rbx
jmp    1030 <proc_get_freq_kernel@plt>

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

LLVM IR (-O2):
define i64 @cpufreq_get_freq_kernel(i32 %0) {
%2 = tail call i64 @sysfs_get_freq_kernel(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i64 @proc_get_freq_kernel(i32 %0)
br label %6
6: ; preds = %4, %1
%7 = phi i64 [ %2, %1 ], [ %5, %4 ]
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ Tut_ErrorExit(char *);
void *realloc(void *, size_t);
void *Tut_Realloc(void *mem, size_t newSize) {
  void *newMem = realloc(mem, newSize);
  if (!newMem)
    Tut_ErrorExit("Out of memory!\n");
  return newMem;
}


x86 assembly (clang, -O0):
<Tut_Realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1158 <Tut_Realloc+0x38>
lea    0xead(%rip),%rdi
call   1030 <Tut_ErrorExit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Tut_Realloc>:
push   %rbx
call   1040 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <Tut_Realloc+0x1a>
lea    0xecb(%rip),%rdi
call   1030 <Tut_ErrorExit@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Out of memory!\0A\00"
define i8* @Tut_Realloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %13, label %11
11: ; preds = %2
%12 = call i32 @Tut_ErrorExit(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %2
%14 = load i8*, i8** %5
ret i8* %14
}

LLVM IR (-O2):
@.str = [16 x i8] c"Out of memory!\0A\00"
define noalias i8* @Tut_Realloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @Tut_ErrorExit(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
int main(void) {
  extern char s[];
  (printf("%s = [%s]\n", "s", (s)));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [11 x i8] c"%s = [%s]\0A\00"
@.str.1 = [2 x i8] c"s\00"
@s = external global [0 x i8]
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([0 x i8], [0 x i8]* @s, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ MSort(int *, int *, int /*<<< orphan*/, int, int);
void MergeSort(int src[], int len) { MSort(src, src, 0, len - 1, len); }


x86 assembly (clang, -O0):
<MergeSort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
mov    -0xc(%rbp),%r8d
xor    %edx,%edx
call   1030 <MSort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MergeSort>:
mov    %esi,%r8d
lea    -0x1(%r8),%ecx
mov    %rdi,%rsi
xor    %edx,%edx
jmp    1030 <MSort@plt>

LLVM IR (-O0):
define void @MergeSort(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32*, i32** %3
%7 = load i32, i32* %4
%8 = sub nsw i32 %7, 1
%9 = load i32, i32* %4
%10 = call i32 @MSort(i32* %5, i32* %6, i32 0, i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
define void @MergeSort(i32* %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = tail call i32 @MSort(i32* %0, i32* %0, i32 0, i32 %3, i32 %1)
ret void
}
/* Variables and functions */
float __ocml_exp2_f32(float);
float exp2f(float x) { return __ocml_exp2_f32(x); }


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

x86 assembly (clang, -O2):
<exp2f>:
jmp    1030 <__ocml_exp2_f32@plt>

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

LLVM IR (-O2):
define float @exp2f(float %0) {
%2 = tail call float @__ocml_exp2_f32(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, int);
char *emit_mon(char *dst, int mon) {
  memcpy(dst, ("JanFebMarAprMayJunJulAugSepOctNovDec") + mon * 3, 3);
  return dst + 3;
}


x86 assembly (clang, -O0):
<emit_mon>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
imul   $0x3,-0xc(%rbp),%eax
cltq
lea    0xed0(%rip),%rsi
add    %rax,%rsi
mov    $0x3,%edx
call   1030 <memcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x3,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_mon>:
push   %rbx
mov    %rdi,%rbx
lea    (%rsi,%rsi,2),%eax
cltq
lea    0xee0(%rip),%rsi
add    %rax,%rsi
mov    $0x3,%edx
call   1030 <memcpy@plt>
add    $0x3,%rbx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [37 x i8] c"JanFebMarAprMayJunJulAugSepOctNovDec\00"
define i8* @emit_mon(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = mul nsw i32 %6, 3
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i64 %8
%10 = call i32 @memcpy(i8* %5, i8* %9, i32 3)
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i64 3
ret i8* %12
}

LLVM IR (-O2):
@.str = [37 x i8] c"JanFebMarAprMayJunJulAugSepOctNovDec\00"
define i8* @emit_mon(i8* %0, i32 %1) {
%3 = mul nsw i32 %1, 3
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds [37 x i8], [37 x i8]* @.str, i64 0, i64 %4
%6 = tail call i32 @memcpy(i8* %0, i8* %5, i32 3)
%7 = getelementptr inbounds i8, i8* %0, i64 3
ret i8* %7
}
char revcomp(char c) {
  switch (c) {
  case 'A':
  case 'a':
    return 'T';
  case 'C':
  case 'c':
    return 'G';
  case 'G':
  case 'g':
    return 'C';
  case 'T':
  case 't':
    return 'A';
  case '@':
    return '@';
  case '$':
    return '$';
  default:
    return 'N';
  }
}


x86 assembly (clang, -O0):
<revcomp>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
add    $0xffffffdc,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x50,%eax
ja     116a <revcomp+0x6a>
mov    -0x10(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movb   $0x54,-0x1(%rbp)
jmp    116e <revcomp+0x6e>
movb   $0x47,-0x1(%rbp)
jmp    116e <revcomp+0x6e>
movb   $0x43,-0x1(%rbp)
jmp    116e <revcomp+0x6e>
movb   $0x41,-0x1(%rbp)
jmp    116e <revcomp+0x6e>
movb   $0x40,-0x1(%rbp)
jmp    116e <revcomp+0x6e>
movb   $0x24,-0x1(%rbp)
jmp    116e <revcomp+0x6e>
movb   $0x4e,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<revcomp>:
add    $0xffffffdc,%edi
cmp    $0x50,%edi
ja     1126 <revcomp+0x26>
mov    $0x54,%al
lea    0xeef(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
mov    $0x47,%al
ret
mov    $0x43,%al
ret
mov    $0x41,%al
ret
mov    $0x24,%al
ret
mov    $0x4e,%al
ret
mov    $0x40,%al
ret

LLVM IR (-O0):
define signext i8 @revcomp(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %12 [
i32 65, label %6
i32 97, label %6
i32 67, label %7
i32 99, label %7
i32 71, label %8
i32 103, label %8
i32 84, label %9
i32 116, label %9
i32 64, label %10
i32 36, label %11
]
6: ; preds = %1, %1
store i8 84, i8* %2
br label %13
7: ; preds = %1, %1
store i8 71, i8* %2
br label %13
8: ; preds = %1, %1
store i8 67, i8* %2
br label %13
9: ; preds = %1, %1
store i8 65, i8* %2
br label %13
10: ; preds = %1
store i8 64, i8* %2
br label %13
11: ; preds = %1
store i8 36, i8* %2
br label %13
12: ; preds = %1
store i8 78, i8* %2
br label %13
13: ; preds = %12, %11, %10, %9, %8, %7, %6
%14 = load i8, i8* %2
ret i8 %14
}

LLVM IR (-O2):
define signext i8 @revcomp(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %8 [
i32 65, label %9
i32 97, label %9
i32 67, label %3
i32 99, label %3
i32 71, label %4
i32 103, label %4
i32 84, label %5
i32 116, label %5
i32 64, label %6
i32 36, label %7
]
3: ; preds = %1, %1
br label %9
4: ; preds = %1, %1
br label %9
5: ; preds = %1, %1
br label %9
6: ; preds = %1
br label %9
7: ; preds = %1
br label %9
8: ; preds = %1
br label %9
9: ; preds = %1, %1, %8, %7, %6, %5, %4, %3
%10 = phi i8 [ 78, %8 ], [ 36, %7 ], [ 64, %6 ], [ 65, %5 ], [ 67, %4 ], [ 71, %3 ], [ 84, %1 ], [ 84, %1 ]
ret i8 %10
}
/* Variables and functions */
int strlen(char *);
void ins_char(char *buf, char *ptr, char c) {
  char *cp;
  cp = buf + strlen(buf);
  while (cp >= ptr) {
    *(cp + 1) = *cp;
    cp--;
  }
  *ptr = c;
}


x86 assembly (clang, -O0):
<ins_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
jb     1172 <ins_char+0x62>
mov    -0x20(%rbp),%rax
mov    (%rax),%cl
mov    -0x20(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x20(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x20(%rbp)
jmp    1146 <ins_char+0x36>
mov    -0x11(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ins_char>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %rdi,%rbp
call   1030 <strlen@plt>
cltq
add    %rbp,%rax
cmp    %rbx,%rax
jb     113f <ins_char+0x2f>
nopl   0x0(%rax)
movzbl (%rax),%ecx
mov    %cl,0x1(%rax)
add    $0xffffffffffffffff,%rax
cmp    %rbx,%rax
jae    1130 <ins_char+0x20>
mov    %r14b,(%rbx)
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @ins_char(i8* %0, i8* writeonly %1, i8 signext %2) {
%4 = tail call i32 @strlen(i8* %0)
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = icmp ult i8* %6, %1
br i1 %7, label %14, label %8
8: ; preds = %3, %8
%9 = phi i8* [ %12, %8 ], [ %6, %3 ]
%10 = load i8, i8* %9
%11 = getelementptr inbounds i8, i8* %9, i64 1
store i8 %10, i8* %11
%12 = getelementptr inbounds i8, i8* %9, i64 -1
%13 = icmp ult i8* %12, %1
br i1 %13, label %14, label %8
14: ; preds = %8, %3
store i8 %2, i8* %1
ret void
}
int tumbalek(char c) {
  c = (c & 0xF0) >> 4 | (c & 0x0F) << 4;
  c = (c & 0xCC) >> 2 | (c & 0x33) << 2;
  c = (c & 0xAA) >> 1 | (c & 0x55) << 1;
  return c;
}


x86 assembly (clang, -O0):
<tumbalek>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
and    $0xf0,%eax
sar    $0x4,%eax
movsbl -0x1(%rbp),%ecx
and    $0xf,%ecx
shl    $0x4,%ecx
or     %ecx,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
and    $0xcc,%eax
sar    $0x2,%eax
movsbl -0x1(%rbp),%ecx
and    $0x33,%ecx
shl    $0x2,%ecx
or     %ecx,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
and    $0xaa,%eax
sar    $0x1,%eax
movsbl -0x1(%rbp),%ecx
and    $0x55,%ecx
shl    $0x1,%ecx
or     %ecx,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tumbalek>:
rol    $0x4,%dil
mov    %edi,%eax
and    $0x33,%al
shl    $0x2,%al
shr    $0x2,%dil
and    $0x33,%dil
or     %al,%dil
mov    %edi,%eax
and    $0x55,%al
add    %al,%al
shr    %dil
and    $0x55,%dil
or     %al,%dil
movsbl %dil,%eax
ret

LLVM IR (-O0):
define i32 @tumbalek(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, 240
%6 = ashr i32 %5, 4
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = and i32 %8, 15
%10 = shl i32 %9, 4
%11 = or i32 %6, %10
%12 = trunc i32 %11 to i8
store i8 %12, i8* %2
%13 = load i8, i8* %2
%14 = sext i8 %13 to i32
%15 = and i32 %14, 204
%16 = ashr i32 %15, 2
%17 = load i8, i8* %2
%18 = sext i8 %17 to i32
%19 = and i32 %18, 51
%20 = shl i32 %19, 2
%21 = or i32 %16, %20
%22 = trunc i32 %21 to i8
store i8 %22, i8* %2
%23 = load i8, i8* %2
%24 = sext i8 %23 to i32
%25 = and i32 %24, 170
%26 = ashr i32 %25, 1
%27 = load i8, i8* %2
%28 = sext i8 %27 to i32
%29 = and i32 %28, 85
%30 = shl i32 %29, 1
%31 = or i32 %26, %30
%32 = trunc i32 %31 to i8
store i8 %32, i8* %2
%33 = load i8, i8* %2
%34 = sext i8 %33 to i32
ret i32 %34
}

LLVM IR (-O2):
define i32 @tumbalek(i8 signext %0) {
%2 = tail call i8 @llvm.bitreverse.i8(i8 %0)
%3 = sext i8 %2 to i32
ret i32 %3
}
/* Type definitions */
struct epoll_event {
  int dummy;
};

/* Variables and functions */
int epoll_wait(int, struct epoll_event *, int, int);
int ep_wait(int epfd, int timeout, struct epoll_event *events) {
  return epoll_wait(epfd, events, 1024, timeout);
}


x86 assembly (clang, -O0):
<ep_wait>:
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    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%ecx
mov    $0x400,%edx
call   1030 <epoll_wait@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ep_wait>:
mov    %esi,%ecx
mov    %rdx,%rsi
mov    $0x400,%edx
jmp    1030 <epoll_wait@plt>

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

LLVM IR (-O2):
%struct.epoll_event = type { i32 }
define i32 @ep_wait(i32 %0, i32 %1, %struct.epoll_event* %2) {
%4 = tail call i32 @epoll_wait(i32 %0, %struct.epoll_event* %2, i32 1024, i32 %1)
ret i32 %4
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ chr1setBank1(int);
void m65setParamsB001(uint16_t addr, uint8_t val) {
  (void)addr;
  chr1setBank1(val << 10);
}


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

x86 assembly (clang, -O2):
mov    %esi,%edi
shl    $0xa,%edi
jmp    1030 <chr1setBank1@plt>

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

LLVM IR (-O2):
define void @m65setParamsB001(i32 %0, i32 %1) {
%3 = shl i32 %1, 10
%4 = tail call i32 @chr1setBank1(i32 %3)
ret void
}
/* Variables and functions */
scalar_t__ SIGINT;
int /*<<< orphan*/ exit(scalar_t__);
int /*<<< orphan*/ tty_restore();
void handle_interrupt() {
  tty_restore();
  exit((128 + SIGINT));
}


x86 assembly (clang, -O0):
<handle_interrupt>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <tty_restore@plt>
mov    0x2eb6(%rip),%rax
mov    (%rax),%rdi
add    $0x80,%rdi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<handle_interrupt>:
push   %rax
xor    %eax,%eax
call   1030 <tty_restore@plt>
mov    0x2eb9(%rip),%rax
mov    (%rax),%rdi
sub    $0xffffffffffffff80,%rdi
call   1040 <exit@plt>

LLVM IR (-O0):
@SIGINT = global i64 0
define void @handle_interrupt() {
%1 = call i32 (...) @tty_restore()
%2 = load i64, i64* @SIGINT
%3 = add nsw i64 128, %2
%4 = call i32 @exit(i64 %3)
unreachable
}

LLVM IR (-O2):
@SIGINT = global i64 0
define void @handle_interrupt() {
%1 = tail call i32 (...) @tty_restore()
%2 = load i64, i64* @SIGINT
%3 = add nsw i64 %2, 128
%4 = tail call i32 @exit(i64 %3)
unreachable
}
void glBeginTransformFeedback(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glBeginTransformFeedback() {
ret void
}
float _Complex div_float_rr(float a, float b) { return a / b; }


x86 assembly (clang, -O0):
<div_float_rr>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
movl   $0x0,-0x4(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<div_float_rr>:
divss  %xmm1,%xmm0
xorps  %xmm1,%xmm1
movss  %xmm0,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define <2 x float> @div_float_rr(float %0, float %1) {
%3 = alloca { float, float }
%4 = alloca float
%5 = alloca float
store float %0, float* %4
store float %1, float* %5
%6 = load float, float* %4
%7 = load float, float* %5
%8 = fdiv float %6, %7
%9 = getelementptr inbounds { float, float }, { float, float }* %3, i32 0, i32 0
%10 = getelementptr inbounds { float, float }, { float, float }* %3, i32 0, i32 1
store float %8, float* %9
store float 0.000000e+00, float* %10
%11 = bitcast { float, float }* %3 to <2 x float>*
%12 = load <2 x float>, <2 x float>* %11
ret <2 x float> %12
}

LLVM IR (-O2):
define <2 x float> @div_float_rr(float %0, float %1) {
%3 = fdiv float %0, %1
%4 = insertelement <2 x float> <float poison, float 0.000000e+00>, float %3, i64 0
ret <2 x float> %4
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ y;
};
typedef TYPE_1__ XRectangle;

/* Variables and functions */
short get_XRectangle_y(void *_p) { return (short)((XRectangle *)_p)->y; }


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

x86 assembly (clang, -O2):
<get_XRectangle_y>:
movzwl (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define signext i16 @get_XRectangle_y(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i16
ret i16 %7
}

LLVM IR (-O2):
define signext i16 @get_XRectangle_y(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i16
ret i16 %4
}
int test_imm_8Cint8_reg(signed char val) {
  return ((val) & (-0x8C << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_8Cint8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, -140
%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_8Cint8_reg(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = and i32 %2, -140
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int __test_bit(int nr, unsigned long *p) {
  return ((int)(((*(p + (nr >> 5))) >> (nr & 31)) & 1UL));
}


x86 assembly (clang, -O0):
<__test_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
sar    $0x5,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x4(%rbp),%ecx
and    $0x1f,%ecx
mov    %ecx,%ecx
shr    %cl,%rax
and    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__test_bit>:
mov    %edi,%ecx
mov    %edi,%eax
sar    $0x5,%eax
cltq
mov    (%rsi,%rax,8),%rax
and    $0x1f,%cl
shr    %cl,%rax
and    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @__test_bit(i32 %0, i64* nocapture %1) {
%3 = ashr i32 %0, 5
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i64, i64* %1, i64 %4
%6 = load i64, i64* %5
%7 = and i32 %0, 31
%8 = zext i32 %7 to i64
%9 = lshr i64 %6, %8
%10 = trunc i64 %9 to i32
%11 = and i32 %10, 1
ret i32 %11
}
void write_flashram_dummyd() {}


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

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

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

LLVM IR (-O2):
define void @write_flashram_dummyd() {
ret void
}
char *segoff_to_phys(char *addr) {
  int x = (int)addr;
  int segment = (x >> 12) & 0x0FFFF0;
  int offset = x & 0x0FFFF;
  return (char *)(segment | offset);
}


x86 assembly (clang, -O0):
<segoff_to_phys>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0xc,%eax
and    $0xffff0,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
and    $0xffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
or     -0x14(%rbp),%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<segoff_to_phys>:
movzwl %di,%eax
shr    $0xc,%rdi
and    $0xffff0,%edi
or     %rdi,%rax
ret

LLVM IR (-O0):
define i8* @segoff_to_phys(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %2
%6 = load i8*, i8** %2
%7 = ptrtoint i8* %6 to i32
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = ashr i32 %8, 12
%10 = and i32 %9, 1048560
store i32 %10, i32* %4
%11 = load i32, i32* %3
%12 = and i32 %11, 65535
store i32 %12, i32* %5
%13 = load i32, i32* %4
%14 = load i32, i32* %5
%15 = or i32 %13, %14
%16 = sext i32 %15 to i64
%17 = inttoptr i64 %16 to i8*
ret i8* %17
}

LLVM IR (-O2):
define i8* @segoff_to_phys(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = lshr i64 %2, 12
%4 = and i64 %3, 1048560
%5 = and i64 %2, 65535
%6 = or i64 %4, %5
%7 = inttoptr i64 %6 to i8*
ret i8* %7
}
void draw_term(void) { ; }


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

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

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

LLVM IR (-O2):
define void @draw_term() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ mpfr_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ **malloc(int);
void arr_alloc(const size_t x, mpfr_t (**aptr)[x]) {
  *aptr = malloc(sizeof(mpfr_t[x]));
  assert(*aptr != NULL);
}


x86 assembly (clang, -O0):
<arr_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arr_alloc>:
push   %rbx
mov    %rsi,%rbx
shl    $0x2,%edi
call   1040 <malloc@plt>
mov    %rax,(%rbx)
xor    %edi,%edi
test   %rax,%rax
setne  %dil
pop    %rbx
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @arr_alloc(i64 %0, i32** %1) {
%3 = alloca i64
%4 = alloca i32**
store i64 %0, i64* %3
store i32** %1, i32*** %4
%5 = load i64, i64* %3
%6 = load i64, i64* %3
%7 = mul nuw i64 4, %6
%8 = trunc i64 %7 to i32
%9 = call i32** @malloc(i32 %8)
%10 = bitcast i32** %9 to i32*
%11 = load i32**, i32*** %4
store i32* %10, i32** %11
%12 = load i32**, i32*** %4
%13 = load i32*, i32** %12
%14 = icmp ne i32* %13, null
%15 = zext i1 %14 to i32
%16 = call i32 @assert(i32 %15)
ret void
}

LLVM IR (-O2):
define void @arr_alloc(i64 %0, i32** nocapture writeonly %1) {
%3 = trunc i64 %0 to i32
%4 = shl i32 %3, 2
%5 = tail call i32** @malloc(i32 %4)
%6 = bitcast i32** %1 to i32***
store i32** %5, i32*** %6
%7 = icmp ne i32** %5, null
%8 = zext i1 %7 to i32
%9 = tail call i32 @assert(i32 %8)
ret void
}
int GCD(int m, int n) {
  if (!n) {
    return m;
  }
  return GCD(n, m % n);
}


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

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

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

LLVM IR (-O2):
define i32 @GCD(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = phi i32 [ %5, %4 ], [ %0, %2 ]
%7 = srem i32 %6, %5
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %0, %2 ], [ %5, %4 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
int argOk(const char **argv) {
  if (argv[1] == 0) {
    printf("Insira o nome de um arquivo.\n");
    exit(-1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<argOk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,0x8(%rax)
jne    1151 <argOk+0x31>
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<argOk>:
push   %rax
cmpq   $0x0,0x8(%rdi)
je     112c <argOk+0xc>
xor    %eax,%eax
pop    %rcx
ret
lea    0xecd(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"Insira o nome de um arquivo.\0A\00"
define i32 @argOk(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = getelementptr inbounds i8*, i8** %3, i64 1
%5 = load i8*, i8** %4
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @exit(i32 -1)
unreachable
10: ; preds = %1
ret i32 0
}

LLVM IR (-O2):
@str = [29 x i8] c"Insira o nome de um arquivo.\00"
define i32 @argOk(i8** nocapture %0) {
%2 = getelementptr inbounds i8*, i8** %0, i64 1
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 -1)
unreachable
8: ; preds = %1
ret i32 0
}
/* Variables and functions */
long double logl(long double);
long double libm_logl(long double x) { return logl(x); }


x86 assembly (clang, -O0):
<libm_logl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <logl@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<libm_logl>:
jmp    1030 <logl@plt>

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

LLVM IR (-O2):
define x86_fp80 @libm_logl(x86_fp80 %0) {
%2 = tail call x86_fp80 @logl(x86_fp80 %0)
ret x86_fp80 %2
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void default_bzfree(void *opaque, void *addr) {
  if (addr != ((void *)0))
    free(addr);
}


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

x86 assembly (clang, -O2):
<default_bzfree>:
test   %rsi,%rsi
je     111d <default_bzfree+0xd>
mov    %rsi,%rdi
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @default_bzfree(i8* nocapture readnone %0, i8* %1) {
%3 = icmp eq i8* %1, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @free(i8* %1)
br label %6
6: ; preds = %4, %2
ret void
}
/* Variables and functions */
scalar_t__ strlen(char *);
size_t header_length_including_whitespace(char *key, char *value) {
  size_t length = 0;
  length += strlen(key);
  length += 1;
  length += 1;
  length += strlen(value);
  length += 2;
  return length;
}


x86 assembly (clang, -O0):
<header_length_including_whitespace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<header_length_including_whitespace>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
call   1030 <strlen@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1030 <strlen@plt>
add    %rbx,%rax
add    $0x4,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i64 @header_length_including_whitespace(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = add i64 %3, 4
%6 = add i64 %5, %4
ret i64 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ GenCommstatInit(int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void GenProfInit(FILE *f) {
  fprintf(f, "\n\n");
  GenCommstatInit(f);
  fprintf(f, "\n\n");
}


x86 assembly (clang, -O0):
<GenProfInit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <GenCommstatInit@plt>
mov    -0x8(%rbp),%rdi
lea    0xeb0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GenProfInit>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xed2(%rip),%r14
mov    $0x2,%esi
mov    $0x1,%edx
mov    %r14,%rdi
mov    %rbx,%rcx
call   1040 <fwrite@plt>
mov    %rbx,%rdi
call   1030 <GenCommstatInit@plt>
mov    $0x2,%esi
mov    $0x1,%edx
mov    %r14,%rdi
mov    %rbx,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <fwrite@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"\0A\0A\00"
define void @GenProfInit(i32* %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i64 2, i64 1, i32* %0)
%3 = tail call i32 @GenCommstatInit(i32* %0)
%4 = tail call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i64 2, i64 1, i32* %0)
ret void
}
/* Variables and functions */
void *init_branches_c(int);
void *init_c(int n) { return init_branches_c(n); }


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

x86 assembly (clang, -O2):
<init_c>:
jmp    1030 <init_branches_c@plt>

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

LLVM IR (-O2):
define i8* @init_c(i32 %0) {
%2 = tail call i8* @init_branches_c(i32 %0)
ret i8* %2
}
/* Variables and functions */
long long PAPI_get_real_nsec();
void papif_get_real_nsec__(long long *time) { *time = PAPI_get_real_nsec(); }


x86 assembly (clang, -O0):
<papif_get_real_nsec__>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <PAPI_get_real_nsec@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<papif_get_real_nsec__>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <PAPI_get_real_nsec@plt>
mov    %rax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @papif_get_real_nsec__(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = call i64 (...) @PAPI_get_real_nsec()
%4 = load i64*, i64** %2
store i64 %3, i64* %4
ret void
}

LLVM IR (-O2):
define void @papif_get_real_nsec__(i64* nocapture writeonly %0) {
%2 = tail call i64 (...) @PAPI_get_real_nsec()
store i64 %2, i64* %0
ret void
}
/* Variables and functions */
int f351(int *);
int f352(int *p) { return f351(p); }


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

x86 assembly (clang, -O2):
<f352>:
jmp    1030 <f351@plt>

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

LLVM IR (-O2):
define i32 @f352(i32* %0) {
%2 = tail call i32 @f351(i32* %0)
ret i32 %2
}
int special(int ch) {
  switch (ch) {
  case '"':
  case '.':
  case ';':
  case '\\':
  case '(':
  case ')':
  case '@':
  case '$':
    return 1;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<special>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x22,%eax
je     1184 <special+0x84>
jmp    111b <special+0x1b>
mov    -0xc(%rbp),%eax
sub    $0x24,%eax
je     1184 <special+0x84>
jmp    112c <special+0x2c>
mov    -0xc(%rbp),%eax
add    $0xffffffd8,%eax
sub    $0x2,%eax
jb     1184 <special+0x84>
jmp    1140 <special+0x40>
mov    -0xc(%rbp),%eax
sub    $0x2e,%eax
je     1184 <special+0x84>
jmp    1151 <special+0x51>
mov    -0xc(%rbp),%eax
sub    $0x3b,%eax
je     1184 <special+0x84>
jmp    1162 <special+0x62>
mov    -0xc(%rbp),%eax
sub    $0x40,%eax
je     1184 <special+0x84>
jmp    1173 <special+0x73>
mov    -0xc(%rbp),%eax
sub    $0x5c,%eax
jne    1190 <special+0x90>
jmp    1184 <special+0x84>
movl   $0x1,-0x4(%rbp)
jmp    1197 <special+0x97>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<special>:
add    $0xffffffde,%edi
cmp    $0x3a,%edi
ja     111e <special+0x1e>
mov    $0x1,%eax
movabs $0x4000000420010c5,%rcx
bt     %rdi,%rcx
jae    111e <special+0x1e>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @special(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 34, label %5
i32 46, label %5
i32 59, label %5
i32 92, label %5
i32 40, label %5
i32 41, label %5
i32 64, label %5
i32 36, label %5
]
5: ; preds = %1, %1, %1, %1, %1, %1, %1, %1
store i32 1, i32* %2
br label %7
6: ; preds = %1
store i32 0, i32* %2
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @special(i32 %0) {
switch i32 %0, label %2 [
i32 34, label %3
i32 46, label %3
i32 59, label %3
i32 92, label %3
i32 40, label %3
i32 41, label %3
i32 64, label %3
i32 36, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}