// File: /workspace/github_c_makefile_star2_O0/983[P]bigint/bigint.c
// Function: bigint_raw_mul_karatsuba
int bigint_raw_mul_karatsuba(
    bigint_word *dst,
    const bigint_word *a, int na,
    const bigint_word *b, int nb,
    bigint_word *tmp
){
    /* so many */
    int n, k, m, m2;
    const bigint_word *lo1, *hi1, *lo2, *hi2;
    int nlo1, nhi1, nlo2, nhi2;
    bigint_word *lo1hi1, *lo2hi2, *z0, *z1, *z2;
    int nlo1hi1, nlo2hi2, nz0, nz1, nz2;

    if (
        na < BIGINT_KARATSUBA_WORD_THRESHOLD &&
        nb < BIGINT_KARATSUBA_WORD_THRESHOLD
    ){
        bigint_raw_zero(dst, 0, na + nb);
        return bigint_raw_mul_add(dst, a, na, b, nb);
    }

    m = BIGINT_MAX(na, nb);
    m2 = m / 2;
    k = m2 + 2;

    lo1 = a;
    lo2 = b;
    hi1 = a + m2;
    hi2 = b + m2;

    nlo1 = bigint_raw_truncate(lo1, BIGINT_MIN(m2, na));
    nlo2 = bigint_raw_truncate(lo2, BIGINT_MIN(m2, nb));
    nhi1 = bigint_raw_truncate(hi1, BIGINT_MAX(na - m2, 0));
    nhi2 = bigint_raw_truncate(hi2, BIGINT_MAX(nb - m2, 0));

    lo1hi1 = tmp; tmp += k;
    lo2hi2 = tmp; tmp += k;
    z0 = tmp; tmp += k*2;
    z1 = tmp; tmp += k*2;
    z2 = tmp; tmp += k*2;

    nlo1hi1 = bigint_raw_add(lo1hi1, lo1, nlo1, hi1, nhi1);
    nlo2hi2 = bigint_raw_add(lo2hi2, lo2, nlo2, hi2, nhi2);

    nz0 = bigint_raw_mul_karatsuba(z0, lo1   , nlo1   , lo2   , nlo2   , tmp);
    nz1 = bigint_raw_mul_karatsuba(z1, lo1hi1, nlo1hi1, lo2hi2, nlo2hi2, tmp);
    nz2 = bigint_raw_mul_karatsuba(z2,    hi1, nhi1   ,    hi2,    nhi2, tmp);

    nz1 = bigint_raw_sub(z1, z1, nz1, z0, nz0);
    nz1 = bigint_raw_sub(z1, z1, nz1, z2, nz2);

    n = nz0;

    bigint_raw_cpy(dst, z0, n);
    bigint_raw_zero(dst, n, na + nb);

    n = bigint_raw_add(dst + m2*1, dst + m2*1, BIGINT_MAX(n - m2, 0), z1, nz1);
    n = bigint_raw_add(dst + m2*2, dst + m2*2, BIGINT_MAX(n - m2, 0), z2, nz2);

    return bigint_raw_truncate(dst, n + m2*2);
}

