// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/annotationsketch/graphics_cairo.c
// Function: gt_graphics_cairo_initialize
void gt_graphics_cairo_initialize(GtGraphics *gg, GtGraphicsOutType type,
                                  unsigned int width, unsigned int height)
{
  GtGraphicsCairo *g = gt_graphics_cairo_cast(gg);
  g->outbuf = gt_str_new();
  switch (type)
  {
    case GT_GRAPHICS_PDF:
#ifdef CAIRO_HAS_PDF_SURFACE
      g->surf = cairo_pdf_surface_create_for_stream(str_write_func,
                                                    g->outbuf,
                                                    width,
                                                    height);
      break;
#endif
    case GT_GRAPHICS_PS:
#ifdef CAIRO_HAS_PS_SURFACE
      g->surf = cairo_ps_surface_create_for_stream(str_write_func,
                                                   g->outbuf,
                                                   width,
                                                   height);
      break;
#endif
    case GT_GRAPHICS_SVG:
#ifdef CAIRO_HAS_SVG_SURFACE
      g->surf = cairo_svg_surface_create_for_stream(str_write_func,
                                                    g->outbuf,
                                                    width,
                                                    height);
      break;
#endif
    case GT_GRAPHICS_PNG:
    default:
      g->surf = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, width, height);
      if (!g->surf && width > 10000)
      {
        gt_warning("warning: failed to create image surface; requested image "
                   "width was %u pixels, which is probably the culprit\n",
                   width);
      }
      break;
  }
  gt_assert(g->surf && cairo_surface_status(g->surf) == CAIRO_STATUS_SUCCESS);
  g->cr = cairo_create(g->surf);
  gt_assert(cairo_status(g->cr) == CAIRO_STATUS_SUCCESS);
  /* set background default to transparent */
  g->bg_color.red = g->bg_color.green  = 0.0;
  g->bg_color.blue = g->bg_color.alpha = 0.0;
  g->width = width;
  g->height = height;
  g->margin_x = g->margin_y = 20;
  cairo_set_line_join(g->cr, CAIRO_LINE_JOIN_ROUND);
  cairo_set_line_cap(g->cr, CAIRO_LINE_CAP_ROUND);
  g->type = type;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movl %esi, 0x1c(%rsp)
movl %edx, 0x18(%rsp)
movl %ecx, 0x14(%rsp)
callq 0x40e60
movq %rax, %rdi
movq 0x20(%rsp), %rsi
callq 0x3e730
movq %rax, 0x8(%rsp)
callq 0x18f00
movq %rax, %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x40(%rax)
movl 0x1c(%rsp), %eax
movq %rax, (%rsp)
subq $0x3, %rax
ja 0x411b7
movq (%rsp), %rax
leaq 0x12723e(%rip), %rcx    # 0x168348
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x8(%rsp), %rax
movq 0x40(%rax), %rsi
movl 0x18(%rsp), %eax
cvtsi2sd %rax, %xmm0
movl 0x14(%rsp), %eax
cvtsi2sd %rax, %xmm1
leaq 0x24b(%rip), %rdi       # 0x41380
callq 0xb040
movq %rax, %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x18(%rax)
jmp 0x411fc
movq 0x8(%rsp), %rax
movq 0x40(%rax), %rsi
movl 0x18(%rsp), %eax
cvtsi2sd %rax, %xmm0
movl 0x14(%rsp), %eax
cvtsi2sd %rax, %xmm1
leaq 0x213(%rip), %rdi       # 0x41380
callq 0xb710
movq %rax, %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x18(%rax)
jmp 0x411fc
movq 0x8(%rsp), %rax
movq 0x40(%rax), %rsi
movl 0x18(%rsp), %eax
cvtsi2sd %rax, %xmm0
movl 0x14(%rsp), %eax
cvtsi2sd %rax, %xmm1
leaq 0x1de(%rip), %rdi       # 0x41380
callq 0xb7c0
movq %rax, %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x18(%rax)
jmp 0x411fc
jmp 0x411b7
movl 0x18(%rsp), %esi
movl 0x14(%rsp), %edx
xorl %edi, %edi
callq 0xb810
movq %rax, %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x18(%rax)
movq 0x8(%rsp), %rax
cmpq $0x0, 0x18(%rax)
jne 0x411fa
cmpl $0x2710, 0x18(%rsp)     # imm = 0x2710
jbe 0x411fa
movl 0x18(%rsp), %esi
leaq 0x1271ff(%rip), %rdi    # 0x1683f2
movb $0x0, %al
callq 0x1c550
jmp 0x411fc
jmp 0x411fe
movq 0x8(%rsp), %rax
cmpq $0x0, 0x18(%rax)
je 0x4121d
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rdi
callq 0xb9c0
cmpl $0x0, %eax
je 0x41255
movq 0x172db4(%rip), %rax    # 0x1b3fd8
movq (%rax), %rdi
leaq 0x11ce38(%rip), %rsi    # 0x15e066
leaq 0x12722a(%rip), %rdx    # 0x16845f
leaq 0x127264(%rip), %rcx    # 0x1684a0
leaq 0x127169(%rip), %r8     # 0x1683ac
movl $0x88, %r9d
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x41257
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rdi
callq 0xb1c0
movq %rax, %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x10(%rax)
movq 0x8(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0xb330
cmpl $0x0, %eax
je 0x412bc
movq 0x172d4d(%rip), %rax    # 0x1b3fd8
movq (%rax), %rdi
leaq 0x11cdd1(%rip), %rsi    # 0x15e066
leaq 0x127221(%rip), %rdx    # 0x1684bd
leaq 0x1271fd(%rip), %rcx    # 0x1684a0
leaq 0x127102(%rip), %r8     # 0x1683ac
movl $0x8a, %r9d
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x412be
movq 0x8(%rsp), %rax
movq $0x0, 0x28(%rax)
movq 0x8(%rsp), %rax
movq $0x0, 0x20(%rax)
movq 0x8(%rsp), %rax
movq $0x0, 0x38(%rax)
movq 0x8(%rsp), %rax
movq $0x0, 0x30(%rax)
movl 0x18(%rsp), %eax
cvtsi2sd %rax, %xmm0
movq 0x8(%rsp), %rax
movsd %xmm0, 0x68(%rax)
movl 0x14(%rsp), %eax
cvtsi2sd %rax, %xmm0
movq 0x8(%rsp), %rax
movsd %xmm0, 0x60(%rax)
movq 0x8(%rsp), %rax
movsd 0x126ffb(%rip), %xmm0   # 0x168320
movsd %xmm0, 0x58(%rax)
movq 0x8(%rsp), %rax
movsd 0x126fe9(%rip), %xmm0   # 0x168320
movsd %xmm0, 0x50(%rax)
movq 0x8(%rsp), %rax
movq 0x10(%rax), %rdi
movl $0x1, %esi
callq 0xb4c0
movq 0x8(%rsp), %rax
movq 0x10(%rax), %rdi
movl $0x1, %esi
callq 0xb340
movl 0x1c(%rsp), %ecx
movq 0x8(%rsp), %rax
movl %ecx, 0x48(%rax)
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)