// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/annotationsketch/canvas_cairo_context.c
// Function: gt_canvas_cairo_context_new
GtCanvas* gt_canvas_cairo_context_new(GtStyle *style, cairo_t *context,
                                      double offsetpos,
                                      GtUword width,
                                      GtUword height,
                                      GtImageInfo *image_info,
                                      GtError *err)
{
  GtCanvas *canvas;
  GtCanvasCairoContext *ccc;
  double margins = 10.0;
  gt_assert(style && width > 0 && height > 0);
  if (gt_style_get_num(style,
                       "format", "margins", &margins,
                       NULL, err) == GT_STYLE_QUERY_ERROR) {
    return NULL;
  }
  canvas = gt_canvas_create(gt_canvas_cairo_context_class());
  canvas->pvt->y += offsetpos;
  canvas->pvt->g = gt_graphics_cairo_new_from_context(context,
                                                      width,
                                                      height+offsetpos);
  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;
  ccc = canvas_cairo_context_cast(canvas);
  ccc->context = context;
  return canvas;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movsd %xmm0, 0x10(%rsp)
movabsq $0x4024000000000000, %rax # imm = 0x4024000000000000
movq %rax, 0x8(%rsp)
testq %rdi, %rdi
je 0x32f5ad
movq %rdx, %r12
testq %rdx, %rdx
je 0x32f5ad
movq %rcx, %r14
testq %rcx, %rcx
je 0x32f5ad
movq %r8, %r15
movq %rsi, %rbx
movq %rdi, %r13
leaq 0x2c710(%rip), %rsi     # 0x35bbb4
leaq 0xb7615(%rip), %rdx     # 0x3e6ac0
xorl %ebp, %ebp
leaq 0x8(%rsp), %rcx
xorl %r8d, %r8d
callq 0x2203ee
cmpl $0x2, %eax
je 0x32f59b
callq 0x32f3c4
movq %rax, %rdi
callq 0x2186bf
movq %rax, %rbp
movq 0x8(%rax), %rax
movsd 0x18(%rax), %xmm0
movsd 0x10(%rsp), %xmm2
addsd %xmm2, %xmm0
movsd %xmm0, 0x18(%rax)
movq %r14, %xmm0
punpckldq 0x183e8(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x183f0(%rip), %xmm0    # 0x3478f0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
addsd %xmm2, %xmm1
cvttsd2si %xmm1, %rdx
movq %rbx, %rdi
movl %r12d, %esi
callq 0x332b0a
movq 0x8(%rbp), %rcx
movq %rax, 0x58(%rcx)
movsd 0x8(%rsp), %xmm0
xorpd %xmm1, %xmm1
movq %rax, %rdi
callq 0x21ac6c
movsd 0x8(%rsp), %xmm0
movq 0x8(%rbp), %rax
movsd %xmm0, 0x20(%rax)
testq %r15, %r15
je 0x32f55d
movq %r15, %rdi
movl %r14d, %esi
callq 0x21d4ad
movq 0x8(%rbp), %rax
movq %r13, 0x38(%rax)
movsd 0x18(%rax), %xmm0
addsd 0x268da(%rip), %xmm0    # 0x355e48
movsd %xmm0, 0x18(%rax)
movq %r15, 0x60(%rax)
movq %r12, 0x28(%rax)
movq %r14, 0x30(%rax)
movq $0x0, 0x50(%rax)
callq 0x32f3c4
movq %rax, %rdi
movq %rbp, %rsi
callq 0x2187a4
movq %rbx, 0x10(%rax)
movq %rbp, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x95ee4
nop