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

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x38,%rsp
  mov    %edi,%r13d
  mov    %rsi,%r14
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  call   <get_jt_path@plt>
  mov    %rax,-0x48(%rbp)
  mov    $0x0,%eax
  call   <get_java_bin_path@plt>
  mov    %rax,-0x50(%rbp)
  cmp    $0x1,%r13d
  jle    L177
  lea    0x8(%r14),%rbx
  lea    -0x2(%r13),%eax
  lea    0x10(%r14,%rax,8),%r15
  mov    $0x0,%r12d
L34:
  mov    (%rbx),%rdi
  call   <strlen@plt>
  add    %eax,%r12d
  add    $0x8,%rbx
  cmp    %r15,%rbx
  jne    L34
L64:
  add    %r13d,%r12d
  mov    -0x48(%rbp),%rax
  test   %rax,%rax
  je     L201
  mov    %rax,%rdi
  call   <strlen@plt>
  add    %eax,%r12d
L201:
  mov    -0x50(%rbp),%rbx
  test   %rbx,%rbx
  je     L25
  mov    %rbx,%rdi
  call   <strlen@plt>
  lea    0x1e(%r12,%rax,1),%edi
  call   <alloca@plt>
  mov    %rax,%r15
  mov    %rax,-0x58(%rbp)
  mov    %rbx,%rdx
  lea    D107(%rip),%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  cltq
  add    %r15,%rax
  mov    %rax,-0x50(%rbp)
  mov    %rbx,%rdi
  call   <free@plt>
L163:
  mov    -0x48(%rbp),%rbx
  test   %rbx,%rbx
  je     L198
  mov    %rbx,%rdx
  lea    D40(%rip),%rsi
  mov    -0x50(%rbp),%r15
  mov    %r15,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  cltq
  add    %r15,%rax
  mov    %rax,-0x48(%rbp)
  mov    %rbx,%rdi
  call   <free@plt>
L85:
  mov    $0x1,%ebx
  lea    D2(%rip),%r15
  cmp    $0x1,%r13d
  jg     L146
  mov    -0x58(%rbp),%rdi
  call   <system@plt>
  test   %eax,%eax
  jne    L134
  lea    D37(%rip),%rdx
  lea    D121(%rip),%rsi
  mov    -0x50(%rbp),%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
L19:
  mov    -0x58(%rbp),%rdi
  call   <system@plt>
L134:
  mov    -0x38(%rbp),%rdx
  sub    %fs:0x28,%rdx
  jne    L180
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
L177:
  mov    $0x0,%r12d
  jmp    L64
L198:
  lea    D84(%rip),%rsi
  mov    $0xd,%ecx
  mov    -0x50(%rbp),%rdi
  rep movsb %ds:(%rsi),%es:(%rdi)
  mov    -0x50(%rbp),%rdi
  lea    0xc(%rdi),%rax
  mov    %rax,-0x48(%rbp)
  jmp    L85
L170:
  add    $0x1,%ebx
L95:
  add    $0x1,%ebx
  cmp    %ebx,%r13d
  jle    L204
L146:
  movslq %ebx,%rax
  mov    (%r14,%rax,8),%r12
  mov    %r15,%rsi
  mov    %r12,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L170
  mov    $0x20,%esi
  mov    %r12,%rdi
  call   <strchr@plt>
  test   %rax,%rax
  lea    D50(%rip),%rsi
  lea    D120(%rip),%rax
  cmovne %rax,%rsi
  mov    %r12,%rdx
  mov    -0x48(%rbp),%r12
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  cltq
  add    %rax,%r12
  mov    %r12,-0x48(%rbp)
  jmp    L95
L3:
  lea    D29(%rip),%rsi
  mov    %r12,%rdi
  call   <strstr@plt>
  cmp    %rax,%r12
  je     L196
  mov    %r12,%rdx
  lea    D121(%rip),%rsi
  mov    -0x48(%rbp),%r12
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  cltq
  add    %rax,%r12
  mov    %r12,-0x48(%rbp)
L137:
  add    $0x1,%ebx
  cmp    %ebx,%r13d
  jle    L19
