user: 下面的汇编指令对应的C源代码是什么:

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  sub    $0x688,%rsp
  mov    $0x7f,%ecx
  pxor   %xmm0,%xmm0
  xor    %ebx,%ebx
  lea    D240(%rip),%rsi
  mov    %fs:0x28,%rax
  mov    %rax,0x2678(%rsp)
  xor    %eax,%eax
  lea    0x270(%rsp),%r15
  lea    0x1270(%rsp),%rbp
  movl   $0x0,0x140(%rsp)
  mov    %r15,%rdi
  lea    0x1a70(%rsp),%r14
  movaps %xmm0,0x100(%rsp)
  lea    0x2270(%rsp),%r13
  movaps %xmm0,0x110(%rsp)
  movaps %xmm0,0x120(%rsp)
  movaps %xmm0,0x130(%rsp)
  rep stos %rax,%es:(%rdi)
  mov    $0x11,%ecx
  movl   $0x0,(%rdi)
  lea    0x1e0(%rsp),%rdi
  mov    %rdi,0x28(%rsp)
  rep stos %rax,%es:(%rdi)
  lea    0xe70(%rsp),%rdi
  mov    $0x7f,%ecx
  mov    %rdi,0x8(%rsp)
  rep stos %rax,%es:(%rdi)
  mov    $0x7f,%ecx
  movl   $0x0,(%rdi)
  mov    %rbp,%rdi
  rep stos %rax,%es:(%rdi)
  mov    $0x7f,%ecx
  movl   $0x0,(%rdi)
  lea    0x1670(%rsp),%rdi
  mov    %rdi,0x18(%rsp)
  rep stos %rax,%es:(%rdi)
  mov    $0x7f,%ecx
  movl   $0x0,(%rdi)
  mov    %r14,%rdi
  rep stos %rax,%es:(%rdi)
  mov    $0x7f,%ecx
  movl   $0x0,(%rdi)
  lea    0x1e70(%rsp),%rdi
  mov    %rdi,0x20(%rsp)
  rep stos %rax,%es:(%rdi)
  movl   $0x0,(%rdi)
  lea    D26(%rip),%rdi
  call   <fopen@plt>
  mov    %rax,%r12
  test   %rax,%rax
  jne    L92
  jmp    L310
  nopw   0x0(%rax,%rax,1)
L48:
  cmpl   $0x23,0x2270(%rsp)
  jne    L343
L92:
  mov    %r12,%rdx
  mov    $0xff,%esi
  mov    %r13,%rdi
  call   <fgets@plt>
  test   %rax,%rax
  jne    L48
  mov    %r12,%rdi
  call   <fclose@plt>
  cmp    $0x4,%ebx
  jle    L442
  xor    %edi,%edi
  call   <mysql_init@plt>
  mov    %rax,0x10(%rsp)
  mov    %rax,%rbx
  test   %rax,%rax
  je     L63
  push   $0x0
  mov    %rbp,%rsi
  mov    %rax,%rdi
  xor    %r8d,%r8d
  push   $0x0
  mov    0x40(%rsp),%r9d
  mov    %r14,%rcx
  mov    0x28(%rsp),%rdx
  call   <mysql_real_connect@plt>
  pop    %rsi
  pop    %rdi
  test   %rax,%rax
  je     L63
  mov    0x20(%rsp),%rsi
  mov    %rbx,%rdi
  call   <mysql_select_db@plt>
  test   %rax,%rax
  js     L202
  lea    D71(%rip),%rdi
  lea    D352(%rip),%r14
  call   <puts@plt>
  lea    D103(%rip),%rdi
  call   <puts@plt>
  nopl   0x0(%rax,%rax,1)
L111:
  mov    %r14,%rdi
  xor    %eax,%eax
  call   <printf@plt>
  lea    D66(%rip),%rdi
  mov    %r15,%rsi
  call   <scanf@plt>
  mov    %r15,%rdi
  call   <strlen@plt>
  cmp    $0x10,%eax
  jg     L432
  mov    0x8(%rsp),%rbx
  lea    D51(%rip),%rsi
  xor    %eax,%eax
  mov    %r15,%rdx
  mov    %rbx,%rdi
  call   <sprintf@plt>
  mov    %rbx,%rsi
  mov    0x10(%rsp),%rbx
  mov    %rbx,%rdi
  call   <mysql_query@plt>
  test   %eax,%eax
  jne    L287
  mov    %rbx,%rdi
  call   <mysql_store_result@plt>
  mov    %rax,%rdi
  mov    %rax,%rbp
  call   <mysql_num_rows@plt>
  mov    %eax,%ebx
  test   %eax,%eax
  jne    L175
  mov    %rbp,%rdi
  lea    0xb0(%rsp),%r14
  lea    0x150(%rsp),%rbp
  call   <mysql_free_result@plt>
  mov    %r15,%rdi
  call   <strlen@plt>
  lea    0x60(%rsp),%rdi
  mov    %r15,%rsi
  lea    0x1(%rax),%edx
  mov    %rdi,0x20(%rsp)
  call   <memcpy@plt>
  xor    %edi,%edi
  call   <time@plt>
  mov    %rax,0x30(%rsp)
L322:
  lea    D372(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  lea    D66(%rip),%rdi
  mov    %r15,%rsi
  call   <scanf@plt>
  mov    %r15,%rdi
  call   <strlen@plt>
  cmp    $0x10,%eax
  jg     L459
L20:
  mov    $0x11,%edx
  mov    %r15,%rsi
  mov    %rbp,%rdi
  mov    $0x1,%r12d
  call   <memcpy@plt>
  lea    D320(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    %r15,%rsi
  lea    D66(%rip),%rdi
  call   <scanf@plt>
  mov    $0x11,%edx
  mov    %r15,%rsi
  mov    %r14,%rdi
  call   <memcpy@plt>
  xor    %eax,%eax
  nopl   0x0(%rax)
L462:
  mov    (%r14,%rax,1),%ecx
  cmp    %ecx,0x0(%rbp,%rax,1)
  cmovne %ebx,%r12d
  add    $0x4,%rax
  cmp    $0x40,%rax
  jne    L462
  test   %r12d,%r12d
  jne    L363
  lea    D47(%rip),%rdi
  call   <puts@plt>
  jmp    L322
L343:
  cmp    $0x3,%ebx
  jle    L49
L483:
  cmp    $0x4,%ebx
  ja     L52
  lea    D82(%rip),%rdx
  mov    %ebx,%eax
  movslq (%rdx,%rax,4),%rax
  add    %rdx,%rax
  notrack jmp *%rax
  mov    0x10(%rsp),%eax
  mov    %r13,%rsi
  mov    %rbp,%rdi
  lea    0x1(%rax),%edx
  call   <memcpy@plt>
L52:
  add    $0x1,%ebx
  jmp    L92
L63:
  mov    0x10(%rsp),%rbx
  mov    $0x1,%r12d
  mov    %rbx,%rdi
  call   <mysql_error@plt>
  mov    0x30(%rsp),%edx
  mov    %rbp,%rsi
  lea    D78(%rip),%rdi
  mov    %rax,%rcx
  xor    %eax,%eax
  call   <printf@plt>
  mov    %rbx,%rdi
  call   <mysql_close@plt>
L353:
  mov    0x2678(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L419
  add    $0x2688,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L442:
  lea    D54(%rip),%rdi
  mov    $0x1,%r12d
  call   <puts@plt>
  jmp    L353
L49:
  mov    %r13,%rdi
  call   <strlen@plt>
  mov    %eax,0x10(%rsp)
  sub    $0x1,%eax
  movslq %eax,%rdx
  cmpl   $0xa,0x2270(%rsp,%rdx,4)
  je     L86
L460:
  movslq 0x10(%rsp),%rax
  movl   $0x0,0x2270(%rsp,%rax,4)
  jmp    L483
  mov    %r13,%rdi
  call   <atoi@plt>
  mov    %eax,0x30(%rsp)
  jmp    L52
  mov    0x10(%rsp),%eax
  mov    0x18(%rsp),%rdi
  mov    %r13,%rsi
  lea    0x1(%rax),%edx
  call   <memcpy@plt>
  jmp    L52
  mov    0x10(%rsp),%eax
  mov    %r13,%rsi
  mov    %r14,%rdi
  lea    0x1(%rax),%edx
  call   <memcpy@plt>
  jmp    L52
  mov    0x10(%rsp),%eax
  mov    0x20(%rsp),%rdi
  mov    %r13,%rsi
  lea    0x1(%rax),%edx
  call   <memcpy@plt>
  jmp    L52
L86:
  movslq 0x10(%rsp),%rdx
  mov    %eax,0x10(%rsp)
  movl   $0x0,0x2270(%rsp,%rdx,4)
  jmp    L460
  nopw   0x0(%rax,%rax,1)
L432:
  lea    D223(%rip),%rdi
  call   <puts@plt>
  jmp    L111
L459:
  mov    %r15,%rdi
  call   <strlen@plt>
  cmp    $0x7,%eax
  jle    L20
  lea    D269(%rip),%rdi
  call   <puts@plt>
  jmp    L322
L287:
  lea    D94(%rip),%rdi
  mov    $0x1,%r12d
  call   <puts@plt>
  jmp    L353
L175:
  lea    D180(%rip),%rdi
  call   <puts@plt>
  mov    %rbp,%rdi
  call   <mysql_fetch_row@plt>
  mov    %rbp,%rdi
  mov    %rax,%rbx
  call   <mysql_num_fields@plt>
  lea    D321(%rip),%rdi
  mov    %eax,%r12d
  call   <puts@plt>
  lea    D332(%rip),%rdi
  call   <puts@plt>
  test   %r12d,%r12d
  jle    L269
  movslq %r12d,%rax
  mov    %rbp,0x18(%rsp)
  xor    %r12d,%r12d
  mov    %rbx,%rbp
  mov    %rax,%rbx
  nopw   0x0(%rax,%rax,1)
L56:
  mov    0x0(%rbp,%r12,8),%rdx
  mov    %r12d,%esi
  lea    D72(%rip),%rdi
  xor    %eax,%eax
  add    $0x1,%r12
  call   <printf@plt>
  cmp    %rbx,%r12
  jne    L56
  mov    0x18(%rsp),%rbp
L269:
  mov    %rbp,%rdi
  call   <mysql_free_result@plt>
  jmp    L111
L363:
  mov    %r13,0x50(%rsp)
  lea    0x670(%rsp),%rbx
  mov    %r12d,0x3c(%rsp)
  mov    0x10(%rsp),%r12
  mov    %rbp,0x58(%rsp)
  mov    0x8(%rsp),%rbp
  nopw   0x0(%rax,%rax,1)
L71:
  lea    D355(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    %r15,%rsi
  lea    D66(%rip),%rdi
  call   <scanf@plt>
  mov    %r15,%rdi
  call   <strlen@plt>
  mov    %r15,%rsi
  mov    %rbx,%rdi
  lea    0x1(%rax),%edx
  call   <memcpy@plt>
  mov    %rbp,%rdi
  xor    %eax,%eax
  mov    %rbx,%rdx
  lea    D136(%rip),%rsi
  call   <sprintf@plt>
  mov    %rbp,%rsi
  mov    %r12,%rdi
  call   <mysql_query@plt>
  test   %eax,%eax
  jne    L287
  mov    %r12,%rdi
  call   <mysql_store_result@plt>
  mov    %rax,%rdi
  mov    %rax,%r13
  call   <mysql_num_rows@plt>
  mov    %r13,%rdi
  mov    %rax,%r14
  mov    %eax,0x18(%rsp)
  call   <mysql_free_result@plt>
  test   %r14d,%r14d
  jne    L364
  lea    D253(%rip),%rdi
  xor    %eax,%eax
  lea    0xa70(%rsp),%r13
  xor    %r14d,%r14d
  call   <printf@plt>
  mov    %r15,%rsi
  lea    D66(%rip),%rdi
  call   <scanf@plt>
  mov    %r15,%rdi
  call   <strlen@plt>
  mov    %r13,%rdi
  mov    %r15,%rsi
  lea    0x1(%rax),%edx
  call   <memcpy@plt>
  mov    0x3c(%rsp),%ecx
  mov    %r12,0x40(%rsp)
  mov    %rbx,%r12
  mov    %rbp,0x48(%rsp)
  mov    %r13,%rbx
  mov    0x18(%rsp),%r13d
  mov    %ecx,%ebp
  jmp    L346
L230:
  mov    (%rbx,%r14,4),%eax
  cmp    %eax,(%r12,%r14,4)
  cmovne %r13d,%ebp
  add    $0x1,%r14
L346:
  mov    %r12,%rdi
  call   <strlen@plt>
  cmp    %r14d,%eax
  jg     L230
  mov    %ebp,%ecx
  mov    %r12,%rbx
  mov    0x48(%rsp),%rbp
  mov    0x40(%rsp),%r12
  test   %ecx,%ecx
  jne    L270
  lea    D339(%rip),%rdi
  call   <puts@plt>
  jmp    L71
  nopl   0x0(%rax)
L364:
  lea    D244(%rip),%rdi
  call   <puts@plt>
  jmp    L71
L310:
  lea    D227(%rip),%rdi
  mov    $0x1,%r12d
  call   <puts@plt>
  jmp    L353
L202:
  mov    0x20(%rsp),%rsi
  lea    D286(%rip),%rdi
  xor    %eax,%eax
  mov    $0x2,%r12d
  call   <printf@plt>
  mov    0x10(%rsp),%rdi
  call   <mysql_close@plt>
  jmp    L353
L270:
  mov    0x8(%rsp),%r15
  lea    D185(%rip),%rsi
  xor    %eax,%eax
  mov    0x50(%rsp),%r13
  mov    0x58(%rsp),%rbp
  mov    %r15,%rdi
  call   <sprintf@plt>
  mov    0x10(%rsp),%rdi
  mov    %r15,%rsi
  call   <mysql_query@plt>
  test   %eax,%eax
  jne    L287
  mov    0x10(%rsp),%rdi
  call   <mysql_store_result@plt>
  mov    %rax,%rdi
  mov    %rax,%r12
  call   <mysql_num_rows@plt>
  mov    %r12,%rdi
  mov    %rax,%r15
  call   <mysql_free_result@plt>
  mov    %r15d,%esi
  lea    D297(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    0x30(%rsp),%eax
  mov    $0xe10,%ecx
  xor    %edx,%edx
  mov    %rbp,%rdi
  div    %ecx
  mov    %eax,0x18(%rsp)
  call   <strlen@plt>
  mov    0x18(%rsp),%edx
  mov    %r13,%rdi
  lea    D289(%rip),%rsi
  mov    %eax,%r12d
  xor    %eax,%eax
  call   <sprintf@plt>
  movslq %r12d,%rax
  mov    %r13,%rdx
  lea    D4(%rip),%rsi
  lea    0x0(%rbp,%rax,4),%rdi
  xor    %eax,%eax
  xor    %r12d,%r12d
  call   <sprintf@plt>
  lea    0x100(%rsp),%rcx
  mov    %rbp,%rdi
  lea    D20(%rip),%rbp
  mov    %rcx,%rsi
  mov    %rcx,0x30(%rsp)
  call   <MDString@plt>
  mov    0x28(%rsp),%r14
  mov    0x30(%rsp),%r13
L420:
  mov    0x0(%r13,%r12,4),%edx
  mov    %r14,%rdi
  mov    %rbp,%rsi
  xor    %eax,%eax
  add    $0x1,%r12
  add    $0x8,%r14
  call   <sprintf@plt>
  cmp    $0x10,%r12
  jne    L420
  movl   $0x0,0x260(%rsp)
  test   %r15d,%r15d
  jne    L161
  push   %rax
  mov    %rbx,%r8
  lea    D270(%rip),%rsi
  xor    %eax,%eax
  push   $0x280de81
  mov    0x28(%rsp),%r9d
  mov    0x38(%rsp),%rcx
  mov    0x30(%rsp),%rdx
  mov    0x18(%rsp),%rdi
  call   <sprintf@plt>
  pop    %rdx
  pop    %rcx
L297:
  mov    0x10(%rsp),%rbx
  mov    0x8(%rsp),%rsi
  mov    %rbx,%rdi
  call   <mysql_query@plt>
  mov    %eax,%r12d
  test   %eax,%eax
  jne    L287
  lea    D42(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    %rbx,%rdi
  call   <mysql_close@plt>
  jmp    L353
L161:
  mov    0x18(%rsp),%r9d
  mov    0x28(%rsp),%rcx
  mov    %rbx,%r8
  xor    %eax,%eax
  mov    0x20(%rsp),%rdx
  mov    0x8(%rsp),%rdi
  lea    D278(%rip),%rsi
  call   <sprintf@plt>
  jmp    L297
L419:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: label: D240
datatype: string
name: extract_symbolic_data
arguments: label: D26
datatype: string
name: extract_symbolic_data
arguments: label: D71
datatype: string
name: extract_symbolic_data
arguments: label: D352
datatype: string
name: extract_symbolic_data
arguments: label: D103
datatype: string
name: extract_symbolic_data
arguments: label: D66
datatype: string
name: extract_symbolic_data
arguments: label: D51
datatype: string
name: extract_symbolic_data
arguments: label: D372
datatype: string
name: extract_symbolic_data
arguments: label: D320
datatype: string
name: extract_symbolic_data
arguments: label: D47
datatype: string
name: extract_symbolic_data
arguments: label: D78
datatype: string
name: extract_symbolic_data
arguments: label: D54
datatype: string
name: extract_symbolic_data
arguments: label: D223
datatype: string
name: extract_symbolic_data
arguments: label: D269
datatype: string
name: extract_symbolic_data
arguments: label: D94
datatype: string
name: extract_symbolic_data
arguments: label: D180
datatype: string
name: extract_symbolic_data
arguments: label: D321
datatype: string
name: extract_symbolic_data
arguments: label: D332
datatype: string
name: extract_symbolic_data
arguments: label: D72
datatype: string
name: extract_symbolic_data
arguments: label: D355
datatype: string
name: extract_symbolic_data
arguments: label: D136
datatype: string
name: extract_symbolic_data
arguments: label: D253
datatype: string
name: extract_symbolic_data
arguments: label: D339
datatype: string
name: extract_symbolic_data
arguments: label: D244
datatype: string
name: extract_symbolic_data
arguments: label: D227
datatype: string
name: extract_symbolic_data
arguments: label: D286
datatype: string
name: extract_symbolic_data
arguments: label: D185
datatype: string
name: extract_symbolic_data
arguments: label: D297
datatype: string
name: extract_symbolic_data
arguments: label: D289
datatype: string
name: extract_symbolic_data
arguments: label: D4
datatype: string
name: extract_symbolic_data
arguments: label: D20
datatype: string
name: extract_symbolic_data
arguments: label: D270
datatype: string
name: extract_symbolic_data
arguments: label: D42
datatype: string
name: extract_symbolic_data
arguments: label: D278
datatype: string

tool: D240: r

tool: D26: tethealla.ini

tool: D71: Tethealla Server Account Addition

tool: D352: New account's username: 

tool: D103: -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

tool: D66: %s

tool: D51: SELECT * from account_data WHERE username='%s'

tool: D372: New account's password: 

tool: D320: Verify password: 

tool: D47: The input passwords did not match.

tool: D78: Can't connect to the mysql server (%s) on port %d !
mysql_error = %s


tool: D54: tethealla.ini seems to be corrupted.

tool: D223: Desired account name length should be 16 characters or less.

tool: D269: Desired password length should be 16 characters or less.

tool: D94: Couldn't query the MySQL server.

tool: D180: There is already an account by that name on the server.

tool: D321: Row data:

tool: D332: -=-=-=-=-

tool: D72: column %u = %s


tool: D355: New account's e-mail address: 

tool: D136: SELECT * from account_data WHERE email='%s'

tool: D253: Verify e-mail address: 

tool: D339: The input e-mail addresses did not match.

tool: D244: That e-mail address has already been registered to an account.

tool: D227: The configuration file tethealla.ini appears to be missing.

tool: D286: Can't select the %s database !


tool: D185: SELECT * from account_data

tool: D297: There are %i accounts already registered on the server.


tool: D289: %d

tool: D4: _%s_salt

tool: D20: %02x

tool: D270: INSERT into account_data (username,password,email,regtime,guildcard,isgm,isactive) VALUES ('%s','%s','%s','%u','%u','1','1')

tool: D42: Account successfully added to the database!

tool: D278: INSERT into account_data (username,password,email,regtime,isactive) VALUES ('%s','%s','%s','%u','1')

assistant: ```c
int main(int32_t argc, int8_t *argv[]) {
  int8_t inputstr[255] = {0};
  int8_t username[17];
  int8_t password[34];
  int8_t password_check[17];
  int8_t md5password[34] = {0};
  int8_t email[255];
  int8_t email_check[255];
  uint8_t ch;
  time_t regtime;
  uint32_t reg_seconds;
  uint8_t max_fields;
  MYSQL *myData;
  int8_t myQuery[255] = {0};
  MYSQL_ROW myRow;
  MYSQL_RES *myResult;
  int32_t num_rows, pw_ok, pw_same;
  uint32_t guildcard_number;
  int8_t mySQL_Host[255] = {0};
  int8_t mySQL_Username[255] = {0};
  int8_t mySQL_Password[255] = {0};
  int8_t mySQL_Database[255] = {0};
  uint32_t mySQL_Port;
  int32_t config_index = 0;
  int8_t config_data[255];
  uint8_t MDBuffer[17] = {0};
  FILE *fp;
  if ((fp = fopen("tethealla.ini", "r")) == NULL) {
    printf("The configuration file tethealla.ini appears to be missing.\n");
    return 1;
  } else
    while (fgets(&config_data[0], 255, fp) != NULL) {
      if (config_data[0] != 0x23) {
        if (config_index < 0x04) {
          ch = strlen(&config_data[0]);
          if (config_data[ch - 1] == 0x0A)
            config_data[ch--] = 0x00;
          config_data[ch] = 0;
        }
        switch (config_index) {
        case 0x00:
          memcpy(&mySQL_Host[0], &config_data[0], ch + 1);
          break;
        case 0x01:
          memcpy(&mySQL_Username[0], &config_data[0], ch + 1);
          break;
        case 0x02:
          memcpy(&mySQL_Password[0], &config_data[0], ch + 1);
          break;
        case 0x03:
          memcpy(&mySQL_Database[0], &config_data[0], ch + 1);
          break;
        case 0x04:
          mySQL_Port = atoi(&config_data[0]);
          break;
        default:
          break;
        }
        config_index++;
      }
    }
  fclose(fp);
  if (config_index < 5) {
    printf("tethealla.ini seems to be corrupted.\n");
    return 1;
  }
  if ((myData = mysql_init((MYSQL *)0)) && mysql_real_connect(myData, &mySQL_Host[0], &mySQL_Username[0], &mySQL_Password[0], NULL, mySQL_Port, NULL, 0)) {
    if (mysql_select_db(myData, &mySQL_Database[0]) < 0) {
      printf("Can't select the %s database !\n", mySQL_Database);
      mysql_close(myData);
      return 2;
    }
  } else {
    printf("Can't connect to the mysql server (%s) on port %d !\nmysql_error = %s\n", mySQL_Host, mySQL_Port, mysql_error(myData));
    mysql_close(myData);
    return 1;
  }
  printf("Tethealla Server Account Addition\n");
  printf("-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n");
  pw_ok = 0;
  while (!pw_ok) {
    printf("New account's username: ");
    scanf("%s", inputstr);
    if (strlen(inputstr) < 17) {
      sprintf(&myQuery[0], "SELECT * from account_data WHERE username='%s'", inputstr);
      if (!mysql_query(myData, &myQuery[0])) {
        myResult = mysql_store_result(myData);
        num_rows = (int)mysql_num_rows(myResult);
        if (num_rows) {
          printf("There is already an account by that name on the server.\n");
          myRow = mysql_fetch_row(myResult);
          max_fields = mysql_num_fields(myResult);
          printf("Row data:\n");
          printf("-=-=-=-=-\n");
          for (ch = 0; ch < max_fields; ch++)
            printf("column %u = %s\n", ch, myRow[ch]);
        } else
          pw_ok = 1;
        mysql_free_result(myResult);
      } else {
        printf("Couldn't query the MySQL server.\n");
        return 1;
      }
    } else
      printf("Desired account name length should be 16 characters or less.\n");
  }
  memcpy(&username[0], &inputstr[0], strlen(inputstr) + 1);
  regtime = time(NULL);
  pw_ok = 0;
  while (!pw_ok) {
    printf("New account's password: ");
    scanf("%s", inputstr);
    if ((strlen(inputstr) < 17) || (strlen(inputstr) < 8)) {
      memcpy(&password[0], &inputstr[0], 17);
      printf("Verify password: ");
      scanf("%s", inputstr);
      memcpy(&password_check[0], &inputstr[0], 17);
      pw_same = 1;
      for (ch = 0; ch < 16; ch++) {
        if (password[ch] != password_check[ch])
          pw_same = 0;
      }
      if (pw_same)
        pw_ok = 1;
      else
        printf("The input passwords did not match.\n");
    } else
      printf("Desired password length should be 16 characters or less.\n");
  }
  pw_ok = 0;
  while (!pw_ok) {
    printf("New account's e-mail address: ");
    scanf("%s", inputstr);
    memcpy(&email[0], &inputstr[0], strlen(inputstr) + 1);
    sprintf(&myQuery[0], "SELECT * from account_data WHERE email='%s'", email);
    if (!mysql_query(myData, &myQuery[0])) {
      myResult = mysql_store_result(myData);
      num_rows = (int)mysql_num_rows(myResult);
      mysql_free_result(myResult);
      if (num_rows)
        printf("That e-mail address has already been registered to an account.\n");
    } else {
      printf("Couldn't query the MySQL server.\n");
      return 1;
    }
    if (!num_rows) {
      printf("Verify e-mail address: ");
      scanf("%s", inputstr);
      memcpy(&email_check[0], &inputstr[0], strlen(inputstr) + 1);
      pw_same = 1;
      for (ch = 0; ch < strlen(email); ch++) {
        if (email[ch] != email_check[ch])
          pw_same = 0;
      }
      if (pw_same)
        pw_ok = 1;
      else
        printf("The input e-mail addresses did not match.\n");
    }
  }
  sprintf(&myQuery[0], "SELECT * from account_data");
  if (!mysql_query(myData, &myQuery[0])) {
    myResult = mysql_store_result(myData);
    num_rows = (int)mysql_num_rows(myResult);
    mysql_free_result(myResult);
    printf("There are %i accounts already registered on the server.\n", num_rows);
  } else {
    printf("Couldn't query the MySQL server.\n");
    return 1;
  }
  reg_seconds = (unsigned)regtime / 3600L;
  ch = strlen(&password[0]);
  sprintf(&config_data[0], "%d", reg_seconds);
  sprintf(&password[ch], "_%s_salt", &config_data[0]);
  MDString(&password[0], &MDBuffer[0]);
  for (ch = 0; ch < 16; ch++)
    sprintf(&md5password[ch * 2], "%02x", (uint8_t)MDBuffer[ch]);
  md5password[32] = 0;
  if (!num_rows) {
    guildcard_number = 42000001;
    sprintf(&myQuery[0], "INSERT into account_data (username,password,email,regtime,guildcard,isgm,isactive) VALUES ('%s','%s','%s','%u','%u','1','1')", username, md5password, email, reg_seconds, guildcard_number);
  } else {
    sprintf(&myQuery[0], "INSERT into account_data (username,password,email,regtime,isactive) VALUES ('%s','%s','%s','%u','1')", username, md5password, email, reg_seconds);
  }
  if (!mysql_query(myData, &myQuery[0]))
    printf("Account successfully added to the database!");
  else {
    printf("Couldn't query the MySQL server.\n");
    return 1;
  }
  mysql_close(myData);
  return 0;
}
```