// File: /workspace/github_cpp_makefile_star2_O3/bitwiseshiftleft[P]crandom/test_random.cpp
// Function: void test<crandom::prg_generator<crandom::v_chacha<12, 128>>, float, false>(int, unsigned int, unsigned int, crandom::prg_generator<crandom::v_chacha<12, 128>>*)
void test(int n, unsigned int new_features, unsigned int of_features, gen *generator) {
  unsigned int old_features = crandom_features,
    good = HAVE(new_features) && ((new_features & MUST_MASK) == (MUST_MASK & of_features));
  int i;
  crandom_features = (crandom_features & ~of_features) | new_features | 1;
  print_features(crandom_features);
  
  t out = 0;
  if (good) {
  
    double start=now();
    for (i=0; i<n; i++) {
      if (slow) {
        t x;
        generator->randomize_slow_case((unsigned char *) &x, sizeof(x));
        out += x;
      } else {
        out += generator->template random<t>();
      }
    }
    start = now() - start;
    
    printf("%0.1f ME (%0.1f MB) / %0.3f sec = %0.1f MB/sec",
           i / 1000000.0,
           i * sizeof(t) / 1000000.0,
           start,
           i * sizeof(t) / 1000000.0 / start);
    printf("\n\n");
  } else {
    printf("(unsupported)\n\n");
  }
  
  crandom_features = old_features;
  opacify(out);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %edx, %ebp
movl %esi, %r15d
leaq 0x7501(%rip), %r12      # 0x94f0
movl (%r12), %r13d
testl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
je 0x2025
notl %ebp
andl %r13d, %ebp
orl %r15d, %ebp
orl $0x1, %ebp
movl %ebp, (%r12)
movl %ebp, %edi
callq 0x125c
leaq 0x4211(%rip), %rdi      # 0x6229
callq 0x1110
xorl %r15d, %r15d
jmp 0x21ef
movq %rcx, %r14
movl %edi, %ebx
testl %r15d, %r15d
je 0x206d
movl %ebx, 0x8(%rsp)
movl %r13d, %eax
testl %r13d, %r13d
je 0x2205
movl %eax, %r12d
notl %r12d
notl %ebp
andl %eax, %ebp
orl %r15d, %ebp
orl $0x1, %ebp
leaq 0x749a(%rip), %rbx      # 0x94f0
movl %ebp, (%rbx)
movl %ebp, %edi
callq 0x125c
testl %r12d, %r15d
movq %rbx, %r12
movl 0x8(%rsp), %ebx
jne 0x2011
jmp 0x2080
notl %ebp
andl %r13d, %ebp
orl $0x1, %ebp
movl %ebp, (%r12)
movl %ebp, %edi
callq 0x125c
xorl %ebp, %ebp
leaq 0x28(%rsp), %r15
movq %r15, %rdi
xorl %esi, %esi
callq 0x1120
cvtsi2sdq (%r15), %xmm0
cvtsi2sdq 0x8(%r15), %xmm1
divsd 0x3f64(%rip), %xmm1     # 0x6008
addsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rsp)
movl $0x0, %r15d
testl %ebx, %ebx
jle 0x217a
xorpd %xmm1, %xmm1
movss 0x3f58(%rip), %xmm2     # 0x6020
leaq 0x28(%rsp), %r15
movl %ebx, %ebp
movl 0x14(%r14), %eax
testl %eax, %eax
je 0x210c
cmpl $0x4, %eax
jb 0x212f
addl $-0x4, %eax
movl %eax, 0x14(%r14)
movq 0x18(%r14), %rdx
movl (%rdx,%rax), %ecx
movl $0x0, (%rdx,%rax)
shrl $0x9, %ecx
orl $0x3f800000, %ecx       # imm = 0x3F800000
movd %ecx, %xmm0
addss %xmm2, %xmm0
addss %xmm0, %xmm1
decl %ebp
jne 0x20cf
jmp 0x2159
movq (%r14), %rax
movq %r14, %rdi
movapd %xmm1, 0x10(%rsp)
callq *0x8(%rax)
movss 0x3efd(%rip), %xmm2     # 0x6020
movapd 0x10(%rsp), %xmm1
movl 0x14(%r14), %eax
jmp 0x20d7
movl $0x4, %edx
movq %r14, %rdi
movq %r15, %rsi
movapd %xmm1, 0x10(%rsp)
callq 0x2cd8
movss 0x3ed3(%rip), %xmm2     # 0x6020
movapd 0x10(%rsp), %xmm1
movl 0x28(%rsp), %ecx
jmp 0x20f1
cvttss2si %xmm1, %rax
movq %rax, %rcx
subss 0x3ebb(%rip), %xmm1     # 0x6024
cvttss2si %xmm1, %r15
sarq $0x3f, %rcx
andq %rcx, %r15
orq %rax, %r15
movl %ebx, %ebp
leaq 0x28(%rsp), %rbx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x1120
xorps %xmm0, %xmm0
cvtsi2sdq (%rbx), %xmm0
xorps %xmm2, %xmm2
cvtsi2sdq 0x8(%rbx), %xmm2
movsd 0x3e66(%rip), %xmm3     # 0x6008
divsd %xmm3, %xmm2
addsd %xmm0, %xmm2
subsd 0x8(%rsp), %xmm2
xorps %xmm0, %xmm0
cvtsi2sd %ebp, %xmm0
movl %ebp, %eax
shlq $0x2, %rax
xorps %xmm1, %xmm1
cvtsi2sd %rax, %xmm1
divsd %xmm3, %xmm0
divsd %xmm3, %xmm1
movapd %xmm1, %xmm3
divsd %xmm2, %xmm3
leaq 0x3e79(%rip), %rdi      # 0x6055
movb $0x4, %al
callq 0x1030
leaq 0x404c(%rip), %rdi      # 0x6236
callq 0x1110
movl %r13d, (%r12)
movq %r15, %r15
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x5adc
jmp 0x203f