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

/* Variables and functions */
int strncmp(char *, char *, size_t);
int wcsncmp(const wchar_t *s1, const wchar_t *s2, size_t n) {
  return strncmp((char *)s1, (char *)s2, n);
}


x86 assembly (clang, -O0):
<wcsncmp>:
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
mov    -0x18(%rbp),%rdx
call   1030 <strncmp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcsncmp>:
jmp    1030 <strncmp@plt>

LLVM IR (-O0):
define i32 @wcsncmp(i32* %0, i32* %1, i64 %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i64
store i32* %0, i32** %4
store i32* %1, i32** %5
store i64 %2, i64* %6
%7 = load i32*, i32** %4
%8 = bitcast i32* %7 to i8*
%9 = load i32*, i32** %5
%10 = bitcast i32* %9 to i8*
%11 = load i64, i64* %6
%12 = call i32 @strncmp(i8* %8, i8* %10, i64 %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @wcsncmp(i32* nocapture %0, i32* nocapture %1, i64 %2) {
%4 = bitcast i32* %0 to i8*
%5 = bitcast i32* %1 to i8*
%6 = tail call i32 @strncmp(i8* %4, i8* %5, i64 %2)
ret i32 %6
}
/* Variables and functions */
long double truncl(long double);
long double fmodl(long double x, long double y) {
  return x - truncl(x / y) * y;
}


x86 assembly (clang, -O0):
<fmodl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fld    %st(0)
fstpt  -0x2c(%rbp)
fldt   -0x20(%rbp)
fld    %st(0)
fstpt  -0x38(%rbp)
fdivrp %st,%st(1)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <truncl@plt>
fldt   -0x38(%rbp)
fldt   -0x2c(%rbp)
fxch   %st(2)
fmulp  %st,%st(1)
fsubrp %st,%st(1)
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmodl>:
sub    $0x28,%rsp
fldt   0x40(%rsp)
fld    %st(0)
fstpt  0x10(%rsp)
fldt   0x30(%rsp)
fld    %st(0)
fstpt  0x1c(%rsp)
fdivp  %st,%st(1)
fstpt  (%rsp)
call   1030 <truncl@plt>
fldt   0x10(%rsp)
fmulp  %st,%st(1)
fldt   0x1c(%rsp)
fsubp  %st,%st(1)
add    $0x28,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @fmodl(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
store x86_fp80 %1, x86_fp80* %4
%5 = load x86_fp80, x86_fp80* %3
%6 = load x86_fp80, x86_fp80* %3
%7 = load x86_fp80, x86_fp80* %4
%8 = fdiv x86_fp80 %6, %7
%9 = call x86_fp80 @llvm.trunc.f80(x86_fp80 %8)
%10 = load x86_fp80, x86_fp80* %4
%11 = fneg x86_fp80 %9
%12 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %11, x86_fp80 %10, x86_fp80 %5)
ret x86_fp80 %12
}

LLVM IR (-O2):
define x86_fp80 @fmodl(x86_fp80 %0, x86_fp80 %1) {
%3 = fdiv x86_fp80 %0, %1
%4 = tail call x86_fp80 @llvm.trunc.f80(x86_fp80 %3)
%5 = fneg x86_fp80 %4
%6 = tail call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %5, x86_fp80 %1, x86_fp80 %0)
ret x86_fp80 %6
}
unsigned long ffz(unsigned long value) {
  __asm__("bsf %1, %0" : "=r"(value) : "r"(~value) : "cc");
  return value;
}


x86 assembly (clang, -O0):
<ffz>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
xor    $0xffffffffffffffff,%rax
bsf    %rax,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ffz>:
not    %rdi
bsf    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @ffz(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = xor i64 %3, -1
%5 = call i64 asm "bsf $1, $0", "=r,r,~{cc},~{dirflag},~{fpsr},~{flags}"(i64 %4)
store i64 %5, i64* %2
%6 = load i64, i64* %2
ret i64 %6
}

LLVM IR (-O2):
define i64 @ffz(i64 %0) {
%2 = xor i64 %0, -1
%3 = tail call i64 asm "bsf $1, $0", "=r,r,~{cc},~{dirflag},~{fpsr},~{flags}"(i64 %2)
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ die(char *, void *, size_t);
void *realloc(void *, size_t);
void *urealloc(void *p, size_t s) {
  void *n = realloc(p, s);
  if (!n)
    die("realloc(%p, %ld)", p, s);
  return n;
}


x86 assembly (clang, -O0):
<urealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1160 <urealloc+0x40>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xea5(%rip),%rdi
call   1040 <die@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<urealloc>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
call   1030 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    114a <urealloc+0x2a>
lea    0xec1(%rip),%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1040 <die@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [17 x i8] c"realloc(%p, %ld)\00"
define i8* @urealloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %15, label %11
11: ; preds = %2
%12 = load i8*, i8** %3
%13 = load i64, i64* %4
%14 = call i32 @die(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %12, i64 %13)
br label %15
15: ; preds = %11, %2
%16 = load i8*, i8** %5
ret i8* %16
}

