// File: /workspace/github_cpp_makefile_star2_O1/ncbi[P]amr/common.cpp
// Function: Common_sp::Rand::get(unsigned long)
ulong Rand::get (ulong max)
{
  ASSERT (max > 0);
  ASSERT (max <= (ulong) max_);
  
  const long up = max_ - (max_ % (long) max);  // Multiple of max
  do run ();
    while (seed >= up);  // P(stay in cycle) < 0.5
  return (ulong) (seed % (long) max);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movq %rsi, %rbx
movq %rdi, %r14
callq 0xa070
movl $0x0, (%rax)
testq %rbx, %rbx
je 0x3f275
movl $0x0, (%rax)
movq %rbx, %rax
shrq $0x1f, %rax
jne 0x3f314
movl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
xorl %edx, %edx
divq %rbx
movq %rdx, %r15
xorq %rcx, %r15
movabsq $0x41a705af1fe3fb79, %r12 # imm = 0x41A705AF1FE3FB79
movq %r14, %rdi
callq 0x3f770
movq (%r14), %rcx
movq %rcx, %rax
imulq %r12
movq %rdx, %rax
shrq $0x3f, %rax
sarq $0xf, %rdx
addq %rax, %rdx
imulq $-0x1f31d, %rdx, %rax   # imm = 0xFFFE0CE3
addq %rcx, %rax
imulq $0x41a7, %rax, %rcx     # imm = 0x41A7
imulq $-0xb14, %rdx, %rdx     # imm = 0xF4EC
leaq (%rcx,%rdx), %rax
addq $0x7fffffff, %rax       # imm = 0x7FFFFFFF
addq %rdx, %rcx
cmovnsq %rcx, %rax
movq %rax, (%r14)
cmpq %r15, %rax
jge 0x3f20b
cqto
idivq %rbx
movq %rdx, %rax
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0xa6b0
testl %eax, %eax
jne 0x3f3b3
leaq 0x98(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x4d6a1(%rip), %rsi     # 0x8c936
leaq 0x4d6ad(%rip), %rdx     # 0x8c949
leaq 0x88(%rsp), %rdi
callq 0x2fdd8
leaq 0xa8(%rsp), %rdi
movl $0x641, %esi            # imm = 0x641
callq 0x2d60a
leaq 0xc8(%rsp), %rdi
leaq 0x88(%rsp), %rsi
leaq 0xa8(%rsp), %rdx
callq 0x2d562
leaq 0x4b906(%rip), %rsi     # 0x8abe5
leaq 0xc8(%rsp), %rdi
callq 0xaac0
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x3f3bd
movups (%rcx), %xmm0
movups %xmm0, (%r15)
jmp 0x3f3ca
callq 0xa6b0
testl %eax, %eax
jne 0x3f3b3
leaq 0x98(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x4d602(%rip), %rsi     # 0x8c936
leaq 0x4d60e(%rip), %rdx     # 0x8c949
leaq 0x88(%rsp), %rdi
callq 0x2fdd8
leaq 0xa8(%rsp), %rdi
movl $0x642, %esi            # imm = 0x642
callq 0x2d60a
leaq 0xc8(%rsp), %rdi
leaq 0x88(%rsp), %rsi
leaq 0xa8(%rsp), %rdx
callq 0x2d562
leaq 0x4b867(%rip), %rsi     # 0x8abe5
leaq 0xc8(%rsp), %rdi
callq 0xaac0
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x3f43e
movups (%rcx), %xmm0
movups %xmm0, (%r15)
jmp 0x3f44b
movl $0x1, %edi
callq 0xa6c0
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
movq 0x8(%rax), %rdx
movq %rdx, 0x10(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x78(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x4dce0(%rip), %rsi     # 0x8d0d3
leaq 0x4dcfa(%rip), %rdx     # 0x8d0f4
leaq 0x68(%rsp), %rdi
callq 0x2fdd8
leaq 0x4d528(%rip), %rsi     # 0x8c933
leaq 0x68(%rsp), %rdi
callq 0xaac0
leaq 0x38(%rsp), %r13
movq %r13, -0x10(%r13)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x3f4b8
movups (%rcx), %xmm0
movups %xmm0, (%r13)
jmp 0x3f4c5
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
movq 0x8(%rax), %rdx
movq %rdx, 0x10(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x78(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x4dc5f(%rip), %rsi     # 0x8d0d3
leaq 0x4dc79(%rip), %rdx     # 0x8d0f4
leaq 0x68(%rsp), %rdi
callq 0x2fdd8
leaq 0x4d4a7(%rip), %rsi     # 0x8c933
leaq 0x68(%rsp), %rdi
callq 0xaac0
leaq 0x38(%rsp), %r13
movq %r13, -0x10(%r13)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x3f528
movups (%rcx), %xmm0
movups %xmm0, (%r13)
jmp 0x3f535
movq %rdx, 0x28(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x38(%rsp)
movq 0x8(%rax), %rsi
leaq 0x28(%rsp), %rdx
movq %rsi, 0x8(%rdx)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0xe8(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x2d562
leaq 0x4dbfb(%rip), %rsi     # 0x8d0f5
leaq 0xe8(%rsp), %rdi
callq 0xaac0
leaq 0x58(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x3f598
movups (%rcx), %xmm0
movups %xmm0, (%rbp)
jmp 0x3f5a5
movq %rdx, 0x28(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x38(%rsp)
movq 0x8(%rax), %rsi
leaq 0x28(%rsp), %rdx
movq %rsi, 0x8(%rdx)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0xe8(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x2d562
leaq 0x4db93(%rip), %rsi     # 0x8d0fd
leaq 0xe8(%rsp), %rdi
callq 0xaac0
leaq 0x58(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x3f5c6
movups (%rcx), %xmm0
movups %xmm0, (%rbp)
jmp 0x3f5d3
movq %rdx, 0x48(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x58(%rsp)
movq 0x8(%rax), %rdx
leaq 0x48(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
callq 0x3523b
movq %rdx, 0x48(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x58(%rsp)
movq 0x8(%rax), %rdx
leaq 0x48(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
callq 0x3523b
jmp 0x3f5f6
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %rbp, %rdi
je 0x3f617
movq 0x58(%rsp), %rsi
incq %rsi
callq 0xa5a0
jmp 0x3f617
jmp 0x3f614
movq %rax, %rbx
leaq 0xf8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3f63f
movq 0xf8(%rsp), %rsi
incq %rsi
callq 0xa5a0
jmp 0x3f63f
jmp 0x3f63c
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r13, %rdi
je 0x3f65d
movq 0x38(%rsp), %rsi
incq %rsi
callq 0xa5a0
jmp 0x3f65d
jmp 0x3f65a
movq %rax, %rbx
movq 0x68(%rsp), %rdi
cmpq %r12, %rdi
je 0x3f67b
movq 0x78(%rsp), %rsi
incq %rsi
callq 0xa5a0
jmp 0x3f67b
jmp 0x3f678
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x3f699
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xa5a0
jmp 0x3f699
jmp 0x3f696
movq %rax, %rbx
leaq 0xd8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3f6c1
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0xa5a0
jmp 0x3f6c1
jmp 0x3f6be
movq %rax, %rbx
leaq 0xb8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3f6e9
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0xa5a0
jmp 0x3f6e9
jmp 0x3f6e6
movq %rax, %rbx
movq 0x88(%rsp), %rdi
cmpq %r14, %rdi
je 0x3f70d
movq 0x98(%rsp), %rsi
incq %rsi
callq 0xa5a0
jmp 0x3f70d
jmp 0x3f70a
movq %rax, %rbx
movq %rbx, %rdi
callq 0xaa10
nop