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

/* Variables and functions */
int /*<<< orphan*/ file16_to_cpu(int /*<<< orphan*/);
uint16_t struct_val_u16(char *ptr, unsigned int offset) {
  return (file16_to_cpu(*(uint16_t *)(ptr + offset)));
}


x86 assembly (clang, -O0):
<struct_val_u16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    (%rax,%rcx,1),%edi
call   1030 <file16_to_cpu@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<struct_val_u16>:
mov    %esi,%eax
mov    (%rdi,%rax,1),%edi
jmp    1030 <file16_to_cpu@plt>

LLVM IR (-O0):
define i32 @struct_val_u16(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 = zext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = call i32 @file16_to_cpu(i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @struct_val_u16(i8* nocapture %0, i32 %1) {
%3 = zext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = bitcast i8* %4 to i32*
%6 = load i32, i32* %5
%7 = tail call i32 @file16_to_cpu(i32 %6)
ret i32 %7
}
int do_307() { return 307; }


x86 assembly (clang, -O0):
<do_307>:
push   %rbp
mov    %rsp,%rbp
mov    $0x133,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @do_307() {
ret i32 307
}

LLVM IR (-O2):
define i32 @do_307() {
ret i32 307
}
/* Variables and functions */
int /*<<< orphan*/ xyz();
void xxx(void) { xyz(); }


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

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

LLVM IR (-O0):
define void @xxx() {
%1 = call i32 (...) @xyz()
ret void
}

LLVM IR (-O2):
define void @xxx() {
%1 = tail call i32 (...) @xyz()
ret void
}
/* Type definitions */
typedef int uint32_t;
typedef int uint16_t;
struct hle_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ alist_move(struct hle_t *, int, int, int);
void DMEMMOVE(struct hle_t *hle, uint32_t w1, uint32_t w2) {
  uint16_t dmemi = w1;
  uint16_t dmemo = (w2 >> 16);
  uint16_t count = w2;
  if (count == 0)
    return;
  alist_move(hle, dmemo, dmemi, (count + 3) & ~3);
}


x86 assembly (clang, -O0):
<DMEMMOVE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
sar    $0x10,%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jne    1146 <DMEMMOVE+0x36>
jmp    115e <DMEMMOVE+0x4e>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x1c(%rbp),%ecx
add    $0x3,%ecx
and    $0xfffffffc,%ecx
call   1030 <alist_move@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DMEMMOVE>:
mov    %edx,%ecx
test   %edx,%edx
je     1128 <DMEMMOVE+0x18>
mov    %esi,%edx
mov    %ecx,%esi
sar    $0x10,%esi
add    $0x3,%ecx
and    $0xfffffffc,%ecx
jmp    1030 <alist_move@plt>
ret

LLVM IR (-O0):
%struct.hle_t = type { i32 }
define void @DMEMMOVE(%struct.hle_t* %0, i32 %1, i32 %2) {
%4 = alloca %struct.hle_t*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store %struct.hle_t* %0, %struct.hle_t** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%10 = load i32, i32* %5
store i32 %10, i32* %7
%11 = load i32, i32* %6
%12 = ashr i32 %11, 16
store i32 %12, i32* %8
%13 = load i32, i32* %6
store i32 %13, i32* %9
%14 = load i32, i32* %9
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %3
br label %25
17: ; preds = %3
%18 = load %struct.hle_t*, %struct.hle_t** %4
%19 = load i32, i32* %8
%20 = load i32, i32* %7
%21 = load i32, i32* %9
%22 = add nsw i32 %21, 3
%23 = and i32 %22, -4
%24 = call i32 @alist_move(%struct.hle_t* %18, i32 %19, i32 %20, i32 %23)
br label %25
25: ; preds = %17, %16
ret void
}

LLVM IR (-O2):
%struct.hle_t = type { i32 }
define void @DMEMMOVE(%struct.hle_t* %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %10, label %5
5: ; preds = %3
%6 = ashr i32 %2, 16
%7 = add nsw i32 %2, 3
%8 = and i32 %7, -4
%9 = tail call i32 @alist_move(%struct.hle_t* %0, i32 %6, i32 %1, i32 %8)
br label %10
10: ; preds = %3, %5
ret void
}
/* Variables and functions */
int _citrus_NONE_ctype_init(void **__restrict cl, void *__restrict var,
                            size_t lenvar, size_t lenps) {
  *cl = NULL;
  return (0);
}


x86 assembly (clang, -O0):
<_citrus_NONE_ctype_init>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_citrus_NONE_ctype_init>:
movq   $0x0,(%rdi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @_citrus_NONE_ctype_init(i8** noalias %0, i8* noalias %1, i64 %2, i64 %3) {
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i64
store i8** %0, i8*** %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%9 = load i8**, i8*** %5
store i8* null, i8** %9
ret i32 0
}

LLVM IR (-O2):
define i32 @_citrus_NONE_ctype_init(i8** noalias nocapture writeonly %0, i8* noalias nocapture readnone %1, i64 %2, i64 %3) {
store i8* null, i8** %0
ret i32 0
}
/* Type definitions */
typedef int ssize_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int write(int, void const *, size_t);
ssize_t xwrite(int filedes, const void *buffer, size_t size) {
  ssize_t err = write(filedes, buffer, size);
  if (err == -1) {
    perror("write() failed");
    exit(1);
  }
  return err;
}


x86 assembly (clang, -O0):
<xwrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <write@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0xffffffff,-0x1c(%rbp)
jne    1176 <xwrite+0x46>
lea    0xe99(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xwrite>:
push   %rax
call   1030 <write@plt>
cmp    $0xffffffff,%eax
je     113d <xwrite+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"write() failed\00"
define i32 @xwrite(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i32, i32* %4
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = call i32 @write(i32 %8, i8* %9, i64 %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = icmp eq i32 %12, -1
br i1 %13, label %14, label %17
14: ; preds = %3
%15 = call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%16 = call i32 @exit(i32 1)
unreachable
17: ; preds = %3
%18 = load i32, i32* %7
ret i32 %18
}

LLVM IR (-O2):
@.str = [15 x i8] c"write() failed\00"
define i32 @xwrite(i32 %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32 @write(i32 %0, i8* %1, i64 %2)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = tail call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %3
ret i32 %4
}
/* Type definitions */
typedef scalar_t__ int32_t;

/* Variables and functions */
int /*<<< orphan*/ frexp(double, scalar_t__ *);
double hypot(double, double);
double ldexp(double, scalar_t__);
double eps(double re, double im) {
  double y;
  int32_t exponent;
  double absxk = hypot(re, im);
  if (absxk <= 2.2250738585072014E-308)
    y = 4.94065645841247E-324;
  else {
    frexp(absxk, &exponent);
    y = ldexp(1.0, exponent - 53);
  }
  return y;
}


x86 assembly (clang, -O0):
<eps>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1050 <hypot@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  0xea2(%rip),%xmm0
ucomisd -0x28(%rbp),%xmm0
jb     117b <eps+0x4b>
movsd  0xe9f(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    11a3 <eps+0x73>
movsd  -0x28(%rbp),%xmm0
lea    -0x20(%rbp),%rdi
call   1040 <frexp@plt>
mov    -0x20(%rbp),%rdi
sub    $0x35,%rdi
movsd  0xe6f(%rip),%xmm0
call   1030 <ldexp@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eps>:
push   %rax
call   1050 <hypot@plt>
movsd  0xec2(%rip),%xmm1
ucomisd %xmm0,%xmm1
jae    1162 <eps+0x32>
mov    %rsp,%rdi
call   1040 <frexp@plt>
mov    (%rsp),%rdi
add    $0xffffffffffffffcb,%rdi
movsd  0xeb4(%rip),%xmm0
pop    %rax
jmp    1030 <ldexp@plt>
movsd  0xe9e(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @eps(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca i64
%7 = alloca double
store double %0, double* %3
store double %1, double* %4
%8 = load double, double* %3
%9 = load double, double* %4
%10 = call double @hypot(double %8, double %9)
store double %10, double* %7
%11 = load double, double* %7
%12 = fcmp ole double %11, 0x10000000000000
br i1 %12, label %13, label %14
13: ; preds = %2
store double 4.940660e-324, double* %5
br label %20
14: ; preds = %2
%15 = load double, double* %7
%16 = call i32 @frexp(double %15, i64* %6)
%17 = load i64, i64* %6
%18 = sub nsw i64 %17, 53
%19 = call double @ldexp(double 1.000000e+00, i64 %18)
store double %19, double* %5
br label %20
20: ; preds = %14, %13
%21 = load double, double* %5
ret double %21
}

LLVM IR (-O2):
define double @eps(double %0, double %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to i8*
%5 = tail call double @hypot(double %0, double %1)
%6 = fcmp ugt double %5, 0x10000000000000
br i1 %6, label %7, label %12
7: ; preds = %2
%8 = call i32 @frexp(double %5, i64* %3)
%9 = load i64, i64* %3
%10 = add nsw i64 %9, -53
%11 = tail call double @ldexp(double 1.000000e+00, i64 %10)
br label %12
12: ; preds = %2, %7
%13 = phi double [ %11, %7 ], [ 4.940660e-324, %2 ]
ret double %13
}
char SubStrings_ASCII_LowerC(const char C) {
  if (C >= 'A' && C <= 'Z')
    return C + ('a' - 'A');
  else
    return C;
}


x86 assembly (clang, -O0):
<SubStrings_ASCII_LowerC>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x41,%eax
jl     1133 <SubStrings_ASCII_LowerC+0x33>
movsbl -0x2(%rbp),%eax
cmp    $0x5a,%eax
jg     1133 <SubStrings_ASCII_LowerC+0x33>
movsbl -0x2(%rbp),%eax
add    $0x20,%eax
mov    %al,-0x1(%rbp)
jmp    1139 <SubStrings_ASCII_LowerC+0x39>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SubStrings_ASCII_LowerC>:
lea    -0x41(%rdi),%eax
lea    0x20(%rdi),%ecx
cmp    $0x1a,%al
movzbl %cl,%eax
cmovae %edi,%eax
ret

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

LLVM IR (-O2):
define signext i8 @SubStrings_ASCII_LowerC(i8 signext %0) {
%2 = add i8 %0, -65
%3 = icmp ult i8 %2, 26
%4 = add i8 %0, 32
%5 = select i1 %3, i8 %4, i8 %0
ret i8 %5
}
/* Variables and functions */
int /*<<< orphan*/ transmit(int, int, int /*<<< orphan*/, int,
                            int /*<<< orphan*/);
void stop(void) { transmit(4, 0x88, 0, 0x8C, 0); }


x86 assembly (clang, -O0):
<stop>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4,%edi
mov    $0x88,%esi
xor    %r8d,%r8d
mov    $0x8c,%ecx
mov    %r8d,%edx
call   1030 <transmit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<stop>:
mov    $0x4,%edi
mov    $0x88,%esi
xor    %edx,%edx
mov    $0x8c,%ecx
xor    %r8d,%r8d
jmp    1030 <transmit@plt>

LLVM IR (-O0):
define void @stop() {
%1 = call i32 @transmit(i32 4, i32 136, i32 0, i32 140, i32 0)
ret void
}

LLVM IR (-O2):
define void @stop() {
%1 = tail call i32 @transmit(i32 4, i32 136, i32 0, i32 140, i32 0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ u_char;

/* Variables and functions */
int ns_name_uncompress(int /*<<< orphan*/ const *, int /*<<< orphan*/ const *,
                       int /*<<< orphan*/ const *, char *, size_t);
int dn_expand(const u_char *msg, const u_char *eom, const u_char *src,
              char *dst, int dstsiz) {
  int n = ns_name_uncompress(msg, eom, src, dst, (size_t)dstsiz);
  if (n > 0 && dst[0] == '.')
    dst[0] = '\0';
  return (n);
}


x86 assembly (clang, -O0):
<dn_expand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
movslq -0x24(%rbp),%r8
call   1030 <ns_name_uncompress@plt>
mov    %eax,-0x28(%rbp)
cmpl   $0x0,-0x28(%rbp)
jle    1169 <dn_expand+0x59>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
jne    1169 <dn_expand+0x59>
mov    -0x20(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x28(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dn_expand>:
push   %rbx
mov    %rcx,%rbx
movslq %r8d,%r8
call   1030 <ns_name_uncompress@plt>
test   %eax,%eax
jle    1128 <dn_expand+0x18>
cmpb   $0x2e,(%rbx)
jne    1128 <dn_expand+0x18>
movb   $0x0,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @dn_expand(i32* %0, i32* %1, i32* %2, i8* %3, i32 %4) {
%6 = sext i32 %4 to i64
%7 = tail call i32 @ns_name_uncompress(i32* %0, i32* %1, i32* %2, i8* %3, i64 %6)
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %5
%10 = load i8, i8* %3
%11 = icmp eq i8 %10, 46
br i1 %11, label %12, label %13
12: ; preds = %9
store i8 0, i8* %3
br label %13
13: ; preds = %12, %9, %5
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
void DelayMs(uint16_t cmpt_ms) {}


x86 assembly (clang, -O0):
<DelayMs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @DelayMs(i32 %0) {
ret void
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int /*<<< orphan*/ knapsack(int *, int *, int, int *, int *, int);
int main() {
  int *size;
  int *val;
  int N = __VERIFIER_nondet_int();
  int *cost;
  int *best;
  int M = __VERIFIER_nondet_int();
  knapsack(size, val, N, cost, best, M);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x1c(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x34(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
mov    -0x28(%rbp),%rcx
mov    -0x30(%rbp),%r8
mov    -0x34(%rbp),%r9d
call   1040 <knapsack@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %ebx,%edx
mov    %eax,%r9d
call   1040 <knapsack@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
%3 = tail call i32 @knapsack(i32* undef, i32* undef, i32 %1, i32* undef, i32* undef, i32 %2)
ret i32 0
}
/* Variables and functions */
scalar_t__ tolower(int);
char *lowercase(char *s) {
  while (*s) {
    *s = (char)tolower((int)*s);
    s++;
  }
  return s;
}


x86 assembly (clang, -O0):
<lowercase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114e <lowercase+0x3e>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <tolower@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <lowercase+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lowercase>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     1136 <lowercase+0x26>
nopw   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <tolower@plt>
mov    %al,(%rbx)
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <lowercase+0x10>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @lowercase(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %11, %4 ], [ %2, %1 ]
%6 = phi i8* [ %10, %4 ], [ %0, %1 ]
%7 = sext i8 %5 to i32
%8 = tail call i64 @tolower(i32 %7)
%9 = trunc i64 %8 to i8
store i8 %9, i8* %6
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %1
%14 = phi i8* [ %0, %1 ], [ %10, %4 ]
ret i8* %14
}
/* Variables and functions */
float fmodf_c(float, float);
float fmodf_neon_sfp(float x, float y) { return fmodf_c(x, y); }


x86 assembly (clang, -O0):
<fmodf_neon_sfp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1030 <fmodf_c@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmodf_neon_sfp>:
jmp    1030 <fmodf_c@plt>

LLVM IR (-O0):
define float @fmodf_neon_sfp(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = call float @fmodf_c(float %5, float %6)
ret float %7
}

LLVM IR (-O2):
define float @fmodf_neon_sfp(float %0, float %1) {
%3 = tail call float @fmodf_c(float %0, float %1)
ret float %3
}
unsigned xrop3_12_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;
  stk2 = ~T;
  stk1 = S & stk2;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_12_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    -0x10(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
and    -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_12_1_0>:
mov    %edi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_12_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
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %7
%23 = xor i32 %22, -1
store i32 %23, i32* %9
%24 = load i32, i32* %6
%25 = load i32, i32* %9
%26 = and i32 %24, %25
store i32 %26, i32* %8
%27 = load i32, i32* %8
%28 = load i32, i32* %6
%29 = xor i32 %28, -1
%30 = and i32 %27, %29
%31 = load i32, i32* %5
%32 = load i32, i32* %6
%33 = and i32 %31, %32
%34 = or i32 %30, %33
ret i32 %34
}

LLVM IR (-O2):
define i32 @xrop3_12_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
ret i32 %3
}
/* Variables and functions */
scalar_t__ halt3();
scalar_t__ unknown();
int test12() { (void)(halt3() || unknown()); }


x86 assembly (clang, -O0):
<test12>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <halt3@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    1152 <test12+0x32>
mov    $0x0,%al
call   1040 <unknown@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test12>:
push   %rax
xor    %eax,%eax
call   1030 <halt3@plt>
test   %rax,%rax
je     112f <test12+0xf>
pop    %rcx
ret
xor    %eax,%eax
call   1040 <unknown@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @test12() {
%1 = alloca i32
%2 = call i64 (...) @halt3()
%3 = icmp ne i64 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %0
%5 = call i64 (...) @unknown()
%6 = icmp ne i64 %5, 0
br label %7
7: ; preds = %4, %0
%8 = phi i1 [ true, %0 ], [ %6, %4 ]
%9 = zext i1 %8 to i32
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
define i32 @test12() {
%1 = tail call i64 (...) @halt3()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i64 (...) @unknown()
br label %5
5: ; preds = %3, %0
ret i32 undef
}
char *strcat(s, append)
char *s;
const char *append;
{
  char *save = s;
  for (; *s; ++s)
    ;
  while ((*s++ = *append++) != '\0')
    ;
  return (save);
}


x86 assembly (clang, -O0):
<strcat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1137 <strcat+0x37>
jmp    1126 <strcat+0x26>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1114 <strcat+0x14>
jmp    113c <strcat+0x3c>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     116f <strcat+0x6f>
jmp    113c <strcat+0x3c>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcat>:
mov    %rdi,%rax
mov    %rdi,%rcx
cs nopw 0x0(%rax,%rax,1)
cmpb   $0x0,(%rcx)
lea    0x1(%rcx),%rcx
jne    1110 <strcat+0x10>
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
movzbl (%rsi,%rdx,1),%edi
mov    %dil,-0x1(%rcx,%rdx,1)
add    $0x1,%rdx
test   %dil,%dil
jne    1120 <strcat+0x20>
ret

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

LLVM IR (-O2):
define i8* @strcat(i8* returned %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3, %8
%9 = phi i8* [ %11, %8 ], [ %1, %3 ]
%10 = phi i8* [ %13, %8 ], [ %4, %3 ]
%11 = getelementptr inbounds i8, i8* %9, i64 1
%12 = load i8, i8* %9
%13 = getelementptr inbounds i8, i8* %10, i64 1
store i8 %12, i8* %10
%14 = icmp eq i8 %12, 0
br i1 %14, label %15, label %8
15: ; preds = %8
ret i8* %0
}
void voidFunction(void *var) { return; }


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

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

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

LLVM IR (-O2):
define void @voidFunction(i8* nocapture %0) {
ret void
}
/* Type definitions */
struct msg_buff {
  int dummy;
};

/* Variables and functions */
void *__nla_reserve_nohdr(struct msg_buff *, int);
int /*<<< orphan*/ memcpy(void *, void const *, int);
void __nla_put_nohdr(struct msg_buff *msg, int attrlen, const void *data) {
  void *start;
  start = __nla_reserve_nohdr(msg, attrlen);
  memcpy(start, data, attrlen);
}


x86 assembly (clang, -O0):
<__nla_put_nohdr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <__nla_reserve_nohdr@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1040 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__nla_put_nohdr>:
push   %rbp
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %esi,%ebp
call   1030 <__nla_reserve_nohdr@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <memcpy@plt>

LLVM IR (-O0):
%struct.msg_buff = type { i32 }
define void @__nla_put_nohdr(%struct.msg_buff* %0, i32 %1, i8* %2) {
%4 = alloca %struct.msg_buff*
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
store %struct.msg_buff* %0, %struct.msg_buff** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%8 = load %struct.msg_buff*, %struct.msg_buff** %4
%9 = load i32, i32* %5
%10 = call i8* @__nla_reserve_nohdr(%struct.msg_buff* %8, i32 %9)
store i8* %10, i8** %7
%11 = load i8*, i8** %7
%12 = load i8*, i8** %6
%13 = load i32, i32* %5
%14 = call i32 @memcpy(i8* %11, i8* %12, i32 %13)
ret void
}

LLVM IR (-O2):
%struct.msg_buff = type { i32 }
define void @__nla_put_nohdr(%struct.msg_buff* %0, i32 %1, i8* %2) {
%4 = tail call i8* @__nla_reserve_nohdr(%struct.msg_buff* %0, i32 %1)
%5 = tail call i32 @memcpy(i8* %4, i8* %2, i32 %1)
ret void
}
/* Variables and functions */
char popc();
void flush() {
  while (popc() != '\n')
    ;
}


x86 assembly (clang, -O0):
<flush>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <flush+0x9>
mov    $0x0,%al
call   1030 <popc@plt>
movsbl %al,%eax
cmp    $0xa,%eax
je     1131 <flush+0x21>
jmp    1119 <flush+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<flush>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <popc@plt>
cmp    $0xa,%al
jne    1120 <flush+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @flush() {
br label %1
1: ; preds = %5, %0
%2 = call signext i8 (...) @popc()
%3 = sext i8 %2 to i32
%4 = icmp ne i32 %3, 10
br i1 %4, label %5, label %6
5: ; preds = %1
br label %1
6: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @flush() {
br label %1
1: ; preds = %1, %0
%2 = tail call signext i8 (...) @popc()
%3 = icmp eq i8 %2, 10
br i1 %3, label %4, label %1
4: ; preds = %1
ret void
}
/* Variables and functions */
int FindSmallestInteger(int *, int, int);
int /*<<< orphan*/ SwapIntegerElements(int *, int, int);
void SortIntegerArray(int array[], int n) {
  int lh, rh;
  for (lh = 0; lh < n; lh++) {
    rh = FindSmallestInteger(array, lh, n - 1);
    SwapIntegerElements(array, lh, rh);
  }
}


x86 assembly (clang, -O0):
<SortIntegerArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1174 <SortIntegerArray+0x54>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
call   1030 <FindSmallestInteger@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1040 <SwapIntegerElements@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1136 <SortIntegerArray+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SortIntegerArray>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %esi,%esi
jle    1161 <SortIntegerArray+0x41>
mov    %esi,%r14d
mov    %rdi,%rbx
lea    -0x1(%r14),%r15d
xor    %ebp,%ebp
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r15d,%edx
call   1030 <FindSmallestInteger@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %eax,%edx
call   1040 <SwapIntegerElements@plt>
add    $0x1,%ebp
cmp    %ebp,%r14d
jne    1140 <SortIntegerArray+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @SortIntegerArray(i32* %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = add nsw i32 %1, -1
br label %6
6: ; preds = %4, %6
%7 = phi i32 [ 0, %4 ], [ %10, %6 ]
%8 = tail call i32 @FindSmallestInteger(i32* %0, i32 %7, i32 %5)
%9 = tail call i32 @SwapIntegerElements(i32* %0, i32 %7, i32 %8)
%10 = add nuw nsw i32 %7, 1
%11 = icmp eq i32 %10, %1
br i1 %11, label %12, label %6
12: ; preds = %6, %2
ret void
}
/* Variables and functions */
int __syscall(int, int, char *, int);
int write(int file, char *ptr, int len) {
  return __syscall(0x23, file, ptr, len);
}


x86 assembly (clang, -O0):
<write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    $0x23,%edi
call   1030 <__syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0x23,%edi
jmp    1030 <__syscall@plt>

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

LLVM IR (-O2):
define i32 @write(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @__syscall(i32 35, i32 %0, i8* %1, i32 %2)
ret i32 %4
}
unsigned xrop3_151_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 = T | S;
  stk4 = ~stk4;
  stk3 = D | stk4;
  stk2 = S ^ stk3;
  stk1 = T ^ stk2;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_151_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    -0x10(%rbp),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x20(%rbp)
mov    -0x8(%rbp),%eax
or     -0x20(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%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_151_1_0>:
mov    %edi,%ecx
shl    $0x8,%ecx
mov    %esi,%eax
shl    $0x8,%eax
lea    (%rsi,%rax,1),%edx
or     %ecx,%eax
or     %edi,%ecx
xor    %ecx,%eax
xor    %edx,%eax
or     %ecx,%eax
not    %eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_151_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* %7
%25 = load i32, i32* %6
%26 = or i32 %24, %25
store i32 %26, i32* %11
%27 = load i32, i32* %11
%28 = xor i32 %27, -1
store i32 %28, i32* %11
%29 = load i32, i32* %5
%30 = load i32, i32* %11
%31 = or i32 %29, %30
store i32 %31, i32* %10
%32 = load i32, i32* %6
%33 = load i32, i32* %10
%34 = xor i32 %32, %33
store i32 %34, i32* %9
%35 = load i32, i32* %7
%36 = load i32, i32* %9
%37 = xor i32 %35, %36
store i32 %37, i32* %8
%38 = load i32, i32* %8
%39 = load i32, i32* %6
%40 = xor i32 %39, -1
%41 = and i32 %38, %40
%42 = load i32, i32* %5
%43 = load i32, i32* %6
%44 = and i32 %42, %43
%45 = or i32 %41, %44
ret i32 %45
}

LLVM IR (-O2):
define i32 @xrop3_151_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = or i32 %4, %3
%6 = zext i8 %1 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = or i32 %7, %6
%9 = or i32 %7, %4
%10 = xor i32 %9, %5
%11 = xor i32 %10, %8
%12 = or i32 %11, %5
%13 = xor i32 %12, -1
%14 = or i32 %13, %3
ret i32 %14
}
unsigned int get_hashcode(const char *key) {
  int c;
  unsigned int hash = 5381;
  while ((c = *key++)) {
    hash = ((hash << 5) + hash) + c;
  }
  return hash;
}


x86 assembly (clang, -O0):
<get_hashcode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1505,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
je     1141 <get_hashcode+0x41>
mov    -0x10(%rbp),%eax
shl    $0x5,%eax
add    -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    110f <get_hashcode+0xf>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_hashcode>:
mov    (%rdi),%cl
test   %cl,%cl
je     1138 <get_hashcode+0x38>
add    $0x1,%rdi
mov    $0x1505,%edx
mov    %edx,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl %cl,%ecx
shl    $0x5,%eax
add    %edx,%eax
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
mov    %eax,%edx
test   %cl,%cl
jne    1120 <get_hashcode+0x20>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i32 @get_hashcode(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 [ %11, %4 ], [ 5381, %1 ]
%7 = phi i8* [ %9, %4 ], [ %0, %1 ]
%8 = sext i8 %5 to i32
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = mul i32 %6, 33
%11 = add i32 %10, %8
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 5381, %1 ], [ %11, %4 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
scalar_t__ pc_JSON_malloc(size_t);
int strlen(char const *);
char *pc_JSON_strdup(const char *str) {
  size_t len;
  char *copy;
  len = strlen(str) + 1;
  if (!(copy = (char *)pc_JSON_malloc(len)))
    return 0;
  memcpy(copy, str, len);
  return copy;
}


x86 assembly (clang, -O0):
<pc_JSON_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <pc_JSON_malloc@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jne    1172 <pc_JSON_strdup+0x42>
movq   $0x0,-0x8(%rbp)
jmp    118b <pc_JSON_strdup+0x5b>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pc_JSON_strdup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
add    $0x1,%eax
movslq %eax,%r15
mov    %r15,%rdi
call   1050 <pc_JSON_malloc@plt>
test   %rax,%rax
je     1163 <pc_JSON_strdup+0x33>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
jmp    1165 <pc_JSON_strdup+0x35>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @pc_JSON_strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @strlen(i8* %6)
%8 = add nsw i32 %7, 1
%9 = sext i32 %8 to i64
store i64 %9, i64* %4
%10 = load i64, i64* %4
%11 = call i64 @pc_JSON_malloc(i64 %10)
%12 = inttoptr i64 %11 to i8*
store i8* %12, i8** %5
%13 = icmp ne i8* %12, null
br i1 %13, label %15, label %14
14: ; preds = %1
store i8* null, i8** %2
br label %21
15: ; preds = %1
%16 = load i8*, i8** %5
%17 = load i8*, i8** %3
%18 = load i64, i64* %4
%19 = call i32 @memcpy(i8* %16, i8* %17, i64 %18)
%20 = load i8*, i8** %5
store i8* %20, i8** %2
br label %21
21: ; preds = %15, %14
%22 = load i8*, i8** %2
ret i8* %22
}

LLVM IR (-O2):
define i8* @pc_JSON_strdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = sext i32 %3 to i64
%5 = tail call i64 @pc_JSON_malloc(i64 %4)
%6 = inttoptr i64 %5 to i8*
%7 = icmp eq i64 %5, 0
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = tail call i32 @memcpy(i8* %6, i8* %0, i64 %4)
br label %10
10: ; preds = %1, %8
%11 = phi i8* [ %6, %8 ], [ null, %1 ]
ret i8* %11
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage:\n"
                  "    nesdump [-d] [-h] <NES ROM file>\n"
                  "\n"
                  "Options:\n"
                  "    -d    Output ROM header information.\n"
                  "    -h    Show this help.\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [122 x i8] c"Usage:\0A nesdump [-d] [-h] <NES ROM file>\0A\0AOptions:\0A -d Output ROM header information.\0A -h Show this help.\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([122 x i8], [122 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [122 x i8] c"Usage:\0A nesdump [-d] [-h] <NES ROM file>\0A\0AOptions:\0A -d Output ROM header information.\0A -h Show this help.\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([122 x i8], [122 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
size_t strnlen(const char *str, int maxLen) {
  size_t ret = 0;
  int len = 0;
  while (str[ret] != 0) {
    ret++;
    if (++len == maxLen)
      break;
  }
  return ret;
}


x86 assembly (clang, -O0):
<strnlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1157 <strnlen+0x57>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
cmp    -0xc(%rbp),%eax
jne    1152 <strnlen+0x52>
jmp    1157 <strnlen+0x57>
jmp    111a <strnlen+0x1a>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strnlen>:
lea    -0x1(%rsi),%ecx
add    $0x1,%rcx
mov    %esi,%edx
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
cmpb   $0x0,(%rdi,%rax,1)
je     1122 <strnlen+0x22>
add    $0x1,%rax
cmp    %rax,%rdx
jne    1110 <strnlen+0x10>
mov    %rcx,%rax
ret

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

LLVM IR (-O2):
define i64 @strnlen(i8* nocapture %0, i32 %1) {
%3 = add i32 %1, -1
%4 = zext i32 %3 to i64
%5 = add nuw nsw i64 %4, 1
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %12, %2
%8 = phi i64 [ 0, %2 ], [ %13, %12 ]
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %15, label %12
12: ; preds = %7
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %15, label %7
15: ; preds = %12, %7
%16 = phi i64 [ %5, %12 ], [ %8, %7 ]
ret i64 %16
}
int ddf_level_to_layout(int level) {
  switch (level) {
  case 0:
  case 1:
    return 0;
  case 5:
    return 2;
  case 6:
    return 10;
  case 10:
    return 0x102;
  default:
    return (0xfffe);
  }
}


x86 assembly (clang, -O0):
<ddf_level_to_layout>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %rax,-0x10(%rbp)
sub    $0xa,%rax
ja     115c <ddf_level_to_layout+0x5c>
mov    -0x10(%rbp),%rax
lea    0xedd(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x0,-0x4(%rbp)
jmp    1163 <ddf_level_to_layout+0x63>
movl   $0x2,-0x4(%rbp)
jmp    1163 <ddf_level_to_layout+0x63>
movl   $0xa,-0x4(%rbp)
jmp    1163 <ddf_level_to_layout+0x63>
movl   $0x102,-0x4(%rbp)
jmp    1163 <ddf_level_to_layout+0x63>
movl   $0xfffe,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ddf_level_to_layout>:
mov    $0xfffe,%eax
cmp    $0xa,%edi
ja     1117 <ddf_level_to_layout+0x17>
movslq %edi,%rax
lea    0xeec(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @ddf_level_to_layout(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %9 [
i32 0, label %5
i32 1, label %5
i32 5, label %6
i32 6, label %7
i32 10, label %8
]
5: ; preds = %1, %1
store i32 0, i32* %2
br label %10
6: ; preds = %1
store i32 2, i32* %2
br label %10
7: ; preds = %1
store i32 10, i32* %2
br label %10
8: ; preds = %1
store i32 258, i32* %2
br label %10
9: ; preds = %1
store i32 65534, i32* %2
br label %10
10: ; preds = %9, %8, %7, %6, %5
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
@switch.table.ddf_level_to_layout = [11 x i32] [i32 0, i32 0, i32 65534, i32 65534, i32 65534, i32 2, i32 10, i32 65534, i32 65534, i32 65534, i32 258]
define i32 @ddf_level_to_layout(i32 %0) {
%2 = icmp ult i32 %0, 11
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = sext i32 %0 to i64
%5 = getelementptr inbounds [11 x i32], [11 x i32]* @switch.table.ddf_level_to_layout, i64 0, i64 %4
%6 = load i32, i32* %5
br label %7
7: ; preds = %1, %3
%8 = phi i32 [ %6, %3 ], [ 65534, %1 ]
ret i32 %8
}