// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/annotationsketch/canvas_cairo_file.c
// Function: gt_canvas_cairo_file_new
GtCanvas* gt_canvas_cairo_file_new(GtStyle *style,
                                   GtGraphicsOutType output_type,
                                   GtUword width, GtUword height,
                                   GtImageInfo *image_info,
                                   GtError *err)
{
  GtCanvas *canvas;
  GtColor bgcolor = {1.0, 1.0, 1.0, 1.0};
  GtCanvasCairoFile *ccf;
  GtStyleQueryStatus status;
  double margins = 10.0;
  gt_assert(style && width > 0 && height > 0);

  status = gt_style_get_color(style, "format", "background_color", &bgcolor,
                              NULL, err);
  switch (status) {
    case GT_STYLE_QUERY_ERROR:
      return NULL;
    case GT_STYLE_QUERY_NOT_SET:
      bgcolor.red = bgcolor.green = bgcolor.blue = bgcolor.alpha = 1.0;
      break;
    default:
      break;
    }
  if (gt_style_get_num(style,
                       "format", "margins", &margins,
                       NULL, err) == GT_STYLE_QUERY_ERROR) {
    return NULL;
  }

  canvas = gt_canvas_create(gt_canvas_cairo_file_class());
  canvas->pvt->g = gt_graphics_cairo_new(output_type, width, height);
  (void) gt_graphics_set_background_color(canvas->pvt->g, bgcolor);
  (void) gt_graphics_set_margins(canvas->pvt->g, margins, 0);
  canvas->pvt->margins = margins;
  if (image_info)
    gt_image_info_set_height(image_info, height);
  canvas->pvt->sty = style;
  canvas->pvt->y += 0.5;
  canvas->pvt->ii = image_info;
  canvas->pvt->width = width;
  canvas->pvt->height = height;
  canvas->pvt->bt = NULL;
  ccf = canvas_cairo_file_cast(canvas);
  ccf->type = output_type;
  return canvas;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %r8, 0x28(%rsp)
movups 0x9e61c(%rip), %xmm0    # 0xea750
movaps %xmm0, 0x40(%rsp)
movupd 0x9e5ff(%rip), %xmm0    # 0xea740
movapd %xmm0, 0x30(%rsp)
movabsq $0x4024000000000000, %rax # imm = 0x4024000000000000
movq %rax, 0x20(%rsp)
testq %rdi, %rdi
je 0x4c2ba
movq %rdx, %r12
testq %rdx, %rdx
je 0x4c2ba
movq %rcx, %r14
testq %rcx, %rcx
je 0x4c2ba
movq %r9, %rbx
movl %esi, %r15d
movq %rdi, %r13
leaq 0x9500f(%rip), %rsi     # 0xe1196
leaq 0x9f141(%rip), %rdx     # 0xeb2cf
xorl %ebp, %ebp
leaq 0x30(%rsp), %rcx
xorl %r8d, %r8d
callq 0x531a5
cmpl $0x2, %eax
je 0x4c2a8
cmpl $0x1, %eax
jne 0x4c1bf
movapd 0x9e48d(%rip), %xmm0    # 0xea640
movapd %xmm0, 0x40(%rsp)
movapd %xmm0, 0x30(%rsp)
leaq 0x94fd0(%rip), %rsi     # 0xe1196
leaq 0x9f26b(%rip), %rdx     # 0xeb438
xorl %ebp, %ebp
leaq 0x20(%rsp), %rcx
movq %r13, %rdi
xorl %r8d, %r8d
movq %rbx, %r9
callq 0x5393e
cmpl $0x2, %eax
je 0x4c2a8
callq 0x4c08e
movq %rax, %rdi
callq 0x4bd8b
movq %rax, %rbp
movl %r15d, %edi
movl %r12d, %esi
movl %r14d, %edx
callq 0x51314
movq 0x8(%rbp), %rcx
movq %rax, 0x58(%rcx)
movaps 0x30(%rsp), %xmm0
movaps 0x40(%rsp), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movq %rax, %rdi
callq 0x4ded8
movq 0x8(%rbp), %rax
movq 0x58(%rax), %rdi
movsd 0x20(%rsp), %xmm0
xorps %xmm1, %xmm1
callq 0x4e0d4
movsd 0x20(%rsp), %xmm0
movq 0x8(%rbp), %rax
movsd %xmm0, 0x20(%rax)
movq 0x28(%rsp), %rbx
testq %rbx, %rbx
je 0x4c26a
movq %rbx, %rdi
movl %r14d, %esi
callq 0x515d5
movq 0x8(%rbp), %rax
movq %r13, 0x38(%rax)
movsd 0x18(%rax), %xmm0
addsd 0x9e3d5(%rip), %xmm0    # 0xea650
movsd %xmm0, 0x18(%rax)
movq %rbx, 0x60(%rax)
movq %r12, 0x28(%rax)
movq %r14, 0x30(%rax)
movq $0x0, 0x50(%rax)
callq 0x4c08e
movq %rax, %rdi
movq %rbp, %rsi
callq 0x4be70
movl %r15d, 0x10(%rax)
movq %rbp, %rax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x15806
nop