// File: /workspace/github_c_makefile_star2_O3/983[P]bigint/bigint.c
// Function: bigint_raw_shift_right
int bigint_raw_shift_right(
    bigint_word *dst, int n_dst,
    const bigint_word *src, int n_src,
    int shift
){
    int i;
    int word_shift = shift / BIGINT_WORD_BITS;
    int bits_shift = shift % BIGINT_WORD_BITS;

    if (bits_shift){
        bigint_word hi, lo = src[word_shift];

        for (i = 0; i < n_src - word_shift - 1; i++){
            hi = src[i + word_shift + 1];
            BIGINT_ASSERT(i, <, n_dst);
            dst[i] = (hi << (BIGINT_WORD_BITS - bits_shift)) | (lo >> bits_shift);
            lo = hi;
        }

        BIGINT_ASSERT(i, <, n_dst);
        dst[i++] = lo >> bits_shift;

        BIGINT_ASSERT(i, <=, n_dst);
        return bigint_raw_truncate(dst, i);
    }else{
        /* this case is not only separate because of performance */
        /* but (hi << (BIGINT_WORD_BITS - 0)) is also undefined behaviour */
        for (i = 0; i < n_src - word_shift; i++){
            BIGINT_ASSERT(i, <, n_dst);
            dst[i] = src[i + word_shift];
        }

        BIGINT_ASSERT(i, <=, n_dst);
        return bigint_raw_truncate(dst, i);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %r8d, %r9d
sarl $0x5, %r9d
movl %r8d, %eax
andl $0x1f, %eax
je 0x2d74
movslq %r9d, %r15
movl (%rdx,%r15,4), %r10d
movl %r15d, %r9d
notl %r9d
addl %ecx, %r9d
testl %r9d, %r9d
jle 0x2dc7
xorl %r11d, %r11d
testl %esi, %esi
movl $0x0, %ebx
cmovgl %esi, %ebx
movl %r9d, %r14d
leaq (%rdx,%r15,4), %rdx
addq $0x4, %rdx
cmpq %r11, %rbx
je 0x2e09
movl (%rdx,%r11,4), %ebp
movl %r8d, %ecx
shrdl %cl, %ebp, %r10d
movl %r10d, (%rdi,%r11,4)
incq %r11
movl %ebp, %r10d
cmpq %r11, %r14
jne 0x2d4c
movl %ebp, %r10d
jmp 0x2dca
subl %r9d, %ecx
jle 0x2df6
movslq %r9d, %r10
xorl %eax, %eax
testl %esi, %esi
movl $0x0, %r8d
cmovgl %esi, %r8d
movl %ecx, %r9d
leaq (%rdx,%r10,4), %rdx
cmpq %rax, %r8
je 0x2e28
movl (%rdx,%rax,4), %r10d
movl %r10d, (%rdi,%rax,4)
incq %rax
cmpq %rax, %r9
jne 0x2d91
cmpl %esi, %ecx
jg 0x2e66
movl %ecx, %eax
cmpl $0x0, -0x4(%rdi,%rax,4)
jne 0x2dfc
leal -0x1(%rcx), %eax
cmpl $0x1, %ecx
movl %eax, %ecx
jg 0x2db2
jmp 0x2dfa
xorl %r9d, %r9d
cmpl %esi, %r9d
jge 0x2e47
movl %eax, %ecx
shrl %cl, %r10d
movl %r9d, %eax
movl %r10d, (%rdi,%rax,4)
incl %r9d
movl %r9d, %ecx
movl %ecx, %eax
cmpl $0x0, -0x4(%rdi,%rax,4)
jne 0x2dfc
leal -0x1(%rcx), %eax
cmpl $0x1, %ecx
movl %eax, %ecx
jg 0x2de1
jmp 0x2dfa
testl %esi, %esi
js 0x2e66
xorl %ecx, %ecx
movl %ecx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2661(%rip), %rdi      # 0x5471
leaq 0x23fc(%rip), %rsi      # 0x5213
leaq 0x2670(%rip), %rcx      # 0x548e
movl $0x2c9, %edx            # imm = 0x2C9
callq 0x1060
leaq 0x2642(%rip), %rdi      # 0x5471
leaq 0x23dd(%rip), %rsi      # 0x5213
leaq 0x2651(%rip), %rcx      # 0x548e
movl $0x2d7, %edx            # imm = 0x2D7
callq 0x1060
leaq 0x2623(%rip), %rdi      # 0x5471
leaq 0x23be(%rip), %rsi      # 0x5213
leaq 0x2632(%rip), %rcx      # 0x548e
movl $0x2ce, %edx            # imm = 0x2CE
callq 0x1060
leaq 0x2612(%rip), %rdi      # 0x547f
leaq 0x239f(%rip), %rsi      # 0x5213
leaq 0x2613(%rip), %rcx      # 0x548e
movl $0x2db, %edx            # imm = 0x2DB
callq 0x1060