LLVM IR (-O2):
@.str = [17 x i8] c"realloc(%p, %ld)\00"
define noalias i8* @urealloc(i8* %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @die(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %0, i64 %1)
br label %7
7: ; preds = %5, %2
ret i8* %3
}
/* Type definitions */
struct symbol {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ do_debug_symbol(struct symbol *, int /*<<< orphan*/);
void debug_symbol(struct symbol *sym) { do_debug_symbol(sym, 0); }


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

x86 assembly (clang, -O2):
<debug_symbol>:
xor    %esi,%esi
jmp    1030 <do_debug_symbol@plt>

LLVM IR (-O0):
%struct.symbol = type { i32 }
define void @debug_symbol(%struct.symbol* %0) {
%2 = alloca %struct.symbol*
store %struct.symbol* %0, %struct.symbol** %2
%3 = load %struct.symbol*, %struct.symbol** %2
%4 = call i32 @do_debug_symbol(%struct.symbol* %3, i32 0)
ret void
}

LLVM IR (-O2):
%struct.symbol = type { i32 }
define void @debug_symbol(%struct.symbol* %0) {
%2 = tail call i32 @do_debug_symbol(%struct.symbol* %0, i32 0)
ret void
}
int raptor_sink_iostream_read_eof(void *user_data) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @raptor_sink_iostream_read_eof(i8* nocapture readnone %0) {
ret i32 1
}
/* Variables and functions */
int rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int generaterandomfunc(int n) {
  srand(time(NULL));
  return rand() % n;
}


x86 assembly (clang, -O0):
<generaterandomfunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
mov    $0x0,%al
call   1050 <rand@plt>
cltd
idivl  -0x4(%rbp)
mov    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generaterandomfunc>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
cltd
idiv   %ebx
mov    %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @generaterandomfunc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @time(i32* null)
%4 = call i32 @srand(i32 %3)
%5 = call i32 (...) @rand()
%6 = load i32, i32* %2
%7 = srem i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @generaterandomfunc(i32 %0) {
%2 = tail call i32 @time(i32* null)
%3 = tail call i32 @srand(i32 %2)
%4 = tail call i32 (...) @rand()
%5 = srem i32 %4, %0
ret i32 %5
}
void pgCloseModule(void) {}


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

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

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

LLVM IR (-O2):
define void @pgCloseModule() {
ret void
}
int round_to_int(double d) { return d > 0.0 ? d + 0.5 : d - 0.5; }


x86 assembly (clang, -O0):
<round_to_int>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1132 <round_to_int+0x32>
movsd  0xedd(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1148 <round_to_int+0x48>
movsd  -0x8(%rbp),%xmm0
movsd  0xec1(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
cvttsd2si %xmm0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<round_to_int>:
xorpd  %xmm1,%xmm1
xor    %eax,%eax
ucomisd %xmm1,%xmm0
seta   %al
lea    0xeec(%rip),%rcx
addsd  (%rcx,%rax,8),%xmm0
cvttsd2si %xmm0,%eax
ret

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

LLVM IR (-O2):
define i32 @round_to_int(double %0) {
%2 = fcmp ogt double %0, 0.000000e+00
%3 = select i1 %2, double 5.000000e-01, double -5.000000e-01
%4 = fadd double %3, %0
%5 = fptosi double %4 to i32
ret i32 %5
}
int updateGap(int gap) {
  gap = (gap * 10) / 13;
  return (gap < 1 ? 1 : gap);
}


x86 assembly (clang, -O0):
<updateGap>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0xa,-0x4(%rbp),%eax
mov    $0xd,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jge    112d <updateGap+0x2d>
mov    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1133 <updateGap+0x33>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<updateGap>:
add    %edi,%edi
lea    (%rdi,%rdi,4),%eax
cltq
imul   $0x4ec4ec4f,%rax,%rcx
mov    %rcx,%rax
shr    $0x3f,%rax
sar    $0x22,%rcx
add    %eax,%ecx
test   %ecx,%ecx
mov    $0x1,%eax
cmovg  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @updateGap(i32 %0) {
%2 = mul nsw i32 %0, 10
%3 = sdiv i32 %2, 13
%4 = icmp sgt i32 %3, 1
%5 = select i1 %4, i32 %3, i32 1
ret i32 %5
}
/* Variables and functions */
void *malloc(size_t);
void *tlib_malloc(size_t size) { return malloc(size); }


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

x86 assembly (clang, -O2):
<tlib_malloc>:
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @tlib_malloc(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i8* @malloc(i64 %3)
ret i8* %4
}

LLVM IR (-O2):
define noalias i8* @tlib_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
/* Type definitions */
struct if_nameindex {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct if_nameindex *);
void if_freenameindex(struct if_nameindex *ptr) { free(ptr); }


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

x86 assembly (clang, -O2):
<if_freenameindex>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.if_nameindex = type { i32 }
define void @if_freenameindex(%struct.if_nameindex* %0) {
%2 = alloca %struct.if_nameindex*
store %struct.if_nameindex* %0, %struct.if_nameindex** %2
%3 = load %struct.if_nameindex*, %struct.if_nameindex** %2
%4 = call i32 @free(%struct.if_nameindex* %3)
ret void
}

LLVM IR (-O2):
%struct.if_nameindex = type { i32 }
define void @if_freenameindex(%struct.if_nameindex* nocapture %0) {
%2 = tail call i32 @free(%struct.if_nameindex* %0)
ret void
}
/* Type definitions */
struct sockaddr_in6 {
  int dummy;
};
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ ssize_t;
typedef int /*<<< orphan*/ socklen_t;

/* Variables and functions */
int /*<<< orphan*/ sendto_schedule2(int, void const *, size_t, int,
                                    struct sockaddr const *, int /*<<< orphan*/,
                                    struct sockaddr_in6 const *,
                                    int /*<<< orphan*/);
ssize_t sendto_or_schedule2(int sockfd, const void *buf, size_t len, int flags,
                            const struct sockaddr *dest_addr, socklen_t addrlen,
                            const struct sockaddr_in6 *src_addr) {
  return sendto_schedule2(sockfd, buf, len, flags, dest_addr, addrlen, src_addr,
                          0);
}


x86 assembly (clang, -O0):
<sendto_or_schedule2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x28(%rbp),%r8
mov    -0x2c(%rbp),%r9d
mov    0x10(%rbp),%rax
xor    %r10d,%r10d
mov    %rax,(%rsp)
movl   $0x0,0x8(%rsp)
call   1030 <sendto_schedule2@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sendto_or_schedule2>:
push   %rax
push   $0x0
push   0x18(%rsp)
call   1030 <sendto_schedule2@plt>
add    $0x10,%rsp
pop    %rcx
ret

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
%struct.sockaddr_in6 = type { i32 }
define i32 @sendto_or_schedule2(i32 %0, i8* %1, i64 %2, i32 %3, %struct.sockaddr* %4, i32 %5, %struct.sockaddr_in6* %6) {
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i64
%11 = alloca i32
%12 = alloca %struct.sockaddr*
%13 = alloca i32
%14 = alloca %struct.sockaddr_in6*
store i32 %0, i32* %8
store i8* %1, i8** %9
store i64 %2, i64* %10
store i32 %3, i32* %11
store %struct.sockaddr* %4, %struct.sockaddr** %12
store i32 %5, i32* %13
store %struct.sockaddr_in6* %6, %struct.sockaddr_in6** %14
%15 = load i32, i32* %8
%16 = load i8*, i8** %9
%17 = load i64, i64* %10
%18 = load i32, i32* %11
%19 = load %struct.sockaddr*, %struct.sockaddr** %12
%20 = load i32, i32* %13
%21 = load %struct.sockaddr_in6*, %struct.sockaddr_in6** %14
%22 = call i32 @sendto_schedule2(i32 %15, i8* %16, i64 %17, i32 %18, %struct.sockaddr* %19, i32 %20, %struct.sockaddr_in6* %21, i32 0)
ret i32 %22
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
%struct.sockaddr_in6 = type { i32 }
define i32 @sendto_or_schedule2(i32 %0, i8* %1, i64 %2, i32 %3, %struct.sockaddr* %4, i32 %5, %struct.sockaddr_in6* %6) {
%8 = tail call i32 @sendto_schedule2(i32 %0, i8* %1, i64 %2, i32 %3, %struct.sockaddr* %4, i32 %5, %struct.sockaddr_in6* %6, i32 0)
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void main_fini2(void) {
  printf("main_fini2"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [11 x i8] c"main_fini2\00"
define void @main_fini2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
ret void
}
double nop(double x) { return (x = 1.0); }


x86 assembly (clang, -O0):
<nop>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  0xee2(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<nop>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @nop(double %0) {
%2 = alloca double
store double %0, double* %2
store double 1.000000e+00, double* %2
ret double 1.000000e+00
}

LLVM IR (-O2):
define double @nop(double %0) {
ret double 1.000000e+00
}
void _Z9shsUpdateP8SHS_INFOPhi(void) {}


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

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

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

LLVM IR (-O2):
define void @_Z9shsUpdateP8SHS_INFOPhi() {
ret void
}
int eraVersionMicro() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @eraVersionMicro() {
ret i32 0
}
int PB_Cfirstnb(int N, int I, int INB, int NB) {
  int inbt;
  inbt = ((INB -= I) <= 0 ? ((-INB) / NB + 1) * NB + INB : INB);
  return ((((inbt) < (N)) ? (inbt) : (N)));
}


x86 assembly (clang, -O0):
<PB_Cfirstnb>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0xc(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
jg     113f <PB_Cfirstnb+0x3f>
xor    %eax,%eax
sub    -0xc(%rbp),%eax
cltd
idivl  -0x10(%rbp)
add    $0x1,%eax
imul   -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    1145 <PB_Cfirstnb+0x45>
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1162 <PB_Cfirstnb+0x62>
mov    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
jmp    1168 <PB_Cfirstnb+0x68>
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<PB_Cfirstnb>:
mov    %edx,%r8d
sub    %esi,%r8d
jg     111b <PB_Cfirstnb+0x1b>
mov    %r8d,%eax
cltd
idiv   %ecx
mov    $0x1,%edx
sub    %eax,%edx
imul   %ecx,%edx
add    %edx,%r8d
cmp    %edi,%r8d
cmovl  %r8d,%edi
mov    %edi,%eax
ret

LLVM IR (-O0):
define i32 @PB_Cfirstnb(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = sub nsw i32 %11, %10
store i32 %12, i32* %7
%13 = icmp sle i32 %12, 0
br i1 %13, label %14, label %24
14: ; preds = %4
%15 = load i32, i32* %7
%16 = sub nsw i32 0, %15
%17 = load i32, i32* %8
%18 = sdiv i32 %16, %17
%19 = add nsw i32 %18, 1
%20 = load i32, i32* %8
%21 = mul nsw i32 %19, %20
%22 = load i32, i32* %7
%23 = add nsw i32 %21, %22
br label %26
24: ; preds = %4
%25 = load i32, i32* %7
br label %26
26: ; preds = %24, %14
%27 = phi i32 [ %23, %14 ], [ %25, %24 ]
store i32 %27, i32* %9
%28 = load i32, i32* %9
%29 = load i32, i32* %5
%30 = icmp slt i32 %28, %29
br i1 %30, label %31, label %33
31: ; preds = %26
%32 = load i32, i32* %9
br label %35
33: ; preds = %26
%34 = load i32, i32* %5
br label %35
35: ; preds = %33, %31
%36 = phi i32 [ %32, %31 ], [ %34, %33 ]
ret i32 %36
}

LLVM IR (-O2):
define i32 @PB_Cfirstnb(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = sub nsw i32 %2, %1
%6 = icmp slt i32 %5, 1
br i1 %6, label %7, label %12
7: ; preds = %4
%8 = sdiv i32 %5, %3
%9 = sub i32 1, %8
%10 = mul nsw i32 %9, %3
%11 = add nsw i32 %10, %5
br label %12
12: ; preds = %4, %7
%13 = phi i32 [ %11, %7 ], [ %5, %4 ]
%14 = icmp slt i32 %13, %0
%15 = select i1 %14, i32 %13, i32 %0
ret i32 %15
}
void v9fs_cache_inode_set_cookie(struct inode *inode, struct file *file) {}


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

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

LLVM IR (-O0):
%struct.inode = type opaque
%struct.file = type opaque
define void @v9fs_cache_inode_set_cookie(%struct.inode* %0, %struct.file* %1) {
%3 = alloca %struct.inode*
%4 = alloca %struct.file*
store %struct.inode* %0, %struct.inode** %3
store %struct.file* %1, %struct.file** %4
ret void
}

LLVM IR (-O2):
%struct.inode = type opaque
%struct.file = type opaque
define void @v9fs_cache_inode_set_cookie(%struct.inode* nocapture %0, %struct.file* nocapture %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ fd_set;

/* Variables and functions */
int FD_ISSET(int, int /*<<< orphan*/ *);
int ME_fd_isset(int fd, fd_set *fds) { return FD_ISSET(fd, fds); }


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

x86 assembly (clang, -O2):
<ME_fd_isset>:
jmp    1030 <FD_ISSET@plt>

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

LLVM IR (-O2):
define i32 @ME_fd_isset(i32 %0, i32* %1) {
%3 = tail call i32 @FD_ISSET(i32 %0, i32* %1)
ret i32 %3
}
void nullify(int *x) { *x = 0; }


x86 assembly (clang, -O0):
<nullify>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<nullify>:
movl   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @nullify(i32* nocapture writeonly %0) {
store i32 0, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CyPmHibernateEx(int);
void CyPmHibernate(void) { CyPmHibernateEx((0x0040u)); }


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

x86 assembly (clang, -O2):
<CyPmHibernate>:
mov    $0x40,%edi
jmp    1030 <CyPmHibernateEx@plt>

LLVM IR (-O0):
define void @CyPmHibernate() {
%1 = call i32 @CyPmHibernateEx(i32 64)
ret void
}

LLVM IR (-O2):
define void @CyPmHibernate() {
%1 = tail call i32 @CyPmHibernateEx(i32 64)
ret void
}
int XMinCmapsOfScreen() {}


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

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

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

LLVM IR (-O2):
define i32 @XMinCmapsOfScreen() {
ret i32 undef
}
/* Variables and functions */
int bar();
void foo(void) {
  int a, b, c;
  if (a = bar()) {
  } else {
  }
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <bar@plt>
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
je     1130 <foo+0x20>
jmp    1135 <foo+0x25>
jmp    1135 <foo+0x25>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @foo() {
%1 = tail call i32 (...) @bar()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
struct sockaddr_storage {
  scalar_t__ ss_family;
};
struct sockaddr_in6 {
  int dummy;
};
struct sockaddr_in {
  int dummy;
};
struct sockaddr {
  int dummy;
};

/* Variables and functions */
scalar_t__ PF_INET;
int /*<<< orphan*/ sendto(int, int /*<<< orphan*/ *, size_t, int /*<<< orphan*/,
                          struct sockaddr *, int);
void dns_send_reply(uint8_t *buffer, size_t len, int fd,
                    struct sockaddr_storage *addr) {
  sendto(fd, buffer, len, 0, (struct sockaddr *)addr,
         addr->ss_family == PF_INET ? sizeof(struct sockaddr_in)
                                    : sizeof(struct sockaddr_in6));
}


x86 assembly (clang, -O0):
<dns_send_reply>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%r8
mov    -0x20(%rbp),%rax
mov    (%rax),%rcx
mov    0x2e9c(%rip),%rax
mov    (%rax),%r9
mov    $0x4,%eax
cmp    %r9,%rcx
cmove  %rax,%rax
mov    %eax,%r9d
xor    %ecx,%ecx
call   1030 <sendto@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dns_send_reply>:
mov    %rcx,%r8
mov    %edx,%eax
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    %eax,%edi
xor    %ecx,%ecx
mov    $0x4,%r9d
jmp    1030 <sendto@plt>

LLVM IR (-O0):
%struct.sockaddr_storage = type { i64 }
%struct.sockaddr = type { i32 }
@PF_INET = global i64 0
define void @dns_send_reply(i32* %0, i64 %1, i32 %2, %struct.sockaddr_storage* %3) {
%5 = alloca i32*
%6 = alloca i64
%7 = alloca i32
%8 = alloca %struct.sockaddr_storage*
store i32* %0, i32** %5
store i64 %1, i64* %6
store i32 %2, i32* %7
store %struct.sockaddr_storage* %3, %struct.sockaddr_storage** %8
%9 = load i32, i32* %7
%10 = load i32*, i32** %5
%11 = load i64, i64* %6
%12 = load %struct.sockaddr_storage*, %struct.sockaddr_storage** %8
%13 = bitcast %struct.sockaddr_storage* %12 to %struct.sockaddr*
%14 = load %struct.sockaddr_storage*, %struct.sockaddr_storage** %8
%15 = getelementptr inbounds %struct.sockaddr_storage, %struct.sockaddr_storage* %14, i32 0, i32 0
%16 = load i64, i64* %15
%17 = load i64, i64* @PF_INET
%18 = icmp eq i64 %16, %17
%19 = zext i1 %18 to i64
%20 = select i1 %18, i64 4, i64 4
%21 = trunc i64 %20 to i32
%22 = call i32 @sendto(i32 %9, i32* %10, i64 %11, i32 0, %struct.sockaddr* %13, i32 %21)
ret void
}

LLVM IR (-O2):
%struct.sockaddr_storage = type { i64 }
%struct.sockaddr = type { i32 }
@PF_INET = global i64 0
define void @dns_send_reply(i32* %0, i64 %1, i32 %2, %struct.sockaddr_storage* %3) {
%5 = bitcast %struct.sockaddr_storage* %3 to %struct.sockaddr*
%6 = tail call i32 @sendto(i32 %2, i32* %0, i64 %1, i32 0, %struct.sockaddr* %5, i32 4)
ret void
}
int test_imm_99int8_mem(signed char *val) {
  return ((*val) & (-0x99 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_99int8_mem>:
movsbl (%rdi),%eax
test   $0xffffff67,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_99int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = and i32 %3, -153
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 -40, i32 -20
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
struct zbuf {
  int dummy;
};

/* Variables and functions */
scalar_t__ __zbuf_pull(struct zbuf *, int, int);
uint8_t zbuf_get8(struct zbuf *zb) {
  uint8_t *src = ((uint8_t *)__zbuf_pull(zb, sizeof(uint8_t), 1));
  if (src)
    return *src;
  return 0;
}


x86 assembly (clang, -O0):
<zbuf_get8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <__zbuf_pull@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     114c <zbuf_get8+0x3c>
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1153 <zbuf_get8+0x43>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zbuf_get8>:
push   %rax
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <__zbuf_pull@plt>
test   %rax,%rax
je     1129 <zbuf_get8+0x19>
mov    (%rax),%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.zbuf = type { i32 }
define i32 @zbuf_get8(%struct.zbuf* %0) {
%2 = alloca i32
%3 = alloca %struct.zbuf*
%4 = alloca i32*
store %struct.zbuf* %0, %struct.zbuf** %3
%5 = load %struct.zbuf*, %struct.zbuf** %3
%6 = call i64 @__zbuf_pull(%struct.zbuf* %5, i32 4, i32 1)
%7 = inttoptr i64 %6 to i32*
store i32* %7, i32** %4
%8 = load i32*, i32** %4
%9 = icmp ne i32* %8, null
br i1 %9, label %10, label %13
10: ; preds = %1
%11 = load i32*, i32** %4
%12 = load i32, i32* %11
store i32 %12, i32* %2
br label %14
13: ; preds = %1
store i32 0, i32* %2
br label %14
14: ; preds = %13, %10
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
%struct.zbuf = type { i32 }
define i32 @zbuf_get8(%struct.zbuf* %0) {
%2 = tail call i64 @__zbuf_pull(%struct.zbuf* %0, i32 4, i32 1)
%3 = icmp eq i64 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = inttoptr i64 %2 to i32*
%6 = load i32, i32* %5
br label %7
7: ; preds = %1, %4
%8 = phi i32 [ %6, %4 ], [ 0, %1 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ mpn_gcdext(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                              int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                              int /*<<< orphan*/, int /*<<< orphan*/ *,
                              int /*<<< orphan*/);
void f(void) { mpn_gcdext(NULL, NULL, NULL, NULL, 0, NULL, 0); }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
mov    %eax,%r9d
xor    %r8d,%r8d
mov    %r9,%rdi
mov    %r9,%rsi
mov    %r9,%rdx
mov    %r9,%rcx
movl   $0x0,(%rsp)
call   1030 <mpn_gcdext@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rax
movl   $0x0,(%rsp)
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <mpn_gcdext@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @f() {
%1 = call i32 @mpn_gcdext(i32* null, i32* null, i32* null, i32* null, i32 0, i32* null, i32 0)
ret void
}

LLVM IR (-O2):
define void @f() {
%1 = tail call i32 @mpn_gcdext(i32* null, i32* null, i32* null, i32* null, i32 0, i32* null, i32 0)
ret void
}
void machtime_stream(s, sep) int s;
struct servtab *sep;
{
  long result;
  result = machtime();
  (void)write(s, (char *)&result, sizeof(result));
}


x86 assembly (clang, -O0):
<machtime_stream>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <machtime@plt>
cltq
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x18(%rbp),%rsi
mov    $0x8,%edx
mov    $0x0,%al
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<machtime_stream>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <machtime@plt>
cltq
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rsi
mov    $0x8,%edx
mov    %ebx,%edi
xor    %eax,%eax
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.servtab = type opaque
define void @machtime_stream(i32 %0, %struct.servtab* %1) {
%3 = alloca i32
%4 = alloca %struct.servtab*
%5 = alloca i64
store i32 %0, i32* %3
store %struct.servtab* %1, %struct.servtab** %4
%6 = call i32 (...) @machtime()
%7 = sext i32 %6 to i64
store i64 %7, i64* %5
%8 = load i32, i32* %3
%9 = bitcast i64* %5 to i8*
%10 = call i32 (i32, i8*, i64, ...) bitcast (i32 (...)* @write to i32 (i32, i8*, i64, ...)*)(i32 %8, i8* %9, i64 8)
ret void
}

LLVM IR (-O2):
%struct.servtab = type opaque
define void @machtime_stream(i32 %0, %struct.servtab* nocapture readnone %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to i8*
%5 = tail call i32 (...) @machtime()
%6 = sext i32 %5 to i64
store i64 %6, i64* %3
%7 = call i32 (i32, i8*, i64, ...) bitcast (i32 (...)* @write to i32 (i32, i8*, i64, ...)*)(i32 %0, i8* %4, i64 8)
ret void
}
/* Type definitions */
typedef scalar_t__ wchar_t;

/* Variables and functions */
scalar_t__ smalloc(int);
int /*<<< orphan*/ ustrcpy(scalar_t__ *, scalar_t__ *);
int ustrlen(scalar_t__ *);
wchar_t *ustrdup(wchar_t *s) {
  wchar_t *r;
  if (s) {
    r = ((wchar_t *)smalloc((1 + ustrlen(s)) * sizeof(wchar_t)));
    ustrcpy(r, s);
  } else {
    r = ((wchar_t *)smalloc(sizeof(wchar_t)));
    *r = 0;
  }
  return r;
}


x86 assembly (clang, -O0):
<ustrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1176 <ustrdup+0x46>
mov    -0x8(%rbp),%rdi
call   1040 <ustrlen@plt>
add    $0x1,%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1050 <smalloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <ustrcpy@plt>
jmp    118f <ustrdup+0x5f>
mov    $0x8,%edi
call   1050 <smalloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movq   $0x0,(%rax)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ustrdup>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     115d <ustrdup+0x2d>
mov    %rdi,%r14
call   1040 <ustrlen@plt>
lea    0x8(,%rax,8),%edi
call   1050 <smalloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <ustrcpy@plt>
jmp    1171 <ustrdup+0x41>
mov    $0x8,%edi
call   1050 <smalloc@plt>
mov    %rax,%rbx
movq   $0x0,(%rax)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i64* @ustrdup(i64* %0) {
%2 = icmp eq i64* %0, null
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = tail call i32 @ustrlen(i64* %0)
%5 = shl i32 %4, 3
%6 = add i32 %5, 8
%7 = tail call i64 @smalloc(i32 %6)
%8 = inttoptr i64 %7 to i64*
%9 = tail call i32 @ustrcpy(i64* %8, i64* %0)
br label %13
10: ; preds = %1
%11 = tail call i64 @smalloc(i32 8)
%12 = inttoptr i64 %11 to i64*
store i64 0, i64* %12
br label %13
13: ; preds = %10, %3
%14 = phi i64* [ %8, %3 ], [ %12, %10 ]
ret i64* %14
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("Usage: ttoyctl <command> <args>\n"
         "\n"
         "Where <command> is one of:\n"
         "\thelp       Show help for a command\n"
         "\ttitle      Set the window title\n"
         "\tbg         Set the background\n");
}


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

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

LLVM IR (-O0):
@.str = [161 x i8] c"Usage: ttoyctl <command> <args>\0A\0AWhere <command> is one of:\0A\09help Show help for a command\0A\09title Set the window title\0A\09bg Set the background\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([161 x i8], [161 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [160 x i8] c"Usage: ttoyctl <command> <args>\0A\0AWhere <command> is one of:\0A\09help Show help for a command\0A\09title Set the window title\0A\09bg Set the background\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([160 x i8], [160 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ vx86_NBSB_Write8(int /*<<< orphan*/, unsigned char,
                                    unsigned char);
void nb_Write8(unsigned char offset, unsigned char val) {
  vx86_NBSB_Write8(0, offset, val);
}


x86 assembly (clang, -O0):
<nb_Write8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    -0x1(%rbp),%al
xor    %edi,%edi
movzbl %al,%esi
movzbl -0x2(%rbp),%edx
call   1030 <vx86_NBSB_Write8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nb_Write8>:
mov    %esi,%edx
mov    %edi,%esi
xor    %edi,%edi
jmp    1030 <vx86_NBSB_Write8@plt>

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

LLVM IR (-O2):
define void @nb_Write8(i8 zeroext %0, i8 zeroext %1) {
%3 = tail call i32 @vx86_NBSB_Write8(i32 0, i8 zeroext %0, i8 zeroext %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void test_log_fn(int level, const char *file, int line, const char *format) {
  if (level != 4)
    return;
  printf("%s\n", format);
  return;
}


x86 assembly (clang, -O0):
<test_log_fn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
cmpl   $0x4,-0x4(%rbp)
je     1135 <test_log_fn+0x25>
jmp    1145 <test_log_fn+0x35>
mov    -0x20(%rbp),%rsi
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_log_fn>:
cmp    $0x4,%edi
jne    1124 <test_log_fn+0x14>
lea    0xee4(%rip),%rdi
mov    %rcx,%rsi
jmp    1030 <printf@plt>
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @test_log_fn(i32 %0, i8* nocapture readnone %1, i32 %2, i8* %3) {
%5 = icmp eq i32 %0, 4
br i1 %5, label %6, label %8
6: ; preds = %4
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
br label %8
8: ; preds = %4, %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int foo();
int main(void) {
  int res = foo();
  if (res != 925)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <foo@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x39d,-0x8(%rbp)
je     114d <main+0x2d>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <foo@plt>
cmp    $0x39d,%eax
jne    1133 <main+0x13>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @foo()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 925
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @foo()
%2 = icmp eq i32 %1, 925
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int special_permutation(int, int);
int main() {
  int number, k;
  scanf("%d", &number);
  scanf("%d", &k);
  int special = special_permutation(number, k);
  printf("The number of special permutations is %d", special);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee7(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xed7(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <special_permutation@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xe90(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xeea(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
call   1040 <special_permutation@plt>
lea    0xe96(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [41 x i8] c"The number of special permutations is %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = call i32 @special_permutation(i32 %6, i32 %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0), i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [41 x i8] c"The number of special permutations is %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = call i32 @special_permutation(i32 %7, i32 %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0), i32 %9)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void generateSystem() {
  printf("\nNOT IMPLEMENTED, YET\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@.str = [23 x i8] c"\0ANOT IMPLEMENTED, YET\0A\00"
define void @generateSystem() {
%1 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [22 x i8] c"\0ANOT IMPLEMENTED, YET\00"
define void @generateSystem() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int findEmptyIndex(int *);
char *test_findEmptyIndex() {
  static int grid[81] = {1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
  do {
    if (!(findEmptyIndex(grid) == 2))
      return "e: test_findEmptyIndex";
  } while (0);
  return 0;
}


x86 assembly (clang, -O0):
<test_findEmptyIndex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0x2f11(%rip),%rdi
call   1030 <findEmptyIndex@plt>
cmp    $0x2,%eax
je     113d <test_findEmptyIndex+0x2d>
lea    0xecc(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    114a <test_findEmptyIndex+0x3a>
jmp    1142 <test_findEmptyIndex+0x32>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_findEmptyIndex>:
push   %rax
lea    0x2f18(%rip),%rdi
call   1030 <findEmptyIndex@plt>
xor    %ecx,%ecx
cmp    $0x2,%eax
lea    0xed7(%rip),%rax
cmovne %rax,%rcx
mov    %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@test_findEmptyIndex.grid = internal global <{ i32, i32, [79 x i32] }> <{ i32 1, i32 2, [79 x i32] zeroinitializer }>
@.str = [23 x i8] c"e: test_findEmptyIndex\00"
define i8* @test_findEmptyIndex() {
%1 = alloca i8*
br label %2
2: ; preds = %0
%3 = call i32 @findEmptyIndex(i32* getelementptr inbounds ([81 x i32], [81 x i32]* bitcast (<{ i32, i32, [79 x i32] }>* @test_findEmptyIndex.grid to [81 x i32]*), i64 0, i64 0))
%4 = icmp eq i32 %3, 2
br i1 %4, label %6, label %5
5: ; preds = %2
store i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8** %1
br label %8
6: ; preds = %2
br label %7
7: ; preds = %6
store i8* null, i8** %1
br label %8
8: ; preds = %7, %5
%9 = load i8*, i8** %1
ret i8* %9
}

LLVM IR (-O2):
@test_findEmptyIndex.grid = internal global <{ i32, i32, [79 x i32] }> <{ i32 1, i32 2, [79 x i32] zeroinitializer }>
@.str = [23 x i8] c"e: test_findEmptyIndex\00"
define i8* @test_findEmptyIndex() {
%1 = tail call i32 @findEmptyIndex(i32* getelementptr inbounds (<{ i32, i32, [79 x i32] }>, <{ i32, i32, [79 x i32] }>* @test_findEmptyIndex.grid, i64 0, i32 0))
%2 = icmp eq i32 %1, 2
%3 = select i1 %2, i8* null, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ crypto_scalarmult_nistp256(unsigned char *, unsigned char *,
                                              unsigned char *);
int /*<<< orphan*/ memcpy(unsigned char *, unsigned char *, int);
void crypto_box_nistp256aes256gcm_beforenm(unsigned char *k, unsigned char *pk,
                                           unsigned char *sk) {
  unsigned char temp[64];
  crypto_scalarmult_nistp256(temp, sk, pk);
  memcpy(k, temp, 32);
}


x86 assembly (clang, -O0):
<crypto_box_nistp256aes256gcm_beforenm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x60(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <crypto_scalarmult_nistp256@plt>
mov    -0x8(%rbp),%rdi
lea    -0x60(%rbp),%rsi
mov    $0x20,%edx
call   1030 <memcpy@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crypto_box_nistp256aes256gcm_beforenm>:
push   %r14
push   %rbx
sub    $0x48,%rsp
mov    %rsi,%rax
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %r14,%rdi
mov    %rdx,%rsi
mov    %rax,%rdx
call   1040 <crypto_scalarmult_nistp256@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x20,%edx
call   1030 <memcpy@plt>
add    $0x48,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @crypto_box_nistp256aes256gcm_beforenm(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca [64 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = getelementptr inbounds [64 x i8], [64 x i8]* %7, i64 0, i64 0
%9 = load i8*, i8** %6
%10 = load i8*, i8** %5
%11 = call i32 @crypto_scalarmult_nistp256(i8* %8, i8* %9, i8* %10)
%12 = load i8*, i8** %4
%13 = getelementptr inbounds [64 x i8], [64 x i8]* %7, i64 0, i64 0
%14 = call i32 @memcpy(i8* %12, i8* %13, i32 32)
ret void
}

LLVM IR (-O2):
define void @crypto_box_nistp256aes256gcm_beforenm(i8* %0, i8* %1, i8* %2) {
%4 = alloca [64 x i8]
%5 = getelementptr inbounds [64 x i8], [64 x i8]* %4, i64 0, i64 0
%6 = call i32 @crypto_scalarmult_nistp256(i8* %5, i8* %2, i8* %1)
%7 = call i32 @memcpy(i8* %0, i8* %5, i32 32)
ret void
}