// File: /workspace/github_cpp_makefile_star2_O1/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 0x48e8
leaq 0x6fa4(%rip), %rcx      # 0x84f0
movl %eax, (%rcx)
movl $0x28, %edi
callq 0x10e0
movq %rax, %rbx
movq %rax, %rdi
movl $0x80, %esi
movl $0x1, %edx
movl $0x20, %ecx
callq 0x2cd0
leaq 0x67b7(%rip), %rax      # 0x7d30
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 0x2cd0
leaq 0x67c9(%rip), %rax      # 0x7d78
movq %rax, (%r14)
movq $0x0, 0x20(%r14)
leaq 0x3bdf(%rip), %rdi      # 0x51a0
callq 0x1110
leaq 0x3ab7(%rip), %r15      # 0x5084
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 0x3a49(%rip), %r15      # 0x509e
movq %r15, %rdi
xorl %eax, %eax
callq 0x1030
movl $0x5f5e100, %edi        # imm = 0x5F5E100
movl $0x8, %esi
movl $0x8, %edx
movq %r14, %rcx
callq 0x1a3e
movq %r15, %rdi
xorl %eax, %eax
callq 0x1030
movl $0x989680, %edi         # imm = 0x989680
xorl %esi, %esi
movl $0x8, %edx
movq %r14, %rcx
callq 0x1a3e
leaq 0x3b36(%rip), %rdi      # 0x51d1
callq 0x1110
movl $0x5f5e100, %edi        # imm = 0x5F5E100
callq 0x12ba
leaq 0x3b2a(%rip), %rdi      # 0x51db
callq 0x1110
movl $0x5f5e100, %edi        # imm = 0x5F5E100
callq 0x138f
leaq 0x3b20(%rip), %rdi      # 0x51e7
callq 0x1110
movl $0x989680, %edi         # imm = 0x989680
callq 0x1464
leaq 0x3b17(%rip), %rdi      # 0x51f4
callq 0x1110
leaq 0x39cc(%rip), %rdi      # 0x50b5
xorl %eax, %eax
callq 0x1030
movl $0x5f5e100, %edi        # imm = 0x5F5E100
xorl %esi, %esi
xorl %edx, %edx
movq %rbx, %rcx
callq 0x1c1b
leaq 0x39c8(%rip), %rdi      # 0x50d0
xorl %eax, %eax
callq 0x1030
movl $0x5f5e100, %edi        # imm = 0x5F5E100
xorl %esi, %esi
xorl %edx, %edx
movq %rbx, %rcx
callq 0x1e06
leaq 0x39c2(%rip), %rdi      # 0x50e9
xorl %eax, %eax
callq 0x1030
movl $0x5f5e100, %edi        # imm = 0x5F5E100
xorl %esi, %esi
xorl %edx, %edx
movq %rbx, %rcx
callq 0x1feb
leaq 0x39b9(%rip), %rdi      # 0x50ff
xorl %eax, %eax
callq 0x1030
movl $0x5f5e100, %edi        # imm = 0x5F5E100
xorl %esi, %esi
xorl %edx, %edx
movq %rbx, %rcx
callq 0x222a
leaq 0x39b1(%rip), %rdi      # 0x5116
xorl %eax, %eax
callq 0x1030
movl $0x5f5e100, %edi        # imm = 0x5F5E100
movl $0x8, %esi
movl $0x8, %edx
movq %r14, %rcx
callq 0x247b
leaq 0x39a4(%rip), %rdi      # 0x512e
xorl %eax, %eax
callq 0x1030
movl $0x5f5e100, %edi        # imm = 0x5F5E100
xorl %esi, %esi
xorl %edx, %edx
movq %r14, %rcx
callq 0x2666
leaq 0x3a65(%rip), %rdi      # 0x520e
callq 0x1110
leaq 0x398f(%rip), %rdi      # 0x5144
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 0x284b
leaq 0x3974(%rip), %rdi      # 0x515d
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 0x284b
leaq 0x3962(%rip), %rdi      # 0x5179
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 0x2a28
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