// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/annotationsketch/layout.c
// Function: layout_tracks
static int layout_tracks(void *key, void *value, void *data,
                         GtError *err)
{
  GtUword i,
                max = 50;
  GtTrack *track = NULL;
  GtLayoutTraverseInfo *lti = (GtLayoutTraverseInfo*) data;
  GtArray *list = (GtArray*) value;
  GtStr *gt_track_key;
  GtBlock *block;
  int had_err = 0;
  bool split = true;
  double tmp = 50;
  gt_assert(list);

  /* to get a deterministic layout, we sort the GtBlocks for each type */
  if (lti->layout->block_ordering_func) {
    gt_array_sort_stable_with_data(list, blocklist_block_compare,
                                   lti->layout);
  }

  /* XXX: get first block for track property lookups, this should be reworked
     to allow arbitrary track keys! */
  block = *(GtBlock**) gt_array_get(list, 0);
  gt_track_key = gt_str_new_cstr((char*) key);

  /* obtain default settings*/
  if (gt_style_get_bool(lti->layout->style, "format", "split_lines", &split,
                         NULL, err) == GT_STYLE_QUERY_ERROR) {
    had_err = 1;
  }
  if (!had_err) {
    if (gt_style_get_num(lti->layout->style,
                         "format", "max_num_lines",
                         &tmp, NULL, err) == GT_STYLE_QUERY_ERROR) {
      had_err = 1;
    }
  }
  /* obtain track-specific settings, should be changed to query arbitrary
     track keys! */
  if (!had_err) {
    if (gt_style_get_bool(lti->layout->style, gt_block_get_type(block),
                          "split_lines",  &split, NULL,
                          err) == GT_STYLE_QUERY_ERROR) {
      had_err = 1;
    }
  }
  if (!had_err) {
    if (gt_style_get_num(lti->layout->style, gt_block_get_type(block),
                         "max_num_lines", &tmp, NULL,
                         err) == GT_STYLE_QUERY_ERROR) {
      had_err = 1;
    }
  }

  if (!had_err) {
    max = (GtUword) tmp;
    track = gt_track_new(gt_track_key, max, split,
                         gt_line_breaker_captions_new(lti->layout,
                                                      lti->layout->width,
                                                      lti->layout->style));
    lti->layout->nof_tracks++;
    for (i = 0; !had_err && i < gt_array_size(list); i++) {
      block = *(GtBlock**) gt_array_get(list, i);
      had_err = gt_track_insert_block(track, block, err);
    }
  }
  if (!had_err) {
    gt_hashmap_add(lti->layout->tracks, gt_cstr_dup(gt_str_get(gt_track_key)),
                   track);
  }
  else
  {
    gt_track_delete(track);
  }

  gt_str_delete(gt_track_key);
  return had_err;
}

