user: Please show me the C implementation that matches the assembly code listed below:

```asm
<read_int>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x60,%rsp
  mov    %rdi,%rbp
  mov    %rsi,%rbx
  mov    %rdx,%r12
  mov    %fs:0x28,%rax
  mov    %rax,0x58(%rsp)
  xor    %eax,%eax
  test   %rsi,%rsi
  je     L43
L56:
  test   %rbp,%rbp
  je     L1
L33:
  test   %r12,%r12
  je     L8
L49:
  cmpb   $0x2a,(%rbx)
  je     L102
  mov    %rbx,%rsi
  mov    %rbp,%rdi
  call   <find_string@plt>
  mov    %rax,%rdi
L90:
  mov    %r12,%rdx
  lea    D26(%rip),%rsi
  call   <sscanf@plt>
  test   %rax,%rax
  je     L31
L68:
  mov    0x58(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L35
  add    $0x60,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L43:
  lea    D74(%rip),%rdx
  lea    D94(%rip),%rsi
  mov    $0xb5,%edi
  call   <errhandler@plt>
  jmp    L56
L1:
  lea    D93(%rip),%rdx
  lea    D94(%rip),%rsi
  mov    $0xb6,%edi
  call   <errhandler@plt>
  jmp    L33
L8:
  lea    D38(%rip),%rdx
  lea    D94(%rip),%rsi
  mov    $0xb7,%edi
  call   <errhandler@plt>
  jmp    L49
L102:
  lea    0x1(%rbx),%rsi
  mov    %rbp,%rdi
  call   <find_string@plt>
  mov    %rax,%rdi
  jmp    L90
L31:
  mov    %rsp,%r12
  mov    %rbx,%r8
  mov    %rbp,%rcx
  lea    D70(%rip),%rdx
  lea    D15(%rip),%rsi
  mov    %r12,%rdi
  call   <sprintf@plt>
  mov    %r12,%rdx
  lea    D94(%rip),%rsi
  mov    $0xbf,%edi
  call   <errhandler@plt>
  jmp    L68
L35:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: label: D26
type: string
name: retrieve_data
arguments: label: D74
type: string
name: retrieve_data
arguments: label: D94
type: string
name: retrieve_data
arguments: label: D93
type: string
name: retrieve_data
arguments: label: D38
type: string
name: retrieve_data
arguments: label: D70
type: string
name: retrieve_data
arguments: label: D15
type: string

tool: D26: %d

tool: D74: null pointer given as varable name

tool: D94: /scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/grantathon/computational_fluid_dynamics/refs/heads/master/03_assignment/helper.c

tool: D93: null pointer given as filename

tool: D38: null pointer given as variable

tool: D70: wrong format

tool: D15:  %s  File: %s   Variable: %s 

assistant: ```c
void read_int(const char *szFileName, const char *szVarName, int *pVariable) {
  char *szValue = NULL;
  if (szVarName == 0)
    errhandler(181, "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/grantathon/computational_fluid_dynamics/refs/heads/master/03_assignment/helper.c", "null pointer given as varable name");
  if (szFileName == 0)
    errhandler(182, "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/grantathon/computational_fluid_dynamics/refs/heads/master/03_assignment/helper.c", "null pointer given as filename");
  if (pVariable == 0)
    errhandler(183, "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/grantathon/computational_fluid_dynamics/refs/heads/master/03_assignment/helper.c", "null pointer given as variable");
  if (szVarName[0] == '*')
    szValue = find_string(szFileName, szVarName + 1);
  else
    szValue = find_string(szFileName, szVarName);
  if (sscanf(szValue, "%d", pVariable) == 0) {
    char szTmp[80];
    if (0)
      sprintf(szTmp, " %s  File: %s   Variable: %s  Line: %d", "wrong format", szFileName, szVarName, 0);
    else
      sprintf(szTmp, " %s  File: %s   Variable: %s ", "wrong format", szFileName, szVarName);
    errhandler(191, "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/grantathon/computational_fluid_dynamics/refs/heads/master/03_assignment/helper.c", szTmp);
  };
}
```