user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<main>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  cmp    $0x3,%edi
  jle    L50
  mov    %edi,%r12d
  mov    0x10(%rsi),%rdi
  mov    %rsi,%rbx
  call   <mode_finder@plt>
  mov    0x8(%rbx),%rdi
  mov    %eax,%ebp
  call   <generate_forest@plt>
  mov    %rax,%r13
  cmp    $0x4,%ebp
  ja     L38
  lea    D50(%rip),%rdx
  movslq (%rdx,%rbp,4),%rax
  add    %rdx,%rax
  notrack jmp *%rax
L50:
  lea    D2(%rip),%rdi
  call   <printf@plt>
L38:
  add    $0x8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  mov    0x18(%rbx),%rdx
  push   %rdi
  xor    %r9d,%r9d
  mov    $0x1,%r8d
  push   $0x0
  xor    %ecx,%ecx
  mov    %r13,%rsi
  mov    $0x3,%edi
  call   <search_forest@plt>
  pop    %r8
  pop    %r9
  jmp    L38
  cmp    $0x5,%r12d
  je     L1
  lea    D42(%rip),%rdi
  call   <printf@plt>
  mov    $0x1,%edi
  call   <exit@plt>
L1:
  mov    0x20(%rbx),%rdi
  mov    $0xa,%edx
  xor    %esi,%esi
  call   <strtol@plt>
  mov    0x18(%rbx),%rdi
  mov    %eax,%ebp
  call   <operation_finder@plt>
  xor    %ecx,%ecx
  mov    %r13,%rsi
  mov    %ebp,%r9d
  push   %rdx
  mov    $0x1,%r8d
  lea    D33(%rip),%rdx
  mov    $0x4,%edi
  push   %rax
  call   <search_forest@plt>
  pop    %rcx
  pop    %rsi
  jmp    L38
  mov    0x18(%rbx),%rdx
  push   %rax
  xor    %r9d,%r9d
  mov    $0x1,%r8d
  push   $0x0
  xor    %ecx,%ecx
  mov    %r13,%rsi
  xor    %edi,%edi
  call   <search_forest@plt>
  pop    %rax
  pop    %rdx
  jmp    L38
  mov    0x18(%rbx),%rdi
  mov    $0xa,%edx
  xor    %esi,%esi
  call   <strtol@plt>
  push   %rbp
  mov    %r13,%rsi
  xor    %r9d,%r9d
  push   $0x0
  mov    %eax,%ecx
  mov    $0x1,%r8d
  mov    $0x1,%edi
  lea    D33(%rip),%rdx
  call   <search_forest@plt>
  pop    %r12
  pop    %r13
  jmp    L38
  mov    0x18(%rbx),%rdi
  call   <type_finder@plt>
  xor    %r9d,%r9d
  xor    %ecx,%ecx
  mov    %r13,%rsi
  push   %r10
  mov    %eax,%r8d
  mov    $0x2,%edi
  lea    D33(%rip),%rdx
  push   $0x0
  call   <search_forest@plt>
  pop    %r11
  pop    %rbx
  jmp    L38
```

tool_calls: name: retrieve_data
arguments: label: D2
data_type: string
name: retrieve_data
arguments: label: D42
data_type: string
name: retrieve_data
arguments: label: D33
data_type: string

tool: D2: Usage:
	search_forest DIRECTORY MODE {FILENAME/PERMS/FILETYPE/OPERATION} {SIZE_COMP}


tool: D42: Please enter an operation

tool: D33: null

assistant: ```c
int main(int argc, char **argv) {
  if (argc < 4) {
    printf("Usage:\n\tsearch_forest DIRECTORY MODE {FILENAME/PERMS/FILETYPE/OPERATION} {SIZE_COMP}\n");
    return 0;
  }
  int perms;
  int type;
  int size_comp;
  int operation;
  int mode = mode_finder(argv[2]);
  struct TreeNode *root = generate_forest(argv[1]);
  switch (mode) {
  case 0:
    search_forest(mode, root, argv[3], 0, 1, 0, 0);
    break;
  case 1:
    perms = strtol(argv[3], NULL, 10);
    search_forest(mode, root, "null", perms, 1, 0, 0);
    break;
  case 2:
    type = type_finder(argv[3]);
    search_forest(mode, root, "null", 0, type, 0, 0);
    break;
  case 3:
    search_forest(mode, root, argv[3], 0, 1, 0, 0);
    break;
  case 4:
    if (argc != 5) {
      printf("Please enter an operation");
      exit(1);
    }
    size_comp = strtol(argv[4], NULL, 10);
    operation = operation_finder(argv[3]);
    search_forest(mode, root, "null", 0, 1, size_comp, operation);
    break;
  }
  return 0;
}
```