// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/extended/encdesc.c
// Function: gt_encdesc_load
GtEncdesc* gt_encdesc_load(const char *name,
                           GtError *err)
{
  int had_err = 0;
  GtEncdesc *encdesc = NULL;
  FILE *fp;
  GtStr *filename;
  int fd;
  GtUword const pages_to_map = 5UL;

  gt_assert(name);
  encdesc = encdesc_new();

  filename = gt_str_new_cstr(name);
  gt_str_append_cstr(filename, GT_ENCDESC_FILESUFFIX);
  fp = gt_fa_fopen_with_suffix(name, GT_ENCDESC_FILESUFFIX, "rb", err);
  if (fp == NULL) {
    gt_assert(gt_error_is_set(err));
    had_err = 1;
  }

  if (!had_err) {
    fd = open(gt_str_get(filename), O_RDONLY);
    if (fd == -1) {
      gt_error_set(err, "open(): cannot read file %s, error: %s",
                   gt_str_get(filename), strerror(errno));
      had_err = 1;
    }
  }
  if (!had_err)
    had_err = encdesc_read_header(encdesc, fp, err);

  if (!had_err) {
    encdesc_init_huffman(encdesc);

    encdesc_read_samplingtab(encdesc, fp);
    gt_fa_fclose(fp);

    encdesc->bitinstream =
      gt_bitinstream_new(gt_str_get(filename),
                         (size_t) encdesc->start_of_encoding, pages_to_map);
    gt_str_delete(filename);

  }
  else {
    gt_encdesc_delete(encdesc);
    encdesc = NULL;
  }
  return encdesc;
}

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x50(%rsp)
movq %rsi, 0x48(%rsp)
movl $0x0, 0x44(%rsp)
movq $0x0, 0x38(%rsp)
movq $0x5, 0x18(%rsp)
cmpq $0x0, 0x50(%rsp)
jne 0x161998
movq 0x4da639(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x3b46a2(%rip), %rsi    # 0x516013
leaq 0x3f3486(%rip), %rdx    # 0x554dfe
leaq 0x3ecbe2(%rip), %rcx    # 0x54e561
leaq 0x3ec8e2(%rip), %r8     # 0x54e268
movl $0x467, %r9d            # imm = 0x467
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x16199a
callq 0x15ef20
movq %rax, 0x38(%rsp)
movq 0x50(%rsp), %rdi
callq 0x11d510
movq %rax, 0x28(%rsp)
movq 0x28(%rsp), %rdi
leaq 0x3eca2f(%rip), %rsi    # 0x54e3ee
callq 0x11d550
movq 0x50(%rsp), %rdi
movq 0x48(%rsp), %r9
leaq 0x3eca19(%rip), %rsi    # 0x54e3ee
leaq 0x416509(%rip), %rdx    # 0x577ee5
leaq 0x3ec885(%rip), %rcx    # 0x54e268
movl $0x46c, %r8d            # imm = 0x46C
callq 0xd92c0
movq %rax, 0x30(%rsp)
cmpq $0x0, 0x30(%rsp)
jne 0x161a4d
jmp 0x1619fd
movq 0x48(%rsp), %rdi
callq 0xd8a60
testb $0x1, %al
jne 0x161a43
movq 0x4da58e(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x3b45f7(%rip), %rsi    # 0x516013
leaq 0x3d8564(%rip), %rdx    # 0x539f87
leaq 0x3ecb37(%rip), %rcx    # 0x54e561
leaq 0x3ec837(%rip), %r8     # 0x54e268
movl $0x46e, %r9d            # imm = 0x46E
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x161a45
movl $0x1, 0x44(%rsp)
cmpl $0x0, 0x44(%rsp)
jne 0x161abf
movq 0x28(%rsp), %rdi
callq 0x11dee0
movq %rax, %rdi
xorl %esi, %esi
movb $0x0, %al
callq 0x19c80
movl %eax, 0x24(%rsp)
cmpl $-0x1, 0x24(%rsp)
jne 0x161abd
movq 0x48(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x28(%rsp), %rdi
callq 0x11dee0
movq %rax, 0x10(%rsp)
callq 0x19060
movl (%rax), %edi
callq 0x19200
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rdx
movq %rax, %rcx
leaq 0x3ecac3(%rip), %rsi    # 0x54e571
movb $0x0, %al
callq 0xd88c0
movl $0x1, 0x44(%rsp)
jmp 0x161abf
cmpl $0x0, 0x44(%rsp)
jne 0x161ade
movq 0x38(%rsp), %rdi
movq 0x30(%rsp), %rsi
movq 0x48(%rsp), %rdx
callq 0x165110
movl %eax, 0x44(%rsp)
cmpl $0x0, 0x44(%rsp)
jne 0x161b40
movq 0x38(%rsp), %rdi
callq 0x161110
movq 0x38(%rsp), %rdi
movq 0x30(%rsp), %rsi
callq 0x161b60
movq 0x30(%rsp), %rdi
callq 0xd9390
movq 0x28(%rsp), %rdi
callq 0x11dee0
movq %rax, %rdi
movq 0x38(%rsp), %rax
movq 0x60(%rax), %rsi
movl $0x5, %edx
callq 0x4899a0
movq %rax, %rcx
movq 0x38(%rsp), %rax
movq %rcx, 0x20(%rax)
movq 0x28(%rsp), %rdi
callq 0x11f560
jmp 0x161b53
movq 0x38(%rsp), %rdi
callq 0x161bb0
movq $0x0, 0x38(%rsp)
movq 0x38(%rsp), %rax
addq $0x58, %rsp
retq
nopl (%rax)