// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/extended/mapping.c
// Function: map_function
static int map_function(GtMapping *m, GtStr **stroutput, GtWord *integeroutput,
                        const char *input, GtError *err)
{
  int had_err = 0;
  gt_error_check(err);
  gt_assert(m && input);
  gt_assert((m->type == GT_MAPPINGTYPE_STRING  && stroutput) ||
            (m->type == GT_MAPPINGTYPE_INTEGER && integeroutput));
  gt_assert(!lua_gettop(m->L));
  lua_getglobal(m->L, m->global);
  lua_pushstring(m->L, input);
  /* call function */
  if (lua_pcall(m->L, 1, 1, 0)) {
    gt_error_set(err, "running function '%s': %s", m->global,
              lua_tostring(m->L, -1));
    had_err = -1;
  }
  /* make sure the result is a string */
  if (!had_err) {
    switch (m->type) {
      case GT_MAPPINGTYPE_STRING:
        if (!lua_isstring(m->L, -1)) {
          gt_error_set(err, "function '%s' must return a string (defined in "
                         "\"%s\")", m->global, gt_str_get(m->mapping_file));
          had_err = -1;
        }
        if (!had_err)
          *stroutput = gt_str_new_cstr(lua_tostring(m->L, -1));
         break;
       case GT_MAPPINGTYPE_INTEGER:
        if (!lua_isnumber(m->L, -1)) {
          gt_error_set(err, "function '%s' must return an integer) (defined in "
                       "\"%s\")", m->global, gt_str_get(m->mapping_file));
          had_err = -1;
        }
        if (!had_err)
          *integeroutput = lua_tointeger(m->L, -1);
        break;
    }
  }
  lua_pop(m->L, 1); /* pop result */
  gt_assert(!lua_gettop(m->L));
  return had_err;
}

