// File: redpony[P]cpyp/./cpyp/crp.h
// Function: int cpyp::crp<int, std::hash<int>>::decrement<cpyp::MT19937>(int const&, cpyp::MT19937&, double*)
int decrement(const Dish& dish, Engine& eng, double* logq = nullptr) {
    crp_table_manager<1>& loc = dish_locs_[dish];
    assert(loc.num_customers());
    if (loc.num_customers() == 1) {
      update_llh_remove_customer_from_table_seating(1);
      dish_locs_.erase(dish);
      --num_tables_;
      --num_customers_;
      // q = 1 since this is the first customer
      return -1;
    } else {
      unsigned selected_table_postcount = 0;
      int delta = loc.remove_customer(eng, &selected_table_postcount).second;
      update_llh_remove_customer_from_table_seating(
          selected_table_postcount + 1);
      --num_customers_;
      if (delta) {
        --num_tables_;
      }

      if (logq) {
        double p_empty = (strength_ + num_tables_ * discount_);
        double p_share = (loc.num_customers() - loc.num_tables() * discount_);
        const double z = p_empty + p_share;
        p_empty /= z;
        p_share /= z;
        if (selected_table_postcount) {
          *logq += log(p_share * (selected_table_postcount - discount_) /
                     (loc.num_customers() - loc.num_tables() * discount_));
        } else {
          *logq += log(p_empty);
        }
      }
      return delta;
    }
  }

// Assembly:
subq $0x78, %rsp
movq %rdi, 0x68(%rsp)
movq %rsi, 0x60(%rsp)
movq %rdx, 0x58(%rsp)
movq %rcx, 0x50(%rsp)
movq 0x68(%rsp), %rdi
movq %rdi, 0x18(%rsp)
addq $0x8, %rdi
movq 0x60(%rsp), %rsi
callq 0xc9c0
movq %rax, 0x48(%rsp)
movq 0x48(%rsp), %rdi
callq 0xc9f0
cmpl $0x0, %eax
je 0x6116
jmp 0x6135
leaq 0xf6ac(%rip), %rdi      # 0x157c9
leaq 0xf490(%rip), %rsi      # 0x155b4
movl $0xd5, %edx
leaq 0xf6ad(%rip), %rcx      # 0x157dd
callq 0x20e0
movq 0x48(%rsp), %rdi
callq 0xc9f0
cmpl $0x1, %eax
jne 0x6188
movq 0x18(%rsp), %rdi
movl $0x1, %esi
callq 0xca00
movq 0x18(%rsp), %rdi
addq $0x8, %rdi
movq 0x60(%rsp), %rsi
callq 0xcb20
movq 0x18(%rsp), %rax
movl (%rax), %ecx
addl $-0x1, %ecx
movl %ecx, (%rax)
movl 0x4(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x4(%rax)
movl $0xffffffff, 0x74(%rsp) # imm = 0xFFFFFFFF
jmp 0x6379
movl $0x0, 0x44(%rsp)
movq 0x48(%rsp), %rdi
movq 0x58(%rsp), %rsi
leaq 0x44(%rsp), %rdx
callq 0xcb50
movq 0x18(%rsp), %rdi
movq %rax, 0x38(%rsp)
movl 0x3c(%rsp), %eax
movl %eax, 0x40(%rsp)
movl 0x44(%rsp), %esi
addl $0x1, %esi
callq 0xca00
movq 0x18(%rsp), %rax
movl 0x4(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x4(%rax)
cmpl $0x0, 0x40(%rsp)
je 0x61e3
movq 0x18(%rsp), %rax
movl (%rax), %ecx
addl $-0x1, %ecx
movl %ecx, (%rax)
cmpq $0x0, 0x50(%rsp)
je 0x6371
movq 0x18(%rsp), %rax
movsd 0x48(%rax), %xmm1
movl (%rax), %ecx
cvtsi2sd %rcx, %xmm0
movsd 0x40(%rax), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x30(%rsp)
movq 0x48(%rsp), %rdi
callq 0xc9f0
movl %eax, %eax
cvtsi2sd %rax, %xmm0
movsd %xmm0, 0x10(%rsp)
movq 0x48(%rsp), %rdi
callq 0xb2e0
movsd 0x10(%rsp), %xmm1
movl %eax, %ecx
movq 0x18(%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, 0x28(%rsp)
movsd 0x30(%rsp), %xmm0
addsd 0x28(%rsp), %xmm0
movsd %xmm0, 0x20(%rsp)
movsd 0x20(%rsp), %xmm1
movsd 0x30(%rsp), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, 0x30(%rsp)
movsd 0x20(%rsp), %xmm1
movsd 0x28(%rsp), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, 0x28(%rsp)
cmpl $0x0, 0x44(%rsp)
je 0x6357
movq 0x18(%rsp), %rax
movsd 0x28(%rsp), %xmm0
movl 0x44(%rsp), %ecx
cvtsi2sd %rcx, %xmm1
movsd 0x40(%rax), %xmm2
subsd %xmm2, %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, 0x8(%rsp)
movq 0x48(%rsp), %rdi
callq 0xc9f0
movl %eax, %eax
cvtsi2sd %rax, %xmm0
movsd %xmm0, (%rsp)
movq 0x48(%rsp), %rdi
callq 0xb2e0
movsd (%rsp), %xmm2
movsd 0x8(%rsp), %xmm0
movl %eax, %ecx
movq 0x18(%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 0x50(%rsp), %rax
addsd (%rax), %xmm0
movsd %xmm0, (%rax)
jmp 0x636f
movsd 0x30(%rsp), %xmm0
callq 0x2130
movq 0x50(%rsp), %rax
addsd (%rax), %xmm0
movsd %xmm0, (%rax)
jmp 0x6371
movl 0x40(%rsp), %eax
movl %eax, 0x74(%rsp)
movl 0x74(%rsp), %eax
addq $0x78, %rsp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)