// File: /workspace/github_c_makefile_star2_O0/yhg926[P]public_kssd/iseq2comem.c
// Function: write_fqkoc2file
llong write_fqkoc2file(char* cofilename, llong *co)
{
  int comp_code_bits = half_ctx_len - drlevel > COMPONENT_SZ ? 4*(half_ctx_len - drlevel - COMPONENT_SZ ) : 0 ;
  FILE **outf;
  outf = 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_fqkoc2file()") ;
  };
  unsigned int count, wr = 0;
 llong newid;
  for(count=0;count < hashsize; count++)
  {
    if( co[count] > 0 ) {
   newid = ((co[count] >> (comp_code_bits + OCCRC_BIT)) << OCCRC_BIT ) | (co[count] & OCCRC_MAX) ;
      fwrite( &newid, sizeof(llong),1,outf[ (co[count] >> OCCRC_BIT ) % component_num ] );
      wr++;
    }
  }
  for(int i=0;i<component_num ;i++)
    fclose(outf[i]);
 free(outf);
  return wr;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x150, %rsp            # imm = 0x150
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl 0x4a683(%rip), %eax     # 0x6460c
subl 0x4a689(%rip), %eax     # 0x64618
cmpl $0x7, %eax
jle 0x19fae
movl 0x4a672(%rip), %eax     # 0x6460c
subl 0x4a678(%rip), %eax     # 0x64618
subl $0x7, %eax
shll $0x2, %eax
movl %eax, -0x140(%rbp)
jmp 0x19fb8
xorl %eax, %eax
movl %eax, -0x140(%rbp)
jmp 0x19fb8
movl -0x140(%rbp), %eax
movl %eax, -0x14(%rbp)
movslq 0x4a65c(%rip), %rdi     # 0x64624
shlq $0x3, %rdi
callq 0x3310
movq %rax, -0x20(%rbp)
movl $0x0, -0x124(%rbp)
movl -0x124(%rbp), %eax
cmpl 0x4a639(%rip), %eax     # 0x64624
jge 0x1a05c
leaq -0x120(%rbp), %rdi
movq -0x8(%rbp), %rdx
movl -0x124(%rbp), %ecx
leaq 0x204c(%rip), %rsi      # 0x1c051
movb $0x0, %al
callq 0x3400
leaq -0x120(%rbp), %rdi
leaq 0x2040(%rip), %rsi      # 0x1c05a
callq 0x3370
movq -0x20(%rbp), %rcx
movslq -0x124(%rbp), %rdx
movq %rax, (%rcx,%rdx,8)
cmpq $0x0, %rax
jne 0x1a049
callq 0x3050
movl (%rax), %edi
leaq 0x5135(%rip), %rsi      # 0x1f177
movb $0x0, %al
callq 0x3300
jmp 0x1a04b
movl -0x124(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x124(%rbp)
jmp 0x19fdf
movl $0x0, -0x12c(%rbp)
movl $0x0, -0x128(%rbp)
movl -0x128(%rbp), %eax
cmpl 0x4a5a0(%rip), %eax     # 0x6461c
jae 0x1a142
movq -0x10(%rbp), %rax
movl -0x128(%rbp), %ecx
cmpq $0x0, (%rax,%rcx,8)
jbe 0x1a12c
movq -0x10(%rbp), %rax
movl -0x128(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl -0x14(%rbp), %ecx
addl $0x10, %ecx
movl %ecx, %ecx
shrq %cl, %rax
shlq $0x10, %rax
movq -0x10(%rbp), %rcx
movl -0x128(%rbp), %edx
movq (%rcx,%rdx,8), %rcx
andq $0xffff, %rcx           # imm = 0xFFFF
orq %rcx, %rax
movq %rax, -0x138(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x148(%rbp)
movq -0x10(%rbp), %rax
movl -0x128(%rbp), %ecx
movq (%rax,%rcx,8), %rax
shrq $0x10, %rax
movslq 0x4a52d(%rip), %rcx     # 0x64624
xorl %edx, %edx
divq %rcx
movq -0x148(%rbp), %rax
movq (%rax,%rdx,8), %rcx
leaq -0x138(%rbp), %rdi
movl $0x8, %esi
movl $0x1, %edx
callq 0x3420
movl -0x12c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x12c(%rbp)
jmp 0x1a12e
movl -0x128(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x128(%rbp)
jmp 0x1a070
movl $0x0, -0x13c(%rbp)
movl -0x13c(%rbp), %eax
cmpl 0x4a4cc(%rip), %eax     # 0x64624
jge 0x1a17f
movq -0x20(%rbp), %rax
movslq -0x13c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x30e0
movl -0x13c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x13c(%rbp)
jmp 0x1a14c
movq -0x20(%rbp), %rdi
callq 0x3040
movl -0x12c(%rbp), %eax
addq $0x150, %rsp            # imm = 0x150
popq %rbp
retq
nopw (%rax,%rax)