// File: /workspace/github_c_makefile_star2_O2/jiqingxiaoxi[P]RPA/RPA.c
// Function: merge
void merge(int *store,int *temp,int *data,int start,int end,int middle)
{
        int i,j,k;
        i=start;
        j=middle+1;
        k=start;
        while(i<=middle&&j<=end)
        {
                if(data[store[i]*6]<data[store[j]*6])
                {
                        temp[k]=store[i];
                        k++;
                        i++;
                        continue;
                }
                if(data[store[j]*6]<data[store[i]*6])
                {
                        temp[k]=store[j];
                        k++;
                        j++;
                        continue;
                }
        //len
                if(data[store[i]*6+1]<data[store[j]*6+1])
                {
                        temp[k]=store[i];
                        k++;
                        i++;
                        continue;
                }
                if(data[store[j]*6+1]<data[store[i]*6+1])
                {
                        temp[k]=store[j];
                        k++;
                        j++;
                        continue;
                }
        //gi
                if(data[store[i]*6+2]<data[store[j]*6+2])
                {
                        temp[k]=store[i];
                        k++;
                        i++;
                        continue;
                }
                if(data[store[j]*6+2]<data[store[i]*6+2])
                {
                        temp[k]=store[j];
                        k++;
                        j++;
                        continue;
                }
        //position
                if(data[store[i]*6+3]<data[store[j]*6+3])
                {
                        temp[k]=store[i];
                        k++;
                        i++;
                }
                else
                {
                        temp[k]=store[j];
                        k++;
                        j++;
                        continue;
                }
        }
        while(i<=middle)
        {
                temp[k]=store[i];
                k++;
                i++;
        }
        while(j<=end)
        {
                temp[k]=store[j];
                k++;
                j++;
        }
        for(i=start;i<=end;i++)
                store[i]=temp[i];
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movl %r8d, -0x2c(%rbp)
leal 0x1(%r9), %r8d
movslq %ecx, %rax
movq %rsi, -0x38(%rbp)
leaq (%rsi,%rax,4), %r10
movslq %ecx, %rbx
cmpl %r9d, %ecx
jg 0xa5bd
cmpl -0x2c(%rbp), %r8d
jg 0xa5bd
movslq (%rdi,%rbx,4), %rbx
imulq $0x6, %rbx, %r15
movl (%rdx,%r15,4), %r13d
movslq %r8d, %r14
movslq (%rdi,%r14,4), %r14
imulq $0x6, %r14, %r12
movl (%rdx,%r12,4), %r11d
cmpl %r11d, %r13d
jge 0xa56d
movl %ebx, (%r10)
incl %ecx
jmp 0xa575
jle 0xa57b
movl %r14d, (%r10)
incl %r8d
addq $0x4, %r10
jmp 0xa538
movl %r15d, %r11d
orl $0x1, %r11d
movslq %r11d, %r11
movl (%rdx,%r11,4), %r11d
movl %r12d, %r13d
orl $0x1, %r13d
movslq %r13d, %r13
movl (%rdx,%r13,4), %r13d
cmpl %r13d, %r11d
jl 0xa566
jg 0xa56f
movl 0x8(%rdx,%r15,4), %r11d
movl 0x8(%rdx,%r12,4), %r13d
cmpl %r13d, %r11d
jl 0xa566
jg 0xa56f
movl 0xc(%rdx,%r15,4), %r11d
cmpl 0xc(%rdx,%r12,4), %r11d
jl 0xa566
jmp 0xa56f
movslq %r8d, %rcx
movslq %r9d, %rdx
cmpq %rdx, %rbx
jg 0xa5d7
movl (%rdi,%rbx,4), %esi
movl %esi, (%r10)
incq %rbx
addq $0x4, %r10
jmp 0xa5c3
movslq -0x2c(%rbp), %rdx
cmpq %rdx, %rcx
jg 0xa5ef
movl (%rdi,%rcx,4), %esi
movl %esi, (%r10)
incq %rcx
addq $0x4, %r10
jmp 0xa5db
movq -0x38(%rbp), %rsi
cmpq %rdx, %rax
jg 0xa603
movl (%rsi,%rax,4), %ecx
movl %ecx, (%rdi,%rax,4)
incq %rax
jmp 0xa5f3
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq