// File: /workspace/github_cpp_makefile_star2_O3/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, %ebx
leaq 0x4167(%rip), %r15      # 0x54c0
movl (%r15), %r13d
movl %r13d, %ebp
testl %r13d, %r13d
je 0x1554
movl %ebp, %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, %bpl
jne 0x13a7
leaq 0x1ce6(%rip), %rdi      # 0x3088
jmp 0x153a
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 0x1bf8(%rip), %xmm1     # 0x3008
addsd %xmm0, %xmm1
movsd %xmm1, (%rsp)
testl %ebx, %ebx
jle 0x1467
xorl %r14d, %r14d
leaq 0x30(%rsp), %r15
leaq 0x50(%rsp), %r12
movl %ebx, %ebp
xorl %edi, %edi
movq %r14, %rsi
movl $0xc, %edx
movl $0x80, %ecx
movq %r15, %r8
movq %r12, %r9
callq 0x1a68
addq $0x2, %r14
decl %ebp
jne 0x142c
shll $0x7, %ebx
xorps %xmm0, %xmm0
cvtsi2sd %ebx, %xmm0
movsd %xmm0, 0x8(%rsp)
leaq 0x405b(%rip), %r15      # 0x54c0
jmp 0x1471
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 0x1b6f(%rip), %xmm1     # 0x3008
addsd %xmm0, %xmm1
subsd (%rsp), %xmm1
movsd %xmm1, (%rsp)
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
callq 0x1994
movq (%rbx), %rsi
movsd 0x8(%rsp), %xmm0
divsd 0x1b43(%rip), %xmm0     # 0x3008
movapd %xmm0, %xmm2
movsd (%rsp), %xmm1
divsd %xmm1, %xmm2
leaq 0x1b63(%rip), %rdi      # 0x303c
movb $0x3, %al
callq 0x1030
movq (%rbx), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x14fa
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x1080
movl $0x10, %r14d
leaq 0x1b69(%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 0x152a
movl $0x20, %edi
callq 0x10a0
incq %r14
cmpq $0x20, %r14
jne 0x1507
leaq 0x1b5b(%rip), %rdi      # 0x3095
callq 0x10b0
movl %r13d, (%r15)
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x2910
movl %eax, %ebp
jmp 0x1368