// File: /workspace/github_c_makefile_star2_O3/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %r15d
movl %edx, %ebp
movl %esi, %ebx
movq %rdi, %r14
callq 0x4efdf
movq %rax, %rdi
movq %r14, %rsi
callq 0x4dbf7
movq %rax, %r14
callq 0x3b728
movq %rax, 0x40(%r14)
movl %ebp, %r13d
movl %r15d, %r12d
cmpl $0x3, %ebx
je 0x4f15a
cmpl $0x2, %ebx
je 0x4f13f
testl %ebx, %ebx
jne 0x4f214
cvtsi2sd %r13, %xmm0
cvtsi2sd %r12, %xmm1
leaq 0x129(%rip), %rdi       # 0x4f25e
movq %rax, %rsi
callq 0xb040
jmp 0x4f173
cvtsi2sd %r13, %xmm0
cvtsi2sd %r12, %xmm1
leaq 0x10e(%rip), %rdi       # 0x4f25e
movq %rax, %rsi
callq 0xb740
jmp 0x4f173
cvtsi2sd %r13, %xmm0
cvtsi2sd %r12, %xmm1
leaq 0xf3(%rip), %rdi        # 0x4f25e
movq %rax, %rsi
callq 0xb7f0
movq %rax, 0x18(%r14)
testq %rax, %rax
je 0x4f254
movq %rax, %rdi
callq 0xba00
testl %eax, %eax
jne 0x4f254
movq 0x18(%r14), %rdi
callq 0xb1e0
movq %rax, 0x10(%r14)
movq %rax, %rdi
callq 0xb350
testl %eax, %eax
jne 0x4f259
xorps %xmm0, %xmm0
cvtsi2sd %r13, %xmm0
xorpd %xmm1, %xmm1
movupd %xmm1, 0x30(%r14)
movupd %xmm1, 0x20(%r14)
movsd %xmm0, 0x68(%r14)
xorps %xmm0, %xmm0
cvtsi2sd %r12, %xmm0
movsd %xmm0, 0x60(%r14)
movaps 0x9bf20(%rip), %xmm0    # 0xeb100
movups %xmm0, 0x50(%r14)
movq 0x10(%r14), %rdi
movl $0x1, %esi
callq 0xb4e0
movq 0x10(%r14), %rdi
movl $0x1, %esi
callq 0xb360
movl %ebx, 0x48(%r14)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %edi, %edi
movl %ebp, %esi
movl %r15d, %edx
callq 0xb850
movq %rax, 0x18(%r14)
testq %rax, %rax
setne %cl
cmpl $0x2711, %ebp           # imm = 0x2711
setb %dl
orb %cl, %dl
jne 0x4f177
leaq 0x9bf80(%rip), %rdi     # 0xeb1c2
movl %ebp, %esi
xorl %eax, %eax
callq 0x3d110
movq 0x18(%r14), %rax
jmp 0x4f177
callq 0x16958
callq 0x1691f