// File: /workspace/github_c_makefile_star2_O1/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 0x9d9dc(%rip), %xmm0    # 0xea7a0
movaps %xmm0, 0x40(%rsp)
movupd 0x9d9bf(%rip), %xmm0    # 0xea790
movapd %xmm0, 0x30(%rsp)
movabsq $0x4024000000000000, %rax # imm = 0x4024000000000000
movq %rax, 0x20(%rsp)
testq %rdi, %rdi
je 0x4cf4a
movq %rdx, %r12
testq %rdx, %rdx
je 0x4cf4a
movq %rcx, %r14
testq %rcx, %rcx
je 0x4cf4a
movq %r9, %rbx
movl %esi, %r15d
movq %rdi, %r13
leaq 0x9437f(%rip), %rsi     # 0xe1196
leaq 0x9e501(%rip), %rdx     # 0xeb31f
xorl %ebp, %ebp
leaq 0x30(%rsp), %rcx
xorl %r8d, %r8d
callq 0x53e39
cmpl $0x2, %eax
je 0x4cf38
cmpl $0x1, %eax
jne 0x4ce4f
movapd 0x9d84d(%rip), %xmm0    # 0xea690
movapd %xmm0, 0x40(%rsp)
movapd %xmm0, 0x30(%rsp)
leaq 0x94340(%rip), %rsi     # 0xe1196
leaq 0x9e62b(%rip), %rdx     # 0xeb488
xorl %ebp, %ebp
leaq 0x20(%rsp), %rcx
movq %r13, %rdi
xorl %r8d, %r8d
movq %rbx, %r9
callq 0x545d2
cmpl $0x2, %eax
je 0x4cf38
callq 0x4cd1e
movq %rax, %rdi
callq 0x4ca21
movq %rax, %rbp
movl %r15d, %edi
movl %r12d, %esi
movl %r14d, %edx
callq 0x51f9b
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 0x4eb84
movq 0x8(%rbp), %rax
movq 0x58(%rax), %rdi
movsd 0x20(%rsp), %xmm0
xorps %xmm1, %xmm1
callq 0x4ed80
movsd 0x20(%rsp), %xmm0
movq 0x8(%rbp), %rax
movsd %xmm0, 0x20(%rax)
movq 0x28(%rsp), %rbx
testq %rbx, %rbx
je 0x4cef6
movq %rbx, %rdi
movl %r14d, %esi
callq 0x5225d
movq 0x8(%rbp), %rax
movq %r13, 0x38(%rax)
movsd 0x18(%rax), %xmm0
addsd 0x9d795(%rip), %xmm0    # 0xea6a0
movsd %xmm0, 0x18(%rax)
movq %rbx, 0x60(%rax)
movq %r12, 0x28(%rax)
movq %r14, 0x30(%rax)
movq $0x0, 0x50(%rax)
callq 0x4cd1e
movq %rax, %rdi
movq %rbp, %rsi
callq 0x4cb00
movl %r15d, 0x10(%rax)
movq %rbp, %rax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x15958
nop