xunge/DecIR huggingface dataset:
char *buf2str(char *buf, int len) {
  buf[len] = '\0';
  return buf;
}


x86 assembly (clang, -O0):
<buf2str>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<buf2str>:
mov    %rdi,%rax
movslq %esi,%rcx
movb   $0x0,(%rdi,%rcx,1)
ret

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

LLVM IR (-O2):
define i8* @buf2str(i8* returned writeonly %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
store i8 0, i8* %4
ret i8* %0
}
unsigned mmtask_default_counter() {
  static unsigned counter = 0;
  return ++counter;
}


x86 assembly (clang, -O0):
<mmtask_default_counter>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f1a(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2f11(%rip)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mmtask_default_counter>:
mov    0x2f1e(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2f15(%rip)
ret

LLVM IR (-O0):
@mmtask_default_counter.counter = internal global i32 0
define i32 @mmtask_default_counter() {
%1 = load i32, i32* @mmtask_default_counter.counter
%2 = add i32 %1, 1
store i32 %2, i32* @mmtask_default_counter.counter
ret i32 %2
}

LLVM IR (-O2):
@mmtask_default_counter.counter = internal unnamed_addr global i32 0
define i32 @mmtask_default_counter() {
%1 = load i32, i32* @mmtask_default_counter.counter
%2 = add i32 %1, 1
store i32 %2, i32* @mmtask_default_counter.counter
ret i32 %2
}
int minint(int a, int b) { return a < b ? a : b; }


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

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

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

LLVM IR (-O2):
define i32 @minint(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
void pegasus_sleep(int msec) { sleep(msec / 1000); }


x86 assembly (clang, -O0):
<pegasus_sleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <sleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pegasus_sleep>:
movslq %edi,%rax
imul   $0x10624dd3,%rax,%rdi
mov    %rdi,%rax
shr    $0x3f,%rax
sar    $0x26,%rdi
add    %eax,%edi
jmp    1030 <sleep@plt>

LLVM IR (-O0):
define void @pegasus_sleep(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, 1000
%5 = call i32 @sleep(i32 %4)
ret void
}

LLVM IR (-O2):
define void @pegasus_sleep(i32 %0) {
%2 = sdiv i32 %0, 1000
%3 = tail call i32 @sleep(i32 %2)
ret void
}
int slopeLimiter(int oldValue, int newValue, int maxStepSize) {
  int delta = newValue - oldValue;
  if (delta > maxStepSize) {
    delta = maxStepSize;
  }
  if (delta < 0 - maxStepSize) {
    delta = 0 - maxStepSize;
  }
  if (newValue == 0) {
    delta = 0;
  }
  return delta;
}


x86 assembly (clang, -O0):
<slopeLimiter>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1128 <slopeLimiter+0x28>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
xor    %ecx,%ecx
sub    -0xc(%rbp),%ecx
cmp    %ecx,%eax
jge    1140 <slopeLimiter+0x40>
xor    %eax,%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1151 <slopeLimiter+0x51>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<slopeLimiter>:
mov    %esi,%eax
sub    %edi,%eax
cmp    %edx,%eax
cmovg  %edx,%eax
neg    %edx
cmp    %edx,%eax
cmovl  %edx,%eax
test   %esi,%esi
cmove  %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @slopeLimiter(i32 %0, i32 %1, i32 %2) {
%4 = sub nsw i32 %1, %0
%5 = icmp sgt i32 %4, %2
%6 = select i1 %5, i32 %2, i32 %4
%7 = sub nsw i32 0, %2
%8 = icmp slt i32 %6, %7
%9 = select i1 %8, i32 %7, i32 %6
%10 = icmp eq i32 %1, 0
%11 = select i1 %10, i32 0, i32 %9
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ sleep(int);
void *start_routine(void *arg) {
  int i;
  for (i = 1; i <= 5; i++) {
    printf("i = %d\n", i);
    sleep(1);
  }
  return NULL;
}


x86 assembly (clang, -O0):
<start_routine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x5,-0xc(%rbp)
jg     1164 <start_routine+0x44>
mov    -0xc(%rbp),%esi
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <start_routine+0x13>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<start_routine>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"i = %d\0A\00"
define noalias i8* @start_routine(i8* nocapture readnone %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 1)
%3 = tail call i32 @sleep(i32 1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 2)
%5 = tail call i32 @sleep(i32 1)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 3)
%7 = tail call i32 @sleep(i32 1)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 4)
%9 = tail call i32 @sleep(i32 1)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 5)
%11 = tail call i32 @sleep(i32 1)
ret i8* null
}
/* Type definitions */
struct wl_proxy {
  int dummy;
};
struct wl_buffer {
  int dummy;
};

