user: 请从给定的汇编指令推导出C源代码：

```asm
<main>:
  endbr64
  push   %r14
  xor    %eax,%eax
  push   %r13
  push   %r12
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  mov    %edi,%ebx
  call   <geteuid@plt>
  mov    %eax,%edi
  call   <setuid@plt>
  cmp    $0x1,%ebx
  jle    L200
  mov    0x8(%rbp),%r12
  lea    D218(%rip),%rsi
  mov    %r12,%rdi
  call   <strcasecmp@plt>
  test   %eax,%eax
  je     L22
  lea    D155(%rip),%rsi
  mov    %r12,%rdi
  call   <strcasecmp@plt>
  test   %eax,%eax
  je     L135
  mov    %r12,%rdi
  lea    D277(%rip),%rsi
  call   <strcasecmp@plt>
  mov    %r12,%rdi
  lea    D106(%rip),%rsi
  mov    %eax,%r13d
  call   <strcasecmp@plt>
  mov    %r12,%rdi
  lea    D22(%rip),%rsi
  mov    %eax,%r14d
  call   <strcasecmp@plt>
  mov    %eax,%r12d
  test   %r14d,%r14d
  jne    L73
  cmp    $0x2,%ebx
  je     L2
  mov    0x10(%rbp),%rax
  cmpb   $0x0,(%rax)
  je     L124
  lea    D309(%rip),%rdi
  call   <puts@plt>
  lea    D102(%rip),%rdi
  call   <puts@plt>
L52:
  mov    0x10(%rbp),%rdi
  call   <UpdateRefs@plt>
  lea    D61(%rip),%rdi
  call   <puts@plt>
  lea    D16(%rip),%rdi
  call   <puts@plt>
  mov    0x10(%rbp),%rdi
  call   <ShowRefs@plt>
L159:
  lea    D60(%rip),%rsi
  lea    D82(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  lea    D168(%rip),%rdi
  call   <puts@plt>
  jmp    L23
L200:
  lea    D309(%rip),%rdi
  call   <puts@plt>
  lea    D102(%rip),%rdi
  call   <puts@plt>
  mov    $0x1,%edi
L40:
  call   <ShowStats@plt>
L23:
  pop    %rbx
  xor    %eax,%eax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L73:
  test   %eax,%eax
  jne    L17
  cmp    $0x2,%ebx
  je     L171
  mov    0x10(%rbp),%rax
  cmpb   $0x0,(%rax)
  jne    L112
L44:
  lea    D309(%rip),%rdi
  call   <puts@plt>
  lea    D102(%rip),%rdi
  call   <puts@plt>
  cmp    $0x1,%r12d
  jne    L111
L186:
  xor    %eax,%eax
  call   <UpdateAllRefs@plt>
  lea    D71(%rip),%rdi
  call   <puts@plt>
  lea    D105(%rip),%rdi
  call   <puts@plt>
  xor    %eax,%eax
  call   <ShowAllRefs@plt>
  jmp    L159
L22:
  lea    D309(%rip),%rdi
  call   <puts@plt>
  lea    D102(%rip),%rdi
  call   <puts@plt>
  xor    %eax,%eax
  call   <ShowVersion@plt>
  jmp    L23
L17:
  lea    D309(%rip),%rdi
  call   <puts@plt>
  lea    D102(%rip),%rdi
  call   <puts@plt>
  xor    %edi,%edi
  test   %r13d,%r13d
  setne  %dil
  jmp    L40
L135:
  lea    D309(%rip),%rdi
  call   <puts@plt>
  lea    D102(%rip),%rdi
  call   <puts@plt>
  xor    %eax,%eax
  call   <ShowEnv@plt>
  jmp    L23
L124:
  test   %r12d,%r12d
  je     L31
L2:
  lea    D309(%rip),%rdi
  call   <puts@plt>
  lea    D102(%rip),%rdi
  call   <puts@plt>
  jmp    L186
L31:
  mov    $0x1,%r12d
  jmp    L44
L171:
  lea    D309(%rip),%rdi
  call   <puts@plt>
  lea    D102(%rip),%rdi
  call   <puts@plt>
L43:
  lea    D300(%rip),%rdi
  call   <puts@plt>
  lea    D278(%rip),%rdi
  call   <puts@plt>
  xor    %eax,%eax
  call   <ShowAllRefs@plt>
L136:
  lea    D9(%rip),%rdi
  call   <puts@plt>
  jmp    L159
L111:
  cmp    $0x2,%r12d
  je     L52
  jmp    L43
L112:
  lea    D309(%rip),%rdi
  call   <puts@plt>
  lea    D102(%rip),%rdi
  call   <puts@plt>
  lea    D191(%rip),%rdi
  call   <puts@plt>
  lea    D239(%rip),%rdi
  call   <puts@plt>
  mov    0x10(%rbp),%rdi
  call   <ShowRefs@plt>
  lea    D166(%rip),%rdi
  call   <puts@plt>
  mov    0x10(%rbp),%rsi
  lea    D98(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L136
```

tool_calls: name: disassemble_data
arguments: label: D218
type_infered: string
name: disassemble_data
arguments: label: D155
type_infered: string
name: disassemble_data
arguments: label: D277
type_infered: string
name: disassemble_data
arguments: label: D106
type_infered: string
name: disassemble_data
arguments: label: D22
type_infered: string
name: disassemble_data
arguments: label: D309
type_infered: string
name: disassemble_data
arguments: label: D102
type_infered: string
name: disassemble_data
arguments: label: D61
type_infered: string
name: disassemble_data
arguments: label: D16
type_infered: string
name: disassemble_data
arguments: label: D60
type_infered: string
name: disassemble_data
arguments: label: D82
type_infered: string
name: disassemble_data
arguments: label: D168
type_infered: string
name: disassemble_data
arguments: label: D71
type_infered: string
name: disassemble_data
arguments: label: D105
type_infered: string
name: disassemble_data
arguments: label: D300
type_infered: string
name: disassemble_data
arguments: label: D278
type_infered: string
name: disassemble_data
arguments: label: D9
type_infered: string
name: disassemble_data
arguments: label: D191
type_infered: string
name: disassemble_data
arguments: label: D239
type_infered: string
name: disassemble_data
arguments: label: D166
type_infered: string
name: disassemble_data
arguments: label: D98
type_infered: string

tool: D218: version

tool: D155: env

tool: D277: text

tool: D106: ref_update

tool: D22: ref_show

tool: D309: Content-type: text/html

tool: 

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

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

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

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


tool: D168: </body></html>

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

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

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

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

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

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

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

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

tool: D98: <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);
}
```