// File: 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:
subq $0x278, %rsp            # imm = 0x278
movq %rdi, 0x270(%rsp)
movq %rsi, 0x268(%rsp)
movq 0x270(%rsp), %rax
movq %rax, 0x28(%rsp)
callq 0xc090
movl $0x0, (%rax)
cmpq $0x0, 0x268(%rsp)
ja 0x49ef5
callq 0xc8c0
cmpl $0x0, %eax
jne 0x49eeb
leaq 0x1c7(%rsp), %rdi
movq %rdi, 0x20(%rsp)
callq 0xcd00
movq 0x20(%rsp), %rdx
leaq 0x83d7f(%rip), %rsi     # 0xcda19
leaq 0x1c8(%rsp), %rdi
callq 0x29fd0
jmp 0x49ca9
leaq 0x190(%rsp), %rdi
movl $0x641, %esi            # imm = 0x641
callq 0x2ded0
jmp 0x49cbd
leaq 0x1e8(%rsp), %rdi
leaq 0x1c8(%rsp), %rsi
leaq 0x190(%rsp), %rdx
callq 0x2dde0
jmp 0x49cdc
leaq 0x81ebe(%rip), %rdx     # 0xcbba1
leaq 0x208(%rsp), %rdi
leaq 0x1e8(%rsp), %rsi
callq 0x2a2f0
jmp 0x49cfa
leaq 0x14f(%rsp), %rdi
movq %rdi, 0x18(%rsp)
callq 0xcd00
movq 0x18(%rsp), %rdx
leaq 0x844d3(%rip), %rsi     # 0xce1eb
leaq 0x150(%rsp), %rdi
callq 0x29fd0
jmp 0x49d27
leaq 0x83ce8(%rip), %rdx     # 0xcda16
leaq 0x170(%rsp), %rdi
leaq 0x150(%rsp), %rsi
callq 0x2a2f0
jmp 0x49d45
leaq 0x228(%rsp), %rdi
leaq 0x208(%rsp), %rsi
leaq 0x170(%rsp), %rdx
callq 0x2dde0
jmp 0x49d64
leaq 0x844a2(%rip), %rdx     # 0xce20d
leaq 0x248(%rsp), %rdi
leaq 0x228(%rsp), %rsi
callq 0x2a2f0
jmp 0x49d82
leaq 0x248(%rsp), %rdi
callq 0x3e9b0
jmp 0x49d91
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1b8(%rsp)
movl %eax, 0x1b4(%rsp)
jmp 0x49ed9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1b8(%rsp)
movl %eax, 0x1b4(%rsp)
jmp 0x49ecc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1b8(%rsp)
movl %eax, 0x1b4(%rsp)
jmp 0x49ebf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1b8(%rsp)
movl %eax, 0x1b4(%rsp)
jmp 0x49eb2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1b8(%rsp)
movl %eax, 0x1b4(%rsp)
jmp 0x49e98
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1b8(%rsp)
movl %eax, 0x1b4(%rsp)
jmp 0x49e8b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1b8(%rsp)
movl %eax, 0x1b4(%rsp)
jmp 0x49e7e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1b8(%rsp)
movl %eax, 0x1b4(%rsp)
jmp 0x49e71
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1b8(%rsp)
movl %eax, 0x1b4(%rsp)
leaq 0x248(%rsp), %rdi
callq 0xce98
leaq 0x228(%rsp), %rdi
callq 0xce98
leaq 0x170(%rsp), %rdi
callq 0xce98
leaq 0x150(%rsp), %rdi
callq 0xce98
leaq 0x14f(%rsp), %rdi
callq 0xc7a0
leaq 0x208(%rsp), %rdi
callq 0xce98
leaq 0x1e8(%rsp), %rdi
callq 0xce98
leaq 0x190(%rsp), %rdi
callq 0xce98
leaq 0x1c8(%rsp), %rdi
callq 0xce98
leaq 0x1c7(%rsp), %rdi
callq 0xc7a0
jmp 0x4a1d0
movl $0x1, %edi
callq 0xc8d0
callq 0xc090
movl $0x0, (%rax)
cmpq $0x7fffffff, 0x268(%rsp) # imm = 0x7FFFFFFF
jbe 0x4a17e
callq 0xc8c0
cmpl $0x0, %eax
jne 0x4a174
leaq 0xa7(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0xcd00
movq 0x10(%rsp), %rdx
leaq 0x83adb(%rip), %rsi     # 0xcda19
leaq 0xa8(%rsp), %rdi
callq 0x29fd0
jmp 0x49f4d
leaq 0x80(%rsp), %rdi
movl $0x642, %esi            # imm = 0x642
callq 0x2ded0
jmp 0x49f61
leaq 0xc8(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
leaq 0x80(%rsp), %rdx
callq 0x2dde0
jmp 0x49f80
leaq 0x81c1a(%rip), %rdx     # 0xcbba1
leaq 0xe8(%rsp), %rdi
leaq 0xc8(%rsp), %rsi
callq 0x2a2f0
jmp 0x49f9e
leaq 0x3f(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0xcd00
movq 0x8(%rsp), %rdx
leaq 0x84232(%rip), %rsi     # 0xce1eb
leaq 0x40(%rsp), %rdi
callq 0x29fd0
jmp 0x49fc5
leaq 0x83a4a(%rip), %rdx     # 0xcda16
leaq 0x60(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0x2a2f0
jmp 0x49fdd
leaq 0x108(%rsp), %rdi
leaq 0xe8(%rsp), %rsi
leaq 0x60(%rsp), %rdx
callq 0x2dde0
jmp 0x49ff9
leaq 0x84215(%rip), %rdx     # 0xce215
leaq 0x128(%rsp), %rdi
leaq 0x108(%rsp), %rsi
callq 0x2a2f0
jmp 0x4a017
leaq 0x128(%rsp), %rdi
callq 0x3e9b0
jmp 0x4a026
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1b8(%rsp)
movl %eax, 0x1b4(%rsp)
jmp 0x4a165
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1b8(%rsp)
movl %eax, 0x1b4(%rsp)
jmp 0x4a158
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1b8(%rsp)
movl %eax, 0x1b4(%rsp)
jmp 0x4a14b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1b8(%rsp)
movl %eax, 0x1b4(%rsp)
jmp 0x4a13e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1b8(%rsp)
movl %eax, 0x1b4(%rsp)
jmp 0x4a127
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1b8(%rsp)
movl %eax, 0x1b4(%rsp)
jmp 0x4a11d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1b8(%rsp)
movl %eax, 0x1b4(%rsp)
jmp 0x4a113
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1b8(%rsp)
movl %eax, 0x1b4(%rsp)
jmp 0x4a106
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1b8(%rsp)
movl %eax, 0x1b4(%rsp)
leaq 0x128(%rsp), %rdi
callq 0xce98
leaq 0x108(%rsp), %rdi
callq 0xce98
leaq 0x60(%rsp), %rdi
callq 0xce98
leaq 0x40(%rsp), %rdi
callq 0xce98
leaq 0x3f(%rsp), %rdi
callq 0xc7a0
leaq 0xe8(%rsp), %rdi
callq 0xce98
leaq 0xc8(%rsp), %rdi
callq 0xce98
leaq 0x80(%rsp), %rdi
callq 0xce98
leaq 0xa8(%rsp), %rdi
callq 0xce98
leaq 0xa7(%rsp), %rdi
callq 0xc7a0
jmp 0x4a1d0
movl $0x1, %edi
callq 0xc8d0
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
cqto
idivq 0x268(%rsp)
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
subq %rdx, %rax
movq %rax, 0x30(%rsp)
movq 0x28(%rsp), %rdi
callq 0x4a1e0
movq 0x28(%rsp), %rax
movq (%rax), %rax
cmpq 0x30(%rsp), %rax
jge 0x4a19a
movq 0x28(%rsp), %rax
movq (%rax), %rax
cqto
idivq 0x268(%rsp)
movq %rdx, %rax
addq $0x278, %rsp            # imm = 0x278
retq
movq 0x1b8(%rsp), %rdi
callq 0xccf0
nopl (%rax)