/* Variables and functions */
void *wl_proxy_get_user_data(struct wl_proxy *);
void *wl_buffer_get_user_data(struct wl_buffer *wl_buffer) {
  return wl_proxy_get_user_data((struct wl_proxy *)wl_buffer);
}


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

x86 assembly (clang, -O2):
<wl_buffer_get_user_data>:
jmp    1030 <wl_proxy_get_user_data@plt>

LLVM IR (-O0):
%struct.wl_buffer = type { i32 }
%struct.wl_proxy = type { i32 }
define i8* @wl_buffer_get_user_data(%struct.wl_buffer* %0) {
%2 = alloca %struct.wl_buffer*
store %struct.wl_buffer* %0, %struct.wl_buffer** %2
%3 = load %struct.wl_buffer*, %struct.wl_buffer** %2
%4 = bitcast %struct.wl_buffer* %3 to %struct.wl_proxy*
%5 = call i8* @wl_proxy_get_user_data(%struct.wl_proxy* %4)
ret i8* %5
}

LLVM IR (-O2):
%struct.wl_buffer = type { i32 }
%struct.wl_proxy = type { i32 }
define i8* @wl_buffer_get_user_data(%struct.wl_buffer* %0) {
%2 = bitcast %struct.wl_buffer* %0 to %struct.wl_proxy*
%3 = tail call i8* @wl_proxy_get_user_data(%struct.wl_proxy* %2)
ret i8* %3
}
int main() {
  int i = 0, n = 1, z = 2, p = 3;
  switch (i) {
  case 1:
    n++;
    break;
  case 0:
    z++;
    break;
  default:
    p++;
    break;
  }
  return z;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x2,-0x10(%rbp)
movl   $0x3,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
test   %eax,%eax
je     1159 <main+0x59>
jmp    113a <main+0x3a>
mov    -0x18(%rbp),%eax
sub    $0x1,%eax
jne    1167 <main+0x67>
jmp    114b <main+0x4b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1170 <main+0x70>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1170 <main+0x70>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 1, i32* %3
store i32 2, i32* %4
store i32 3, i32* %5
%6 = load i32, i32* %2
switch i32 %6, label %13 [
i32 1, label %7
i32 0, label %10
]
7: ; preds = %0
%8 = load i32, i32* %3
%9 = add nsw i32 %8, 1
store i32 %9, i32* %3
br label %16
10: ; preds = %0
%11 = load i32, i32* %4
%12 = add nsw i32 %11, 1
store i32 %12, i32* %4
br label %16
13: ; preds = %0
%14 = load i32, i32* %5
%15 = add nsw i32 %14, 1
store i32 %15, i32* %5
br label %16
16: ; preds = %13, %10, %7
%17 = load i32, i32* %4
ret i32 %17
}