// Assembly:
subq $0x68, %rsp
movq %rdi, 0x60(%rsp)
movq %rsi, 0x58(%rsp)
movq %rdx, 0x50(%rsp)
movq %rcx, 0x48(%rsp)
movq %r8, 0x40(%rsp)
movl $0x0, 0x3c(%rsp)
cmpq $0x0, 0x40(%rsp)
je 0x33a65
movq 0x40(%rsp), %rdi
callq 0xc270
testb $0x1, %al
jne 0x33a2d
jmp 0x33a65
movq 0x1805a4(%rip), %rax    # 0x1b3fd8
movq (%rax), %rdi
leaq 0x12a628(%rip), %rsi    # 0x15e066
leaq 0x12ac03(%rip), %rdx    # 0x15e648
leaq 0x132395(%rip), %rcx    # 0x165de1
leaq 0x132187(%rip), %r8     # 0x165bda
movl $0x9a, %r9d
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x33a67
jmp 0x33a69
cmpq $0x0, 0x60(%rsp)
je 0x33a79
cmpq $0x0, 0x48(%rsp)
jne 0x33ab1
movq 0x180558(%rip), %rax    # 0x1b3fd8
movq (%rax), %rdi
leaq 0x12a5dc(%rip), %rsi    # 0x15e066
leaq 0x13225f(%rip), %rdx    # 0x165cf0
leaq 0x132349(%rip), %rcx    # 0x165de1
leaq 0x13213b(%rip), %r8     # 0x165bda
movl $0x9b, %r9d
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x33ab3
jmp 0x33ab5
movq 0x60(%rsp), %rax
cmpl $0x0, 0x10(%rax)
jne 0x33ac8
cmpq $0x0, 0x58(%rsp)
jne 0x33b13
movq 0x60(%rsp), %rax
cmpl $0x1, 0x10(%rax)
jne 0x33adb
cmpq $0x0, 0x50(%rsp)
jne 0x33b13
movq 0x1804f6(%rip), %rax    # 0x1b3fd8
movq (%rax), %rdi
leaq 0x12a57a(%rip), %rsi    # 0x15e066
leaq 0x132208(%rip), %rdx    # 0x165cfb
leaq 0x1322e7(%rip), %rcx    # 0x165de1
leaq 0x1320d9(%rip), %r8     # 0x165bda
movl $0x9d, %r9d
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x33b15
jmp 0x33b17
movq 0x60(%rsp), %rax
movq 0x18(%rax), %rdi
callq 0x4f0e0
cmpl $0x0, %eax
je 0x33b62
movq 0x1804a7(%rip), %rax    # 0x1b3fd8
movq (%rax), %rdi
leaq 0x12a52b(%rip), %rsi    # 0x15e066
leaq 0x1320f7(%rip), %rdx    # 0x165c39
leaq 0x132298(%rip), %rcx    # 0x165de1
leaq 0x13208a(%rip), %r8     # 0x165bda
movl $0x9e, %r9d
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x33b64
movq 0x60(%rsp), %rax
movq 0x18(%rax), %rdi
movq 0x60(%rsp), %rax
movq 0x8(%rax), %rdx
movl $0xffffd8ee, %esi       # imm = 0xFFFFD8EE
callq 0x51640
movq 0x60(%rsp), %rax
movq 0x18(%rax), %rdi
movq 0x48(%rsp), %rsi
callq 0x50970
movq 0x60(%rsp), %rax
movq 0x18(%rax), %rdi
movl $0x1, %edx
xorl %ecx, %ecx
movl %edx, %esi
callq 0x527f0
cmpl $0x0, %eax
je 0x33c01
movq 0x40(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x60(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x30(%rsp)
movq 0x60(%rsp), %rax
movq 0x18(%rax), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %eax, %eax
movl %eax, %edx
callq 0x50180
movq 0x28(%rsp), %rdi
movq 0x30(%rsp), %rdx
movq %rax, %rcx
leaq 0x1321fc(%rip), %rsi    # 0x165dee
movb $0x0, %al
callq 0xc0d0
movl $0xffffffff, 0x3c(%rsp) # imm = 0xFFFFFFFF
cmpl $0x0, 0x3c(%rsp)
jne 0x33d4d
movq 0x60(%rsp), %rax
movl 0x10(%rax), %eax
movl %eax, 0x24(%rsp)
testl %eax, %eax
je 0x33c30
jmp 0x33c1e
movl 0x24(%rsp), %eax
subl $0x1, %eax
je 0x33cc6
jmp 0x33d4b
movq 0x60(%rsp), %rax
movq 0x18(%rax), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x4f9e0
cmpl $0x0, %eax
jne 0x33c90
movq 0x40(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x60(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x18(%rsp)
movq 0x60(%rsp), %rax
movq (%rax), %rdi
callq 0x19940
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rdx
movq %rax, %rcx
leaq 0x132187(%rip), %rsi    # 0x165e08
movb $0x0, %al
callq 0xc0d0
movl $0xffffffff, 0x3c(%rsp) # imm = 0xFFFFFFFF
cmpl $0x0, 0x3c(%rsp)
jne 0x33cc1
movq 0x60(%rsp), %rax
movq 0x18(%rax), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %eax, %eax
movl %eax, %edx
callq 0x50180
movq %rax, %rdi
callq 0x18f70
movq %rax, %rcx
movq 0x58(%rsp), %rax
movq %rcx, (%rax)
jmp 0x33d4b
movq 0x60(%rsp), %rax
movq 0x18(%rax), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x4f8f0
cmpl $0x0, %eax
jne 0x33d24
movq 0x40(%rsp), %rax
movq %rax, (%rsp)
movq 0x60(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x8(%rsp)
movq 0x60(%rsp), %rax
movq (%rax), %rdi
callq 0x19940
movq (%rsp), %rdi
movq 0x8(%rsp), %rdx
movq %rax, %rcx
leaq 0x132128(%rip), %rsi    # 0x165e3d
movb $0x0, %al
callq 0xc0d0
movl $0xffffffff, 0x3c(%rsp) # imm = 0xFFFFFFFF
cmpl $0x0, 0x3c(%rsp)
jne 0x33d49
movq 0x60(%rsp), %rax
movq 0x18(%rax), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x50090
movq %rax, %rcx
movq 0x50(%rsp), %rax
movq %rcx, (%rax)
jmp 0x33d4b
jmp 0x33d4d
movq 0x60(%rsp), %rax
movq 0x18(%rax), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x4f100
movq 0x60(%rsp), %rax
movq 0x18(%rax), %rdi
callq 0x4f0e0
cmpl $0x0, %eax
je 0x33dab
movq 0x18025e(%rip), %rax    # 0x1b3fd8
movq (%rax), %rdi
leaq 0x12a2e2(%rip), %rsi    # 0x15e066
leaq 0x131eae(%rip), %rdx    # 0x165c39
leaq 0x13204f(%rip), %rcx    # 0x165de1
leaq 0x131e41(%rip), %r8     # 0x165bda
movl $0xbf, %r9d
movb $0x0, %al
callq 0xb890
callq 0xb2e0
jmp 0x33dad
movl 0x3c(%rsp), %eax
addq $0x68, %rsp
retq
nopw %cs:(%rax,%rax)