// File: /workspace/github_c_makefile_star2_O1/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 0x4fc8b
movq %rax, %rdi
movq %r14, %rsi
callq 0x4e8a3
movq %rax, %r14
callq 0x3bfe0
movq %rax, 0x40(%r14)
movl %ebp, %r13d
movl %r15d, %r12d
cmpl $0x3, %ebx
je 0x4fe0e
cmpl $0x2, %ebx
je 0x4fdf3
testl %ebx, %ebx
jne 0x4fec9
cvtsi2sd %r13, %xmm0
cvtsi2sd %r12, %xmm1
leaq 0x126(%rip), %rdi       # 0x4ff0f
movq %rax, %rsi
callq 0xb040
jmp 0x4fe27
cvtsi2sd %r13, %xmm0
cvtsi2sd %r12, %xmm1
leaq 0x10b(%rip), %rdi       # 0x4ff0f
movq %rax, %rsi
callq 0xb740
jmp 0x4fe27
cvtsi2sd %r13, %xmm0
cvtsi2sd %r12, %xmm1
leaq 0xf0(%rip), %rdi        # 0x4ff0f
movq %rax, %rsi
callq 0xb7f0
movq %rax, 0x18(%r14)
movq 0x18(%r14), %rdi
testq %rdi, %rdi
je 0x4ff05
callq 0xba00
testl %eax, %eax
jne 0x4ff05
movq 0x18(%r14), %rdi
callq 0xb1e0
movq %rax, 0x10(%r14)
movq %rax, %rdi
callq 0xb350
testl %eax, %eax
jne 0x4ff0a
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 0x9b2bb(%rip), %xmm0    # 0xeb150
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 %al
cmpl $0x2711, %ebp           # imm = 0x2711
setb %cl
orb %al, %cl
jne 0x4fe2b
leaq 0x9b31b(%rip), %rdi     # 0xeb212
movl %ebp, %esi
xorl %eax, %eax
callq 0x3da84
jmp 0x4fe2b
callq 0x16aaa
callq 0x16a71