xunge/DecIR huggingface dataset:
void s2e_enable_timer_interrupt() {
  __asm__ __volatile__(".byte 0x0f, 0x3f\n"
                       ".byte 0x00, 0x50, 0x00, 0x00\n"
                       ".byte 0x00, 0x00, 0x00, 0x00\n");
}


x86 assembly (clang, -O0):
<s2e_enable_timer_interrupt>:
push   %rbp
mov    %rsp,%rbp
(bad)
add    %dl,0x0(%rax)
add    %al,(%rax)
add    %al,(%rax)
add    %bl,-0x3d(%rbp)

x86 assembly (clang, -O2):
<s2e_enable_timer_interrupt>:
(bad)
add    %dl,0x0(%rax)
add    %al,(%rax)
add    %al,(%rax)
add    %al,%bl

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

LLVM IR (-O2):
define void @s2e_enable_timer_interrupt() {
tail call void asm sideeffect ".byte 0x0f, 0x3f\0A.byte 0x00, 0x50, 0x00, 0x00\0A.byte 0x00, 0x00, 0x00, 0x00\0A", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
int main(int argc, char *argv[]) {
  void (*selector)() = f1();
  selector();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <f1@plt>
cltq
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   *-0x18(%rbp)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca void (...)*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 (...) @f1()
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to void (...)*
store void (...)* %9, void (...)** %6
%10 = load void (...)*, void (...)** %6
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @f1()
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to void (...)*
tail call void (...) %5()
ret i32 0
}
/* Variables and functions */
double line_segment_dist_2dx(double, double, double, double, double, double,
                             int /*<<< orphan*/ *);
double line_segment_dist_2d(double z0, double r0, double z1, double r1,
                            double z, double r) {
  return (line_segment_dist_2dx(z0, r0, z1, r1, z, r, NULL));
}


x86 assembly (clang, -O0):
<line_segment_dist_2d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
movsd  -0x28(%rbp),%xmm4
movsd  -0x30(%rbp),%xmm5
xor    %eax,%eax
mov    %eax,%edi
call   1030 <line_segment_dist_2dx@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<line_segment_dist_2d>:
xor    %edi,%edi
jmp    1030 <line_segment_dist_2dx@plt>

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

LLVM IR (-O2):
define double @line_segment_dist_2d(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = tail call double @line_segment_dist_2dx(double %0, double %1, double %2, double %3, double %4, double %5, i32* null)
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ setState(char *);
int /*<<< orphan*/ sprintf(char *, char *, char const *);
void c(const char *from) {
  char buffer[100];
  sprintf(buffer, "c() from %s", from);
  setState(buffer);
}


x86 assembly (clang, -O0):
<c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x70(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xec5(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x70(%rbp),%rdi
call   1030 <setState@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c>:
push   %rbx
sub    $0x70,%rsp
mov    %rdi,%rdx
lea    0xed1(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <setState@plt>
add    $0x70,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [12 x i8] c"c() from %s\00"
define void @c(i8* %0) {
%2 = alloca [100 x i8]
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = call i32 @setState(i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ClearONOFF();
int /*<<< orphan*/ DeinitFields();
void SwitchFrom_51(void) {
  DeinitFields();
  ClearONOFF();
}


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

x86 assembly (clang, -O2):
<SwitchFrom_51>:
push   %rax
xor    %eax,%eax
call   1030 <DeinitFields@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <ClearONOFF@plt>

LLVM IR (-O0):
define void @SwitchFrom_51() {
%1 = call i32 (...) @DeinitFields()
%2 = call i32 (...) @ClearONOFF()
ret void
}

LLVM IR (-O2):
define void @SwitchFrom_51() {
%1 = tail call i32 (...) @DeinitFields()
%2 = tail call i32 (...) @ClearONOFF()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void fizz() { puts("fizz"); }


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"fizz\00"
define void @fizz() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
int test_imm_E7uint32_reg(unsigned int val) {
  return ((val) & (0xE7 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_E7uint32_reg(i32 %0) {
%2 = and i32 %0, 231
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void test39_Test0_targetInit__I() {}


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

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

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

LLVM IR (-O2):
define void @test39_Test0_targetInit__I() {
ret void
}
void gtk_icon_view_unselect_path() {}


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

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

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

LLVM IR (-O2):
define void @gtk_icon_view_unselect_path() {
ret void
}
__attribute__((always_)) int default_cpu_to_logical_apicid(int cpu) {
  return 1 << cpu;
}


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

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

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

LLVM IR (-O2):
define i32 @default_cpu_to_logical_apicid(i32 %0) {
%2 = shl nuw i32 1, %0
ret i32 %2
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int stat(char const *, struct stat *);
int __xstat(int ver, const char *path, struct stat *buf) {
  return stat(path, buf);
}


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

x86 assembly (clang, -O2):
<__xstat>:
mov    %rsi,%rdi
mov    %rdx,%rsi
jmp    1030 <stat@plt>

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

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @__xstat(i32 %0, i8* nocapture %1, %struct.stat* nocapture %2) {
%4 = tail call i32 @stat(i8* %1, %struct.stat* %2)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ printf(char *);
void updateLog(FILE **fp) {
  *fp = fopen("logDebug.log", "w+b");
  if (*fp == NULL) {
    printf("cannot debug \n");
  } else {
  }
}


x86 assembly (clang, -O0):
<updateLog>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
lea    0xed3(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
jne    1168 <updateLog+0x48>
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
jmp    116d <updateLog+0x4d>
jmp    116d <updateLog+0x4d>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<updateLog>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
lea    0xedb(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,(%rbx)
test   %rax,%rax
je     1141 <updateLog+0x21>
pop    %rbx
ret
lea    0xec9(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"logDebug.log\00"
@.str.1 = [4 x i8] c"w+b\00"
@.str.2 = [15 x i8] c"cannot debug \0A\00"
define void @updateLog(i32** %0) {
%2 = alloca i32**
store i32** %0, i32*** %2
%3 = call i32* @fopen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%4 = load i32**, i32*** %2
store i32* %3, i32** %4
%5 = load i32**, i32*** %2
%6 = load i32*, i32** %5
%7 = icmp eq i32* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
br label %11
10: ; preds = %1
br label %11
11: ; preds = %10, %8
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"logDebug.log\00"
@.str.1 = [4 x i8] c"w+b\00"
@str = [14 x i8] c"cannot debug \00"
define void @updateLog(i32** nocapture writeonly %0) {
%2 = tail call i32* @fopen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
store i32* %2, i32** %0
%3 = icmp eq i32* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
br label %6
6: ; preds = %1, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
void nap(int ms) { (void)usleep(ms * 1000); }


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

x86 assembly (clang, -O2):
<nap>:
imul   $0x3e8,%edi,%edi
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @nap(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 1000
%5 = call i32 @usleep(i32 %4)
ret void
}

LLVM IR (-O2):
define void @nap(i32 %0) {
%2 = mul nsw i32 %0, 1000
%3 = tail call i32 @usleep(i32 %2)
ret void
}
/* Variables and functions */
int getch();
int /*<<< orphan*/ putchar(int);
int /*<<< orphan*/ ungetch(int);
int main(void) {
  int c;
  while ((c = getch()) != '\n')
    putchar(c);
  ungetch(c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <getch@plt>
mov    %eax,-0x8(%rbp)
cmp    $0xa,%eax
je     115f <main+0x2f>
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
jmp    113f <main+0xf>
mov    -0x8(%rbp),%edi
call   1040 <ungetch@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <getch@plt>
cmp    $0xa,%eax
je     1155 <main+0x25>
mov    %eax,%edi
call   1030 <putchar@plt>
jmp    1140 <main+0x10>
mov    $0xa,%edi
call   1040 <ungetch@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @getch()
%2 = icmp eq i32 %1, 10
br i1 %2, label %8, label %3
3: ; preds = %0, %3
%4 = phi i32 [ %6, %3 ], [ %1, %0 ]
%5 = tail call i32 @putchar(i32 %4)
%6 = tail call i32 (...) @getch()
%7 = icmp eq i32 %6, 10
br i1 %7, label %8, label %3
8: ; preds = %3, %0
%9 = tail call i32 @ungetch(i32 10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int trailingZeroes(int);
int main(void) {
  int a = 10;
  printf("%d\n", trailingZeroes(a));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @trailingZeroes(i32 10)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int memcmp(char const *, char const *, size_t);
int compare_str(const char *src_key, size_t src_key_size, const char *dest_key,
                size_t dest_key_size) {
  if (src_key_size <= dest_key_size)
    return memcmp(src_key, dest_key, src_key_size);
  else
    return memcmp(src_key, dest_key, dest_key_size);
}


x86 assembly (clang, -O0):
<compare_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x28(%rbp),%rax
ja     114f <compare_str+0x3f>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <memcmp@plt>
mov    %eax,-0x4(%rbp)
jmp    1163 <compare_str+0x53>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
call   1030 <memcmp@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_str>:
mov    %rsi,%rax
cmp    %rcx,%rsi
cmova  %rcx,%rax
mov    %rdx,%rsi
mov    %rax,%rdx
jmp    1030 <memcmp@plt>

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

LLVM IR (-O2):
define i32 @compare_str(i8* nocapture %0, i64 %1, i8* nocapture %2, i64 %3) {
%5 = icmp ugt i64 %1, %3
%6 = select i1 %5, i64 %3, i64 %1
%7 = tail call i32 @memcmp(i8* %0, i8* %2, i64 %6)
ret i32 %7
}
/* Variables and functions */
int order_table(int);
int LabedevP(int rule) { return order_table(rule + 1); }


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

x86 assembly (clang, -O2):
<LabedevP>:
add    $0x1,%edi
jmp    1030 <order_table@plt>

LLVM IR (-O0):
define i32 @LabedevP(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
%5 = call i32 @order_table(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @LabedevP(i32 %0) {
%2 = add nsw i32 %0, 1
%3 = tail call i32 @order_table(i32 %2)
ret i32 %3
}
/* Variables and functions */
void glmSub3fv(float out[3], const float x[3], const float y[3]) {
  for (size_t i = 0; i < 3; ++i)
    out[i] = x[i] - y[i];
}


x86 assembly (clang, -O0):
<glmSub3fv>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
cmpq   $0x3,-0x20(%rbp)
jae    115b <glmSub3fv+0x5b>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
subss  (%rax,%rcx,4),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1118 <glmSub3fv+0x18>
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmSub3fv>:
movss  (%rsi),%xmm0
subss  (%rdx),%xmm0
movss  %xmm0,(%rdi)
movss  0x4(%rsi),%xmm0
subss  0x4(%rdx),%xmm0
movss  %xmm0,0x4(%rdi)
movss  0x8(%rsi),%xmm0
subss  0x8(%rdx),%xmm0
movss  %xmm0,0x8(%rdi)
ret

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

LLVM IR (-O2):
define void @glmSub3fv(float* nocapture writeonly %0, float* nocapture %1, float* nocapture %2) {
%4 = load float, float* %1
%5 = load float, float* %2
%6 = fsub float %4, %5
store float %6, float* %0
%7 = getelementptr inbounds float, float* %1, i64 1
%8 = load float, float* %7
%9 = getelementptr inbounds float, float* %2, i64 1
%10 = load float, float* %9
%11 = fsub float %8, %10
%12 = getelementptr inbounds float, float* %0, i64 1
store float %11, float* %12
%13 = getelementptr inbounds float, float* %1, i64 2
%14 = load float, float* %13
%15 = getelementptr inbounds float, float* %2, i64 2
%16 = load float, float* %15
%17 = fsub float %14, %16
%18 = getelementptr inbounds float, float* %0, i64 2
store float %17, float* %18
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int place;
};
typedef TYPE_1__ XCirculateEvent;

/* Variables and functions */
void set_XCirculateEvent_place(void *_p, int _v) {
  ((XCirculateEvent *)_p)->place = (int)_v;
}


x86 assembly (clang, -O0):
<set_XCirculateEvent_place>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_XCirculateEvent_place>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XCirculateEvent_place(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XCirculateEvent_place(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
size_t SIZE_MAX;
void *ralloc_size(void const *, size_t);
void *ralloc_array_size(const void *ctx, size_t size, unsigned count) {
  if (count > SIZE_MAX / size)
    return NULL;
  return ralloc_size(ctx, size * count);
}


x86 assembly (clang, -O0):
<ralloc_array_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %rax,-0x28(%rbp)
mov    0x2ea7(%rip),%rax
mov    (%rax),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x18(%rbp)
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
cmp    %rcx,%rax
jbe    1159 <ralloc_array_size+0x49>
movq   $0x0,-0x8(%rbp)
jmp    1171 <ralloc_array_size+0x61>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%eax
imul   %rax,%rsi
call   1030 <ralloc_size@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ralloc_array_size>:
mov    %edx,%ecx
mov    0x2ebf(%rip),%rax
mov    (%rax),%rax
mov    %rax,%rdx
or     %rsi,%rdx
shr    $0x20,%rdx
je     1135 <ralloc_array_size+0x25>
xor    %edx,%edx
div    %rsi
cmp    %rcx,%rax
jae    113e <ralloc_array_size+0x2e>
xor    %eax,%eax
ret
xor    %edx,%edx
div    %esi
cmp    %rcx,%rax
jb     1132 <ralloc_array_size+0x22>
imul   %rsi,%rcx
mov    %rcx,%rsi
jmp    1030 <ralloc_size@plt>

LLVM IR (-O0):
@SIZE_MAX = global i64 0
define i8* @ralloc_array_size(i8* %0, i64 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i32
store i8* %0, i8** %5
store i64 %1, i64* %6
store i32 %2, i32* %7
%8 = load i32, i32* %7
%9 = zext i32 %8 to i64
%10 = load i64, i64* @SIZE_MAX
%11 = load i64, i64* %6
%12 = udiv i64 %10, %11
%13 = icmp ugt i64 %9, %12
br i1 %13, label %14, label %15
14: ; preds = %3
store i8* null, i8** %4
br label %22
15: ; preds = %3
%16 = load i8*, i8** %5
%17 = load i64, i64* %6
%18 = load i32, i32* %7
%19 = zext i32 %18 to i64
%20 = mul i64 %17, %19
%21 = call i8* @ralloc_size(i8* %16, i64 %20)
store i8* %21, i8** %4
br label %22
22: ; preds = %15, %14
%23 = load i8*, i8** %4
ret i8* %23
}

LLVM IR (-O2):
@SIZE_MAX = global i64 0
define i8* @ralloc_array_size(i8* %0, i64 %1, i32 %2) {
%4 = zext i32 %2 to i64
%5 = load i64, i64* @SIZE_MAX
%6 = udiv i64 %5, %1
%7 = icmp ult i64 %6, %4
br i1 %7, label %11, label %8
8: ; preds = %3
%9 = mul i64 %4, %1
%10 = tail call i8* @ralloc_size(i8* %0, i64 %9)
br label %11
11: ; preds = %3, %8
%12 = phi i8* [ %10, %8 ], [ null, %3 ]
ret i8* %12
}
/* Variables and functions */
int /*<<< orphan*/ put_byte(int, int);
int /*<<< orphan*/ put_word(int, int);
__attribute__((always_)) void patch_NCAS_3_6_0_546_extra(void) {
  put_word(0x100BE8B4, 0xE12FFF1E);
  put_byte(0x1008E1FB, 0xEA);
  put_word(0x10135DF4, 0xE12FFF1E);
}


x86 assembly (clang, -O0):
<patch_NCAS_3_6_0_546_extra>:
push   %rbp
mov    %rsp,%rbp
mov    $0x100be8b4,%edi
mov    $0xe12fff1e,%esi
call   1040 <put_word@plt>
mov    $0x1008e1fb,%edi
mov    $0xea,%esi
call   1030 <put_byte@plt>
mov    $0x10135df4,%edi
mov    $0xe12fff1e,%esi
call   1040 <put_word@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<patch_NCAS_3_6_0_546_extra>:
push   %rax
mov    $0x100be8b4,%edi
mov    $0xe12fff1e,%esi
call   1040 <put_word@plt>
mov    $0x1008e1fb,%edi
mov    $0xea,%esi
call   1030 <put_byte@plt>
mov    $0x10135df4,%edi
mov    $0xe12fff1e,%esi
pop    %rax
jmp    1040 <put_word@plt>

LLVM IR (-O0):
define void @patch_NCAS_3_6_0_546_extra() {
%1 = call i32 @put_word(i32 269215924, i32 -516948194)
%2 = call i32 @put_byte(i32 269017595, i32 234)
%3 = call i32 @put_word(i32 269704692, i32 -516948194)
ret void
}

LLVM IR (-O2):
define void @patch_NCAS_3_6_0_546_extra() {
%1 = tail call i32 @put_word(i32 269215924, i32 -516948194)
%2 = tail call i32 @put_byte(i32 269017595, i32 234)
%3 = tail call i32 @put_word(i32 269704692, i32 -516948194)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ my_sleep(int);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/, ...);
int /*<<< orphan*/ pthread_self();
void *thr_fun(void *arg) {
  int n = (int)arg;
  printf("[%lu] running\n", pthread_self());
  my_sleep(n);
  printf("[%lu] sleep %d seconds\n", pthread_self(), n);
  return NULL;
}


x86 assembly (clang, -O0):
<thr_fun>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1040 <pthread_self@plt>
mov    %eax,%esi
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%edi
call   1050 <my_sleep@plt>
mov    $0x0,%al
call   1040 <pthread_self@plt>
mov    %eax,%esi
mov    -0xc(%rbp),%edx
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thr_fun>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <pthread_self@plt>
lea    0xebe(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %ebx,%edi
call   1050 <my_sleep@plt>
xor    %eax,%eax
call   1040 <pthread_self@plt>
lea    0xeaf(%rip),%rdi
mov    %eax,%esi
mov    %ebx,%edx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"[%lu] running\0A\00"
@.str.1 = [24 x i8] c"[%lu] sleep %d seconds\0A\00"
define i8* @thr_fun(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = ptrtoint i8* %4 to i32
store i32 %5, i32* %3
%6 = call i32 (...) @pthread_self()
%7 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i32, i32* %3
%9 = call i32 @my_sleep(i32 %8)
%10 = call i32 (...) @pthread_self()
%11 = load i32, i32* %3
%12 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %10, i32 %11)
ret i8* null
}

LLVM IR (-O2):
@.str = [15 x i8] c"[%lu] running\0A\00"
@.str.1 = [24 x i8] c"[%lu] sleep %d seconds\0A\00"
define noalias i8* @thr_fun(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
%4 = tail call i32 (...) @pthread_self()
%5 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = tail call i32 @my_sleep(i32 %3)
%7 = tail call i32 (...) @pthread_self()
%8 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %7, i32 %3)
ret i8* null
}
/* Variables and functions */
int isspace(int);
int space(int c) { return isspace(c); }


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

x86 assembly (clang, -O2):
<space>:
jmp    1030 <isspace@plt>

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

LLVM IR (-O2):
define i32 @space(i32 %0) {
%2 = tail call i32 @isspace(i32 %0)
ret i32 %2
}
/* Variables and functions */
int CHAR_BIT;
long uint_array_size(long bits) {
  return (bits <= 0) ? 0
                     : ((bits - 1) / ((sizeof(unsigned int)) * CHAR_BIT) + 1);
}


x86 assembly (clang, -O0):
<uint_array_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jg     111e <uint_array_size+0x1e>
xor    %eax,%eax
mov    %rax,-0x10(%rbp)
jmp    1141 <uint_array_size+0x41>
mov    -0x8(%rbp),%rax
sub    $0x1,%rax
mov    0x2eb3(%rip),%rcx
movslq (%rcx),%rcx
shl    $0x2,%rcx
xor    %edx,%edx
div    %rcx
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uint_array_size>:
test   %rdi,%rdi
jle    1130 <uint_array_size+0x30>
add    $0xffffffffffffffff,%rdi
mov    0x2ed0(%rip),%rax
movslq (%rax),%rcx
shl    $0x2,%rcx
mov    %rdi,%rax
or     %rcx,%rax
shr    $0x20,%rax
je     1133 <uint_array_size+0x33>
mov    %rdi,%rax
xor    %edx,%edx
div    %rcx
add    $0x1,%rax
ret
xor    %eax,%eax
ret
mov    %edi,%eax
xor    %edx,%edx
div    %ecx
add    $0x1,%rax
ret

LLVM IR (-O0):
@CHAR_BIT = global i32 0
define i64 @uint_array_size(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp sle i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %14
6: ; preds = %1
%7 = load i64, i64* %2
%8 = sub nsw i64 %7, 1
%9 = load i32, i32* @CHAR_BIT
%10 = sext i32 %9 to i64
%11 = mul i64 4, %10
%12 = udiv i64 %8, %11
%13 = add i64 %12, 1
br label %14
14: ; preds = %6, %5
%15 = phi i64 [ 0, %5 ], [ %13, %6 ]
ret i64 %15
}

LLVM IR (-O2):
@CHAR_BIT = global i32 0
define i64 @uint_array_size(i64 %0) {
%2 = icmp slt i64 %0, 1
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = add nsw i64 %0, -1
%5 = load i32, i32* @CHAR_BIT
%6 = sext i32 %5 to i64
%7 = shl nsw i64 %6, 2
%8 = udiv i64 %4, %7
%9 = add nuw nsw i64 %8, 1
br label %10
10: ; preds = %1, %3
%11 = phi i64 [ %9, %3 ], [ 0, %1 ]
ret i64 %11
}
/* Variables and functions */
unsigned int encode_basepairs(char *, int);
int check_15mer(char *string, unsigned char *map, int n) {
  unsigned int which;
  unsigned char mask, final;
  int i, j;
  which = encode_basepairs(string, n);
  i = which / 8;
  j = which % 8;
  mask = 1 << j;
  final = map[i] & mask;
  return final;
}


x86 assembly (clang, -O0):
<check_15mer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <encode_basepairs@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
shr    $0x3,%eax
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%eax
and    $0x7,%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %al,-0x19(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
movzbl -0x19(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0x1a(%rbp)
movzbl -0x1a(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_15mer>:
push   %rbx
mov    %rsi,%rbx
mov    %edx,%esi
call   1030 <encode_basepairs@plt>
mov    %eax,%edx
and    $0x7,%al
mov    $0x1,%esi
mov    %eax,%ecx
shl    %cl,%esi
shr    $0x3,%rdx
and    (%rbx,%rdx,1),%sil
movzbl %sil,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @check_15mer(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8
%9 = alloca i8
%10 = alloca i32
%11 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%12 = load i8*, i8** %4
%13 = load i32, i32* %6
%14 = call i32 @encode_basepairs(i8* %12, i32 %13)
store i32 %14, i32* %7
%15 = load i32, i32* %7
%16 = udiv i32 %15, 8
store i32 %16, i32* %10
%17 = load i32, i32* %7
%18 = urem i32 %17, 8
store i32 %18, i32* %11
%19 = load i32, i32* %11
%20 = shl i32 1, %19
%21 = trunc i32 %20 to i8
store i8 %21, i8* %8
%22 = load i8*, i8** %5
%23 = load i32, i32* %10
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i8, i8* %22, i64 %24
%26 = load i8, i8* %25
%27 = zext i8 %26 to i32
%28 = load i8, i8* %8
%29 = zext i8 %28 to i32
%30 = and i32 %27, %29
%31 = trunc i32 %30 to i8
store i8 %31, i8* %9
%32 = load i8, i8* %9
%33 = zext i8 %32 to i32
ret i32 %33
}

LLVM IR (-O2):
define i32 @check_15mer(i8* %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @encode_basepairs(i8* %0, i32 %2)
%5 = lshr i32 %4, 3
%6 = and i32 %4, 7
%7 = shl nuw nsw i32 1, %6
%8 = zext i32 %5 to i64
%9 = getelementptr inbounds i8, i8* %1, i64 %8
%10 = load i8, i8* %9
%11 = trunc i32 %7 to i8
%12 = and i8 %10, %11
%13 = zext i8 %12 to i32
ret i32 %13
}
void SHA512(void) {}


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

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

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

LLVM IR (-O2):
define void @SHA512() {
ret void
}
double erfc(double x) { return 0.0; }


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

x86 assembly (clang, -O2):
<erfc>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @erfc(double %0) {
%2 = alloca double
store double %0, double* %2
ret double 0.000000e+00
}

LLVM IR (-O2):
define double @erfc(double %0) {
ret double 0.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char, char *, char, char, char, char, char,
                          char, char);
int main(void) {
  char *a = "int main(void){char* a=%c%s%c;char c='%c%c';char b='%c%c';char "
            "d='%cn';printf(a,b,a,b,c,c,c,b,c,d);return(0);}%c";
  char c = '\\';
  char b = '\"';
  char d = '\n';
  printf(a, b, a, b, c, c, c, b, c, d);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rax
mov    %rax,-0x10(%rbp)
movb   $0x5c,-0x11(%rbp)
movb   $0x22,-0x12(%rbp)
movb   $0xa,-0x13(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x12(%rbp),%sil
mov    -0x10(%rbp),%rdx
mov    -0x12(%rbp),%cl
mov    -0x11(%rbp),%r8b
mov    -0x11(%rbp),%r9b
mov    -0x11(%rbp),%r11b
mov    -0x12(%rbp),%r10b
mov    -0x11(%rbp),%al
movsbl %sil,%esi
movsbl %cl,%ecx
movsbl %r8b,%r8d
movsbl %r9b,%r9d
movsbl %r11b,%r11d
mov    %r11d,(%rsp)
movsbl %r10b,%r10d
mov    %r10d,0x8(%rsp)
movsbl %al,%eax
mov    %eax,0x10(%rsp)
movsbl -0x13(%rbp),%eax
mov    %eax,0x18(%rsp)
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x22,%esi
mov    %rdi,%rdx
mov    $0x22,%ecx
mov    $0x5c,%r8d
mov    $0x5c,%r9d
push   $0xa
push   $0x5c
push   $0x22
push   $0x5c
call   1030 <printf@plt>
add    $0x20,%rsp
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [113 x i8] c"int main(void){char* a=%c%s%c;char c='%c%c';char b='%c%c';char d='%cn';printf(a,b,a,b,c,c,c,b,c,d);return(0);}%c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8
%4 = alloca i8
%5 = alloca i8
store i32 0, i32* %1
store i8* getelementptr inbounds ([113 x i8], [113 x i8]* @.str, i64 0, i64 0), i8** %2
store i8 92, i8* %3
store i8 34, i8* %4
store i8 10, i8* %5
%6 = load i8*, i8** %2
%7 = load i8, i8* %4
%8 = load i8*, i8** %2
%9 = load i8, i8* %4
%10 = load i8, i8* %3
%11 = load i8, i8* %3
%12 = load i8, i8* %3
%13 = load i8, i8* %4
%14 = load i8, i8* %3
%15 = load i8, i8* %5
%16 = call i32 @printf(i8* %6, i8 signext %7, i8* %8, i8 signext %9, i8 signext %10, i8 signext %11, i8 signext %12, i8 signext %13, i8 signext %14, i8 signext %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [113 x i8] c"int main(void){char* a=%c%s%c;char c='%c%c';char b='%c%c';char d='%cn';printf(a,b,a,b,c,c,c,b,c,d);return(0);}%c\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([113 x i8], [113 x i8]* @.str, i64 0, i64 0), i8 signext 34, i8* getelementptr inbounds ([113 x i8], [113 x i8]* @.str, i64 0, i64 0), i8 signext 34, i8 signext 92, i8 signext 92, i8 signext 92, i8 signext 34, i8 signext 92, i8 signext 10)
ret i32 0
}
int main() {
  struct student {
    int id;
    char name[40];
  };
  struct student one;
  one.id = 1;
  strcpy(one.name, "Tahmid Rafi");
  printf("ID: %d\n", one.id);
  printf("Name: %s\n", one.name);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x30(%rbp)
lea    -0x30(%rbp),%rdi
add    $0x4,%rdi
lea    0xebb(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x30(%rbp),%esi
lea    0xeb8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x30(%rbp),%rsi
add    $0x4,%rsi
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
movl   $0x1,(%rsp)
lea    0x4(%rsp),%rbx
movabs $0x522064696d686154,%rax
64 20 52
mov    %rax,0x4(%rsp)
movl   $0x696661,0xc(%rsp)
lea    0xecd(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xec2(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.student = type { i32, [40 x i8] }
@.str = [12 x i8] c"Tahmid Rafi\00"
@.str.1 = [8 x i8] c"ID: %d\0A\00"
@.str.2 = [10 x i8] c"Name: %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.student
store i32 0, i32* %1
%3 = getelementptr inbounds %struct.student, %struct.student* %2, i32 0, i32 0
store i32 1, i32* %3
%4 = getelementptr inbounds %struct.student, %struct.student* %2, i32 0, i32 1
%5 = getelementptr inbounds [40 x i8], [40 x i8]* %4, i64 0, i64 0
%6 = call i8* @strcpy(i8* %5, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%7 = getelementptr inbounds %struct.student, %struct.student* %2, i32 0, i32 0
%8 = load i32, i32* %7
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %8)
%10 = getelementptr inbounds %struct.student, %struct.student* %2, i32 0, i32 1
%11 = getelementptr inbounds [40 x i8], [40 x i8]* %10, i64 0, i64 0
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* %11)
ret i32 0
}

LLVM IR (-O2):
%struct.student = type { i32, [40 x i8] }
@.str = [12 x i8] c"Tahmid Rafi\00"
@.str.1 = [8 x i8] c"ID: %d\0A\00"
@.str.2 = [10 x i8] c"Name: %s\0A\00"
define i32 @main() {
%1 = alloca %struct.student
%2 = bitcast %struct.student* %1 to i8*
%3 = getelementptr inbounds %struct.student, %struct.student* %1, i64 0, i32 0
store i32 1, i32* %3
%4 = getelementptr inbounds %struct.student, %struct.student* %1, i64 0, i32 1, i64 0
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 1)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* %4)
ret i32 0
}
/* Variables and functions */
scalar_t__ strchr(char const *, int /*<<< orphan*/);
char *strpbrk(const char *str, const char *keys) {
  while (*str)
    if (strchr(keys, *str++))
      return (char *)--str;
  return NULL;
}


x86 assembly (clang, -O0):
<strpbrk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     116c <strpbrk+0x5c>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%esi
call   1030 <strchr@plt>
cmp    $0x0,%rax
je     1167 <strpbrk+0x57>
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
mov    %rax,-0x8(%rbp)
jmp    1174 <strpbrk+0x64>
jmp    1120 <strpbrk+0x10>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strpbrk>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
xchg   %ax,%ax
movsbl 0x1(%rbx),%esi
test   %esi,%esi
je     113b <strpbrk+0x2b>
mov    %r14,%rdi
call   1030 <strchr@plt>
add    $0x1,%rbx
test   %rax,%rax
je     1120 <strpbrk+0x10>
jmp    113d <strpbrk+0x2d>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @strpbrk(i8* %0, i8* %1) {
br label %3
3: ; preds = %7, %2
%4 = phi i8* [ %0, %2 ], [ %8, %7 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
br i1 %6, label %12, label %7
7: ; preds = %3
%8 = getelementptr inbounds i8, i8* %4, i64 1
%9 = sext i8 %5 to i32
%10 = tail call i64 @strchr(i8* %1, i32 %9)
%11 = icmp eq i64 %10, 0
br i1 %11, label %3, label %12
12: ; preds = %3, %7
%13 = phi i8* [ %4, %7 ], [ null, %3 ]
ret i8* %13
}
const char *proginfo_version(void) {
  const char *s = "v0.2.5";
  return s;
}


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"v0.2.5\00"
define i8* @proginfo_version() {
%1 = alloca i8*
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = load i8*, i8** %1
ret i8* %2
}

LLVM IR (-O2):
@.str = [7 x i8] c"v0.2.5\00"
define i8* @proginfo_version() {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t pixel64_get_g16(uint64_t pixel) { return (pixel & 0xFFFF0000) >> 16; }


x86 assembly (clang, -O0):
<pixel64_get_g16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffff0000,%eax
shr    $0x10,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pixel64_get_g16>:
mov    %edi,%eax
shr    $0x10,%eax
ret

LLVM IR (-O0):
define i32 @pixel64_get_g16(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, -65536
%5 = lshr i32 %4, 16
ret i32 %5
}

LLVM IR (-O2):
define i32 @pixel64_get_g16(i32 %0) {
%2 = lshr i32 %0, 16
ret i32 %2
}
double
f4_cb_send_pre_double_double_double_double_double_double_double_double_short(
    double (*cb)(double, double, double, double, double, double, double, double,
                 short)) {
  short r = -22;
  return cb(8.25, 9.25, 10.25, 11.25, 12.25, 13.25, 14.25, 15.25, r) + 1.0;
}


x86 assembly (clang, -O0):
<f4_cb_send_pre_double_double_double_double_double_double_double_double_short>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movw   $0xffea,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movsd  0xeea(%rip),%xmm0
movsd  0xeea(%rip),%xmm1
movsd  0xeea(%rip),%xmm2
movsd  0xeea(%rip),%xmm3
movsd  0xeea(%rip),%xmm4
movsd  0xeea(%rip),%xmm5
movsd  0xeea(%rip),%xmm6
movsd  0xeea(%rip),%xmm7
movswl -0xa(%rbp),%edi
call   *%rax
movsd  0xe9c(%rip),%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4_cb_send_pre_double_double_double_double_double_double_double_double_short>:
push   %rax
mov    %rdi,%rax
movsd  0xef4(%rip),%xmm0
movsd  0xef4(%rip),%xmm1
movsd  0xef4(%rip),%xmm2
movsd  0xef4(%rip),%xmm3
movsd  0xef4(%rip),%xmm4
movsd  0xef4(%rip),%xmm5
movsd  0xef4(%rip),%xmm6
movsd  0xef4(%rip),%xmm7
mov    $0xffffffea,%edi
call   *%rax
addsd  0xeed(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @f4_cb_send_pre_double_double_double_double_double_double_double_double_short(double (double, double, double, double, double, double, double, double, i16)* %0) {
%2 = alloca double (double, double, double, double, double, double, double, double, i16)*
%3 = alloca i16
store double (double, double, double, double, double, double, double, double, i16)* %0, double (double, double, double, double, double, double, double, double, i16)** %2
store i16 -22, i16* %3
%4 = load double (double, double, double, double, double, double, double, double, i16)*, double (double, double, double, double, double, double, double, double, i16)** %2
%5 = load i16, i16* %3
%6 = call double %4(double 8.250000e+00, double 9.250000e+00, double 1.025000e+01, double 1.125000e+01, double 1.225000e+01, double 1.325000e+01, double 1.425000e+01, double 1.525000e+01, i16 signext %5)
%7 = fadd double %6, 1.000000e+00
ret double %7
}

LLVM IR (-O2):
define double @f4_cb_send_pre_double_double_double_double_double_double_double_double_short(double (double, double, double, double, double, double, double, double, i16)* nocapture %0) {
%2 = tail call double %0(double 8.250000e+00, double 9.250000e+00, double 1.025000e+01, double 1.125000e+01, double 1.225000e+01, double 1.325000e+01, double 1.425000e+01, double 1.525000e+01, i16 signext -22)
%3 = fadd double %2, 1.000000e+00
ret double %3
}
int f1() {
  int y = 1;
  y++;
  return y;
}


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

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

LLVM IR (-O0):
define i32 @f1() {
%1 = alloca i32
store i32 1, i32* %1
%2 = load i32, i32* %1
%3 = add nsw i32 %2, 1
store i32 %3, i32* %1
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
define i32 @f1() {
ret i32 2
}
int ENS_Detect(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @ENS_Detect() {
ret i32 1
}

LLVM IR (-O2):
define i32 @ENS_Detect() {
ret i32 1
}