// File: /workspace/github_c_makefile_star2_O3/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 0x55170
movq %rax, %rdi
callq 0x54f0d
movq %rax, %rbx
callq 0x55170
movq %rax, %rdi
movq %rbx, %rsi
callq 0x550b3
movq %rax, %r15
leaq 0x97a21(%rip), %rdi     # 0xecc6f
callq 0x3b785
movq %rax, %r14
testq %rbp, %rbp
je 0x55267
movq %rbp, %rdi
callq 0x52a93
movq %rax, 0x10(%r15)
testq %r13, %r13
je 0x55270
xorl %eax, %eax
jmp 0x55292
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 0x55316
leaq 0x8beec(%rip), %rsi     # 0xe1196
leaq 0x979c3(%rip), %rdx     # 0xecc74
leaq 0x8(%rsp), %rcx
xorl %r8d, %r8d
movq %r12, %r9
callq 0x5393e
cmpl $0x2, %eax
jne 0x552d8
movq %r14, %rdi
callq 0x3c87b
movq %rbx, %rdi
callq 0x54fa6
jmp 0x55305
movq 0x10(%r15), %rdi
leaq 0x8beb3(%rip), %rsi     # 0xe1196
leaq 0x979a2(%rip), %rdx     # 0xecc8c
movq %r14, %rcx
xorl %r8d, %r8d
movq %r12, %r9
callq 0x5363b
cmpl $0x2, %eax
jne 0x55309
movq %r14, %rdi
callq 0x3c87b
xorl %ebx, %ebx
jmp 0x55378
movq 0x18(%r15), %rdi
callq 0xb3d0
movq 0x18(%r15), %r13
movq %r13, %rdi
callq 0xb150
movq %rax, 0x28(%r15)
movq %r14, %rdi
callq 0x3bb5d
cvttsd2si 0x8(%rsp), %r8d
leaq 0x95e70(%rip), %rdx     # 0xeb1a8
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 0x3c87b
movq %rbx, %rax
addq $0x2018, %rsp           # imm = 0x2018
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)