user: Converte this assembly snippet into its equivalent C code:

```asm
<_iSelProcessDirEF>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x150,%rsp
  mov    %edi,%eax
  mov    %al,-0x144(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movzbl -0x144(%rbp),%eax
  mov    $0xff,%ecx
  mov    $0x1,%edx
  mov    %eax,%esi
  mov    $0x1,%edi
  call   <vPushApduPrepare@plt>
  movb   $0x1,-0x13e(%rbp)
L87:
  movzbl -0x13e(%rbp),%esi
  movzbl -0x144(%rbp),%eax
  lea    -0x110(%rbp),%rcx
  lea    -0x13f(%rbp),%rdx
  mov    %eax,%edi
  call   <uiEmvCmdRdRec@plt>
  mov    %eax,-0x138(%rbp)
  cmpl   $0x1,-0x138(%rbp)
  jne    L1
  mov    $0xffffd507,%eax
  jmp    L177
L1:
  cmpl   $0x6a83,-0x138(%rbp)
  jne    L4
  cmpb   $0x1,-0x13e(%rbp)
  jne    L128
  mov    $0xffffd4fe,%eax
  jmp    L177
L128:
  mov    $0x0,%eax
  jmp    L177
L4:
  cmpl   $0x0,-0x138(%rbp)
  je     L104
  mov    $0xffffd506,%eax
  jmp    L177
L104:
  lea    -0x11a(%rbp),%rax
  lea    D14(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcpy@plt>
  movzbl -0x13f(%rbp),%eax
  movzbl %al,%esi
  lea    -0x128(%rbp),%rcx
  lea    -0x11a(%rbp),%rdx
  lea    -0x110(%rbp),%rax
  mov    %rcx,%r8
  mov    %rdx,%rcx
  mov    $0x0,%edx
  mov    %rax,%rdi
  call   <iTlvSearchObj@plt>
  mov    %eax,-0x134(%rbp)
  cmpl   $0xffffd8ee,-0x134(%rbp)
  jne    L28
  mov    $0xffffd4fc,%eax
  jmp    L177
L28:
  cmpl   $0xffffd8ec,-0x134(%rbp)
  jne    L124
  mov    $0xffffd4fc,%eax
  jmp    L177
L124:
  movl   $0x0,-0x13c(%rbp)
L149:
  lea    -0x11a(%rbp),%rax
  lea    D1(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcpy@plt>
  movzbl -0x13f(%rbp),%eax
  movzbl %al,%esi
  lea    -0x130(%rbp),%rdi
  lea    -0x11a(%rbp),%rcx
  mov    -0x13c(%rbp),%edx
  lea    -0x110(%rbp),%rax
  mov    %rdi,%r8
  mov    %rax,%rdi
  call   <iTlvSearchObj@plt>
  mov    %eax,-0x134(%rbp)
  cmpl   $0xffffd8ee,-0x134(%rbp)
  jne    L114
  mov    $0xffffd4fc,%eax
  jmp    L177
L114:
  cmpl   $0xffffd8ec,-0x134(%rbp)
  je     L2
  mov    -0x134(%rbp),%eax
  mov    %al,-0x13d(%rbp)
  movzbl -0x13d(%rbp),%edx
  mov    -0x130(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <_iSelProcessTlvObj61@plt>
  mov    %eax,-0x134(%rbp)
  cmpl   $0x0,-0x134(%rbp)
  jns    L105
  mov    -0x134(%rbp),%eax
  jmp    L177
L105:
  addl   $0x1,-0x13c(%rbp)
  jmp    L149
L2:
  nop
  movzbl -0x13e(%rbp),%eax
  add    $0x1,%eax
  mov    %al,-0x13e(%rbp)
  jmp    L87
L177:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L180
  call   <__stack_chk_fail@plt>
L180:
  leave
  ret
```

tool_calls: name: read_data
arguments: label: D14
data_type: string
name: read_data
arguments: label: D1
data_type: string

tool: D14: p

tool: D1: pa

assistant: ```c
int _iSelProcessDirEF(unsigned char ucSFI) {
  unsigned char sRec[254];
  unsigned char ucRecNo;
  unsigned char ucRecLen;
  unsigned int uiIndex;
  unsigned char *psTlvObj61, ucTlvObj61Len;
  unsigned char *p;
  unsigned char sTagRoute[10];
  unsigned int uiRet;
  int iRet;
  vPushApduPrepare(1, ucSFI, 1, 255);
  for (ucRecNo = 1;; ucRecNo++) {
    uiRet = uiEmvCmdRdRec(ucSFI, ucRecNo, &ucRecLen, sRec);
    if (uiRet == 1)
      return (-11001);
    if (uiRet == 0x6a83) {
      if (ucRecNo == 1)
        return (-11010);
      return (0);
    }
    if (uiRet)
      return (-11002);
    strcpy(sTagRoute, "\x70");
    iRet = iTlvSearchObj(sRec, (int)ucRecLen, 0, sTagRoute, &p);
    if (iRet == -10002)
      return (-11012);
    if (iRet == -10004)
      return (-11012);
    for (uiIndex = 0;; uiIndex++) {
      strcpy(sTagRoute, "\x70"
                        "\x61");
      iRet = iTlvSearchObj(sRec, (int)ucRecLen, uiIndex, sTagRoute, &psTlvObj61);
      if (iRet == -10002)
        return (-11012);
      if (iRet == -10004)
        break;
      ucTlvObj61Len = (unsigned char)iRet;
      iRet = _iSelProcessTlvObj61(psTlvObj61, ucTlvObj61Len);
      if (iRet < 0)
        return (iRet);
    }
  }
  return (0);
}
```