LLVM IR (-O2):
define i32 @main() {
ret i32 3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int pixel_sa8d_wxh(int /*<<< orphan*/ *, int, int /*<<< orphan*/ *, int, int,
                   int);
int pixel_sa8d_16x8(uint8_t *pix1, int i_stride_pix1, uint8_t *pix2,
                    int i_stride_pix2) {
  return (pixel_sa8d_wxh(pix1, i_stride_pix1, pix2, i_stride_pix2, 16, 8) +
          2) >>
         2;
}


x86 assembly (clang, -O0):
<pixel_sa8d_16x8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    $0x10,%r8d
mov    $0x8,%r9d
call   1030 <pixel_sa8d_wxh@plt>
add    $0x2,%eax
sar    $0x2,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pixel_sa8d_16x8>:
push   %rax
mov    $0x10,%r8d
mov    $0x8,%r9d
call   1030 <pixel_sa8d_wxh@plt>
add    $0x2,%eax
sar    $0x2,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @pixel_sa8d_16x8(i32* %0, i32 %1, i32* %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32
store i32* %0, i32** %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store i32 %3, i32* %8
%9 = load i32*, i32** %5
%10 = load i32, i32* %6
%11 = load i32*, i32** %7
%12 = load i32, i32* %8
%13 = call i32 @pixel_sa8d_wxh(i32* %9, i32 %10, i32* %11, i32 %12, i32 16, i32 8)
%14 = add nsw i32 %13, 2
%15 = ashr i32 %14, 2
ret i32 %15
}

LLVM IR (-O2):
define i32 @pixel_sa8d_16x8(i32* %0, i32 %1, i32* %2, i32 %3) {
%5 = tail call i32 @pixel_sa8d_wxh(i32* %0, i32 %1, i32* %2, i32 %3, i32 16, i32 8)
%6 = add nsw i32 %5, 2
%7 = ashr i32 %6, 2
ret i32 %7
}
int ah_decrypt_byte(unsigned long *pkeys, const unsigned long *pcrc_32_tab) {
  unsigned temp;
  temp = ((unsigned)(*(pkeys + 2)) & 0xffff) | 2;
  return (int)(((temp * (temp ^ 1)) >> 8) & 0xff);
}


x86 assembly (clang, -O0):
<ah_decrypt_byte>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%rax
and    $0xffff,%eax
or     $0x2,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x14(%rbp),%ecx
xor    $0x1,%ecx
imul   %ecx,%eax
shr    $0x8,%eax
and    $0xff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ah_decrypt_byte>:
mov    $0xfffd,%eax
and    0x10(%rdi),%eax
lea    0x2(%rax),%ecx
xor    $0x3,%eax
imul   %ecx,%eax
movzbl %ah,%eax
ret

LLVM IR (-O0):
define i32 @ah_decrypt_byte(i64* %0, i64* %1) {
%3 = alloca i64*
%4 = alloca i64*
%5 = alloca i32
store i64* %0, i64** %3
store i64* %1, i64** %4
%6 = load i64*, i64** %3
%7 = getelementptr inbounds i64, i64* %6, i64 2
%8 = load i64, i64* %7
%9 = trunc i64 %8 to i32
%10 = and i32 %9, 65535
%11 = or i32 %10, 2
store i32 %11, i32* %5
%12 = load i32, i32* %5
%13 = load i32, i32* %5
%14 = xor i32 %13, 1
%15 = mul i32 %12, %14
%16 = lshr i32 %15, 8
%17 = and i32 %16, 255
ret i32 %17
}

LLVM IR (-O2):
define i32 @ah_decrypt_byte(i64* nocapture %0, i64* nocapture readnone %1) {
%3 = getelementptr inbounds i64, i64* %0, i64 2
%4 = load i64, i64* %3
%5 = trunc i64 %4 to i32
%6 = and i32 %5, 65533
%7 = or i32 %6, 2
%8 = xor i32 %6, 3
%9 = mul nuw i32 %7, %8
%10 = lshr i32 %9, 8
%11 = and i32 %10, 255
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ putc(char, int /*<<< orphan*/);
int /*<<< orphan*/ puts(char const *);
int /*<<< orphan*/ rib_util_printseparator(int, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ strlen(char const *);
void rib_util_printheader(const char *title, bool isBold) {
  puts(title);
  putc('\n', stdout);
  rib_util_printseparator(isBold, strlen(title));
  putc('\n', stdout);
}


x86 assembly (clang, -O0):
<rib_util_printheader>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <puts@plt>
mov    0x2e81(%rip),%rax
mov    (%rax),%esi
mov    $0xa,%edi
call   1060 <putc@plt>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x10(%rbp),%edi
mov    %eax,%esi
call   1030 <rib_util_printseparator@plt>
mov    0x2e55(%rip),%rax
mov    (%rax),%esi
mov    $0xa,%edi
call   1060 <putc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rib_util_printheader>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%rbx
call   1040 <puts@plt>
mov    0x2e8b(%rip),%r14
mov    (%r14),%esi
mov    $0xa,%edi
call   1060 <putc@plt>
mov    %rbx,%rdi
call   1050 <strlen@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1030 <rib_util_printseparator@plt>
mov    (%r14),%esi
mov    $0xa,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1060 <putc@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @rib_util_printheader(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = call i32 @puts(i8* %5)
%7 = load i32, i32* @stdout
%8 = call i32 @putc(i8 signext 10, i32 %7)
%9 = load i32, i32* %4
%10 = load i8*, i8** %3
%11 = call i32 @strlen(i8* %10)
%12 = call i32 @rib_util_printseparator(i32 %9, i32 %11)
%13 = load i32, i32* @stdout
%14 = call i32 @putc(i8 signext 10, i32 %13)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @rib_util_printheader(i8* %0, i32 %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) %0)
%4 = load i32, i32* @stdout
%5 = tail call i32 @putc(i8 signext 10, i32 %4)
%6 = tail call i32 @strlen(i8* %0)
%7 = tail call i32 @rib_util_printseparator(i32 %1, i32 %6)
%8 = load i32, i32* @stdout
%9 = tail call i32 @putc(i8 signext 10, i32 %8)
ret void
}
char *gdb_detach() {}


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

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

LLVM IR (-O0):
define i8* @gdb_detach() {
%1 = alloca i8*
%2 = load i8*, i8** %1
ret i8* %2
}

LLVM IR (-O2):
define noalias i8* @gdb_detach() {
ret i8* undef
}
void unlock_sc() {}


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

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

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

LLVM IR (-O2):
define void @unlock_sc() {
ret void
}
int test_imm_F7uint32_mem(unsigned int *val) {
  return ((*val) & (0xF7 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_F7uint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 247
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int x;
  int y;
  int z;
  int res;
  x = __VERIFIER_nondet_int();
  y = __VERIFIER_nondet_int();
  res = 0;
  while (y > 0) {
    z = x;
    x = y - 1;
    y = z;
    res = res + 1;
  }
  res = res + x;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    1167 <main+0x57>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113a <main+0x2a>
mov    -0x14(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 0
}
void rct_ena_usb_int_clk(void) {}


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

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

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

LLVM IR (-O2):
define void @rct_ena_usb_int_clk() {
ret void
}
double ip_vi(double redchan, double nirchan) {
  double result;
  if ((nirchan + redchan) == 0.0) {
    result = -1.0;
  } else {
    result = (nirchan) / (nirchan + redchan);
  }
  return result;
}


x86 assembly (clang, -O0):
<ip_vi>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
addsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    113d <ip_vi+0x3d>
jp     113d <ip_vi+0x3d>
movsd  0xecd(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1155 <ip_vi+0x55>
movsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
addsd  -0x8(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ip_vi>:
addsd  %xmm1,%xmm0
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm0
jne    1119 <ip_vi+0x19>
jp     1119 <ip_vi+0x19>
movsd  0xee8(%rip),%xmm0
ret
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @ip_vi(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %4
%7 = load double, double* %3
%8 = fadd double %6, %7
%9 = fcmp oeq double %8, 0.000000e+00
br i1 %9, label %10, label %11
10: ; preds = %2
store double -1.000000e+00, double* %5
br label %17
11: ; preds = %2
%12 = load double, double* %4
%13 = load double, double* %4
%14 = load double, double* %3
%15 = fadd double %13, %14
%16 = fdiv double %12, %15
store double %16, double* %5
br label %17
17: ; preds = %11, %10
%18 = load double, double* %5
ret double %18
}

LLVM IR (-O2):
define double @ip_vi(double %0, double %1) {
%3 = fadd double %0, %1
%4 = fcmp oeq double %3, 0.000000e+00
%5 = fdiv double %1, %3
%6 = select i1 %4, double -1.000000e+00, double %5
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ doit(int, int, int, int);
int main(int argc, char *argv[]) {
  doit(0x0000000000000000, 0x0000000000000000, 0x0000000000000000,
       0x0000000000000000);
  doit(0x0707070707070707, 0x0707070707070707, 0x0000000000000000,
       0x0000000000000000);
  doit(0x8080808080808080, 0x8080808080808080, 0x0000000000000000,
       0x0000000000000000);
  doit(0x13579BDF02468ACE, 0xFEDCBA9876543210, 0xFEEDFACEDEADBEEF,
       0xFEE1DEADDABBAD00);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %ecx,%ecx
mov    %ecx,%edi
mov    %ecx,%esi
mov    %ecx,%edx
call   1030 <doit@plt>
mov    $0x7070707,%esi
xor    %ecx,%ecx
mov    %esi,%edi
mov    %ecx,%edx
call   1030 <doit@plt>
mov    $0x80808080,%esi
xor    %ecx,%ecx
mov    %esi,%edi
mov    %ecx,%edx
call   1030 <doit@plt>
mov    $0x2468ace,%edi
mov    $0x76543210,%esi
mov    $0xdeadbeef,%edx
mov    $0xdabbad00,%ecx
call   1030 <doit@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <doit@plt>
mov    $0x7070707,%edi
mov    $0x7070707,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <doit@plt>
mov    $0x80808080,%edi
mov    $0x80808080,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <doit@plt>
mov    $0x2468ace,%edi
mov    $0x76543210,%esi
mov    $0xdeadbeef,%edx
mov    $0xdabbad00,%ecx
call   1030 <doit@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @doit(i32 0, i32 0, i32 0, i32 0)
%7 = call i32 @doit(i32 117901063, i32 117901063, i32 0, i32 0)
%8 = call i32 @doit(i32 -2139062144, i32 -2139062144, i32 0, i32 0)
%9 = call i32 @doit(i32 38177486, i32 1985229328, i32 -559038737, i32 -625234688)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @doit(i32 0, i32 0, i32 0, i32 0)
%4 = tail call i32 @doit(i32 117901063, i32 117901063, i32 0, i32 0)
%5 = tail call i32 @doit(i32 -2139062144, i32 -2139062144, i32 0, i32 0)
%6 = tail call i32 @doit(i32 38177486, i32 1985229328, i32 -559038737, i32 -625234688)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void fprint_movx_atDPTR(FILE *stream) {
  fprintf(stream, "MOVX  A, @DPTR                  ");
}


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

x86 assembly (clang, -O2):
<fprint_movx_atDPTR>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0x20,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"MOVX A, @DPTR \00"
define void @fprint_movx_atDPTR(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"MOVX A, @DPTR \00"
define void @fprint_movx_atDPTR(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i64 32, i64 1, i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ statusbar(char *);
void nano_disabled_msg(void) {
  statusbar(("Sorry, support for this function has been disabled"));
}


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

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

LLVM IR (-O0):
@.str = [51 x i8] c"Sorry, support for this function has been disabled\00"
define void @nano_disabled_msg() {
%1 = call i32 @statusbar(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [51 x i8] c"Sorry, support for this function has been disabled\00"
define void @nano_disabled_msg() {
%1 = tail call i32 @statusbar(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
ret void
}
int g(int x, int y) { return x + y; }


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

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

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

LLVM IR (-O2):
define i32 @g(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ FATAL_ERROR(char *);
void plazaio_file_error() {
  FATAL_ERROR("Cannot open message stream '"
              "plazapool"
              "'");
}


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

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

LLVM IR (-O0):
@.str = [39 x i8] c"Cannot open message stream 'plazapool'\00"
define void @plazaio_file_error() {
%1 = call i32 @FATAL_ERROR(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [39 x i8] c"Cannot open message stream 'plazapool'\00"
define void @plazaio_file_error() {
%1 = tail call i32 @FATAL_ERROR(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *);
int main() {
  float m;
  printf("Metro: ");
  scanf("%f", &m);
  printf("Jarda: %.2f", m / 0.91);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecc(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xea2(%rip),%xmm1
divsd  %xmm1,%xmm0
lea    0xeaa(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeda(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
divsd  0xeae(%rip),%xmm0
lea    0xeba(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"Metro: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [12 x i8] c"Jarda: %.2f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%5 = load float, float* %2
%6 = fpext float %5 to double
%7 = fdiv double %6, 9.100000e-01
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), double %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"Metro: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [12 x i8] c"Jarda: %.2f\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%5 = load float, float* %1
%6 = fpext float %5 to double
%7 = fdiv double %6, 9.100000e-01
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), double %7)
ret i32 0
}
signed short int signedshortint_ignoring_signedlong(signed short int x,
                                                    signed long y) {
  return x;
}


x86 assembly (clang, -O0):
<signedshortint_ignoring_signedlong>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<signedshortint_ignoring_signedlong>:
mov    %edi,%eax
ret

LLVM IR (-O0):
define signext i16 @signedshortint_ignoring_signedlong(i16 signext %0, i64 %1) {
%3 = alloca i16
%4 = alloca i64
store i16 %0, i16* %3
store i64 %1, i64* %4
%5 = load i16, i16* %3
ret i16 %5
}

LLVM IR (-O2):
define signext i16 @signedshortint_ignoring_signedlong(i16 returned signext %0, i64 %1) {
ret i16 %0
}
int sum(int arg1, int arg2) { return arg1 + arg2; }


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

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

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

LLVM IR (-O2):
define i32 @sum(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ usleep(unsigned long);
void sleep(unsigned long sec) { usleep(sec * 1000); }


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

x86 assembly (clang, -O2):
<sleep>:
imul   $0x3e8,%rdi,%rdi
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @sleep(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = mul i64 %3, 1000
%5 = call i32 @usleep(i64 %4)
ret void
}

LLVM IR (-O2):
define void @sleep(i64 %0) {
%2 = mul i64 %0, 1000
%3 = tail call i32 @usleep(i64 %2)
ret void
}
unsigned hash(const char *s) {
  unsigned h;
  for (h = 0; *s; s++)
    h = ((unsigned)*s) + (h << 6) + (h << 16) - h;
  return h;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114a <hash+0x4a>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0xc(%rbp),%ecx
shl    $0x6,%ecx
add    %ecx,%eax
mov    -0xc(%rbp),%ecx
shl    $0x10,%ecx
add    %ecx,%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <hash+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1127 <hash+0x27>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
imul   $0x1003f,%eax,%eax
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %10, %4 ], [ 0, %1 ]
%7 = phi i8* [ %11, %4 ], [ %0, %1 ]
%8 = sext i8 %5 to i32
%9 = mul i32 %6, 65599
%10 = add i32 %9, %8
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %10, %4 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ fork();
void recursive(int cnt) {
  if (cnt != 0) {
    fork();
    recursive(cnt - 1);
  }
}


x86 assembly (clang, -O0):
<recursive>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1147 <recursive+0x27>
mov    $0x0,%al
call   1040 <fork@plt>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
call   1030 <recursive@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<recursive>:
push   %rbx
test   %edi,%edi
je     112c <recursive+0x1c>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <fork@plt>
add    $0xffffffff,%ebx
jne    1120 <recursive+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @recursive(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = call i32 (...) @fork()
%7 = load i32, i32* %2
%8 = sub nsw i32 %7, 1
br label %9
9: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @recursive(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ %0, %1 ]
%5 = tail call i32 (...) @fork()
%6 = add nsw i32 %4, -1
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ i2d_of_void;
typedef int /*<<< orphan*/ DH;
typedef int /*<<< orphan*/ BIO;

/* Variables and functions */
int PEM_ASN1_write_bio(int /*<<< orphan*/ *, int /*<<< orphan*/,
                       int /*<<< orphan*/ *, void *, int /*<<< orphan*/ *,
                       int /*<<< orphan*/ *, int /*<<< orphan*/,
                       int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ PEM_STRING_DHPARAMS;
scalar_t__ i2d_DHparams;
int PEM_write_bio_DHparams(BIO *bp, const DH *x) {
  return PEM_ASN1_write_bio((i2d_of_void *)i2d_DHparams, PEM_STRING_DHPARAMS,
                            bp, (void *)x, NULL, NULL, 0, NULL, NULL);
}


x86 assembly (clang, -O0):
<PEM_write_bio_DHparams>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ec1(%rip),%rax
mov    (%rax),%rdi
mov    0x2e9f(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%r9d
xor    %eax,%eax
mov    %r9,%r8
movl   $0x0,(%rsp)
movq   $0x0,0x8(%rsp)
movq   $0x0,0x10(%rsp)
call   1030 <PEM_ASN1_write_bio@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PEM_write_bio_DHparams>:
sub    $0x18,%rsp
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2ec7(%rip),%rax
mov    (%rax),%rdi
mov    0x2ea5(%rip),%rax
mov    (%rax),%esi
xorps  %xmm0,%xmm0
movups %xmm0,0x8(%rsp)
movl   $0x0,(%rsp)
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <PEM_ASN1_write_bio@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@i2d_DHparams = global i64 0
@PEM_STRING_DHPARAMS = global i32 0
define i32 @PEM_write_bio_DHparams(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i64, i64* @i2d_DHparams
%6 = inttoptr i64 %5 to i32*
%7 = load i32, i32* @PEM_STRING_DHPARAMS
%8 = load i32*, i32** %3
%9 = load i32*, i32** %4
%10 = bitcast i32* %9 to i8*
%11 = call i32 @PEM_ASN1_write_bio(i32* %6, i32 %7, i32* %8, i8* %10, i32* null, i32* null, i32 0, i32* null, i32* null)
ret i32 %11
}

LLVM IR (-O2):
@i2d_DHparams = global i64 0
@PEM_STRING_DHPARAMS = global i32 0
define i32 @PEM_write_bio_DHparams(i32* %0, i32* %1) {
%3 = load i64, i64* @i2d_DHparams
%4 = inttoptr i64 %3 to i32*
%5 = load i32, i32* @PEM_STRING_DHPARAMS
%6 = bitcast i32* %1 to i8*
%7 = tail call i32 @PEM_ASN1_write_bio(i32* %4, i32 %5, i32* %0, i8* %6, i32* null, i32* null, i32 0, i32* null, i32* null)
ret i32 %7
}
/* Variables and functions */
double garan2();
double GARandomDouble() { return garan2(); }


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

x86 assembly (clang, -O2):
<GARandomDouble>:
xor    %eax,%eax
jmp    1030 <garan2@plt>

LLVM IR (-O0):
define double @GARandomDouble() {
%1 = call double (...) @garan2()
ret double %1
}

LLVM IR (-O2):
define double @GARandomDouble() {
%1 = tail call double (...) @garan2()
ret double %1
}
/* Variables and functions */
scalar_t__ __floor(double);
long double __floorl(long double x) {
  return ((long double)__floor((double)x));
}


x86 assembly (clang, -O0):
<__floorl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fstpl  -0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1030 <__floor@plt>
mov    %rax,-0x18(%rbp)
fildll -0x18(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__floorl>:
sub    $0x18,%rsp
fldt   0x20(%rsp)
fstpl  0x8(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <__floor@plt>
mov    %rax,0x10(%rsp)
fildll 0x10(%rsp)
add    $0x18,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @__floorl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fptrunc x86_fp80 %3 to double
%5 = call i64 @__floor(double %4)
%6 = sitofp i64 %5 to x86_fp80
ret x86_fp80 %6
}

LLVM IR (-O2):
define x86_fp80 @__floorl(x86_fp80 %0) {
%2 = fptrunc x86_fp80 %0 to double
%3 = tail call i64 @__floor(double %2)
%4 = sitofp i64 %3 to x86_fp80
ret x86_fp80 %4
}
int Door_InitHandler(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @Door_InitHandler() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void halide_free(void *ctx, void *ptr) { free((char *)ptr - 32); }


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

x86 assembly (clang, -O2):
<halide_free>:
lea    -0x20(%rsi),%rdi
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @halide_free(i8* nocapture readnone %0, i8* nocapture %1) {
%3 = getelementptr inbounds i8, i8* %1, i64 -32
%4 = tail call i32 @free(i8* %3)
ret void
}
/* Variables and functions */
void *realloc(void *mem, size_t size) { return 0; }


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

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

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

LLVM IR (-O2):
define noalias i8* @realloc(i8* nocapture readnone %0, i64 %1) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ Fail(char *, int, int);
int printf(char *, char *);
int strlen(char *);
void DoStrTest(char *formatstr, char *param, char *checkstr) {
  int ret;
  ret = printf(formatstr, param);
  if (ret != strlen(checkstr)) {
    Fail("Expected printf to return %d, got %d.\n", strlen(checkstr), ret);
  }
}


x86 assembly (clang, -O0):
<DoStrTest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <printf@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%eax
cmp    %ecx,%eax
je     118a <DoStrTest+0x5a>
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%esi
mov    -0x1c(%rbp),%edx
lea    0xe7b(%rip),%rdi
call   1050 <Fail@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DoStrTest>:
push   %rbp
push   %rbx
push   %rax
mov    %rdx,%rbx
call   1040 <printf@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <strlen@plt>
cmp    %eax,%ebp
jne    1150 <DoStrTest+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    %rbx,%rdi
call   1030 <strlen@plt>
lea    0xea1(%rip),%rdi
mov    %eax,%esi
mov    %ebp,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <Fail@plt>

LLVM IR (-O0):
@.str = [39 x i8] c"Expected printf to return %d, got %d.\0A\00"
define void @DoStrTest(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = call i32 @printf(i8* %8, i8* %9)
store i32 %10, i32* %7
%11 = load i32, i32* %7
%12 = load i8*, i8** %6
%13 = call i32 @strlen(i8* %12)
%14 = icmp ne i32 %11, %13
br i1 %14, label %15, label %20
15: ; preds = %3
%16 = load i8*, i8** %6
%17 = call i32 @strlen(i8* %16)
%18 = load i32, i32* %7
%19 = call i32 @Fail(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 %17, i32 %18)
br label %20
20: ; preds = %15, %3
ret void
}

LLVM IR (-O2):
@.str = [39 x i8] c"Expected printf to return %d, got %d.\0A\00"
define void @DoStrTest(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @printf(i8* %0, i8* %1)
%5 = tail call i32 @strlen(i8* %2)
%6 = icmp eq i32 %4, %5
br i1 %6, label %10, label %7
7: ; preds = %3
%8 = tail call i32 @strlen(i8* %2)
%9 = tail call i32 @Fail(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %4)
br label %10
10: ; preds = %7, %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ const *,
                          int /*<<< orphan*/);
void fastlz_memcpy(uint8_t *dest, const uint8_t *src, uint32_t count) {
  memcpy(dest, src, count);
}


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

x86 assembly (clang, -O2):
<fastlz_memcpy>:
jmp    1030 <memcpy@plt>

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

LLVM IR (-O2):
define void @fastlz_memcpy(i32* %0, i32* %1, i32 %2) {
%4 = tail call i32 @memcpy(i32* %0, i32* %1, i32 %2)
ret void
}
int isalnum(int ch) {
  return (ch >= 48 && ch <= 57) || (ch >= 65 && ch <= 90) ||
         (ch >= 97 && ch <= 122);
}


x86 assembly (clang, -O0):
<isalnum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x30,-0x4(%rbp)
jl     1120 <isalnum+0x20>
mov    $0x1,%al
cmpl   $0x39,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1158 <isalnum+0x58>
cmpl   $0x41,-0x4(%rbp)
jl     1139 <isalnum+0x39>
mov    $0x1,%al
cmpl   $0x5a,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1158 <isalnum+0x58>
xor    %eax,%eax
cmpl   $0x61,-0x4(%rbp)
mov    %al,-0x6(%rbp)
jl     1152 <isalnum+0x52>
cmpl   $0x7a,-0x4(%rbp)
setle  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isalnum>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%eax
setb   %al
and    $0xffffffdf,%edi
add    $0xffffffbf,%edi
cmp    $0x1a,%edi
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @isalnum(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = and i32 %0, -33
%5 = add i32 %4, -65
%6 = icmp ult i32 %5, 26
%7 = or i1 %3, %6
%8 = zext i1 %7 to i32
ret i32 %8
}