// File: /workspace/github_c_makefile_star2_O0/richarddurbin[P]hash10x/moshasm.c
// Function: readsetWrite
void readsetWrite (Readset *rs, char *root)
{
  FILE *f ;
  if (!(f = fopenTag (root, "mosh", "w"))) die ("can't open file %s.mosh", root) ;
  moshsetWrite (rs->ms, f) ; fclose (f) ;
  if (!(f = fopenTag (root, "readset", "w"))) die ("can't open file %s.readset", root) ;
  if (fwrite("RSMSHv2",8,1,f) != 1) die ("failed to write readset header") ;
  if (fwrite (&rs->totHit,sizeof(U64),1,f) != 1) die ("failed to write totHit") ;
  arrayWrite (rs->reads, f) ;
  int i, n ; Read *r = arrp(rs->reads,0,Read) ;
  for (i = 0 ; i < arrayMax(rs->reads) ; ++i, ++r)
    if ((n = r->nHit))
      { if (fwrite(r->hit,sizeof(U32),n,f) != n) die ("failed write hits %d", n) ;
	if (fwrite(r->dx,sizeof(U16),n,f) != n) die ("failed write dx %d", n) ;
      }
  fclose (f) ;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
leaq 0x9b88(%rip), %rsi      # 0xb043
leaq 0xa51d(%rip), %rdx      # 0xb9df
callq 0xa470
movq %rax, -0x18(%rbp)
cmpq $0x0, %rax
jne 0x14e3
movq -0x10(%rbp), %rsi
leaq 0x9b54(%rip), %rdi      # 0xb030
movb $0x0, %al
callq 0xa100
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0x75b0
movq -0x18(%rbp), %rdi
callq 0x1090
movq -0x10(%rbp), %rdi
leaq 0x9b54(%rip), %rsi      # 0xb05b
leaq 0xa4d1(%rip), %rdx      # 0xb9df
callq 0xa470
movq %rax, -0x18(%rbp)
cmpq $0x0, %rax
jne 0x152f
movq -0x10(%rbp), %rsi
leaq 0x9b20(%rip), %rdi      # 0xb048
movb $0x0, %al
callq 0xa100
movq -0x18(%rbp), %rcx
leaq 0x9bbe(%rip), %rdi      # 0xb0f8
movl $0x8, %esi
movl $0x1, %edx
callq 0x1220
cmpq $0x1, %rax
je 0x155d
leaq 0x9b0d(%rip), %rdi      # 0xb063
movb $0x0, %al
callq 0xa100
movq -0x8(%rbp), %rdi
addq $0x10, %rdi
movq -0x18(%rbp), %rcx
movl $0x8, %esi
movl $0x1, %edx
callq 0x1220
cmpq $0x1, %rax
je 0x158c
leaq 0x9afd(%rip), %rdi      # 0xb082
movb $0x0, %al
callq 0xa100
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0x97e0
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x8(%rcx), %rcx
imull $0x0, 0x14(%rcx), %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movq -0x8(%rbp), %rcx
movq 0x8(%rcx), %rcx
cmpl 0x18(%rcx), %eax
jge 0x166f
movq -0x28(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x20(%rbp)
cmpl $0x0, %eax
je 0x1653
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rdi
movslq -0x20(%rbp), %rdx
movq -0x18(%rbp), %rcx
movl $0x4, %esi
callq 0x1220
movslq -0x20(%rbp), %rcx
cmpq %rcx, %rax
je 0x161d
movl -0x20(%rbp), %esi
leaq 0x9a83(%rip), %rdi      # 0xb099
movb $0x0, %al
callq 0xa100
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rdi
movslq -0x20(%rbp), %rdx
movq -0x18(%rbp), %rcx
movl $0x2, %esi
callq 0x1220
movslq -0x20(%rbp), %rcx
cmpq %rcx, %rax
je 0x1651
movl -0x20(%rbp), %esi
leaq 0x9a64(%rip), %rdi      # 0xb0ae
movb $0x0, %al
callq 0xa100
jmp 0x1653
jmp 0x1655
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
movq -0x28(%rbp), %rax
addq $0x48, %rax
movq %rax, -0x28(%rbp)
jmp 0x15c6
movq -0x18(%rbp), %rdi
callq 0x1090
addq $0x30, %rsp
popq %rbp
retq
nop