// File: /workspace/github_cpp_makefile_star2_O1/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 $0x28, %rsp
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
movq 0x8(%rsi), %rdx
movq 0x10(%rsi), %rsi
subq %rdx, %rsi
sarq $0x2, %rsi
cmpq $0x2, %rsi
ja 0x1980c
movq 0x8(%r15), %rax
movq 0x10(%r15), %rdi
subq %rax, %rdi
cmpq $0x8, %rdi
ja 0x1980c
movq 0x10(%r14), %rdi
xorl %ecx, %ecx
subq %rdx, %rdi
je 0x1990a
sarq $0x2, %rdi
xorl %r8d, %r8d
xorl %esi, %esi
movl (%rdx,%r8,4), %r9d
shlq %cl, %r9
orq %r9, %rsi
incq %r8
movl %r8d, %r9d
addl $0x20, %ecx
cmpq %r9, %rdi
ja 0x197ef
jmp 0x1990c
testb %cl, %cl
je 0x19819
leaq 0x8(%rbx), %rdi
callq 0x182f2
movq 0x8(%rbx), %rax
movq 0x10(%rbx), %rdx
movq %rdx, %rcx
subq %rax, %rcx
subq %rax, %rdx
je 0x19905
movq %rbx, (%rsp)
sarq $0x2, %rcx
movq 0x8(%r14), %rsi
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, %r11b
xorl %r10d, %r10d
xorl %r15d, %r15d
movl $0x0, %ebp
cmpq %r15, %rdi
jbe 0x1986d
movl (%rsi,%r15,4), %ebp
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
cmpq %r15, %r9
jbe 0x1987f
movl (%r8,%r15,4), %r13d
notl %r13d
movl %r13d, %r12d
incl %r12d
sete %bl
testb $0x1, %r11b
jne 0x19891
movl %r13d, %r12d
andb %bl, %r11b
testb $0x1, %r11b
movl %r12d, %ebx
cmovnel %r10d, %ebx
addl %ebp, %ebx
setb %bpl
movl %ebx, (%rax,%r15,4)
orb %r11b, %bpl
cmpl %r12d, %ebx
setb %r11b
orb %bpl, %r11b
andb $0x1, %r11b
incq %r15
movl %r15d, %ebx
cmpq %rbx, %rcx
ja 0x1985f
movq 0x10(%r14), %rcx
cmpq 0x8(%r14), %rcx
je 0x198ee
movl -0x4(%rcx), %esi
movl $0x1f, %ecx
movl $0x1, %edi
shll %cl, %edi
btl %ecx, %esi
jb 0x198ee
notl %edi
andl %edi, -0x4(%rax,%rdx)
addl $-0x1, %ecx
jb 0x198d7
movq (%rsp), %rdi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x18a56
movb $0x0, (%rbx)
jmp 0x19981
xorl %esi, %esi
movq 0x10(%r15), %rdx
xorl %ecx, %ecx
subq %rax, %rdx
je 0x1993a
sarq $0x2, %rdx
xorl %r8d, %r8d
xorl %edi, %edi
movl (%rax,%r8,4), %r9d
shlq %cl, %r9
orq %r9, %rdi
incq %r8
movl %r8d, %r9d
addl $0x20, %ecx
cmpq %r9, %rdx
ja 0x19920
jmp 0x1993c
xorl %edi, %edi
subq %rdi, %rsi
movzbl (%rbx), %edx
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x18694
cmpq %rbx, %r14
je 0x1996a
leaq 0x10(%rsp), %rsi
movb -0x8(%rsi), %al
movb %al, (%rbx)
addq $0x8, %rbx
movq %rbx, %rdi
callq 0x18980
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x19981
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x4260
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x199aa
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x4260
movq %rbx, %rdi
callq 0x43f0