xunge/DecIR huggingface dataset:
/* Type definitions */
struct pkt_buff {
  int dummy;
};
typedef scalar_t__ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ tprintf(char *);
void dissect_mobility_options(struct pkt_buff *pkt __attribute__((__unused__)),
                              ssize_t *message_data_len) {
  if (*message_data_len)
    tprintf("MH Option(s) recognized ");
}


x86 assembly (clang, -O0):
<dissect_mobility_options>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     113a <dissect_mobility_options+0x2a>
lea    0xecb(%rip),%rdi
call   1030 <tprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dissect_mobility_options>:
cmpq   $0x0,(%rsi)
je     1122 <dissect_mobility_options+0x12>
lea    0xee3(%rip),%rdi
jmp    1030 <tprintf@plt>
ret

LLVM IR (-O0):
%struct.pkt_buff = type { i32 }
@.str = [25 x i8] c"MH Option(s) recognized \00"
define void @dissect_mobility_options(%struct.pkt_buff* %0, i64* %1) {
%3 = alloca %struct.pkt_buff*
%4 = alloca i64*
store %struct.pkt_buff* %0, %struct.pkt_buff** %3
store i64* %1, i64** %4
%5 = load i64*, i64** %4
%6 = load i64, i64* %5
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @tprintf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
ret void
}

