// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/examples/sketch_constructed.c
// Function: draw_example_features
static void draw_example_features(GtArray *features, const char *style_file,
                                  const char *output_file)
{
  GtRange range = { 1, 1000 }; /* the genomic range to draw */
  GtStyle *style;
  GtDiagram *diagram;
  GtLayout *layout;
  GtCanvas *canvas;
  GtUword height;
  GtError *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 diagram */
  diagram = gt_diagram_new_from_array(features, &range, style);

  /* 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, output_file,
                                   err)) {
    handle_error(err);
  }

  /* free */
  gt_canvas_delete(canvas);
  gt_layout_delete(layout);
  gt_diagram_delete(diagram);
  gt_style_delete(style);
  gt_error_delete(err);
}

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x50(%rsp)
movq %rsi, 0x48(%rsp)
movq %rdx, 0x40(%rsp)
movq 0x15208e(%rip), %rax    # 0x15e058
movq %rax, 0x30(%rsp)
movq 0x15208a(%rip), %rax    # 0x15e060
movq %rax, 0x38(%rsp)
callq 0xf130
movq %rax, (%rsp)
movq (%rsp), %rdi
callq 0x40220
movq %rax, 0x28(%rsp)
cmpq $0x0, %rax
jne 0xc001
movq (%rsp), %rdi
callq 0xc1b0
movq 0x28(%rsp), %rdi
movq 0x48(%rsp), %rsi
movq (%rsp), %rdx
callq 0x40aa0
cmpl $0x0, %eax
je 0xc022
movq (%rsp), %rdi
callq 0xc1b0
movq 0x50(%rsp), %rdi
movq 0x28(%rsp), %rdx
leaq 0x30(%rsp), %rsi
callq 0x34120
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rdi
movq 0x28(%rsp), %rdx
movq (%rsp), %rcx
movl $0x258, %esi            # imm = 0x258
callq 0x3e070
movq %rax, 0x18(%rsp)
cmpq $0x0, 0x18(%rsp)
jne 0xc069
movq (%rsp), %rdi
callq 0xc1b0
movq 0x18(%rsp), %rdi
movq (%rsp), %rdx
leaq 0x8(%rsp), %rsi
callq 0x3edb0
cmpl $0x0, %eax
je 0xc08a
movq (%rsp), %rdi
callq 0xc1b0
movq 0x28(%rsp), %rdi
movq 0x8(%rsp), %rcx
movq (%rsp), %r9
movl $0x1, %esi
movl $0x258, %edx            # imm = 0x258
xorl %eax, %eax
movl %eax, %r8d
callq 0x33b80
movq %rax, 0x10(%rsp)
cmpq $0x0, 0x10(%rsp)
jne 0xc0c2
movq (%rsp), %rdi
callq 0xc1b0
movq 0x18(%rsp), %rdi
movq 0x10(%rsp), %rsi
movq (%rsp), %rdx
callq 0x3e600
cmpl $0x0, %eax
je 0xc0e3
movq (%rsp), %rdi
callq 0xc1b0
movq 0x10(%rsp), %rdi
movq 0x40(%rsp), %rsi
movq (%rsp), %rdx
callq 0x33910
cmpl $0x0, %eax
je 0xc104
movq (%rsp), %rdi
callq 0xc1b0
movq 0x10(%rsp), %rdi
callq 0x33090
movq 0x18(%rsp), %rdi
callq 0x3e550
movq 0x20(%rsp), %rdi
callq 0x34ac0
movq 0x28(%rsp), %rdi
callq 0x43220
movq (%rsp), %rdi
callq 0xf510
addq $0x58, %rsp
retq
nopw (%rax,%rax)