// File: /workspace/github_c_makefile_star2_O0/hoobaa[P]ficl/double.c
// Function: ficl2UnsignedDivide
ficl2UnsignedQR ficl2UnsignedDivide(ficl2Unsigned q, ficlUnsigned y)
{
    ficl2UnsignedQR result;
    ficl2Unsigned quotient;
    ficl2Unsigned subtrahend;
    ficl2Unsigned mask;

    quotient.low = 0;
    quotient.high = 0;
    
    subtrahend.low = y;
    subtrahend.high = 0;
    
    mask.low = 1;
    mask.high = 0;
    
    while ((ficl2UnsignedCompare(subtrahend, q) < 0) &&
           (subtrahend.high & FICL_CELL_HIGH_BIT) == 0)
    {
        mask = ficl2UnsignedArithmeticShiftLeft(mask);
        subtrahend = ficl2UnsignedArithmeticShiftLeft(subtrahend);
    }
    
    while (mask.low != 0 || mask.high != 0) 
    {
        if (ficl2UnsignedCompare(subtrahend, q) <= 0) 
        {
            q = ficl2UnsignedSubtract( q, subtrahend);
            quotient = ficl2UnsignedOr(quotient, mask);
        }
        mask = ficl2UnsignedArithmeticShiftRight(mask);
        subtrahend = ficl2UnsignedArithmeticShiftRight(subtrahend);
    }
    
    result.quotient = quotient;
    result.remainder = q.low;
    return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movq %rdi, -0xb8(%rbp)
movq %rdi, -0xb0(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x8(%rbp)
movq %rcx, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
movq $0x1, -0x40(%rbp)
movq $0x0, -0x48(%rbp)
movq -0x38(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x10(%rbp), %rdx
movq -0x8(%rbp), %rcx
callq 0x136d0
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0xb9(%rbp)
jge 0x137d4
movabsq $-0x8000000000000000, %rax # imm = 0x8000000000000000
andq -0x38(%rbp), %rax
cmpq $0x0, %rax
sete %al
movb %al, -0xb9(%rbp)
movb -0xb9(%rbp), %al
testb $0x1, %al
jne 0x137e0
jmp 0x1382f
movq -0x48(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x135a0
movq %rax, -0x58(%rbp)
movq %rdx, -0x50(%rbp)
movq -0x58(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x38(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x135a0
movq %rax, -0x68(%rbp)
movq %rdx, -0x60(%rbp)
movq -0x68(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x60(%rbp), %rax
movq %rax, -0x30(%rbp)
jmp 0x13795
jmp 0x13831
movb $0x1, %al
cmpq $0x0, -0x40(%rbp)
movb %al, -0xba(%rbp)
jne 0x1384e
cmpq $0x0, -0x48(%rbp)
setne %al
movb %al, -0xba(%rbp)
movb -0xba(%rbp), %al
testb $0x1, %al
jne 0x1385d
jmp 0x1393e
movq -0x38(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x10(%rbp), %rdx
movq -0x8(%rbp), %rcx
callq 0x136d0
cmpl $0x0, %eax
jg 0x138d7
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
movq -0x38(%rbp), %rdx
movq -0x30(%rbp), %rcx
callq 0x135f0
movq %rax, -0x78(%rbp)
movq %rdx, -0x70(%rbp)
movq -0x78(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x70(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x28(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x48(%rbp), %rdx
movq -0x40(%rbp), %rcx
callq 0x13690
movq %rax, -0x88(%rbp)
movq %rdx, -0x80(%rbp)
movq -0x88(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x80(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x48(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x13640
movq %rax, -0x98(%rbp)
movq %rdx, -0x90(%rbp)
movq -0x98(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x90(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x38(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x13640
movq %rax, -0xa8(%rbp)
movq %rdx, -0xa0(%rbp)
movq -0xa8(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0xa0(%rbp), %rax
movq %rax, -0x30(%rbp)
jmp 0x13831
movq -0xb0(%rbp), %rax
movq -0xb8(%rbp), %rcx
movq -0x28(%rbp), %rdx
movq %rdx, (%rcx)
movq -0x20(%rbp), %rdx
movq %rdx, 0x8(%rcx)
movq -0x8(%rbp), %rdx
movq %rdx, 0x10(%rcx)
addq $0xc0, %rsp
popq %rbp
retq
nopl (%rax)