xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void clear() {
  int x;
  for (x = 0; x < 10; x++) {
    printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
  }
}


x86 assembly (clang, -O0):
<clear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jge    1143 <clear+0x33>
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <clear+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str = [17 x i8] c"\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\00"
define void @clear() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ hz_abort(char *, size_t, char const, char const, char, char);
void hz_assert_char(const char *buf, size_t i, char expected) {
  if (buf[i] != expected) {
    hz_abort("Char at [%zu] equal to %d ('%c'), expected %d ('%c')", i, buf[i],
             buf[i], expected, expected);
  }
}


x86 assembly (clang, -O0):
<hz_assert_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
je     1175 <hz_assert_char+0x65>
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rax,%rcx,1),%cl
mov    -0x11(%rbp),%al
lea    0xe9f(%rip),%rdi
movsbl %dl,%edx
movsbl %cl,%ecx
movsbl %al,%r8d
movsbl -0x11(%rbp),%r9d
call   1030 <hz_abort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hz_assert_char>:
mov    (%rdi,%rsi,1),%al
cmp    %dl,%al
jne    1118 <hz_assert_char+0x8>
ret
movsbl %al,%ecx
movsbl %dl,%r8d
lea    0xeda(%rip),%rdi
mov    %ecx,%edx
mov    %r8d,%r9d
jmp    1030 <hz_abort@plt>

LLVM IR (-O0):
@.str = [53 x i8] c"Char at [%zu] equal to %d ('%c'), expected %d ('%c')\00"
define void @hz_assert_char(i8* %0, i64 %1, i8 signext %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8
store i8* %0, i8** %4
store i64 %1, i64* %5
store i8 %2, i8* %6
%7 = load i8*, i8** %4
%8 = load i64, i64* %5
%9 = getelementptr inbounds i8, i8* %7, i64 %8
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = load i8, i8* %6
%13 = sext i8 %12 to i32
%14 = icmp ne i32 %11, %13
br i1 %14, label %15, label %28
15: ; preds = %3
%16 = load i64, i64* %5
%17 = load i8*, i8** %4
%18 = load i64, i64* %5
%19 = getelementptr inbounds i8, i8* %17, i64 %18
%20 = load i8, i8* %19
%21 = load i8*, i8** %4
%22 = load i64, i64* %5
%23 = getelementptr inbounds i8, i8* %21, i64 %22
%24 = load i8, i8* %23
%25 = load i8, i8* %6
%26 = load i8, i8* %6
%27 = call i32 @hz_abort(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i64 %16, i8 signext %20, i8 signext %24, i8 signext %25, i8 signext %26)
br label %28
28: ; preds = %15, %3
ret void
}

