// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/core/fa.c
// Function: mmap_generic_path_func
static void* mmap_generic_path_func(const char *path, size_t *len,
                                    bool mapwritable, bool hard_fail,
                                    const char *src_file, int src_line,
                                    GtError *err)
{
  int fd;
  void *map;
  size_t file_size;

  gt_error_check(err);
  gt_assert(fa && path);
  fd = open(path, mapwritable?O_RDWR:O_RDONLY, 0);
  if (fd == -1) {
    gt_error_set(err,"cannot open file \"%s\": %s", path, strerror(errno));
    return NULL;
  }
  file_size = fd_to_file_size(fd,path,hard_fail,err);
  if (file_size == -1)
  {
    return NULL;
  }
  map = gt_fa_mmap_generic_fd_func(fd, path, file_size, 0, mapwritable,
                                   hard_fail, src_file, src_line, err);
  if (map != NULL && len != NULL)
    *len = file_size;
  gt_xclose(fd);
  return map;
}

// Assembly:
subq $0x68, %rsp
movb %cl, %al
movb %dl, %cl
movq 0x70(%rsp), %rdx
movq %rdi, 0x58(%rsp)
movq %rsi, 0x50(%rsp)
andb $0x1, %cl
movb %cl, 0x4f(%rsp)
andb $0x1, %al
movb %al, 0x4e(%rsp)
movq %r8, 0x40(%rsp)
movl %r9d, 0x3c(%rsp)
cmpq $0x0, 0x70(%rsp)
je 0x80e5e
movq 0x70(%rsp), %rdi
callq 0xc270
testb $0x1, %al
jne 0x80e26
jmp 0x80e5e
movq 0x1331ab(%rip), %rax    # 0x1b3fd8
movq (%rax), %rdi
leaq 0xdd22f(%rip), %rsi     # 0x15e066
leaq 0xdd80a(%rip), %rdx     # 0x15e648
leaq 0xed292(%rip), %rcx     # 0x16e0d7
leaq 0xece20(%rip), %r8      # 0x16dc6c
movl $0x1ed, %r9d            # imm = 0x1ED
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x80e60
jmp 0x80e62
cmpq $0x0, 0x135646(%rip)    # 0x1b64b0
je 0x80e74
cmpq $0x0, 0x58(%rsp)
jne 0x80eac
movq 0x13315d(%rip), %rax    # 0x1b3fd8
movq (%rax), %rdi
leaq 0xdd1e1(%rip), %rsi     # 0x15e066
leaq 0xed262(%rip), %rdx     # 0x16e0ee
leaq 0xed244(%rip), %rcx     # 0x16e0d7
leaq 0xecdd2(%rip), %r8      # 0x16dc6c
movl $0x1ee, %r9d            # imm = 0x1EE
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x80eae
movq 0x58(%rsp), %rdi
movb 0x4f(%rsp), %cl
xorl %esi, %esi
movl $0x2, %eax
testb $0x1, %cl
cmovnel %eax, %esi
xorl %edx, %edx
movb $0x0, %al
callq 0xbaa0
movl %eax, 0x38(%rsp)
cmpl $-0x1, 0x38(%rsp)
jne 0x80f21
movq 0x70(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x58(%rsp), %rax
movq %rax, 0x20(%rsp)
callq 0xb060
movl (%rax), %edi
callq 0xb1b0
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rdx
movq %rax, %rcx
leaq 0xed1ed(%rip), %rsi     # 0x16e0f9
movb $0x0, %al
callq 0xc0d0
movq $0x0, 0x60(%rsp)
jmp 0x80fd9
movl 0x38(%rsp), %edi
movq 0x58(%rsp), %rsi
movb 0x4e(%rsp), %al
movq 0x70(%rsp), %rcx
andb $0x1, %al
movzbl %al, %edx
callq 0x82420
movq %rax, 0x28(%rsp)
cmpq $-0x1, 0x28(%rsp)
jne 0x80f58
movq $0x0, 0x60(%rsp)
jmp 0x80fd9
movl 0x38(%rsp), %edi
movq 0x58(%rsp), %rsi
movq 0x28(%rsp), %rdx
movb 0x4f(%rsp), %r8b
movb 0x4e(%rsp), %r9b
movq 0x40(%rsp), %r11
movl 0x3c(%rsp), %r10d
movq 0x70(%rsp), %rax
xorl %ecx, %ecx
andb $0x1, %r8b
andb $0x1, %r9b
movzbl %r8b, %r8d
movzbl %r9b, %r9d
movq %r11, (%rsp)
movl %r10d, 0x8(%rsp)
movq %rax, 0x10(%rsp)
callq 0x809c0
movq %rax, 0x30(%rsp)
cmpq $0x0, 0x30(%rsp)
je 0x80fc6
cmpq $0x0, 0x50(%rsp)
je 0x80fc6
movq 0x28(%rsp), %rcx
movq 0x50(%rsp), %rax
movq %rcx, (%rax)
movl 0x38(%rsp), %edi
callq 0xa2b80
movq 0x30(%rsp), %rax
movq %rax, 0x60(%rsp)
movq 0x60(%rsp), %rax
addq $0x68, %rsp
retq
nopw %cs:(%rax,%rax)