// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x78, %rsp
movl $0x0, 0x74(%rsp)
movl %edi, 0x70(%rsp)
movq %rsi, 0x68(%rsp)
cmpl $0x4, 0x70(%rsp)
je 0xbdf9
movq 0x1a8205(%rip), %rax    # 0x1b3fd8
movq (%rax), %rdi
movq 0x68(%rsp), %rax
movq (%rax), %rdx
leaq 0x15221f(%rip), %rsi    # 0x15e004
movb $0x0, %al
callq 0xb890
movl $0x1, 0x74(%rsp)
jmp 0xc054
movq 0x68(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x60(%rsp)
movq 0x68(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x58(%rsp)
movq 0x68(%rsp), %rax
movq 0x18(%rax), %rax
movq %rax, 0x50(%rsp)
callq 0xc4e0
callq 0xc0b0
movq %rax, (%rsp)
movq (%rsp), %rdi
callq 0x47850
movq %rax, 0x40(%rsp)
cmpq $0x0, %rax
jne 0xbe4e
movq (%rsp), %rdi
callq 0xc060
movq 0x40(%rsp), %rdi
movq 0x60(%rsp), %rsi
movq (%rsp), %rdx
callq 0x480d0
cmpl $0x0, %eax
je 0xbe6f
movq (%rsp), %rdi
callq 0xc060
callq 0x1f9d0
movq %rax, 0x38(%rsp)
movq 0x38(%rsp), %rdi
movq 0x50(%rsp), %rsi
movq (%rsp), %rdx
callq 0x1d550
cmpl $0x0, %eax
je 0xbe9a
movq (%rsp), %rdi
callq 0xc060
movq 0x38(%rsp), %rdi
movq (%rsp), %rsi
callq 0x1d9c0
movq %rax, 0x48(%rsp)
cmpq $0x0, %rax
jne 0xbecd
movq (%rsp), %rdi
callq 0xc270
testb $0x1, %al
jne 0xbec2
jmp 0xbecb
movq (%rsp), %rdi
callq 0xc060
jmp 0xbecd
movq 0x38(%rsp), %rdi
movq 0x48(%rsp), %rdx
movq (%rsp), %rcx
leaq 0x28(%rsp), %rsi
callq 0x1dc10
cmpl $0x0, %eax
je 0xbef3
movq (%rsp), %rdi
callq 0xc060
movq 0x38(%rsp), %rdi
movq 0x48(%rsp), %rsi
movq 0x40(%rsp), %rcx
movq (%rsp), %r8
leaq 0x28(%rsp), %rdx
callq 0x3b4e0
movq %rax, 0x20(%rsp)
movq 0x48(%rsp), %rdi
leaq 0x15210c(%rip), %rsi    # 0x15e02d
movl $0x3c, %edx
callq 0xdab0
movq (%rsp), %rdi
callq 0xc270
testb $0x1, %al
jne 0xbf3a
jmp 0xbf43
movq (%rsp), %rdi
callq 0xc060
movq 0x20(%rsp), %rdi
movq 0x40(%rsp), %rdx
movq (%rsp), %rcx
movl $0x258, %esi            # imm = 0x258
callq 0x456a0
movq %rax, 0x18(%rsp)
cmpq $0x0, 0x18(%rsp)
jne 0xbf71
movq (%rsp), %rdi
callq 0xc060
movq 0x18(%rsp), %rdi
movq (%rsp), %rdx
leaq 0x8(%rsp), %rsi
callq 0x463e0
cmpl $0x0, %eax
je 0xbf92
movq (%rsp), %rdi
callq 0xc060
movq 0x40(%rsp), %rdi
movq 0x8(%rsp), %rcx
movq (%rsp), %r9
movl $0x1, %esi
movl $0x258, %edx            # imm = 0x258
xorl %eax, %eax
movl %eax, %r8d
callq 0x3b1b0
movq %rax, 0x10(%rsp)
cmpq $0x0, 0x10(%rsp)
jne 0xbfca
movq (%rsp), %rdi
callq 0xc060
movq 0x18(%rsp), %rdi
movq 0x10(%rsp), %rsi
movq (%rsp), %rdx
callq 0x45c30
cmpl $0x0, %eax
je 0xbfeb
movq (%rsp), %rdi
callq 0xc060
movq 0x10(%rsp), %rdi
movq 0x58(%rsp), %rsi
movq (%rsp), %rdx
callq 0x3af40
cmpl $0x0, %eax
je 0xc00c
movq (%rsp), %rdi
callq 0xc060
movq 0x10(%rsp), %rdi
callq 0x3a6c0
movq 0x18(%rsp), %rdi
callq 0x45b80
movq 0x20(%rsp), %rdi
callq 0x3c0f0
movq 0x38(%rsp), %rdi
callq 0x1d200
movq 0x40(%rsp), %rdi
callq 0x4a850
movq (%rsp), %rdi
callq 0xc490
callq 0xc740
movl $0x0, 0x74(%rsp)
movl 0x74(%rsp), %eax
addq $0x78, %rsp
retq
nopl (%rax)