// File: /workspace/github_c_makefile_star2_O0/mirth-lang[P]mirth/bin/mirth1.c
// Function: big_pos_u32_mul_sub_shift_accum_
static void big_pos_u32_mul_sub_shift_accum_(BIG* a, INT b, uint32_t scale, size_t shift) {
    size_t bsize;
    uint32_t *bradix;
    uint32_t bradix_temp[2] = {0};
    if (IS_I63(b)) {
        int64_t ib = GET_I63(b);
        ASSERT(ib >= 0);
        bsize = 2;
        bradix = bradix_temp;
        bradix_temp[0] = LO_RADIX(ib);
        bradix_temp[1] = HI_RADIX(ib);
    } else {
        BIG* bb = GET_BIG(b);
        bsize = bb->size;
        bradix = bb->radix;
    }

    uint64_t borrow = 0;
    size_t i = 0;
    for (; i < bsize; i++) {
        ASSERT(i+shift < a->size);
        uint64_t br = (uint64_t)scale * (uint64_t)bradix[i];
        ASSERT(borrow <= UINT64_MAX - br);
        br += borrow;
        uint64_t ahi = (i+shift+1 < a->size) ? a->radix[i+shift+1] : 0;
        uint64_t alo = a->radix[i+shift];
        uint64_t ar = (ahi << 32) | alo;
        borrow = (ar < br) ? (uint64_t)0x100000000 : (uint64_t)0;
        ar -= br;
        a->radix[i+shift] = LO_RADIX(ar);
        if (i+shift+1 < a->size) {
            a->radix[i+shift+1] = HI_RADIX(ar);
        }
    }
    if (borrow) {
        big_pred_at_accum_(a, i+shift+1);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rsi, -0x8(%rbp)
movq %rdi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq %rcx, -0x20(%rbp)
leaq -0x38(%rbp), %rdi
xorl %esi, %esi
movl $0x8, %edx
callq 0x5080
movq -0x8(%rbp), %rax
andq $0x1, %rax
cmpq $0x0, %rax
je 0x42115
movq -0x8(%rbp), %rax
subq $0x1, %rax
movl $0x2, %ecx
cqto
idivq %rcx
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
jge 0x420ef
movl $0x2, %edi
leaq 0x313a98(%rip), %rsi    # 0x355b69
movl $0x35, %edx
callq 0x5060
callq 0x5310
callq 0x53b0
movl $0x1, %edi
callq 0x5130
jmp 0x420f1
movq $0x2, -0x28(%rbp)
leaq -0x38(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x40(%rbp), %rax
movl %eax, -0x38(%rbp)
movq -0x40(%rbp), %rax
shrq $0x20, %rax
movl %eax, -0x34(%rbp)
jmp 0x42135
movq -0x8(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x48(%rbp), %rax
addq $0x18, %rax
movq %rax, -0x30(%rbp)
movq $0x0, -0x50(%rbp)
movq $0x0, -0x58(%rbp)
movq -0x58(%rbp), %rax
cmpq -0x28(%rbp), %rax
jae 0x422db
jmp 0x42155
movq -0x58(%rbp), %rax
addq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jb 0x42191
movl $0x2, %edi
leaq 0x313a2c(%rip), %rsi    # 0x355b9f
movl $0x3f, %edx
callq 0x5060
callq 0x5310
callq 0x53b0
movl $0x1, %edi
callq 0x5130
jmp 0x42193
movl -0x14(%rbp), %eax
movq -0x30(%rbp), %rcx
movq -0x58(%rbp), %rdx
movl (%rcx,%rdx,4), %ecx
imulq %rcx, %rax
movq %rax, -0x60(%rbp)
movq -0x50(%rbp), %rax
movq $-0x1, %rcx
subq -0x60(%rbp), %rcx
cmpq %rcx, %rax
jbe 0x421e7
movl $0x2, %edi
leaq 0x313a16(%rip), %rsi    # 0x355bdf
movl $0x47, %edx
callq 0x5060
callq 0x5310
callq 0x53b0
movl $0x1, %edi
callq 0x5130
jmp 0x421e9
movq -0x50(%rbp), %rax
addq -0x60(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x58(%rbp), %rax
addq -0x20(%rbp), %rax
addq $0x1, %rax
movq -0x10(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jae 0x42220
movq -0x10(%rbp), %rax
movq -0x58(%rbp), %rcx
addq -0x20(%rbp), %rcx
movl 0x1c(%rax,%rcx,4), %eax
movl %eax, -0x7c(%rbp)
jmp 0x42227
xorl %eax, %eax
movl %eax, -0x7c(%rbp)
jmp 0x42227
movl -0x7c(%rbp), %eax
movl %eax, %eax
movq %rax, -0x68(%rbp)
movq -0x10(%rbp), %rax
movq -0x58(%rbp), %rcx
addq -0x20(%rbp), %rcx
movl 0x18(%rax,%rcx,4), %eax
movq %rax, -0x70(%rbp)
movq -0x68(%rbp), %rax
shlq $0x20, %rax
orq -0x70(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rdx
movq -0x60(%rbp), %rsi
xorl %eax, %eax
movabsq $0x100000000, %rcx      # imm = 0x100000000
cmpq %rsi, %rdx
cmovbq %rcx, %rax
movq %rax, -0x50(%rbp)
movq -0x60(%rbp), %rcx
movq -0x78(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rax
movl %eax, %edx
movq -0x10(%rbp), %rax
movq -0x58(%rbp), %rcx
addq -0x20(%rbp), %rcx
movl %edx, 0x18(%rax,%rcx,4)
movq -0x58(%rbp), %rax
addq -0x20(%rbp), %rax
addq $0x1, %rax
movq -0x10(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jae 0x422c8
movq -0x78(%rbp), %rax
shrq $0x20, %rax
movl %eax, %edx
movq -0x10(%rbp), %rax
movq -0x58(%rbp), %rcx
addq -0x20(%rbp), %rcx
movl %edx, 0x1c(%rax,%rcx,4)
jmp 0x422ca
movq -0x58(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x58(%rbp)
jmp 0x42145
cmpq $0x0, -0x50(%rbp)
je 0x422f7
movq -0x10(%rbp), %rdi
movq -0x58(%rbp), %rsi
addq -0x20(%rbp), %rsi
addq $0x1, %rsi
callq 0x42590
addq $0x80, %rsp
popq %rbp
retq