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

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %edi,-0x14(%rbp)
  mov    %rsi,-0x20(%rbp)
  movl   $0x0,-0x4(%rbp)
  mov    $0x0,%eax
  call   <geteuid@plt>
  mov    %eax,%edi
  call   <setuid@plt>
  cmpl   $0x1,-0x14(%rbp)
  jle    L193
  mov    -0x20(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rax
  lea    D90(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcasecmp@plt>
  test   %eax,%eax
  jne    L193
  lea    D320(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    D170(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    $0x0,%eax
  call   <ShowVersion@plt>
  mov    $0x0,%eax
  jmp    L27
L193:
  cmpl   $0x1,-0x14(%rbp)
  jle    L64
  mov    -0x20(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rax
  lea    D189(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcasecmp@plt>
  test   %eax,%eax
  jne    L64
  lea    D320(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    D170(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    $0x0,%eax
  call   <ShowEnv@plt>
  mov    $0x0,%eax
  jmp    L27
L64:
  cmpl   $0x1,-0x14(%rbp)
  jle    L180
  mov    -0x20(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rax
  lea    D204(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcasecmp@plt>
  test   %eax,%eax
  jne    L180
  movl   $0x0,-0xc(%rbp)
  jmp    L206
L180:
  movl   $0x1,-0xc(%rbp)
L206:
  cmpl   $0x1,-0x14(%rbp)
  jle    L241
  mov    -0x20(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rax
  lea    D99(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcasecmp@plt>
  test   %eax,%eax
  jne    L241
  cmpl   $0x2,-0x14(%rbp)
  jle    L247
  mov    -0x20(%rbp),%rax
  add    $0x10,%rax
  mov    (%rax),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L247
  movl   $0x2,-0x8(%rbp)
  jmp    L252
L247:
  movl   $0x1,-0x8(%rbp)
  jmp    L252
L241:
  movl   $0x0,-0x8(%rbp)
L252:
  cmpl   $0x1,-0x14(%rbp)
  jle    L186
  mov    -0x20(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rax
  lea    D31(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcasecmp@plt>
  test   %eax,%eax
  jne    L186
  cmpl   $0x2,-0x14(%rbp)
  jle    L106
  mov    -0x20(%rbp),%rax
  add    $0x10,%rax
  mov    (%rax),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L106
  movl   $0x2,-0x4(%rbp)
  jmp    L143
L106:
  movl   $0x1,-0x4(%rbp)
  jmp    L143
L186:
  movl   $0x0,-0x4(%rbp)
L143:
  lea    D320(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    D170(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  cmpl   $0x1,-0x8(%rbp)
  jne    L249
  mov    $0x0,%eax
  call   <UpdateAllRefs@plt>
  lea    D203(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    D136(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    $0x0,%eax
  call   <ShowAllRefs@plt>
  lea    D234(%rip),%rax
  mov    %rax,%rsi
  lea    D199(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    D152(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  jmp    L65
L249:
  cmpl   $0x2,-0x8(%rbp)
  jne    L220
  mov    -0x20(%rbp),%rax
  add    $0x10,%rax
  mov    (%rax),%rax
  mov    %rax,%rdi
  call   <UpdateRefs@plt>
  lea    D148(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    D310(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    -0x20(%rbp),%rax
  add    $0x10,%rax
  mov    (%rax),%rax
  mov    %rax,%rdi
  call   <ShowRefs@plt>
  lea    D234(%rip),%rax
  mov    %rax,%rsi
  lea    D199(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    D152(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  jmp    L65
L220:
  cmpl   $0x1,-0x4(%rbp)
  jne    L99
  lea    D46(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    D151(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    $0x0,%eax
  call   <ShowAllRefs@plt>
  lea    D295(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    D234(%rip),%rax
  mov    %rax,%rsi
  lea    D199(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    D152(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  jmp    L65
L99:
  cmpl   $0x2,-0x4(%rbp)
  jne    L215
  lea    D29(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    D137(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    -0x20(%rbp),%rax
  add    $0x10,%rax
  mov    (%rax),%rax
  mov    %rax,%rdi
  call   <ShowRefs@plt>
  lea    D229(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    -0x20(%rbp),%rax
  add    $0x10,%rax
  mov    (%rax),%rax
  mov    %rax,%rsi
  lea    D80(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    D295(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    D234(%rip),%rax
  mov    %rax,%rsi
  lea    D199(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    D152(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  jmp    L65
L215:
  mov    -0xc(%rbp),%eax
  mov    %eax,%edi
  call   <ShowStats@plt>
L65:
  mov    $0x0,%eax
L27:
  leave
  ret
```

tool_calls: name: read_data
arguments: label: D90
type_infered: string
name: read_data
arguments: label: D320
type_infered: string
name: read_data
arguments: label: D170
type_infered: string
name: read_data
arguments: label: D189
type_infered: string
name: read_data
arguments: label: D204
type_infered: string
name: read_data
arguments: label: D99
type_infered: string
name: read_data
arguments: label: D31
type_infered: string
name: read_data
arguments: label: D203
type_infered: string
name: read_data
arguments: label: D136
type_infered: string
name: read_data
arguments: label: D234
type_infered: string
name: read_data
arguments: label: D199
type_infered: string
name: read_data
arguments: label: D152
type_infered: string
name: read_data
arguments: label: D148
type_infered: string
name: read_data
arguments: label: D310
type_infered: string
name: read_data
arguments: label: D46
type_infered: string
name: read_data
arguments: label: D151
type_infered: string
name: read_data
arguments: label: D295
type_infered: string
name: read_data
arguments: label: D29
type_infered: string
name: read_data
arguments: label: D137
type_infered: string
name: read_data
arguments: label: D229
type_infered: string
name: read_data
arguments: label: D80
type_infered: string

tool: D90: version

tool: D320: Content-type: text/html

tool: 

tool: D189: env

tool: D204: text

tool: D99: ref_update

tool: D31: ref_show

tool: D203: <html><head><title>Finished Updating All URL Ref Pages</title></head>

tool: D136: <body><center><h1>Finished Updating All URL Ref Pages</h1></center>

tool: D234: http://www.io.org/~rasmus/phpl.cgi?pages/phptools.html

tool: D199: <hr><font size=-1><i><a href="%s">PHP Tools</a> Copyright &copy 1995 Rasmus Lerdorf</i></font><br>


tool: D152: </body></html>

tool: D148: <html><head><title>Finished Updating Ref Page</title></head>

tool: D310: <body><center><h1>Finished Updating Ref Page</h1></center>

tool: D46: <html><head><title>Referring URL List for All Pages</title></head>

tool: D151: <body><center><h1>Referring URL List for All Pages</h1></center>

tool: D295: <a href="phplmon.cgi?ref_update">Update Reference URL's for All pages</a><br>

tool: D29: <html><head><title>Referring URL List</title></head>

tool: D137: <body><center><h1>Referring URL List</h1></center>

tool: D229: <a href="phplmon.cgi?ref_show">Show Reference URL's for All pages</a><br>

tool: D80: <a href="phplmon.cgi?ref_update+%s">Update Reference URL's for this page</a><br>


assistant: ```c
int main(int argc, char *argv[]) {
  int fancy;
  int ref;
  int show = 0;
  setuid(geteuid());
  if (argc > 1 && !strcasecmp(argv[1], "version")) {
    puts("Content-type: text/html");
    puts("");
    ShowVersion();
    return (0);
  }
  if (argc > 1 && !strcasecmp(argv[1], "env")) {
    puts("Content-type: text/html");
    puts("");
    ShowEnv();
    return (0);
  }
  if (argc > 1 && !strcasecmp(argv[1], "text"))
    fancy = 0;
  else
    fancy = 1;
  if (argc > 1 && !strcasecmp(argv[1], "ref_update")) {
    if (argc > 2 && strlen(argv[2]))
      ref = 2;
    else
      ref = 1;
  } else
    ref = 0;
  if (argc > 1 && !strcasecmp(argv[1], "ref_show")) {
    if (argc > 2 && strlen(argv[2]))
      show = 2;
    else
      show = 1;
  } else
    show = 0;
  puts("Content-type: text/html");
  puts("");
  if (ref == 1) {
    UpdateAllRefs();
    puts("<html><head><title>Finished Updating All URL Ref Pages</title></head>");
    puts("<body><center><h1>Finished Updating All URL Ref Pages</h1></center>");
    ShowAllRefs();
    printf("<hr><font size=-1><i><a href=\"%s\">PHP Tools</a> Copyright &copy 1995 Rasmus Lerdorf</i></font><br>\n", "http://www.io.org/~rasmus/phpl.cgi?pages/phptools.html");
    puts("</body></html>");
  } else if (ref == 2) {
    UpdateRefs(argv[2]);
    puts("<html><head><title>Finished Updating Ref Page</title></head>");
    puts("<body><center><h1>Finished Updating Ref Page</h1></center>");
    ShowRefs(argv[2]);
    printf("<hr><font size=-1><i><a href=\"%s\">PHP Tools</a> Copyright &copy 1995 Rasmus Lerdorf</i></font><br>\n", "http://www.io.org/~rasmus/phpl.cgi?pages/phptools.html");
    puts("</body></html>");
  } else if (show == 1) {
    puts("<html><head><title>Referring URL List for All Pages</title></head>");
    puts("<body><center><h1>Referring URL List for All Pages</h1></center>");
    ShowAllRefs();
    printf("<a href=\"phplmon.cgi?ref_update\">Update Reference URL's for All pages</a><br>\n");
    printf("<hr><font size=-1><i><a href=\"%s\">PHP Tools</a> Copyright &copy 1995 Rasmus Lerdorf</i></font><br>\n", "http://www.io.org/~rasmus/phpl.cgi?pages/phptools.html");
    puts("</body></html>");
  } else if (show == 2) {
    puts("<html><head><title>Referring URL List</title></head>");
    puts("<body><center><h1>Referring URL List</h1></center>");
    ShowRefs(argv[2]);
    printf("<a href=\"phplmon.cgi?ref_show\">Show Reference URL's for All pages</a><br>\n");
    printf("<a href=\"phplmon.cgi?ref_update+%s\">Update Reference URL's for this page</a><br>\n", argv[2]);
    printf("<a href=\"phplmon.cgi?ref_update\">Update Reference URL's for All pages</a><br>\n");
    printf("<hr><font size=-1><i><a href=\"%s\">PHP Tools</a> Copyright &copy 1995 Rasmus Lerdorf</i></font><br>\n", "http://www.io.org/~rasmus/phpl.cgi?pages/phptools.html");
    puts("</body></html>");
  } else
    ShowStats(fancy);
  return (0);
}
```