// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/annotationsketch/text_width_calculator_cairo.c
// Function: gt_text_width_calculator_cairo_new
GtTextWidthCalculator* gt_text_width_calculator_cairo_new(cairo_t *context,
                                                          GtStyle *style,
                                                          GtError *err)
{
  GtTextWidthCalculatorCairo *twcc;
  GtTextWidthCalculator *twc;
  GtStr *fontfam = NULL;
  double theight = TEXT_SIZE_DEFAULT;
  char buf[BUFSIZ];
  twc = gt_text_width_calculator_create(gt_text_width_calculator_cairo_class());
  twcc = gt_text_width_calculator_cairo_cast(twc);
  fontfam = gt_str_new_cstr("Sans");
  if (style)
    twcc->style = gt_style_ref(style);
  if (!context)
  {
    twcc->mysurf = cairo_image_surface_create(GT_TWC_FORMAT, GT_TWC_WIDTH,
                                              GT_TWC_HEIGHT);
    twcc->context = cairo_create(twcc->mysurf);
    twcc->own_context = true;
  } else {
    twcc->context = context;
    twcc->own_context = false;
  }
  if (twcc->style)
  {
    if (gt_style_get_num(twcc->style,
                         "format", "block_caption_font_size",
                         &theight, NULL, err) == GT_STYLE_QUERY_ERROR) {
      gt_str_delete(fontfam);
      gt_text_width_calculator_delete(twc);
      return NULL;
    }
    if (gt_style_get_str(twcc->style,
                         "format", "block_caption_font_family",
                         fontfam, NULL, err ) == GT_STYLE_QUERY_ERROR) {
      gt_str_delete(fontfam);
      return NULL;
    }
    cairo_save(twcc->context);
  }
  twcc->layout = pango_cairo_create_layout(twcc->context);
  snprintf(buf, BUFSIZ, "%s %d", gt_str_get(fontfam), (int) theight);
  twcc->desc = pango_font_description_from_string(buf);
  pango_layout_set_font_description(twcc->layout, twcc->desc);
  pango_font_description_free(twcc->desc);
  gt_str_delete(fontfam);
  return twc;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2018, %rsp           # imm = 0x2018
movq %rdx, %r12
movq %rsi, %rbp
movq %rdi, %r13
movabsq $0x4020000000000000, %rax # imm = 0x4020000000000000
movq %rax, 0x8(%rsp)
callq 0x55f38
movq %rax, %rdi
callq 0x55cd5
movq %rax, %rbx
callq 0x55f38
movq %rax, %rdi
movq %rbx, %rsi
callq 0x55e7b
movq %rax, %r15
leaq 0x96ca9(%rip), %rdi     # 0xeccbf
callq 0x3c03d
movq %rax, %r14
testq %rbp, %rbp
je 0x5602f
movq %rbp, %rdi
callq 0x5370b
movq %rax, 0x10(%r15)
testq %r13, %r13
je 0x56038
xorl %eax, %eax
jmp 0x5605a
xorl %edi, %edi
movl $0x1f4, %esi            # imm = 0x1F4
movl $0x3c, %edx
callq 0xb850
movq %rax, 0x20(%r15)
movq %rax, %rdi
callq 0xb1e0
movq %rax, %r13
movb $0x1, %al
movq %r13, 0x18(%r15)
movb %al, 0x38(%r15)
movq 0x10(%r15), %rdi
testq %rdi, %rdi
je 0x560da
leaq 0x8b124(%rip), %rsi     # 0xe1196
leaq 0x96c4b(%rip), %rdx     # 0xeccc4
leaq 0x8(%rsp), %rcx
xorl %r8d, %r8d
movq %r12, %r9
callq 0x545d2
cmpl $0x2, %eax
jne 0x560a0
movq %r14, %rdi
callq 0x3d1eb
movq %rbx, %rdi
callq 0x55d6e
jmp 0x560cd
movq 0x10(%r15), %rdi
leaq 0x8b0eb(%rip), %rsi     # 0xe1196
leaq 0x96c2a(%rip), %rdx     # 0xeccdc
movq %r14, %rcx
xorl %r8d, %r8d
movq %r12, %r9
callq 0x542cf
cmpl $0x2, %eax
jne 0x560d1
movq %r14, %rdi
callq 0x3d1eb
xorl %ebx, %ebx
jmp 0x5613d
movq 0x18(%r15), %rdi
callq 0xb3d0
movq 0x18(%r15), %rdi
callq 0xb150
movq %rax, 0x28(%r15)
movq %r14, %rdi
callq 0x3c40b
cvttsd2si 0x8(%rsp), %r8d
leaq 0x950fb(%rip), %rdx     # 0xeb1f8
leaq 0x10(%rsp), %r12
movl $0x2000, %esi           # imm = 0x2000
movq %r12, %rdi
movq %rax, %rcx
xorl %eax, %eax
callq 0xba10
movq %r12, %rdi
callq 0xbb10
movq %rax, 0x30(%r15)
movq 0x28(%r15), %rdi
movq %rax, %rsi
callq 0xbc50
movq 0x30(%r15), %rdi
callq 0xb4c0
movq %r14, %rdi
callq 0x3d1eb
movq %rbx, %rax
addq $0x2018, %rsp           # imm = 0x2018
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop