// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/match/shu_unitfile.c
// Function: traverse_units
static int traverse_units(lua_State *L,
                          GtShuUnitFileInfo *unit_info,
                          GtError *err)
{
  int had_err = 0;
  GtUword genome_idx = 0,
                files_added = 0;
  bool *file_set;
  GtStr *mapping_filename = gt_str_new();

  gt_assert(unit_info->file_names);

  file_set = gt_calloc((size_t) unit_info->num_of_files,
                       sizeof (file_set));

  unit_info->map_files = gt_calloc((size_t) unit_info->num_of_files,
                                   sizeof (unit_info->map_files));

  gt_str_array_reset(unit_info->genome_names);

  lua_pushnil(L); /*the first outer key*/
  while (lua_next(L, -2) != 0 && !had_err) {
    had_err = shu_unitfile_traverse_inner_keys(L, unit_info, file_set,
                                               mapping_filename,
                                               genome_idx, &files_added, err);
    lua_pop(L, 1);
    genome_idx++;
  }
  lua_pop(L, 1);

  gt_free(file_set);

  if (!had_err) {
    unit_info->num_of_genomes = genome_idx;
    gt_assert(unit_info->num_of_genomes ==
        gt_str_array_size(unit_info->genome_names));
  }
  if (!had_err && files_added != unit_info->num_of_files) {
    had_err = -1;
    gt_error_set(err, "number of files in index (" GT_WU ") and unitfile ("
                 GT_WU ")! differ!", unit_info->num_of_files, files_added);
  }
  if (!had_err) {
    GtUword file_idx;
    for (file_idx = 0; file_idx < unit_info->num_of_files; file_idx++) {
      gt_log_log("file: " GT_WU " belongs to genome: %s",
                 file_idx,
                 gt_str_array_get(unit_info->genome_names,
                                  unit_info->map_files[file_idx]));
    }
  }
  gt_str_delete(mapping_filename);
  return had_err;
}

// Assembly:
subq $0x68, %rsp
movq %rdi, 0x60(%rsp)
movq %rsi, 0x58(%rsp)
movq %rdx, 0x50(%rsp)
movl $0x0, 0x4c(%rsp)
movq $0x0, 0x40(%rsp)
movq $0x0, 0x38(%rsp)
callq 0x11d4a0
movq %rax, 0x28(%rsp)
movq 0x58(%rsp), %rax
cmpq $0x0, 0x18(%rax)
jne 0x2edf3b
movq 0x34e096(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x2280ff(%rip), %rsi    # 0x516013
leaq 0x2a0d3a(%rip), %rdx    # 0x58ec55
leaq 0x2a0d49(%rip), %rcx    # 0x58ec6b
leaq 0x2a0cd1(%rip), %r8     # 0x58ebfa
movl $0x88, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2edf3d
movq 0x58(%rsp), %rax
movq 0x8(%rax), %rdi
movl $0x8, %esi
leaq 0x2a0ca8(%rip), %rdx    # 0x58ebfa
movl $0x8b, %ecx
callq 0xe83c0
movq %rax, 0x30(%rsp)
movq 0x58(%rsp), %rax
movq 0x8(%rax), %rdi
movl $0x8, %esi
leaq 0x2a0c84(%rip), %rdx    # 0x58ebfa
movl $0x8e, %ecx
callq 0xe83c0
movq %rax, %rcx
movq 0x58(%rsp), %rax
movq %rcx, 0x20(%rax)
movq 0x58(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x11fc60
movq 0x60(%rsp), %rdi
callq 0x335470
movq 0x60(%rsp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x338000
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, 0x1f(%rsp)
je 0x2edfce
cmpl $0x0, 0x4c(%rsp)
setne %al
xorb $-0x1, %al
movb %al, 0x1f(%rsp)
movb 0x1f(%rsp), %al
testb $0x1, %al
jne 0x2edfd8
jmp 0x2ee02a
movq 0x60(%rsp), %rdi
movq 0x58(%rsp), %rsi
movq 0x30(%rsp), %rdx
movq 0x28(%rsp), %rcx
movq 0x40(%rsp), %r8
movq 0x50(%rsp), %rax
leaq 0x38(%rsp), %r9
movq %rax, (%rsp)
callq 0x2ee310
movl %eax, 0x4c(%rsp)
movq 0x60(%rsp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x333ed0
movq 0x40(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x40(%rsp)
jmp 0x2edfa4
movq 0x60(%rsp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x333ed0
movq 0x30(%rsp), %rdi
leaq 0x2a0bb5(%rip), %rsi    # 0x58ebfa
movl $0x9c, %edx
callq 0xe88c0
cmpl $0x0, 0x4c(%rsp)
jne 0x2ee0c7
movq 0x40(%rsp), %rcx
movq 0x58(%rsp), %rax
movq %rcx, (%rax)
movq 0x58(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x10(%rsp)
movq 0x58(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x11fcc0
movq %rax, %rcx
movq 0x10(%rsp), %rax
cmpq %rcx, %rax
je 0x2ee0c3
movq 0x34df0e(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x227f77(%rip), %rsi    # 0x516013
leaq 0x2a0bd7(%rip), %rdx    # 0x58ec7a
leaq 0x2a0bc1(%rip), %rcx    # 0x58ec6b
leaq 0x2a0b49(%rip), %r8     # 0x58ebfa
movl $0xa1, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x2ee0c5
jmp 0x2ee0c7
cmpl $0x0, 0x4c(%rsp)
jne 0x2ee107
movq 0x38(%rsp), %rax
movq 0x58(%rsp), %rcx
cmpq 0x8(%rcx), %rax
je 0x2ee107
movl $0xffffffff, 0x4c(%rsp) # imm = 0xFFFFFFFF
movq 0x50(%rsp), %rdi
movq 0x58(%rsp), %rax
movq 0x8(%rax), %rdx
movq 0x38(%rsp), %rcx
leaq 0x2a0bc2(%rip), %rsi    # 0x58ecc2
movb $0x0, %al
callq 0xd88c0
cmpl $0x0, 0x4c(%rsp)
jne 0x2ee179
movq $0x0, 0x20(%rsp)
movq 0x20(%rsp), %rax
movq 0x58(%rsp), %rcx
cmpq 0x8(%rcx), %rax
jae 0x2ee177
movq 0x20(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x58(%rsp), %rax
movq 0x10(%rax), %rdi
movq 0x58(%rsp), %rax
movq 0x20(%rax), %rax
movq 0x20(%rsp), %rcx
movq (%rax,%rcx,8), %rsi
callq 0x11f8c0
movq 0x8(%rsp), %rsi
movq %rax, %rdx
leaq 0x2a0b9d(%rip), %rdi    # 0x58ecfd
movb $0x0, %al
callq 0xe7740
movq 0x20(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x20(%rsp)
jmp 0x2ee117
jmp 0x2ee179
movq 0x28(%rsp), %rdi
callq 0x11f560
movl 0x4c(%rsp), %eax
addq $0x68, %rsp
retq
nopl (%rax)