// File: /workspace/github_c_makefile_star2_O0/bmottershead[P]DBF2TSV/dbf.c
// Function: DBFReadAttribute
static void *DBFReadAttribute(DBFHandle psDBF, int hEntity, int iField,
                              char chReqType) {
  unsigned char *pabyRec;
  void *pReturnField = NULL;

  /* Verify selection. */
  if (hEntity < 0 || hEntity >= psDBF->nRecords)
    return (NULL);
  if (iField < 0 || iField >= psDBF->nFields)
    return (NULL);

  /* Have we read the record? */
  if (!DBFLoadRecord(psDBF, hEntity))
    return NULL;
  pabyRec = (unsigned char *) psDBF->pszCurrentRecord;

  /* Ensure we have room to extract the target field. */
  if (psDBF->panFieldSize[iField] >= psDBF->nWorkFieldLength) {
    psDBF->nWorkFieldLength = psDBF->panFieldSize[iField] + 100;
    if (psDBF->pszWorkField == NULL)
      psDBF->pszWorkField = (char *) malloc(psDBF->nWorkFieldLength);
    else
      psDBF->pszWorkField = (char *) realloc(psDBF->pszWorkField,psDBF->nWorkFieldLength);
  }

  /* Extract the requested field. */
  strncpy(psDBF->pszWorkField,
          ((const char *) pabyRec) + psDBF->panFieldOffset[iField],
          psDBF->panFieldSize[iField]);
  psDBF->pszWorkField[psDBF->panFieldSize[iField]] = '\0';

  pReturnField = psDBF->pszWorkField;

  /* Decode the field. */
  if (chReqType == 'N') {
    psDBF->dfDoubleField = atof(psDBF->pszWorkField);
    pReturnField = &(psDBF->dfDoubleField);
  }

  /* Should we trim white space off the string attribute value? */
#ifdef TRIM_DBF_WHITESPACE
  else {
    char *pchSrc, *pchDst;

    pchDst = pchSrc = psDBF->pszWorkField;
    while (*pchSrc == ' ')
      pchSrc++;
    while (*pchSrc != '\0')
      *(pchDst++) = *(pchSrc++);
    *pchDst = '\0';
    while (pchDst != psDBF->pszWorkField && *(--pchDst) == ' ')
      *pchDst = '\0';
  }
#endif

  return (pReturnField);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movb %cl, %al
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movb %al, -0x19(%rbp)
movq $0x0, -0x30(%rbp)
cmpl $0x0, -0x14(%rbp)
jl 0x2a21
movl -0x14(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jl 0x2a2e
movq $0x0, -0x8(%rbp)
jmp 0x2c29
cmpl $0x0, -0x18(%rbp)
jl 0x2a40
movl -0x18(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x14(%rcx), %eax
jl 0x2a4d
movq $0x0, -0x8(%rbp)
jmp 0x2c29
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x31c0
cmpl $0x0, %eax
jne 0x2a6b
movq $0x0, -0x8(%rbp)
jmp 0x2c29
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x18(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movq -0x10(%rbp), %rcx
cmpl 0x50(%rcx), %eax
jl 0x2aef
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x18(%rbp), %rcx
movl (%rax,%rcx,4), %ecx
addl $0x64, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x50(%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x58(%rax)
jne 0x2acd
movq -0x10(%rbp), %rax
movslq 0x50(%rax), %rdi
callq 0x1140
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x58(%rax)
jmp 0x2aed
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rdi
movq -0x10(%rbp), %rax
movslq 0x50(%rax), %rsi
callq 0x1170
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x58(%rax)
jmp 0x2aef
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rdi
movq -0x28(%rbp), %rsi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x18(%rbp), %rcx
movslq (%rax,%rcx,4), %rax
addq %rax, %rsi
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x18(%rbp), %rcx
movslq (%rax,%rcx,4), %rdx
callq 0x1040
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x20(%rcx), %rcx
movslq -0x18(%rbp), %rdx
movslq (%rcx,%rdx,4), %rcx
movb $0x0, (%rax,%rcx)
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
movq %rax, -0x30(%rbp)
movsbl -0x19(%rbp), %eax
cmpl $0x4e, %eax
jne 0x2b7b
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rdi
callq 0x10a0
movq -0x10(%rbp), %rax
movsd %xmm0, 0x68(%rax)
movq -0x10(%rbp), %rax
addq $0x68, %rax
movq %rax, -0x30(%rbp)
jmp 0x2c21
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
movq %rax, -0x38(%rbp)
movq %rax, -0x40(%rbp)
movq -0x38(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x20, %eax
jne 0x2ba5
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x2b8b
jmp 0x2ba7
movq -0x38(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x2bd7
movq -0x38(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x38(%rbp)
movb (%rax), %cl
movq -0x40(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x40(%rbp)
movb %cl, (%rax)
jmp 0x2ba7
movq -0x40(%rbp), %rax
movb $0x0, (%rax)
movq -0x40(%rbp), %rcx
movq -0x10(%rbp), %rdx
xorl %eax, %eax
cmpq 0x58(%rdx), %rcx
movb %al, -0x41(%rbp)
je 0x2c0d
movq -0x40(%rbp), %rax
movq %rax, %rcx
addq $-0x1, %rcx
movq %rcx, -0x40(%rbp)
movsbl -0x1(%rax), %eax
cmpl $0x20, %eax
sete %al
movb %al, -0x41(%rbp)
movb -0x41(%rbp), %al
testb $0x1, %al
jne 0x2c16
jmp 0x2c1f
movq -0x40(%rbp), %rax
movb $0x0, (%rax)
jmp 0x2bde
jmp 0x2c21
movq -0x30(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)