// File: redpony[P]cpyp/./cpyp/crp.h
// Function: int cpyp::crp<int, std::hash<int>>::increment_no_base<cpyp::MT19937>(int const&, cpyp::MT19937&, double*)
int increment_no_base(const Dish& dish, Engine& eng, double* logq) {
    crp_table_manager<1>& loc = dish_locs_[dish];
    bool share_table = false;
    if (loc.num_customers()) {
      const double p_empty = strength_ + num_tables_ * discount_;
      const double p_share = loc.num_customers() - loc.num_tables() * discount_;
      share_table = sample_bernoulli(p_empty, p_share, eng);

      // probability of sharing a table | dish
      *logq += log((share_table ? p_share : p_empty) / (p_empty + p_share));
    }

    if (share_table) {
      const unsigned selected_table_prevcount = loc.share_table(discount_, eng);
      // probability of picking this particlar table to share | dish
      *logq += log((selected_table_prevcount - discount_) /
                  (loc.num_customers() - 1 - loc.num_tables() * discount_));
      update_llh_add_customer_to_table_seating(selected_table_prevcount);
    } else {
      update_llh_add_customer_to_table_seating(0);
      loc.create_table();
      ++num_tables_;
    }
    ++num_customers_;
    return (share_table ? 0 : 1);
  }

// Assembly:
subq $0x78, %rsp
movq %rdi, 0x70(%rsp)
movq %rsi, 0x68(%rsp)
movq %rdx, 0x60(%rsp)
movq %rcx, 0x58(%rsp)
movq 0x70(%rsp), %rdi
movq %rdi, 0x28(%rsp)
addq $0x8, %rdi
movq 0x68(%rsp), %rsi
callq 0xc9c0
movq %rax, 0x50(%rsp)
movb $0x0, 0x4f(%rsp)
movq 0x50(%rsp), %rdi
callq 0xc9f0
cmpl $0x0, %eax
je 0x68db
movq 0x28(%rsp), %rax
movsd 0x48(%rax), %xmm1
movl (%rax), %ecx
cvtsi2sd %rcx, %xmm0
movsd 0x40(%rax), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x40(%rsp)
movq 0x50(%rsp), %rdi
callq 0xc9f0
movl %eax, %eax
cvtsi2sd %rax, %xmm0
movsd %xmm0, 0x20(%rsp)
movq 0x50(%rsp), %rdi
callq 0xb2e0
movsd 0x20(%rsp), %xmm1
movl %eax, %ecx
movq 0x28(%rsp), %rax
movl %ecx, %ecx
cvtsi2sd %rcx, %xmm0
movsd 0x40(%rax), %xmm2
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x38(%rsp)
movsd 0x40(%rsp), %xmm0
movsd 0x38(%rsp), %xmm1
movq 0x60(%rsp), %rdi
callq 0x6ae0
cmpl $0x0, %eax
setne %al
andb $0x1, %al
movb %al, 0x4f(%rsp)
testb $0x1, 0x4f(%rsp)
je 0x68a7
movsd 0x38(%rsp), %xmm0
movsd %xmm0, 0x18(%rsp)
jmp 0x68b3
movsd 0x40(%rsp), %xmm0
movsd %xmm0, 0x18(%rsp)
movsd 0x18(%rsp), %xmm0
movsd 0x40(%rsp), %xmm1
addsd 0x38(%rsp), %xmm1
divsd %xmm1, %xmm0
callq 0x2130
movq 0x58(%rsp), %rax
addsd (%rax), %xmm0
movsd %xmm0, (%rax)
testb $0x1, 0x4f(%rsp)
je 0x69a7
movq 0x28(%rsp), %rax
movq 0x50(%rsp), %rdi
movsd 0x40(%rax), %xmm0
movq 0x60(%rsp), %rsi
callq 0xfce0
movl %eax, %ecx
movq 0x28(%rsp), %rax
movl %ecx, 0x34(%rsp)
movl 0x34(%rsp), %ecx
cvtsi2sd %rcx, %xmm0
movsd 0x40(%rax), %xmm1
subsd %xmm1, %xmm0
movsd %xmm0, 0x10(%rsp)
movq 0x50(%rsp), %rdi
callq 0xc9f0
decl %eax
cvtsi2sd %rax, %xmm0
movsd %xmm0, 0x8(%rsp)
movq 0x50(%rsp), %rdi
callq 0xb2e0
movsd 0x8(%rsp), %xmm2
movsd 0x10(%rsp), %xmm0
movl %eax, %ecx
movq 0x28(%rsp), %rax
movl %ecx, %ecx
cvtsi2sd %rcx, %xmm1
movsd 0x40(%rax), %xmm3
movq %xmm1, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
mulsd %xmm3, %xmm1
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
callq 0x2130
movq 0x28(%rsp), %rdi
movq 0x58(%rsp), %rax
addsd (%rax), %xmm0
movsd %xmm0, (%rax)
movl 0x34(%rsp), %esi
callq 0xfdf0
jmp 0x69cb
movq 0x28(%rsp), %rdi
xorl %esi, %esi
callq 0xfdf0
movq 0x50(%rsp), %rdi
xorl %esi, %esi
callq 0xfee0
movq 0x28(%rsp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movq 0x28(%rsp), %rax
movl 0x4(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x4(%rax)
movb 0x4f(%rsp), %dl
movl $0x1, %eax
xorl %ecx, %ecx
testb $0x1, %dl
cmovnel %ecx, %eax
addq $0x78, %rsp
retq
nop