// File: /workspace/github_c_makefile_star2_O0/mbitsnbites[P]SoftFP/softfloat.c
// Function: float128_rem
float128 float128_rem(float128 a, float128 b, float_status *status)
{
    flag aSign, zSign;
    int32 aExp, bExp, expDiff;
    uint64_t aSig0, aSig1, bSig0, bSig1, q, term0, term1, term2;
    uint64_t allZero, alternateASig0, alternateASig1, sigMean1;
    int64_t sigMean0;
    float128 z;

    aSig1 = extractFloat128Frac1( a );
    aSig0 = extractFloat128Frac0( a );
    aExp = extractFloat128Exp( a );
    aSign = extractFloat128Sign( a );
    bSig1 = extractFloat128Frac1( b );
    bSig0 = extractFloat128Frac0( b );
    bExp = extractFloat128Exp( b );
    if ( aExp == 0x7FFF ) {
        if (    ( aSig0 | aSig1 )
             || ( ( bExp == 0x7FFF ) && ( bSig0 | bSig1 ) ) ) {
            return propagateFloat128NaN(a, b, status);
        }
        goto invalid;
    }
    if ( bExp == 0x7FFF ) {
        if (bSig0 | bSig1) {
            return propagateFloat128NaN(a, b, status);
        }
        return a;
    }
    if ( bExp == 0 ) {
        if ( ( bSig0 | bSig1 ) == 0 ) {
 invalid:
            float_raise(float_flag_invalid, status);
            z.low = float128_default_nan_low;
            z.high = float128_default_nan_high;
            return z;
        }
        normalizeFloat128Subnormal( bSig0, bSig1, &bExp, &bSig0, &bSig1 );
    }
    if ( aExp == 0 ) {
        if ( ( aSig0 | aSig1 ) == 0 ) return a;
        normalizeFloat128Subnormal( aSig0, aSig1, &aExp, &aSig0, &aSig1 );
    }
    expDiff = aExp - bExp;
    if ( expDiff < -1 ) return a;
    shortShift128Left(
        aSig0 | LIT64( 0x0001000000000000 ),
        aSig1,
        15 - ( expDiff < 0 ),
        &aSig0,
        &aSig1
    );
    shortShift128Left(
        bSig0 | LIT64( 0x0001000000000000 ), bSig1, 15, &bSig0, &bSig1 );
    q = le128( bSig0, bSig1, aSig0, aSig1 );
    if ( q ) sub128( aSig0, aSig1, bSig0, bSig1, &aSig0, &aSig1 );
    expDiff -= 64;
    while ( 0 < expDiff ) {
        q = estimateDiv128To64( aSig0, aSig1, bSig0 );
        q = ( 4 < q ) ? q - 4 : 0;
        mul128By64To192( bSig0, bSig1, q, &term0, &term1, &term2 );
        shortShift192Left( term0, term1, term2, 61, &term1, &term2, &allZero );
        shortShift128Left( aSig0, aSig1, 61, &aSig0, &allZero );
        sub128( aSig0, 0, term1, term2, &aSig0, &aSig1 );
        expDiff -= 61;
    }
    if ( -64 < expDiff ) {
        q = estimateDiv128To64( aSig0, aSig1, bSig0 );
        q = ( 4 < q ) ? q - 4 : 0;
        q >>= - expDiff;
        shift128Right( bSig0, bSig1, 12, &bSig0, &bSig1 );
        expDiff += 52;
        if ( expDiff < 0 ) {
            shift128Right( aSig0, aSig1, - expDiff, &aSig0, &aSig1 );
        }
        else {
            shortShift128Left( aSig0, aSig1, expDiff, &aSig0, &aSig1 );
        }
        mul128By64To192( bSig0, bSig1, q, &term0, &term1, &term2 );
        sub128( aSig0, aSig1, term1, term2, &aSig0, &aSig1 );
    }
    else {
        shift128Right( aSig0, aSig1, 12, &aSig0, &aSig1 );
        shift128Right( bSig0, bSig1, 12, &bSig0, &bSig1 );
    }
    do {
        alternateASig0 = aSig0;
        alternateASig1 = aSig1;
        ++q;
        sub128( aSig0, aSig1, bSig0, bSig1, &aSig0, &aSig1 );
    } while ( 0 <= (int64_t) aSig0 );
    add128(
        aSig0, aSig1, alternateASig0, alternateASig1, (uint64_t *)&sigMean0, &sigMean1 );
    if (    ( sigMean0 < 0 )
         || ( ( ( sigMean0 | sigMean1 ) == 0 ) && ( q & 1 ) ) ) {
        aSig0 = alternateASig0;
        aSig1 = alternateASig1;
    }
    zSign = ( (int64_t) aSig0 < 0 );
    if ( zSign ) sub128( 0, 0, aSig0, aSig1, &aSig0, &aSig1 );
    return normalizeRoundAndPackFloat128(aSign ^ zSign, bExp - 4, aSig0, aSig1,
                                         status);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xe0, %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)
