// File: /workspace/github_c_makefile_star2_O2/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 0x35d09
movq %rax, %rdi
callq 0x3590b
movq %rax, %rbx
callq 0x35d09
movq %rax, %rdi
movq %rbx, %rsi
callq 0x35b9b
movq %rax, %r15
leaq 0x9fe7a(%rip), %rdi     # 0xd5c5f
callq 0x13da9
movq %rax, %r14
testq %rbp, %rbp
je 0x35dfe
movq %rbp, %rdi
callq 0x32bc0
movq %rax, 0x10(%r15)
testq %r13, %r13
je 0x35e07
xorl %eax, %eax
jmp 0x35e27
pushq $0x3c
popq %rdx
xorl %edi, %edi
movl $0x1f4, %esi            # imm = 0x1F4
callq 0xb840
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 0x35eab
leaq 0x94357(%rip), %rsi     # 0xca196
leaq 0x9fe1e(%rip), %rdx     # 0xd5c64
leaq 0x8(%rsp), %rcx
xorl %r8d, %r8d
movq %r12, %r9
callq 0x33ff8
cmpl $0x2, %eax
jne 0x35e6d
movq %r14, %rdi
callq 0x152db
movq %rbx, %rdi
callq 0x35a0b
jmp 0x35e9a
movq 0x10(%r15), %rdi
leaq 0x9431e(%rip), %rsi     # 0xca196
leaq 0x9fdfd(%rip), %rdx     # 0xd5c7c
movq %r14, %rcx
xorl %r8d, %r8d
movq %r12, %r9
callq 0x33b98
cmpl $0x2, %eax
jne 0x35e9e
movq %r14, %rdi
callq 0x152db
xorl %ebx, %ebx
jmp 0x35f0d
movq 0x18(%r15), %rdi
callq 0xb3d0
movq 0x18(%r15), %r13
movq %r13, %rdi
callq 0xb150
movq %rax, 0x28(%r15)
movq %r14, %rdi
callq 0x143d2
cvttsd2si 0x8(%rsp), %r8d
leaq 0x9e2cb(%rip), %rdx     # 0xd4198
leaq 0x10(%rsp), %r12
movl $0x2000, %esi           # imm = 0x2000
movq %r12, %rdi
movq %rax, %rcx
xorl %eax, %eax
callq 0xba00
movq %r12, %rdi
callq 0xbb00
movq %rax, 0x30(%r15)
movq 0x28(%r15), %rdi
movq %rax, %rsi
callq 0xbc40
movq 0x30(%r15), %rdi
callq 0xb4c0
movq %r14, %rdi
callq 0x152db
movq %rbx, %rax
addq $0x2018, %rsp           # imm = 0x2018
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop