// 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>::operator%(efgy::math::numeric::bigIntegers<long long, unsigned long long, unsigned int, 32u> const&) const
bigIntegers operator%(const bigIntegers &b) const {
    if (*this == zero()) {
      return zero();
    } else if (b == zero()) {
      return zero();
    } else if (b == one()) {
      return zero();
    }

    if ((cell.size() <= cellsPerLong) && (b.cell.size() <= cellsPerLong)) {
      return bigIntegers((*this).toInteger() % (b).toInteger(), negative);
    }

    bigIntegers r;
    const bigIntegers &ap = negative ? -*this : *this;
    const bigIntegers &bp = b.negative ? -b : b;

    if (b.cell.size() == 1) {
      r.doModuloHorner(ap, b.cell[0]);
    } /*
                              else if (b.cell.size() < (cellsPerLong - 1))
                              {
                                  r.doModuloHorner(ap, bp);
                              }
      */
    else {
      r.doModulo(ap, bp);
    }

    r.negative = negative;

    return r;
  }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x40, %rsp
movq %rdi, %rbx
movq 0x8(%rsi), %rdi
movq 0x10(%rsi), %r8
subq %rdi, %r8
je 0x18b95
movq %rdx, %r15
movq %rsi, %r14
movq 0x8(%rdx), %rdx
movq 0x10(%r15), %rsi
subq %rdx, %rsi
je 0x18b95
cmpq $0x4, %rsi
jne 0x18bb4
cmpb $0x0, (%r15)
jne 0x18bb4
cmpl $0x1, (%rdx)
jne 0x18bb4
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rbx)
movq $0x0, 0x18(%rbx)
movb $0x0, (%rbx)
movq %rbx, %rax
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq 0x10(%r14), %rax
subq %rdi, %rax
cmpq $0x8, %rax
ja 0x18c2f
movq 0x10(%r15), %rax
subq %rdx, %rax
cmpq $0x8, %rax
ja 0x18c2f
sarq $0x2, %r8
xorl %ecx, %ecx
xorl %r9d, %r9d
xorl %eax, %eax
movl (%rdi,%r9,4), %r10d
shlq %cl, %r10
orq %r10, %rax
incq %r9
movl %r9d, %r10d
addl $0x20, %ecx
cmpq %r10, %r8
ja 0x18bd9
sarq $0x2, %rsi
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %edi, %edi
movl (%rdx,%r8,4), %r9d
shlq %cl, %r9
orq %r9, %rdi
incq %r8
movl %r8d, %r9d
addl $0x20, %ecx
cmpq %r9, %rsi
ja 0x18bfc
xorl %edx, %edx
divq %rdi
movzbl (%r14), %eax
movq %rbx, %rdi
movq %rdx, %rsi
movl %eax, %edx
callq 0x18694
jmp 0x18ba7
movb $0x0, (%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rbx)
movq $0x0, 0x18(%rbx)
movb (%r14), %al
cmpb $0x1, %al
jne 0x18c55
movq %rsp, %rdi
movq %r14, %rsi
callq 0x18b2e
jmp 0x18c76
leaq 0x8(%r14), %rsi
leaq 0x8(%rsp), %rdi
movb %al, -0x8(%rdi)
callq 0x18aae
movq 0x10(%rsp), %rax
cmpq 0x8(%rsp), %rax
jne 0x18c76
movb $0x0, (%rsp)
movb (%r15), %al
cmpb $0x1, %al
jne 0x18c8c
leaq 0x20(%rsp), %rdi
movq %r15, %rsi
callq 0x18b2e
jmp 0x18cae
leaq 0x8(%r15), %rsi
leaq 0x28(%rsp), %rdi
movb %al, -0x8(%rdi)
callq 0x18aae
movq 0x30(%rsp), %rax
cmpq 0x28(%rsp), %rax
jne 0x18cae
movb $0x0, 0x20(%rsp)
movq 0x8(%r15), %rdx
movq 0x10(%r15), %rax
subq %rdx, %rax
cmpq $0x4, %rax
jne 0x18cd1
movq %rsp, %rsi
movq %rbx, %rdi
movl $0x1, %ecx
callq 0x191b8
jmp 0x18ce6
movq %rsp, %rsi
leaq 0x20(%rsp), %rdx
movq %rbx, %rdi
movl $0x1, %ecx
callq 0x1923e
movb (%r14), %al
movb %al, (%rbx)
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x18d02
movq 0x38(%rsp), %rsi
subq %rdi, %rsi
callq 0x4260
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x18ba7
movq 0x18(%rsp), %rsi
subq %rdi, %rsi
callq 0x4260
jmp 0x18ba7
movq %rax, %r14
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x18d41
movq 0x38(%rsp), %rsi
subq %rdi, %rsi
callq 0x4260
jmp 0x18d41
movq %rax, %r14
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x18d5d
movq 0x18(%rsp), %rsi
subq %rdi, %rsi
callq 0x4260
jmp 0x18d5d
movq %rax, %r14
leaq 0x8(%rbx), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x18d75
movq 0x18(%rbx), %rsi
subq %rdi, %rsi
callq 0x4260
movq %r14, %rdi
callq 0x43f0