xunge/DecIR huggingface dataset:
char *f() {
  char *p = __builtin_malloc(42);
  __builtin_memset(p, 3, 33);
  __builtin_memset(p, 7, 10);
  return p;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x2a,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x3,%esi
mov    $0x21,%edx
call   1030 <memset@plt>
mov    -0x8(%rbp),%rdi
mov    $0x7,%esi
mov    $0xa,%edx
call   1030 <memset@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rax
mov    $0x2a,%edi
call   1030 <malloc@plt>
movaps 0xede(%rip),%xmm0
movups %xmm0,0xa(%rax)
movabs $0x303030303030303,%rcx
03 03 03
mov    %rcx,0x19(%rax)
movabs $0x707070707070707,%rcx
07 07 07
mov    %rcx,(%rax)
movw   $0x707,0x8(%rax)
pop    %rcx
ret

LLVM IR (-O0):
define i8* @f() {
%1 = alloca i8*
%2 = call i8* @malloc(i64 42)
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = load i8*, i8** %1
%5 = load i8*, i8** %1
ret i8* %5
}

LLVM IR (-O2):
define noalias i8* @f() {
%1 = tail call dereferenceable_or_null(42) i8* @malloc(i64 42)
%2 = getelementptr inbounds i8, i8* %1, i64 10
tail call void @llvm.memset.p0i8.i64(i8* align 1 dereferenceable(33) %2, i8 3, i64 23, i1 false)
tail call void @llvm.memset.p0i8.i64(i8* align 1 dereferenceable(10) %1, i8 7, i64 10, i1 false)
ret i8* %1
}
void __attribute__((no)) g(int x, ...) { asm volatile("" : : "g"(x)); }


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
mov    %edi,-0x4(%rsp)
ret

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

LLVM IR (-O2):
define void @g(i32 %0, ...) {
tail call void asm sideeffect "", "imr,~{dirflag},~{fpsr},~{flags}"(i32 %0)
ret void
}
unsigned long convert_timer_to_ns(unsigned long ticks) {
  return ticks * 1000 / 24000;
}


x86 assembly (clang, -O0):
<convert_timer_to_ns>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
imul   $0x3e8,-0x8(%rbp),%rax
mov    $0x5dc0,%ecx
xor    %edx,%edx
div    %rcx
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_timer_to_ns>:
imul   $0x3e8,%rdi,%rax
movabs $0xaec33e1f671529a5,%rcx
3e c3 ae
mul    %rcx
mov    %rdx,%rax
shr    $0xe,%rax
ret

LLVM IR (-O0):
define i64 @convert_timer_to_ns(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = mul i64 %3, 1000
%5 = udiv i64 %4, 24000
ret i64 %5
}

LLVM IR (-O2):
define i64 @convert_timer_to_ns(i64 %0) {
%2 = mul i64 %0, 1000
%3 = udiv i64 %2, 24000
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ kprintf(char *, int);
void isrHandle2() { kprintf("ISR %d.\n", 2); }


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

x86 assembly (clang, -O2):
<isrHandle2>:
lea    0xee9(%rip),%rdi
mov    $0x2,%esi
jmp    1030 <kprintf@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"ISR %d.\0A\00"
define void @isrHandle2() {
%1 = call i32 @kprintf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 2)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"ISR %d.\0A\00"
define void @isrHandle2() {
%1 = tail call i32 @kprintf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 2)
ret void
}
void callme(void) {}


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

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

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

LLVM IR (-O2):
define void @callme() {
ret void
}
void strength_test3(int *data) {
  int i = data[0];
  int j = data[1];
  do {
    data[data[2]] = 2;
    i = i + 1;
    j = j + 1;
  } while (i * j < data[3]);
}


x86 assembly (clang, -O0):
<strength_test3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
movslq 0x8(%rcx),%rcx
movl   $0x2,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
imul   -0x10(%rbp),%eax
mov    -0x8(%rbp),%rcx
cmp    0xc(%rcx),%eax
jl     111b <strength_test3+0x1b>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strength_test3>:
mov    (%rdi),%eax
mov    0x4(%rdi),%ecx
add    $0x1,%eax
add    $0x1,%ecx
nopl   0x0(%rax,%rax,1)
movslq 0x8(%rdi),%rdx
movl   $0x2,(%rdi,%rdx,4)
mov    %ecx,%edx
imul   %eax,%edx
add    $0x1,%eax
add    $0x1,%ecx
cmp    0xc(%rdi),%edx
jl     1110 <strength_test3+0x10>
ret

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

LLVM IR (-O2):
define void @strength_test3(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = load i32, i32* %3
%5 = getelementptr inbounds i32, i32* %0, i64 2
%6 = getelementptr inbounds i32, i32* %0, i64 3
br label %7
7: ; preds = %7, %1
%8 = phi i32 [ %2, %1 ], [ %13, %7 ]
%9 = phi i32 [ %4, %1 ], [ %14, %7 ]
%10 = load i32, i32* %5
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i32, i32* %0, i64 %11
store i32 2, i32* %12
%13 = add nsw i32 %8, 1
%14 = add nsw i32 %9, 1
%15 = mul nsw i32 %14, %13
%16 = load i32, i32* %6
%17 = icmp slt i32 %15, %16
br i1 %17, label %7, label %18
18: ; preds = %7
ret void
}
void runcmd(s) char *s;
{ system(s); }


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

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

LLVM IR (-O0):
define void @runcmd(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @system to i32 (i8*, ...)*)(i8* %3)
ret void
}

