// File: bitwiseshiftleft[P]crandom/test_random.cpp
// Function: void test<crandom::generator_base, unsigned int, true>(int, unsigned int, unsigned int, crandom::generator_base*)
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
movq %rsp, %rbp
subq $0x40, %rsp
movl %edi, -0xc(%rbp)
movl %esi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq %rcx, -0x20(%rbp)
leaq 0x7b84(%rip), %rax      # 0xa4e0
movl (%rax), %eax
movl %eax, -0x24(%rbp)
movl -0x10(%rbp), %edi
callq 0x1950
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x3d(%rbp)
je 0x2989
movl -0x10(%rbp), %eax
andl $0x0, %eax
movl -0x14(%rbp), %ecx
andl $0x0, %ecx
cmpl %ecx, %eax
sete %al
movb %al, -0x3d(%rbp)
movb -0x3d(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x28(%rbp)
leaq 0x7b45(%rip), %rax      # 0xa4e0
movl (%rax), %ecx
movl -0x14(%rbp), %eax
xorl $-0x1, %eax
andl %eax, %ecx
orl -0x10(%rbp), %ecx
orl $0x1, %ecx
leaq 0x7b2e(%rip), %rax      # 0xa4e0
movl %ecx, (%rax)
leaq 0x7b25(%rip), %rax      # 0xa4e0
movl (%rax), %edi
callq 0x1250
movl $0x0, -0x30(%rbp)
cmpl $0x0, -0x28(%rbp)
je 0x2aa1
callq 0x13d0
movsd %xmm0, -0x38(%rbp)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0x2a12
movq -0x20(%rbp), %rdi
leaq -0x3c(%rbp), %rsi
movl $0x4, %edx
callq 0x3490
movl -0x3c(%rbp), %eax
addl -0x30(%rbp), %eax
movl %eax, -0x30(%rbp)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x29e4
callq 0x13d0
movsd -0x38(%rbp), %xmm1
subsd %xmm1, %xmm0
movsd %xmm0, -0x38(%rbp)
movslq -0x2c(%rbp), %rax
movl %eax, %ecx
cvtsi2sd %ecx, %xmm0
movsd 0x45d1(%rip), %xmm2     # 0x7008
divsd %xmm2, %xmm0
shlq $0x2, %rax
movq %rax, %xmm3
movaps 0x45d5(%rip), %xmm1     # 0x7020
punpckldq %xmm1, %xmm3    # xmm3 = xmm3[0],xmm1[0],xmm3[1],xmm1[1]
movapd 0x45d9(%rip), %xmm1     # 0x7030
subpd %xmm1, %xmm3
movaps %xmm3, %xmm1
unpckhpd %xmm3, %xmm3            # xmm3 = xmm3[1,1]
addsd %xmm1, %xmm3
movaps %xmm3, %xmm1
divsd %xmm2, %xmm1
movsd -0x38(%rbp), %xmm2
movsd 0x458e(%rip), %xmm4     # 0x7008
divsd %xmm4, %xmm3
divsd -0x38(%rbp), %xmm3
leaq 0x45e7(%rip), %rdi      # 0x7071
movb $0x4, %al
callq 0x1030
leaq 0x47c0(%rip), %rdi      # 0x7258
movb $0x0, %al
callq 0x1030
jmp 0x2aaf
leaq 0x47a3(%rip), %rdi      # 0x724b
movb $0x0, %al
callq 0x1030
movl -0x24(%rbp), %ecx
leaq 0x7a27(%rip), %rax      # 0xa4e0
movl %ecx, (%rax)
movl -0x30(%rbp), %eax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, %rax
movq %rax, -0x8(%rbp)
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)