// File: /workspace/github_c_makefile_star2_O0/yhg926[P]public_kssd/co2mco.c
// Function: llmco2arrmco
gidobj_t** llmco2arrmco(mco_entry_stat_t** llmco)
{
 size_t comp_sz = (1LL << 4*COMPONENT_SZ) ;
 gidobj_t** arrmco = calloc(comp_sz, sizeof(gidobj_t*));
 gidobj_t* current_blkpos_mapin_arrmco;
 gid_arr_llist_t *tmpblk, *tmpptr;
  for(size_t i = 0; i< comp_sz ; i++ ){
  if(llmco[i] == NULL) continue;
  int arr_len = (int)llmco[i]->g_num + 1;
   arrmco[i] = malloc( arr_len * sizeof(gidobj_t) );
  current_blkpos_mapin_arrmco = arrmco[i] + arr_len;
  arrmco[i][0] = llmco[i]->g_num;
  int blk_num = arrmco[i][0] % GID_ARR_SZ == 0 ? arrmco[i][0]/GID_ARR_SZ :arrmco[i][0]/GID_ARR_SZ + 1;
  for(int blk = 0; blk < blk_num; blk++){
   if( blk == 0 ){
    tmpblk = llmco[i]->next;
    if(arrmco[i][0] % GID_ARR_SZ == 0){
     current_blkpos_mapin_arrmco -= GID_ARR_SZ;
     memcpy(current_blkpos_mapin_arrmco, tmpblk->gidobj, GID_ARR_SZ * sizeof(gidobj_t));
    }
    else {
     current_blkpos_mapin_arrmco -= arrmco[i][0] % GID_ARR_SZ ;
     memcpy(current_blkpos_mapin_arrmco, tmpblk->gidobj, (arrmco[i][0] % GID_ARR_SZ) * sizeof(gidobj_t));
    }
    free(llmco[i]);
   }
   else {
    tmpptr = tmpblk;
    tmpblk = tmpblk->next;
    current_blkpos_mapin_arrmco -= GID_ARR_SZ;
        memcpy(current_blkpos_mapin_arrmco, tmpblk->gidobj,GID_ARR_SZ * sizeof(gidobj_t));
    free(tmpptr);
   }
  }
  }
 free(llmco);
 return arrmco;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq $0x10000000, -0x10(%rbp) # imm = 0x10000000
movq -0x10(%rbp), %rdi
movl $0x8, %esi
callq 0x3270
movq %rax, -0x18(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpq -0x10(%rbp), %rax
jae 0x48e7
movq -0x8(%rbp), %rax
movq -0x38(%rbp), %rcx
cmpq $0x0, (%rax,%rcx,8)
jne 0x4710
jmp 0x48d6
movq -0x8(%rbp), %rax
movq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl (%rax), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
movslq -0x3c(%rbp), %rdi
shlq $0x2, %rdi
callq 0x3310
movq %rax, %rdx
movq -0x18(%rbp), %rax
movq -0x38(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x18(%rbp), %rax
movq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x3c(%rbp), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl (%rax), %ecx
movq -0x18(%rbp), %rax
movq -0x38(%rbp), %rdx
movq (%rax,%rdx,8), %rax
movl %ecx, (%rax)
movq -0x18(%rbp), %rax
movq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl (%rax), %eax
andl $0xf, %eax
cmpl $0x0, %eax
jne 0x47a3
movq -0x18(%rbp), %rax
movq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl (%rax), %eax
shrl $0x4, %eax
movl %eax, -0x48(%rbp)
jmp 0x47ba
movq -0x18(%rbp), %rax
movq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl (%rax), %eax
shrl $0x4, %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
movl -0x48(%rbp), %eax
movl %eax, -0x40(%rbp)
movl $0x0, -0x44(%rbp)
movl -0x44(%rbp), %eax
cmpl -0x40(%rbp), %eax
jge 0x48d4
cmpl $0x0, -0x44(%rbp)
jne 0x4889
movq -0x8(%rbp), %rax
movq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rax
movq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl (%rax), %eax
andl $0xf, %eax
cmpl $0x0, %eax
jne 0x4827
movq -0x20(%rbp), %rax
addq $-0x40, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rsi
movl $0x40, %edx
callq 0x32c0
jmp 0x4876
movq -0x18(%rbp), %rax
movq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl (%rax), %ecx
andl $0xf, %ecx
movq -0x20(%rbp), %rax
movl %ecx, %ecx
movl %ecx, %edx
xorl %ecx, %ecx
subq %rdx, %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x18(%rbp), %rax
movq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl (%rax), %eax
andl $0xf, %eax
movl %eax, %eax
movl %eax, %edx
shlq $0x2, %rdx
callq 0x32c0
movq -0x8(%rbp), %rax
movq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x3040
jmp 0x48c4
movq -0x28(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rax
movq 0x40(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
addq $-0x40, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rsi
movl $0x40, %edx
callq 0x32c0
movq -0x30(%rbp), %rdi
callq 0x3040
jmp 0x48c6
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x47c7
jmp 0x48d6
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x46ee
movq -0x8(%rbp), %rdi
callq 0x3040
movq -0x18(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nopw (%rax,%rax)