xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ u_int32_t;

/* Variables and functions */
int /*<<< orphan*/ SYS_futex;
int syscall(int /*<<< orphan*/, int /*<<< orphan*/ *, int, int /*<<< orphan*/,
            int /*<<< orphan*/ *, int /*<<< orphan*/ *, int /*<<< orphan*/);
int futex_detach(u_int32_t *uaddr, int opflags) {
  return syscall(SYS_futex, uaddr, 14 | opflags, 0, NULL, NULL, 0);
}


x86 assembly (clang, -O0):
<futex_detach>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
or     $0xe,%edx
xor    %ecx,%ecx
xor    %eax,%eax
mov    %eax,%r9d
mov    %r9,%r8
movl   $0x0,(%rsp)
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<futex_detach>:
push   %rax
mov    %esi,%edx
mov    %rdi,%rsi
mov    0x2ec3(%rip),%rax
mov    (%rax),%edi
or     $0xe,%edx
movl   $0x0,(%rsp)
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <syscall@plt>
pop    %rcx
ret

LLVM IR (-O0):
@SYS_futex = global i32 0
define i32 @futex_detach(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* @SYS_futex
%6 = load i32*, i32** %3
%7 = load i32, i32* %4
%8 = or i32 14, %7
%9 = call i32 @syscall(i32 %5, i32* %6, i32 %8, i32 0, i32* null, i32* null, i32 0)
ret i32 %9
}

LLVM IR (-O2):
@SYS_futex = global i32 0
define i32 @futex_detach(i32* %0, i32 %1) {
%3 = load i32, i32* @SYS_futex
%4 = or i32 %1, 14
%5 = tail call i32 @syscall(i32 %3, i32* %0, i32 %4, i32 0, i32* null, i32* null, i32 0)
ret i32 %5
}
unsigned xrop3_115_1_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = ~T;
  stk2 = D | stk3;
  stk1 = S & stk2;
  stk1 = ~stk1;
  return (stk1 & (~S) & (~T)) | (D & S) | (D & T);
}


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

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

LLVM IR (-O0):
define i32 @xrop3_115_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %7
%24 = xor i32 %23, -1
store i32 %24, i32* %10
%25 = load i32, i32* %5
%26 = load i32, i32* %10
%27 = or i32 %25, %26
store i32 %27, i32* %9
%28 = load i32, i32* %6
%29 = load i32, i32* %9
%30 = and i32 %28, %29
store i32 %30, i32* %8
%31 = load i32, i32* %8
%32 = xor i32 %31, -1
store i32 %32, i32* %8
%33 = load i32, i32* %8
%34 = load i32, i32* %6
%35 = xor i32 %34, -1
%36 = and i32 %33, %35
%37 = load i32, i32* %7
%38 = xor i32 %37, -1
%39 = and i32 %36, %38
%40 = load i32, i32* %5
%41 = load i32, i32* %6
%42 = and i32 %40, %41
%43 = or i32 %39, %42
%44 = load i32, i32* %5
%45 = load i32, i32* %7
%46 = and i32 %44, %45
%47 = or i32 %43, %46
ret i32 %47
}

LLVM IR (-O2):
define i32 @xrop3_115_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = or i32 %6, %4
%8 = xor i32 %7, -1
%9 = or i8 %1, %0
%10 = zext i8 %9 to i32
%11 = or i32 %10, %8
ret i32 %11
}
int hashInt(int key, int capacity) { return key % capacity; }


