// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/examples/sketch_parsed.c
// Function: main
int main(int argc, char *argv[])
{
  const char *style_file, *png_file, *gff3_file;
  char *seqid;
  GtStyle *style;
  GtFeatureIndex *feature_index;
  GtRange range;
  GtDiagram *diagram;
  GtLayout *layout;
  GtCanvas *canvas;
  GtUword height;
  GtError *err;

  if (argc != 4) {
    fprintf(stderr, "Usage: %s style_file PNG_file GFF3_file\n", argv[0]);
    return EXIT_FAILURE;
  }

  style_file = argv[1];
  png_file = argv[2];
  gff3_file = argv[3];

  /* initialize */
  gt_lib_init();

  /* create error object */
  err = gt_error_new();

  /* create style */
  if (!(style = gt_style_new(err)))
    handle_error(err);

  /* load style file */
  if (gt_style_load_file(style, style_file, err))
    handle_error(err);

  /* create feature index */
  feature_index = gt_feature_index_memory_new();

  /* add GFF3 file to index */
  if (gt_feature_index_add_gff3file(feature_index, gff3_file, err))
    handle_error(err);

  /* create diagram for first sequence ID in feature index */
  if (!(seqid = gt_feature_index_get_first_seqid(feature_index, err))) {
    if (gt_error_is_set(err))
      handle_error(err);
  }
  if (gt_feature_index_get_range_for_seqid(feature_index, &range, seqid, err))
    handle_error(err);
  diagram = gt_diagram_new(feature_index, seqid, &range, style, err);
  gt_free(seqid);
  if (gt_error_is_set(err))
    handle_error(err);

  /* create layout with given width, determine resulting image height */
  layout = gt_layout_new(diagram, 600, style, err);
  if (!layout)
    handle_error(err);
  if (gt_layout_get_height(layout, &height, err))
    handle_error(err);

  /* create PNG canvas */
  canvas = gt_canvas_cairo_file_new(style, GT_GRAPHICS_PNG, 600, height,
                                    NULL, err);
  if (!canvas)
    handle_error(err);

  /* sketch layout on canvas */
  if (gt_layout_sketch(layout, canvas, err))
    handle_error(err);

  /* write canvas to file */
  if (gt_canvas_cairo_file_to_file((GtCanvasCairoFile*) canvas, png_file, err))
    handle_error(err);

  /* free */
  gt_canvas_delete(canvas);
  gt_layout_delete(layout);
  gt_diagram_delete(diagram);
  gt_feature_index_delete(feature_index);
  gt_style_delete(style);
  gt_error_delete(err);
  /* perform static data cleanup */
  gt_lib_clean();
  return EXIT_SUCCESS;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
cmpl $0x4, %edi
jne 0x3553c
movq 0x8(%rsi), %r15
movq 0x10(%rsi), %r12
movq 0x18(%rsi), %r13
callq 0x35744
callq 0x35584
movq %rax, %rbx
movq %rax, %rdi
callq 0x53488
testq %rax, %rax
je 0x3554b
movq %rax, %r14
movq %rax, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x5389a
testl %eax, %eax
jne 0x3554b
movq %r12, 0x8(%rsp)
callq 0x3f595
movq %rax, %r12
movq %rax, %rdi
movq %r13, %rsi
movq %rbx, %rdx
callq 0x3e1d0
testl %eax, %eax
jne 0x3554b
movq %r12, %rdi
movq %rbx, %rsi
callq 0x3e455
movq %rax, %rbp
testq %rax, %rax
jne 0x3541c
movq %rbx, %rdi
callq 0x3566a
testb %al, %al
jne 0x3554b
leaq 0x18(%rsp), %rsi
movq %r12, %rdi
movq %rbp, %rdx
movq %rbx, %rcx
callq 0x3e548
testl %eax, %eax
jne 0x3554b
leaq 0x18(%rsp), %rdx
movq %r12, %rdi
movq %rbp, %rsi
movq %r14, %rcx
movq %rbx, %r8
callq 0x4cf50
movq %rax, %r13
leaq 0xabbd6(%rip), %rsi     # 0xe102d
movq %rbp, %rdi
movl $0x3c, %edx
callq 0x362a0
movq %rbx, %rdi
callq 0x3566a
testb %al, %al
jne 0x3554b
movq %r13, %rdi
movl $0x258, %esi            # imm = 0x258
movq %r14, %rdx
movq %rbx, %rcx
callq 0x52450
testq %rax, %rax
je 0x3554b
movq %rax, %rbp
leaq 0x10(%rsp), %rsi
movq %rax, %rdi
movq %rbx, %rdx
callq 0x52984
testl %eax, %eax
jne 0x3554b
movq 0x10(%rsp), %rcx
movl $0x258, %edx            # imm = 0x258
movq %r14, %rdi
movl $0x1, %esi
xorl %r8d, %r8d
movq %rbx, %r9
callq 0x4cdaa
testq %rax, %rax
je 0x3554b
movq %rax, %r15
movq %rbp, %rdi
movq %rax, %rsi
movq %rbx, %rdx
callq 0x52748
testl %eax, %eax
jne 0x3554b
movq %r15, %rdi
movq 0x8(%rsp), %rsi
movq %rbx, %rdx
callq 0x4cc8c
testl %eax, %eax
jne 0x3554b
movq %r15, %rdi
callq 0x4ca7e
movq %rbp, %rdi
callq 0x526da
movq %r13, %rdi
callq 0x4d597
movq %r12, %rdi
callq 0x3e016
movq %r14, %rdi
callq 0x54be4
movq %rbx, %rdi
callq 0x35705
callq 0x35973
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rsi, %rdi
callq 0xbd00
movl $0x1, %eax
jmp 0x3552d
movq %rbx, %rdi
callq 0x35553