// Assembly:
subq $0xa8, %rsp
movq %rdi, 0xa0(%rsp)
movq %rsi, 0x98(%rsp)
movq %rdx, 0x90(%rsp)
movq %rcx, 0x88(%rsp)
movq $0x32, 0x78(%rsp)
movq $0x0, 0x70(%rsp)
movq 0x90(%rsp), %rax
movq %rax, 0x68(%rsp)
movq 0x98(%rsp), %rax
movq %rax, 0x60(%rsp)
movl $0x0, 0x4c(%rsp)
movb $0x1, 0x4b(%rsp)
movsd 0x1221c8(%rip), %xmm0   # 0x168b30
movsd %xmm0, 0x40(%rsp)
cmpq $0x0, 0x60(%rsp)
jne 0x469ae
movq 0x16d65b(%rip), %rax    # 0x1b3fd8
movq (%rax), %rdi
leaq 0x1176df(%rip), %rsi    # 0x15e066
leaq 0x120545(%rip), %rdx    # 0x166ed3
leaq 0x12240a(%rip), %rcx    # 0x168d9f
leaq 0x1221cf(%rip), %r8     # 0x168b6b
movl $0x6f, %r9d
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x469b0
movq 0x68(%rsp), %rax
movq 0x8(%rax), %rax
cmpq $0x0, 0x60(%rax)
je 0x469da
movq 0x60(%rsp), %rdi
movq 0x68(%rsp), %rax
movq 0x8(%rax), %rdx
leaq 0x31b(%rip), %rsi       # 0x46cf0
callq 0x767d0
movq 0x60(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x75c80
movq (%rax), %rax
movq %rax, 0x50(%rsp)
movq 0xa0(%rsp), %rdi
callq 0x18f70
movq %rax, 0x58(%rsp)
movq 0x68(%rsp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rdi
movq 0x88(%rsp), %r9
leaq 0x117779(%rip), %rsi    # 0x15e196
leaq 0x122389(%rip), %rdx    # 0x168dad
leaq 0x4b(%rsp), %rcx
xorl %eax, %eax
movl %eax, %r8d
callq 0x4a140
cmpl $0x2, %eax
jne 0x46a40
movl $0x1, 0x4c(%rsp)
cmpl $0x0, 0x4c(%rsp)
jne 0x46a87
movq 0x68(%rsp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rdi
movq 0x88(%rsp), %r9
leaq 0x117734(%rip), %rsi    # 0x15e196
leaq 0x122350(%rip), %rdx    # 0x168db9
leaq 0x40(%rsp), %rcx
xorl %eax, %eax
movl %eax, %r8d
callq 0x49af0
cmpl $0x2, %eax
jne 0x46a85
movl $0x1, 0x4c(%rsp)
jmp 0x46a87
cmpl $0x0, 0x4c(%rsp)
jne 0x46ade
movq 0x68(%rsp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rax
movq %rax, 0x38(%rsp)
movq 0x50(%rsp), %rdi
callq 0xb10f0
movq 0x38(%rsp), %rdi
movq %rax, %rsi
movq 0x88(%rsp), %r9
leaq 0x1222ed(%rip), %rdx    # 0x168dad
leaq 0x4b(%rsp), %rcx
xorl %eax, %eax
movl %eax, %r8d
callq 0x4a140
cmpl $0x2, %eax
jne 0x46adc
movl $0x1, 0x4c(%rsp)
jmp 0x46ade
cmpl $0x0, 0x4c(%rsp)
jne 0x46b35
movq 0x68(%rsp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rax
movq %rax, 0x30(%rsp)
movq 0x50(%rsp), %rdi
callq 0xb10f0
movq 0x30(%rsp), %rdi
movq %rax, %rsi
movq 0x88(%rsp), %r9
leaq 0x1222a2(%rip), %rdx    # 0x168db9
leaq 0x40(%rsp), %rcx
xorl %eax, %eax
movl %eax, %r8d
callq 0x49af0
cmpl $0x2, %eax
jne 0x46b33
movl $0x1, 0x4c(%rsp)
jmp 0x46b35
cmpl $0x0, 0x4c(%rsp)
jne 0x46c86
movsd 0x40(%rsp), %xmm0
movsd 0x120dda(%rip), %xmm2   # 0x167928
movaps %xmm0, %xmm1
subsd %xmm2, %xmm1
cvttsd2si %xmm1, %rcx
cvttsd2si %xmm0, %rax
movq %rax, %rdx
sarq $0x3f, %rdx
andq %rdx, %rcx
orq %rcx, %rax
movq %rax, 0x78(%rsp)
movq 0x58(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x78(%rsp), %rax
movq %rax, 0x20(%rsp)
movb 0x4b(%rsp), %al
movb %al, 0x2f(%rsp)
movq 0x68(%rsp), %rax
movq 0x8(%rax), %rdi
movq 0x68(%rsp), %rax
movq 0x8(%rax), %rax
movl 0x48(%rax), %eax
movl %eax, %esi
movq 0x68(%rsp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rdx
callq 0x472c0
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rsi
movq %rax, %rcx
movb 0x2f(%rsp), %al
andb $0x1, %al
movzbl %al, %edx
callq 0x4c970
movq %rax, 0x70(%rsp)
movq 0x68(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x40(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x40(%rax)
movq $0x0, 0x80(%rsp)
xorl %eax, %eax
cmpl $0x0, 0x4c(%rsp)
movb %al, 0x17(%rsp)
jne 0x46c2c
movq 0x80(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x60(%rsp), %rdi
callq 0x76490
movq %rax, %rcx
movq 0x8(%rsp), %rax
cmpq %rcx, %rax
setb %al
movb %al, 0x17(%rsp)
movb 0x17(%rsp), %al
testb $0x1, %al
jne 0x46c36
jmp 0x46c84
movq 0x60(%rsp), %rdi
movq 0x80(%rsp), %rsi
callq 0x75c80
movq (%rax), %rax
movq %rax, 0x50(%rsp)
movq 0x70(%rsp), %rdi
movq 0x50(%rsp), %rsi
movq 0x88(%rsp), %rdx
callq 0x4cbb0
movl %eax, 0x4c(%rsp)
movq 0x80(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x80(%rsp)
jmp 0x46bf6
jmp 0x46c86
cmpl $0x0, 0x4c(%rsp)
jne 0x46cc3
movq 0x68(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x20(%rax), %rax
movq %rax, (%rsp)
movq 0x58(%rsp), %rdi
callq 0x19940
movq %rax, %rdi
callq 0x7c400
movq (%rsp), %rdi
movq %rax, %rsi
movq 0x70(%rsp), %rdx
callq 0x86510
jmp 0x46ccd
movq 0x70(%rsp), %rdi
callq 0x4eb10
movq 0x58(%rsp), %rdi
callq 0x1afc0
movl 0x4c(%rsp), %eax
addq $0xa8, %rsp
retq
nopw %cs:(%rax,%rax)