// File: /workspace/github_cpp_makefile_star2_O1/bitwiseshiftleft[P]crandom/bench.cpp
// Function: void test<crandom::v_chacha<12, 128>, 2u, 22u>(int)
void test(int n) {
  unsigned int old_features = crandom_features,
    good = HAVE(new_features) && ((new_features & MUST_MASK) == (MUST_MASK & of_features));
  crandom_features = (crandom_features & ~of_features) | new_features | 1;
  print_features(new_features);
  
  if (good) {
    unsigned char key[generator::input_size], output[generator::output_size];
    int i;
    u_int64_t iv=0, ctr=0;
    bzero(key, sizeof(key));
    bzero(output, sizeof(output));
    
    double start=now();
    for (i=0; i<n; i++) {
      generator::expand(iv, ctr, key, output);
    }
    start = now() - start;
    
    printf("%s: %0.1f MB / %0.3f sec = %0.1f MB/sec\nchecksum = ",
           generator::get_name().c_str(),
           i * generator::output_size / 1000000.0,
           start,
           i * generator::output_size / 1000000.0 / start);
    for (i=16; i<32; i++) {
      printf("%02x", output[i]);
      if ((i&3)==3) printf(" ");
    }
    printf("\n\n");
  } else {
    printf("(unsupported)\n\n");
  }
  
  crandom_features = old_features;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movl %edi, %r13d
leaq 0x4166(%rip), %r15      # 0x54c0
movl (%r15), %ebp
testl %ebp, %ebp
je 0x1557
movl (%r15), %ebx
movl %ebx, %eax
andl $-0x18, %eax
orl $0x3, %eax
movl %eax, (%r15)
leaq 0x1c96(%rip), %rdi      # 0x3010
leaq 0x1ca2(%rip), %rsi      # 0x3023
leaq 0x1d0e(%rip), %rcx      # 0x3096
movq %rcx, %rdx
movq %rcx, %r8
xorl %eax, %eax
callq 0x1030
testb $0x2, %bl
jne 0x13a6
leaq 0x1ce7(%rip), %rdi      # 0x3088
jmp 0x153d
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
movaps %xmm0, 0x40(%rsp)
movaps %xmm0, 0x50(%rsp)
movaps %xmm0, 0x60(%rsp)
movaps %xmm0, 0x70(%rsp)
movaps %xmm0, 0x80(%rsp)
movaps %xmm0, 0x90(%rsp)
movaps %xmm0, 0xa0(%rsp)
movaps %xmm0, 0xb0(%rsp)
movaps %xmm0, 0xc0(%rsp)
leaq 0x10(%rsp), %r14
movq %r14, %rdi
xorl %esi, %esi
callq 0x10d0
xorps %xmm0, %xmm0
cvtsi2sdq (%r14), %xmm0
cvtsi2sdq 0x8(%r14), %xmm1
divsd 0x1bf9(%rip), %xmm1     # 0x3008
addsd %xmm0, %xmm1
movsd %xmm1, (%rsp)
testl %r13d, %r13d
jle 0x146a
xorl %r14d, %r14d
leaq 0x30(%rsp), %r15
leaq 0x50(%rsp), %r12
movl %r13d, %ebx
xorl %edi, %edi
movq %r14, %rsi
movl $0xc, %edx
movl $0x80, %ecx
movq %r15, %r8
movq %r12, %r9
callq 0x1a6c
addq $0x2, %r14
decl %ebx
jne 0x142d
shll $0x7, %r13d
xorps %xmm0, %xmm0
cvtsi2sd %r13d, %xmm0
movsd %xmm0, 0x8(%rsp)
leaq 0x4058(%rip), %r15      # 0x54c0
jmp 0x1474
xorpd %xmm0, %xmm0
movsd %xmm0, 0x8(%rsp)
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x10d0
xorps %xmm0, %xmm0
cvtsi2sdq (%rbx), %xmm0
xorps %xmm1, %xmm1
cvtsi2sdq 0x8(%rbx), %xmm1
divsd 0x1b6c(%rip), %xmm1     # 0x3008
addsd %xmm0, %xmm1
subsd (%rsp), %xmm1
movsd %xmm1, (%rsp)
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
callq 0x1998
movq (%rbx), %rsi
movsd 0x8(%rsp), %xmm0
divsd 0x1b40(%rip), %xmm0     # 0x3008
movapd %xmm0, %xmm2
movsd (%rsp), %xmm1
divsd %xmm1, %xmm2
leaq 0x1b60(%rip), %rdi      # 0x303c
movb $0x3, %al
callq 0x1030
movq (%rbx), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x14fd
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x1080
movl $0x10, %r14d
leaq 0x1b66(%rip), %rbx      # 0x3070
movzbl 0x50(%rsp,%r14), %esi
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1030
movl %r14d, %eax
notl %eax
testb $0x3, %al
jne 0x152d
movl $0x20, %edi
callq 0x10a0
incq %r14
cmpq $0x20, %r14
jne 0x150a
leaq 0x1b58(%rip), %rdi      # 0x3095
callq 0x10b0
movl %ebp, (%r15)
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x296c
movl %eax, (%r15)
jmp 0x1365