xunge/DecIR huggingface dataset:
__attribute__((no, noclone)) unsigned short foo14(unsigned short arg) {
  unsigned short ret = 1;
  if (arg + 1 < ((!1) ? -(1L << (sizeof(char) * 8 - 1)) : 0) ||
      arg + 1 > ((!0) ? ((1L << (sizeof(char) * 8 - 1)) - 1)
                      : ((1L << (sizeof(char) * 8)) - 1)))
    return ret;
  arg = arg + 1;
  ret = (char)arg;
  return arg;
}


x86 assembly (clang, -O0):
<foo14>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x4(%rbp)
movw   $0x1,-0x6(%rbp)
movzwl -0x4(%rbp),%eax
add    $0x1,%eax
cltq
cmp    $0x0,%rax
jl     1137 <foo14+0x37>
movzwl -0x4(%rbp),%eax
add    $0x1,%eax
cltq
cmp    $0x7f,%rax
jle    1144 <foo14+0x44>
mov    -0x6(%rbp),%ax
mov    %ax,-0x2(%rbp)
jmp    1162 <foo14+0x62>
movzwl -0x4(%rbp),%eax
add    $0x1,%eax
mov    %ax,-0x4(%rbp)
mov    -0x4(%rbp),%ax
movsbl %al,%eax
mov    %ax,-0x6(%rbp)
mov    -0x4(%rbp),%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo14>:
lea    0x1(%rdi),%ecx
cmp    $0x7f,%di
mov    $0x1,%eax
cmovb  %ecx,%eax
ret

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

LLVM IR (-O2):
define zeroext i16 @foo14(i16 zeroext %0) {
%2 = add i16 %0, 1
%3 = icmp ugt i16 %0, 126
%4 = select i1 %3, i16 1, i16 %2
ret i16 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
main() { printf("%s\n", "Sun Jan 23 07:19:12 2022"); }


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [25 x i8] c"Sun Jan 23 07:19:12 2022\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [25 x i8] c"Sun Jan 23 07:19:12 2022\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ F_SETFL;
int /*<<< orphan*/ O_NONBLOCK;
int /*<<< orphan*/ fcntl(int, int /*<<< orphan*/, int /*<<< orphan*/);
void UnblockSocket(int SocketNum) { fcntl(SocketNum, F_SETFL, O_NONBLOCK); }


x86 assembly (clang, -O0):
<UnblockSocket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eb3(%rip),%rax
mov    (%rax),%esi
mov    0x2eba(%rip),%rax
mov    (%rax),%edx
call   1030 <fcntl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UnblockSocket>:
mov    0x2ec1(%rip),%rax
mov    (%rax),%esi
mov    0x2ec8(%rip),%rax
mov    (%rax),%edx
jmp    1030 <fcntl@plt>

LLVM IR (-O0):
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
define void @UnblockSocket(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @F_SETFL
%5 = load i32, i32* @O_NONBLOCK
%6 = call i32 @fcntl(i32 %3, i32 %4, i32 %5)
ret void
}

LLVM IR (-O2):
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
define void @UnblockSocket(i32 %0) {
%2 = load i32, i32* @F_SETFL
%3 = load i32, i32* @O_NONBLOCK
%4 = tail call i32 @fcntl(i32 %0, i32 %2, i32 %3)
ret void
}
int max2(int a, int b) { return (a > b) ? a : b; }


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

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

LLVM IR (-O0):
define i32 @max2(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 = icmp sgt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @max2(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
void *dlopen(char *, int /*<<< orphan*/);
int /*<<< orphan*/ open(char *, int);
int main() {
  void *handle;
  open("12345", 12);
  handle = dlopen("somefile", 0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
mov    $0xc,%esi
call   1040 <open@plt>
lea    0xec6(%rip),%rdi
xor    %esi,%esi
call   1030 <dlopen@plt>
mov    %rax,-0x8(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0xc,%esi
call   1040 <open@plt>
lea    0xecd(%rip),%rdi
xor    %esi,%esi
call   1030 <dlopen@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"12345\00"
@.str.1 = [9 x i8] c"somefile\00"
define i32 @main() {
%1 = alloca i8*
%2 = call i32 @open(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 12)
%3 = call i8* @dlopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 0)
store i8* %3, i8** %1
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"12345\00"
@.str.1 = [9 x i8] c"somefile\00"
define i32 @main() {
%1 = tail call i32 @open(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 12)
%2 = tail call i8* @dlopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_read() {
  printf("NOT IMPLEMENTED:"
         "pa_read"
         "\n");
}


x86 assembly (clang, -O0):
<pa_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [25 x i8] c"NOT IMPLEMENTED:pa_read\0A\00"
define i32 @pa_read() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [24 x i8] c"NOT IMPLEMENTED:pa_read\00"
define i32 @pa_read() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int value = 1;
  while (value <= 3) {
    printf("Value is %d\n", value);
    value++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x3,-0x8(%rbp)
jg     114d <main+0x3d>
mov    -0x8(%rbp),%esi
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    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    $0x1,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [13 x i8] c"Value is %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 2)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void cpulimit(void) { printf("#ifndef CPUEMU_68000_ONLY\n"); }


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

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

LLVM IR (-O0):
@.str = [27 x i8] c"#ifndef CPUEMU_68000_ONLY\0A\00"
define void @cpulimit() {
%1 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [26 x i8] c"#ifndef CPUEMU_68000_ONLY\00"
define void @cpulimit() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
ret void
}
struct spwd *getspent() {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.spwd = type opaque
define %struct.spwd* @getspent() {
ret %struct.spwd* null
}

LLVM IR (-O2):
%struct.spwd = type opaque
define noalias %struct.spwd* @getspent() {
ret %struct.spwd* null
}
/* Type definitions */
struct lm {
  int dummy;
};

/* Variables and functions */
char **lmCloneRowExt(struct lm *, char **, int, int);
char **lmCloneRow(struct lm *lm, char **row, int rowSize) {
  return lmCloneRowExt(lm, row, rowSize, rowSize);
}


x86 assembly (clang, -O0):
<lmCloneRow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x14(%rbp),%ecx
call   1030 <lmCloneRowExt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lmCloneRow>:
mov    %edx,%ecx
jmp    1030 <lmCloneRowExt@plt>

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

LLVM IR (-O2):
%struct.lm = type { i32 }
define i8** @lmCloneRow(%struct.lm* %0, i8** %1, i32 %2) {
%4 = tail call i8** @lmCloneRowExt(%struct.lm* %0, i8** %1, i32 %2, i32 %2)
ret i8** %4
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int remove(char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ tsd();
int /*<<< orphan*/ tse();
int main(void) {
  tse();
  tsd();
  int ret = remove("./save");
  if (ret != 0) {
    fprintf(stderr, "error: could not remove savefile\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <tse@plt>
mov    $0x0,%al
call   1030 <tsd@plt>
lea    0xe9c(%rip),%rdi
call   1040 <remove@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     118b <main+0x4b>
mov    0x2e63(%rip),%rax
mov    (%rax),%edi
lea    0xe81(%rip),%rsi
call   1050 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <tse@plt>
xor    %eax,%eax
call   1030 <tsd@plt>
lea    0xeaa(%rip),%rdi
call   1040 <remove@plt>
test   %eax,%eax
je     1174 <main+0x34>
mov    0x2e7a(%rip),%rax
mov    (%rax),%edi
lea    0xe98(%rip),%rsi
call   1050 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"./save\00"
@stderr = global i32 0
@.str.1 = [34 x i8] c"error: could not remove savefile\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @tse()
%4 = call i32 (...) @tsd()
%5 = call i32 @remove(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %0
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %8, %0
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"./save\00"
@stderr = global i32 0
@.str.1 = [34 x i8] c"error: could not remove savefile\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @tse()
%2 = tail call i32 (...) @tsd()
%3 = tail call i32 @remove(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i32 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %0
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %5, %0
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ fd_set;

/* Variables and functions */
int /*<<< orphan*/ FD_SET(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ FD_ZERO(int /*<<< orphan*/ *);
int /*<<< orphan*/ select(int, int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                          int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int do_select(int fd) {
  fd_set readset;
  FD_ZERO(&readset);
  FD_SET(fd, &readset);
  select(fd + 1, &readset, NULL, NULL, NULL);
  return 1;
}


x86 assembly (clang, -O0):
<do_select>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
call   1030 <FD_ZERO@plt>
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
call   1050 <FD_SET@plt>
mov    -0x4(%rbp),%edi
add    $0x1,%edi
lea    -0x8(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%r8d
mov    %r8,%rdx
mov    %r8,%rcx
call   1040 <select@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_select>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0x4(%rsp),%r14
mov    %r14,%rdi
call   1030 <FD_ZERO@plt>
mov    %ebx,%edi
mov    %r14,%rsi
call   1050 <FD_SET@plt>
add    $0x1,%ebx
mov    %ebx,%edi
mov    %r14,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1040 <select@plt>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @do_select(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 @FD_ZERO(i32* %3)
%5 = load i32, i32* %2
%6 = call i32 @FD_SET(i32 %5, i32* %3)
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 1
%9 = call i32 @select(i32 %8, i32* %3, i32* null, i32* null, i32* null)
ret i32 1
}

LLVM IR (-O2):
define i32 @do_select(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @FD_ZERO(i32* %2)
%5 = call i32 @FD_SET(i32 %0, i32* %2)
%6 = add nsw i32 %0, 1
%7 = call i32 @select(i32 %6, i32* %2, i32* null, i32* null, i32* null)
ret i32 1
}
/* Type definitions */
typedef size_t ssize_t;

/* Variables and functions */
ssize_t __ht_bucket_dist(size_t index, size_t fhash, int M) {
  if (fhash == ((size_t)-1)) {
    return 0;
  }
  return ((fhash ^ ((size_t)1 << ((sizeof(size_t) * 8) - 1))) >>
          ((sizeof(size_t) * 8) - M - 1)) -
         index;
}


x86 assembly (clang, -O0):
<__ht_bucket_dist>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
cmpq   $0xffffffffffffffff,-0x18(%rbp)
jne    1127 <__ht_bucket_dist+0x27>
movq   $0x0,-0x8(%rbp)
jmp    1150 <__ht_bucket_dist+0x50>
movabs $0x8000000000000000,%rax
xor    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rdx
mov    $0x40,%ecx
sub    %rdx,%rcx
sub    $0x1,%rcx
shr    %cl,%rax
sub    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ht_bucket_dist>:
cmp    $0xffffffffffffffff,%rsi
je     1121 <__ht_bucket_dist+0x21>
mov    %rsi,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
mov    $0x3f,%cl
sub    %dl,%cl
shr    %cl,%rax
sub    %rdi,%rax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @__ht_bucket_dist(i64 %0, i64 %1, i32 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i32
store i64 %0, i64* %5
store i64 %1, i64* %6
store i32 %2, i32* %7
%8 = load i64, i64* %6
%9 = icmp eq i64 %8, -1
br i1 %9, label %10, label %11
10: ; preds = %3
store i64 0, i64* %4
br label %21
11: ; preds = %3
%12 = load i64, i64* %6
%13 = xor i64 %12, -9223372036854775808
%14 = load i32, i32* %7
%15 = sext i32 %14 to i64
%16 = sub i64 64, %15
%17 = sub i64 %16, 1
%18 = lshr i64 %13, %17
%19 = load i64, i64* %5
%20 = sub i64 %18, %19
store i64 %20, i64* %4
br label %21
21: ; preds = %11, %10
%22 = load i64, i64* %4
ret i64 %22
}

LLVM IR (-O2):
define i64 @__ht_bucket_dist(i64 %0, i64 %1, i32 %2) {
%4 = icmp eq i64 %1, -1
br i1 %4, label %11, label %5
5: ; preds = %3
%6 = xor i64 %1, -9223372036854775808
%7 = sext i32 %2 to i64
%8 = sub nsw i64 63, %7
%9 = lshr i64 %6, %8
%10 = sub i64 %9, %0
br label %11
11: ; preds = %3, %5
%12 = phi i64 [ %10, %5 ], [ 0, %3 ]
ret i64 %12
}
/* Variables and functions */
int get_short_filename(char *, char *);
int remove_extension(char *, char *);
int get_short_filename_no_ext(char *filename, char *short_filename) {
  int ret = 0;
  if ((ret = get_short_filename(filename, short_filename)) < 0)
    return ret;
  if ((ret = remove_extension(short_filename, short_filename)) < 0)
    return ret;
  return ret;
}


x86 assembly (clang, -O0):
<get_short_filename_no_ext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <get_short_filename@plt>
mov    %eax,-0x1c(%rbp)
cmp    $0x0,%eax
jge    115b <get_short_filename_no_ext+0x3b>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1185 <get_short_filename_no_ext+0x65>
mov    -0x18(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <remove_extension@plt>
mov    %eax,-0x1c(%rbp)
cmp    $0x0,%eax
jge    117f <get_short_filename_no_ext+0x5f>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1185 <get_short_filename_no_ext+0x65>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_short_filename_no_ext>:
push   %rbx
mov    %rsi,%rbx
call   1030 <get_short_filename@plt>
test   %eax,%eax
js     1139 <get_short_filename_no_ext+0x19>
mov    %rbx,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <remove_extension@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @get_short_filename_no_ext(i8* %0, i8* %1) {
%3 = tail call i32 @get_short_filename(i8* %0, i8* %1)
%4 = icmp slt i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @remove_extension(i8* %1, i8* %1)
br label %7
7: ; preds = %5, %2
%8 = phi i32 [ %3, %2 ], [ %6, %5 ]
ret i32 %8
}
void setnum(char *s, int n) {
  int i;
  for (i = 0; i < 3; i++) {
    *--s = '0' + (n % 10);
    n /= 10;
  }
}


x86 assembly (clang, -O0):
<setnum>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x3,-0x10(%rbp)
jge    115a <setnum+0x5a>
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    $0x30,%edx
mov    %dl,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0xffffffffffffffff,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,-0x1(%rax)
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <setnum+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<setnum>:
movslq %esi,%rcx
imul   $0x66666667,%rcx,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rax
add    %edx,%eax
lea    (%rax,%rax,1),%edx
lea    (%rdx,%rdx,4),%edx
imul   $0x51eb851f,%rcx,%rsi
sub    %edx,%ecx
add    $0x30,%cl
mov    %cl,-0x1(%rdi)
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x22,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
add    $0x30,%al
mov    %al,-0x2(%rdi)
mov    %rsi,%rax
shr    $0x3f,%rax
sar    $0x25,%rsi
add    %eax,%esi
movslq %esi,%rax
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x22,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
add    $0x30,%al
mov    %al,-0x3(%rdi)
ret

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

LLVM IR (-O2):
define void @setnum(i8* nocapture writeonly %0, i32 %1) {
%3 = srem i32 %1, 10
%4 = trunc i32 %3 to i8
%5 = add nsw i8 %4, 48
%6 = getelementptr inbounds i8, i8* %0, i64 -1
store i8 %5, i8* %6
%7 = sdiv i32 %1, 10
%8 = srem i32 %7, 10
%9 = trunc i32 %8 to i8
%10 = add nsw i8 %9, 48
%11 = getelementptr inbounds i8, i8* %0, i64 -2
store i8 %10, i8* %11
%12 = sdiv i32 %1, 100
%13 = srem i32 %12, 10
%14 = trunc i32 %13 to i8
%15 = add nsw i8 %14, 48
%16 = getelementptr inbounds i8, i8* %0, i64 -3
store i8 %15, i8* %16
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/
convert_10bit_y_uv_vectors_to_8bit_rgb_vectors_sse2_ssse3(int /*<<< orphan*/ *,
                                                          int /*<<< orphan*/ *);
extern void
convert_10bit_y_uv_vectors_to_8bit_rgb_vectors_sse2_ssse3_sse41(__m128i *in,
                                                                __m128i *out) {
  convert_10bit_y_uv_vectors_to_8bit_rgb_vectors_sse2_ssse3(in, out);
}


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

x86 assembly (clang, -O2):
<convert_10bit_y_uv_vectors_to_8bit_rgb_vectors_sse2_ssse3_sse41>:
jmp    1030 <convert_10bit_y_uv_vectors_to_8bit_rgb_vectors_sse2_ssse3@plt>

LLVM IR (-O0):
define void @convert_10bit_y_uv_vectors_to_8bit_rgb_vectors_sse2_ssse3_sse41(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 @convert_10bit_y_uv_vectors_to_8bit_rgb_vectors_sse2_ssse3(i32* %5, i32* %6)
ret void
}

LLVM IR (-O2):
define void @convert_10bit_y_uv_vectors_to_8bit_rgb_vectors_sse2_ssse3_sse41(i32* %0, i32* %1) {
%3 = tail call i32 @convert_10bit_y_uv_vectors_to_8bit_rgb_vectors_sse2_ssse3(i32* %0, i32* %1)
ret void
}
void unpack(unsigned int a, unsigned char *b) {
  b[3] = ((unsigned char)(a));
  b[2] = ((unsigned char)(a >> 8));
  b[1] = ((unsigned char)(a >> 16));
  b[0] = ((unsigned char)(a >> 24));
}


x86 assembly (clang, -O0):
<unpack>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0x4(%rbp),%eax
shr    $0x8,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x4(%rbp),%eax
shr    $0x10,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x4(%rbp),%eax
shr    $0x18,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<unpack>:
bswap  %edi
mov    %edi,(%rsi)
ret

LLVM IR (-O0):
define void @unpack(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = trunc i32 %5 to i8
%7 = load i8*, i8** %4
%8 = getelementptr inbounds i8, i8* %7, i64 3
store i8 %6, i8* %8
%9 = load i32, i32* %3
%10 = lshr i32 %9, 8
%11 = trunc i32 %10 to i8
%12 = load i8*, i8** %4
%13 = getelementptr inbounds i8, i8* %12, i64 2
store i8 %11, i8* %13
%14 = load i32, i32* %3
%15 = lshr i32 %14, 16
%16 = trunc i32 %15 to i8
%17 = load i8*, i8** %4
%18 = getelementptr inbounds i8, i8* %17, i64 1
store i8 %16, i8* %18
%19 = load i32, i32* %3
%20 = lshr i32 %19, 24
%21 = trunc i32 %20 to i8
%22 = load i8*, i8** %4
%23 = getelementptr inbounds i8, i8* %22, i64 0
store i8 %21, i8* %23
ret void
}

LLVM IR (-O2):
define void @unpack(i32 %0, i8* nocapture writeonly %1) {
%3 = trunc i32 %0 to i8
%4 = getelementptr inbounds i8, i8* %1, i64 3
store i8 %3, i8* %4
%5 = lshr i32 %0, 8
%6 = trunc i32 %5 to i8
%7 = getelementptr inbounds i8, i8* %1, i64 2
store i8 %6, i8* %7
%8 = lshr i32 %0, 16
%9 = trunc i32 %8 to i8
%10 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %9, i8* %10
%11 = lshr i32 %0, 24
%12 = trunc i32 %11 to i8
store i8 %12, i8* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ secure_memzero(char *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
void string_clear(char *str) {
  if (str) {
    secure_memzero(str, strlen(str));
  }
}


x86 assembly (clang, -O0):
<string_clear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1153 <string_clear+0x33>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1040 <secure_memzero@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_clear>:
test   %rdi,%rdi
je     1139 <string_clear+0x19>
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <secure_memzero@plt>
ret

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

LLVM IR (-O2):
define void @string_clear(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 @strlen(i8* %0)
%5 = tail call i32 @secure_memzero(i8* %0, i32 %4)
br label %6
6: ; preds = %3, %1
ret void
}
/* Type definitions */
struct sigaction {
  int /*<<< orphan*/ sa_handler;
};
typedef int /*<<< orphan*/ action;

/* Variables and functions */
int /*<<< orphan*/ SIGINT;
int /*<<< orphan*/ SIG_DFL;
int /*<<< orphan*/ memset(struct sigaction *, int /*<<< orphan*/, int);
int /*<<< orphan*/ sigaction(int /*<<< orphan*/, struct sigaction *,
                             int /*<<< orphan*/ *);
void sigint_restore(void) {
  struct sigaction action;
  memset(&action, 0, sizeof(action));
  action.sa_handler = SIG_DFL;
  sigaction(SIGINT, &action, NULL);
}


x86 assembly (clang, -O0):
<sigint_restore>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
mov    0x2e99(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <sigaction@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigint_restore>:
push   %rbx
sub    $0x10,%rsp
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x8(%rsp)
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
xor    %edx,%edx
call   1030 <sigaction@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.sigaction = type { i32 }
@SIG_DFL = global i32 0
@SIGINT = global i32 0
define void @sigint_restore() {
%1 = alloca %struct.sigaction
%2 = call i32 @memset(%struct.sigaction* %1, i32 0, i32 4)
%3 = load i32, i32* @SIG_DFL
%4 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %1, i32 0, i32 0
store i32 %3, i32* %4
%5 = load i32, i32* @SIGINT
%6 = call i32 @sigaction(i32 %5, %struct.sigaction* %1, i32* null)
ret void
}

LLVM IR (-O2):
%struct.sigaction = type { i32 }
@SIG_DFL = global i32 0
@SIGINT = global i32 0
define void @sigint_restore() {
%1 = alloca %struct.sigaction
%2 = bitcast %struct.sigaction* %1 to i8*
%3 = call i32 @memset(%struct.sigaction* %1, i32 0, i32 4)
%4 = load i32, i32* @SIG_DFL
%5 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %1, i64 0, i32 0
store i32 %4, i32* %5
%6 = load i32, i32* @SIGINT
%7 = call i32 @sigaction(i32 %6, %struct.sigaction* %1, i32* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int);
void encodeInt(unsigned int num, int size) {
  int i;
  for (i = 0; i < size; i++) {
    printf("%c", num & 0xff);
    num >>= 8;
  }
}


x86 assembly (clang, -O0):
<encodeInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    115d <encodeInt+0x4d>
mov    -0x4(%rbp),%esi
and    $0xff,%esi
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
shr    $0x8,%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1125 <encodeInt+0x15>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<encodeInt>:
push   %rbp
push   %r14
push   %rbx
test   %esi,%esi
jle    1144 <encodeInt+0x34>
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xedd(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl %bpl,%esi
mov    %r14,%rdi
call   1030 <printf@plt>
shr    $0x8,%ebp
add    $0xffffffff,%ebx
jne    1130 <encodeInt+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @encodeInt(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %12
4: ; preds = %2, %4
%5 = phi i32 [ %10, %4 ], [ 0, %2 ]
%6 = phi i32 [ %9, %4 ], [ %0, %2 ]
%7 = and i32 %6, 255
%8 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = lshr i32 %6, 8
%10 = add nuw nsw i32 %5, 1
%11 = icmp eq i32 %10, %1
br i1 %11, label %12, label %4
12: ; preds = %4, %2
ret void
}
/* Variables and functions */
scalar_t__ foo(unsigned int *);
void bar(void) {
  unsigned s = 128;
  while (1) {
    unsigned b[s];
    if (foo(b))
      break;
    s *= 2;
  }
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x80,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
lea    0xf(,%rax,4),%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,%rsp
mov    %rax,-0x18(%rbp)
call   1030 <foo@plt>
cmp    $0x0,%rax
je     115d <bar+0x4d>
movl   $0x3,-0x1c(%rbp)
jmp    116d <bar+0x5d>
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x4(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    -0x1c(%rbp),%eax
test   %eax,%eax
je     1189 <bar+0x79>
jmp    1184 <bar+0x74>
jmp    118e <bar+0x7e>
jmp    111f <bar+0xf>
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
push   %rbp
mov    %rsp,%rbp
push   %r14
push   %rbx
mov    $0x80,%ebx
nopl   0x0(%rax)
mov    %rsp,%r14
mov    %ebx,%eax
mov    %rsp,%rdi
lea    0xf(,%rax,4),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rdi
mov    %rdi,%rsp
call   1030 <foo@plt>
add    %ebx,%ebx
test   %rax,%rax
mov    %r14,%rsp
je     1120 <bar+0x10>
lea    -0x10(%rbp),%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @bar() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i32
store i32 128, i32* %1
br label %5
5: ; preds = %0, %19
%6 = load i32, i32* %1
%7 = zext i32 %6 to i64
%8 = call i8* @llvm.stacksave()
store i8* %8, i8** %2
%9 = alloca i32, i64 %7
store i64 %7, i64* %3
%10 = call i64 @foo(i32* %9)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %5
store i32 3, i32* %4
br label %16
13: ; preds = %5
%14 = load i32, i32* %1
%15 = mul i32 %14, 2
store i32 %15, i32* %1
store i32 0, i32* %4
br label %16
16: ; preds = %13, %12
%17 = load i8*, i8** %2
%18 = load i32, i32* %4
switch i32 %18, label %21 [
i32 0, label %19
i32 3, label %20
]
19: ; preds = %16
br label %5
20: ; preds = %16
ret void
21: ; preds = %16
unreachable
}

LLVM IR (-O2):
define void @bar() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 128, %0 ], [ %8, %1 ]
%3 = zext i32 %2 to i64
%4 = call i8* @llvm.stacksave()
%5 = alloca i32, i64 %3
%6 = call i64 @foo(i32* %5)
%7 = icmp eq i64 %6, 0
%8 = shl i32 %2, 1
br i1 %7, label %1, label %9
9: ; preds = %1
ret void
}
/* Type definitions */
struct addrinfo {
  struct addrinfo *ai_next;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct addrinfo *);
void freeaddrinfo(struct addrinfo *res) {
  struct addrinfo *next;
  do {
    next = res->ai_next;
    free(res);
  } while ((res = next) != NULL);
}


x86 assembly (clang, -O0):
<freeaddrinfo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
cmp    $0x0,%rax
jne    111c <freeaddrinfo+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freeaddrinfo>:
push   %rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%rdi),%rbx
call   1030 <free@plt>
mov    %rbx,%rdi
test   %rbx,%rbx
jne    1120 <freeaddrinfo+0x10>
pop    %rbx
ret

LLVM IR (-O0):
%struct.addrinfo = type { %struct.addrinfo* }
define void @freeaddrinfo(%struct.addrinfo* %0) {
%2 = alloca %struct.addrinfo*
%3 = alloca %struct.addrinfo*
store %struct.addrinfo* %0, %struct.addrinfo** %2
br label %4
4: ; preds = %10, %1
%5 = load %struct.addrinfo*, %struct.addrinfo** %2
%6 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %5, i32 0, i32 0
%7 = load %struct.addrinfo*, %struct.addrinfo** %6
store %struct.addrinfo* %7, %struct.addrinfo** %3
%8 = load %struct.addrinfo*, %struct.addrinfo** %2
%9 = call i32 @free(%struct.addrinfo* %8)
br label %10
10: ; preds = %4
%11 = load %struct.addrinfo*, %struct.addrinfo** %3
store %struct.addrinfo* %11, %struct.addrinfo** %2
%12 = icmp ne %struct.addrinfo* %11, null
br i1 %12, label %4, label %13
13: ; preds = %10
ret void
}

LLVM IR (-O2):
%struct.addrinfo = type { %struct.addrinfo* }
define void @freeaddrinfo(%struct.addrinfo* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi %struct.addrinfo* [ %0, %1 ], [ %5, %2 ]
%4 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %3, i64 0, i32 0
%5 = load %struct.addrinfo*, %struct.addrinfo** %4
%6 = tail call i32 @free(%struct.addrinfo* %3)
%7 = icmp eq %struct.addrinfo* %5, null
br i1 %7, label %8, label %2
8: ; preds = %2
ret void
}
/* Type definitions */
struct timeval {
  double tv_sec;
  double tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/);
double get_time() {
  struct timeval tv;
  gettimeofday(&tv, 0);
  return (double)(tv.tv_sec * 100.0 + tv.tv_usec / 10000.0);
}


x86 assembly (clang, -O0):
<get_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  0xed3(%rip),%xmm2
divsd  %xmm2,%xmm1
movsd  0xebf(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_time>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movsd  0x10(%rsp),%xmm1
divsd  0xed2(%rip),%xmm1
movsd  0x8(%rsp),%xmm0
mulsd  0xecc(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { double, double }
define double @get_time() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load double, double* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%6 = load double, double* %5
%7 = fdiv double %6, 1.000000e+04
%8 = call double @llvm.fmuladd.f64(double %4, double 1.000000e+02, double %7)
ret double %8
}

LLVM IR (-O2):
%struct.timeval = type { double, double }
define double @get_time() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load double, double* %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%7 = load double, double* %6
%8 = fdiv double %7, 1.000000e+04
%9 = call double @llvm.fmuladd.f64(double %5, double 1.000000e+02, double %8)
ret double %9
}
void fill_iir_G712_8khz(a_cof, b_cof, nblocks) float ***a_cof;
float ***b_cof;
long *nblocks;
{
  static float a_G712_8khz[2][2] = {{0.197140840E+01, 0.100000000E+01},
                                    {-0.199301310E+01, 0.100000000E+01}};
  static float b_G712_8khz[2][2] = {{0.156814950E+01, 0.690445310E+00},
                                    {-0.179704400E+01, 0.830129300E+00}};
  *nblocks = 2;
  *a_cof = (float **)a_G712_8khz;
  *b_cof = (float **)b_G712_8khz;
}


x86 assembly (clang, -O0):
<fill_iir_G712_8khz>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movq   $0x2,(%rax)
mov    -0x8(%rbp),%rax
lea    0x2f0a(%rip),%rcx
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
lea    0x2f0c(%rip),%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fill_iir_G712_8khz>:
movq   $0x2,(%rdx)
lea    0x2f22(%rip),%rax
mov    %rax,(%rdi)
lea    0x2f28(%rip),%rax
mov    %rax,(%rsi)
ret

LLVM IR (-O0):
@fill_iir_G712_8khz.a_G712_8khz = internal global [2 x [2 x float]] [[2 x float] [float 0x3FFF8AE380000000, float 1.000000e+00], [2 x float] [float 0xBFFFE361C0000000, float 1.000000e+00]]
@fill_iir_G712_8khz.b_G712_8khz = internal global [2 x [2 x float]] [[2 x float] [float 0x3FF91723E0000000, float 0x3FE61820C0000000], [2 x float] [float 0xBFFCC0B140000000, float 0x3FEA906B60000000]]
define void @fill_iir_G712_8khz(float*** %0, float*** %1, i64* %2) {
%4 = alloca float***
%5 = alloca float***
%6 = alloca i64*
store float*** %0, float**** %4
store float*** %1, float**** %5
store i64* %2, i64** %6
%7 = load i64*, i64** %6
store i64 2, i64* %7
%8 = load float***, float**** %4
store float** bitcast ([2 x [2 x float]]* @fill_iir_G712_8khz.a_G712_8khz to float**), float*** %8
%9 = load float***, float**** %5
store float** bitcast ([2 x [2 x float]]* @fill_iir_G712_8khz.b_G712_8khz to float**), float*** %9
ret void
}

LLVM IR (-O2):
@fill_iir_G712_8khz.a_G712_8khz = internal global [2 x [2 x float]] [[2 x float] [float 0x3FFF8AE380000000, float 1.000000e+00], [2 x float] [float 0xBFFFE361C0000000, float 1.000000e+00]]
@fill_iir_G712_8khz.b_G712_8khz = internal global [2 x [2 x float]] [[2 x float] [float 0x3FF91723E0000000, float 0x3FE61820C0000000], [2 x float] [float 0xBFFCC0B140000000, float 0x3FEA906B60000000]]
define void @fill_iir_G712_8khz(float*** nocapture writeonly %0, float*** nocapture writeonly %1, i64* nocapture writeonly %2) {
store i64 2, i64* %2
store float** bitcast ([2 x [2 x float]]* @fill_iir_G712_8khz.a_G712_8khz to float**), float*** %0
store float** bitcast ([2 x [2 x float]]* @fill_iir_G712_8khz.b_G712_8khz to float**), float*** %1
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ daemonize();
int main(void) {
  daemonize();
  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 <daemonize@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 <daemonize@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 (...) @daemonize()
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @daemonize()
%2 = load i32, i32* @EXIT_SUCCESS
ret i32 %2
}
int is_alphanum(unsigned char c) {
  return ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') ||
          (c >= '0' && c <= '9'));
}


x86 assembly (clang, -O0):
<is_alphanum>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0x61,%eax
jl     1129 <is_alphanum+0x29>
movzbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x7a,%ecx
mov    %al,-0x2(%rbp)
jle    116d <is_alphanum+0x6d>
movzbl -0x1(%rbp),%eax
cmp    $0x41,%eax
jl     1148 <is_alphanum+0x48>
movzbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x5a,%ecx
mov    %al,-0x2(%rbp)
jle    116d <is_alphanum+0x6d>
movzbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x3(%rbp)
jl     1167 <is_alphanum+0x67>
movzbl -0x1(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_alphanum>:
mov    %edi,%eax
and    $0xdf,%al
add    $0xbf,%al
cmp    $0x1a,%al
setb   %al
add    $0xd0,%dil
cmp    $0xa,%dil
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @is_alphanum(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = icmp sge i32 %4, 97
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = zext i8 %7 to i32
%9 = icmp sle i32 %8, 122
br i1 %9, label %28, label %10
10: ; preds = %6, %1
%11 = load i8, i8* %2
%12 = zext i8 %11 to i32
%13 = icmp sge i32 %12, 65
br i1 %13, label %14, label %18
14: ; preds = %10
%15 = load i8, i8* %2
%16 = zext i8 %15 to i32
%17 = icmp sle i32 %16, 90
br i1 %17, label %28, label %18
18: ; preds = %14, %10
%19 = load i8, i8* %2
%20 = zext i8 %19 to i32
%21 = icmp sge i32 %20, 48
br i1 %21, label %22, label %26
22: ; preds = %18
%23 = load i8, i8* %2
%24 = zext i8 %23 to i32
%25 = icmp sle i32 %24, 57
br label %26
26: ; preds = %22, %18
%27 = phi i1 [ false, %18 ], [ %25, %22 ]
br label %28
28: ; preds = %26, %14, %6
%29 = phi i1 [ true, %14 ], [ true, %6 ], [ %27, %26 ]
%30 = zext i1 %29 to i32
ret i32 %30
}

LLVM IR (-O2):
define i32 @is_alphanum(i8 zeroext %0) {
%2 = and i8 %0, -33
%3 = add i8 %2, -65
%4 = icmp ult i8 %3, 26
%5 = add i8 %0, -48
%6 = icmp ult i8 %5, 10
%7 = or i1 %6, %4
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int musmidi_setflag(int, int, int);
int mus_midi_set_flag(int mode, int index, int val) {
  return musmidi_setflag(mode, index, val);
}


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

x86 assembly (clang, -O2):
<mus_midi_set_flag>:
jmp    1030 <musmidi_setflag@plt>

LLVM IR (-O0):
define i32 @mus_midi_set_flag(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @musmidi_setflag(i32 %7, i32 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @mus_midi_set_flag(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @musmidi_setflag(i32 %0, i32 %1, i32 %2)
ret i32 %4
}
void finn_vec2_sub_vec2(float *result, float *lhs, float *rhs) {
  result[0] = lhs[0] - rhs[0];
  result[1] = lhs[1] - rhs[1];
}


x86 assembly (clang, -O0):
<finn_vec2_sub_vec2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x18(%rbp),%rax
subss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x18(%rbp),%rax
subss  0x4(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @finn_vec2_sub_vec2(float* %0, float* %1, float* %2) {
%4 = alloca float*
%5 = alloca float*
%6 = alloca float*
store float* %0, float** %4
store float* %1, float** %5
store float* %2, float** %6
%7 = load float*, float** %5
%8 = getelementptr inbounds float, float* %7, i64 0
%9 = load float, float* %8
%10 = load float*, float** %6
%11 = getelementptr inbounds float, float* %10, i64 0
%12 = load float, float* %11
%13 = fsub float %9, %12
%14 = load float*, float** %4
%15 = getelementptr inbounds float, float* %14, i64 0
store float %13, float* %15
%16 = load float*, float** %5
%17 = getelementptr inbounds float, float* %16, i64 1
%18 = load float, float* %17
%19 = load float*, float** %6
%20 = getelementptr inbounds float, float* %19, i64 1
%21 = load float, float* %20
%22 = fsub float %18, %21
%23 = load float*, float** %4
%24 = getelementptr inbounds float, float* %23, i64 1
store float %22, float* %24
ret void
}

LLVM IR (-O2):
define void @finn_vec2_sub_vec2(float* nocapture writeonly %0, float* nocapture %1, float* nocapture %2) {
%4 = load float, float* %1
%5 = load float, float* %2
%6 = fsub float %4, %5
store float %6, float* %0
%7 = getelementptr inbounds float, float* %1, i64 1
%8 = load float, float* %7
%9 = getelementptr inbounds float, float* %2, i64 1
%10 = load float, float* %9
%11 = fsub float %8, %10
%12 = getelementptr inbounds float, float* %0, i64 1
store float %11, float* %12
ret void
}