// Assembly:
subq $0x128, %rsp            # imm = 0x128
movq %rdi, 0x118(%rsp)
movq %rsi, 0x110(%rsp)
movl %edx, 0x10c(%rsp)
movq %rcx, 0x100(%rsp)
movl %r8d, 0xfc(%rsp)
movq %r9, 0xf0(%rsp)
cmpl $0x14, 0x10c(%rsp)
jge 0x307f
cmpl $0x14, 0xfc(%rsp)
jge 0x307f
movq 0x118(%rsp), %rdi
movl 0x10c(%rsp), %edx
addl 0xfc(%rsp), %edx
xorl %esi, %esi
callq 0x24a0
movq 0x118(%rsp), %rdi
movq 0x110(%rsp), %rsi
movl 0x10c(%rsp), %edx
movq 0x100(%rsp), %rcx
movl 0xfc(%rsp), %r8d
callq 0x2a20
movl %eax, 0x124(%rsp)
jmp 0x3667
movl 0x10c(%rsp), %eax
cmpl 0xfc(%rsp), %eax
jle 0x309c
movl 0x10c(%rsp), %eax
movl %eax, 0x70(%rsp)
jmp 0x30a7
movl 0xfc(%rsp), %eax
movl %eax, 0x70(%rsp)
movl 0x70(%rsp), %eax
movl %eax, 0xe4(%rsp)
movl 0xe4(%rsp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, 0xe0(%rsp)
movl 0xe0(%rsp), %eax
addl $0x2, %eax
movl %eax, 0xe8(%rsp)
movq 0x110(%rsp), %rax
movq %rax, 0xd8(%rsp)
movq 0x100(%rsp), %rax
movq %rax, 0xc8(%rsp)
movq 0x110(%rsp), %rax
movslq 0xe0(%rsp), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, 0xd0(%rsp)
movq 0x100(%rsp), %rax
movslq 0xe0(%rsp), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, 0xc0(%rsp)
movq 0xd8(%rsp), %rax
movq %rax, 0x68(%rsp)
movl 0xe0(%rsp), %eax
cmpl 0x10c(%rsp), %eax
jge 0x3161
movl 0xe0(%rsp), %eax
movl %eax, 0x64(%rsp)
jmp 0x316c
movl 0x10c(%rsp), %eax
movl %eax, 0x64(%rsp)
movq 0x68(%rsp), %rdi
movl 0x64(%rsp), %esi
callq 0x2640
movl %eax, 0xbc(%rsp)
movq 0xc8(%rsp), %rax
movq %rax, 0x58(%rsp)
movl 0xe0(%rsp), %eax
cmpl 0xfc(%rsp), %eax
jge 0x31ab
movl 0xe0(%rsp), %eax
movl %eax, 0x54(%rsp)
jmp 0x31b6
movl 0xfc(%rsp), %eax
movl %eax, 0x54(%rsp)
movq 0x58(%rsp), %rdi
movl 0x54(%rsp), %esi
callq 0x2640
movl %eax, 0xb4(%rsp)
movq 0xd0(%rsp), %rax
movq %rax, 0x48(%rsp)
movl 0x10c(%rsp), %eax
subl 0xe0(%rsp), %eax
cmpl $0x0, %eax
jle 0x31ff
movl 0x10c(%rsp), %eax
subl 0xe0(%rsp), %eax
movl %eax, 0x44(%rsp)
jmp 0x3207
xorl %eax, %eax
movl %eax, 0x44(%rsp)
jmp 0x3207
movq 0x48(%rsp), %rdi
movl 0x44(%rsp), %esi
callq 0x2640
movl %eax, 0xb8(%rsp)
movq 0xc0(%rsp), %rax
movq %rax, 0x38(%rsp)
movl 0xfc(%rsp), %eax
subl 0xe0(%rsp), %eax
cmpl $0x0, %eax
jle 0x3250
movl 0xfc(%rsp), %eax
subl 0xe0(%rsp), %eax
movl %eax, 0x34(%rsp)
jmp 0x3258
xorl %eax, %eax
movl %eax, 0x34(%rsp)
jmp 0x3258
movq 0x38(%rsp), %rdi
movl 0x34(%rsp), %esi
callq 0x2640
movl %eax, 0xb0(%rsp)
movq 0xf0(%rsp), %rax
movq %rax, 0xa8(%rsp)
movl 0xe8(%rsp), %ecx
movq 0xf0(%rsp), %rax
movslq %ecx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, 0xf0(%rsp)
movq 0xf0(%rsp), %rax
movq %rax, 0xa0(%rsp)
movl 0xe8(%rsp), %ecx
movq 0xf0(%rsp), %rax
movslq %ecx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, 0xf0(%rsp)
movq 0xf0(%rsp), %rax
movq %rax, 0x98(%rsp)
movl 0xe8(%rsp), %ecx
shll %ecx
movq 0xf0(%rsp), %rax
movslq %ecx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, 0xf0(%rsp)
movq 0xf0(%rsp), %rax
movq %rax, 0x90(%rsp)
movl 0xe8(%rsp), %ecx
shll %ecx
movq 0xf0(%rsp), %rax
movslq %ecx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, 0xf0(%rsp)
movq 0xf0(%rsp), %rax
movq %rax, 0x88(%rsp)
movl 0xe8(%rsp), %ecx
shll %ecx
movq 0xf0(%rsp), %rax
movslq %ecx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, 0xf0(%rsp)
movq 0xa8(%rsp), %rdi
movq 0xd8(%rsp), %rsi
movl 0xbc(%rsp), %edx
movq 0xd0(%rsp), %rcx
movl 0xb8(%rsp), %r8d
callq 0x2ce0
movl %eax, 0x84(%rsp)
movq 0xa0(%rsp), %rdi
movq 0xc8(%rsp), %rsi
movl 0xb4(%rsp), %edx
movq 0xc0(%rsp), %rcx
movl 0xb0(%rsp), %r8d
callq 0x2ce0
movl %eax, 0x80(%rsp)
movq 0x98(%rsp), %rdi
movq 0xd8(%rsp), %rsi
movl 0xbc(%rsp), %edx
movq 0xc8(%rsp), %rcx
movl 0xb4(%rsp), %r8d
movq 0xf0(%rsp), %r9
callq 0x2fe0
movl %eax, 0x7c(%rsp)
movq 0x90(%rsp), %rdi
movq 0xa8(%rsp), %rsi
movl 0x84(%rsp), %edx
movq 0xa0(%rsp), %rcx
movl 0x80(%rsp), %r8d
movq 0xf0(%rsp), %r9
callq 0x2fe0
movl %eax, 0x78(%rsp)
movq 0x88(%rsp), %rdi
movq 0xd0(%rsp), %rsi
movl 0xb8(%rsp), %edx
movq 0xc0(%rsp), %rcx
movl 0xb0(%rsp), %r8d
movq 0xf0(%rsp), %r9
callq 0x2fe0
movl %eax, 0x74(%rsp)
movq 0x90(%rsp), %rdi
movq 0x90(%rsp), %rsi
movl 0x78(%rsp), %edx
movq 0x98(%rsp), %rcx
movl 0x7c(%rsp), %r8d
callq 0x2e60
movl %eax, 0x78(%rsp)
movq 0x90(%rsp), %rdi
movq 0x90(%rsp), %rsi
movl 0x78(%rsp), %edx
movq 0x88(%rsp), %rcx
movl 0x74(%rsp), %r8d
callq 0x2e60
movl %eax, 0x78(%rsp)
movl 0x7c(%rsp), %eax
movl %eax, 0xec(%rsp)
movq 0x118(%rsp), %rdi
movq 0x98(%rsp), %rsi
movl 0xec(%rsp), %edx
callq 0x2540
movq 0x118(%rsp), %rdi
movl 0xec(%rsp), %esi
movl 0x10c(%rsp), %edx
addl 0xfc(%rsp), %edx
callq 0x24a0
movq 0x118(%rsp), %rax
movl 0xe0(%rsp), %ecx
shll $0x0, %ecx
movslq %ecx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, 0x20(%rsp)
movq 0x118(%rsp), %rax
movl 0xe0(%rsp), %ecx
shll $0x0, %ecx
movslq %ecx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, 0x28(%rsp)
movl 0xec(%rsp), %eax
subl 0xe0(%rsp), %eax
cmpl $0x0, %eax
jle 0x357c
movl 0xec(%rsp), %eax
subl 0xe0(%rsp), %eax
movl %eax, 0x1c(%rsp)
jmp 0x3584
xorl %eax, %eax
movl %eax, 0x1c(%rsp)
jmp 0x3584
movq 0x28(%rsp), %rsi
movq 0x20(%rsp), %rdi
movl 0x1c(%rsp), %edx
movq 0x90(%rsp), %rcx
movl 0x78(%rsp), %r8d
callq 0x2ce0
movl %eax, 0xec(%rsp)
movq 0x118(%rsp), %rax
movl 0xe0(%rsp), %ecx
shll %ecx
movslq %ecx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, 0x8(%rsp)
movq 0x118(%rsp), %rax
movl 0xe0(%rsp), %ecx
shll %ecx
movslq %ecx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, 0x10(%rsp)
movl 0xec(%rsp), %eax
subl 0xe0(%rsp), %eax
cmpl $0x0, %eax
jle 0x3612
movl 0xec(%rsp), %eax
subl 0xe0(%rsp), %eax
movl %eax, 0x4(%rsp)
jmp 0x361a
xorl %eax, %eax
movl %eax, 0x4(%rsp)
jmp 0x361a
movq 0x10(%rsp), %rsi
movq 0x8(%rsp), %rdi
movl 0x4(%rsp), %edx
movq 0x88(%rsp), %rcx
movl 0x74(%rsp), %r8d
callq 0x2ce0
movl %eax, 0xec(%rsp)
movq 0x118(%rsp), %rdi
movl 0xec(%rsp), %esi
movl 0xe0(%rsp), %eax
shll %eax
addl %eax, %esi
callq 0x2640
movl %eax, 0x124(%rsp)
movl 0x124(%rsp), %eax
addq $0x128, %rsp            # imm = 0x128
retq
nopw %cs:(%rax,%rax)