// File: /workspace/github_c_makefile_star2_O3/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 0x34ebc
movq 0x8(%rsi), %r15
movq 0x10(%rsi), %r12
movq 0x18(%rsi), %r13
callq 0x350c4
callq 0x34f04
movq %rax, %rbx
movq %rax, %rdi
callq 0x52810
testq %rax, %rax
je 0x34ecb
movq %rax, %r14
movq %rax, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x52c0f
testl %eax, %eax
jne 0x34ecb
movq %r12, 0x8(%rsp)
callq 0x3ec3d
movq %rax, %r12
movq %rax, %rdi
movq %r13, %rsi
movq %rbx, %rdx
callq 0x3d854
testl %eax, %eax
jne 0x34ecb
movq %r12, %rdi
movq %rbx, %rsi
callq 0x3dad9
movq %rax, %rbp
testq %rax, %rax
jne 0x34d9c
movq %rbx, %rdi
callq 0x34fea
testb %al, %al
jne 0x34ecb
leaq 0x18(%rsp), %rsi
movq %r12, %rdi
movq %rbp, %rdx
movq %rbx, %rcx
callq 0x3dbcc
testl %eax, %eax
jne 0x34ecb
leaq 0x18(%rsp), %rdx
movq %r12, %rdi
movq %rbp, %rsi
movq %r14, %rcx
movq %rbx, %r8
callq 0x4c2c0
movq %rax, %r13
leaq 0xac256(%rip), %rsi     # 0xe102d
movq %rbp, %rdi
movl $0x3c, %edx
callq 0x35c27
movq %rbx, %rdi
callq 0x34fea
testb %al, %al
jne 0x34ecb
movq %r13, %rdi
movl $0x258, %esi            # imm = 0x258
movq %r14, %rdx
movq %rbx, %rcx
callq 0x517d0
testq %rax, %rax
je 0x34ecb
movq %rax, %rbp
leaq 0x10(%rsp), %rsi
movq %rax, %rdi
movq %rbx, %rdx
callq 0x51d09
testl %eax, %eax
jne 0x34ecb
movq 0x10(%rsp), %rcx
movl $0x258, %edx            # imm = 0x258
movq %r14, %rdi
movl $0x1, %esi
xorl %r8d, %r8d
movq %rbx, %r9
callq 0x4c11a
testq %rax, %rax
je 0x34ecb
movq %rax, %r15
movq %rbp, %rdi
movq %rax, %rsi
movq %rbx, %rdx
callq 0x51acd
testl %eax, %eax
jne 0x34ecb
movq %r15, %rdi
movq 0x8(%rsp), %rsi
movq %rbx, %rdx
callq 0x4bffc
testl %eax, %eax
jne 0x34ecb
movq %r15, %rdi
callq 0x4bde8
movq %rbp, %rdi
callq 0x51a5f
movq %r13, %rdi
callq 0x4c902
movq %r12, %rdi
callq 0x3d69a
movq %r14, %rdi
callq 0x53f50
movq %rbx, %rdi
callq 0x35085
callq 0x352ef
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 0x34ead
movq %rbx, %rdi
callq 0x34ed3