// File: /workspace/github_c_makefile_star2_O0/mbitsnbites[P]SoftFP/softfloat.c
// Function: float128_div
float128 float128_div(float128 a, float128 b, float_status *status)
{
    flag aSign, bSign, zSign;
    int32 aExp, bExp, zExp;
    uint64_t aSig0, aSig1, bSig0, bSig1, zSig0, zSig1, zSig2;
    uint64_t rem0, rem1, rem2, rem3, term0, term1, term2, term3;
    float128 z;

    aSig1 = extractFloat128Frac1( a );
    aSig0 = extractFloat128Frac0( a );
    aExp = extractFloat128Exp( a );
    aSign = extractFloat128Sign( a );
    bSig1 = extractFloat128Frac1( b );
    bSig0 = extractFloat128Frac0( b );
    bExp = extractFloat128Exp( b );
    bSign = extractFloat128Sign( b );
    zSign = aSign ^ bSign;
    if ( aExp == 0x7FFF ) {
        if (aSig0 | aSig1) {
            return propagateFloat128NaN(a, b, status);
        }
        if ( bExp == 0x7FFF ) {
            if (bSig0 | bSig1) {
                return propagateFloat128NaN(a, b, status);
            }
            goto invalid;
        }
        return packFloat128( zSign, 0x7FFF, 0, 0 );
    }
    if ( bExp == 0x7FFF ) {
        if (bSig0 | bSig1) {
            return propagateFloat128NaN(a, b, status);
        }
        return packFloat128( zSign, 0, 0, 0 );
    }
    if ( bExp == 0 ) {
        if ( ( bSig0 | bSig1 ) == 0 ) {
            if ( ( aExp | aSig0 | aSig1 ) == 0 ) {
 invalid:
                float_raise(float_flag_invalid, status);
                z.low = float128_default_nan_low;
                z.high = float128_default_nan_high;
                return z;
            }
            float_raise(float_flag_divbyzero, status);
            return packFloat128( zSign, 0x7FFF, 0, 0 );
        }
        normalizeFloat128Subnormal( bSig0, bSig1, &bExp, &bSig0, &bSig1 );
    }
    if ( aExp == 0 ) {
        if ( ( aSig0 | aSig1 ) == 0 ) return packFloat128( zSign, 0, 0, 0 );
        normalizeFloat128Subnormal( aSig0, aSig1, &aExp, &aSig0, &aSig1 );
    }
    zExp = aExp - bExp + 0x3FFD;
    shortShift128Left(
        aSig0 | LIT64( 0x0001000000000000 ), aSig1, 15, &aSig0, &aSig1 );
    shortShift128Left(
        bSig0 | LIT64( 0x0001000000000000 ), bSig1, 15, &bSig0, &bSig1 );
    if ( le128( bSig0, bSig1, aSig0, aSig1 ) ) {
        shift128Right( aSig0, aSig1, 1, &aSig0, &aSig1 );
        ++zExp;
    }
    zSig0 = estimateDiv128To64( aSig0, aSig1, bSig0 );
    mul128By64To192( bSig0, bSig1, zSig0, &term0, &term1, &term2 );
    sub192( aSig0, aSig1, 0, term0, term1, term2, &rem0, &rem1, &rem2 );
    while ( (int64_t) rem0 < 0 ) {
        --zSig0;
        add192( rem0, rem1, rem2, 0, bSig0, bSig1, &rem0, &rem1, &rem2 );
    }
    zSig1 = estimateDiv128To64( rem1, rem2, bSig0 );
    if ( ( zSig1 & 0x3FFF ) <= 4 ) {
        mul128By64To192( bSig0, bSig1, zSig1, &term1, &term2, &term3 );
        sub192( rem1, rem2, 0, term1, term2, term3, &rem1, &rem2, &rem3 );
        while ( (int64_t) rem1 < 0 ) {
            --zSig1;
            add192( rem1, rem2, rem3, 0, bSig0, bSig1, &rem1, &rem2, &rem3 );
        }
        zSig1 |= ( ( rem1 | rem2 | rem3 ) != 0 );
    }
    shift128ExtraRightJamming( zSig0, zSig1, 0, 15, &zSig0, &zSig1, &zSig2 );
    return roundAndPackFloat128(zSign, zExp, zSig0, zSig1, zSig2, status);

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xf0, %rsp
movq %rdi, -0x20(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x30(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x38(%rbp)
movq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x1e410
movq %rax, -0x58(%rbp)
movq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x1e430
movq %rax, -0x50(%rbp)
movq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x1e450
movl %eax, -0x40(%rbp)
movq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x1e470
movb %al, -0x39(%rbp)
movq -0x30(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x1e410
movq %rax, -0x68(%rbp)
movq -0x30(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x1e430
movq %rax, -0x60(%rbp)
movq -0x30(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x1e450
movl %eax, -0x44(%rbp)
movq -0x30(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x1e470
movb %al, -0x3a(%rbp)
movzbl -0x39(%rbp), %eax
movzbl -0x3a(%rbp), %ecx
xorl %ecx, %eax
movb %al, -0x3b(%rbp)
cmpl $0x7fff, -0x40(%rbp)    # imm = 0x7FFF
jne 0x20aa5
movq -0x50(%rbp), %rax
orq -0x58(%rbp), %rax
cmpq $0x0, %rax
je 0x20a41
movq -0x38(%rbp), %r8
movq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq -0x28(%rbp), %rcx
callq 0x1f480
movq %rax, -0x10(%rbp)
movq %rdx, -0x8(%rbp)
jmp 0x20efe
cmpl $0x7fff, -0x44(%rbp)    # imm = 0x7FFF
jne 0x20a83
movq -0x60(%rbp), %rax
orq -0x68(%rbp), %rax
cmpq $0x0, %rax
je 0x20a7e
movq -0x38(%rbp), %r8
movq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq -0x28(%rbp), %rcx
callq 0x1f480
movq %rax, -0x10(%rbp)
movq %rdx, -0x8(%rbp)
jmp 0x20efe
jmp 0x20b31
movl $0x7fff, %esi           # imm = 0x7FFF
xorl %eax, %eax
movl %eax, %ecx
movzbl -0x3b(%rbp), %edi
movq %rcx, %rdx
callq 0x11a80
movq %rax, -0x10(%rbp)
movq %rdx, -0x8(%rbp)
jmp 0x20efe
cmpl $0x7fff, -0x44(%rbp)    # imm = 0x7FFF
jne 0x20b01
movq -0x60(%rbp), %rax
orq -0x68(%rbp), %rax
cmpq $0x0, %rax
je 0x20ae2
movq -0x38(%rbp), %r8
movq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq -0x28(%rbp), %rcx
callq 0x1f480
movq %rax, -0x10(%rbp)
movq %rdx, -0x8(%rbp)
jmp 0x20efe
xorl %esi, %esi
xorl %eax, %eax
movl %eax, %ecx
movzbl -0x3b(%rbp), %edi
movq %rcx, %rdx
callq 0x11a80
movq %rax, -0x10(%rbp)
movq %rdx, -0x8(%rbp)
jmp 0x20efe
cmpl $0x0, -0x44(%rbp)
jne 0x20bbf
movq -0x60(%rbp), %rax
orq -0x68(%rbp), %rax
cmpq $0x0, %rax
jne 0x20ba6
movslq -0x40(%rbp), %rax
orq -0x50(%rbp), %rax
orq -0x58(%rbp), %rax
cmpq $0x0, %rax
jne 0x20b76
jmp 0x20b31
movq -0x38(%rbp), %rsi
movl $0x1, %edi
callq 0x11080
movq $0x0, -0xd0(%rbp)
movabsq $0x7fff800000000000, %rax # imm = 0x7FFF800000000000
movq %rax, -0xc8(%rbp)
movq -0xd0(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0xc8(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x20efe
movq -0x38(%rbp), %rsi
movl $0x4, %edi
callq 0x11080
movl $0x7fff, %esi           # imm = 0x7FFF
xorl %eax, %eax
movl %eax, %ecx
movzbl -0x3b(%rbp), %edi
movq %rcx, %rdx
callq 0x11a80
movq %rax, -0x10(%rbp)
movq %rdx, -0x8(%rbp)
jmp 0x20efe
movq -0x60(%rbp), %rdi
movq -0x68(%rbp), %rsi
leaq -0x44(%rbp), %rdx
leaq -0x60(%rbp), %rcx
leaq -0x68(%rbp), %r8
callq 0x1ee00
cmpl $0x0, -0x40(%rbp)
jne 0x20c0b
movq -0x50(%rbp), %rax
orq -0x58(%rbp), %rax
cmpq $0x0, %rax
jne 0x20bf2
xorl %esi, %esi
xorl %eax, %eax
movl %eax, %ecx
movzbl -0x3b(%rbp), %edi
movq %rcx, %rdx
callq 0x11a80
movq %rax, -0x10(%rbp)
movq %rdx, -0x8(%rbp)
jmp 0x20efe
movq -0x50(%rbp), %rdi
movq -0x58(%rbp), %rsi
leaq -0x40(%rbp), %rdx
leaq -0x50(%rbp), %rcx
leaq -0x58(%rbp), %r8
callq 0x1ee00
movl -0x40(%rbp), %eax
subl -0x44(%rbp), %eax
addl $0x3ffd, %eax           # imm = 0x3FFD
movl %eax, -0x48(%rbp)
movabsq $0x1000000000000, %rdi  # imm = 0x1000000000000
orq -0x50(%rbp), %rdi
movq -0x58(%rbp), %rsi
movl $0xf, %edx
leaq -0x50(%rbp), %rcx
leaq -0x58(%rbp), %r8
callq 0x121c0
movabsq $0x1000000000000, %rdi  # imm = 0x1000000000000
orq -0x60(%rbp), %rdi
movq -0x68(%rbp), %rsi
movl $0xf, %edx
leaq -0x60(%rbp), %rcx
leaq -0x68(%rbp), %r8
callq 0x121c0
movq -0x60(%rbp), %rdi
movq -0x68(%rbp), %rsi
movq -0x50(%rbp), %rdx
movq -0x58(%rbp), %rcx
callq 0x1d2d0
cmpb $0x0, %al
je 0x20c9d
movq -0x50(%rbp), %rdi
movq -0x58(%rbp), %rsi
movl $0x1, %edx
leaq -0x50(%rbp), %rcx
leaq -0x58(%rbp), %r8
callq 0x17be0
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
movq -0x50(%rbp), %rdi
movq -0x58(%rbp), %rsi
movq -0x60(%rbp), %rdx
callq 0x14bf0
movq %rax, -0x70(%rbp)
movq -0x60(%rbp), %rdi
movq -0x68(%rbp), %rsi
movq -0x70(%rbp), %rdx
leaq -0xa8(%rbp), %rcx
leaq -0xb0(%rbp), %r8
leaq -0xb8(%rbp), %r9
callq 0x20f10
movq -0x50(%rbp), %rdi
movq -0x58(%rbp), %rsi
movq -0xa8(%rbp), %rcx
movq -0xb0(%rbp), %r8
movq -0xb8(%rbp), %r9
xorl %eax, %eax
movl %eax, %edx
leaq -0x88(%rbp), %r11
leaq -0x90(%rbp), %r10
leaq -0x98(%rbp), %rax
movq %r11, (%rsp)
movq %r10, 0x8(%rsp)
movq %rax, 0x10(%rsp)
callq 0x1d850
cmpq $0x0, -0x88(%rbp)
jge 0x20d82
movq -0x70(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x70(%rbp)
movq -0x88(%rbp), %rdi
movq -0x90(%rbp), %rsi
movq -0x98(%rbp), %rdx
movq -0x60(%rbp), %r8
movq -0x68(%rbp), %r9
xorl %eax, %eax
movl %eax, %ecx
leaq -0x88(%rbp), %r11
leaq -0x90(%rbp), %r10
leaq -0x98(%rbp), %rax
movq %r11, (%rsp)
movq %r10, 0x8(%rsp)
movq %rax, 0x10(%rsp)
callq 0x1d930
jmp 0x20d21
movq -0x90(%rbp), %rdi
movq -0x98(%rbp), %rsi
movq -0x60(%rbp), %rdx
callq 0x14bf0
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rax
andq $0x3fff, %rax           # imm = 0x3FFF
cmpq $0x4, %rax
ja 0x20eb2
movq -0x60(%rbp), %rdi
movq -0x68(%rbp), %rsi
movq -0x78(%rbp), %rdx
leaq -0xb0(%rbp), %rcx
leaq -0xb8(%rbp), %r8
leaq -0xc0(%rbp), %r9
callq 0x20f10
movq -0x90(%rbp), %rdi
movq -0x98(%rbp), %rsi
movq -0xb0(%rbp), %rcx
movq -0xb8(%rbp), %r8
movq -0xc0(%rbp), %r9
xorl %eax, %eax
movl %eax, %edx
leaq -0x90(%rbp), %r11
leaq -0x98(%rbp), %r10
leaq -0xa0(%rbp), %rax
movq %r11, (%rsp)
movq %r10, 0x8(%rsp)
movq %rax, 0x10(%rsp)
callq 0x1d850
cmpq $0x0, -0x90(%rbp)
jge 0x20e87
movq -0x78(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x78(%rbp)
movq -0x90(%rbp), %rdi
movq -0x98(%rbp), %rsi
movq -0xa0(%rbp), %rdx
movq -0x60(%rbp), %r8
movq -0x68(%rbp), %r9
xorl %eax, %eax
movl %eax, %ecx
leaq -0x90(%rbp), %r11
leaq -0x98(%rbp), %r10
leaq -0xa0(%rbp), %rax
movq %r11, (%rsp)
movq %r10, 0x8(%rsp)
movq %rax, 0x10(%rsp)
callq 0x1d930
jmp 0x20e26
movq -0x90(%rbp), %rax
orq -0x98(%rbp), %rax
orq -0xa0(%rbp), %rax
cmpq $0x0, %rax
setne %al
andb $0x1, %al
movzbl %al, %eax
cltq
orq -0x78(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x70(%rbp), %rdi
movq -0x78(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
movl $0xf, %ecx
leaq -0x70(%rbp), %r8
leaq -0x78(%rbp), %r9
leaq -0x80(%rbp), %rax
movq %rax, (%rsp)
callq 0x20420
movb -0x3b(%rbp), %al
movl -0x48(%rbp), %esi
movq -0x70(%rbp), %rdx
movq -0x78(%rbp), %rcx
movq -0x80(%rbp), %r8
movq -0x38(%rbp), %r9
movzbl %al, %edi
callq 0x20590
movq %rax, -0x10(%rbp)
movq %rdx, -0x8(%rbp)
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rdx
addq $0xf0, %rsp
popq %rbp
retq
nop