#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scrypt_N_1_1_256_sp_generic(char const *, char *, char *,
                                               unsigned char);
void scrypt_N_1_1_256(const char *input, char *output, unsigned char Nfactor) {
  int scratchpadsize = ((1 << (Nfactor + 1)) * 128) + 63;
  char scratchpad[scratchpadsize];
  printf("scrypt_N_1_1_256              0\n");
  scrypt_N_1_1_256_sp_generic(input, output, scratchpad, Nfactor);
  printf("scrypt_N_1_1_256              1\n");
}


x86 assembly (clang, -O0):
<scrypt_N_1_1_256>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%cl
add    $0x1,%cl
mov    $0x1,%eax
shl    %cl,%eax
shl    $0x7,%eax
or     $0x3f,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x20(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x30(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x28(%rbp)
lea    0xe88(%rip),%rdi
call   1040 <printf@plt>
mov    -0x30(%rbp),%rdx
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movzbl -0x11(%rbp),%ecx
call   1030 <scrypt_N_1_1_256_sp_generic@plt>
lea    0xe88(%rip),%rdi
call   1040 <printf@plt>
mov    -0x20(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scrypt_N_1_1_256>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %edx,%r12d
mov    %rsi,%r14
mov    %rdi,%r15
mov    $0x100,%eax
mov    %r12d,%ecx
shl    %cl,%eax
or     $0x40,%eax
mov    %rsp,%rbx
sub    %rax,%rbx
mov    %rbx,%rsp
lea    0xeaf(%rip),%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
mov    %r12d,%ecx
call   1040 <scrypt_N_1_1_256_sp_generic@plt>
lea    0xeb2(%rip),%rdi
call   1030 <puts@plt>
lea    -0x20(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [33 x i8] c"scrypt_N_1_1_256 0\0A\00"
@.str.1 = [33 x i8] c"scrypt_N_1_1_256 1\0A\00"
define void @scrypt_N_1_1_256(i8* %0, i8* %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8 %2, i8* %6
%10 = load i8, i8* %6
%11 = zext i8 %10 to i32
%12 = add nsw i32 %11, 1
%13 = shl i32 1, %12
%14 = mul nsw i32 %13, 128
%15 = add nsw i32 %14, 63
store i32 %15, i32* %7
%16 = load i32, i32* %7
%17 = zext i32 %16 to i64
%18 = call i8* @llvm.stacksave()
store i8* %18, i8** %8
%19 = alloca i8, i64 %17
store i64 %17, i64* %9
%20 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%21 = load i8*, i8** %4
%22 = load i8*, i8** %5
%23 = load i8, i8* %6
%24 = call i32 @scrypt_N_1_1_256_sp_generic(i8* %21, i8* %22, i8* %19, i8 zeroext %23)
%25 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
%26 = load i8*, i8** %8
ret void
}

LLVM IR (-O2):
@str = [32 x i8] c"scrypt_N_1_1_256 0\00"
@str.2 = [32 x i8] c"scrypt_N_1_1_256 1\00"
define void @scrypt_N_1_1_256(i8* %0, i8* %1, i8 zeroext %2) {
%4 = zext i8 %2 to i32
%5 = shl i32 256, %4
%6 = or i32 %5, 63
%7 = zext i32 %6 to i64
%8 = alloca i8, i64 %7
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
%10 = call i32 @scrypt_N_1_1_256_sp_generic(i8* %0, i8* %1, i8* %8, i8 zeroext %2)
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.2, i64 0, i64 0))
ret void
}