// File: /workspace/github_c_makefile_star2_O2/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 0x2e259
movq %rax, %rdi
movq %r14, %rsi
callq 0x2c5a1
movq %rax, %r14
callq 0x13d5c
movq %rax, 0x40(%r14)
movl %ebp, %r13d
movl %r15d, %r12d
cmpl $0x3, %ebx
je 0x2e3d4
cmpl $0x2, %ebx
je 0x2e3b9
testl %ebx, %ebx
jne 0x2e485
cvtsi2sd %r13, %xmm0
cvtsi2sd %r12, %xmm1
leaq 0x17c(%rip), %rdi       # 0x2e52b
movq %rax, %rsi
callq 0xb040
jmp 0x2e3ed
cvtsi2sd %r13, %xmm0
cvtsi2sd %r12, %xmm1
leaq 0x161(%rip), %rdi       # 0x2e52b
movq %rax, %rsi
callq 0xb740
jmp 0x2e3ed
cvtsi2sd %r13, %xmm0
cvtsi2sd %r12, %xmm1
leaq 0x146(%rip), %rdi       # 0x2e52b
movq %rax, %rsi
callq 0xb7f0
movq %rax, 0x18(%r14)
testq %rax, %rax
je 0x2e4c5
movq %rax, %rdi
callq 0xb9f0
testl %eax, %eax
jne 0x2e4c5
movq 0x18(%r14), %rdi
callq 0xb1e0
movq %rax, 0x10(%r14)
movq %rax, %rdi
callq 0xb350
testl %eax, %eax
jne 0x2e4f3
cvtsi2sd %r13, %xmm0
xorpd %xmm1, %xmm1
movupd %xmm1, 0x30(%r14)
movupd %xmm1, 0x20(%r14)
movsd %xmm0, 0x68(%r14)
cvtsi2sd %r12, %xmm0
movsd %xmm0, 0x60(%r14)
movaps 0xa5c9c(%rip), %xmm0    # 0xd40f0
movups %xmm0, 0x50(%r14)
movq 0x10(%r14), %rdi
pushq $0x1
popq %rbp
movl %ebp, %esi
callq 0xb4e0
movq 0x10(%r14), %rdi
movl %ebp, %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 0xb840
movq %rax, 0x18(%r14)
testq %rax, %rax
setne %cl
cmpl $0x2711, %ebp           # imm = 0x2711
setb %dl
orb %cl, %dl
jne 0x2e3f1
leaq 0xa5cff(%rip), %rdi     # 0xd41b2
movl %ebp, %esi
xorl %eax, %eax
callq 0x161b0
movq 0x18(%r14), %rax
jmp 0x2e3f1
movq 0xffaec(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x9bb90(%rip), %rsi     # 0xca066
leaq 0xa5d42(%rip), %rdx     # 0xd421f
leaq 0xa5d7c(%rip), %rcx     # 0xd4260
leaq 0xa5c81(%rip), %r8      # 0xd416c
movl $0x88, %r9d
jmp 0x2e51f
movq 0xffabe(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x9bb62(%rip), %rsi     # 0xca066
leaq 0xa5d72(%rip), %rdx     # 0xd427d
leaq 0xa5d4e(%rip), %rcx     # 0xd4260
leaq 0xa5c53(%rip), %r8      # 0xd416c
movl $0x8a, %r9d
xorl %eax, %eax
callq 0xb8c0
callq 0xb300