// File: /workspace/github_c_makefile_star2_O0/mbitsnbites[P]SoftFP/softfloat.c
// Function: roundAndPackInt64
static int64 roundAndPackInt64(flag zSign, uint64_t absZ0, uint64_t absZ1,
                               float_status *status)
{
    int8 roundingMode;
    flag roundNearestEven, increment;
    int64_t z;

    roundingMode = status->float_rounding_mode;
    roundNearestEven = ( roundingMode == float_round_nearest_even );
    switch (roundingMode) {
    case float_round_nearest_even:
    case float_round_ties_away:
        increment = ((int64_t) absZ1 < 0);
        break;
    case float_round_to_zero:
        increment = 0;
        break;
    case float_round_up:
        increment = !zSign && absZ1;
        break;
    case float_round_down:
        increment = zSign && absZ1;
        break;
    default:
        abort();
    }
    if ( increment ) {
        ++absZ0;
        if ( absZ0 == 0 ) goto overflow;
        absZ0 &= ~ ( ( (uint64_t) ( absZ1<<1 ) == 0 ) & roundNearestEven );
    }
    z = absZ0;
    if ( zSign ) z = - z;
    if ( z && ( ( z < 0 ) ^ zSign ) ) {
 overflow:
        float_raise(float_flag_invalid, status);
        return
              zSign ? (int64_t) LIT64( 0x8000000000000000 )
            : LIT64( 0x7FFFFFFFFFFFFFFF );
    }
    if (absZ1) {
        status->float_exception_flags |= float_flag_inexact;
    }
    return z;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movb %dil, %al
movb %al, -0x9(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x28(%rbp), %rax
movb 0x1(%rax), %al
movb %al, -0x29(%rbp)
movb -0x29(%rbp), %al
testb %al, %al
sete -0x2a(%rbp)
movsbl -0x29(%rbp), %eax
movl %eax, %ecx
movq %rcx, -0x40(%rbp)
subl $0x4, %eax
ja 0x12e71
movq -0x40(%rbp), %rax
leaq 0x12a65(%rip), %rcx     # 0x2586c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
cmpq $0x0, -0x20(%rbp)
setl %al
andb $0x1, %al
movzbl %al, %eax
movb %al, -0x2b(%rbp)
jmp 0x12e76
movb $0x0, -0x2b(%rbp)
jmp 0x12e76
xorl %eax, %eax
cmpb $0x0, -0x9(%rbp)
movb %al, -0x41(%rbp)
jne 0x12e3e
cmpq $0x0, -0x20(%rbp)
setne %al
movb %al, -0x41(%rbp)
movb -0x41(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
movb %al, -0x2b(%rbp)
jmp 0x12e76
movzbl -0x9(%rbp), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x42(%rbp)
je 0x12e64
cmpq $0x0, -0x20(%rbp)
setne %al
movb %al, -0x42(%rbp)
movb -0x42(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
movb %al, -0x2b(%rbp)
jmp 0x12e76
callq 0x1030
cmpb $0x0, -0x2b(%rbp)
je 0x12eb7
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x12e91
jmp 0x12ef0
movq -0x20(%rbp), %rax
shlq %rax
cmpq $0x0, %rax
sete %al
andb $0x1, %al
movzbl %al, %eax
movzbl -0x2a(%rbp), %ecx
andl %ecx, %eax
xorl $-0x1, %eax
cltq
andq -0x18(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x38(%rbp)
cmpb $0x0, -0x9(%rbp)
je 0x12ecf
xorl %eax, %eax
subq -0x38(%rbp), %rax
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
je 0x12f23
cmpq $0x0, -0x38(%rbp)
setl %al
andb $0x1, %al
movzbl %al, %eax
movzbl -0x9(%rbp), %ecx
xorl %ecx, %eax
cmpl $0x0, %eax
je 0x12f23
jmp 0x12ef0
movq -0x28(%rbp), %rsi
movl $0x1, %edi
callq 0x11080
movzbl -0x9(%rbp), %edx
movabsq $0x7fffffffffffffff, %rax # imm = 0x7FFFFFFFFFFFFFFF
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
cmpl $0x0, %edx
cmovneq %rcx, %rax
movq %rax, -0x8(%rbp)
jmp 0x12f40
cmpq $0x0, -0x20(%rbp)
je 0x12f38
movq -0x28(%rbp), %rax
movsbl 0x2(%rax), %ecx
orl $0x20, %ecx
movb %cl, 0x2(%rax)
movq -0x38(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nopw (%rax,%rax)