// File: /workspace/github_cpp_makefile_star2_O3/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), %rax
movq %rax, %r8
subq %rdi, %r8
je 0x18c7a
movq %rdx, %r15
movq %rsi, %r14
movq 0x8(%rdx), %rdx
movq 0x10(%r15), %rsi
subq %rdx, %rsi
je 0x18c7a
cmpq $0x4, %rsi
jne 0x18c99
cmpb $0x0, (%r15)
jne 0x18c99
cmpl $0x1, (%rdx)
jne 0x18d14
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
subq %rdi, %rax
cmpq $0x9, %rax
setb %cl
cmpq $0x9, %rsi
setb %r9b
movq %rax, %r8
testb %r9b, %cl
je 0x18d1a
shrq $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 0x18cbe
shrq $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 0x18ce1
xorl %edx, %edx
divq %rdi
movzbl (%r14), %eax
movq %rbx, %rdi
movq %rdx, %rsi
movl %eax, %edx
callq 0x18782
jmp 0x18c8c
cmpq $0x8, %r8
jbe 0x18cb3
leaq 0x8(%r14), %rsi
movb $0x0, (%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rbx)
movq $0x0, 0x18(%rbx)
movb (%r14), %al
leaq 0x8(%rsp), %rdi
movb %al, -0x8(%rdi)
cmpb $0x1, %al
jne 0x18d64
callq 0x18bb6
movq 0x10(%rsp), %rax
movb (%rsp), %cl
xorb $0x1, %cl
cmpq 0x8(%rsp), %rax
movzbl %cl, %eax
movl $0x1, %ecx
cmovnel %eax, %ecx
movb %cl, (%rsp)
jmp 0x18d79
callq 0x18bb6
movq 0x10(%rsp), %rax
cmpq 0x8(%rsp), %rax
jne 0x18d79
movb $0x0, (%rsp)
leaq 0x8(%r15), %rsi
movb (%r15), %al
leaq 0x28(%rsp), %rdi
movb %al, -0x8(%rdi)
cmpb $0x1, %al
jne 0x18db3
callq 0x18bb6
movq 0x30(%rsp), %rax
movb 0x20(%rsp), %cl
xorb $0x1, %cl
cmpq 0x28(%rsp), %rax
movzbl %cl, %eax
movl $0x1, %ecx
cmovnel %eax, %ecx
movb %cl, 0x20(%rsp)
jmp 0x18dc9
callq 0x18bb6
movq 0x30(%rsp), %rax
cmpq 0x28(%rsp), %rax
jne 0x18dc9
movb $0x0, 0x20(%rsp)
movq 0x8(%r15), %rdx
movq 0x10(%r15), %rax
subq %rdx, %rax
cmpq $0x4, %rax
jne 0x18dec
movq %rsp, %rsi
movq %rbx, %rdi
movl $0x1, %ecx
callq 0x192e4
jmp 0x18e01
movq %rsp, %rsi
leaq 0x20(%rsp), %rdx
movq %rbx, %rdi
movl $0x1, %ecx
callq 0x1936a
movb (%r14), %al
movb %al, (%rbx)
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x18e1d
movq 0x38(%rsp), %rsi
subq %rdi, %rsi
callq 0x4260
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x18c8c
movq 0x18(%rsp), %rsi
subq %rdi, %rsi
callq 0x4260
jmp 0x18c8c
movq %rax, %r14
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x18e5c
movq 0x38(%rsp), %rsi
subq %rdi, %rsi
callq 0x4260
jmp 0x18e5c
movq %rax, %r14
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x18e78
movq 0x18(%rsp), %rsi
subq %rdi, %rsi
callq 0x4260
jmp 0x18e78
movq %rax, %r14
leaq 0x8(%rbx), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x18e90
movq 0x18(%rbx), %rsi
subq %rdi, %rsi
callq 0x4260
movq %r14, %rdi
callq 0x43f0