// File: /workspace/github_c_makefile_star2_O0/mirth-lang[P]mirth/bin/mirth1.c
// Function: i63_i63_mul
static INT i63_i63_mul (int64_t a, int64_t b) {
    if ((b == 0) ||
        ((b > 0) && (INT63_MIN/b <= a) && (a <= INT63_MAX/b)) ||
        ((b < 0) && (INT63_MAX/b <= a) && (a <= INT63_MIN/b)))
    {
        return WRAP_I63(a * b);
    }

    bool negate = (a < 0) ^ (b < 0);
    if (a < 0) a = -a;
    if (b < 0) b = -b;

    uint64_t a0 = LO_RADIX(a);
    uint64_t a1 = HI_RADIX(a);
    uint64_t b0 = LO_RADIX(b);
    uint64_t b1 = HI_RADIX(b);

    uint64_t r0 = a0 * b0;
    uint64_t r1 = a1 * b0 + a0 * b1 + HI_RADIX(r0);
    uint64_t r2 = a1 * b1 + HI_RADIX(r1);
    uint64_t r3 = HI_RADIX(r2);

    BIG* c = big_alloc(5);
    c->size = 4;
    c->radix[0] = LO_RADIX(r0);
    c->radix[1] = LO_RADIX(r1);
    c->radix[2] = LO_RADIX(r2);
    c->radix[3] = LO_RADIX(r3);
    INT x = big_normalize(c);
    return negate ? int_negate(x) : x;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x2b240
cmpq $0x0, -0x18(%rbp)
jle 0x2b1ff
movabsq $-0x4000000000000000, %rax # imm = 0xC000000000000000
cqto
idivq -0x18(%rbp)
cmpq -0x10(%rbp), %rax
jg 0x2b1ff
movq -0x10(%rbp), %rax
movq %rax, -0x78(%rbp)
movabsq $0x3fffffffffffffff, %rax # imm = 0x3FFFFFFFFFFFFFFF
cqto
idivq -0x18(%rbp)
movq %rax, %rcx
movq -0x78(%rbp), %rax
cmpq %rcx, %rax
jle 0x2b240
cmpq $0x0, -0x18(%rbp)
jge 0x2b259
movabsq $0x3fffffffffffffff, %rax # imm = 0x3FFFFFFFFFFFFFFF
cqto
idivq -0x18(%rbp)
cmpq -0x10(%rbp), %rax
jg 0x2b259
movq -0x10(%rbp), %rax
movq %rax, -0x80(%rbp)
movabsq $-0x4000000000000000, %rax # imm = 0xC000000000000000
cqto
idivq -0x18(%rbp)
movq %rax, %rcx
movq -0x80(%rbp), %rax
cmpq %rcx, %rax
jg 0x2b259
movq -0x10(%rbp), %rax
imulq -0x18(%rbp), %rax
shlq %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
jmp 0x2b3a8
cmpq $0x0, -0x10(%rbp)
setl %al
andb $0x1, %al
movzbl %al, %eax
cmpq $0x0, -0x18(%rbp)
setl %cl
andb $0x1, %cl
movzbl %cl, %ecx
xorl %ecx, %eax
cmpl $0x0, %eax
setne %al
andb $0x1, %al
movb %al, -0x19(%rbp)
cmpq $0x0, -0x10(%rbp)
jge 0x2b292
xorl %eax, %eax
subq -0x10(%rbp), %rax
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x18(%rbp)
jge 0x2b2a3
xorl %eax, %eax
subq -0x18(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movl %eax, %eax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
shrq $0x20, %rax
movl %eax, %eax
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rax
movl %eax, %eax
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rax
shrq $0x20, %rax
movl %eax, %eax
movq %rax, -0x40(%rbp)
movq -0x28(%rbp), %rax
imulq -0x38(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x30(%rbp), %rax
imulq -0x38(%rbp), %rax
movq -0x28(%rbp), %rcx
imulq -0x40(%rbp), %rcx
addq %rcx, %rax
movq -0x48(%rbp), %rcx
shrq $0x20, %rcx
movl %ecx, %ecx
addq %rcx, %rax
movq %rax, -0x50(%rbp)
movq -0x30(%rbp), %rax
imulq -0x40(%rbp), %rax
movq -0x50(%rbp), %rcx
shrq $0x20, %rcx
movl %ecx, %ecx
addq %rcx, %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
shrq $0x20, %rax
movl %eax, %eax
movq %rax, -0x60(%rbp)
movl $0x5, %edi
callq 0x5250
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
movq $0x4, 0x10(%rax)
movq -0x48(%rbp), %rax
movl %eax, %ecx
movq -0x68(%rbp), %rax
movl %ecx, 0x18(%rax)
movq -0x50(%rbp), %rax
movl %eax, %ecx
movq -0x68(%rbp), %rax
movl %ecx, 0x1c(%rax)
movq -0x58(%rbp), %rax
movl %eax, %ecx
movq -0x68(%rbp), %rax
movl %ecx, 0x20(%rax)
movq -0x60(%rbp), %rax
movl %eax, %ecx
movq -0x68(%rbp), %rax
movl %ecx, 0x24(%rax)
movq -0x68(%rbp), %rdi
callq 0x1cad0
movq %rax, -0x70(%rbp)
testb $0x1, -0x19(%rbp)
je 0x2b39e
movq -0x70(%rbp), %rdi
callq 0x1c7f0
movq %rax, -0x8(%rbp)
jmp 0x2b3a6
movq -0x70(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x2b3a8
movq -0x8(%rbp), %rax
addq $0x80, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)