// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/vcf.c
// Function: bcf_enc_vint
int bcf_enc_vint(kstring_t *s, int n, int32_t *a, int wsize)
{
    int32_t max = INT32_MIN, min = INT32_MAX;
    int i;
    if (n <= 0) {
        return bcf_enc_size(s, 0, BCF_BT_NULL);
    } else if (n == 1) {
        return bcf_enc_int1(s, a[0]);
    } else {
        if (wsize <= 0) wsize = n;

        // Equivalent to:
        // for (i = 0; i < n; ++i) {
        //     if (a[i] == bcf_int32_missing || a[i] == bcf_int32_vector_end )
        //         continue;
        //     if (max < a[i]) max = a[i];
        //     if (min > a[i]) min = a[i];
        // }
        int max4[4] = {INT32_MIN, INT32_MIN, INT32_MIN, INT32_MIN};
        int min4[4] = {INT32_MAX, INT32_MAX, INT32_MAX, INT32_MAX};
        for (i = 0; i < (n&~3); i+=4) {
            // bcf_int32_missing    == INT32_MIN and
            // bcf_int32_vector_end == INT32_MIN+1.
            // We skip these, but can mostly avoid explicit checking
            if (max4[0] < a[i+0]) max4[0] = a[i+0];
            if (max4[1] < a[i+1]) max4[1] = a[i+1];
            if (max4[2] < a[i+2]) max4[2] = a[i+2];
            if (max4[3] < a[i+3]) max4[3] = a[i+3];
            if (min4[0] > a[i+0] && a[i+0] > INT32_MIN+1) min4[0] = a[i+0];
            if (min4[1] > a[i+1] && a[i+1] > INT32_MIN+1) min4[1] = a[i+1];
            if (min4[2] > a[i+2] && a[i+2] > INT32_MIN+1) min4[2] = a[i+2];
            if (min4[3] > a[i+3] && a[i+3] > INT32_MIN+1) min4[3] = a[i+3];
        }
        min = min4[0];
        if (min > min4[1]) min = min4[1];
        if (min > min4[2]) min = min4[2];
        if (min > min4[3]) min = min4[3];
        max = max4[0];
        if (max < max4[1]) max = max4[1];
        if (max < max4[2]) max = max4[2];
        if (max < max4[3]) max = max4[3];
        for (; i < n; ++i) {
            if (max < a[i]) max = a[i];
            if (min > a[i] && a[i] > INT32_MIN+1) min = a[i];
        }

        if (max <= BCF_MAX_BT_INT8 && min >= BCF_MIN_BT_INT8) {
            if (bcf_enc_size(s, wsize, BCF_BT_INT8) < 0 ||
                ks_resize(s, s->l + n) < 0)
                return -1;
            uint8_t *p = (uint8_t *) s->s + s->l;
            for (i = 0; i < n; ++i, p++) {
                if ( a[i]==bcf_int32_vector_end )   *p = bcf_int8_vector_end;
                else if ( a[i]==bcf_int32_missing ) *p = bcf_int8_missing;
                else *p = a[i];
            }
            s->l += n;
        } else if (max <= BCF_MAX_BT_INT16 && min >= BCF_MIN_BT_INT16) {
            uint8_t *p;
            if (bcf_enc_size(s, wsize, BCF_BT_INT16) < 0 ||
                ks_resize(s, s->l + n * sizeof(int16_t)) < 0)
                return -1;
            p = (uint8_t *) s->s + s->l;
            for (i = 0; i < n; ++i)
            {
                int16_t x;
                if ( a[i]==bcf_int32_vector_end ) x = bcf_int16_vector_end;
                else if ( a[i]==bcf_int32_missing ) x = bcf_int16_missing;
                else x = a[i];
                i16_to_le(x, p);
                p += sizeof(int16_t);
            }
            s->l += n * sizeof(int16_t);
        } else {
            uint8_t *p;
            if (bcf_enc_size(s, wsize, BCF_BT_INT32) < 0 ||
                ks_resize(s, s->l + n * sizeof(int32_t)) < 0)
                return -1;
            p = (uint8_t *) s->s + s->l;
            for (i = 0; i < n; ++i) {
                i32_to_le(a[i], p);
                p += sizeof(int32_t);
            }
            s->l += n * sizeof(int32_t);
        }
    }

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movl %ecx, -0x24(%rbp)
movl $0x80000000, -0x28(%rbp) # imm = 0x80000000
movl $0x7fffffff, -0x2c(%rbp) # imm = 0x7FFFFFFF
cmpl $0x0, -0x14(%rbp)
jg 0x4432f
movq -0x10(%rbp), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0x448b0
movl %eax, -0x4(%rbp)
jmp 0x44899
cmpl $0x1, -0x14(%rbp)
jne 0x4434c
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rax
movl (%rax), %esi
callq 0x44a50
movl %eax, -0x4(%rbp)
jmp 0x44899
cmpl $0x0, -0x24(%rbp)
jg 0x44358
movl -0x14(%rbp), %eax
movl %eax, -0x24(%rbp)
movq 0xc3161(%rip), %rax     # 0x1074c0
movq %rax, -0x40(%rbp)
movq 0xc315e(%rip), %rax     # 0x1074c8
movq %rax, -0x38(%rbp)
movq 0xc315b(%rip), %rax     # 0x1074d0
movq %rax, -0x50(%rbp)
movq 0xc3158(%rip), %rax     # 0x1074d8
movq %rax, -0x48(%rbp)
movl $0x0, -0x30(%rbp)
movl -0x30(%rbp), %eax
movl -0x14(%rbp), %ecx
andl $-0x4, %ecx
cmpl %ecx, %eax
jge 0x44544
movl -0x40(%rbp), %eax
movq -0x20(%rbp), %rcx
movl -0x30(%rbp), %edx
addl $0x0, %edx
movslq %edx, %rdx
cmpl (%rcx,%rdx,4), %eax
jge 0x443c4
movq -0x20(%rbp), %rax
movl -0x30(%rbp), %ecx
addl $0x0, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x40(%rbp)
movl -0x3c(%rbp), %eax
movq -0x20(%rbp), %rcx
movl -0x30(%rbp), %edx
addl $0x1, %edx
movslq %edx, %rdx
cmpl (%rcx,%rdx,4), %eax
jge 0x443ec
movq -0x20(%rbp), %rax
movl -0x30(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x3c(%rbp)
movl -0x38(%rbp), %eax
movq -0x20(%rbp), %rcx
movl -0x30(%rbp), %edx
addl $0x2, %edx
movslq %edx, %rdx
cmpl (%rcx,%rdx,4), %eax
jge 0x44414
movq -0x20(%rbp), %rax
movl -0x30(%rbp), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x38(%rbp)
movl -0x34(%rbp), %eax
movq -0x20(%rbp), %rcx
movl -0x30(%rbp), %edx
addl $0x3, %edx
movslq %edx, %rdx
cmpl (%rcx,%rdx,4), %eax
jge 0x4443c
movq -0x20(%rbp), %rax
movl -0x30(%rbp), %ecx
addl $0x3, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x34(%rbp)
movl -0x50(%rbp), %eax
movq -0x20(%rbp), %rcx
movl -0x30(%rbp), %edx
addl $0x0, %edx
movslq %edx, %rdx
cmpl (%rcx,%rdx,4), %eax
jle 0x4447a
movq -0x20(%rbp), %rax
movl -0x30(%rbp), %ecx
addl $0x0, %ecx
movslq %ecx, %rcx
cmpl $0x80000001, (%rax,%rcx,4) # imm = 0x80000001
jle 0x4447a
movq -0x20(%rbp), %rax
movl -0x30(%rbp), %ecx
addl $0x0, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x50(%rbp)
movl -0x4c(%rbp), %eax
movq -0x20(%rbp), %rcx
movl -0x30(%rbp), %edx
addl $0x1, %edx
movslq %edx, %rdx
cmpl (%rcx,%rdx,4), %eax
jle 0x444b8
movq -0x20(%rbp), %rax
movl -0x30(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
cmpl $0x80000001, (%rax,%rcx,4) # imm = 0x80000001
jle 0x444b8
movq -0x20(%rbp), %rax
movl -0x30(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x4c(%rbp)
movl -0x48(%rbp), %eax
movq -0x20(%rbp), %rcx
movl -0x30(%rbp), %edx
addl $0x2, %edx
movslq %edx, %rdx
cmpl (%rcx,%rdx,4), %eax
jle 0x444f6
movq -0x20(%rbp), %rax
movl -0x30(%rbp), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
cmpl $0x80000001, (%rax,%rcx,4) # imm = 0x80000001
jle 0x444f6
movq -0x20(%rbp), %rax
movl -0x30(%rbp), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x48(%rbp)
movl -0x44(%rbp), %eax
movq -0x20(%rbp), %rcx
movl -0x30(%rbp), %edx
addl $0x3, %edx
movslq %edx, %rdx
cmpl (%rcx,%rdx,4), %eax
jle 0x44534
movq -0x20(%rbp), %rax
movl -0x30(%rbp), %ecx
addl $0x3, %ecx
movslq %ecx, %rcx
cmpl $0x80000001, (%rax,%rcx,4) # imm = 0x80000001
jle 0x44534
movq -0x20(%rbp), %rax
movl -0x30(%rbp), %ecx
addl $0x3, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x44(%rbp)
jmp 0x44536
movl -0x30(%rbp), %eax
addl $0x4, %eax
movl %eax, -0x30(%rbp)
jmp 0x4438b
movl -0x50(%rbp), %eax
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x4c(%rbp), %eax
jle 0x44558
movl -0x4c(%rbp), %eax
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x48(%rbp), %eax
jle 0x44566
movl -0x48(%rbp), %eax
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x44(%rbp), %eax
jle 0x44574
movl -0x44(%rbp), %eax
movl %eax, -0x2c(%rbp)
movl -0x40(%rbp), %eax
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
cmpl -0x3c(%rbp), %eax
jge 0x44588
movl -0x3c(%rbp), %eax
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
cmpl -0x38(%rbp), %eax
jge 0x44596
movl -0x38(%rbp), %eax
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
cmpl -0x34(%rbp), %eax
jge 0x445a4
movl -0x34(%rbp), %eax
movl %eax, -0x28(%rbp)
jmp 0x445a6
movl -0x30(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x44608
movl -0x28(%rbp), %eax
movq -0x20(%rbp), %rcx
movslq -0x30(%rbp), %rdx
cmpl (%rcx,%rdx,4), %eax
jge 0x445cc
movq -0x20(%rbp), %rax
movslq -0x30(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x28(%rbp)
movl -0x2c(%rbp), %eax
movq -0x20(%rbp), %rcx
movslq -0x30(%rbp), %rdx
cmpl (%rcx,%rdx,4), %eax
jle 0x445fb
movq -0x20(%rbp), %rax
movslq -0x30(%rbp), %rcx
cmpl $0x80000001, (%rax,%rcx,4) # imm = 0x80000001
jle 0x445fb
movq -0x20(%rbp), %rax
movslq -0x30(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x2c(%rbp)
jmp 0x445fd
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x445a6
cmpl $0x7f, -0x28(%rbp)
jg 0x446f1
cmpl $-0x78, -0x2c(%rbp)
jl 0x446f1
movq -0x10(%rbp), %rdi
movl -0x24(%rbp), %esi
movl $0x1, %edx
callq 0x448b0
cmpl $0x0, %eax
jl 0x4464e
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
movslq -0x14(%rbp), %rax
addq %rax, %rsi
callq 0x44ba0
cmpl $0x0, %eax
jge 0x4465a
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x44899
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rcx
addq (%rcx), %rax
movq %rax, -0x58(%rbp)
movl $0x0, -0x30(%rbp)
movl -0x30(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x446de
movq -0x20(%rbp), %rax
movslq -0x30(%rbp), %rcx
cmpl $0x80000001, (%rax,%rcx,4) # imm = 0x80000001
jne 0x44696
movq -0x58(%rbp), %rax
movb $-0x7f, (%rax)
jmp 0x446c5
movq -0x20(%rbp), %rax
movslq -0x30(%rbp), %rcx
cmpl $0x80000000, (%rax,%rcx,4) # imm = 0x80000000
jne 0x446b0
movq -0x58(%rbp), %rax
movb $-0x80, (%rax)
jmp 0x446c3
movq -0x20(%rbp), %rax
movslq -0x30(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movb %al, %cl
movq -0x58(%rbp), %rax
movb %cl, (%rax)
jmp 0x446c5
jmp 0x446c7
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
movq -0x58(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x58(%rbp)
jmp 0x44674
movslq -0x14(%rbp), %rcx
movq -0x10(%rbp), %rax
addq (%rax), %rcx
movq %rcx, (%rax)
jmp 0x4488e
cmpl $0x7fff, -0x28(%rbp)    # imm = 0x7FFF
jg 0x447ee
cmpl $0xffff8008, -0x2c(%rbp) # imm = 0xFFFF8008
jl 0x447ee
movq -0x10(%rbp), %rdi
movl -0x24(%rbp), %esi
movl $0x2, %edx
callq 0x448b0
cmpl $0x0, %eax
jl 0x44740
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
movslq -0x14(%rbp), %rax
shlq %rax
addq %rax, %rsi
callq 0x44ba0
cmpl $0x0, %eax
jge 0x4474c
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x44899
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rcx
addq (%rcx), %rax
movq %rax, -0x60(%rbp)
movl $0x0, -0x30(%rbp)
movl -0x30(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x447d8
movq -0x20(%rbp), %rax
movslq -0x30(%rbp), %rcx
cmpl $0x80000001, (%rax,%rcx,4) # imm = 0x80000001
jne 0x44787
movw $0x8001, -0x62(%rbp)    # imm = 0x8001
jmp 0x447b1
movq -0x20(%rbp), %rax
movslq -0x30(%rbp), %rcx
cmpl $0x80000000, (%rax,%rcx,4) # imm = 0x80000000
jne 0x447a0
movw $0x8000, -0x62(%rbp)    # imm = 0x8000
jmp 0x447af
movq -0x20(%rbp), %rax
movslq -0x30(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movw %ax, -0x62(%rbp)
jmp 0x447b1
movw -0x62(%rbp), %ax
movq -0x60(%rbp), %rsi
movswl %ax, %edi
callq 0x44c40
movq -0x60(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x60(%rbp)
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x44766
movslq -0x14(%rbp), %rcx
shlq %rcx
movq -0x10(%rbp), %rax
addq (%rax), %rcx
movq %rcx, (%rax)
jmp 0x4488c
movq -0x10(%rbp), %rdi
movl -0x24(%rbp), %esi
movl $0x3, %edx
callq 0x448b0
cmpl $0x0, %eax
jl 0x44824
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
movslq -0x14(%rbp), %rax
shlq $0x2, %rax
addq %rax, %rsi
callq 0x44ba0
cmpl $0x0, %eax
jge 0x4482d
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x44899
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rcx
addq (%rcx), %rax
movq %rax, -0x70(%rbp)
movl $0x0, -0x30(%rbp)
movl -0x30(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x4487a
movq -0x20(%rbp), %rax
movslq -0x30(%rbp), %rcx
movl (%rax,%rcx,4), %edi
movq -0x70(%rbp), %rsi
callq 0x43890
movq -0x70(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x70(%rbp)
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x44847
movslq -0x14(%rbp), %rcx
shlq $0x2, %rcx
movq -0x10(%rbp), %rax
addq (%rax), %rcx
movq %rcx, (%rax)
jmp 0x4488e
jmp 0x44890
jmp 0x44892
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)