// File: /workspace/github_c_makefile_star2_O3/yhg926[P]public_kssd/iseq2comem.c
// Function: write_fqkoc2files
unsigned int write_fqkoc2files(char* cofilename, llong *co)
{
  int comp_code_bits = half_ctx_len - drlevel > COMPONENT_SZ ? 4*(half_ctx_len - drlevel - COMPONENT_SZ ) : 0 ;
  FILE **outf,**abdf;
  outf = malloc(component_num * sizeof(FILE *));
 abdf = malloc(component_num * sizeof(FILE *));
  char cofilename_with_component[PATHLEN];
  for(int i=0;i<component_num ;i++)
  {
    sprintf(cofilename_with_component,"%s.%d",cofilename,i);
    if ( (outf[i] = fopen(cofilename_with_component,"wb") ) == NULL )
      err(errno,"write_fqkoc2files()") ;
  sprintf(cofilename_with_component,"%s.%d.a",cofilename,i);
  if ( (abdf[i] = fopen(cofilename_with_component,"wb") ) == NULL )
      err(errno,"write_fqkoc2files()") ;
  };
  unsigned int count, wr = 0, newid,compi;
 unsigned short abdc;
  for(count=0;count < hashsize; count++)
  {
    if( co[count] > 0 ) {
   compi = (co[count] >> OCCRC_BIT ) % component_num;
      newid = (unsigned int)(co[count] >> (comp_code_bits + OCCRC_BIT));
      fwrite( &newid, sizeof(newid),1,outf[compi] );
   abdc = co[count] & OCCRC_MAX;
   fwrite( &abdc, sizeof(abdc),1,abdf[compi] );
      wr++;
    }
  }
  for(int i=0;i<component_num ;i++){
    fclose(outf[i]);
  fclose(abdf[i]);
 }
  free(outf);
 free(abdf);
  return wr;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x138, %rsp            # imm = 0x138
movq %rsi, 0x18(%rsp)
movl 0x4a72a(%rip), %eax     # 0x5e618
subl 0x4a730(%rip), %eax     # 0x5e624
movq %rdi, %r13
cmpl $0x8, %eax
leal -0xc(,%rax,4), %eax
movl $0x10, %ecx
cmovgel %eax, %ecx
movq %rcx, 0x28(%rsp)
movslq 0x4a71b(%rip), %rbx     # 0x5e630
leaq (,%rbx,8), %r14
movq %r14, %rdi
callq 0x3340
movq %rax, 0x10(%rsp)
movq %r14, %rdi
callq 0x3340
movq %rax, %r14
testq %rbx, %rbx
jle 0x13fbf
leaq 0x30(%rsp), %r12
leaq 0x1120(%rip), %rbp      # 0x1506a
xorl %r15d, %r15d
movq %r12, %rdi
leaq 0x110a(%rip), %rsi      # 0x15061
movq %r13, %rdx
movl %r15d, %ecx
xorl %eax, %eax
callq 0x3430
movq %r12, %rdi
movq %rbp, %rsi
callq 0x33a0
movq 0x10(%rsp), %rcx
movq %rax, (%rcx,%r15,8)
testq %rax, %rax
je 0x140b9
movq %r12, %rdi
leaq 0x158c(%rip), %rsi      # 0x15517
movq %r13, %rdx
movl %r15d, %ecx
xorl %eax, %eax
callq 0x3430
movq %r12, %rdi
movq %rbp, %rsi
callq 0x33a0
movq %rax, (%r14,%r15,8)
testq %rax, %rax
je 0x140b9
incq %r15
movslq 0x4a676(%rip), %rbx     # 0x5e630
cmpq %rbx, %r15
jl 0x13f4d
movl 0x4a663(%rip), %eax     # 0x5e628
testl %eax, %eax
je 0x14067
xorl %r15d, %r15d
leaq 0xe(%rsp), %r13
xorl %ebp, %ebp
movq 0x10(%rsp), %r12
movq 0x18(%rsp), %rbx
movq (%rbx,%r15,8), %rsi
testq %rsi, %rsi
je 0x14055
movq %rsi, %rax
shrq $0x10, %rax
movslq 0x4a638(%rip), %rcx     # 0x5e630
xorl %edx, %edx
divq %rcx
movq 0x28(%rsp), %rcx
shrq %cl, %rsi
movl %esi, 0x24(%rsp)
movl %edx, %ebx
movq (%r12,%rbx,8), %rcx
movl $0x4, %esi
movl $0x1, %edx
leaq 0x24(%rsp), %rdi
callq 0x3450
movq 0x18(%rsp), %rax
movzwl (%rax,%r15,8), %eax
movw %ax, 0xe(%rsp)
movq (%r14,%rbx,8), %rcx
movq 0x18(%rsp), %rbx
movl $0x2, %esi
movl $0x1, %edx
movq %r13, %rdi
callq 0x3450
incl %ebp
movl 0x4a5d3(%rip), %eax     # 0x5e628
incq %r15
movl %eax, %ecx
cmpq %rcx, %r15
jb 0x13fe1
movl 0x4a5cb(%rip), %ebx     # 0x5e630
jmp 0x1406e
xorl %ebp, %ebp
movq 0x10(%rsp), %r12
testl %ebx, %ebx
jle 0x14095
xorl %ebx, %ebx
movq (%r12,%rbx,8), %rdi
callq 0x3100
movq (%r14,%rbx,8), %rdi
callq 0x3100
incq %rbx
movslq 0x4a5a0(%rip), %rax     # 0x5e630
cmpq %rax, %rbx
jl 0x14074
movq %r12, %rdi
callq 0x3040
movq %r14, %rdi
callq 0x3040
movl %ebp, %eax
addq $0x138, %rsp            # imm = 0x138
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x3060
movl (%rax), %edi
leaq 0x420a(%rip), %rsi      # 0x182d1
xorl %eax, %eax
callq 0x3330