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

```asm
<parse_server_args>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  cmp    $0x1,%edi
  jle    L35
  mov    %rdx,%rbp
  cmp    $0x2,%edi
  je     L3
  mov    0x10(%rsi),%rdi
  mov    %rsi,%rbx
  mov    $0x7,%edx
  lea    D0(%rip),%rsi
  call   <strncmp@plt>
  test   %rax,%rax
  je     L99
L3:
  movl   $0x457,0x0(%rbp)
  xor    %eax,%eax
L56:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L99:
  mov    0x10(%rbx),%rdi
  call   <strlen@plt>
  lea    -0x6(%rax),%r13d
  mov    %r13d,%edi
  call   <malloc@plt>
  mov    0x10(%rbx),%rsi
  mov    %r13d,%edx
  movslq %r13d,%r13
  mov    %rax,%r12
  mov    %rax,%rdi
  add    $0x7,%rsi
  call   <strncpy@plt>
  movb   $0x0,(%r12,%r13,1)
  movsbl (%r12),%edi
  test   %dil,%dil
  je     L44
  lea    0x1(%r12),%rbx
  jmp    L48
  nopl   0x0(%rax)
L4:
  movsbl (%rbx),%edi
  add    $0x1,%rbx
  test   %dil,%dil
  je     L44
L48:
  call   <isdigit@plt>
  test   %eax,%eax
  jne    L4
  call   <print_usage_details@plt>
  lea    D38(%rip),%rdi
  call   <printf@plt>
  add    $0x8,%rsp
  mov    $0xffffffff,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  xchg   %ax,%ax
L44:
  mov    %r12,%rdi
  call   <atoi@plt>
  cmp    $0xffff,%eax
  jg     L53
  mov    %eax,0x0(%rbp)
  mov    %r12,%rdi
  call   <free@plt>
  add    $0x8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L35:
  xor    %eax,%eax
  call   <print_usage_details@plt>
  lea    D4(%rip),%rdi
  call   <printf@plt>
  lea    D36(%rip),%rdi
  call   <printf@plt>
  mov    $0xffffffff,%eax
  jmp    L56
L53:
  xor    %eax,%eax
  call   <print_usage_details@plt>
  lea    D49(%rip),%rdi
  call   <printf@plt>
  mov    $0xffffffff,%eax
  jmp    L56
```

tool_calls: name: disassemble_data
arguments: label: D0
datatype: string
name: disassemble_data
arguments: label: D38
datatype: string
name: disassemble_data
arguments: label: D4
datatype: string
name: disassemble_data
arguments: label: D36
datatype: string
name: disassemble_data
arguments: label: D49
datatype: string

tool: D0: --port=

tool: D38: Found a character in the port number


tool: D4: Starting a server


tool: D36: Had less than 2 arguments
.

tool: D49: Port number was greater than 65535


assistant: ```c
int parse_server_args(int argc, char **argv, int *server_port) {
  int numPortChars, counter;
  char *szPort;
  int iPort;
  if (argc < 2) {
    print_usage_details();
    printf("Starting a server\n");
    printf("Had less than 2 arguments\n.");
    return -1;
  } else if (argc == 2) {
    *server_port = 1111;
    return 0;
  }
  if (strncmp(argv[2], "--port=", 7) == 0) {
    numPortChars = strlen(argv[2]) - 7 + 1;
    szPort = malloc(numPortChars * sizeof(char));
    strncpy(szPort, argv[2] + 7, numPortChars);
    szPort[numPortChars] = '\0';
    counter = 0;
    while (szPort[counter] != '\0') {
      if (!isdigit(szPort[counter])) {
        print_usage_details();
        printf("Found a character in the port number\n");
        return -1;
      }
      counter++;
    }
    iPort = atoi(szPort);
    if (iPort > 65535) {
      print_usage_details();
      printf("Port number was greater than 65535\n");
      return -1;
    }
    *server_port = iPort;
    free(szPort);
  } else
    *server_port = 1111;
  return 0;
}
```