// File: /workspace/github_c_makefile_star2_O1/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 $0x128, %rsp            # imm = 0x128
movq %rsi, 0x8(%rsp)
movl 0x4b05c(%rip), %eax     # 0x5e618
subl 0x4b062(%rip), %eax     # 0x5e624
movq %rdi, %r13
cmpl $0x8, %eax
leal -0xc(,%rax,4), %eax
movl $0x10, %ecx
cmovgel %eax, %ecx
movq %rcx, 0x18(%rsp)
movslq 0x4b04d(%rip), %r15     # 0x5e630
leaq (,%r15,8), %r14
movq %r14, %rdi
callq 0x3340
movq %rax, %rbx
movq %r14, %rdi
callq 0x3340
movq %rax, %r14
testq %r15, %r15
jle 0x13682
leaq 0x20(%rsp), %r12
leaq 0x1a58(%rip), %rbp      # 0x1506a
xorl %r15d, %r15d
movq %r12, %rdi
leaq 0x1a42(%rip), %rsi      # 0x15061
movq %r13, %rdx
movl %r15d, %ecx
xorl %eax, %eax
callq 0x3430
movq %r12, %rdi
movq %rbp, %rsi
callq 0x33a0
movq %rax, (%rbx,%r15,8)
testq %rax, %rax
je 0x13770
movq %r12, %rdi
leaq 0x1e79(%rip), %rsi      # 0x154c7
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 0x13770
incq %r15
movslq 0x4afb3(%rip), %rax     # 0x5e630
cmpq %rax, %r15
jl 0x13615
cmpl $0x0, 0x4af9f(%rip)     # 0x5e628
je 0x1371d
xorl %r15d, %r15d
leaq 0x6(%rsp), %r13
xorl %ebp, %ebp
movq 0x8(%rsp), %rcx
movq (%rcx,%r15,8), %rsi
testq %rsi, %rsi
je 0x1370d
movq %rsi, %rax
shrq $0x10, %rax
movslq 0x4af7b(%rip), %rcx     # 0x5e630
xorl %edx, %edx
divq %rcx
movq 0x18(%rsp), %rcx
shrq %cl, %rsi
movl %esi, 0x14(%rsp)
movl %edx, %r12d
movq (%rbx,%r12,8), %rcx
movl $0x4, %esi
movl $0x1, %edx
leaq 0x14(%rsp), %rdi
callq 0x3450
movq 0x8(%rsp), %rax
movzwl (%rax,%r15,8), %eax
movw %ax, 0x6(%rsp)
movq (%r14,%r12,8), %rcx
movl $0x2, %esi
movl $0x1, %edx
movq %r13, %rdi
callq 0x3450
movq 0x8(%rsp), %rcx
incl %ebp
incq %r15
movl 0x4af12(%rip), %eax     # 0x5e628
cmpq %rax, %r15
jb 0x1369e
jmp 0x1371f
xorl %ebp, %ebp
cmpl $0x0, 0x4af0a(%rip)     # 0x5e630
jle 0x1374c
xorl %r15d, %r15d
movq (%rbx,%r15,8), %rdi
callq 0x3100
movq (%r14,%r15,8), %rdi
callq 0x3100
incq %r15
movslq 0x4aee9(%rip), %rax     # 0x5e630
cmpq %rax, %r15
jl 0x1372b
movq %rbx, %rdi
callq 0x3040
movq %r14, %rdi
callq 0x3040
movl %ebp, %eax
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x3060
movl (%rax), %edi
leaq 0x4b23(%rip), %rsi      # 0x182a1
xorl %eax, %eax
callq 0x3330