// File: /workspace/github_cpp_makefile_star2_O2/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 %r15
pushq %r14
pushq %rbx
subq $0x110, %rsp            # imm = 0x110
movq %rsi, %rbx
movq %rdi, %r14
callq 0xb060
andl $0x0, (%rax)
testq %rbx, %rbx
je 0x27b79
movq %rbx, %rax
shrq $0x1f, %rax
jne 0x27c4d
movl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
xorl %edx, %edx
divl %ebx
movl %edx, %r15d
xorl %ecx, %r15d
movq %r14, %rdi
callq 0x27dca
movq (%r14), %rax
cmpq %r15, %rax
jge 0x27b54
cqto
idivq %rbx
movq %rdx, %rax
addq $0x110, %rsp            # imm = 0x110
popq %rbx
popq %r14
popq %r15
retq
callq 0xb6c0
testl %eax, %eax
jne 0x27d21
leaq 0x33db4(%rip), %rsi     # 0x5b941
leaq 0x70(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x1b7b6
leaq 0x50(%rsp), %rdi
movl $0x641, %esi            # imm = 0x641
callq 0x1caa3
leaq 0x90(%rsp), %rdi
leaq 0x70(%rsp), %rsi
leaq 0x50(%rsp), %rdx
callq 0x1ca3c
leaq 0x3201a(%rip), %rdx     # 0x59be3
leaq 0xb0(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0x1b92d
leaq 0x344e3(%rip), %rsi     # 0x5c0c8
leaq 0x10(%rsp), %rdi
leaq 0xe(%rsp), %rdx
callq 0x1b7b6
leaq 0x33d43(%rip), %rdx     # 0x5b93e
leaq 0x30(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x1b92d
leaq 0xd0(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
leaq 0x30(%rsp), %rdx
callq 0x1ca3c
leaq 0x344bf(%rip), %rdx     # 0x5c0ea
leaq 0xf0(%rsp), %rdi
leaq 0xd0(%rsp), %rsi
callq 0x1b92d
leaq 0xf0(%rsp), %rdi
callq 0x224fc
callq 0xb6c0
testl %eax, %eax
jne 0x27d21
leaq 0x33ce0(%rip), %rsi     # 0x5b941
leaq 0x70(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x1b7b6
leaq 0x50(%rsp), %rdi
movl $0x642, %esi            # imm = 0x642
callq 0x1caa3
leaq 0x90(%rsp), %rdi
leaq 0x70(%rsp), %rsi
leaq 0x50(%rsp), %rdx
callq 0x1ca3c
leaq 0x31f46(%rip), %rdx     # 0x59be3
leaq 0xb0(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0x1b92d
leaq 0x3440f(%rip), %rsi     # 0x5c0c8
leaq 0x10(%rsp), %rdi
leaq 0xe(%rsp), %rdx
callq 0x1b7b6
leaq 0x33c6f(%rip), %rdx     # 0x5b93e
leaq 0x30(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x1b92d
leaq 0xd0(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
leaq 0x30(%rsp), %rdx
callq 0x1ca3c
leaq 0x343f3(%rip), %rdx     # 0x5c0f2
leaq 0xf0(%rsp), %rdi
leaq 0xd0(%rsp), %rsi
callq 0x1b92d
leaq 0xf0(%rsp), %rdi
callq 0x224fc
pushq $0x1
popq %rdi
callq 0xb6d0
jmp 0x27d2d
jmp 0x27d3f
movq %rax, %rbx
leaq 0xf0(%rsp), %rdi
callq 0xbb68
jmp 0x27d42
movq %rax, %rbx
leaq 0xd0(%rsp), %rdi
callq 0xbb68
jmp 0x27d56
jmp 0x27d53
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0xbb68
jmp 0x27d67
jmp 0x27d64
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0xbb68
jmp 0x27d78
jmp 0x27d75
movq %rax, %rbx
leaq 0xb0(%rsp), %rdi
callq 0xbb68
jmp 0x27d8c
jmp 0x27d89
movq %rax, %rbx
leaq 0x90(%rsp), %rdi
callq 0xbb68
jmp 0x27da0
jmp 0x27d9d
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0xbb68
jmp 0x27db1
jmp 0x27dae
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
callq 0xbb68
jmp 0x27dc2
jmp 0x27dbf
movq %rax, %rbx
movq %rbx, %rdi
callq 0xba30