// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x2058, %rsp           # imm = 0x2058
movq %rdi, 0x2048(%rsp)
movq %rsi, 0x2040(%rsp)
movq %rdx, 0x2038(%rsp)
movq $0x0, 0x2020(%rsp)
movsd 0x11bc75(%rip), %xmm0   # 0x168338
movsd %xmm0, 0x2018(%rsp)
callq 0x4c5d0
movq %rax, %rdi
callq 0x4c040
movq %rax, 0x2028(%rsp)
callq 0x4c5d0
movq %rax, %rdi
movq 0x2028(%rsp), %rsi
callq 0x4c3a0
movq %rax, 0x2030(%rsp)
leaq 0x11d7bf(%rip), %rdi    # 0x169ec4
callq 0x18f70
movq %rax, 0x2020(%rsp)
cmpq $0x0, 0x2040(%rsp)
je 0x4c739
movq 0x2040(%rsp), %rdi
callq 0x47d40
movq %rax, %rcx
movq 0x2030(%rsp), %rax
movq %rcx, 0x10(%rax)
cmpq $0x0, 0x2048(%rsp)
jne 0x4c792
xorl %edi, %edi
movl $0x1f4, %esi            # imm = 0x1F4
movl $0x3c, %edx
callq 0xb810
movq %rax, %rcx
movq 0x2030(%rsp), %rax
movq %rcx, 0x20(%rax)
movq 0x2030(%rsp), %rax
movq 0x20(%rax), %rdi
callq 0xb1c0
movq %rax, %rcx
movq 0x2030(%rsp), %rax
movq %rcx, 0x18(%rax)
movq 0x2030(%rsp), %rax
movb $0x1, 0x38(%rax)
jmp 0x4c7b2
movq 0x2048(%rsp), %rcx
movq 0x2030(%rsp), %rax
movq %rcx, 0x18(%rax)
movq 0x2030(%rsp), %rax
movb $0x0, 0x38(%rax)
movq 0x2030(%rsp), %rax
cmpq $0x0, 0x10(%rax)
je 0x4c891
movq 0x2030(%rsp), %rax
movq 0x10(%rax), %rdi
movq 0x2038(%rsp), %r9
leaq 0x1119b6(%rip), %rsi    # 0x15e196
leaq 0x11d6e2(%rip), %rdx    # 0x169ec9
leaq 0x2018(%rsp), %rcx
xorl %eax, %eax
movl %eax, %r8d
callq 0x49af0
cmpl $0x2, %eax
jne 0x4c829
movq 0x2020(%rsp), %rdi
callq 0x1afc0
movq 0x2028(%rsp), %rdi
callq 0x4c190
movq $0x0, 0x2050(%rsp)
jmp 0x4c951
movq 0x2030(%rsp), %rax
movq 0x10(%rax), %rdi
movq 0x2020(%rsp), %rcx
movq 0x2038(%rsp), %r9
leaq 0x11194a(%rip), %rsi    # 0x15e196
leaq 0x11d68e(%rip), %rdx    # 0x169ee1
xorl %eax, %eax
movl %eax, %r8d
callq 0x494c0
cmpl $0x2, %eax
jne 0x4c880
movq 0x2020(%rsp), %rdi
callq 0x1afc0
movq $0x0, 0x2050(%rsp)
jmp 0x4c951
movq 0x2030(%rsp), %rax
movq 0x18(%rax), %rdi
callq 0xb3b0
movq 0x2030(%rsp), %rax
movq 0x18(%rax), %rdi
callq 0xb130
movq %rax, %rcx
movq 0x2030(%rsp), %rax
movq %rcx, 0x28(%rax)
leaq 0x10(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x2020(%rsp), %rdi
callq 0x19940
movq 0x8(%rsp), %rdi
movq %rax, %rcx
cvttsd2si 0x2018(%rsp), %r8d
movl $0x2000, %esi           # imm = 0x2000
leaq 0x11baf2(%rip), %rdx    # 0x1683d8
movb $0x0, %al
callq 0xb9d0
leaq 0x10(%rsp), %rdi
callq 0xbad0
movq %rax, %rcx
movq 0x2030(%rsp), %rax
movq %rcx, 0x30(%rax)
movq 0x2030(%rsp), %rax
movq 0x28(%rax), %rdi
movq 0x2030(%rsp), %rax
movq 0x30(%rax), %rsi
callq 0xbc10
movq 0x2030(%rsp), %rax
movq 0x30(%rax), %rdi
callq 0xb4a0
movq 0x2020(%rsp), %rdi
callq 0x1afc0
movq 0x2028(%rsp), %rax
movq %rax, 0x2050(%rsp)
movq 0x2050(%rsp), %rax
addq $0x2058, %rsp           # imm = 0x2058
retq
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)