xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ strstr(char const *, char const *);
int str_contains(const char *haystack, const char *needle) {
  char *pos = (char *)strstr(haystack, needle);
  if (pos)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<str_contains>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strstr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1148 <str_contains+0x38>
movl   $0x1,-0x4(%rbp)
jmp    114f <str_contains+0x3f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @str_contains(i8* %0, i8* %1) {
%3 = tail call i64 @strstr(i8* %0, i8* %1)
%4 = icmp ne i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ addbyte(int);
void SAVE_EA() {
  addbyte(0x89);
  addbyte(0x44);
  addbyte(0x24);
  addbyte(0x24);
}


x86 assembly (clang, -O0):
<SAVE_EA>:
push   %rbp
mov    %rsp,%rbp
mov    $0x89,%edi
call   1030 <addbyte@plt>
mov    $0x44,%edi
call   1030 <addbyte@plt>
mov    $0x24,%edi
call   1030 <addbyte@plt>
mov    $0x24,%edi
call   1030 <addbyte@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<SAVE_EA>:
push   %rax
mov    $0x89,%edi
call   1030 <addbyte@plt>
mov    $0x44,%edi
call   1030 <addbyte@plt>
mov    $0x24,%edi
call   1030 <addbyte@plt>
mov    $0x24,%edi
pop    %rax
jmp    1030 <addbyte@plt>

LLVM IR (-O0):
define void @SAVE_EA() {
%1 = call i32 @addbyte(i32 137)
%2 = call i32 @addbyte(i32 68)
%3 = call i32 @addbyte(i32 36)
%4 = call i32 @addbyte(i32 36)
ret void
}

LLVM IR (-O2):
define void @SAVE_EA() {
%1 = tail call i32 @addbyte(i32 137)
%2 = tail call i32 @addbyte(i32 68)
%3 = tail call i32 @addbyte(i32 36)
%4 = tail call i32 @addbyte(i32 36)
ret void
}
pickspaces(line, col, number, nl) int line, col, number, nl;
{ pcspaces(line, col, number, nl, 0); }


x86 assembly (clang, -O0):
<pickspaces>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
xor    %r8d,%r8d
mov    $0x0,%al
call   1030 <pcspaces@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pickspaces>:
xor    %r8d,%r8d
xor    %eax,%eax
jmp    1030 <pcspaces@plt>

LLVM IR (-O0):
define i32 @pickspaces(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = load i32, i32* %9
%14 = call i32 (i32, i32, i32, i32, i32, ...) bitcast (i32 (...)* @pcspaces to i32 (i32, i32, i32, i32, i32, ...)*)(i32 %10, i32 %11, i32 %12, i32 %13, i32 0)
%15 = load i32, i32* %5
ret i32 %15
}

LLVM IR (-O2):
define i32 @pickspaces(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 (i32, i32, i32, i32, i32, ...) bitcast (i32 (...)* @pcspaces to i32 (i32, i32, i32, i32, i32, ...)*)(i32 %0, i32 %1, i32 %2, i32 %3, i32 0)
ret i32 undef
}
/* Variables and functions */
void *memfind(const void *s, int c, size_t n) {
  const void *ends = (const char *)s + n;
  for (; s < ends; s++)
    if (*(const unsigned char *)s == (unsigned char)c)
      break;
  return (void *)s;
}


x86 assembly (clang, -O0):
<memfind>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x20(%rbp),%rax
jae    1159 <memfind+0x59>
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    -0xc(%rbp),%ecx
movzbl %cl,%ecx
cmp    %ecx,%eax
jne    1143 <memfind+0x43>
jmp    1159 <memfind+0x59>
jmp    1148 <memfind+0x48>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111b <memfind+0x1b>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<memfind>:
mov    %rdi,%rax
test   %rdx,%rdx
jle    111e <memfind+0x1e>
add    %rax,%rdx
nopl   0x0(%rax,%rax,1)
cmp    %sil,(%rax)
je     111e <memfind+0x1e>
add    $0x1,%rax
cmp    %rdx,%rax
jb     1110 <memfind+0x10>
ret

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

LLVM IR (-O2):
define i8* @memfind(i8* %0, i32 %1, i64 %2) {
%4 = getelementptr inbounds i8, i8* %0, i64 %2
%5 = icmp sgt i64 %2, 0
br i1 %5, label %6, label %15
6: ; preds = %3
%7 = trunc i32 %1 to i8
br label %8
8: ; preds = %6, %12
%9 = phi i8* [ %0, %6 ], [ %13, %12 ]
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, %7
br i1 %11, label %15, label %12
12: ; preds = %8
%13 = getelementptr inbounds i8, i8* %9, i64 1
%14 = icmp ult i8* %13, %4
br i1 %14, label %8, label %15
15: ; preds = %12, %8, %3
%16 = phi i8* [ %0, %3 ], [ %9, %8 ], [ %13, %12 ]
ret i8* %16
}
/* Variables and functions */
int strlen(char *);
char *path_append_store(char *path) { return path + strlen(path); }


x86 assembly (clang, -O0):
<path_append_store>:
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 <strlen@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<path_append_store>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
add    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @path_append_store(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %3, i64 %6
ret i8* %7
}

LLVM IR (-O2):
define i8* @path_append_store(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = sext i32 %2 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
ret i8* %4
}
void dbg3(const char *format, ...) {}


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

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

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

LLVM IR (-O2):
define void @dbg3(i8* nocapture %0, ...) {
ret void
}
void deinitRB() {}


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

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

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

LLVM IR (-O2):
define void @deinitRB() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ merge(int, int, int);
void mergesort(int lo, int hi) {
  if (lo >= hi)
    return;
  int mid = (lo + hi) / 2;
  mergesort(lo, mid);
  mergesort(mid + 1, hi);
  merge(lo, mid, hi);
}


x86 assembly (clang, -O0):
<mergesort>:
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 <mergesort+0x1f>
jmp    1177 <mergesort+0x57>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <mergesort@plt>
mov    -0xc(%rbp),%edi
add    $0x1,%edi
mov    -0x8(%rbp),%esi
call   1040 <mergesort@plt>
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
call   1030 <merge@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mergesort>:
cmp    %esi,%edi
jge    1160 <mergesort+0x40>
push   %r15
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %edi,%r15d
lea    (%r14,%r15,1),%eax
mov    %eax,%ebx
shr    $0x1f,%ebx
add    %eax,%ebx
sar    %ebx
mov    %ebx,%esi
call   1040 <mergesort@plt>
lea    0x1(%rbx),%edi
mov    %r14d,%esi
call   1040 <mergesort@plt>
mov    %r15d,%edi
mov    %ebx,%esi
mov    %r14d,%edx
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <merge@plt>
ret

LLVM IR (-O0):
define void @mergesort(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 %24
10: ; preds = %2
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = add nsw i32 %11, %12
%14 = sdiv i32 %13, 2
store i32 %14, i32* %5
%15 = load i32, i32* %3
%16 = load i32, i32* %5
%17 = load i32, i32* %5
%18 = add nsw i32 %17, 1
%19 = load i32, i32* %4
%20 = load i32, i32* %3
%21 = load i32, i32* %5
%22 = load i32, i32* %4
%23 = call i32 @merge(i32 %20, i32 %21, i32 %22)
br label %24
24: ; preds = %10, %9
ret void
}

LLVM IR (-O2):
define void @mergesort(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
br i1 %3, label %5, label %4
4: ; preds = %2, %5
ret void
5: ; preds = %2
%6 = add nsw i32 %1, %0
%7 = sdiv i32 %6, 2
tail call void @mergesort(i32 %0, i32 %7)
%8 = add nsw i32 %7, 1
tail call void @mergesort(i32 %8, i32 %1)
%9 = tail call i32 @merge(i32 %0, i32 %7, i32 %1)
br label %4
}
/* Variables and functions */
int inb(int);
unsigned char get_nmi_reason(void) { return (inb(0x33) & 6) ? 0x80 : 0; }


x86 assembly (clang, -O0):
<get_nmi_reason>:
push   %rbp
mov    %rsp,%rbp
mov    $0x33,%edi
call   1030 <inb@plt>
mov    %eax,%edx
and    $0x6,%edx
xor    %eax,%eax
mov    $0x80,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_nmi_reason>:
push   %rax
mov    $0x33,%edi
call   1030 <inb@plt>
test   $0x6,%al
setne  %al
shl    $0x7,%al
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i8 @get_nmi_reason() {
%1 = call i32 @inb(i32 51)
%2 = and i32 %1, 6
%3 = icmp ne i32 %2, 0
%4 = zext i1 %3 to i64
%5 = select i1 %3, i32 128, i32 0
%6 = trunc i32 %5 to i8
ret i8 %6
}

LLVM IR (-O2):
define zeroext i8 @get_nmi_reason() {
%1 = tail call i32 @inb(i32 51)
%2 = and i32 %1, 6
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i8 0, i8 -128
ret i8 %4
}
/* Variables and functions */
int ReadData(int, void *, unsigned int);
int /*<<< orphan*/ perror(int /*<<< orphan*/ *);
int CheckForData(int sock, void *data, unsigned int size) {
  int b;
  if ((b = ReadData(sock, data, size)) > 0)
    return (b);
  else if (b < 0) {
    perror(NULL);
    return -1;
  }
}


x86 assembly (clang, -O0):
<CheckForData>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <ReadData@plt>
mov    %eax,-0x18(%rbp)
cmp    $0x0,%eax
jle    1158 <CheckForData+0x38>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    117c <CheckForData+0x5c>
cmpl   $0x0,-0x18(%rbp)
jge    1177 <CheckForData+0x57>
xor    %eax,%eax
mov    %eax,%edi
call   1030 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    117c <CheckForData+0x5c>
jmp    117c <CheckForData+0x5c>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CheckForData>:
push   %rax
call   1040 <ReadData@plt>
test   %eax,%eax
jle    112c <CheckForData+0xc>
pop    %rcx
ret
jns    112a <CheckForData+0xa>
xor    %edi,%edi
call   1030 <perror@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @CheckForData(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @ReadData(i32 %0, i8* %1, i32 %2)
%5 = icmp sgt i32 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %3
%7 = icmp slt i32 %4, 0
br i1 %7, label %8, label %10
8: ; preds = %6
%9 = tail call i32 @perror(i32* null)
br label %10
10: ; preds = %6, %3, %8
%11 = phi i32 [ -1, %8 ], [ %4, %3 ], [ undef, %6 ]
ret i32 %11
}
void endservent() {
  anvil_syslog(0, "%s unimplemented\n", __FUNCTION__);
  while (1)
    ;
}


x86 assembly (clang, -O0):
<endservent>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
lea    0xeee(%rip),%rdx
mov    $0x0,%al
call   1030 <anvil_syslog@plt>
jmp    112b <endservent+0x1b>

x86 assembly (clang, -O2):
<endservent>:
push   %rax
lea    0xee8(%rip),%rsi
lea    0xef3(%rip),%rdx
xor    %edi,%edi
xor    %eax,%eax
call   1030 <anvil_syslog@plt>
nopl   0x0(%rax,%rax,1)
jmp    1130 <endservent+0x20>

LLVM IR (-O0):
@.str = [18 x i8] c"%s unimplemented\0A\00"
@__FUNCTION__.endservent = [11 x i8] c"endservent\00"
define void @endservent() {
%1 = call i32 (i32, i8*, i8*, ...) bitcast (i32 (...)* @anvil_syslog to i32 (i32, i8*, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__FUNCTION__.endservent, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
br label %2
}

LLVM IR (-O2):
@.str = [18 x i8] c"%s unimplemented\0A\00"
@__FUNCTION__.endservent = [11 x i8] c"endservent\00"
define void @endservent() {
%1 = tail call i32 (i32, i8*, i8*, ...) bitcast (i32 (...)* @anvil_syslog to i32 (i32, i8*, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__FUNCTION__.endservent, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
br label %2
}
struct route_node *bgp_node_to_rnode(struct bgp_node *node) {
  return (struct route_node *)node;
}


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

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

LLVM IR (-O0):
%struct.route_node = type opaque
%struct.bgp_node = type opaque
define %struct.route_node* @bgp_node_to_rnode(%struct.bgp_node* %0) {
%2 = alloca %struct.bgp_node*
store %struct.bgp_node* %0, %struct.bgp_node** %2
%3 = load %struct.bgp_node*, %struct.bgp_node** %2
%4 = bitcast %struct.bgp_node* %3 to %struct.route_node*
ret %struct.route_node* %4
}

LLVM IR (-O2):
%struct.route_node = type opaque
%struct.bgp_node = type opaque
define %struct.route_node* @bgp_node_to_rnode(%struct.bgp_node* readnone %0) {
%2 = bitcast %struct.bgp_node* %0 to %struct.route_node*
ret %struct.route_node* %2
}
int get_best_reliability_score(long double reliability_score_1,
                               long double reliability_score_2,
                               long double reliability_score_3) {
  int max = 2;
  if (reliability_score_1 > reliability_score_2 &&
      reliability_score_1 > reliability_score_3) {
    max = 1;
  } else if (reliability_score_3 > reliability_score_2) {
    max = 3;
  }
  return max;
}


x86 assembly (clang, -O0):
<get_best_reliability_score>:
push   %rbp
mov    %rsp,%rbp
fldt   0x30(%rbp)
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fstpt  -0x30(%rbp)
movl   $0x2,-0x34(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
jbe    1157 <get_best_reliability_score+0x57>
jmp    1134 <get_best_reliability_score+0x34>
fldt   -0x10(%rbp)
fldt   -0x30(%rbp)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
jbe    1157 <get_best_reliability_score+0x57>
jmp    114b <get_best_reliability_score+0x4b>
movl   $0x1,-0x34(%rbp)
jmp    117a <get_best_reliability_score+0x7a>
fldt   -0x30(%rbp)
fldt   -0x20(%rbp)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
jbe    1175 <get_best_reliability_score+0x75>
jmp    116e <get_best_reliability_score+0x6e>
movl   $0x3,-0x34(%rbp)
jmp    117a <get_best_reliability_score+0x7a>
mov    -0x34(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_best_reliability_score>:
fldt   0x28(%rsp)
fldt   0x18(%rsp)
fldt   0x8(%rsp)
fucomi %st(1),%st
jbe    111b <get_best_reliability_score+0x1b>
mov    $0x1,%eax
fucomip %st(2),%st
fldz
ja     1141 <get_best_reliability_score+0x41>
fstp   %st(0)
mov    $0x2,%eax
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
fldz
fldz
fldz
jbe    1141 <get_best_reliability_score+0x41>
fstp   %st(2)
fstp   %st(0)
fstp   %st(0)
mov    $0x3,%eax
fldz
fldz
fldz
fstp   %st(2)
fstp   %st(0)
fstp   %st(0)
ret

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

LLVM IR (-O2):
define i32 @get_best_reliability_score(x86_fp80 %0, x86_fp80 %1, x86_fp80 %2) {
%4 = fcmp ogt x86_fp80 %0, %1
%5 = fcmp ogt x86_fp80 %0, %2
%6 = and i1 %4, %5
br i1 %6, label %10, label %7
7: ; preds = %3
%8 = fcmp ogt x86_fp80 %2, %1
br i1 %8, label %9, label %10
9: ; preds = %7
br label %10
10: ; preds = %3, %7, %9
%11 = phi i32 [ 3, %9 ], [ 2, %7 ], [ 1, %3 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ adc08d1020_write_reg(int, int);
void testpattern_adc08d1020() { adc08d1020_write_reg(0x9, 0x83FF); }


x86 assembly (clang, -O0):
<testpattern_adc08d1020>:
push   %rbp
mov    %rsp,%rbp
mov    $0x9,%edi
mov    $0x83ff,%esi
call   1030 <adc08d1020_write_reg@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<testpattern_adc08d1020>:
mov    $0x9,%edi
mov    $0x83ff,%esi
jmp    1030 <adc08d1020_write_reg@plt>

LLVM IR (-O0):
define void @testpattern_adc08d1020() {
%1 = call i32 @adc08d1020_write_reg(i32 9, i32 33791)
ret void
}

LLVM IR (-O2):
define void @testpattern_adc08d1020() {
%1 = tail call i32 @adc08d1020_write_reg(i32 9, i32 33791)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EPOLL_CTL_DEL;
int /*<<< orphan*/ epoll_ctl(int, int /*<<< orphan*/, int,
                             int /*<<< orphan*/ *);
void sp_del(int efd, int sock) { epoll_ctl(efd, EPOLL_CTL_DEL, sock, NULL); }


x86 assembly (clang, -O0):
<sp_del>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ed0(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%edx
xor    %eax,%eax
mov    %eax,%ecx
call   1030 <epoll_ctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sp_del>:
mov    %esi,%edx
mov    0x2edf(%rip),%rax
mov    (%rax),%esi
xor    %ecx,%ecx
jmp    1030 <epoll_ctl@plt>

LLVM IR (-O0):
@EPOLL_CTL_DEL = global i32 0
define void @sp_del(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* @EPOLL_CTL_DEL
%7 = load i32, i32* %4
%8 = call i32 @epoll_ctl(i32 %5, i32 %6, i32 %7, i32* null)
ret void
}

LLVM IR (-O2):
@EPOLL_CTL_DEL = global i32 0
define void @sp_del(i32 %0, i32 %1) {
%3 = load i32, i32* @EPOLL_CTL_DEL
%4 = tail call i32 @epoll_ctl(i32 %0, i32 %3, i32 %1, i32* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ is_prime(int);
void *thread3_find(void *arg) {
  int i;
  for (i = 140000; i < 200000; i++)
    is_prime(i);
}


x86 assembly (clang, -O0):
<thread3_find>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x222e0,-0x14(%rbp)
cmpl   $0x30d40,-0x14(%rbp)
jge    1146 <thread3_find+0x36>
mov    -0x14(%rbp),%edi
call   1030 <is_prime@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1123 <thread3_find+0x13>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread3_find>:
push   %rbx
mov    $0x222e0,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1030 <is_prime@plt>
add    $0x1,%ebx
cmp    $0x30d40,%ebx
jne    1120 <thread3_find+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define noalias i8* @thread3_find(i8* nocapture readnone %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i32 [ 140000, %1 ], [ %5, %2 ]
%4 = tail call i32 @is_prime(i32 %3)
%5 = add nuw nsw i32 %3, 1
%6 = icmp eq i32 %5, 200000
br i1 %6, label %7, label %2
7: ; preds = %2
ret i8* undef
}
void lgtd_timer_stop(struct lgtd_timer *timer) { (void)timer; }


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

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

LLVM IR (-O0):
%struct.lgtd_timer = type opaque
define void @lgtd_timer_stop(%struct.lgtd_timer* %0) {
%2 = alloca %struct.lgtd_timer*
store %struct.lgtd_timer* %0, %struct.lgtd_timer** %2
%3 = load %struct.lgtd_timer*, %struct.lgtd_timer** %2
ret void
}

LLVM IR (-O2):
%struct.lgtd_timer = type opaque
define void @lgtd_timer_stop(%struct.lgtd_timer* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sha512_init_ctx(void *);
void sha512_init(void *context) { sha512_init_ctx(context); }


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

x86 assembly (clang, -O2):
<sha512_init>:
jmp    1030 <sha512_init_ctx@plt>

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

LLVM IR (-O2):
define void @sha512_init(i8* %0) {
%2 = tail call i32 @sha512_init_ctx(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ aes_ccm_decrypt();
int /*<<< orphan*/ aes_ccm_encrypt();
int main(int argc, char **argv) {
  aes_ccm_encrypt();
  aes_ccm_decrypt();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <aes_ccm_encrypt@plt>
mov    $0x0,%al
call   1040 <aes_ccm_decrypt@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 (...) @aes_ccm_encrypt()
%6 = call i32 (...) @aes_ccm_decrypt()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @aes_ccm_encrypt()
%4 = tail call i32 (...) @aes_ccm_decrypt()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ popNarray(char *, unsigned int);
void popreal32array_(char *x, unsigned int *n) { popNarray(x, (*n * 32)); }


x86 assembly (clang, -O0):
<popreal32array_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
shl    $0x5,%esi
call   1030 <popNarray@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<popreal32array_>:
mov    (%rsi),%esi
shl    $0x5,%esi
jmp    1030 <popNarray@plt>

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

LLVM IR (-O2):
define void @popreal32array_(i8* %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = shl i32 %3, 5
%5 = tail call i32 @popNarray(i8* %0, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ steer(int);
void steer_right() { steer(1780); }


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

x86 assembly (clang, -O2):
<steer_right>:
mov    $0x6f4,%edi
jmp    1030 <steer@plt>

LLVM IR (-O0):
define void @steer_right() {
%1 = call i32 @steer(i32 1780)
ret void
}

LLVM IR (-O2):
define void @steer_right() {
%1 = tail call i32 @steer(i32 1780)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int test_loop_ubyte_101();
int main(int argc, char **argv) {
  if (test_loop_ubyte_101() != 101)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <test_loop_ubyte_101@plt>
cmp    $0x65,%eax
je     114d <main+0x2d>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <test_loop_ubyte_101@plt>
cmp    $0x65,%eax
jne    1131 <main+0x11>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_loop_ubyte_101()
%4 = icmp eq i32 %3, 101
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 (...) @abort()
unreachable
7: ; preds = %2
ret i32 0
}
int main() {
  int a, b, c;
  a = 0x40;
  b = a * 8;
  c = b / 32;
  return c;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x40,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x3,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x20,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 64, i32* %2
%5 = load i32, i32* %2
%6 = mul nsw i32 %5, 8
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = sdiv i32 %7, 32
store i32 %8, i32* %4
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
define i32 @main() {
ret i32 16
}
char *strupr(char *str) {
  char *p = str;
  while (*p != '\0') {
    if (*p >= 'a' && *p <= 'z')
      *p -= 0x20;
    p++;
  }
  return str;
}


x86 assembly (clang, -O0):
<strupr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     115d <strupr+0x5d>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x61,%eax
jl     114c <strupr+0x4c>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x7a,%eax
jg     114c <strupr+0x4c>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
sub    $0x20,%ecx
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strupr+0x10>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strupr>:
mov    %rdi,%rax
mov    (%rdi),%cl
test   %cl,%cl
je     112c <strupr+0x2c>
lea    0x1(%rax),%rdx
jmp    111b <strupr+0x1b>
nop
movzbl (%rdx),%ecx
add    $0x1,%rdx
test   %cl,%cl
je     112c <strupr+0x2c>
lea    -0x61(%rcx),%esi
cmp    $0x19,%sil
ja     1110 <strupr+0x10>
add    $0xe0,%cl
mov    %cl,-0x1(%rdx)
jmp    1110 <strupr+0x10>
ret

LLVM IR (-O0):
define i8* @strupr(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
br label %5
5: ; preds = %26, %1
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %29
10: ; preds = %5
%11 = load i8*, i8** %3
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp sge i32 %13, 97
br i1 %14, label %15, label %26
15: ; preds = %10
%16 = load i8*, i8** %3
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp sle i32 %18, 122
br i1 %19, label %20, label %26
20: ; preds = %15
%21 = load i8*, i8** %3
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = sub nsw i32 %23, 32
%25 = trunc i32 %24 to i8
store i8 %25, i8* %21
br label %26
26: ; preds = %20, %15, %10
%27 = load i8*, i8** %3
%28 = getelementptr inbounds i8, i8* %27, i32 1
store i8* %28, i8** %3
br label %5
29: ; preds = %5
%30 = load i8*, i8** %2
ret i8* %30
}

LLVM IR (-O2):
define i8* @strupr(i8* returned %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %11
%5 = phi i8 [ %13, %11 ], [ %2, %1 ]
%6 = phi i8* [ %12, %11 ], [ %0, %1 ]
%7 = add i8 %5, -97
%8 = icmp ult i8 %7, 26
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = add nsw i8 %5, -32
store i8 %10, i8* %6
br label %11
11: ; preds = %9, %4
%12 = getelementptr inbounds i8, i8* %6, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %11, %1
ret i8* %0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ little_endian_read_16(int /*<<< orphan*/ const *, int);
uint16_t
hci_event_disconnection_complete_get_connection_handle(const uint8_t *event) {
  return little_endian_read_16(event, 3);
}


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

x86 assembly (clang, -O2):
<hci_event_disconnection_complete_get_connection_handle>:
mov    $0x3,%esi
jmp    1030 <little_endian_read_16@plt>

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

LLVM IR (-O2):
define i32 @hci_event_disconnection_complete_get_connection_handle(i32* %0) {
%2 = tail call i32 @little_endian_read_16(i32* %0, i32 3)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void pad(int d) {
  int i;
  for (i = 0; i < d; i++)
    fputs("  ", stdout);
}


x86 assembly (clang, -O0):
<pad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1151 <pad+0x41>
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
lea    0xec2(%rip),%rdi
call   1030 <fputs@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <pad+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pad>:
push   %r15
push   %r14
push   %rbx
test   %edi,%edi
jle    1140 <pad+0x30>
mov    %edi,%ebx
mov    0x2ebe(%rip),%r15
lea    0xed7(%rip),%r14
nopl   0x0(%rax)
mov    (%r15),%esi
mov    %r14,%rdi
call   1030 <fputs@plt>
add    $0xffffffff,%ebx
jne    1130 <pad+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c" \00"
@stdout = global i32 0
define void @pad(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = load i32, i32* @stdout
%6 = tail call i32 @fputs(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = add nuw nsw i32 %4, 1
%8 = icmp eq i32 %7, %0
br i1 %8, label %9, label %3
9: ; preds = %3, %1
ret void
}
void polf2i_(n, parray) int *n;
int parray[][2];
{ polf2i((long)*n, parray); }


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

x86 assembly (clang, -O2):
<polf2i_>:
movslq (%rdi),%rdi
xor    %eax,%eax
jmp    1030 <polf2i@plt>

LLVM IR (-O0):
define void @polf2i_(i32* %0, [2 x i32]* %1) {
%3 = alloca i32*
%4 = alloca [2 x i32]*
store i32* %0, i32** %3
store [2 x i32]* %1, [2 x i32]** %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %5
%7 = sext i32 %6 to i64
%8 = load [2 x i32]*, [2 x i32]** %4
%9 = call i32 (i64, [2 x i32]*, ...) bitcast (i32 (...)* @polf2i to i32 (i64, [2 x i32]*, ...)*)(i64 %7, [2 x i32]* %8)
ret void
}

LLVM IR (-O2):
define void @polf2i_(i32* nocapture %0, [2 x i32]* %1) {
%3 = load i32, i32* %0
%4 = sext i32 %3 to i64
%5 = tail call i32 (i64, [2 x i32]*, ...) bitcast (i32 (...)* @polf2i to i32 (i64, [2 x i32]*, ...)*)(i64 %4, [2 x i32]* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ snprintf(char *, int, char *, char *, char *);
int /*<<< orphan*/ system(char *);
void screen_kill(char nickname[]) {
  char chaine[100] = {0};
  snprintf(chaine, 100, "su --command='screen -S %s-rtorrent -X quit' %s\n",
           nickname, nickname);
  printf("%s", chaine);
  system(chaine);
}


x86 assembly (clang, -O0):
<screen_kill>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x70(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1060 <memset@plt>
lea    -0x70(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    -0x8(%rbp),%r8
mov    $0x64,%esi
lea    0xe8c(%rip),%rdx
call   1050 <snprintf@plt>
lea    -0x70(%rbp),%rsi
lea    0xead(%rip),%rdi
call   1040 <printf@plt>
lea    -0x70(%rbp),%rdi
call   1030 <system@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<screen_kill>:
push   %rbx
sub    $0x70,%rsp
mov    %rdi,%rcx
xorps  %xmm0,%xmm0
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
movl   $0x0,0x60(%rsp)
lea    0xe99(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x64,%esi
mov    %rcx,%r8
call   1050 <snprintf@plt>
lea    0xeb0(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [49 x i8] c"su --command='screen -S %s-rtorrent -X quit' %s\0A\00"
@.str.1 = [3 x i8] c"%s\00"
define void @screen_kill(i8* %0) {
%2 = alloca i8*
%3 = alloca [100 x i8]
store i8* %0, i8** %2
%4 = bitcast [100 x i8]* %3 to i8*
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%6 = load i8*, i8** %2
%7 = load i8*, i8** %2
%8 = call i32 @snprintf(i8* %5, i32 100, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %7)
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%10 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %9)
%11 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%12 = call i32 @system(i8* %11)
ret void
}

LLVM IR (-O2):
@.str = [49 x i8] c"su --command='screen -S %s-rtorrent -X quit' %s\0A\00"
@.str.1 = [3 x i8] c"%s\00"
define void @screen_kill(i8* %0) {
%2 = alloca [100 x i8]
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%4 = call i32 @snprintf(i8* %3, i32 100, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %0)
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%6 = call i32 @system(i8* %3)
ret void
}
int min(int a, int b) {
  if (a <= b)
    return a;
  return b;
}


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1121 <min+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <min+0x27>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
mov    %edi,%eax
cmp    %esi,%edi
cmovg  %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @min(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
int BIO_sock_non_fatal_error(int err) {
  switch (err) {
    return (1);
  default:
    break;
  }
  return (0);
}


x86 assembly (clang, -O0):
<BIO_sock_non_fatal_error>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    110c <BIO_sock_non_fatal_error+0xc>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @BIO_sock_non_fatal_error(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %4 [
]
4: ; preds = %1
br label %5
5: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
define i32 @BIO_sock_non_fatal_error(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ handleConnect();
scalar_t__ nextConnect();
int startWebServer() {
  while (nextConnect()) {
    handleConnect();
  }
  return (-1);
}


x86 assembly (clang, -O0):
<startWebServer>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <startWebServer+0x9>
mov    $0x0,%al
call   1040 <nextConnect@plt>
cmp    $0x0,%rax
je     1146 <startWebServer+0x26>
mov    $0x0,%al
call   1030 <handleConnect@plt>
jmp    1129 <startWebServer+0x9>
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<startWebServer>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <nextConnect@plt>
test   %rax,%rax
je     1145 <startWebServer+0x25>
xor    %eax,%eax
call   1030 <handleConnect@plt>
jmp    1130 <startWebServer+0x10>
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @startWebServer() {
%1 = tail call i64 (...) @nextConnect()
%2 = icmp eq i64 %1, 0
br i1 %2, label %7, label %3
3: ; preds = %0, %3
%4 = tail call i32 (...) @handleConnect()
%5 = tail call i64 (...) @nextConnect()
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %3
7: ; preds = %3, %0
ret i32 -1
}
void free_matrix(double **a, int rows) {
  int i = 0;
  for (i = 0; i < rows; i++)
    free(a[i]);
  free(a);
}


x86 assembly (clang, -O0):
<free_matrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1158 <free_matrix+0x48>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112d <free_matrix+0x1d>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_matrix>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1142 <free_matrix+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <free_matrix+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_matrix(double** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds double*, double** %0, i64 %7
%9 = bitcast double** %8 to i8**
%10 = load i8*, i8** %9
tail call void @free(i8* %10)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = bitcast double** %0 to i8*
tail call void @free(i8* %14)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
void *task(void *p) {
  usleep(30000);
  return NULL;
}


x86 assembly (clang, -O0):
<task>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x7530,%edi
call   1030 <usleep@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @task(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @usleep(i32 30000)
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @task(i8* nocapture readnone %0) {
%2 = tail call i32 @usleep(i32 30000)
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ __console_tx_char(int, unsigned char);
void print_err_char(unsigned char byte) { __console_tx_char(3, byte); }


x86 assembly (clang, -O0):
<print_err_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x3,%edi
movzbl -0x1(%rbp),%esi
call   1030 <__console_tx_char@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_err_char>:
mov    %edi,%esi
mov    $0x3,%edi
jmp    1030 <__console_tx_char@plt>

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

LLVM IR (-O2):
define void @print_err_char(i8 zeroext %0) {
%2 = tail call i32 @__console_tx_char(i32 3, i8 zeroext %0)
ret void
}
int is_big_endian() {
  int x = 0x01;
  char *c = (char *)&x;
  return (c[0] != 0x01);
}


x86 assembly (clang, -O0):
<is_big_endian>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x1,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @is_big_endian() {
%1 = alloca i32
%2 = alloca i8*
store i32 1, i32* %1
%3 = bitcast i32* %1 to i8*
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp ne i32 %7, 1
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @is_big_endian() {
ret i32 0
}
/* Type definitions */
struct bytebuffer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ bytebuffer_append(struct bytebuffer *, char const *,
                                     int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
void bytebuffer_puts(struct bytebuffer *b, const char *str) {
  bytebuffer_append(b, str, strlen(str));
}


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

x86 assembly (clang, -O2):
<bytebuffer_puts>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <bytebuffer_append@plt>

LLVM IR (-O0):
%struct.bytebuffer = type { i32 }
define void @bytebuffer_puts(%struct.bytebuffer* %0, i8* %1) {
%3 = alloca %struct.bytebuffer*
%4 = alloca i8*
store %struct.bytebuffer* %0, %struct.bytebuffer** %3
store i8* %1, i8** %4
%5 = load %struct.bytebuffer*, %struct.bytebuffer** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @bytebuffer_append(%struct.bytebuffer* %5, i8* %6, i32 %8)
ret void
}

LLVM IR (-O2):
%struct.bytebuffer = type { i32 }
define void @bytebuffer_puts(%struct.bytebuffer* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @bytebuffer_append(%struct.bytebuffer* %0, i8* %1, i32 %3)
ret void
}