L70:
  movslq %ebx,%rax
  mov    (%r14,%rax,8),%r12
  mov    %r15,%rsi
  mov    %r12,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L3
  add    $0x1,%ebx
  jmp    L137
L196:
  lea    D123(%rip),%rsi
  mov    %r12,%rdi
  call   <strstr@plt>
  cmp    %rax,%r12
  je     L103
  lea    D41(%rip),%rsi
  mov    %r12,%rdi
  call   <strstr@plt>
  cmp    %rax,%r12
  jne    L137
L103:
  add    $0x1,%ebx
  jmp    L137
L204:
  mov    -0x58(%rbp),%rdi
  call   <system@plt>
  test   %eax,%eax
  jne    L134
  lea    D37(%rip),%rdx
  lea    D121(%rip),%rsi
  mov    -0x50(%rbp),%rbx
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  mov    %rbx,%rax
  add    $0x6,%rax
  mov    %rax,-0x48(%rbp)
  mov    $0x1,%ebx
  lea    D2(%rip),%r15
  jmp    L70
L25:
  lea    0x1e(%r12),%edi
  call   <alloca@plt>
  mov    %rax,-0x50(%rbp)
  mov    %rax,-0x58(%rbp)
  jmp    L163
L180:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_label: D107
data_type: string
name: read_data
arguments: data_label: D40
data_type: string
name: read_data
arguments: data_label: D2
data_type: string
name: read_data
arguments: data_label: D37
data_type: string
name: read_data
arguments: data_label: D121
data_type: string
name: read_data
arguments: data_label: D84
data_type: string
name: read_data
arguments: data_label: D50
data_type: string
name: read_data
arguments: data_label: D120
data_type: string
name: read_data
arguments: data_label: D29
data_type: string
name: read_data
arguments: data_label: D123
data_type: string
name: read_data
arguments: data_label: D41
data_type: string

tool: D107: %s

tool: D40: java -cp %s jt.Proc

tool: D2: -JTPATH

tool: D37: javac

tool: D121: %s 

tool: D84: java jt.Proc

tool: D50:  %s

tool: D120:  "%s"

tool: D29: -jt.

tool: D123: -jt.include

tool: D41: -jt.sourcepath

assistant: ```c
int main(int argc, char **argv) {
  int i, len = 0, err;
  char *cmd_line, *pp, *pa, *jt_path, *java_bin_path;
  jt_path = get_jt_path(argc, argv);
  java_bin_path = get_java_bin_path();
  for (i = 1; i < argc; i++) {
    len += strlen(argv[i]);
  }
  len += argc;
  if (jt_path) {
    len += strlen(jt_path);
  }
  if (java_bin_path) {
    len += strlen(java_bin_path);
  }
  len += 30;
  cmd_line = (char *)alloca(len);
  if (java_bin_path) {
    pp = cmd_line + sprintf(cmd_line, "%s", java_bin_path);
    free(java_bin_path);
  } else {
    pp = cmd_line;
  }
  if (jt_path) {
    pa = pp + sprintf(pp, "java -cp %s jt.Proc", jt_path);
    free(jt_path);
  } else {
    pa = pp + sprintf(pp, "java jt.Proc");
  }
  for (i = 1; i < argc; i++) {
    char *arg = argv[i];
    if (0 == strcmp(arg, "-JTPATH"))
      i++;
    else
      pa += sprintf(pa, (strchr(arg, ' ') ? " \"%s\"" : " %s"), arg);
  };
  if (0 != (err = system(cmd_line))) {
    ;
    return err;
  }
  pa = pp + sprintf(pp, "%s ", "javac");
  for (i = 1; i < argc; i++) {
    char *arg = argv[i];
    if (0 == strcmp(arg, "-JTPATH")) {
      i++;
    } else if (arg == strstr(arg, "-jt.")) {
      if (arg == strstr(arg, "-jt.include") || arg == strstr(arg, "-jt.sourcepath"))
        i++;
    } else {
      pa += sprintf(pa, "%s ", arg);
    }
  };
  if (0 != (err = system(cmd_line))) {
    ;
    return err;
  }
  return 0;
}
```