// File: /workspace/github_c_makefile_star2_O2/mbitsnbites[P]SoftFP/softfloat.c
// Function: float128_mul
float128 float128_mul(float128 a, float128 b, float_status *status)
{
    flag aSign, bSign, zSign;
    int32 aExp, bExp, zExp;
    uint64_t aSig0, aSig1, bSig0, bSig1, zSig0, zSig1, zSig2, zSig3;
    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 )
             || ( ( bExp == 0x7FFF ) && ( bSig0 | bSig1 ) ) ) {
            return propagateFloat128NaN(a, b, status);
        }
        if ( ( bExp | bSig0 | bSig1 ) == 0 ) goto invalid;
        return packFloat128( zSign, 0x7FFF, 0, 0 );
    }
    if ( bExp == 0x7FFF ) {
        if (bSig0 | bSig1) {
            return propagateFloat128NaN(a, b, status);
        }
        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;
        }
        return packFloat128( zSign, 0x7FFF, 0, 0 );
    }
    if ( aExp == 0 ) {
        if ( ( aSig0 | aSig1 ) == 0 ) return packFloat128( zSign, 0, 0, 0 );
        normalizeFloat128Subnormal( aSig0, aSig1, &aExp, &aSig0, &aSig1 );
    }
    if ( bExp == 0 ) {
        if ( ( bSig0 | bSig1 ) == 0 ) return packFloat128( zSign, 0, 0, 0 );
        normalizeFloat128Subnormal( bSig0, bSig1, &bExp, &bSig0, &bSig1 );
    }
    zExp = aExp + bExp - 0x4000;
    aSig0 |= LIT64( 0x0001000000000000 );
    shortShift128Left( bSig0, bSig1, 16, &bSig0, &bSig1 );
    mul128To256( aSig0, aSig1, bSig0, bSig1, &zSig0, &zSig1, &zSig2, &zSig3 );
    add128( zSig0, zSig1, aSig0, aSig1, &zSig0, &zSig1 );
    zSig2 |= ( zSig3 != 0 );
    if ( LIT64( 0x0002000000000000 ) <= zSig0 ) {
        shift128ExtraRightJamming(
            zSig0, zSig1, zSig2, 1, &zSig0, &zSig1, &zSig2 );
        ++zExp;
    }
    return roundAndPackFloat128(zSign, zExp, zSig0, zSig1, zSig2, status);

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %r8, %rbx
movq %rdx, %r15
movq %rdi, %rax
movabsq $0xffffffffffff, %r12   # imm = 0xFFFFFFFFFFFF
movq %rdi, 0x30(%rsp)
movq %rsi, %rdi
andq %r12, %rdi
movq %rdi, 0x38(%rsp)
movq %rsi, %rdx
shrq $0x30, %rdx
movl $0x7fff, %r10d          # imm = 0x7FFF
movl %edx, %r9d
andl %r10d, %r9d
movl %r9d, 0xc(%rsp)
movq %r15, 0x28(%rsp)
movq %rcx, %r13
andq %r12, %r13
movq %r13, 0x58(%rsp)
movq %rcx, %r8
shrq $0x30, %r8
movl %r8d, %r14d
andl %r10d, %r14d
movl %r14d, 0x1c(%rsp)
movq %rcx, %rbp
xorq %rsi, %rbp
cmpl %r10d, %r9d
jne 0x1134d
orq %rax, %rdi
jne 0x1135b
cmpl $0x7fff, %r14d          # imm = 0x7FFF
setne %dl
movq %r13, %rdi
orq %r15, %rdi
sete %dil
orb %dl, %dil
je 0x1135b
andl $0x7fff, %r8d           # imm = 0x7FFF
orq %r15, %r8
orq %r13, %r8
je 0x113b0
movabsq $-0x8000000000000000, %rax # imm = 0x8000000000000000
andq %rax, %rbp
movabsq $0x7fff000000000000, %rdx # imm = 0x7FFF000000000000
orq %rbp, %rdx
jmp 0x113be
cmpl $0x7fff, %r14d          # imm = 0x7FFF
jne 0x1136e
orq %r15, %r13
je 0x113a2
movq %rax, %rdi
movq %r15, %rdx
movq %rbx, %r8
callq 0x10ca1
jmp 0x1155b
testl %r9d, %r9d
jne 0x11396
movq %rdi, %rcx
orq %rax, %rcx
je 0x11549
leaq 0xc(%rsp), %rdx
leaq 0x38(%rsp), %rcx
leaq 0x30(%rsp), %r8
movq %rax, %rsi
callq 0x1092e
testl %r14d, %r14d
je 0x113c5
movq %rbx, 0x10(%rsp)
jmp 0x11407
andl $0x7fff, %edx           # imm = 0x7FFF
orq %rax, %rdx
orq %rdi, %rdx
jne 0x11331
orb $0x1, 0x2(%rbx)
movabsq $0x7fff800000000000, %rdx # imm = 0x7FFF800000000000
xorl %eax, %eax
jmp 0x1155b
movq %r13, %rax
orq %r15, %rax
je 0x11549
movq %rbx, 0x10(%rsp)
leaq 0x1c(%rsp), %rbx
leaq 0x58(%rsp), %rax
leaq 0x28(%rsp), %r8
movq %r13, %rdi
movq %r15, %rsi
movq %rbx, %rdx
movq %rax, %r15
movq %rax, %rcx
callq 0x1092e
movl (%rbx), %r14d
movq (%r15), %r13
leaq 0x28(%rsp), %rax
movq (%rax), %r15
shrq $0x3f, %rbp
movq %rbp, 0x50(%rsp)
movl 0xc(%rsp), %eax
movq %rax, 0x20(%rsp)
incq %r12
orq 0x38(%rsp), %r12
shldq $0x10, %r15, %r13
shlq $0x10, %r15
movq 0x30(%rsp), %rbp
movq %rbp, 0x48(%rsp)
leaq 0x68(%rsp), %rdx
leaq 0x60(%rsp), %rcx
movq %rbp, %rdi
movq %r15, %rsi
callq 0xd0a6
leaq 0x80(%rsp), %rbx
leaq 0x40(%rsp), %rcx
movq %rbp, %rdi
movq %r13, %rsi
movq %rbx, %rdx
callq 0xd0a6
movq (%rbx), %rbp
leaq 0x68(%rsp), %rax
movq (%rax), %rbx
leaq 0x40(%rsp), %rax
addq (%rax), %rbx
adcq $0x0, %rbp
leaq 0x70(%rsp), %rdx
leaq 0x78(%rsp), %rax
movq %r12, %rdi
movq %r13, %rsi
movq %rax, %r13
movq %rax, %rcx
callq 0xd0a6
addq (%r13), %rbp
movq %r13, %rax
leaq 0x70(%rsp), %rcx
movq (%rcx), %r13
adcq %r12, %r13
movq %r12, %rdi
movq %r15, %rsi
movq %rax, %r12
movq %rax, %rdx
leaq 0x40(%rsp), %r15
movq %r15, %rcx
callq 0xd0a6
addq (%r15), %rbx
movq (%r12), %rcx
adcq %rbp, %rcx
xorl %edx, %edx
cmpq %rbp, %rcx
setb %dl
addq 0x48(%rsp), %rcx
adcq %r13, %rdx
xorl %r8d, %r8d
leaq 0x60(%rsp), %rax
cmpq $0x0, (%rax)
setne %r8b
orq %rbx, %r8
movq %rdx, %rax
shrq $0x31, %rax
je 0x11526
addl 0x20(%rsp), %r14d
movq %rdx, %rax
shldq $0x3f, %rcx, %rax
shlq $0x3f, %rcx
shrq %rdx
xorl %esi, %esi
testq %r8, %r8
setne %sil
orq %rcx, %rsi
addl $0xffffc001, %r14d      # imm = 0xFFFFC001
movq %rax, %rcx
movq %rsi, %r8
jmp 0x11535
movq 0x20(%rsp), %rax
addl %eax, %r14d
addl $0xffffc000, %r14d      # imm = 0xFFFFC000
movq 0x10(%rsp), %r9
movzbl 0x50(%rsp), %edi
movl %r14d, %esi
callq 0x115fc
jmp 0x1155b
movabsq $-0x8000000000000000, %rax # imm = 0x8000000000000000
andq %rax, %rbp
xorl %eax, %eax
movq %rbp, %rdx
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq