// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x150, %rsp            # imm = 0x150
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl 0x4a963(%rip), %eax     # 0x6460c
subl 0x4a969(%rip), %eax     # 0x64618
cmpl $0x7, %eax
jle 0x19cce
movl 0x4a952(%rip), %eax     # 0x6460c
subl 0x4a958(%rip), %eax     # 0x64618
subl $0x7, %eax
shll $0x2, %eax
movl %eax, -0x150(%rbp)
jmp 0x19cd8
xorl %eax, %eax
movl %eax, -0x150(%rbp)
jmp 0x19cd8
movl -0x150(%rbp), %eax
movl %eax, -0x14(%rbp)
movslq 0x4a93c(%rip), %rdi     # 0x64624
shlq $0x3, %rdi
callq 0x3310
movq %rax, -0x20(%rbp)
movslq 0x4a928(%rip), %rdi     # 0x64624
shlq $0x3, %rdi
callq 0x3310
movq %rax, -0x28(%rbp)
movl $0x0, -0x134(%rbp)
movl -0x134(%rbp), %eax
cmpl 0x4a905(%rip), %eax     # 0x64624
jge 0x19df3
leaq -0x130(%rbp), %rdi
movq -0x8(%rbp), %rdx
movl -0x134(%rbp), %ecx
leaq 0x2314(%rip), %rsi      # 0x1c051
movb $0x0, %al
callq 0x3400
leaq -0x130(%rbp), %rdi
leaq 0x2308(%rip), %rsi      # 0x1c05a
callq 0x3370
movq -0x20(%rbp), %rcx
movslq -0x134(%rbp), %rdx
movq %rax, (%rcx,%rdx,8)
cmpq $0x0, %rax
jne 0x19d81
callq 0x3050
movl (%rax), %edi
leaq 0x53e9(%rip), %rsi      # 0x1f163
movb $0x0, %al
callq 0x3300
leaq -0x130(%rbp), %rdi
movq -0x8(%rbp), %rdx
movl -0x134(%rbp), %ecx
leaq 0x26e0(%rip), %rsi      # 0x1c479
movb $0x0, %al
callq 0x3400
leaq -0x130(%rbp), %rdi
leaq 0x22ac(%rip), %rsi      # 0x1c05a
callq 0x3370
movq -0x28(%rbp), %rcx
movslq -0x134(%rbp), %rdx
movq %rax, (%rcx,%rdx,8)
cmpq $0x0, %rax
jne 0x19ddd
callq 0x3050
movl (%rax), %edi
leaq 0x538d(%rip), %rsi      # 0x1f163
movb $0x0, %al
callq 0x3300
jmp 0x19ddf
movl -0x134(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x134(%rbp)
jmp 0x19d13
movl $0x0, -0x13c(%rbp)
movl $0x0, -0x138(%rbp)
movl -0x138(%rbp), %eax
cmpl 0x4a809(%rip), %eax     # 0x6461c
jae 0x19efb
movq -0x10(%rbp), %rax
movl -0x138(%rbp), %ecx
cmpq $0x0, (%rax,%rcx,8)
jbe 0x19ee5
movq -0x10(%rbp), %rax
movl -0x138(%rbp), %ecx
movq (%rax,%rcx,8), %rax
shrq $0x10, %rax
movslq 0x4a7dd(%rip), %rcx     # 0x64624
xorl %edx, %edx
divq %rcx
movl %edx, %eax
movl %eax, -0x144(%rbp)
movq -0x10(%rbp), %rax
movl -0x138(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl -0x14(%rbp), %ecx
addl $0x10, %ecx
movl %ecx, %ecx
shrq %cl, %rax
movl %eax, -0x140(%rbp)
movq -0x20(%rbp), %rax
movl -0x144(%rbp), %ecx
movq (%rax,%rcx,8), %rcx
leaq -0x140(%rbp), %rdi
movl $0x4, %esi
movl $0x1, %edx
callq 0x3420
movq -0x10(%rbp), %rax
movl -0x138(%rbp), %ecx
movq (%rax,%rcx,8), %rax
andq $0xffff, %rax           # imm = 0xFFFF
movw %ax, -0x146(%rbp)
movq -0x28(%rbp), %rax
movl -0x144(%rbp), %ecx
movq (%rax,%rcx,8), %rcx
leaq -0x146(%rbp), %rdi
movl $0x2, %esi
movl $0x1, %edx
callq 0x3420
movl -0x13c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x13c(%rbp)
jmp 0x19ee7
movl -0x138(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x138(%rbp)
jmp 0x19e07
movl $0x0, -0x14c(%rbp)
movl -0x14c(%rbp), %eax
cmpl 0x4a713(%rip), %eax     # 0x64624
jge 0x19f4c
movq -0x20(%rbp), %rax
movslq -0x14c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x30e0
movq -0x28(%rbp), %rax
movslq -0x14c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x30e0
movl -0x14c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14c(%rbp)
jmp 0x19f05
movq -0x20(%rbp), %rdi
callq 0x3040
movq -0x28(%rbp), %rdi
callq 0x3040
movl -0x13c(%rbp), %eax
addq $0x150, %rsp            # imm = 0x150
popq %rbp
retq
nopl (%rax)