// File: /workspace/github_c_makefile_star2_O1/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 0x33a32d
movq %rdx, %r12
testq %rdx, %rdx
je 0x33a32d
movq %rcx, %r14
testq %rcx, %rcx
je 0x33a32d
movq %r8, %r15
movq %rsi, %rbx
movq %rdi, %r13
leaq 0x2aa30(%rip), %rsi     # 0x364c54
leaq 0xb60a5(%rip), %rdx     # 0x3f02d0
xorl %ebp, %ebp
leaq 0x8(%rsp), %rcx
xorl %r8d, %r8d
callq 0x22a12e
cmpl $0x2, %eax
je 0x33a31b
callq 0x33a144
movq %rax, %rdi
callq 0x222405
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 0x16668(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x16670(%rip), %xmm0    # 0x3508f0
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 0x33d859
movq 0x8(%rbp), %rcx
movq %rax, 0x58(%rcx)
movsd 0x8(%rsp), %xmm0
xorpd %xmm1, %xmm1
movq %rax, %rdi
callq 0x2249c4
movsd 0x8(%rsp), %xmm0
movq 0x8(%rbp), %rax
movsd %xmm0, 0x20(%rax)
testq %r15, %r15
je 0x33a2d9
movq %r15, %rdi
movl %r14d, %esi
callq 0x227119
movq 0x8(%rbp), %rax
movq %r13, 0x38(%rax)
movsd 0x18(%rax), %xmm0
addsd 0x24b8a(%rip), %xmm0    # 0x35ee78
movsd %xmm0, 0x18(%rax)
movq %r15, 0x60(%rax)
movq %r12, 0x28(%rax)
movq %r14, 0x30(%rax)
movq $0x0, 0x50(%rax)
callq 0x33a144
movq %rax, %rdi
movq %rbp, %rsi
callq 0x2224e4
movq %rbx, 0x10(%rax)
movq %rbp, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x97fb9
nop