// File: /workspace/github_c_makefile_star2_O3/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 0x522a0
movq %rcx, %r15
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %rbp
movq 0x8(%rdx), %rdx
cmpq $0x0, 0x60(%rdx)
je 0x520cb
leaq 0x1e2(%rip), %rsi       # 0x522a5
movq %r12, %rdi
callq 0x6f3d2
xorl %r13d, %r13d
movq %r12, %rdi
xorl %esi, %esi
callq 0x6f037
movq (%rax), %rbx
movq %rbp, %rdi
callq 0x3b785
movq %rax, 0x18(%rsp)
movq 0x8(%r14), %rax
movq (%rax), %rdi
leaq 0x8f0a0(%rip), %rsi     # 0xe1196
leaq 0x99a68(%rip), %rdx     # 0xebb65
leaq 0xf(%rsp), %rcx
xorl %r8d, %r8d
movq %r15, %r9
callq 0x53bf6
movl $0x1, %ebp
cmpl $0x2, %eax
je 0x52251
movq 0x8(%r14), %rax
movq (%rax), %rdi
leaq 0x8f06d(%rip), %rsi     # 0xe1196
leaq 0x99a41(%rip), %rdx     # 0xebb71
xorl %r13d, %r13d
leaq 0x20(%rsp), %rcx
xorl %r8d, %r8d
movq %r15, %r9
callq 0x5393e
cmpl $0x2, %eax
je 0x52251
movq 0x8(%r14), %rax
movq (%rax), %rax
movq %rax, 0x10(%rsp)
movq %rbx, %rdi
callq 0x8abe5
leaq 0x999fe(%rip), %rdx     # 0xebb65
xorl %r13d, %r13d
leaq 0xf(%rsp), %rcx
movq 0x10(%rsp), %rdi
movq %rax, %rsi
xorl %r8d, %r8d
movq %r15, %r9
callq 0x53bf6
cmpl $0x2, %eax
je 0x52251
movq 0x8(%r14), %rax
movq (%rax), %rax
movq %rax, 0x10(%rsp)
movq %rbx, %rdi
callq 0x8abe5
leaq 0x999cb(%rip), %rdx     # 0xebb71
xorl %r13d, %r13d
leaq 0x20(%rsp), %rcx
movq 0x10(%rsp), %rdi
movq %rax, %rsi
xorl %r8d, %r8d
movq %r15, %r9
callq 0x5393e
cmpl $0x2, %eax
je 0x52251
movsd 0x20(%rsp), %xmm0
cvttsd2si %xmm0, %rax
movq %rax, %rcx
sarq $0x3f, %rcx
subsd 0x9857c(%rip), %xmm0    # 0xea760
cvttsd2si %xmm0, %rbx
andq %rcx, %rbx
orq %rax, %rbx
movzbl 0xf(%rsp), %ebp
movq 0x8(%r14), %rdi
movl 0x48(%rdi), %esi
movq (%rdi), %rdx
callq 0x525ec
movq 0x18(%rsp), %rdi
movq %rbx, %rsi
movl %ebp, %edx
movq %rax, %rcx
callq 0x55390
movq %rax, %r13
movq 0x8(%r14), %rax
incq 0x40(%rax)
xorl %ebx, %ebx
movq %r12, %rdi
callq 0x6f310
cmpq %rax, %rbx
jae 0x52274
movq %r12, %rdi
movq %rbx, %rsi
callq 0x6f037
movq (%rax), %rsi
movq %r13, %rdi
movq %r15, %rdx
callq 0x55449
incq %rbx
testl %eax, %eax
je 0x52222
movl %eax, %ebp
movq %r13, %rdi
callq 0x567f6
movq 0x18(%rsp), %rdi
callq 0x3c87b
movl %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x8(%r14), %rax
movq 0x20(%rax), %rbx
movq 0x18(%rsp), %rdi
callq 0x3bb5d
movq %rax, %rdi
callq 0x728c0
movq %rbx, %rdi
movq %rax, %rsi
movq %r13, %rdx
callq 0x77628
xorl %ebp, %ebp
jmp 0x52259
callq 0x176a0