// File: /workspace/github_cpp_makefile_star2_O3/kaityo256[P]randomsampling/test.cpp
// Function: void test<walker_alias>(std::vector<double, std::allocator<double>>&)
void test(std::vector<double> &v) {
  std::vector<double> r(v.size(), 0.0);
  std::mt19937 mt;
  T s(v);
  std::cout << s.name() << std::endl;
  const int N = 100000;
  double sum = std::accumulate(v.begin(), v.end(), 0);
  const double a = sum / N;
  for (int i = 0; i < N; i++) {
    int index = s.select(mt);
    r[index] += a;
  }
  for (size_t i = 0; i < v.size(); i++) {
    std::cout << i << ":" << r[i] << std::endl;
  }
  std::cout << std::endl;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1428, %rsp           # imm = 0x1428
movq %rdi, %rbx
movq 0x8(%rdi), %rsi
subq (%rdi), %rsi
sarq $0x3, %rsi
leaq 0xa0(%rsp), %r14
movq $0x0, (%r14)
leaq 0x8(%rsp), %rdi
leaq 0x48(%rsp), %rcx
movq %r14, %rdx
callq 0x2196
movq $0x1571, (%r14)         # imm = 0x1571
movl $0x1, %eax
movl $0x1571, %ecx           # imm = 0x1571
movq %rcx, %rdx
shrq $0x1e, %rdx
xorl %ecx, %edx
imull $0x6c078965, %edx, %ecx # imm = 0x6C078965
addl %eax, %ecx
movq %rcx, 0xa0(%rsp,%rax,8)
incq %rax
cmpq $0x270, %rax            # imm = 0x270
jne 0x15a9
movq $0x270, 0x1420(%rsp) # imm = 0x270
leaq 0x48(%rsp), %rdi
movq %rbx, %rsi
callq 0x22b8
leaq 0x38(%rsp), %r15
movq %r15, -0x10(%r15)
movabsq $0x732772656b6c6157, %rax # imm = 0x732772656B6C6157
movq %rax, (%r15)
movabsq $0x7361696c41207327, %rax # imm = 0x7361696C41207327
movq %rax, 0x6(%r15)
movq $0xe, -0x8(%r15)
movb $0x0, 0xe(%r15)
movq 0x59ba(%rip), %r14      # 0x6fd8
movl $0xe, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x10f0
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x10c0
movsbl %al, %esi
movq %r12, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1080
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0x166f
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x10e0
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
cmpq %rcx, %rax
je 0x169e
xorl %edx, %edx
xorps %xmm0, %xmm0
cvtsi2sd %edx, %xmm0
addsd (%rax), %xmm0
cvttsd2si %xmm0, %edx
addq $0x8, %rax
cmpq %rcx, %rax
jne 0x167d
xorps %xmm0, %xmm0
cvtsi2sd %edx, %xmm0
jmp 0x16a2
xorpd %xmm0, %xmm0
divsd 0x3966(%rip), %xmm0     # 0x5010
movsd %xmm0, 0x20(%rsp)
movl $0x186a0, %ebp          # imm = 0x186A0
leaq 0xa0(%rsp), %r15
movq %r15, %rdi
callq 0x3978
movl 0x48(%rsp), %edx
decl %edx
andl %eax, %edx
movb 0x4c(%rsp), %cl
shrl %cl, %eax
movslq %edx, %rcx
movq 0x80(%rsp), %rdx
cmpl (%rdx,%rcx,4), %eax
jbe 0x16ec
movq 0x50(%rsp), %rax
movslq (%rax,%rcx,4), %rcx
movq 0x8(%rsp), %rax
movsd (%rax,%rcx,8), %xmm0
addsd 0x20(%rsp), %xmm0
movsd %xmm0, (%rax,%rcx,8)
decl %ebp
jne 0x16bd
movq 0x8(%rbx), %rax
cmpq (%rbx), %rax
je 0x178d
xorl %r15d, %r15d
movq 0x58c0(%rip), %r12      # 0x6fd8
leaq 0x39a8(%rip), %r13      # 0x50c7
movq %r12, %rdi
movq %r15, %rsi
callq 0x1070
movq %rax, %rbp
movl $0x1, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x10f0
movq 0x8(%rsp), %rax
movsd (%rax,%r15,8), %xmm0
movq %rbp, %rdi
callq 0x1110
movq %rax, %rbp
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbp, %rdi
movl $0xa, %esi
callq 0x10c0
movsbl %al, %esi
movq %rbp, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1080
incq %r15
movq 0x8(%rbx), %rax
subq (%rbx), %rax
sarq $0x3, %rax
cmpq %rax, %r15
jb 0x171f
movq (%r14), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x10c0
movsbl %al, %esi
movq 0x582d(%rip), %rdi      # 0x6fd8
callq 0x1030
movq %rax, %rdi
callq 0x1080
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x17d5
movq 0x90(%rsp), %rsi
subq %rdi, %rsi
callq 0x10e0
movq 0x68(%rsp), %rdi
testq %rdi, %rdi
je 0x17ec
movq 0x78(%rsp), %rsi
subq %rdi, %rsi
callq 0x10e0
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x1803
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x10e0
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x181a
movq 0x18(%rsp), %rsi
subq %rdi, %rsi
callq 0x10e0
addq $0x1428, %rsp           # imm = 0x1428
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x185e
jmp 0x1851
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0x1854
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x10e0
jmp 0x1854
jmp 0x1851
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x2682
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x1875
movq 0x18(%rsp), %rsi
subq %rdi, %rsi
callq 0x10e0
movq %rbx, %rdi
callq 0x1140