x86 assembly (clang, -O0):
<hashInt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hashInt>:
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @hashInt(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 = srem i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @hashInt(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
ret i32 %3
}
int switch3(int a) {
  switch (a) {
  case 1 ... 11:
    return 11;
  case 12 ... 22:
    return 22;
  case 23 ... 33:
    return 33;
  case 34 ... 44:
    return 44;
  default:
    return 44;
  }
}


x86 assembly (clang, -O0):
<switch3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x2b,%eax
ja     1160 <switch3+0x60>
mov    -0x10(%rbp),%rax
lea    0xed9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0xb,-0x4(%rbp)
jmp    1167 <switch3+0x67>
movl   $0x16,-0x4(%rbp)
jmp    1167 <switch3+0x67>
movl   $0x21,-0x4(%rbp)
jmp    1167 <switch3+0x67>
movl   $0x2c,-0x4(%rbp)
jmp    1167 <switch3+0x67>
movl   $0x2c,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<switch3>:
add    $0xffffffff,%edi
mov    $0x2c,%eax
cmp    $0x2b,%edi
ja     111a <switch3+0x1a>
movslq %edi,%rax
lea    0xee9(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @switch3(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %9 [
i32 1, label %5
i32 2, label %5
i32 3, label %5
i32 4, label %5
i32 5, label %5
i32 6, label %5
i32 7, label %5
i32 8, label %5
i32 9, label %5
i32 10, label %5
i32 11, label %5
i32 12, label %6
i32 13, label %6
i32 14, label %6
i32 15, label %6
i32 16, label %6
i32 17, label %6
i32 18, label %6
i32 19, label %6
i32 20, label %6
i32 21, label %6
i32 22, label %6
i32 23, label %7
i32 24, label %7
i32 25, label %7
i32 26, label %7
i32 27, label %7
i32 28, label %7
i32 29, label %7
i32 30, label %7
i32 31, label %7
i32 32, label %7
i32 33, label %7
i32 34, label %8
i32 35, label %8
i32 36, label %8
i32 37, label %8
i32 38, label %8
i32 39, label %8
i32 40, label %8
i32 41, label %8
i32 42, label %8
i32 43, label %8
i32 44, label %8
]
5: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1
store i32 11, i32* %2
br label %10
6: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1
store i32 22, i32* %2
br label %10
7: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1
store i32 33, i32* %2
br label %10
8: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1
store i32 44, i32* %2
br label %10
9: ; preds = %1
store i32 44, i32* %2
br label %10
10: ; preds = %9, %8, %7, %6, %5
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
@switch.table.switch3 = [44 x i32] [i32 11, i32 11, i32 11, i32 11, i32 11, i32 11, i32 11, i32 11, i32 11, i32 11, i32 11, i32 22, i32 22, i32 22, i32 22, i32 22, i32 22, i32 22, i32 22, i32 22, i32 22, i32 22, i32 33, i32 33, i32 33, i32 33, i32 33, i32 33, i32 33, i32 33, i32 33, i32 33, i32 33, i32 44, i32 44, i32 44, i32 44, i32 44, i32 44, i32 44, i32 44, i32 44, i32 44, i32 44]
define i32 @switch3(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 44
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [44 x i32], [44 x i32]* @switch.table.switch3, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ 44, %1 ]
ret i32 %9
}
int download(int (*notify)(int)) {
  int i = 0;
  int step = 20;
  for (; i <= 100; i += step) {
    notify(i);
  }
}


x86 assembly (clang, -O0):
<download>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x14,-0x18(%rbp)
cmpl   $0x64,-0x14(%rbp)
jg     113b <download+0x3b>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%edi
call   *%rax
mov    -0x18(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    111a <download+0x1a>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<download>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
call   *%rbx
mov    $0x14,%edi
call   *%rbx
mov    $0x28,%edi
call   *%rbx
mov    $0x3c,%edi
call   *%rbx
mov    $0x50,%edi
call   *%rbx
mov    $0x64,%edi
mov    %rbx,%rax
pop    %rbx
jmp    *%rax

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

LLVM IR (-O2):
define i32 @download(i32 (i32)* nocapture %0) {
%2 = tail call i32 %0(i32 0)
%3 = tail call i32 %0(i32 20)
%4 = tail call i32 %0(i32 40)
%5 = tail call i32 %0(i32 60)
%6 = tail call i32 %0(i32 80)
%7 = tail call i32 %0(i32 100)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void free_words(char **arr, int wc) {
  while (wc--)
    free(arr[wc]);
}


x86 assembly (clang, -O0):
<free_words>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
je     1149 <free_words+0x39>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
jmp    111f <free_words+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_words>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
je     1142 <free_words+0x32>
mov    %esi,%r15d
movslq %esi,%rax
lea    (%rdi,%rax,8),%r14
add    $0xfffffffffffffff8,%r14
neg    %r15d
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0xffffffffffffffff,%rbx
cmp    %ebx,%r15d
jne    1130 <free_words+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @free_words(i8** nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %14, label %4
4: ; preds = %2
%5 = sext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ %5, %4 ], [ %8, %6 ]
%8 = add nsw i64 %7, -1
%9 = getelementptr inbounds i8*, i8** %0, i64 %8
%10 = load i8*, i8** %9
%11 = tail call i32 @free(i8* %10)
%12 = trunc i64 %8 to i32
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %6
14: ; preds = %6, %2
ret void
}
char arccaesar(int n) {
  int c;
  if (n == 0) {
    return '\n';
  } else if (n == 1) {
    return '\011';
  } else {
    n = n + 30;
    c = (char)n;
    return c;
  }
}


x86 assembly (clang, -O0):
<arccaesar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    111a <arccaesar+0x1a>
movb   $0xa,-0x1(%rbp)
jmp    1145 <arccaesar+0x45>
cmpl   $0x1,-0x8(%rbp)
jne    112d <arccaesar+0x2d>
movb   $0x9,-0x1(%rbp)
jmp    1145 <arccaesar+0x45>
mov    -0x8(%rbp),%eax
add    $0x1e,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movsbl %al,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<arccaesar>:
test   %edi,%edi
je     110e <arccaesar+0xe>
mov    %edi,%eax
cmp    $0x1,%edi
jne    1111 <arccaesar+0x11>
mov    $0x9,%al
ret
mov    $0xa,%al
ret
add    $0x1e,%al
ret

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

LLVM IR (-O2):
define signext i8 @arccaesar(i32 %0) {
switch i32 %0, label %3 [
i32 0, label %6
i32 1, label %2
]
2: ; preds = %1
br label %6
3: ; preds = %1
%4 = trunc i32 %0 to i8
%5 = add i8 %4, 30
br label %6
6: ; preds = %1, %3, %2
%7 = phi i8 [ 9, %2 ], [ %5, %3 ], [ 10, %1 ]
ret i8 %7
}
int exec_shellcode() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @exec_shellcode() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ phy_rst(int /*<<< orphan*/);
void close_link(void) {
  *(unsigned int *)(0x20000008) = 0x0;
  *(unsigned int *)(0x1400000c) = 0x100;
  *(unsigned int *)(0x20000000) = 0xa420;
  phy_rst(0);
}


x86 assembly (clang, -O0):
<close_link>:
push   %rbp
mov    %rsp,%rbp
mov    $0x20000008,%eax
movl   $0x0,(%rax)
mov    $0x1400000c,%eax
movl   $0x100,(%rax)
mov    $0x20000000,%eax
movl   $0xa420,(%rax)
xor    %edi,%edi
call   1030 <phy_rst@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_link>:
movl   $0x0,0x20000008
movl   $0x100,0x1400000c
movl   $0xa420,0x20000000
xor    %edi,%edi
jmp    1030 <phy_rst@plt>

LLVM IR (-O0):
define void @close_link() {
store i32 0, i32* inttoptr (i64 536870920 to i32*)
store i32 256, i32* inttoptr (i64 335544332 to i32*)
store i32 42016, i32* inttoptr (i64 536870912 to i32*)
%1 = call i32 @phy_rst(i32 0)
ret void
}

LLVM IR (-O2):
define void @close_link() {
store i32 0, i32* inttoptr (i64 536870920 to i32*)
store i32 256, i32* inttoptr (i64 335544332 to i32*)
store i32 42016, i32* inttoptr (i64 536870912 to i32*)
%1 = tail call i32 @phy_rst(i32 0)
ret void
}
long _strhash(void *data) { return ((char *)data)[0]; }


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

x86 assembly (clang, -O2):
<_strhash>:
movsbq (%rdi),%rax
ret

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

LLVM IR (-O2):
define i64 @_strhash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i64
ret i64 %3
}
void NoSoundDrv_PCM_StopPlayback(void) {}


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

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

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

LLVM IR (-O2):
define void @NoSoundDrv_PCM_StopPlayback() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *prog) {
  fprintf(stderr, "usage: %s [-p port]", prog);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [20 x i8] c"usage: %s [-p port]\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [20 x i8] c"usage: %s [-p port]\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void dunno(void) {
  printf("I don't know about that\n");
  exit(0);
}


x86 assembly (clang, -O0):
<dunno>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<dunno>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"I don't know about that\0A\00"
define void @dunno() {
%1 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [24 x i8] c"I don't know about that\00"
define void @dunno() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
void const_array(const int foo[const]) {}


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

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

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

LLVM IR (-O2):
define void @const_array(i32* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ move(int, int, int, int);
int main() {
  int n = 3;
  move(n, 1, 3, 2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x1,%esi
mov    $0x3,%edx
mov    $0x2,%ecx
call   1030 <move@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x3,%edi
mov    $0x1,%esi
mov    $0x3,%edx
mov    $0x2,%ecx
call   1030 <move@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @move(i32 3, i32 1, i32 3, i32 2)
ret i32 0
}
unsigned long hweight_long(unsigned long w) {
  unsigned long count;
  for (count = 0; w; w >>= 1) {
    count += w & 1;
  }
  return count;
}


x86 assembly (clang, -O0):
<hweight_long>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     113c <hweight_long+0x3c>
mov    -0x8(%rbp),%rax
and    $0x1,%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1110 <hweight_long+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hweight_long>:
xor    %eax,%eax
test   %rdi,%rdi
je     1124 <hweight_long+0x24>
mov    %rdi,%rcx
nopw   0x0(%rax,%rax,1)
mov    %edi,%edx
and    $0x1,%edx
add    %rdx,%rax
shr    %rcx
cmp    $0x1,%rdi
mov    %rcx,%rdi
ja     1110 <hweight_long+0x10>
ret

LLVM IR (-O0):
define i64 @hweight_long(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
store i64 0, i64* %3
br label %4
4: ; preds = %12, %1
%5 = load i64, i64* %2
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %15
7: ; preds = %4
%8 = load i64, i64* %2
%9 = and i64 %8, 1
%10 = load i64, i64* %3
%11 = add i64 %10, %9
store i64 %11, i64* %3
br label %12
12: ; preds = %7
%13 = load i64, i64* %2
%14 = lshr i64 %13, 1
store i64 %14, i64* %2
br label %4
15: ; preds = %4
%16 = load i64, i64* %3
ret i64 %16
}

LLVM IR (-O2):
define i64 @hweight_long(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %7, %3 ], [ 0, %1 ]
%5 = phi i64 [ %8, %3 ], [ %0, %1 ]
%6 = and i64 %5, 1
%7 = add i64 %4, %6
%8 = lshr i64 %5, 1
%9 = icmp ult i64 %5, 2
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i64 [ 0, %1 ], [ %7, %3 ]
ret i64 %11
}
extern void gps_on(void) {}


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

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

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

LLVM IR (-O2):
define void @gps_on() {
ret void
}
void internal5(void) {}


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

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

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

LLVM IR (-O2):
define void @internal5() {
ret void
}
/* Variables and functions */
int rand();
int getRandomColor(void) {
  int randMax;
  int randMin;
  int random;
  randMax = rand() % 6;
  randMin = rand() % 1;
  random = (randMax - randMin) + 1;
  return random;
}


x86 assembly (clang, -O0):
<getRandomColor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x6,%ecx
cltd
idiv   %ecx
mov    %edx,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x1,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getRandomColor>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
movslq %eax,%r14
imul   $0x2aaaaaab,%r14,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rax
add    %ecx,%eax
add    %eax,%eax
lea    (%rax,%rax,2),%ebx
xor    %eax,%eax
call   1030 <rand@plt>
neg    %ebx
lea    (%r14,%rbx,1),%eax
add    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @getRandomColor() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = call i32 (...) @rand()
%5 = srem i32 %4, 6
store i32 %5, i32* %1
%6 = call i32 (...) @rand()
%7 = srem i32 %6, 1
store i32 %7, i32* %2
%8 = load i32, i32* %1
%9 = load i32, i32* %2
%10 = sub nsw i32 %8, %9
%11 = add nsw i32 %10, 1
store i32 %11, i32* %3
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
define i32 @getRandomColor() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 6
%3 = tail call i32 (...) @rand()
%4 = add nsw i32 %2, 1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ create_write_byte(int);
void create_wait_duration(int dseconds) {
  ;
  create_write_byte(155);
  create_write_byte(dseconds);
  ;
}


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

x86 assembly (clang, -O2):
<create_wait_duration>:
push   %rbx
mov    %edi,%ebx
mov    $0x9b,%edi
call   1030 <create_write_byte@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <create_write_byte@plt>

LLVM IR (-O0):
define void @create_wait_duration(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @create_write_byte(i32 155)
%4 = load i32, i32* %2
%5 = call i32 @create_write_byte(i32 %4)
ret void
}

LLVM IR (-O2):
define void @create_wait_duration(i32 %0) {
%2 = tail call i32 @create_write_byte(i32 155)
%3 = tail call i32 @create_write_byte(i32 %0)
ret void
}
/* Variables and functions */
double sqrt(float);
float func(float x) { return 1.0 / sqrt(x); }


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  0xece(%rip),%xmm0
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
push   %rax
call   1030 <sqrt@plt>
movsd  0xee2(%rip),%xmm1
divsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @func(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call double @sqrt(float %3)
%5 = fdiv double 1.000000e+00, %4
%6 = fptrunc double %5 to float
ret float %6
}

LLVM IR (-O2):
define float @func(float %0) {
%2 = tail call double @sqrt(float %0)
%3 = fdiv double 1.000000e+00, %2
%4 = fptrunc double %3 to float
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *malloc_err(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *make_string(char *ostr, const char *nstr) {
  if (ostr != NULL)
    free(ostr);
  ostr = malloc_err(strlen(nstr) + 1);
  strcpy(ostr, nstr);
  return ostr;
}


x86 assembly (clang, -O0):
<make_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1164 <make_string+0x24>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rdi
call   1050 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1060 <malloc_err@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_string>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
test   %rdi,%rdi
je     1151 <make_string+0x11>
call   1030 <free@plt>
mov    %r14,%rdi
call   1050 <strlen@plt>
lea    0x1(%rax),%rdi
call   1060 <malloc_err@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1040 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @make_string(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i8*, i8** %3
%9 = call i32 @free(i8* %8)
br label %10
10: ; preds = %7, %2
%11 = load i8*, i8** %4
%12 = call i64 @strlen(i8* %11)
%13 = add nsw i64 %12, 1
%14 = call i8* @malloc_err(i64 %13)
store i8* %14, i8** %3
%15 = load i8*, i8** %3
%16 = load i8*, i8** %4
%17 = call i32 @strcpy(i8* %15, i8* %16)
%18 = load i8*, i8** %3
ret i8* %18
}

LLVM IR (-O2):
define i8* @make_string(i8* %0, i8* %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @free(i8* %0)
br label %6
6: ; preds = %4, %2
%7 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%8 = add nsw i64 %7, 1
%9 = tail call i8* @malloc_err(i64 %8)
%10 = tail call i32 @strcpy(i8* %9, i8* %1)
ret i8* %9
}
double logical_or(double a, double b) { return a != 0.0 || b != 0.0; }


x86 assembly (clang, -O0):
<logical_or>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x1,%al
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x11(%rbp)
jne    1142 <logical_or+0x42>
jp     1142 <logical_or+0x42>
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
setne  %al
setp   %cl
or     %cl,%al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
cvtsi2sd %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<logical_or>:
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm0
setp   %al
setne  %cl
or     %al,%cl
ucomisd %xmm2,%xmm1
setp   %al
setne  %dl
or     %al,%dl
or     %cl,%dl
movzbl %dl,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
ret

LLVM IR (-O0):
define double @logical_or(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = fcmp une double %5, 0.000000e+00
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load double, double* %4
%9 = fcmp une double %8, 0.000000e+00
br label %10
10: ; preds = %7, %2
%11 = phi i1 [ true, %2 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
%13 = sitofp i32 %12 to double
ret double %13
}

LLVM IR (-O2):
define double @logical_or(double %0, double %1) {
%3 = fcmp une double %0, 0.000000e+00
%4 = fcmp une double %1, 0.000000e+00
%5 = or i1 %3, %4
%6 = uitofp i1 %5 to double
ret double %6
}
int IntArraySize(const int *array) {
  return (int)((sizeof array) / (sizeof *array));
}


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

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

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

LLVM IR (-O2):
define i32 @IntArraySize(i32* nocapture readnone %0) {
ret i32 2
}
void test_6() {
  int *i = (int *)malloc(sizeof(int));
  free(i);
  double *j = (double *)malloc(50 * sizeof(double));
  free(j);
}


x86 assembly (clang, -O0):
<test_6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    $0x190,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @test_6() {
%1 = alloca i32*
%2 = alloca double*
%3 = call i8* @malloc(i64 4)
%4 = bitcast i8* %3 to i32*
store i32* %4, i32** %1
%5 = load i32*, i32** %1
%6 = bitcast i32* %5 to i8*
%7 = call i8* @malloc(i64 400)
%8 = bitcast i8* %7 to double*
store double* %8, double** %2
%9 = load double*, double** %2
%10 = bitcast double* %9 to i8*
ret void
}

LLVM IR (-O2):
define void @test_6() {
ret void
}
int strcmp(const char *str1, const char *str2) { return 0; }


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

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

LLVM IR (-O0):
define i32 @strcmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
ret i32 0
}

LLVM IR (-O2):
define i32 @strcmp(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
int isrightbrace(char c) { return ']' == c ? 1 : 0; }


x86 assembly (clang, -O0):
<isrightbrace>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%esi
mov    $0x5d,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %esi,%edx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isrightbrace>:
xor    %eax,%eax
cmp    $0x5d,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @isrightbrace(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 93, %4
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 1, i32 0
ret i32 %7
}

LLVM IR (-O2):
define i32 @isrightbrace(i8 signext %0) {
%2 = icmp eq i8 %0, 93
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char *, char *);
scalar_t__ system(char *);
void output_bad_records(char *shef_bad_file, char *insert_bad_file) {
  char sys_string[1024];
  sprintf(sys_string, "cat %s %s | html_table.e '^^Bad Records' '' ''",
          shef_bad_file, insert_bad_file);
  if (system(sys_string)) {
  };
}


x86 assembly (clang, -O0):
<output_bad_records>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x410(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xeb7(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x410(%rbp),%rdi
call   1030 <system@plt>
cmp    $0x0,%rax
je     1169 <output_bad_records+0x49>
jmp    1169 <output_bad_records+0x49>
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<output_bad_records>:
push   %rbx
sub    $0x400,%rsp
mov    %rsi,%rcx
mov    %rdi,%rdx
lea    0xecb(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
add    $0x400,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"cat %s %s | html_table.e '^^Bad Records' '' ''\00"
define void @output_bad_records(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [1024 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %8)
%10 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%11 = call i64 @system(i8* %10)
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %2
br label %14
14: ; preds = %13, %2
ret void
}

LLVM IR (-O2):
@.str = [47 x i8] c"cat %s %s | html_table.e '^^Bad Records' '' ''\00"
define void @output_bad_records(i8* %0, i8* %1) {
%3 = alloca [1024 x i8]
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%6 = call i64 @system(i8* %4)
ret void
}
/* Variables and functions */
scalar_t__ input_joystick_available();
char const *lang_get(char *);
const char *f_input_up() {
  return lang_get(input_joystick_available() ? "INPUT_JOY_UP"
                                             : "INPUT_KEYB_UP");
}


x86 assembly (clang, -O0):
<f_input_up>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <input_joystick_available@plt>
mov    %rax,%rcx
lea    0xed8(%rip),%rdi
lea    0xec4(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%rdi
call   1030 <lang_get@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_input_up>:
push   %rax
xor    %eax,%eax
call   1040 <input_joystick_available@plt>
test   %rax,%rax
lea    0xedb(%rip),%rax
lea    0xec7(%rip),%rdi
cmove  %rax,%rdi
pop    %rax
jmp    1030 <lang_get@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"INPUT_JOY_UP\00"
@.str.1 = [14 x i8] c"INPUT_KEYB_UP\00"
define i8* @f_input_up() {
%1 = call i64 (...) @input_joystick_available()
%2 = icmp ne i64 %1, 0
%3 = zext i1 %2 to i64
%4 = select i1 %2, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0)
%5 = call i8* @lang_get(i8* %4)
ret i8* %5
}

LLVM IR (-O2):
@.str = [13 x i8] c"INPUT_JOY_UP\00"
@.str.1 = [14 x i8] c"INPUT_KEYB_UP\00"
define i8* @f_input_up() {
%1 = tail call i64 (...) @input_joystick_available()
%2 = icmp eq i64 %1, 0
%3 = select i1 %2, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0)
%4 = tail call i8* @lang_get(i8* %3)
ret i8* %4
}
/* Variables and functions */
int mkdir(char *, int);
int create_dir(char *Path) {
  if (-1 == mkdir(Path, 0777)) {
    return 0;
  } else {
    return 1;
  }
}


x86 assembly (clang, -O0):
<create_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x1ff,%esi
call   1030 <mkdir@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
cmp    %ecx,%eax
jne    1145 <create_dir+0x35>
movl   $0x0,-0x4(%rbp)
jmp    114c <create_dir+0x3c>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_dir>:
push   %rax
mov    $0x1ff,%esi
call   1030 <mkdir@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @create_dir(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 @mkdir(i8* %4, i32 511)
%6 = icmp eq i32 -1, %5
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %9
8: ; preds = %1
store i32 1, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @create_dir(i8* nocapture %0) {
%2 = tail call i32 @mkdir(i8* %0, i32 511)
%3 = icmp ne i32 %2, -1
%4 = zext i1 %3 to i32
ret i32 %4
}
void interrupt_restore(unsigned long dummy) {}


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

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

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

LLVM IR (-O2):
define void @interrupt_restore(i64 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo(unsigned short);
__attribute__((no, noclone)) unsigned short f7(unsigned short x,
                                               unsigned short y) {
  unsigned short r = x + y;
  if (y <= r)
    foo(r);
  return r;
}


x86 assembly (clang, -O0):
<f7>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movzwl -0x2(%rbp),%eax
movzwl -0x4(%rbp),%ecx
add    %ecx,%eax
mov    %ax,-0x6(%rbp)
movzwl -0x4(%rbp),%eax
movzwl -0x6(%rbp),%ecx
cmp    %ecx,%eax
jg     114d <f7+0x3d>
movzwl -0x6(%rbp),%edi
call   1030 <foo@plt>
movzwl -0x6(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f7>:
push   %rbx
mov    %esi,%ebx
add    %di,%bx
jb     1120 <f7+0x10>
movzwl %bx,%edi
call   1030 <foo@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define zeroext i16 @f7(i16 zeroext %0, i16 zeroext %1) {
%3 = alloca i16
%4 = alloca i16
%5 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%6 = load i16, i16* %3
%7 = zext i16 %6 to i32
%8 = load i16, i16* %4
%9 = zext i16 %8 to i32
%10 = add nsw i32 %7, %9
%11 = trunc i32 %10 to i16
store i16 %11, i16* %5
%12 = load i16, i16* %4
%13 = zext i16 %12 to i32
%14 = load i16, i16* %5
%15 = zext i16 %14 to i32
%16 = icmp sle i32 %13, %15
br i1 %16, label %17, label %20
17: ; preds = %2
%18 = load i16, i16* %5
%19 = call i32 @foo(i16 zeroext %18)
br label %20
20: ; preds = %17, %2
%21 = load i16, i16* %5
ret i16 %21
}

LLVM IR (-O2):
define zeroext i16 @f7(i16 zeroext %0, i16 zeroext %1) {
%3 = add i16 %1, %0
%4 = icmp ult i16 %3, %1
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @foo(i16 zeroext %3)
br label %7
7: ; preds = %5, %2
ret i16 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
void my_err(char *c) {
  perror(c);
  exit(-1);
}


x86 assembly (clang, -O0):
<my_err>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<my_err>:
push   %rax
call   1030 <perror@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @my_err(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
define void @my_err(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ ActuatorDesiredHandle();
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
void ActuatorDesiredRequestUpdate() {
  UAVObjRequestUpdate(ActuatorDesiredHandle());
}


x86 assembly (clang, -O0):
<ActuatorDesiredRequestUpdate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <ActuatorDesiredHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjRequestUpdate@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ActuatorDesiredRequestUpdate>:
push   %rax
xor    %eax,%eax
call   1030 <ActuatorDesiredHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjRequestUpdate@plt>

LLVM IR (-O0):
define void @ActuatorDesiredRequestUpdate() {
%1 = call i32 (...) @ActuatorDesiredHandle()
%2 = call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}

LLVM IR (-O2):
define void @ActuatorDesiredRequestUpdate() {
%1 = tail call i32 (...) @ActuatorDesiredHandle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}
/* Variables and functions */
double atof(char *);
int numcmp_increase(char *s1, char *s2) {
  double v1, v2;
  v1 = atof(s1);
  v2 = atof(s2);
  if (v1 == v2)
    return 0;
  if (v1 < v2)
    return -1;
  else
    return 1;
}


x86 assembly (clang, -O0):
<numcmp_increase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <atof@plt>
movsd  %xmm0,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <atof@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
ucomisd -0x28(%rbp),%xmm0
jne    115e <numcmp_increase+0x4e>
jp     115e <numcmp_increase+0x4e>
movl   $0x0,-0x4(%rbp)
jmp    1185 <numcmp_increase+0x75>
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    117e <numcmp_increase+0x6e>
movl   $0xffffffff,-0x4(%rbp)
jmp    1185 <numcmp_increase+0x75>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<numcmp_increase>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
call   1030 <atof@plt>
movsd  %xmm0,0x8(%rsp)
mov    %rbx,%rdi
call   1030 <atof@plt>
xor    %ecx,%ecx
movsd  0x8(%rsp),%xmm1
ucomisd %xmm1,%xmm0
setbe  %cl
xor    %eax,%eax
ucomisd %xmm0,%xmm1
lea    -0x1(%rcx,%rcx,1),%ecx
cmovne %ecx,%eax
cmovp  %ecx,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @numcmp_increase(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call double @atof(i8* %0)
%4 = tail call double @atof(i8* %1)
%5 = fcmp oeq double %3, %4
%6 = fcmp olt double %3, %4
%7 = select i1 %6, i32 -1, i32 1
%8 = select i1 %5, i32 0, i32 %7
ret i32 %8
}
/* Variables and functions */
unsigned char *aes192ecb_decrypt(unsigned char *, size_t *,
                                 unsigned char const *, size_t,
                                 unsigned char const *, unsigned char const *);
unsigned char *crypt_decrypt_aes192ecb(unsigned char *out, size_t *out_len,
                                       const unsigned char *in, size_t in_len,
                                       const unsigned char *nonce,
                                       const unsigned char *key) {
  return aes192ecb_decrypt(out, out_len, in, in_len, nonce, key);
}


x86 assembly (clang, -O0):
<crypt_decrypt_aes192ecb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
call   1030 <aes192ecb_decrypt@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crypt_decrypt_aes192ecb>:
jmp    1030 <aes192ecb_decrypt@plt>

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

LLVM IR (-O2):
define i8* @crypt_decrypt_aes192ecb(i8* %0, i64* %1, i8* %2, i64 %3, i8* %4, i8* %5) {
%7 = tail call i8* @aes192ecb_decrypt(i8* %0, i64* %1, i8* %2, i64 %3, i8* %4, i8* %5)
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ ArgNum();
scalar_t__ GetFlag(int /*<<< orphan*/);
int Cnd_NotZero(void) { return (GetFlag(ArgNum()) != 0); }


x86 assembly (clang, -O0):
<Cnd_NotZero>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <ArgNum@plt>
mov    %eax,%edi
call   1030 <GetFlag@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @Cnd_NotZero() {
%1 = call i32 (...) @ArgNum()
%2 = call i64 @GetFlag(i32 %1)
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @Cnd_NotZero() {
%1 = tail call i32 (...) @ArgNum()
%2 = tail call i64 @GetFlag(i32 %1)
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
struct parameter {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ pcn_out(int, int, int);
int com_ayt(int p0, struct parameter *param) {
  (void)(param);
  pcn_out(p0, 9, 330);
  return 0;
}


x86 assembly (clang, -O0):
<com_ayt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x9,%esi
mov    $0x14a,%edx
call   1030 <pcn_out@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<com_ayt>:
push   %rax
mov    $0x9,%esi
mov    $0x14a,%edx
call   1030 <pcn_out@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.parameter = type { i32 }
define i32 @com_ayt(i32 %0, %struct.parameter* %1) {
%3 = alloca i32
%4 = alloca %struct.parameter*
store i32 %0, i32* %3
store %struct.parameter* %1, %struct.parameter** %4
%5 = load %struct.parameter*, %struct.parameter** %4
%6 = load i32, i32* %3
%7 = call i32 @pcn_out(i32 %6, i32 9, i32 330)
ret i32 0
}

LLVM IR (-O2):
%struct.parameter = type { i32 }
define i32 @com_ayt(i32 %0, %struct.parameter* nocapture readnone %1) {
%3 = tail call i32 @pcn_out(i32 %0, i32 9, i32 330)
ret i32 0
}
/* Variables and functions */
int warm_change_cb_range(int, int, int /*<<< orphan*/, int /*<<< orphan*/);
int warm_change_cb_upper(int cb, int is_set) {
  return warm_change_cb_range(cb, is_set, 0, 0);
}


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

x86 assembly (clang, -O2):
<warm_change_cb_upper>:
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <warm_change_cb_range@plt>

LLVM IR (-O0):
define i32 @warm_change_cb_upper(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 @warm_change_cb_range(i32 %5, i32 %6, i32 0, i32 0)
ret i32 %7
}

LLVM IR (-O2):
define i32 @warm_change_cb_upper(i32 %0, i32 %1) {
%3 = tail call i32 @warm_change_cb_range(i32 %0, i32 %1, i32 0, i32 0)
ret i32 %3
}