cmpl $0x7fff, -0x40(%rbp)    # imm = 0x7FFF
jne 0x21089
movq -0x50(%rbp), %rax
orq -0x58(%rbp), %rax
cmpq $0x0, %rax
jne 0x21061
cmpl $0x7fff, -0x44(%rbp)    # imm = 0x7FFF
jne 0x21087
movq -0x60(%rbp), %rax
orq -0x68(%rbp), %rax
cmpq $0x0, %rax
je 0x21087
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 0x21593
jmp 0x210f1
cmpl $0x7fff, -0x44(%rbp)    # imm = 0x7FFF
jne 0x210db
movq -0x60(%rbp), %rax
orq -0x68(%rbp), %rax
cmpq $0x0, %rax
je 0x210c6
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 0x21593
movq -0x20(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x21593
cmpl $0x0, -0x44(%rbp)
jne 0x2114f
movq -0x60(%rbp), %rax
orq -0x68(%rbp), %rax
cmpq $0x0, %rax
jne 0x21136
jmp 0x210f1
movq -0x38(%rbp), %rsi
movl $0x1, %edi
callq 0x11080
movq $0x0, -0xc0(%rbp)
movabsq $0x7fff800000000000, %rax # imm = 0x7FFF800000000000
movq %rax, -0xb8(%rbp)
movq -0xc0(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0xb8(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x21593
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 0x21191
movq -0x50(%rbp), %rax
orq -0x58(%rbp), %rax
cmpq $0x0, %rax
jne 0x21178
movq -0x20(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x21593
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
movl %eax, -0x48(%rbp)
cmpl $-0x1, -0x48(%rbp)
jge 0x211b5
movq -0x20(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x21593
movabsq $0x1000000000000, %rdi  # imm = 0x1000000000000
orq -0x50(%rbp), %rdi
movq -0x58(%rbp), %rsi
cmpl $0x0, -0x48(%rbp)
setl %al
andb $0x1, %al
movzbl %al, %ecx
movl $0xf, %eax
subl %ecx, %eax
movslq %eax, %rdx
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
movzbl %al, %eax
movq %rax, -0x70(%rbp)
cmpq $0x0, -0x70(%rbp)
je 0x2124e
movq -0x50(%rbp), %rdi
movq -0x58(%rbp), %rsi
movq -0x60(%rbp), %rdx
movq -0x68(%rbp), %rcx
leaq -0x50(%rbp), %r8
leaq -0x58(%rbp), %r9
callq 0x18b70
movl -0x48(%rbp), %eax
subl $0x40, %eax
movl %eax, -0x48(%rbp)
xorl %eax, %eax
cmpl -0x48(%rbp), %eax
jge 0x21343
movq -0x50(%rbp), %rdi
movq -0x58(%rbp), %rsi
movq -0x60(%rbp), %rdx
callq 0x14bf0
movq %rax, -0x70(%rbp)
movl $0x4, %eax
cmpq -0x70(%rbp), %rax
jae 0x21293
movq -0x70(%rbp), %rax
subq $0x4, %rax
movq %rax, -0xc8(%rbp)
jmp 0x2129e
xorl %eax, %eax
movq %rax, -0xc8(%rbp)
jmp 0x2129e
movq -0xc8(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x60(%rbp), %rdi
movq -0x68(%rbp), %rsi
movq -0x70(%rbp), %rdx
leaq -0x78(%rbp), %rcx
leaq -0x80(%rbp), %r8
leaq -0x88(%rbp), %r9
callq 0x20f10
movq -0x78(%rbp), %rdi
movq -0x80(%rbp), %rsi
movq -0x88(%rbp), %rdx
movl $0x3d, %ecx
leaq -0x80(%rbp), %r8
leaq -0x88(%rbp), %r9
leaq -0x90(%rbp), %rax
movq %rax, (%rsp)
callq 0x215b0
movq -0x50(%rbp), %rdi
movq -0x58(%rbp), %rsi
movl $0x3d, %edx
leaq -0x50(%rbp), %rcx
leaq -0x90(%rbp), %r8
callq 0x121c0
movq -0x50(%rbp), %rdi
movq -0x80(%rbp), %rdx
movq -0x88(%rbp), %rcx
xorl %eax, %eax
movl %eax, %esi
leaq -0x50(%rbp), %r8
leaq -0x58(%rbp), %r9
callq 0x18b70
movl -0x48(%rbp), %eax
subl $0x3d, %eax
movl %eax, -0x48(%rbp)
jmp 0x21257
movl $0xffffffc0, %eax       # imm = 0xFFFFFFC0
cmpl -0x48(%rbp), %eax
jge 0x2144d
movq -0x50(%rbp), %rdi
movq -0x58(%rbp), %rsi
movq -0x60(%rbp), %rdx
callq 0x14bf0
movq %rax, -0x70(%rbp)
movl $0x4, %eax
cmpq -0x70(%rbp), %rax
jae 0x21382
movq -0x70(%rbp), %rax
subq $0x4, %rax
movq %rax, -0xd0(%rbp)
jmp 0x2138d
xorl %eax, %eax
movq %rax, -0xd0(%rbp)
jmp 0x2138d
movq -0xd0(%rbp), %rax
movq %rax, -0x70(%rbp)
xorl %ecx, %ecx
subl -0x48(%rbp), %ecx
movq -0x70(%rbp), %rax
movl %ecx, %ecx
shrq %cl, %rax
movq %rax, -0x70(%rbp)
movq -0x60(%rbp), %rdi
movq -0x68(%rbp), %rsi
movl $0xc, %edx
leaq -0x60(%rbp), %rcx
leaq -0x68(%rbp), %r8
callq 0x17be0
movl -0x48(%rbp), %eax
addl $0x34, %eax
movl %eax, -0x48(%rbp)
cmpl $0x0, -0x48(%rbp)
jge 0x213f2
movq -0x50(%rbp), %rdi
movq -0x58(%rbp), %rsi
xorl %eax, %eax
subl -0x48(%rbp), %eax
movslq %eax, %rdx
leaq -0x50(%rbp), %rcx
leaq -0x58(%rbp), %r8
callq 0x17be0
jmp 0x2140b
movq -0x50(%rbp), %rdi
movq -0x58(%rbp), %rsi
movslq -0x48(%rbp), %rdx
leaq -0x50(%rbp), %rcx
leaq -0x58(%rbp), %r8
callq 0x121c0
movq -0x60(%rbp), %rdi
movq -0x68(%rbp), %rsi
movq -0x70(%rbp), %rdx
leaq -0x78(%rbp), %rcx
leaq -0x80(%rbp), %r8
leaq -0x88(%rbp), %r9
callq 0x20f10
movq -0x50(%rbp), %rdi
movq -0x58(%rbp), %rsi
movq -0x80(%rbp), %rdx
movq -0x88(%rbp), %rcx
leaq -0x50(%rbp), %r8
leaq -0x58(%rbp), %r9
callq 0x18b70
jmp 0x21481
movq -0x50(%rbp), %rdi
movq -0x58(%rbp), %rsi
movl $0xc, %edx
leaq -0x50(%rbp), %rcx
leaq -0x58(%rbp), %r8
callq 0x17be0
movq -0x60(%rbp), %rdi
movq -0x68(%rbp), %rsi
movl $0xc, %edx
leaq -0x60(%rbp), %rcx
leaq -0x68(%rbp), %r8
callq 0x17be0
jmp 0x21483
movq -0x50(%rbp), %rax
movq %rax, -0x98(%rbp)
movq -0x58(%rbp), %rax
movq %rax, -0xa0(%rbp)
movq -0x70(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x70(%rbp)
movq -0x50(%rbp), %rdi
movq -0x58(%rbp), %rsi
movq -0x60(%rbp), %rdx
movq -0x68(%rbp), %rcx
leaq -0x50(%rbp), %r8
leaq -0x58(%rbp), %r9
callq 0x18b70
xorl %eax, %eax
cmpq -0x50(%rbp), %rax
jle 0x21483
movq -0x50(%rbp), %rdi
movq -0x58(%rbp), %rsi
movq -0x98(%rbp), %rdx
movq -0xa0(%rbp), %rcx
leaq -0xb0(%rbp), %r8
leaq -0xa8(%rbp), %r9
callq 0x18bd0
cmpq $0x0, -0xb0(%rbp)
jl 0x2151f
movq -0xb0(%rbp), %rax
orq -0xa8(%rbp), %rax
cmpq $0x0, %rax
jne 0x21535
movq -0x70(%rbp), %rax
andq $0x1, %rax
cmpq $0x0, %rax
je 0x21535
movq -0x98(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0xa0(%rbp), %rax
movq %rax, -0x58(%rbp)
cmpq $0x0, -0x50(%rbp)
setl %al
andb $0x1, %al
movzbl %al, %eax
movb %al, -0x3a(%rbp)
cmpb $0x0, -0x3a(%rbp)
je 0x21567
movq -0x50(%rbp), %rdx
movq -0x58(%rbp), %rcx
xorl %eax, %eax
movl %eax, %esi
leaq -0x50(%rbp), %r8
leaq -0x58(%rbp), %r9
movq %rsi, %rdi
callq 0x18b70
movzbl -0x39(%rbp), %eax
movzbl -0x3a(%rbp), %ecx
xorl %ecx, %eax
movl -0x44(%rbp), %esi
subl $0x4, %esi
movq -0x50(%rbp), %rdx
movq -0x58(%rbp), %rcx
movq -0x38(%rbp), %r8
movzbl %al, %edi
callq 0x12660
movq %rax, -0x10(%rbp)
movq %rdx, -0x8(%rbp)
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rdx
addq $0xe0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)