// File: /workspace/github_c_makefile_star2_O0/yhg926[P]public_kssd/iseq2comem.c
// Function: wrt_co2cmpn_use_inn_subctx
llong wrt_co2cmpn_use_inn_subctx(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,"wrt_co2cmpn_use_inn_subctx()") ;
  };
  unsigned int count, wr = 0, newid;
 for(count=0;count < hashsize; count++)
 {
  if( co[count] != 0 && co[count] < HIBITSET1 )
  {
   newid = (unsigned int)( co[count] >> comp_code_bits ) ;
   fwrite( &newid, sizeof(unsigned int),1,outf[(int)( co[count] % 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 $0x140, %rsp            # imm = 0x140
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl 0x4a233(%rip), %eax     # 0x6460c
subl 0x4a239(%rip), %eax     # 0x64618
cmpl $0x7, %eax
jle 0x1a3fe
movl 0x4a222(%rip), %eax     # 0x6460c
subl 0x4a228(%rip), %eax     # 0x64618
subl $0x7, %eax
shll $0x2, %eax
movl %eax, -0x138(%rbp)
jmp 0x1a408
xorl %eax, %eax
movl %eax, -0x138(%rbp)
jmp 0x1a408
movl -0x138(%rbp), %eax
movl %eax, -0x14(%rbp)
movslq 0x4a20c(%rip), %rdi     # 0x64624
shlq $0x3, %rdi
callq 0x3310
movq %rax, -0x20(%rbp)
movl $0x0, -0x124(%rbp)
movl -0x124(%rbp), %eax
cmpl 0x4a1e9(%rip), %eax     # 0x64624
jge 0x1a4ac
leaq -0x120(%rbp), %rdi
movq -0x8(%rbp), %rdx
movl -0x124(%rbp), %ecx
leaq 0x1bfc(%rip), %rsi      # 0x1c051
movb $0x0, %al
callq 0x3400
leaq -0x120(%rbp), %rdi
leaq 0x1bf0(%rip), %rsi      # 0x1c05a
callq 0x3370
movq -0x20(%rbp), %rcx
movslq -0x124(%rbp), %rdx
movq %rax, (%rcx,%rdx,8)
cmpq $0x0, %rax
jne 0x1a499
callq 0x3050
movl (%rax), %edi
leaq 0x4d0a(%rip), %rsi      # 0x1f19c
movb $0x0, %al
callq 0x3300
jmp 0x1a49b
movl -0x124(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x124(%rbp)
jmp 0x1a42f
movl $0x0, -0x12c(%rbp)
movl $0x0, -0x128(%rbp)
movl -0x128(%rbp), %eax
cmpl 0x4a150(%rip), %eax     # 0x6461c
jae 0x1a58b
movq -0x10(%rbp), %rax
movl -0x128(%rbp), %ecx
cmpq $0x0, (%rax,%rcx,8)
je 0x1a575
movq -0x10(%rbp), %rax
movl -0x128(%rbp), %ecx
movabsq $-0x8000000000000000, %rdx # imm = 0x8000000000000000
cmpq %rdx, (%rax,%rcx,8)
jae 0x1a575
movq -0x10(%rbp), %rax
movl -0x128(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl -0x14(%rbp), %ecx
shrq %cl, %rax
movl %eax, -0x130(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x140(%rbp)
movq -0x10(%rbp), %rax
movl -0x128(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movslq 0x4a0e9(%rip), %rcx     # 0x64624
xorl %edx, %edx
divq %rcx
movq -0x140(%rbp), %rax
movl %edx, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rcx
leaq -0x130(%rbp), %rdi
movl $0x4, %esi
movl $0x1, %edx
callq 0x3420
movl -0x12c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x12c(%rbp)
jmp 0x1a577
movl -0x128(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x128(%rbp)
jmp 0x1a4c0
movl $0x0, -0x134(%rbp)
movl -0x134(%rbp), %eax
cmpl 0x4a083(%rip), %eax     # 0x64624
jge 0x1a5c8
movq -0x20(%rbp), %rax
movslq -0x134(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x30e0
movl -0x134(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x134(%rbp)
jmp 0x1a595
movq -0x20(%rbp), %rdi
callq 0x3040
movl -0x12c(%rbp), %eax
addq $0x140, %rsp            # imm = 0x140
popq %rbp
retq