// File: /workspace/github_cpp_makefile_star2_O2/ef-gy[P]libefgy/include/ef.gy/big-integers.h
// Function: efgy::math::numeric::bigIntegers<long long, unsigned long long, unsigned int, 32u>::doSubtract(efgy::math::numeric::bigIntegers<long long, unsigned long long, unsigned int, 32u> const&, efgy::math::numeric::bigIntegers<long long, unsigned long long, unsigned int, 32u> const&, bool)
void doSubtract(const bigIntegers &a, const bigIntegers &b,
                  bool allocate = true) {
    if ((a.cell.size() <= cellsPerLong) && (b.cell.size() <= cellsPerLong)) {
      *this = bigIntegers((a).toInteger() - (b).toInteger(), negative);
      return;
    }

    bool overflow = true;

    if (allocate) {
      cell.resize(a.cell.size());
    }

    if (cell.size() == 0) {
      negative = false;
      return;
    }

    for (cellType i = 0; i < cell.size(); i++) {
      cellType av = (i < a.cell.size()) ? a.cell[i] : 0;
      cellType bv = ~((i < b.cell.size()) ? b.cell[i] : 0);

      if (overflow) {
        bv = bv + 1;

        overflow = (bv == 0);
      }

      cell[i] = (overflow ? av : (av + bv));

      overflow = overflow || ((cell[i] < av) || (cell[i] < bv));
    }

    if (a.cell.size() > 0) {
      cellType &l = cell[(cell.size() - 1)];
      cellType o = a.cell[(a.cell.size() - 1)];

      unsigned int j = cellBitCount;

      do {
        j--;

        if (!(o & (1 << j))) {
          l &= ~cellType(1 << j);
        } else {
          break;
        }
      } while (j > 0);
    }

    shrink();
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
movq 0x10(%rsi), %rsi
subq 0x8(%r14), %rsi
sarq $0x2, %rsi
cmpq $0x2, %rsi
ja 0x1628a
movq 0x10(%r15), %rax
subq 0x8(%r15), %rax
cmpq $0x8, %rax
ja 0x1628a
movq %r14, %rdi
callq 0x15408
movq %rax, %r14
movq %r15, %rdi
callq 0x15408
subq %rax, %r14
movzbl (%rbx), %edx
leaq 0x18(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x1543a
movq %rbx, %rdi
movq %r15, %rsi
callq 0x154e0
leaq 0x20(%rsp), %rdi
callq 0x127b2
jmp 0x16397
testb %cl, %cl
je 0x16297
leaq 0x8(%rbx), %rdi
callq 0x150d6
movq 0x8(%rbx), %rax
movq 0x10(%rbx), %rdx
movq %rdx, %rcx
subq %rax, %rcx
subq %rax, %rdx
je 0x16394
movq %rbx, 0x10(%rsp)
sarq $0x2, %rcx
movq 0x8(%r14), %rsi
movq %r14, 0x8(%rsp)
movq 0x10(%r14), %rdi
subq %rsi, %rdi
sarq $0x2, %rdi
movq 0x8(%r15), %r8
movq 0x10(%r15), %r9
subq %r8, %r9
sarq $0x2, %r9
movb $0x1, %bpl
xorl %r10d, %r10d
pushq $-0x1
popq %rbx
xorl %r11d, %r11d
movl %r11d, %r15d
cmpq %r15, %rcx
jbe 0x1634c
xorl %r12d, %r12d
cmpq %r15, %rdi
jbe 0x162fa
movl (%rsi,%r15,4), %r12d
movl %ebx, %r11d
cmpq %r15, %r9
jbe 0x16309
movl (%r8,%r15,4), %r11d
notl %r11d
movl %r11d, %r13d
incl %r13d
sete %r14b
testb $0x1, %bpl
jne 0x1631c
movl %r11d, %r13d
andb %r14b, %bpl
testb $0x1, %bpl
movl %r13d, %r11d
cmovnel %r10d, %r11d
addl %r12d, %r11d
setb %r14b
movl %r11d, (%rax,%r15,4)
orb %bpl, %r14b
cmpl %r13d, %r11d
setb %bpl
orb %r14b, %bpl
andb $0x1, %bpl
leal 0x1(%r15), %r11d
jmp 0x162e6
movq 0x8(%rsp), %rsi
movq 0x10(%rsi), %rcx
cmpq 0x8(%rsi), %rcx
je 0x1637c
movl -0x4(%rcx), %esi
pushq $0x1f
popq %rcx
pushq $0x1
popq %rdi
movl %edi, %r8d
shll %cl, %r8d
btl %ecx, %esi
jb 0x1637c
notl %r8d
andl %r8d, -0x4(%rax,%rdx)
addl $-0x1, %ecx
jb 0x16364
movq 0x10(%rsp), %rdi
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1580e
movb $0x0, (%rbx)
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x127b2
movq %rbx, %rdi
callq 0x4430
nop