LLVM IR (-O2):
@.str = [53 x i8] c"Char at [%zu] equal to %d ('%c'), expected %d ('%c')\00"
define void @hz_assert_char(i8* nocapture %0, i64 %1, i8 signext %2) {
%4 = getelementptr inbounds i8, i8* %0, i64 %1
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, %2
br i1 %6, label %9, label %7
7: ; preds = %3
%8 = tail call i32 @hz_abort(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i64 %1, i8 signext %5, i8 signext %5, i8 signext %2, i8 signext %2)
br label %9
9: ; preds = %7, %3
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ programme();
int main(void) {
  programme();
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <programme@plt>
mov    0x2eb3(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <programme@plt>
mov    0x2ec1(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @programme()
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @programme()
%2 = load i32, i32* @EXIT_SUCCESS
ret i32 %2
}
int compare_char(const void *lm1, const void *lm2) {
  return (((char *)lm1)[0] - ((char *)lm2)[0]);
}


x86 assembly (clang, -O0):
<compare_char>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_char>:
movsbl (%rdi),%eax
movsbl (%rsi),%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @compare_char(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = load i8*, i8** %4
%10 = getelementptr inbounds i8, i8* %9, i64 0
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = sub nsw i32 %8, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @compare_char(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = sext i8 %3 to i32
%5 = load i8, i8* %1
%6 = sext i8 %5 to i32
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Variables and functions */
int strlen(char const *);
int /*<<< orphan*/ strncpy(char *, char const *, int);
char *Diss_strcat(char *pString, const char *pToken) {
  int nTokenLength = strlen(pToken);
  strncpy(pString, pToken, nTokenLength);
  pString += nTokenLength;
  return pString;
}


x86 assembly (clang, -O0):
<Diss_strcat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <strncpy@plt>
mov    -0x14(%rbp),%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Diss_strcat>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %eax,%ebp
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <strncpy@plt>
movslq %ebp,%rax
add    %r14,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i8* @Diss_strcat(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = call i32 @strlen(i8* %6)
store i32 %7, i32* %5
%8 = load i8*, i8** %3
%9 = load i8*, i8** %4
%10 = load i32, i32* %5
%11 = call i32 @strncpy(i8* %8, i8* %9, i32 %10)
%12 = load i32, i32* %5
%13 = load i8*, i8** %3
%14 = sext i32 %12 to i64
%15 = getelementptr inbounds i8, i8* %13, i64 %14
store i8* %15, i8** %3
%16 = load i8*, i8** %3
ret i8* %16
}

LLVM IR (-O2):
define i8* @Diss_strcat(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @strncpy(i8* %0, i8* %1, i32 %3)
%5 = sext i32 %3 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
ret i8* %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ volatile *mem_get_reg32(int);
volatile uint32_t *syscfg_get_MEMRMP() {
  return mem_get_reg32(0x40010000 + 0x00);
}


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

x86 assembly (clang, -O2):
<syscfg_get_MEMRMP>:
mov    $0x40010000,%edi
jmp    1030 <mem_get_reg32@plt>

LLVM IR (-O0):
define i32* @syscfg_get_MEMRMP() {
%1 = call i32* @mem_get_reg32(i32 1073807360)
ret i32* %1
}

LLVM IR (-O2):
define i32* @syscfg_get_MEMRMP() {
%1 = tail call i32* @mem_get_reg32(i32 1073807360)
ret i32* %1
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int siggetmask(void) {
  ;
  errno = ENOSYS;
  return -1;
  ;
}


x86 assembly (clang, -O0):
<siggetmask>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec4(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<siggetmask>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @siggetmask() {
%1 = load i32, i32* @ENOSYS
store i32 %1, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @siggetmask() {
%1 = load i32, i32* @ENOSYS
store i32 %1, i32* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ omap_do_wfi();
int omap4_hotplug_cpu(unsigned int cpu, unsigned int power_state) {
  omap_do_wfi();
  return 0;
}


x86 assembly (clang, -O0):
<omap4_hotplug_cpu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <omap_do_wfi@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<omap4_hotplug_cpu>:
push   %rax
xor    %eax,%eax
call   1030 <omap_do_wfi@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @omap4_hotplug_cpu(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (...) @omap_do_wfi()
ret i32 0
}

LLVM IR (-O2):
define i32 @omap4_hotplug_cpu(i32 %0, i32 %1) {
%3 = tail call i32 (...) @omap_do_wfi()
ret i32 0
}
/* Type definitions */
struct stat {
  int st_mode;
};

/* Variables and functions */
int S_IFMT;
int errno;
scalar_t__ stat(char const *, struct stat *);
int path_type(const char *path) {
  struct stat st;
  if (0 != stat(path, &st)) {
    return -errno;
  }
  return st.st_mode & S_IFMT;
}


x86 assembly (clang, -O0):
<path_type>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
je     114a <path_type+0x3a>
xor    %eax,%eax
mov    0x2e98(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
jmp    1159 <path_type+0x49>
mov    -0x18(%rbp),%eax
mov    0x2e8c(%rip),%rcx
and    (%rcx),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<path_type>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
test   %rax,%rax
je     112b <path_type+0x1b>
mov    0x2eb3(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
pop    %rcx
ret
mov    0x2eae(%rip),%rax
mov    (%rax),%eax
and    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@errno = global i32 0
@S_IFMT = global i32 0
define i32 @path_type(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @stat(i8* %5, %struct.stat* %4)
%7 = icmp ne i64 0, %6
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i32, i32* @errno
%10 = sub nsw i32 0, %9
store i32 %10, i32* %2
br label %16
11: ; preds = %1
%12 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%13 = load i32, i32* %12
%14 = load i32, i32* @S_IFMT
%15 = and i32 %13, %14
store i32 %15, i32* %2
br label %16
16: ; preds = %11, %8
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@errno = global i32 0
@S_IFMT = global i32 0
define i32 @path_type(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = load i32, i32* @errno
%8 = sub nsw i32 0, %7
br label %14
9: ; preds = %1
%10 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%11 = load i32, i32* %10
%12 = load i32, i32* @S_IFMT
%13 = and i32 %12, %11
br label %14
14: ; preds = %9, %6
%15 = phi i32 [ %8, %6 ], [ %13, %9 ]
ret i32 %15
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int quot;
};
typedef TYPE_1__ div_t;

/* Variables and functions */
TYPE_1__ div(int, int /*<<< orphan*/);
int /*<<< orphan*/ rand();
int main(int argc, char *argv[]) {
  div_t res = div(1, 0);
  rand();
  return res.quot;
}


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    $0x1,%edi
xor    %esi,%esi
call   1030 <div@plt>
mov    %eax,-0x18(%rbp)
mov    $0x0,%al
call   1040 <rand@plt>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <div@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <rand@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32 }
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.TYPE_3__
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 @div(i32 1, i32 0)
%8 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %6, i32 0, i32 0
store i32 %7, i32* %8
%9 = call i32 (...) @rand()
%10 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %6, i32 0, i32 0
%11 = load i32, i32* %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @div(i32 1, i32 0)
%4 = tail call i32 (...) @rand()
ret i32 %3
}
void fp1(int i) { {{i++; }
{ i++; }
}
;
}


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

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

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

LLVM IR (-O2):
define void @fp1(i32 %0) {
ret void
}
/* Variables and functions */
scalar_t__ strstr(char const *, char *);
int haplotype(const char *name) {
  if (strstr(name, "_hap") || strstr(name, "_alt"))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<haplotype>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strstr@plt>
cmp    $0x0,%rax
jne    1150 <haplotype+0x40>
mov    -0x10(%rbp),%rdi
lea    0xec4(%rip),%rsi
call   1030 <strstr@plt>
cmp    $0x0,%rax
je     115c <haplotype+0x4c>
movl   $0x1,-0x4(%rbp)
jmp    1163 <haplotype+0x53>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<haplotype>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
call   1030 <strstr@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     112f <haplotype+0x1f>
pop    %rbx
ret
lea    0xecf(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strstr@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"_hap\00"
@.str.1 = [5 x i8] c"_alt\00"
define i32 @haplotype(i8* %0) {
%2 = tail call i64 @strstr(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @strstr(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
void cpu_mm(float *a, float *b, float *c, int hA, int wA, int wB) {}


x86 assembly (clang, -O0):
<cpu_mm>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @cpu_mm(float* %0, float* %1, float* %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca float*
%8 = alloca float*
%9 = alloca float*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store float* %0, float** %7
store float* %1, float** %8
store float* %2, float** %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
ret void
}

LLVM IR (-O2):
define void @cpu_mm(float* nocapture %0, float* nocapture %1, float* nocapture %2, i32 %3, i32 %4, i32 %5) {
ret void
}
/* Variables and functions */
scalar_t__ f();
unsigned short g() { return f() ? 1 : 0; }


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <f@plt>
mov    %rax,%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
push   %rax
xor    %eax,%eax
call   1030 <f@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i16 @g() {
%1 = call i64 (...) @f()
%2 = icmp ne i64 %1, 0
%3 = zext i1 %2 to i64
%4 = select i1 %2, i32 1, i32 0
%5 = trunc i32 %4 to i16
ret i16 %5
}

LLVM IR (-O2):
define zeroext i16 @g() {
%1 = tail call i64 (...) @f()
%2 = icmp ne i64 %1, 0
%3 = zext i1 %2 to i16
ret i16 %3
}
/* Variables and functions */
int /*<<< orphan*/ Cyc_Tcpat_print_dec_tree(void *, int /*<<< orphan*/);
void Cyc_Tcpat_print_decision_tree(void *d) {
  ({ Cyc_Tcpat_print_dec_tree(d, 0); });
}


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

x86 assembly (clang, -O2):
<Cyc_Tcpat_print_decision_tree>:
xor    %esi,%esi
jmp    1030 <Cyc_Tcpat_print_dec_tree@plt>

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

LLVM IR (-O2):
define void @Cyc_Tcpat_print_decision_tree(i8* %0) {
%2 = tail call i32 @Cyc_Tcpat_print_dec_tree(i8* %0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void rawfree(void *ptr) { free((char *)ptr); }


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

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

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

LLVM IR (-O2):
define void @rawfree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
signed char bar_char(void) { return __real__(foo_char(2 - 3i)); }


x86 assembly (clang, -O0):
<bar_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x2,-0x8(%rbp)
movl   $0xfffffffd,-0x4(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <foo_char@plt>
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar_char>:
push   %rax
movabs $0xfffffffd00000002,%rdi
ff ff ff
xor    %eax,%eax
call   1030 <foo_char@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define signext i8 @bar_char() {
%1 = tail call i32 (i64, ...) bitcast (i32 (...)* @foo_char to i32 (i64, ...)*)(i64 -12884901886)
%2 = trunc i32 %1 to i8
ret i8 %2
}
/* Type definitions */
typedef int uint64_t;
struct timeval {
  int tv_usec;
  int tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
uint64_t getTimeMs() {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return tv.tv_usec / 1000 + tv.tv_sec * 1000;
}


x86 assembly (clang, -O0):
<getTimeMs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    -0x8(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
imul   $0x3e8,-0x4(%rbp),%ecx
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getTimeMs>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movslq (%rsp),%rax
imul   $0x10624dd3,%rax,%rcx
mov    %rcx,%rax
shr    $0x3f,%rax
sar    $0x26,%rcx
add    %eax,%ecx
imul   $0x3e8,0x4(%rsp),%eax
add    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i32 @getTimeMs() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i32, i32* %3
%5 = sdiv i32 %4, 1000
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%7 = load i32, i32* %6
%8 = mul nsw i32 %7, 1000
%9 = add nsw i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i32 @getTimeMs() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = sdiv i32 %5, 1000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i32, i32* %7
%9 = mul nsw i32 %8, 1000
%10 = add nsw i32 %9, %6
ret i32 %10
}
/* Variables and functions */
int _tfsipmod(char *, char *, int, int);
int /*<<< orphan*/ monLock();
int /*<<< orphan*/ monUnlock();
int mon_tfsipmod(char *name, char *buf, int offset, int size) {
  int ret;
  monLock();
  ret = _tfsipmod(name, buf, offset, size);
  monUnlock();
  return (ret);
}


x86 assembly (clang, -O0):
<mon_tfsipmod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    $0x0,%al
call   1030 <monLock@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
call   1050 <_tfsipmod@plt>
mov    %eax,-0x1c(%rbp)
mov    $0x0,%al
call   1040 <monUnlock@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mon_tfsipmod>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %edx,%r15d
mov    %rsi,%rbx
mov    %rdi,%rbp
xor    %eax,%eax
call   1030 <monLock@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r15d,%edx
mov    %r14d,%ecx
call   1050 <_tfsipmod@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <monUnlock@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @mon_tfsipmod(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = call i32 (...) @monLock()
%11 = load i8*, i8** %5
%12 = load i8*, i8** %6
%13 = load i32, i32* %7
%14 = load i32, i32* %8
%15 = call i32 @_tfsipmod(i8* %11, i8* %12, i32 %13, i32 %14)
store i32 %15, i32* %9
%16 = call i32 (...) @monUnlock()
%17 = load i32, i32* %9
ret i32 %17
}

LLVM IR (-O2):
define i32 @mon_tfsipmod(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = tail call i32 (...) @monLock()
%6 = tail call i32 @_tfsipmod(i8* %0, i8* %1, i32 %2, i32 %3)
%7 = tail call i32 (...) @monUnlock()
ret i32 %6
}
int test_imm_86int64_highword_mem(long long *val) {
  return ((*val >> 32) & (0x86 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_86int64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 575525617664
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ init_app();
int /*<<< orphan*/ scan_LEDs_with_tasks();
void main(void) {
  init_app();
  scan_LEDs_with_tasks();
}


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

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

LLVM IR (-O0):
define void @main() {
%1 = call i32 (...) @init_app()
%2 = call i32 (...) @scan_LEDs_with_tasks()
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @init_app()
%2 = tail call i32 (...) @scan_LEDs_with_tasks()
ret void
}
int always_fails(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @always_fails() {
ret i32 0
}

LLVM IR (-O2):
define i32 @always_fails() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, size_t);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
void *xmalloc(size_t size) {
  void *p = malloc(size);
  if (!p) {
    fprintf(stderr, "out of memory allocating %d bytes\n", size);
    exit(1);
  }
  return p;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1177 <xmalloc+0x47>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe98(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
mov    %rdi,%rbx
call   1040 <malloc@plt>
test   %rax,%rax
je     1140 <xmalloc+0x10>
pop    %rbx
ret
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    0xeb0(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [35 x i8] c"out of memory allocating %d bytes\0A\00"
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %13, label %8
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = load i64, i64* %2
%11 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i64 %10)
%12 = call i32 @exit(i32 1)
unreachable
13: ; preds = %1
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [35 x i8] c"out of memory allocating %d bytes\0A\00"
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i64 %0)
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ sqlite3_file;

/* Variables and functions */
int wrap_DeviceCharacteristics(sqlite3_file *pFile) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @wrap_DeviceCharacteristics(i32* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _setvideomode(int);
main() { _setvideomode(-1); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffffff,%edi
call   1030 <_setvideomode@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xffffffff,%edi
call   1030 <_setvideomode@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @_setvideomode(i32 -1)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @_setvideomode(i32 -1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ OpenSSL_add_ssl_algorithms();
int /*<<< orphan*/ RAND_poll();
int /*<<< orphan*/ SSL_library_init();
int /*<<< orphan*/ SSL_load_error_strings();
void crypto_alloc() {
  RAND_poll();
  SSL_library_init();
  SSL_load_error_strings();
  OpenSSL_add_ssl_algorithms();
}


x86 assembly (clang, -O0):
<crypto_alloc>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <RAND_poll@plt>
mov    $0x0,%al
call   1030 <SSL_library_init@plt>
mov    $0x0,%al
call   1050 <SSL_load_error_strings@plt>
mov    $0x0,%al
call   1060 <OpenSSL_add_ssl_algorithms@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<crypto_alloc>:
push   %rax
xor    %eax,%eax
call   1040 <RAND_poll@plt>
xor    %eax,%eax
call   1030 <SSL_library_init@plt>
xor    %eax,%eax
call   1050 <SSL_load_error_strings@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <OpenSSL_add_ssl_algorithms@plt>

LLVM IR (-O0):
define void @crypto_alloc() {
%1 = call i32 (...) @RAND_poll()
%2 = call i32 (...) @SSL_library_init()
%3 = call i32 (...) @SSL_load_error_strings()
%4 = call i32 (...) @OpenSSL_add_ssl_algorithms()
ret void
}

LLVM IR (-O2):
define void @crypto_alloc() {
%1 = tail call i32 (...) @RAND_poll()
%2 = tail call i32 (...) @SSL_library_init()
%3 = tail call i32 (...) @SSL_load_error_strings()
%4 = tail call i32 (...) @OpenSSL_add_ssl_algorithms()
ret void
}
unsigned f3(unsigned c, int shamt) { return 1U << (c << shamt); }


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

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

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

LLVM IR (-O2):
define i32 @f3(i32 %0, i32 %1) {
%3 = shl i32 %0, %1
%4 = shl nuw i32 1, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int j = 2;
  do {
    printf("%x\n", j);
    j++;
  } while (j < 10);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jl     1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x9,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%x\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 2)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 4)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 5)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 6)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 7)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 8)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 9)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sched_yield();
void *process(void *arg) {
  int i;
  for (i = 0; i < 100; i++)
    sched_yield();
  return NULL;
}


x86 assembly (clang, -O0):
<process>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x64,-0xc(%rbp)
jge    1142 <process+0x32>
mov    $0x0,%al
call   1030 <sched_yield@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <process+0x13>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<process>:
push   %rbx
mov    $0x64,%ebx
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <sched_yield@plt>
add    $0xffffffff,%ebx
jne    1120 <process+0x10>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define noalias i8* @process(i8* nocapture readnone %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i32 [ 0, %1 ], [ %5, %2 ]
%4 = tail call i32 (...) @sched_yield()
%5 = add nuw nsw i32 %3, 1
%6 = icmp eq i32 %5, 100
br i1 %6, label %7, label %2
7: ; preds = %2
ret i8* null
}
int test_imm_B7int16_mem(short *val) {
  return ((*val) & (0xB7 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_B7int16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, 183
%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_B7int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 183
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct timespec {
  scalar_t__ tv_sec;
  scalar_t__ tv_nsec;
};

/* Variables and functions */
int specinf(struct timespec *ts) { return (ts->tv_sec < 0 || ts->tv_nsec < 0); }


x86 assembly (clang, -O0):
<specinf>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    $0x1,%al
cmpq   $0x0,(%rcx)
mov    %al,-0x9(%rbp)
jl     112a <specinf+0x2a>
mov    -0x8(%rbp),%rax
cmpq   $0x0,0x8(%rax)
setl   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<specinf>:
cmpq   $0x0,(%rdi)
js     110f <specinf+0xf>
mov    0x8(%rdi),%rax
shr    $0x3f,%rax
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
define i32 @specinf(%struct.timespec* %0) {
%2 = alloca %struct.timespec*
store %struct.timespec* %0, %struct.timespec** %2
%3 = load %struct.timespec*, %struct.timespec** %2
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
%5 = load i64, i64* %4
%6 = icmp slt i64 %5, 0
br i1 %6, label %12, label %7
7: ; preds = %1
%8 = load %struct.timespec*, %struct.timespec** %2
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %8, i32 0, i32 1
%10 = load i64, i64* %9
%11 = icmp slt i64 %10, 0
br label %12
12: ; preds = %7, %1
%13 = phi i1 [ true, %1 ], [ %11, %7 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
define i32 @specinf(%struct.timespec* nocapture %0) {
%2 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 0
%3 = load i64, i64* %2
%4 = icmp slt i64 %3, 0
br i1 %4, label %10, label %5
5: ; preds = %1
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 1
%7 = load i64, i64* %6
%8 = lshr i64 %7, 63
%9 = trunc i64 %8 to i32
br label %10
10: ; preds = %5, %1
%11 = phi i32 [ 1, %1 ], [ %9, %5 ]
ret i32 %11
}
int pure_gcd(int a, int b) {
  int c;
  c = a % b;
  while (c != 0) {
    a = b;
    b = c;
    c = a % b;
  }
  return b;
}


x86 assembly (clang, -O0):
<pure_gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1139 <pure_gcd+0x39>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0xc(%rbp)
jmp    1114 <pure_gcd+0x14>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pure_gcd>:
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
je     1120 <pure_gcd+0x20>
nopl   0x0(%rax)
mov    %edx,%ecx
mov    %esi,%eax
cltd
idiv   %ecx
mov    %ecx,%esi
test   %edx,%edx
jne    1110 <pure_gcd+0x10>
mov    %ecx,%eax
ret
mov    %esi,%eax
ret

LLVM IR (-O0):
define i32 @pure_gcd(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 = srem i32 %6, %7
store i32 %8, i32* %5
br label %9
9: ; preds = %12, %2
%10 = load i32, i32* %5
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %18
12: ; preds = %9
%13 = load i32, i32* %4
store i32 %13, i32* %3
%14 = load i32, i32* %5
store i32 %14, i32* %4
%15 = load i32, i32* %3
%16 = load i32, i32* %4
%17 = srem i32 %15, %16
store i32 %17, i32* %5
br label %9
18: ; preds = %9
%19 = load i32, i32* %4
ret i32 %19
}

LLVM IR (-O2):
define i32 @pure_gcd(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
%4 = icmp eq i32 %3, 0
br i1 %4, label %10, label %5
5: ; preds = %2, %5
%6 = phi i32 [ %8, %5 ], [ %3, %2 ]
%7 = phi i32 [ %6, %5 ], [ %1, %2 ]
%8 = srem i32 %7, %6
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %5
10: ; preds = %5, %2
%11 = phi i32 [ %1, %2 ], [ %6, %5 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void svgend() { printf("</svg>"); }


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"</svg>\00"
define void @svgend() {
%1 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"</svg>\00"
define void @svgend() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ lflush();
int /*<<< orphan*/ lprcat(char *);
int /*<<< orphan*/ nap(int);
void nogold(void) {
  lprcat("\nYou don't have enough gold to pay for that!");
  lflush();
  nap(2200);
}


x86 assembly (clang, -O0):
<nogold>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1050 <lprcat@plt>
mov    $0x0,%al
call   1040 <lflush@plt>
mov    $0x898,%edi
call   1030 <nap@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<nogold>:
push   %rax
lea    0xec8(%rip),%rdi
call   1050 <lprcat@plt>
xor    %eax,%eax
call   1040 <lflush@plt>
mov    $0x898,%edi
pop    %rax
jmp    1030 <nap@plt>

LLVM IR (-O0):
@.str = [45 x i8] c"\0AYou don't have enough gold to pay for that!\00"
define void @nogold() {
%1 = call i32 @lprcat(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @lflush()
%3 = call i32 @nap(i32 2200)
ret void
}

LLVM IR (-O2):
@.str = [45 x i8] c"\0AYou don't have enough gold to pay for that!\00"
define void @nogold() {
%1 = tail call i32 @lprcat(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @lflush()
%3 = tail call i32 @nap(i32 2200)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *, char *);
void printUsage(char *programName) {
  printf("Usage: %s <logfile> (command | option | filename)*\n"
         "where valid commands are\n"
         "       --player-status <username>                Prints 1 if player "
         "is currently logged in, 0 otherwise.\n"
         "\n",
         "valid options are\n"
         "        none\n",
         programName);
  exit(0);
}


x86 assembly (clang, -O0):
<printUsage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
lea    0xec9(%rip),%rdi
lea    0xf79(%rip),%rsi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<printUsage>:
push   %rax
mov    %rdi,%rdx
lea    0xed5(%rip),%rdi
lea    0xf85(%rip),%rsi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [183 x i8] c"Usage: %s <logfile> (command | option | filename)*\0Awhere valid commands are\0A --player-status <username> Prints 1 if player is currently logged in, 0 otherwise.\0A\0A\00"
@.str.1 = [32 x i8] c"valid options are\0A none\0A\00"
define void @printUsage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([183 x i8], [183 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [183 x i8] c"Usage: %s <logfile> (command | option | filename)*\0Awhere valid commands are\0A --player-status <username> Prints 1 if player is currently logged in, 0 otherwise.\0A\0A\00"
@.str.1 = [32 x i8] c"valid options are\0A none\0A\00"
define void @printUsage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([183 x i8], [183 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int get_speed_mega_bytes(int /*<<< orphan*/, int /*<<< orphan*/);
float get_speed_mega_bits(uint64_t bytes_in_window, uint64_t window_size) {
  return 8 * get_speed_mega_bytes(bytes_in_window, window_size);
}


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

x86 assembly (clang, -O2):
<get_speed_mega_bits>:
push   %rax
call   1030 <get_speed_mega_bytes@plt>
shl    $0x3,%eax
cvtsi2ss %eax,%xmm0
pop    %rax
ret

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

LLVM IR (-O2):
define float @get_speed_mega_bits(i32 %0, i32 %1) {
%3 = tail call i32 @get_speed_mega_bytes(i32 %0, i32 %1)
%4 = shl nsw i32 %3, 3
%5 = sitofp i32 %4 to float
ret float %5
}