LLVM IR (-O2):
define void @runcmd(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @system to i32 (i8*, ...)*)(i8* %0)
ret void
}
/* Variables and functions */
unsigned long getTotient(unsigned long);
unsigned long getTotientInverse(unsigned long n) { return n - getTotient(n); }


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

x86 assembly (clang, -O2):
<getTotientInverse>:
push   %rbx
mov    %rdi,%rbx
call   1030 <getTotient@plt>
sub    %rax,%rbx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @getTotientInverse(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = load i64, i64* %2
%5 = call i64 @getTotient(i64 %4)
%6 = sub i64 %3, %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @getTotientInverse(i64 %0) {
%2 = tail call i64 @getTotient(i64 %0)
%3 = sub i64 %0, %2
ret i64 %3
}
/* Variables and functions */
scalar_t__ is_screensaver_active();
int /*<<< orphan*/ screensaver_off();
void key4_event() {
  if (is_screensaver_active()) {
    screensaver_off();
    return;
  }
  screensaver_off();
}


x86 assembly (clang, -O0):
<key4_event>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <is_screensaver_active@plt>
cmp    $0x0,%rax
je     1141 <key4_event+0x21>
mov    $0x0,%al
call   1040 <screensaver_off@plt>
jmp    1148 <key4_event+0x28>
mov    $0x0,%al
call   1040 <screensaver_off@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @key4_event() {
%1 = call i64 (...) @is_screensaver_active()
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 (...) @screensaver_off()
br label %7
5: ; preds = %0
%6 = call i32 (...) @screensaver_off()
br label %7
7: ; preds = %5, %3
ret void
}

LLVM IR (-O2):
define void @key4_event() {
%1 = tail call i64 (...) @is_screensaver_active()
%2 = tail call i32 (...) @screensaver_off()
ret void
}
int s2e_version() {
  int version;
  __asm__ __volatile__(".byte 0x0f, 0x3f\n"
                       ".byte 0x00, 0x00, 0x00, 0x00\n"
                       ".byte 0x00, 0x00, 0x00, 0x00\n"
                       : "=a"(version)
                       : "a"(0));
  return version;
}


x86 assembly (clang, -O0):
<s2e_version>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
(bad)
...
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<s2e_version>:
xor    %eax,%eax
(bad)
...
ret

LLVM IR (-O0):
define i32 @s2e_version() {
%1 = alloca i32
%2 = call i32 asm sideeffect ".byte 0x0f, 0x3f\0A.byte 0x00, 0x00, 0x00, 0x00\0A.byte 0x00, 0x00, 0x00, 0x00\0A", "={ax},{ax},~{dirflag},~{fpsr},~{flags}"(i32 0)
store i32 %2, i32* %1
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @s2e_version() {
%1 = tail call i32 asm sideeffect ".byte 0x0f, 0x3f\0A.byte 0x00, 0x00, 0x00, 0x00\0A.byte 0x00, 0x00, 0x00, 0x00\0A", "={ax},{ax},~{dirflag},~{fpsr},~{flags}"(i32 0)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char *, char, ...);
char *get_ecmwf_tablename(char *target, char type, char *bufrtables_dir,
                          int ksec1[40]) {
  if (0) {
    if (ksec1[13] != 0)
      sprintf(target, "%s%c%03d%05d%05d%03d%03d.TXT", bufrtables_dir, type,
              ksec1[13], ksec1[15], ksec1[2], ksec1[14], ksec1[7]);
    else
      sprintf(target, "%s%c000%05d00000%03d%03d.TXT", bufrtables_dir, type,
              ksec1[15], ksec1[14], ksec1[7]);
  } else {
    sprintf(target, "%s%c0000000000000019000.TXT", bufrtables_dir, type);
  }
  return target;
}


x86 assembly (clang, -O0):
<get_ecmwf_tablename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rdx
lea    0xec7(%rip),%rsi
movsbl -0x9(%rbp),%ecx
mov    $0x0,%al
call   1030 <sprintf@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_ecmwf_tablename>:
push   %rbx
mov    %esi,%ecx
mov    %rdi,%rbx
lea    0xee3(%rip),%rsi
xor    %eax,%eax
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"%s%c0000000000000019000.TXT\00"
define i8* @get_ecmwf_tablename(i8* %0, i8 signext %1, i8* %2, i32* %3) {
%5 = alloca i8*
%6 = alloca i8
%7 = alloca i8*
%8 = alloca i32*
store i8* %0, i8** %5
store i8 %1, i8* %6
store i8* %2, i8** %7
store i32* %3, i32** %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %7
%11 = load i8, i8* %6
%12 = call i32 (i8*, i8*, i8*, i8, ...) @sprintf(i8* %9, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %10, i8 signext %11)
%13 = load i8*, i8** %5
ret i8* %13
}

LLVM IR (-O2):
@.str = [28 x i8] c"%s%c0000000000000019000.TXT\00"
define i8* @get_ecmwf_tablename(i8* returned writeonly %0, i8 signext %1, i8* %2, i32* nocapture readnone %3) {
%5 = tail call i32 (i8*, i8*, i8*, i8, ...) @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %2, i8 signext %1)
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ dotest(int, char *);
int main() {
  dotest(261235, "126235, 2, 0");
  dotest(209917, "29917, 0, 1");
  dotest(285365, "238565, 3, 1");
  dotest(296837, "239687, 4, 1");
  dotest(269045, "26945, 3, 0");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3fc73,%edi
lea    0xee0(%rip),%rsi
call   1030 <dotest@plt>
mov    $0x333fd,%edi
lea    0xedc(%rip),%rsi
call   1030 <dotest@plt>
mov    $0x45ab5,%edi
lea    0xed7(%rip),%rsi
call   1030 <dotest@plt>
mov    $0x48785,%edi
lea    0xed3(%rip),%rsi
call   1030 <dotest@plt>
mov    $0x41af5,%edi
lea    0xecf(%rip),%rsi
call   1030 <dotest@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x3fc73,%edi
call   1030 <dotest@plt>
lea    0xee4(%rip),%rsi
mov    $0x333fd,%edi
call   1030 <dotest@plt>
lea    0xedf(%rip),%rsi
mov    $0x45ab5,%edi
call   1030 <dotest@plt>
lea    0xedb(%rip),%rsi
mov    $0x48785,%edi
call   1030 <dotest@plt>
lea    0xed7(%rip),%rsi
mov    $0x41af5,%edi
call   1030 <dotest@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"126235, 2, 0\00"
@.str.1 = [12 x i8] c"29917, 0, 1\00"
@.str.2 = [13 x i8] c"238565, 3, 1\00"
@.str.3 = [13 x i8] c"239687, 4, 1\00"
@.str.4 = [12 x i8] c"26945, 3, 0\00"
define i32 @main() {
%1 = call i32 @dotest(i32 261235, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @dotest(i32 209917, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @dotest(i32 285365, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @dotest(i32 296837, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @dotest(i32 269045, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"126235, 2, 0\00"
@.str.1 = [12 x i8] c"29917, 0, 1\00"
@.str.2 = [13 x i8] c"238565, 3, 1\00"
@.str.3 = [13 x i8] c"239687, 4, 1\00"
@.str.4 = [12 x i8] c"26945, 3, 0\00"
define i32 @main() {
%1 = tail call i32 @dotest(i32 261235, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @dotest(i32 209917, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @dotest(i32 285365, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @dotest(i32 296837, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
%5 = tail call i32 @dotest(i32 269045, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}
void sig_chld_ignore(int signal) { return; }


x86 assembly (clang, -O0):
<sig_chld_ignore>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @sig_chld_ignore(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret void
}

LLVM IR (-O2):
define void @sig_chld_ignore(i32 %0) {
ret void
}
int isop(char c) {
  return (c == '+' || c == '-' || c == '*' || c == '/' || c == '^');
}


x86 assembly (clang, -O0):
<isop>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x2b,%ecx
mov    %al,-0x2(%rbp)
je     115f <isop+0x5f>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x2d,%ecx
mov    %al,-0x2(%rbp)
je     115f <isop+0x5f>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x2a,%ecx
mov    %al,-0x2(%rbp)
je     115f <isop+0x5f>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x2f,%ecx
mov    %al,-0x2(%rbp)
je     115f <isop+0x5f>
movsbl -0x1(%rbp),%eax
cmp    $0x5e,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isop>:
lea    -0x2a(%rdi),%eax
cmp    $0x6,%al
jae    1119 <isop+0x19>
movzbl %al,%ecx
mov    $0x1,%eax
mov    $0x2b,%edx
bt     %ecx,%edx
jb     1122 <isop+0x22>
xor    %eax,%eax
cmp    $0x5e,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @isop(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 43
br i1 %5, label %22, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 45
br i1 %9, label %22, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 42
br i1 %13, label %22, label %14
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 47
br i1 %17, label %22, label %18
18: ; preds = %14
%19 = load i8, i8* %2
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 94
br label %22
22: ; preds = %18, %14, %10, %6, %1
%23 = phi i1 [ true, %14 ], [ true, %10 ], [ true, %6 ], [ true, %1 ], [ %21, %18 ]
%24 = zext i1 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
define i32 @isop(i8 signext %0) {
%2 = add i8 %0, -42
%3 = icmp ult i8 %2, 6
br i1 %3, label %7, label %4
4: ; preds = %7, %1
%5 = icmp eq i8 %0, 94
%6 = zext i1 %5 to i32
br label %11
7: ; preds = %1
%8 = lshr i8 43, %2
%9 = and i8 %8, 1
%10 = icmp eq i8 %9, 0
br i1 %10, label %4, label %11
11: ; preds = %7, %4
%12 = phi i32 [ %6, %4 ], [ 1, %7 ]
ret i32 %12
}
int test_imm_D3uint16_mem(unsigned short *val) {
  return ((*val) & (0xD3 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_D3uint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%edx
and    $0xd3,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_D3uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 211
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int test_imm_CCuint32_reg(unsigned int val) {
  return ((val) & (0xCC << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_CCuint32_reg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 204
%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_CCuint32_reg(i32 %0) {
%2 = and i32 %0, 204
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
float slange(char norm, int m, int n, float *a, int lda, float *work) {
  extern float slange_(char *norm, int *m, int *n, float *a, int *lda,
                       float *work);
  return slange_(&norm, &m, &n, a, &lda, work);
}


x86 assembly (clang, -O0):
<slange>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x28(%rbp),%r9
lea    -0x1(%rbp),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x1c(%rbp),%r8
call   1030 <slange_@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<slange>:
sub    $0x18,%rsp
mov    %dil,0xb(%rsp)
mov    %esi,0x14(%rsp)
mov    %edx,0x10(%rsp)
mov    %r8d,0xc(%rsp)
lea    0xb(%rsp),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%r8
call   1030 <slange_@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define float @slange(i8 signext %0, i32 %1, i32 %2, float* %3, i32 %4, float* %5) {
%7 = alloca i8
%8 = alloca i32
%9 = alloca i32
%10 = alloca float*
%11 = alloca i32
%12 = alloca float*
store i8 %0, i8* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store float* %3, float** %10
store i32 %4, i32* %11
store float* %5, float** %12
%13 = load float*, float** %10
%14 = load float*, float** %12
%15 = call float @slange_(i8* %7, i32* %8, i32* %9, float* %13, i32* %11, float* %14)
ret float %15
}

LLVM IR (-O2):
define float @slange(i8 signext %0, i32 %1, i32 %2, float* %3, i32 %4, float* %5) {
%7 = alloca i8
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %4, i32* %10
%11 = call float @slange_(i8* %7, i32* %8, i32* %9, float* %3, i32* %10, float* %5)
ret float %11
}
void SystraceEnd() {}


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

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

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

LLVM IR (-O2):
define void @SystraceEnd() {
ret void
}
unsigned xrop3_239_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = ~T;
  stk2 = D | stk3;
  stk1 = S | stk2;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_239_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
or     -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_239_0_0>:
mov    %esi,%eax
shl    $0x8,%edi
shl    $0x8,%eax
not    %eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_239_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %7
%24 = xor i32 %23, -1
store i32 %24, i32* %10
%25 = load i32, i32* %5
%26 = load i32, i32* %10
%27 = or i32 %25, %26
store i32 %27, i32* %9
%28 = load i32, i32* %6
%29 = load i32, i32* %9
%30 = or i32 %28, %29
store i32 %30, i32* %8
%31 = load i32, i32* %8
ret i32 %31
}

LLVM IR (-O2):
define i32 @xrop3_239_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = zext i8 %1 to i32
%6 = shl nuw nsw i32 %5, 8
%7 = xor i32 %6, -1
%8 = or i32 %4, %7
ret i32 %8
}
/* Variables and functions */
int partition(int, int);
void quicksort(int left, int right) {
  if (left >= right)
    return;
  int index = partition(left, right);
  quicksort(left, index - 1);
  quicksort(index + 1, right);
}


x86 assembly (clang, -O0):
<quicksort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jl     113f <quicksort+0x1f>
jmp    1169 <quicksort+0x49>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <partition@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
call   1040 <quicksort@plt>
mov    -0xc(%rbp),%edi
add    $0x1,%edi
mov    -0x8(%rbp),%esi
call   1040 <quicksort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quicksort>:
push   %rbp
push   %r14
push   %rbx
cmp    %esi,%edi
jge    1150 <quicksort+0x30>
mov    %esi,%r14d
mov    %edi,%ebp
nopl   (%rax)
mov    %ebp,%edi
mov    %r14d,%esi
call   1030 <partition@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%esi
mov    %ebp,%edi
call   1040 <quicksort@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1130 <quicksort+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @quicksort(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
br i1 %3, label %4, label %10
4: ; preds = %2, %4
%5 = phi i32 [ %8, %4 ], [ %0, %2 ]
%6 = tail call i32 @partition(i32 %5, i32 %1)
%7 = add nsw i32 %6, -1
tail call void @quicksort(i32 %5, i32 %7)
%8 = add nsw i32 %6, 1
%9 = icmp slt i32 %8, %1
br i1 %9, label %4, label %10
10: ; preds = %4, %2
ret void
}
void parse_whsp(const char **sp) {
  while (((**sp) == ' ' || (**sp) == '\t' || (**sp) == '\n'))
    (*sp)++;
}


x86 assembly (clang, -O0):
<parse_whsp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x9(%rbp)
je     114b <parse_whsp+0x4b>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x9,%ecx
mov    %al,-0x9(%rbp)
je     114b <parse_whsp+0x4b>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    115b <parse_whsp+0x5b>
jmp    116e <parse_whsp+0x6e>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    1108 <parse_whsp+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_whsp>:
mov    (%rdi),%rax
add    $0x1,%rax
movabs $0x100000600,%rcx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzbl -0x1(%rax),%edx
cmp    $0x20,%rdx
ja     1139 <parse_whsp+0x39>
bt     %rdx,%rcx
jae    1139 <parse_whsp+0x39>
mov    %rax,(%rdi)
add    $0x1,%rax
jmp    1120 <parse_whsp+0x20>
ret

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

LLVM IR (-O2):
define void @parse_whsp(i8** nocapture %0) {
%2 = load i8*, i8** %0
br label %3
3: ; preds = %6, %1
%4 = phi i8* [ %7, %6 ], [ %2, %1 ]
%5 = load i8, i8* %4
switch i8 %5, label %8 [
i8 32, label %6
i8 9, label %6
i8 10, label %6
]
6: ; preds = %3, %3, %3
%7 = getelementptr inbounds i8, i8* %4, i64 1
store i8* %7, i8** %0
br label %3
8: ; preds = %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gendir(char *);
int /*<<< orphan*/ strlen(char *);
char *genconfig(char *sf) {
  char *ptr;
  gendir(sf);
  ptr += strlen(sf);
  ptr[0] = 'c';
  ptr[1] = 'o';
  ptr[2] = 'n';
  ptr[3] = 'f';
  ptr[4] = 'i';
  ptr[5] = 'g';
  ptr[6] = '\0';
}


x86 assembly (clang, -O0):
<genconfig>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <gendir@plt>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movb   $0x63,(%rax)
mov    -0x18(%rbp),%rax
movb   $0x6f,0x1(%rax)
mov    -0x18(%rbp),%rax
movb   $0x6e,0x2(%rax)
mov    -0x18(%rbp),%rax
movb   $0x66,0x3(%rax)
mov    -0x18(%rbp),%rax
movb   $0x69,0x4(%rax)
mov    -0x18(%rbp),%rax
movb   $0x67,0x5(%rax)
mov    -0x18(%rbp),%rax
movb   $0x0,0x6(%rax)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<genconfig>:
push   %rbx
mov    %rdi,%rbx
call   1040 <gendir@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>

LLVM IR (-O0):
define i8* @genconfig(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @gendir(i8* %5)
%7 = load i8*, i8** %3
%8 = call i32 @strlen(i8* %7)
%9 = load i8*, i8** %4
%10 = sext i32 %8 to i64
%11 = getelementptr inbounds i8, i8* %9, i64 %10
store i8* %11, i8** %4
%12 = load i8*, i8** %4
%13 = getelementptr inbounds i8, i8* %12, i64 0
store i8 99, i8* %13
%14 = load i8*, i8** %4
%15 = getelementptr inbounds i8, i8* %14, i64 1
store i8 111, i8* %15
%16 = load i8*, i8** %4
%17 = getelementptr inbounds i8, i8* %16, i64 2
store i8 110, i8* %17
%18 = load i8*, i8** %4
%19 = getelementptr inbounds i8, i8* %18, i64 3
store i8 102, i8* %19
%20 = load i8*, i8** %4
%21 = getelementptr inbounds i8, i8* %20, i64 4
store i8 105, i8* %21
%22 = load i8*, i8** %4
%23 = getelementptr inbounds i8, i8* %22, i64 5
store i8 103, i8* %23
%24 = load i8*, i8** %4
%25 = getelementptr inbounds i8, i8* %24, i64 6
store i8 0, i8* %25
%26 = load i8*, i8** %2
ret i8* %26
}

LLVM IR (-O2):
define noalias i8* @genconfig(i8* %0) {
%2 = tail call i32 @gendir(i8* %0)
%3 = tail call i32 @strlen(i8* %0)
unreachable
}
int test_imm_E1uint64_lowword_reg(unsigned long long val) {
  return ((val) & (0xE1 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_E1uint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 225
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
uint64_t negl(uint64_t x) { return 0 - x; }


x86 assembly (clang, -O0):
<negl>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
sub    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<negl>:
mov    %rdi,%rax
neg    %rax
ret

LLVM IR (-O0):
define i64 @negl(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = sub nsw i64 0, %3
ret i64 %4
}

LLVM IR (-O2):
define i64 @negl(i64 %0) {
%2 = sub nsw i64 0, %0
ret i64 %2
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
int string_lt(char *s1, char *s2, int k) {
  k = 0;
  return strcmp(s1, s2) < 0;
}


x86 assembly (clang, -O0):
<string_lt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
setl   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_lt>:
push   %rax
call   1030 <strcmp@plt>
shr    $0x3f,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @string_lt(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
store i32 0, i32* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = call i64 @strcmp(i8* %7, i8* %8)
%10 = icmp slt i64 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @string_lt(i8* %0, i8* %1, i32 %2) {
%4 = tail call i64 @strcmp(i8* %0, i8* %1)
%5 = lshr i64 %4, 63
%6 = trunc i64 %5 to i32
ret i32 %6
}
void dbf(void) {}


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

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

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

LLVM IR (-O2):
define void @dbf() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ios_delay();
int ipc_read(int);
void ipc_wait_reply(void) {
  while (!(ipc_read(1) & 0x4)) {
  }
  ios_delay();
}


x86 assembly (clang, -O0):
<ipc_wait_reply>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <ipc_wait_reply+0x9>
mov    $0x1,%edi
call   1040 <ipc_read@plt>
and    $0x4,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    114b <ipc_wait_reply+0x2b>
jmp    1150 <ipc_wait_reply+0x30>
jmp    1129 <ipc_wait_reply+0x9>
mov    $0x0,%al
call   1030 <ios_delay@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ipc_wait_reply>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x1,%edi
call   1040 <ipc_read@plt>
test   $0x4,%al
je     1130 <ipc_wait_reply+0x10>
xor    %eax,%eax
pop    %rcx
jmp    1030 <ios_delay@plt>

LLVM IR (-O0):
define void @ipc_wait_reply() {
br label %1
1: ; preds = %6, %0
%2 = call i32 @ipc_read(i32 1)
%3 = and i32 %2, 4
%4 = icmp ne i32 %3, 0
%5 = xor i1 %4, true
br i1 %5, label %6, label %7
6: ; preds = %1
br label %1
7: ; preds = %1
%8 = call i32 (...) @ios_delay()
ret void
}

LLVM IR (-O2):
define void @ipc_wait_reply() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @ipc_read(i32 1)
%3 = and i32 %2, 4
%4 = icmp eq i32 %3, 0
br i1 %4, label %1, label %5
5: ; preds = %1
%6 = tail call i32 (...) @ios_delay()
ret void
}
__attribute__((aligned(2))) void f2(void) {}


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

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

LLVM IR (-O0):
define void @f2() align 2 {
ret void
}

LLVM IR (-O2):
define void @f2() align 2 {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clearWindow();
int /*<<< orphan*/ drawAllText();
void renderWindow() {
  clearWindow();
  drawAllText();
}


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

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

LLVM IR (-O0):
define void @renderWindow() {
%1 = call i32 (...) @clearWindow()
%2 = call i32 (...) @drawAllText()
ret void
}

LLVM IR (-O2):
define void @renderWindow() {
%1 = tail call i32 (...) @clearWindow()
%2 = tail call i32 (...) @drawAllText()
ret void
}
void ASN1_item_i2d(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ htobe16(int /*<<< orphan*/);
int /*<<< orphan*/ memcpy(char *, int /*<<< orphan*/ *, int);
void hton16(uint16_t i, char *p) {
  uint16_t n = htobe16(i);
  memcpy(p, &n, sizeof(n));
}


x86 assembly (clang, -O0):
<hton16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <htobe16@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x14(%rbp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hton16>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
call   1040 <htobe16@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define void @hton16(i32 %0, i8* %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 @htobe16(i32 %0)
store i32 %5, i32* %3
%6 = call i32 @memcpy(i8* %1, i32* %3, i32 4)
ret void
}
void g_signal_stop_emission() {}


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

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

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

LLVM IR (-O2):
define void @g_signal_stop_emission() {
ret void
}
/* Variables and functions */
int sigmoid(float);
float dsigmoid(float x) { return sigmoid(x) * (1 - sigmoid(x)); }


x86 assembly (clang, -O0):
<dsigmoid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <sigmoid@plt>
mov    %eax,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <sigmoid@plt>
mov    %eax,%edx
mov    -0x8(%rbp),%eax
mov    $0x1,%ecx
sub    %edx,%ecx
imul   %ecx,%eax
cvtsi2ss %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dsigmoid>:
push   %rbx
sub    $0x10,%rsp
movss  %xmm0,0xc(%rsp)
call   1030 <sigmoid@plt>
mov    %eax,%ebx
movss  0xc(%rsp),%xmm0
call   1030 <sigmoid@plt>
mov    $0x1,%ecx
sub    %eax,%ecx
imul   %ebx,%ecx
xorps  %xmm0,%xmm0
cvtsi2ss %ecx,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define float @dsigmoid(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i32 @sigmoid(float %3)
%5 = load float, float* %2
%6 = call i32 @sigmoid(float %5)
%7 = sub nsw i32 1, %6
%8 = mul nsw i32 %4, %7
%9 = sitofp i32 %8 to float
ret float %9
}

LLVM IR (-O2):
define float @dsigmoid(float %0) {
%2 = tail call i32 @sigmoid(float %0)
%3 = tail call i32 @sigmoid(float %0)
%4 = sub nsw i32 1, %3
%5 = mul nsw i32 %4, %2
%6 = sitofp i32 %5 to float
ret float %6
}
/* Type definitions */
struct stat64 {
  int dummy;
};
struct file {
  int dummy;
};

/* Variables and functions */
int fs_fstat64(struct file *, struct stat64 *);
struct file *get_file(int);
int process_fstat64(int fd, struct stat64 *buf) {
  struct file *file;
  file = get_file(fd);
  if (!file) {
    return -9;
  }
  return fs_fstat64(file, buf);
}


x86 assembly (clang, -O0):
<process_fstat64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <get_file@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1152 <process_fstat64+0x32>
movl   $0xfffffff7,-0x4(%rbp)
jmp    1162 <process_fstat64+0x42>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <fs_fstat64@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<process_fstat64>:
push   %rbx
mov    %rsi,%rbx
call   1030 <get_file@plt>
test   %rax,%rax
je     113a <process_fstat64+0x1a>
mov    %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <fs_fstat64@plt>
mov    $0xfffffff7,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
%struct.stat64 = type { i32 }
%struct.file = type { i32 }
define i32 @process_fstat64(i32 %0, %struct.stat64* %1) {
%3 = tail call %struct.file* @get_file(i32 %0)
%4 = icmp eq %struct.file* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @fs_fstat64(%struct.file* %3, %struct.stat64* %1)
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ %6, %5 ], [ -9, %2 ]
ret i32 %8
}
/* Variables and functions */
void _initialize_mi_out(void) {}


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

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

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

LLVM IR (-O2):
define void @_initialize_mi_out() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ do_csi(char *, int);
void sl(int pn) { do_csi("%d @", pn); }


x86 assembly (clang, -O0):
<sl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <do_csi@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sl>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <do_csi@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"%d @\00"
define void @sl(i32 %0) {
%2 = tail call i32 @do_csi(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
double rt_powd_snf(double, double);
double dBinv(double dBinput) {
  double dBoutput;
  if (dBinput > -150.0) {
    dBoutput = rt_powd_snf(10.0, dBinput / 20.0);
  } else {
    dBoutput = 0.0;
  }
  return dBoutput;
}


x86 assembly (clang, -O0):
<dBinv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    115c <dBinv+0x4c>
movsd  -0x8(%rbp),%xmm1
movsd  0xecf(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0xebb(%rip),%xmm0
call   1030 <rt_powd_snf@plt>
movsd  %xmm0,-0x10(%rbp)
jmp    1164 <dBinv+0x54>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dBinv>:
ucomisd 0xee8(%rip),%xmm0
jbe    1133 <dBinv+0x23>
movapd %xmm0,%xmm1
divsd  0xee2(%rip),%xmm1
movsd  0xee2(%rip),%xmm0
jmp    1030 <rt_powd_snf@plt>
xorpd  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @dBinv(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fcmp ogt double %4, -1.500000e+02
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load double, double* %2
%8 = fdiv double %7, 2.000000e+01
%9 = call double @rt_powd_snf(double 1.000000e+01, double %8)
store double %9, double* %3
br label %11
10: ; preds = %1
store double 0.000000e+00, double* %3
br label %11
11: ; preds = %10, %6
%12 = load double, double* %3
ret double %12
}

LLVM IR (-O2):
define double @dBinv(double %0) {
%2 = fcmp ogt double %0, -1.500000e+02
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = fdiv double %0, 2.000000e+01
%5 = tail call double @rt_powd_snf(double 1.000000e+01, double %4)
br label %6
6: ; preds = %1, %3
%7 = phi double [ %5, %3 ], [ 0.000000e+00, %1 ]
ret double %7
}
int comp(const void *elem1, const void *elem2) {
  char f = *((char *)elem1);
  char s = *((char *)elem2);
  if (f > s)
    return 1;
  if (f < s)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<comp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x19(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x1a(%rbp)
movsbl -0x19(%rbp),%eax
movsbl -0x1a(%rbp),%ecx
cmp    %ecx,%eax
jle    113a <comp+0x3a>
movl   $0x1,-0x4(%rbp)
jmp    115d <comp+0x5d>
movsbl -0x19(%rbp),%eax
movsbl -0x1a(%rbp),%ecx
cmp    %ecx,%eax
jge    1156 <comp+0x56>
movl   $0xffffffff,-0x4(%rbp)
jmp    115d <comp+0x5d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<comp>:
mov    (%rdi),%al
mov    (%rsi),%cl
xor    %edx,%edx
cmp    %cl,%al
setl   %dl
neg    %edx
cmp    %cl,%al
mov    $0x1,%eax
cmovle %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @comp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp sgt i8 %3, %4
%6 = icmp slt i8 %3, %4
%7 = sext i1 %6 to i32
%8 = select i1 %5, i32 1, i32 %7
ret i32 %8
}
void hgetfontsize_(cw, ch) float *cw, *ch;
{ hgetfontsize(cw, ch); }


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

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

LLVM IR (-O0):
define void @hgetfontsize_(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %3
%6 = load float*, float** %4
%7 = call i32 (float*, float*, ...) bitcast (i32 (...)* @hgetfontsize to i32 (float*, float*, ...)*)(float* %5, float* %6)
ret void
}

LLVM IR (-O2):
define void @hgetfontsize_(float* %0, float* %1) {
%3 = tail call i32 (float*, float*, ...) bitcast (i32 (...)* @hgetfontsize to i32 (float*, float*, ...)*)(float* %0, float* %1)
ret void
}
void returnVoidI(int arg) {}


x86 assembly (clang, -O0):
<returnVoidI>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @returnVoidI(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret void
}

LLVM IR (-O2):
define void @returnVoidI(i32 %0) {
ret void
}