user: What is the c source code of the assembly code below?

```asm
<generate_string_from_table>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  mov    %esi,%r13d
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x48,%rsp
  mov    %rdx,0x8(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x38(%rsp)
  xor    %eax,%eax
  lea    -0x1(%rsi),%eax
  movq   $0x0,0x30(%rsp)
  cmpq   $0x0,(%rdi,%rax,8)
  je     L13
  lea    -0x1(%rsi,%rsi,1),%eax
  mov    $0x1,%r15d
  xchg   %ax,%ax
L90:
  mov    %eax,%edx
  add    $0x1,%r15d
  add    %r13d,%eax
  cmpq   $0x0,(%rbx,%rdx,8)
  jne    L90
L154:
  xor    %eax,%eax
  call   <rand@plt>
  xor    %edx,%edx
  div    %r15d
  mov    %edx,%eax
  mov    %edx,0x18(%rsp)
  imul   %r13d,%eax
  lea    (%rbx,%rax,8),%rbp
  mov    0x0(%rbp),%rdi
  call   <wcslen@plt>
  add    $0x1,%rax
  cmp    0x8(%rsp),%rax
  jbe    L37
L103:
  mov    0x30(%rsp),%rax
  mov    0x38(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L143
  add    $0x48,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  cs nopw 0x0(%rax,%rax,1)
L37:
  mov    0x0(%rbp),%rsi
  lea    0x30(%rsp),%rdi
  mov    $0x1,%ebp
  mov    %rdi,0x10(%rsp)
  call   <alloc_wcscat@plt>
  mov    %r15d,0x1c(%rsp)
  mov    %rax,(%rsp)
  jmp    L18
  nopl   0x0(%rax,%rax,1)
L127:
  mov    0x18(%rsp),%eax
  imul   %r13d,%eax
  add    %ebp,%eax
  mov    %eax,%eax
  lea    (%rbx,%rax,8),%r12
  mov    (%r12),%rdi
  test   %rdi,%rdi
  je     L103
  call   <wcslen@plt>
  mov    (%rsp),%rcx
  lea    0x1(%rcx,%rax,1),%rax
  cmp    0x8(%rsp),%rax
  ja     L103
  mov    (%r12),%rsi
  mov    0x10(%rsp),%rdi
  add    $0x1,%ebp
  call   <alloc_wcscat@plt>
  mov    %rax,(%rsp)
L18:
  cmp    %r13d,%ebp
  jb     L127
  xor    %eax,%eax
  call   <rand@plt>
  xor    %edx,%edx
  mov    %r13d,0x24(%rsp)
  divl   0x1c(%rsp)
  mov    0x18(%rsp),%eax
  add    $0x1,%eax
  imul   %r13d,%eax
  mov    %rbx,%r13
  sub    $0x1,%eax
  lea    (%rbx,%rax,8),%rax
  mov    %rax,0x28(%rsp)
  mov    %edx,0x20(%rsp)
  mov    %edx,%r15d
  nopw   0x0(%rax,%rax,1)
L102:
  add    $0x1,%r15d
  xor    %eax,%eax
  cmp    0x1c(%rsp),%r15d
  cmove  %eax,%r15d
  cmp    0x20(%rsp),%r15d
  je     L103
  cmp    0x18(%rsp),%r15d
  je     L102
  mov    0x24(%rsp),%eax
  mov    %eax,%ebx
  imul   %r15d,%ebx
  cmp    $0x1,%eax
  jbe    L27
  lea    0x1(%rbx),%ebp
  lea    (%rax,%rbx,1),%r14d
  xor    %r12d,%r12d
  nopw   0x0(%rax,%rax,1)
L46:
  mov    %ebp,%eax
  mov    0x0(%r13,%rax,8),%rdi
  test   %rdi,%rdi
  je     L168
  call   <wcslen@plt>
  add    %rax,%r12
L168:
  add    $0x1,%ebp
  cmp    %ebp,%r14d
  jne    L46
L139:
  mov    0x28(%rsp),%rax
  mov    0x0(%r13,%rbx,8),%rsi
  mov    (%rax),%rdi
  call   <wcscmp@plt>
  test   %rax,%rax
  jne    L102
  mov    (%rsp),%rax
  lea    0x1(%rax,%r12,1),%rax
  cmp    0x8(%rsp),%rax
  jae    L102
  mov    %r13,%rbx
  mov    %r15d,0x18(%rsp)
  mov    0x24(%rsp),%r13d
  mov    $0x1,%ebp
  jmp    L18
  xchg   %ax,%ax
L27:
  xor    %r12d,%r12d
  jmp    L139
L13:
  mov    $0x1,%r15d
  jmp    L154
L143:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
wchar_t *generate_string_from_table(wchar_t **markov_table, unsigned int n, size_t max_length) {
  size_t new_str_length = 0;
  wchar_t *new_str = NULL;
  unsigned int table_num;
  for (table_num = 1; markov_table[table_num * n - 1] != NULL; table_num++)
    ;
  unsigned int current_index = (unsigned int)rand() % table_num;
  if (new_str_length + wcslen(markov_table[current_index * n]) + 1 > max_length)
    goto end;
  new_str_length = alloc_wcscat(&new_str, markov_table[current_index * n]);
  char not_found = 0;
  while (not_found == 0) {
    not_found = 1;
    for (unsigned int i = 1; i < n; i++) {
      if (markov_table[current_index * n + i] == NULL)
        goto end;
      if (new_str_length + wcslen(markov_table[current_index * n + i]) + 1 > max_length)
        goto end;
      new_str_length = alloc_wcscat(&new_str, markov_table[current_index * n + i]);
    }
    unsigned int search_start_point = (unsigned int)rand() % table_num;
    for (unsigned int i = search_start_point;;) {
      i++;
      if (i == table_num)
        i = 0;
      if (i == search_start_point)
        break;
      if (i == current_index)
        continue;
      size_t searching_str_length = 0;
      for (unsigned int j = 1; j < n; j++) {
        if (markov_table[i * n + j] != NULL)
          searching_str_length += wcslen(markov_table[i * n + j]);
      }
      if (wcscmp(markov_table[current_index * n + n - 1], markov_table[i * n]) == 0 && (new_str_length + searching_str_length + 1 < max_length)) {
        current_index = i;
        not_found = 0;
        break;
      }
    }
  }
end:
  return new_str;
}
```