user: What is the c source code of the assembly code below?

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rsi,%rbx
  sub    $0x8,%rsp
  cmp    $0x4,%edi
  jle    L64
  mov    %edi,%r12d
  mov    0x18(%rsi),%rdi
  mov    0x8(%rsi),%r13
  mov    0x10(%rsi),%r14
  call   <atoi@plt>
  mov    0x20(%rbx),%r8
  mov    %eax,%ebp
  cmp    $0x5,%r12d
  je     L88
  mov    0x28(%rbx),%rsi
L72:
  mov    %r13,%rdi
  mov    %r14,%rcx
  lea    D24(%rip),%rdx
  call   <issueQuery@plt>
  mov    %rax,%r13
  test   %rax,%rax
  je     L57
  lea    0x0(,%rbp,8),%r15d
  lea    D46(%rip),%r12
  nopl   0x0(%rax,%rax,1)
L96:
  mov    %r15d,%edi
  call   <malloc@plt>
  mov    %ebp,%esi
  mov    %r13,%rdi
  mov    %rax,%rdx
  mov    %rax,%rbx
  call   <fetchResultRow@plt>
  lea    D38(%rip),%rdi
  mov    %eax,%r14d
  mov    %eax,%esi
  xor    %eax,%eax
  call   <printf@plt>
  test   %r14d,%r14d
  jne    L67
  test   %ebp,%ebp
  jle    L96
  nopl   0x0(%rax)
L14:
  mov    (%rbx),%rdx
  mov    %r14d,%esi
  mov    %r12,%rdi
  xor    %eax,%eax
  add    $0x1,%r14d
  add    $0x8,%rbx
  call   <printf@plt>
  mov    -0x8(%rbx),%rdi
  call   <free@plt>
  cmp    %r14d,%ebp
  jne    L14
  jmp    L96
L88:
  xor    %esi,%esi
  jmp    L72
L67:
  xor    %eax,%eax
L59:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L64:
  mov    (%rsi),%rsi
  lea    D48(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    $0x1,%eax
  jmp    L59
L57:
  lea    D49(%rip),%rdi
  call   <puts@plt>
  mov    $0x1,%eax
  jmp    L59
```

tool_calls: name: read_data
arguments: tag: D24
type: string
name: read_data
arguments: tag: D46
type: string
name: read_data
arguments: tag: D38
type: string
name: read_data
arguments: tag: D48
type: string
name: read_data
arguments: tag: D49
type: string

tool: D24: presto

tool: D46: i=%d, value=%s


tool: D38: ============================== ret: %d ==================================


tool: D48: usage: %s apikey database num_of_select_col query [endpoint]


tool: D49: Failed to execute query

assistant: ```c
int main(int argc, char *argv[]) {
  int ret;
  char *apikey = NULL;
  char *database = NULL;
  int num_of_select_col;
  char *query = NULL;
  char *endpoint = NULL;
  void *td_query_state = NULL;
  char **values;
  if (argc < 5) {
    printf("usage: %s apikey database num_of_select_col query [endpoint]\n", argv[0]);
    return 1;
  }
  apikey = argv[1];
  database = argv[2];
  num_of_select_col = atoi(argv[3]);
  query = argv[4];
  if (argc >= 6) {
    endpoint = argv[5];
  }
  td_query_state = issueQuery(apikey, endpoint, "presto", database, query);
  if (td_query_state == NULL) {
    printf("Failed to execute query\n");
    return 1;
  }
  while (1) {
    int i;
    values = (char **)malloc(sizeof(char *) * num_of_select_col);
    ret = fetchResultRow(td_query_state, num_of_select_col, values);
    printf("============================== ret: %d ==================================\n", ret);
    if (ret != 0)
      break;
    for (i = 0; i < num_of_select_col; i++) {
      printf("i=%d, value=%s\n", i, values[i]);
      free(values[i]);
    }
  }
  return 0;
}
```