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

```asm
<smm_config_path>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %edi,-0x14(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %rdx,-0x28(%rbp)
  mov    %rcx,-0x30(%rbp)
  mov    %r8d,-0x18(%rbp)
  movl   $0x0,-0xc(%rbp)
  lea    D108(%rip),%rax
  mov    %rax,%rdi
  call   <getenv@plt>
  mov    %rax,-0x8(%rbp)
  cmpl   $0x2,-0x14(%rbp)
  je     L8
  cmpl   $0x2,-0x14(%rbp)
  jg     L112
  cmpl   $0x0,-0x14(%rbp)
  je     L88
  cmpl   $0x1,-0x14(%rbp)
  jne    L112
  cmpq   $0x0,-0x8(%rbp)
  je     L74
  mov    -0x8(%rbp),%rdx
  lea    -0x18(%rbp),%rcx
  lea    -0x30(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <mem_copy@plt>
  mov    %eax,%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0xc(%rbp)
  lea    -0x18(%rbp),%rcx
  lea    -0x30(%rbp),%rax
  lea    D27(%rip),%rdx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <mem_copy@plt>
  mov    %eax,%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0xc(%rbp)
L74:
  cmpq   $0x0,-0x20(%rbp)
  je     L99
  mov    -0x20(%rbp),%rdx
  lea    -0x18(%rbp),%rcx
  lea    -0x30(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <mem_copy@plt>
  mov    %eax,%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0xc(%rbp)
  lea    -0x18(%rbp),%rcx
  lea    -0x30(%rbp),%rax
  lea    D27(%rip),%rdx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <mem_copy@plt>
  mov    %eax,%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0xc(%rbp)
L99:
  mov    -0x28(%rbp),%rdx
  lea    -0x18(%rbp),%rcx
  lea    -0x30(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <mem_copy@plt>
  mov    %eax,%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0xc(%rbp)
  lea    -0x18(%rbp),%rcx
  lea    -0x30(%rbp),%rax
  mov    $0x0,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <mem_copy@plt>
  mov    %eax,%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0xc(%rbp)
  lea    -0x18(%rbp),%rcx
  lea    -0x30(%rbp),%rax
  lea    D45(%rip),%rdx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <mem_copy@plt>
  mov    %eax,%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0xc(%rbp)
  cmpq   $0x0,-0x20(%rbp)
  je     L130
  mov    -0x20(%rbp),%rdx
  lea    -0x18(%rbp),%rcx
  lea    -0x30(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <mem_copy@plt>
  mov    %eax,%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0xc(%rbp)
L130:
  lea    -0x18(%rbp),%rcx
  lea    -0x30(%rbp),%rax
  mov    $0x0,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <mem_copy@plt>
  mov    %eax,%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0xc(%rbp)
  lea    -0x18(%rbp),%rcx
  lea    -0x30(%rbp),%rax
  lea    D73(%rip),%rdx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <mem_copy@plt>
  mov    %eax,%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0xc(%rbp)
  lea    -0x18(%rbp),%rcx
  lea    -0x30(%rbp),%rax
  mov    $0x0,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <mem_copy@plt>
  mov    %eax,%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0xc(%rbp)
  jmp    L85
L8:
  lea    -0x18(%rbp),%rcx
  lea    -0x30(%rbp),%rax
  lea    D11(%rip),%rdx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <mem_copy@plt>
  mov    %eax,%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0xc(%rbp)
  cmpq   $0x0,-0x20(%rbp)
  je     L64
  mov    -0x20(%rbp),%rdx
  lea    -0x18(%rbp),%rcx
  lea    -0x30(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <mem_copy@plt>
  mov    %eax,%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0xc(%rbp)
  lea    -0x18(%rbp),%rcx
  lea    -0x30(%rbp),%rax
  lea    D27(%rip),%rdx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <mem_copy@plt>
  mov    %eax,%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0xc(%rbp)
L64:
  mov    -0x28(%rbp),%rdx
  lea    -0x18(%rbp),%rcx
  lea    -0x30(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <mem_copy@plt>
  mov    %eax,%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0xc(%rbp)
  lea    -0x18(%rbp),%rcx
  lea    -0x30(%rbp),%rax
  mov    $0x0,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <mem_copy@plt>
  mov    %eax,%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0xc(%rbp)
  lea    -0x18(%rbp),%rcx
  lea    -0x30(%rbp),%rax
  lea    D40(%rip),%rdx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <mem_copy@plt>
  mov    %eax,%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0xc(%rbp)
  cmpq   $0x0,-0x20(%rbp)
  je     L142
  mov    -0x20(%rbp),%rdx
  lea    -0x18(%rbp),%rcx
  lea    -0x30(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <mem_copy@plt>
  mov    %eax,%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0xc(%rbp)
L142:
  lea    -0x18(%rbp),%rcx
  lea    -0x30(%rbp),%rax
  mov    $0x0,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <mem_copy@plt>
  mov    %eax,%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0xc(%rbp)
  lea    -0x18(%rbp),%rcx
  lea    -0x30(%rbp),%rax
  lea    D63(%rip),%rdx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <mem_copy@plt>
  mov    %eax,%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0xc(%rbp)
  lea    -0x18(%rbp),%rcx
  lea    -0x30(%rbp),%rax
  mov    $0x0,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <mem_copy@plt>
  mov    %eax,%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0xc(%rbp)
  jmp    L85
L88:
  cmpq   $0x0,-0x8(%rbp)
  je     L52
  mov    -0x8(%rbp),%rdx
  lea    -0x18(%rbp),%rcx
  lea    -0x30(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <mem_copy@plt>
  mov    %eax,%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0xc(%rbp)
  lea    -0x18(%rbp),%rcx
  lea    -0x30(%rbp),%rax
  lea    D27(%rip),%rdx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <mem_copy@plt>
  mov    %eax,%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0xc(%rbp)
L52:
  lea    -0x18(%rbp),%rcx
  lea    -0x30(%rbp),%rax
  lea    D10(%rip),%rdx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <mem_copy@plt>
  mov    %eax,%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0xc(%rbp)
  cmpq   $0x0,-0x20(%rbp)
  je     L28
  mov    -0x20(%rbp),%rdx
  lea    -0x18(%rbp),%rcx
  lea    -0x30(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <mem_copy@plt>
  mov    %eax,%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0xc(%rbp)
  lea    -0x18(%rbp),%rcx
  lea    -0x30(%rbp),%rax
  lea    D27(%rip),%rdx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <mem_copy@plt>
  mov    %eax,%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0xc(%rbp)
L28:
  mov    -0x28(%rbp),%rdx
  lea    -0x18(%rbp),%rcx
  lea    -0x30(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <mem_copy@plt>
  mov    %eax,%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0xc(%rbp)
  lea    -0x18(%rbp),%rcx
  lea    -0x30(%rbp),%rax
  mov    $0x0,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <mem_copy@plt>
  mov    %eax,%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0xc(%rbp)
  lea    -0x18(%rbp),%rcx
  lea    -0x30(%rbp),%rax
  lea    D40(%rip),%rdx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <mem_copy@plt>
  mov    %eax,%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0xc(%rbp)
  cmpq   $0x0,-0x20(%rbp)
  je     L26
  mov    -0x20(%rbp),%rdx
  lea    -0x18(%rbp),%rcx
  lea    -0x30(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <mem_copy@plt>
  mov    %eax,%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0xc(%rbp)
L26:
  lea    -0x18(%rbp),%rcx
  lea    -0x30(%rbp),%rax
  mov    $0x0,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <mem_copy@plt>
  mov    %eax,%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0xc(%rbp)
  lea    -0x18(%rbp),%rcx
  lea    -0x30(%rbp),%rax
  lea    D73(%rip),%rdx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <mem_copy@plt>
  mov    %eax,%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0xc(%rbp)
  lea    -0x18(%rbp),%rcx
  lea    -0x30(%rbp),%rax
  mov    $0x0,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <mem_copy@plt>
  mov    %eax,%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0xc(%rbp)
  jmp    L85
L112:
  cmpq   $0x0,-0x20(%rbp)
  je     L55
  mov    -0x20(%rbp),%rdx
  lea    -0x18(%rbp),%rcx
  lea    -0x30(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <mem_copy@plt>
  mov    %eax,%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0xc(%rbp)
  lea    -0x18(%rbp),%rcx
  lea    -0x30(%rbp),%rax
  lea    D27(%rip),%rdx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <mem_copy@plt>
  mov    %eax,%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0xc(%rbp)
L55:
  mov    -0x28(%rbp),%rdx
  lea    -0x18(%rbp),%rcx
  lea    -0x30(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <mem_copy@plt>
  mov    %eax,%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0xc(%rbp)
  lea    -0x18(%rbp),%rcx
  lea    -0x30(%rbp),%rax
  mov    $0x0,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <mem_copy@plt>
  mov    %eax,%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0xc(%rbp)
  lea    -0x18(%rbp),%rcx
  lea    -0x30(%rbp),%rax
  mov    $0x0,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <mem_copy@plt>
  mov    %eax,%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0xc(%rbp)
  lea    -0x18(%rbp),%rcx
  lea    -0x30(%rbp),%rax
  mov    $0x0,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <mem_copy@plt>
  mov    %eax,%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0xc(%rbp)
  nop
L85:
  lea    -0x18(%rbp),%rcx
  lea    -0x30(%rbp),%rax
  mov    $0x0,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <mem_copy@plt>
  mov    %eax,%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0xc(%rbp)
  mov    -0xc(%rbp),%eax
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: tag: D108
type_infered: string
name: disassemble_data
arguments: tag: D27
type_infered: string
name: disassemble_data
arguments: tag: D45
type_infered: string
name: disassemble_data
arguments: tag: D73
type_infered: string
name: disassemble_data
arguments: tag: D11
type_infered: string
name: disassemble_data
arguments: tag: D40
type_infered: string
name: disassemble_data
arguments: tag: D63
type_infered: string
name: disassemble_data
arguments: tag: D10
type_infered: string

tool: D108: HOME

tool: D27: /

tool: D45: CONSOLE\

tool: D73: HKEY_CURRENT_USER

tool: D11: /etc/

tool: D40: SOFTWARE\

tool: D63: HKEY_LOCAL_MACHINE

tool: D10: .config/

assistant: ```c
int smm_config_path(int sysdir, char *path, char *fname, char *buf, int blen) {
  char *home;
  int len = 0;
  home = getenv("HOME");
  switch (sysdir) {
  case 1:
    if (home) {
      len += mem_copy(&buf, &blen, home);
      len += mem_copy(&buf, &blen, "/");
    }
    if (path) {
      len += mem_copy(&buf, &blen, path);
      len += mem_copy(&buf, &blen, "/");
    }
    len += mem_copy(&buf, &blen, fname);
    len += mem_copy(&buf, &blen, NULL);
    len += mem_copy(&buf, &blen, "CONSOLE\\");
    if (path) {
      len += mem_copy(&buf, &blen, path);
    }
    len += mem_copy(&buf, &blen, NULL);
    len += mem_copy(&buf, &blen, "HKEY_CURRENT_USER");
    len += mem_copy(&buf, &blen, NULL);
    break;
  case 2:
    len += mem_copy(&buf, &blen, "/etc/");
    if (path) {
      len += mem_copy(&buf, &blen, path);
      len += mem_copy(&buf, &blen, "/");
    }
    len += mem_copy(&buf, &blen, fname);
    len += mem_copy(&buf, &blen, NULL);
    len += mem_copy(&buf, &blen, "SOFTWARE\\");
    if (path) {
      len += mem_copy(&buf, &blen, path);
    }
    len += mem_copy(&buf, &blen, NULL);
    len += mem_copy(&buf, &blen, "HKEY_LOCAL_MACHINE");
    len += mem_copy(&buf, &blen, NULL);
    break;
  case 0:
    if (home) {
      len += mem_copy(&buf, &blen, home);
      len += mem_copy(&buf, &blen, "/");
    }
    len += mem_copy(&buf, &blen, ".config/");
    if (path) {
      len += mem_copy(&buf, &blen, path);
      len += mem_copy(&buf, &blen, "/");
    }
    len += mem_copy(&buf, &blen, fname);
    len += mem_copy(&buf, &blen, NULL);
    len += mem_copy(&buf, &blen, "SOFTWARE\\");
    if (path) {
      len += mem_copy(&buf, &blen, path);
    }
    len += mem_copy(&buf, &blen, NULL);
    len += mem_copy(&buf, &blen, "HKEY_CURRENT_USER");
    len += mem_copy(&buf, &blen, NULL);
    break;
  case 3:
  default:
    if (path) {
      len += mem_copy(&buf, &blen, path);
      len += mem_copy(&buf, &blen, "/");
    }
    len += mem_copy(&buf, &blen, fname);
    len += mem_copy(&buf, &blen, NULL);
    len += mem_copy(&buf, &blen, NULL);
    len += mem_copy(&buf, &blen, NULL);
    break;
  }
  len += mem_copy(&buf, &blen, NULL);
  return len;
}
```