// File: 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 %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x98(%rbp)
movq %rdi, %rax
movq %rax, -0x90(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0x88(%rbp)
leaq -0x19(%rbp), %rsi
callq 0x3d1a0
testb $0x1, %al
jne 0x3e7c2
jmp 0x3e7d7
movq -0x98(%rbp), %rdi
leaq -0x1a(%rbp), %rsi
callq 0x3f200
jmp 0x3ea1b
movq -0x18(%rbp), %rdi
leaq -0x1b(%rbp), %rsi
callq 0x3d1a0
testb $0x1, %al
jne 0x3e7ea
jmp 0x3e7ff
movq -0x98(%rbp), %rdi
leaq -0x1c(%rbp), %rsi
callq 0x3f200
jmp 0x3ea1b
movq -0x18(%rbp), %rdi
leaq -0x1d(%rbp), %rsi
callq 0x3f230
testb $0x1, %al
jne 0x3e812
jmp 0x3e827
movq -0x98(%rbp), %rdi
leaq -0x1e(%rbp), %rsi
callq 0x3f200
jmp 0x3ea1b
jmp 0x3e829
jmp 0x3e82b
movq -0x88(%rbp), %rdi
addq $0x8, %rdi
callq 0x3c9c0
cmpq $0x2, %rax
ja 0x3e8a1
movq -0x18(%rbp), %rdi
addq $0x8, %rdi
callq 0x3c9c0
cmpq $0x2, %rax
ja 0x3e8a1
movq -0x88(%rbp), %rdi
callq 0x3d1f0
movq %rax, -0xa0(%rbp)
movq -0x18(%rbp), %rdi
callq 0x3d1f0
movq -0x98(%rbp), %rdi
movq %rax, %rcx
movq -0xa0(%rbp), %rax
xorl %edx, %edx
divq %rcx
movq -0x88(%rbp), %rax
movq %rdx, %rsi
movb (%rax), %al
andb $0x1, %al
movzbl %al, %edx
callq 0x3d290
jmp 0x3ea1b
movq -0x98(%rbp), %rdi
movb $0x0, -0x1f(%rbp)
callq 0x3e410
movq -0x88(%rbp), %rax
testb $0x1, (%rax)
je 0x3e8d1
movq -0x88(%rbp), %rsi
leaq -0x48(%rbp), %rdi
callq 0x3e6d0
jmp 0x3e8cf
jmp 0x3e8e5
movq -0x88(%rbp), %rsi
leaq -0x48(%rbp), %rdi
callq 0x3e3b0
jmp 0x3e8e3
jmp 0x3e8e5
leaq -0x48(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rax
testb $0x1, (%rax)
je 0x3e907
movq -0x18(%rbp), %rsi
leaq -0x80(%rbp), %rdi
callq 0x3e6d0
jmp 0x3e905
jmp 0x3e918
movq -0x18(%rbp), %rsi
leaq -0x80(%rbp), %rdi
callq 0x3e3b0
jmp 0x3e916
jmp 0x3e918
leaq -0x80(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x18(%rbp), %rdi
addq $0x8, %rdi
callq 0x3c9c0
cmpq $0x1, %rax
jne 0x3e9a4
movq -0x28(%rbp), %rax
movq %rax, -0xa8(%rbp)
movq -0x18(%rbp), %rdi
addq $0x8, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x3d8a0
movq -0x98(%rbp), %rdi
movq -0xa8(%rbp), %rsi
movq %rax, %rdx
movl $0x1, %ecx
callq 0x3f2a0
jmp 0x3e96c
jmp 0x3e9c1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x3ea0d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x3e9f4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x10260
jmp 0x3e9f4
movq -0x98(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x60(%rbp), %rdx
movl $0x1, %ecx
callq 0x3f3b0
jmp 0x3e9bf
jmp 0x3e9c1
movq -0x98(%rbp), %rax
movq -0x88(%rbp), %rcx
movb (%rcx), %cl
andb $0x1, %cl
movb %cl, (%rax)
movb $0x1, -0x1f(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x10260
leaq -0x48(%rbp), %rdi
callq 0x10260
testb $0x1, -0x1f(%rbp)
jne 0x3ea0b
jmp 0x3e9ff
leaq -0x48(%rbp), %rdi
callq 0x10260
jmp 0x3ea0d
movq -0x98(%rbp), %rdi
callq 0x10260
jmp 0x3ea1b
movq -0x98(%rbp), %rdi
callq 0x10260
jmp 0x3ea2b
movq -0x90(%rbp), %rax
addq $0xb0, %rsp
popq %rbp
retq
movq -0x50(%rbp), %rdi
callq 0x55e0
nopw %cs:(%rax,%rax)
nop