LLVM IR (-O2):
%struct.pkt_buff = type { i32 }
@.str = [25 x i8] c"MH Option(s) recognized \00"
define void @dissect_mobility_options(%struct.pkt_buff* nocapture readnone %0, i64* nocapture %1) {
%3 = load i64, i64* %1
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @tprintf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t get_uint64_le(const unsigned char *ptr_) {
  return (uint64_t)ptr_[0] | ((uint64_t)ptr_[1] << 8) |
         ((uint64_t)ptr_[2] << 16) | ((uint64_t)ptr_[3] << 24) |
         ((uint64_t)ptr_[4] << 32) | ((uint64_t)ptr_[5] << 40) |
         ((uint64_t)ptr_[6] << 48) | ((uint64_t)ptr_[7] << 56);
}


x86 assembly (clang, -O0):
<get_uint64_le>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
shl    $0x18,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x4(%rcx),%edx
mov    $0x20,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x5(%rcx),%edx
mov    $0x28,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x6(%rcx),%edx
mov    $0x30,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x7(%rcx),%edx
mov    $0x38,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @get_uint64_le(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 = zext i8 %5 to i32
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = shl i32 %10, 8
%12 = or i32 %6, %11
%13 = load i8*, i8** %2
%14 = getelementptr inbounds i8, i8* %13, i64 2
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = shl i32 %16, 16
%18 = or i32 %12, %17
%19 = load i8*, i8** %2
%20 = getelementptr inbounds i8, i8* %19, i64 3
%21 = load i8, i8* %20
%22 = zext i8 %21 to i32
%23 = shl i32 %22, 24
%24 = or i32 %18, %23
%25 = load i8*, i8** %2
%26 = getelementptr inbounds i8, i8* %25, i64 4
%27 = load i8, i8* %26
%28 = zext i8 %27 to i32
%29 = shl i32 %28, 32
%30 = or i32 %24, %29
%31 = load i8*, i8** %2
%32 = getelementptr inbounds i8, i8* %31, i64 5
%33 = load i8, i8* %32
%34 = zext i8 %33 to i32
%35 = shl i32 %34, 40
%36 = or i32 %30, %35
%37 = load i8*, i8** %2
%38 = getelementptr inbounds i8, i8* %37, i64 6
%39 = load i8, i8* %38
%40 = zext i8 %39 to i32
%41 = shl i32 %40, 48
%42 = or i32 %36, %41
%43 = load i8*, i8** %2
%44 = getelementptr inbounds i8, i8* %43, i64 7
%45 = load i8, i8* %44
%46 = zext i8 %45 to i32
%47 = shl i32 %46, 56
%48 = or i32 %42, %47
ret i32 %48
}

LLVM IR (-O2):
define i32 @get_uint64_le(i8* nocapture readnone %0) {
ret i32 poison
}
/* Variables and functions */
char *malloc(unsigned int);
int /*<<< orphan*/ memory_error();
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *save_string(char *string) {
  char *new_string;
  new_string = malloc((unsigned)(strlen(string) + 1));
  if (new_string == NULL)
    memory_error();
  strcpy(new_string, string);
  return (new_string);
}


x86 assembly (clang, -O0):
<save_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x1,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1176 <save_string+0x36>
mov    $0x0,%al
call   1060 <memory_error@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<save_string>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1163 <save_string+0x23>
xor    %eax,%eax
call   1060 <memory_error@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @save_string(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = trunc i64 %2 to i32
%4 = add i32 %3, 1
%5 = tail call i8* @malloc(i32 %4)
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = tail call i32 (...) @memory_error()
br label %9
9: ; preds = %7, %1
%10 = tail call i32 @strcpy(i8* %5, i8* %0)
ret i8* %5
}
void foo_1_1_2_2_1_1_2_1_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_1_2_2_1_1_2_1_1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void f20(long j) {
  if ((j & ((1UL << (20)) - 1)) >= ((1UL << ((20) - 1)) + 2))
    abort();
}


x86 assembly (clang, -O0):
<f20>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0xfffff,%rax
cmp    $0x80002,%rax
jb     1139 <f20+0x29>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f20>:
and    $0xffffe,%edi
cmp    $0x80002,%edi
jae    111f <f20+0xf>
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @f20(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 1048575
%5 = icmp uge i64 %4, 524290
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @f20(i64 %0) {
%2 = and i64 %0, 1048574
%3 = icmp ugt i64 %2, 524289
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @abort()
unreachable
6: ; preds = %1
ret void
}
int test_imm_DBint16_mem(short *val) {
  return ((*val) & (-0xDB << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_DBint16_mem>:
movzwl (%rdi),%eax
test   $0xff25,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_DBint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -219
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int main() {
  int x;
  x = 0;
  switch (x)
  case 0:;
    switch (x)
    case 0:
      switch (x) {
      case 0:
        goto next;
      default:
        return 1;
      }
  return 2;
next:
  switch (x)
  case 1:
    return 3;
  switch (x) {
    x = 1 + 1;
  foo:
  case 1:
    return 4;
  }
  switch (x) {
  case 0:
    return x;
  case 1:
    return 1;
  default:
    return 1;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
test   %eax,%eax
jne    1127 <main+0x27>
jmp    1122 <main+0x22>
jmp    1127 <main+0x27>
mov    -0x8(%rbp),%eax
test   %eax,%eax
jne    1158 <main+0x58>
jmp    1137 <main+0x37>
mov    -0x8(%rbp),%eax
test   %eax,%eax
jne    114c <main+0x4c>
jmp    1147 <main+0x47>
jmp    1164 <main+0x64>
movl   $0x1,-0x4(%rbp)
jmp    11e0 <main+0xe0>
movl   $0x2,-0x4(%rbp)
jmp    11e0 <main+0xe0>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
jne    1181 <main+0x81>
jmp    1175 <main+0x75>
movl   $0x3,-0x4(%rbp)
jmp    11e0 <main+0xe0>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
jne    119e <main+0x9e>
jmp    1192 <main+0x92>
movl   $0x4,-0x4(%rbp)
jmp    11e0 <main+0xe0>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
test   %eax,%eax
je     11c2 <main+0xc2>
jmp    11b1 <main+0xb1>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
je     11cd <main+0xcd>
jmp    11d9 <main+0xd9>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    11e0 <main+0xe0>
movl   $0x1,-0x4(%rbp)
jmp    11e0 <main+0xe0>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %5 [
i32 0, label %4
]
4: ; preds = %0
br label %5
5: ; preds = %4, %0
%6 = load i32, i32* %2
switch i32 %6, label %11 [
i32 0, label %7
]
7: ; preds = %5
%8 = load i32, i32* %2
switch i32 %8, label %10 [
i32 0, label %9
]
9: ; preds = %7
br label %12
10: ; preds = %7
store i32 1, i32* %1
br label %25
11: ; preds = %5
store i32 2, i32* %1
br label %25
12: ; preds = %9
%13 = load i32, i32* %2
switch i32 %13, label %15 [
i32 1, label %14
]
14: ; preds = %12
store i32 3, i32* %1
br label %25
15: ; preds = %12
%16 = load i32, i32* %2
switch i32 %16, label %19 [
i32 1, label %18
]
17: ; No predecessors!
br label %18
18: ; preds = %15, %17
store i32 4, i32* %1
br label %25
19: ; preds = %15
%20 = load i32, i32* %2
switch i32 %20, label %24 [
i32 0, label %21
i32 1, label %23
]
21: ; preds = %19
%22 = load i32, i32* %2
store i32 %22, i32* %1
br label %25
23: ; preds = %19
store i32 1, i32* %1
br label %25
24: ; preds = %19
store i32 1, i32* %1
br label %25
25: ; preds = %24, %23, %21, %18, %14, %11, %10
%26 = load i32, i32* %1
ret i32 %26
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void unquote(char *ptr) {
  char *dest;
  dest = ptr;
  do {
    if (*ptr == '\\' && ptr[1] != '\0') {
      ptr++;
    }
  } while ((*dest++ = *ptr++) != '\0');
}


x86 assembly (clang, -O0):
<unquote>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5c,%eax
jne    113d <unquote+0x3d>
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x0,%eax
je     113d <unquote+0x3d>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1142 <unquote+0x42>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%al
mov    -0x10(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
jne    1110 <unquote+0x10>
pop    %rbp
ret

x86 assembly (clang, -O2):
<unquote>:
mov    %rdi,%rax
jmp    1121 <unquote+0x21>
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rdi),%ecx
add    $0x1,%rdi
mov    %cl,(%rax)
add    $0x1,%rax
test   %cl,%cl
je     1135 <unquote+0x35>
movzbl (%rdi),%ecx
cmp    $0x5c,%cl
jne    1113 <unquote+0x13>
cmpb   $0x0,0x1(%rdi)
je     1110 <unquote+0x10>
add    $0x1,%rdi
jmp    1110 <unquote+0x10>
ret

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

LLVM IR (-O2):
define void @unquote(i8* nocapture %0) {
br label %2
2: ; preds = %13, %1
%3 = phi i8* [ %0, %1 ], [ %16, %13 ]
%4 = phi i8* [ %0, %1 ], [ %17, %13 ]
%5 = load i8, i8* %3
%6 = icmp eq i8 %5, 92
br i1 %6, label %7, label %13
7: ; preds = %2
%8 = getelementptr inbounds i8, i8* %3, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
%11 = select i1 %10, i8* %3, i8* %8
%12 = load i8, i8* %11
br label %13
13: ; preds = %7, %2
%14 = phi i8 [ %12, %7 ], [ %5, %2 ]
%15 = phi i8* [ %11, %7 ], [ %3, %2 ]
%16 = getelementptr inbounds i8, i8* %15, i64 1
%17 = getelementptr inbounds i8, i8* %4, i64 1
store i8 %14, i8* %4
%18 = icmp eq i8 %14, 0
br i1 %18, label %19, label %2
19: ; preds = %13
ret void
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
double get_time();
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ sha1();
int main() {
  uint16_t iter;
  double before = get_time();
  for (iter = 1; iter <= 1000; iter++) {
    sha1();
  }
  double diff = get_time() - before;
  printf("%f\n", diff);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <get_time@plt>
movsd  %xmm0,-0x10(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x3e8,-0x8(%rbp)
jg     1174 <main+0x44>
mov    $0x0,%al
call   1030 <sha1@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1152 <main+0x22>
mov    $0x0,%al
call   1050 <get_time@plt>
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
lea    0xe6f(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
xor    %eax,%eax
call   1050 <get_time@plt>
movsd  %xmm0,0x8(%rsp)
mov    $0x3e8,%ebx
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <sha1@plt>
add    $0xffffffff,%ebx
jne    1150 <main+0x20>
xor    %eax,%eax
call   1050 <get_time@plt>
subsd  0x8(%rsp),%xmm0
lea    0xe90(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = tail call double (...) @get_time()
br label %2
2: ; preds = %0, %2
%3 = phi i32 [ 1, %0 ], [ %5, %2 ]
%4 = tail call i32 (...) @sha1()
%5 = add nuw nsw i32 %3, 1
%6 = icmp eq i32 %5, 1001
br i1 %6, label %7, label %2
7: ; preds = %2
%8 = tail call double (...) @get_time()
%9 = fsub double %8, %1
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %9)
ret i32 0
}
void av_sub_q() {}


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

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

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

LLVM IR (-O2):
define void @av_sub_q() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gr();
int /*<<< orphan*/ ib();
int /*<<< orphan*/ zg();
void yw(int uz) {
  gr();
  for (;;)
    if (uz != 0) {
      uz = 0;
      ib();
    } else
      zg();
}


x86 assembly (clang, -O0):
<yw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <gr@plt>
cmpl   $0x0,-0x4(%rbp)
je     115f <yw+0x2f>
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <ib@plt>
jmp    1166 <yw+0x36>
mov    $0x0,%al
call   1030 <zg@plt>
jmp    1142 <yw+0x12>

x86 assembly (clang, -O2):
<yw>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <gr@plt>
test   %ebx,%ebx
je     1150 <yw+0x20>
xor    %eax,%eax
call   1050 <ib@plt>
cs nopw 0x0(%rax,%rax,1)
nop
xor    %eax,%eax
call   1030 <zg@plt>
jmp    1150 <yw+0x20>

LLVM IR (-O0):
define void @yw(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @gr()
br label %4
4: ; preds = %11, %1
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %4
store i32 0, i32* %2
%8 = call i32 (...) @ib()
br label %11
9: ; preds = %4
%10 = call i32 (...) @zg()
br label %11
11: ; preds = %9, %7
br label %4
}

LLVM IR (-O2):
define void @yw(i32 %0) {
%2 = tail call i32 (...) @gr()
%3 = icmp eq i32 %0, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 (...) @ib()
br label %6
6: ; preds = %1, %4
br label %7
7: ; preds = %6, %7
%8 = tail call i32 (...) @zg()
br label %7
}
float sign(float x) { return (x > 0.0) ? 1.0 : ((x < 0.0) ? -1.0 : 0.0); }


x86 assembly (clang, -O0):
<sign>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1131 <sign+0x31>
movsd  0xee1(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    115e <sign+0x5e>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xebe(%rip),%xmm3
xorps  %xmm2,%xmm2
cmpltsd %xmm2,%xmm0
movaps %xmm0,%xmm1
andpd  %xmm3,%xmm1
andnpd %xmm2,%xmm0
orpd   %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sign>:
xorps  %xmm1,%xmm1
movaps %xmm0,%xmm2
cmpltss %xmm1,%xmm2
movss  0xeed(%rip),%xmm3
andps  %xmm2,%xmm3
cmpltss %xmm0,%xmm1
movss  0xee1(%rip),%xmm0
andps  %xmm1,%xmm0
andnps %xmm3,%xmm1
orps   %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @sign(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fcmp ogt double %4, 0.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
br label %13
7: ; preds = %1
%8 = load float, float* %2
%9 = fpext float %8 to double
%10 = fcmp olt double %9, 0.000000e+00
%11 = zext i1 %10 to i64
%12 = select i1 %10, double -1.000000e+00, double 0.000000e+00
br label %13
13: ; preds = %7, %6
%14 = phi double [ 1.000000e+00, %6 ], [ %12, %7 ]
%15 = fptrunc double %14 to float
ret float %15
}

LLVM IR (-O2):
define float @sign(float %0) {
%2 = fcmp ogt float %0, 0.000000e+00
%3 = fcmp olt float %0, 0.000000e+00
%4 = select i1 %3, float -1.000000e+00, float 0.000000e+00
%5 = select i1 %2, float 1.000000e+00, float %4
ret float %5
}
/* Type definitions */
struct buffer {
  int dummy;
};

/* Variables and functions */
char buffer_get_8(struct buffer *);
char buffer_get_char(struct buffer *self) { return buffer_get_8(self); }


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

x86 assembly (clang, -O2):
<buffer_get_char>:
jmp    1030 <buffer_get_8@plt>

LLVM IR (-O0):
%struct.buffer = type { i32 }
define signext i8 @buffer_get_char(%struct.buffer* %0) {
%2 = alloca %struct.buffer*
store %struct.buffer* %0, %struct.buffer** %2
%3 = load %struct.buffer*, %struct.buffer** %2
%4 = call signext i8 @buffer_get_8(%struct.buffer* %3)
ret i8 %4
}

LLVM IR (-O2):
%struct.buffer = type { i32 }
define signext i8 @buffer_get_char(%struct.buffer* %0) {
%2 = tail call signext i8 @buffer_get_8(%struct.buffer* %0)
ret i8 %2
}
/* Variables and functions */
int get_ticks();
void delay_msecs(int ms) {
  register int endtime;
  endtime = get_ticks() + (ms << 5);
  do {
  } while ((endtime - get_ticks()) > 0);
}


x86 assembly (clang, -O0):
<delay_msecs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <get_ticks@plt>
mov    -0x4(%rbp),%ecx
shl    $0x5,%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
jmp    1132 <delay_msecs+0x22>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <get_ticks@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
sub    %ecx,%eax
cmp    $0x0,%eax
jg     112d <delay_msecs+0x1d>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay_msecs>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <get_ticks@plt>
shl    $0x5,%ebx
add    %eax,%ebx
nop
xor    %eax,%eax
call   1030 <get_ticks@plt>
cmp    %eax,%ebx
jg     1120 <delay_msecs+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @delay_msecs(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 (...) @get_ticks()
%5 = load i32, i32* %2
%6 = shl i32 %5, 5
%7 = add nsw i32 %4, %6
store i32 %7, i32* %3
br label %8
8: ; preds = %9, %1
br label %9
9: ; preds = %8
%10 = load i32, i32* %3
%11 = call i32 (...) @get_ticks()
%12 = sub nsw i32 %10, %11
%13 = icmp sgt i32 %12, 0
br i1 %13, label %8, label %14
14: ; preds = %9
ret void
}

LLVM IR (-O2):
define void @delay_msecs(i32 %0) {
%2 = tail call i32 (...) @get_ticks()
%3 = shl i32 %0, 5
%4 = add nsw i32 %2, %3
br label %5
5: ; preds = %5, %1
%6 = tail call i32 (...) @get_ticks()
%7 = icmp sgt i32 %4, %6
br i1 %7, label %5, label %8
8: ; preds = %5
ret void
}
long plus(long x, long y) { return x + y; }


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

x86 assembly (clang, -O2):
<plus>:
lea    (%rdi,%rsi,1),%rax
ret

LLVM IR (-O0):
define i64 @plus(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = add nsw i64 %5, %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @plus(i64 %0, i64 %1) {
%3 = add nsw i64 %1, %0
ret i64 %3
}
/* Variables and functions */
float nextafterf_custom(float, float);
float nextUp_f(double d) {
  float result = d;
  if (((double)result) >= d)
    return result;
  return nextafterf_custom(result, result + 1000000);
}


x86 assembly (clang, -O0):
<nextUp_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     114e <nextUp_f+0x3e>
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    116a <nextUp_f+0x5a>
movss  -0x14(%rbp),%xmm0
movss  0xea5(%rip),%xmm1
addss  -0x14(%rbp),%xmm1
call   1030 <nextafterf_custom@plt>
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nextUp_f>:
movaps %xmm0,%xmm1
cvtsd2ss %xmm0,%xmm0
cvtss2sd %xmm0,%xmm2
ucomisd %xmm1,%xmm2
jae    1132 <nextUp_f+0x22>
movss  0xed7(%rip),%xmm1
addss  %xmm0,%xmm1
jmp    1030 <nextafterf_custom@plt>
ret

LLVM IR (-O0):
define float @nextUp_f(double %0) {
%2 = alloca float
%3 = alloca double
%4 = alloca float
store double %0, double* %3
%5 = load double, double* %3
%6 = fptrunc double %5 to float
store float %6, float* %4
%7 = load float, float* %4
%8 = fpext float %7 to double
%9 = load double, double* %3
%10 = fcmp oge double %8, %9
br i1 %10, label %11, label %13
11: ; preds = %1
%12 = load float, float* %4
store float %12, float* %2
br label %18
13: ; preds = %1
%14 = load float, float* %4
%15 = load float, float* %4
%16 = fadd float %15, 1.000000e+06
%17 = call float @nextafterf_custom(float %14, float %16)
store float %17, float* %2
br label %18
18: ; preds = %13, %11
%19 = load float, float* %2
ret float %19
}

LLVM IR (-O2):
define float @nextUp_f(double %0) {
%2 = fptrunc double %0 to float
%3 = fpext float %2 to double
%4 = fcmp ult double %3, %0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = fadd float %2, 1.000000e+06
%7 = tail call float @nextafterf_custom(float %2, float %6)
br label %8
8: ; preds = %1, %5
%9 = phi float [ %7, %5 ], [ %2, %1 ]
ret float %9
}
my_fun(x, y) double x, *y;
{ *y = erf(x) - .5; }


x86 assembly (clang, -O0):
<my_fun>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <erf@plt>
movsd  0xecd(%rip),%xmm1
subsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_fun>:
push   %rbx
mov    %rdi,%rbx
call   1030 <erf@plt>
addsd  0xedf(%rip),%xmm0
movsd  %xmm0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define i32 @my_fun(double %0, double* %1) {
%3 = alloca i32
%4 = alloca double
%5 = alloca double*
store double %0, double* %4
store double* %1, double** %5
%6 = load double, double* %4
%7 = call double @erf(double %6)
%8 = fsub double %7, 5.000000e-01
%9 = load double*, double** %5
store double %8, double* %9
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
define i32 @my_fun(double %0, double* nocapture writeonly %1) {
%3 = tail call double @erf(double %0)
%4 = fadd double %3, -5.000000e-01
store double %4, double* %1
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ my_assert(int);
void should_not_report_assertion_failure(int x) { my_assert(x); }


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

x86 assembly (clang, -O2):
<should_not_report_assertion_failure>:
jmp    1030 <my_assert@plt>

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

LLVM IR (-O2):
define void @should_not_report_assertion_failure(i32 %0) {
%2 = tail call i32 @my_assert(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ system(char *);
void enable_rule() {
  system("netsh advfirewall firewall set rule name=\"LoL Chat OFF\" new "
         "enable=yes");
  printf("Done.\n");
}


x86 assembly (clang, -O0):
<enable_rule>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <system@plt>
lea    0xf10(%rip),%rdi
call   1040 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<enable_rule>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <system@plt>
lea    0xf13(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [71 x i8] c"netsh advfirewall firewall set rule name=\22LoL Chat OFF\22 new enable=yes\00"
@.str.1 = [7 x i8] c"Done.\0A\00"
define void @enable_rule() {
%1 = call i32 @system(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [71 x i8] c"netsh advfirewall firewall set rule name=\22LoL Chat OFF\22 new enable=yes\00"
@str = [6 x i8] c"Done.\00"
define void @enable_rule() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ unregister_for_removal(int);
void remove_registered_files_atexit(void) { unregister_for_removal(1); }


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

x86 assembly (clang, -O2):
<remove_registered_files_atexit>:
mov    $0x1,%edi
jmp    1030 <unregister_for_removal@plt>

LLVM IR (-O0):
define void @remove_registered_files_atexit() {
%1 = call i32 @unregister_for_removal(i32 1)
ret void
}

LLVM IR (-O2):
define void @remove_registered_files_atexit() {
%1 = tail call i32 @unregister_for_removal(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ htableResize(void *, long long);
void htableResizeInterface(void *table, long long int sizeMb) {
  htableResize(table, sizeMb);
}


x86 assembly (clang, -O0):
<htableResizeInterface>:
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 <htableResize@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<htableResizeInterface>:
jmp    1030 <htableResize@plt>

LLVM IR (-O0):
define void @htableResizeInterface(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i32 @htableResize(i8* %5, i64 %6)
ret void
}

LLVM IR (-O2):
define void @htableResizeInterface(i8* %0, i64 %1) {
%3 = tail call i32 @htableResize(i8* %0, i64 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int zzzstrlen(char *);
int rl_insert(int count, int c) {
  char str[2];
  str[1] = 0;
  str[0] = c;
  printf("HERE strlen  is %d\n", zzzstrlen(str));
  return 0;
}


x86 assembly (clang, -O0):
<rl_insert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movb   $0x0,-0x9(%rbp)
mov    -0x8(%rbp),%eax
mov    %al,-0xa(%rbp)
lea    -0xa(%rbp),%rdi
call   1030 <zzzstrlen@plt>
mov    %eax,%esi
lea    0xeb6(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rl_insert>:
push   %rax
movb   $0x0,0x7(%rsp)
mov    %sil,0x6(%rsp)
lea    0x6(%rsp),%rdi
call   1030 <zzzstrlen@plt>
lea    0xec4(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"HERE strlen is %d\0A\00"
define i32 @rl_insert(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [2 x i8]
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 1
store i8 0, i8* %6
%7 = load i32, i32* %4
%8 = trunc i32 %7 to i8
%9 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 0
store i8 %8, i8* %9
%10 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 0
%11 = call i32 @zzzstrlen(i8* %10)
%12 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"HERE strlen is %d\0A\00"
define i32 @rl_insert(i32 %0, i32 %1) {
%3 = alloca [2 x i8]
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%5 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 1
store i8 0, i8* %5
%6 = trunc i32 %1 to i8
store i8 %6, i8* %4
%7 = call i32 @zzzstrlen(i8* %4)
%8 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}
/* Type definitions */
typedef char *uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
uint8_t io_read_byte(uint16_t port) {
  uint8_t value;
  asm volatile("inb %%dx, %%al" : "=a"(value) : "d"(port));
  return value;
}


x86 assembly (clang, -O0):
<io_read_byte>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
in     (%dx),%al
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<io_read_byte>:
mov    %edi,%edx
in     (%dx),%al
ret

LLVM IR (-O0):
define i8* @io_read_byte(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* asm sideeffect "inb %dx, %al", "={ax},{dx},~{dirflag},~{fpsr},~{flags}"(i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
ret i8* %6
}

LLVM IR (-O2):
define i8* @io_read_byte(i32 %0) {
%2 = tail call i8* asm sideeffect "inb %dx, %al", "={ax},{dx},~{dirflag},~{fpsr},~{flags}"(i32 %0)
ret i8* %2
}
void __initialize_hardware(void) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define i32 @xrop3_124_1_0(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 = xor i32 %4, -1
%8 = and i32 %6, %7
%9 = or i32 %8, %3
ret i32 %9
}
void handle_swi() { return; }


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

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

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

LLVM IR (-O2):
define void @handle_swi() {
ret void
}
void deflate(void) {}


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

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

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

LLVM IR (-O2):
define void @deflate() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cbmarch_iec_release(int, int);
void cbm_iec_release(int HandleDevice, int Line) {
  ;
  cbmarch_iec_release(HandleDevice, Line);
  return;
}


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

x86 assembly (clang, -O2):
<cbm_iec_release>:
jmp    1030 <cbmarch_iec_release@plt>

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

LLVM IR (-O2):
define void @cbm_iec_release(i32 %0, i32 %1) {
%3 = tail call i32 @cbmarch_iec_release(i32 %0, i32 %1)
ret void
}
/* Variables and functions */
int str2hexnum(int /*<<< orphan*/);
unsigned long str2hex(unsigned char *str) {
  int value = 0;
  while (*str) {
    value = value << 4;
    value |= str2hexnum(*str++);
  }
  return value;
}


x86 assembly (clang, -O0):
<str2hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     115b <str2hex+0x4b>
mov    -0xc(%rbp),%eax
shl    $0x4,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%edi
call   1030 <str2hexnum@plt>
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <str2hex+0x13>
movslq -0xc(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str2hex>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%cl
xor    %eax,%eax
test   %cl,%cl
je     114c <str2hex+0x3c>
mov    %rdi,%rbx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %eax,%ebp
shl    $0x4,%ebp
movzbl %cl,%edi
call   1030 <str2hexnum@plt>
or     %ebp,%eax
movzbl (%rbx),%ecx
add    $0x1,%rbx
test   %cl,%cl
jne    1130 <str2hex+0x20>
cltq
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i64 @str2hex(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %8, %1
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = icmp ne i8 %6, 0
br i1 %7, label %8, label %18
8: ; preds = %4
%9 = load i32, i32* %3
%10 = shl i32 %9, 4
store i32 %10, i32* %3
%11 = load i8*, i8** %2
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %2
%13 = load i8, i8* %11
%14 = zext i8 %13 to i32
%15 = call i32 @str2hexnum(i32 %14)
%16 = load i32, i32* %3
%17 = or i32 %16, %15
store i32 %17, i32* %3
br label %4
18: ; preds = %4
%19 = load i32, i32* %3
%20 = sext i32 %19 to i64
ret i64 %20
}

LLVM IR (-O2):
define i64 @str2hex(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %17, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %13, %4 ], [ %2, %1 ]
%6 = phi i32 [ %12, %4 ], [ 0, %1 ]
%7 = phi i8* [ %9, %4 ], [ %0, %1 ]
%8 = shl i32 %6, 4
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = zext i8 %5 to i32
%11 = tail call i32 @str2hexnum(i32 %10)
%12 = or i32 %11, %8
%13 = load i8, i8* %9
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4
%16 = sext i32 %12 to i64
br label %17
17: ; preds = %15, %1
%18 = phi i64 [ 0, %1 ], [ %16, %15 ]
ret i64 %18
}
int comp(const void *a, const void *b) {
  if (*(float *)a > *(float *)b) {
    return 1;
  }
  if (*(float *)a < *(float *)b) {
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<comp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x18(%rbp),%rax
ucomiss (%rax),%xmm0
jbe    112d <comp+0x2d>
movl   $0x1,-0x4(%rbp)
jmp    1159 <comp+0x59>
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm1
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm0
ucomiss %xmm1,%xmm0
jbe    1152 <comp+0x52>
movl   $0xffffffff,-0x4(%rbp)
jmp    1159 <comp+0x59>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<comp>:
movss  (%rdi),%xmm0
movss  (%rsi),%xmm1
xor    %ecx,%ecx
ucomiss %xmm0,%xmm1
seta   %cl
neg    %ecx
ucomiss %xmm1,%xmm0
mov    $0x1,%eax
cmovbe %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @comp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to float*
%4 = load float, float* %3
%5 = bitcast i8* %1 to float*
%6 = load float, float* %5
%7 = fcmp ogt float %4, %6
%8 = fcmp olt float %4, %6
%9 = sext i1 %8 to i32
%10 = select i1 %7, i32 1, i32 %9
ret i32 %10
}
int open(const char *file, int flag, int mode) {
  long __res;
  __asm__ volatile("int $0x80"
                   : "=a"(__res)
                   : "0"(5), "b"((long)(file)), "c"((long)(flag)),
                     "d"((long)(mode)));
  do {
    if ((unsigned long)(__res) >= (unsigned long)(-125)) {
      __res = -1;
    }
    return (int)(__res);
  } while (0);
}


x86 assembly (clang, -O0):
<open>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x10(%rbp),%rbx
movslq -0x14(%rbp),%rcx
movslq -0x18(%rbp),%rdx
mov    $0x5,%eax
int    $0x80
mov    %rax,-0x20(%rbp)
cmpq   $0xffffffffffffff83,-0x20(%rbp)
jb     1139 <open+0x39>
movq   $0xffffffffffffffff,-0x20(%rbp)
ff
mov    -0x20(%rbp),%rax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<open>:
push   %rbx
mov    %rdi,%rbx
movslq %esi,%rcx
movslq %edx,%rdx
mov    $0x5,%eax
int    $0x80
cmp    $0xffffffffffffff83,%rax
mov    $0xffffffff,%ecx
cmovae %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @open(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i64
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i8*, i8** %4
%9 = ptrtoint i8* %8 to i64
%10 = load i32, i32* %5
%11 = sext i32 %10 to i64
%12 = load i32, i32* %6
%13 = sext i32 %12 to i64
%14 = call i64 asm sideeffect "int $$0x80", "={ax},0,{bx},{cx},{dx},~{dirflag},~{fpsr},~{flags}"(i64 5, i64 %9, i64 %11, i64 %13)
store i64 %14, i64* %7
br label %15
15: ; preds = %3
%16 = load i64, i64* %7
%17 = icmp uge i64 %16, -125
br i1 %17, label %18, label %19
18: ; preds = %15
store i64 -1, i64* %7
br label %19
19: ; preds = %18, %15
%20 = load i64, i64* %7
%21 = trunc i64 %20 to i32
br label %22
22: ; preds = %19
ret i32 %21
}

LLVM IR (-O2):
define i32 @open(i8* %0, i32 %1, i32 %2) {
%4 = ptrtoint i8* %0 to i64
%5 = sext i32 %1 to i64
%6 = sext i32 %2 to i64
%7 = tail call i64 asm sideeffect "int $$0x80", "={ax},0,{bx},{cx},{dx},~{dirflag},~{fpsr},~{flags}"(i64 5, i64 %4, i64 %5, i64 %6)
%8 = icmp ugt i64 %7, -126
%9 = trunc i64 %7 to i32
%10 = select i1 %8, i32 -1, i32 %9
ret i32 %10
}
/* Type definitions */
typedef double clock_t;

/* Variables and functions */
double CLOCKS_PER_SEC;
long timediff(clock_t t1, clock_t t2) {
  long elapsed;
  elapsed = ((double)t2 - t1) / CLOCKS_PER_SEC * 1000;
  return elapsed;
}


x86 assembly (clang, -O0):
<timediff>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
mov    0x2ec9(%rip),%rax
divsd  (%rax),%xmm0
movsd  0xed5(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<timediff>:
subsd  %xmm0,%xmm1
mov    0x2edd(%rip),%rax
divsd  (%rax),%xmm1
mulsd  0xee9(%rip),%xmm1
cvttsd2si %xmm1,%rax
ret

LLVM IR (-O0):
@CLOCKS_PER_SEC = global double 0.000000e+00
define i64 @timediff(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca i64
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %4
%7 = load double, double* %3
%8 = fsub double %6, %7
%9 = load double, double* @CLOCKS_PER_SEC
%10 = fdiv double %8, %9
%11 = fmul double %10, 1.000000e+03
%12 = fptosi double %11 to i64
store i64 %12, i64* %5
%13 = load i64, i64* %5
ret i64 %13
}

LLVM IR (-O2):
@CLOCKS_PER_SEC = global double 0.000000e+00
define i64 @timediff(double %0, double %1) {
%3 = fsub double %1, %0
%4 = load double, double* @CLOCKS_PER_SEC
%5 = fdiv double %3, %4
%6 = fmul double %5, 1.000000e+03
%7 = fptosi double %6 to i64
ret i64 %7
}
int intcomp(void *i1, void *i2) { return *(int *)i1 - *(int *)i2; }


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

x86 assembly (clang, -O2):
<intcomp>:
mov    (%rdi),%eax
sub    (%rsi),%eax
ret

LLVM IR (-O0):
define i32 @intcomp(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 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @intcomp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}