// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x58, %rsp
movq %rdi, 0x48(%rsp)
movq %rsi, 0x40(%rsp)
movsd %xmm0, 0x38(%rsp)
movq %rdx, 0x30(%rsp)
movq %rcx, 0x28(%rsp)
movq %r8, 0x20(%rsp)
movq %r9, 0x18(%rsp)
movsd 0x37440(%rip), %xmm0    # 0x526080
movsd %xmm0, (%rsp)
cmpq $0x0, 0x48(%rsp)
je 0x4eec5d
cmpq $0x0, 0x30(%rsp)
jbe 0x4eec5d
cmpq $0x0, 0x28(%rsp)
ja 0x4eec95
movq 0x14d33c(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x273a5(%rip), %rsi     # 0x516013
leaq 0xcd2da(%rip), %rdx     # 0x5bbf4f
leaq 0xcd2f4(%rip), %rcx     # 0x5bbf70
leaq 0xcd309(%rip), %r8      # 0x5bbf8c
movl $0x4b, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x4eec97
movq 0x48(%rsp), %rdi
movq 0x18(%rsp), %r9
leaq 0x3e059(%rip), %rsi     # 0x52cd01
leaq 0xcda89(%rip), %rdx     # 0x5bc738
movq %rsp, %rcx
xorl %eax, %eax
movl %eax, %r8d
callq 0x32e8c0
cmpl $0x2, %eax
jne 0x4eeccf
movq $0x0, 0x50(%rsp)
jmp 0x4eee3e
callq 0x4eeb60
movq %rax, %rdi
callq 0x31f670
movq %rax, 0x10(%rsp)
movsd 0x38(%rsp), %xmm1
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rax
movsd 0x18(%rax), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x18(%rax)
movq 0x40(%rsp), %rdi
movl 0x30(%rsp), %esi
movaps 0x29c22(%rip), %xmm1    # 0x518930
movq 0x28(%rsp), %xmm0
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0x29c20(%rip), %xmm1    # 0x518940
subpd %xmm1, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movsd 0x38(%rsp), %xmm1
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %rax
movl %eax, %edx
callq 0x4f4e80
movq %rax, %rcx
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rax
movq %rcx, 0x58(%rax)
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x58(%rax), %rdi
movsd (%rsp), %xmm0
xorps %xmm1, %xmm1
callq 0x324650
movsd (%rsp), %xmm0
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rax
movsd %xmm0, 0x20(%rax)
cmpq $0x0, 0x20(%rsp)
je 0x4eed9b
movq 0x20(%rsp), %rdi
movq 0x28(%rsp), %rax
movl %eax, %esi
callq 0x328e10
movq 0x48(%rsp), %rcx
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rax
movq %rcx, 0x38(%rax)
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rax
movsd 0x3814a(%rip), %xmm0    # 0x526f08
addsd 0x18(%rax), %xmm0
movsd %xmm0, 0x18(%rax)
movq 0x20(%rsp), %rcx
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rax
movq %rcx, 0x60(%rax)
movq 0x30(%rsp), %rcx
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rax
movq %rcx, 0x28(%rax)
movq 0x28(%rsp), %rcx
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rax
movq %rcx, 0x30(%rax)
movq 0x10(%rsp), %rax
movq 0x8(%rax), %rax
movq $0x0, 0x50(%rax)
callq 0x4eeb60
movq %rax, %rdi
movq 0x10(%rsp), %rsi
callq 0x31f820
movq %rax, 0x8(%rsp)
movq 0x40(%rsp), %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x10(%rax)
movq 0x10(%rsp), %rax
movq %rax, 0x50(%rsp)
movq 0x50(%rsp), %rax
addq $0x58, %rsp
retq
nopl (%rax,%rax)