// File: /workspace/github_cpp_makefile_star2_O3/bitwiseshiftleft[P]crandom/test_random.cpp
// Function: main
int main(int argc, char **argv) {
  (void) argc; (void) argv;
  
  crandom_features = crandom_detect_features();
  
  unsigned int chacha_features = SSE2 | SSSE3 | XOP, aes_features = AESNI;
  
  prg_generator<chacha> *ch = new prg_generator<chacha>(true);
  prg_generator<aes> *ae = new prg_generator<aes>(true);
  printf("****** Generators and processor features ******\n\n");
  
  printf("chacha, direct, u_int32_t");
  test<prg_generator<chacha>, u_int32_t, false>(100000000, SSE2 | SSSE3 | XOP, chacha_features, ch);
  printf("chacha, direct, u_int32_t");
  test<prg_generator<chacha>, u_int32_t, false>(100000000, SSE2 | SSSE3, chacha_features, ch);
  printf("chacha, direct, u_int32_t");
  test<prg_generator<chacha>, u_int32_t, false>(100000000, SSE2, chacha_features, ch);
  printf("chacha, direct, u_int32_t");
  test<prg_generator<chacha>, u_int32_t, false>(10000000, 0, chacha_features, ch);
  
  printf("aes, direct, u_int32_t");
  test<prg_generator<aes>, u_int32_t, false>(100000000, AESNI, aes_features, ae);
  printf("aes, direct, u_int32_t");
  test<prg_generator<aes>, u_int32_t, false>(10000000, 0, aes_features, ae);
  
  printf("rand, int\n");
  test_rand(100000000);
  
  printf("random, int\n");
  test_random(100000000);
  
  #ifdef __MAC_10_0
    printf("arc4random, int\n");
    test_arc4random(10000000);
  #endif
  
  printf("drand48, int\n");
  test_drand48(10000000);
  
  printf("****** Data sizes ******\n\n");
  
  printf("chacha, direct, u_int128_t");
  test<prg_generator<chacha>, u_int128_t, false>(100000000, 0, 0, ch);
  printf("chacha, direct, u_int8_t");
  test<prg_generator<chacha>, u_int8_t, false>(100000000, 0, 0, ch);
  printf("chacha, direct, float");
  test<prg_generator<chacha>, float, false>(100000000, 0, 0, ch);
  printf("chacha, direct, double");
  test<prg_generator<chacha>, double, false>(100000000, 0, 0, ch);
  printf("aes, direct, u_int128_t");
  test<prg_generator<aes>, u_int128_t, false>(100000000, AESNI, aes_features, ae);
  printf("aes, direct, u_int8_t");
  test<prg_generator<aes>, u_int8_t, false>(100000000, 0, 0, ae);
  
  printf("****** Indirection ******\n\n");
  
  printf("aes, indirect, u_int32_t");
  test<generator_base, u_int32_t, false>(100000000, 0, 0,
    opacify(1) ? static_cast<generator_base *>(ae) : static_cast<generator_base *>(ch));
  printf("chacha, indirect, u_int32_t");
  test<generator_base, u_int32_t, false>(100000000, 0, 0,
    opacify(1) ? static_cast<generator_base *>(ch) : static_cast<generator_base *>(ae));
  printf("chacha, indirect, u_int32_t, slow case");
  test<generator_base, u_int32_t, true>(100000000, 0, 0,
    opacify(1) ? static_cast<generator_base *>(ch) : static_cast<generator_base *>(ae));
  
  return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
callq 0x5adc
leaq 0x7fa4(%rip), %rcx      # 0x94f0
movl %eax, (%rcx)
movl $0x28, %edi
callq 0x10e0
movq %rax, %rbx
movq %rax, %rdi
movl $0x80, %esi
movl $0x1, %edx
movl $0x20, %ecx
callq 0x2c94
leaq 0x77b7(%rip), %rax      # 0x8d30
movq %rax, (%rbx)
movq $0x0, 0x20(%rbx)
movl $0x28, %edi
callq 0x10e0
movq %rax, %r14
movq %rax, %rdi
movl $0x80, %esi
movl $0x1, %edx
movl $0x20, %ecx
callq 0x2c94
leaq 0x77c9(%rip), %rax      # 0x8d78
movq %rax, (%r14)
movq $0x0, 0x20(%r14)
leaq 0x4bdf(%rip), %rdi      # 0x61a0
callq 0x1110
leaq 0x4ab7(%rip), %r15      # 0x6084
movq %r15, %rdi
xorl %eax, %eax
callq 0x1030
movl $0x5f5e100, %edi        # imm = 0x5F5E100
movl $0x16, %esi
movl $0x16, %edx
movq %rbx, %rcx
callq 0x1861
movq %r15, %rdi
xorl %eax, %eax
callq 0x1030
movl $0x5f5e100, %edi        # imm = 0x5F5E100
movl $0x6, %esi
movl $0x16, %edx
movq %rbx, %rcx
callq 0x1861
movq %r15, %rdi
xorl %eax, %eax
callq 0x1030
movl $0x5f5e100, %edi        # imm = 0x5F5E100
movl $0x2, %esi
movl $0x16, %edx
movq %rbx, %rcx
callq 0x1861
movq %r15, %rdi
xorl %eax, %eax
callq 0x1030
movl $0x989680, %edi         # imm = 0x989680
xorl %esi, %esi
movl $0x16, %edx
movq %rbx, %rcx
callq 0x1861
leaq 0x4a49(%rip), %r15      # 0x609e
movq %r15, %rdi
xorl %eax, %eax
callq 0x1030
movl $0x5f5e100, %edi        # imm = 0x5F5E100
movl $0x8, %esi
movl $0x8, %edx
movq %r14, %rcx
callq 0x1a36
movq %r15, %rdi
xorl %eax, %eax
callq 0x1030
movl $0x989680, %edi         # imm = 0x989680
xorl %esi, %esi
movl $0x8, %edx
movq %r14, %rcx
callq 0x1a36
leaq 0x4b36(%rip), %rdi      # 0x61d1
callq 0x1110
movl $0x5f5e100, %edi        # imm = 0x5F5E100
callq 0x12ba
leaq 0x4b2a(%rip), %rdi      # 0x61db
callq 0x1110
movl $0x5f5e100, %edi        # imm = 0x5F5E100
callq 0x138f
leaq 0x4b20(%rip), %rdi      # 0x61e7
callq 0x1110
movl $0x989680, %edi         # imm = 0x989680
callq 0x1464
leaq 0x4b17(%rip), %rdi      # 0x61f4
callq 0x1110
leaq 0x49cc(%rip), %rdi      # 0x60b5
xorl %eax, %eax
callq 0x1030
movl $0x5f5e100, %edi        # imm = 0x5F5E100
xorl %esi, %esi
xorl %edx, %edx
movq %rbx, %rcx
callq 0x1c0b
leaq 0x49c8(%rip), %rdi      # 0x60d0
xorl %eax, %eax
callq 0x1030
movl $0x5f5e100, %edi        # imm = 0x5F5E100
xorl %esi, %esi
xorl %edx, %edx
movq %rbx, %rcx
callq 0x1df3
leaq 0x49c2(%rip), %rdi      # 0x60e9
xorl %eax, %eax
callq 0x1030
movl $0x5f5e100, %edi        # imm = 0x5F5E100
xorl %esi, %esi
xorl %edx, %edx
movq %rbx, %rcx
callq 0x1fd5
leaq 0x49b9(%rip), %rdi      # 0x60ff
xorl %eax, %eax
callq 0x1030
movl $0x5f5e100, %edi        # imm = 0x5F5E100
xorl %esi, %esi
xorl %edx, %edx
movq %rbx, %rcx
callq 0x220f
leaq 0x49b1(%rip), %rdi      # 0x6116
xorl %eax, %eax
callq 0x1030
movl $0x5f5e100, %edi        # imm = 0x5F5E100
movl $0x8, %esi
movl $0x8, %edx
movq %r14, %rcx
callq 0x245c
leaq 0x49a4(%rip), %rdi      # 0x612e
xorl %eax, %eax
callq 0x1030
movl $0x5f5e100, %edi        # imm = 0x5F5E100
xorl %esi, %esi
xorl %edx, %edx
movq %r14, %rcx
callq 0x2644
leaq 0x4a65(%rip), %rdi      # 0x620e
callq 0x1110
leaq 0x498f(%rip), %rdi      # 0x6144
xorl %eax, %eax
callq 0x1030
movl $0x1, %r15d
movl $0x1, %eax
movq %rax, %rax
testq %rax, %rax
movq %r14, %rcx
cmoveq %rbx, %rcx
movl $0x5f5e100, %edi        # imm = 0x5F5E100
xorl %esi, %esi
xorl %edx, %edx
callq 0x2826
leaq 0x4974(%rip), %rdi      # 0x615d
xorl %eax, %eax
callq 0x1030
movl $0x1, %eax
movq %rax, %rax
testq %rax, %rax
movq %rbx, %rcx
cmoveq %r14, %rcx
movl $0x5f5e100, %edi        # imm = 0x5F5E100
xorl %esi, %esi
xorl %edx, %edx
callq 0x2826
leaq 0x4962(%rip), %rdi      # 0x6179
xorl %eax, %eax
callq 0x1030
movq %r15, %r15
testq %r15, %r15
cmoveq %r14, %rbx
movl $0x5f5e100, %edi        # imm = 0x5F5E100
xorl %esi, %esi
xorl %edx, %edx
movq %rbx, %rcx
callq 0x29fb
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %r15
movq %r14, %rbx
jmp 0x184c
movq %rax, %r15
movl $0x28, %esi
movq %rbx, %rdi
callq 0x10f0
movq %r15, %rdi
callq 0x1140