// File: /workspace/github_c_makefile_star2_O1/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movb $0x1, 0xf(%rsp)
movabsq $0x4049000000000000, %rax # imm = 0x4049000000000000
movq %rax, 0x20(%rsp)
testq %rsi, %rsi
je 0x52f2e
movq %rcx, %r15
movq %rdx, %rbx
movq %rsi, %r12
movq %rdi, %r13
movq 0x8(%rdx), %rdx
cmpq $0x0, 0x60(%rdx)
je 0x52d4d
leaq 0x1ee(%rip), %rsi       # 0x52f33
movq %r12, %rdi
callq 0x6ed9c
xorl %ebp, %ebp
movq %r12, %rdi
xorl %esi, %esi
callq 0x6e9fa
movq (%rax), %r14
movq %r13, %rdi
callq 0x3c03d
movq %rax, 0x18(%rsp)
movq 0x8(%rbx), %rax
movq (%rax), %rdi
leaq 0x8e41f(%rip), %rsi     # 0xe1196
leaq 0x98e37(%rip), %rdx     # 0xebbb5
leaq 0xf(%rsp), %rcx
xorl %r8d, %r8d
movq %r15, %r9
callq 0x5488a
movl $0x1, %r13d
cmpl $0x2, %eax
je 0x52ed5
movq 0x8(%rbx), %rax
movq (%rax), %rdi
leaq 0x8e3eb(%rip), %rsi     # 0xe1196
leaq 0x98e0f(%rip), %rdx     # 0xebbc1
xorl %ebp, %ebp
leaq 0x20(%rsp), %rcx
xorl %r8d, %r8d
movq %r15, %r9
callq 0x545d2
cmpl $0x2, %eax
je 0x52ed5
movq 0x8(%rbx), %rax
movq (%rax), %rax
movq %rax, 0x10(%rsp)
movq %r14, %rdi
callq 0x8b101
leaq 0x98dcd(%rip), %rdx     # 0xebbb5
xorl %ebp, %ebp
leaq 0xf(%rsp), %rcx
movq 0x10(%rsp), %rdi
movq %rax, %rsi
xorl %r8d, %r8d
movq %r15, %r9
callq 0x5488a
cmpl $0x2, %eax
je 0x52ed5
movq 0x8(%rbx), %rax
movq (%rax), %rax
movq %rax, 0x10(%rsp)
movq %r14, %rdi
callq 0x8b101
leaq 0x98d9b(%rip), %rdx     # 0xebbc1
xorl %ebp, %ebp
leaq 0x20(%rsp), %rcx
movq 0x10(%rsp), %rdi
movq %rax, %rsi
xorl %r8d, %r8d
movq %r15, %r9
callq 0x545d2
cmpl $0x2, %eax
je 0x52ed5
movsd 0x20(%rsp), %xmm0
cvttsd2si %xmm0, %rax
movq %rax, %rcx
sarq $0x3f, %rcx
subsd 0x9794d(%rip), %xmm0    # 0xea7b0
cvttsd2si %xmm0, %r14
andq %rcx, %r14
orq %rax, %r14
movzbl 0xf(%rsp), %ebp
movq 0x8(%rbx), %rdi
movl 0x48(%rdi), %esi
movq (%rdi), %rdx
callq 0x53264
movq 0x18(%rsp), %rdi
movq %r14, %rsi
movl %ebp, %edx
movq %rax, %rcx
callq 0x56154
movq 0x8(%rbx), %rcx
incq 0x40(%rcx)
movq %rax, %rbp
xorl %r13d, %r13d
xorl %r14d, %r14d
movq %r12, %rdi
callq 0x6ecda
cmpq %rax, %r14
jae 0x52ed5
movq %r12, %rdi
movq %r14, %rsi
callq 0x6e9fa
movq (%rax), %rsi
movq %rbp, %rdi
movq %r15, %rdx
callq 0x5620d
incq %r14
testl %eax, %eax
je 0x52ea5
movl %eax, %r13d
testl %r13d, %r13d
je 0x52ee9
movq %rbp, %rdi
callq 0x575bd
movq 0x18(%rsp), %r14
jmp 0x52f14
movq 0x8(%rbx), %rax
movq 0x20(%rax), %rbx
movq 0x18(%rsp), %r14
movq %r14, %rdi
callq 0x3c40b
movq %rax, %rdi
callq 0x722dc
movq %rbx, %rdi
movq %rax, %rsi
movq %rbp, %rdx
callq 0x77144
movq %r14, %rdi
callq 0x3d1eb
movl %r13d, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x177f2