user: Converte this assembly snippet into its equivalent C code:

```asm
<ArraySort_String>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x188,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x178(%rsp)
  xor    %eax,%eax
  lea    -0x1(%rdi),%eax
  mov    %eax,0x18(%rsp)
  movl   $0x0,0x1c(%rsp)
  mov    $0x0,%r15d
  mov    %rsi,%r14
  mov    %rdx,%r13
  jmp    L62
L138:
  movslq %ebp,%rbp
  add    $0x1,%rbp
  mov    (%r14,%rbp,8),%rdi
  mov    %r12,%rsi
  call   <strcpy@plt>
  mov    0x10(%rsp),%eax
  mov    %eax,0x0(%r13,%rbp,4)
  addq   $0x1,(%rsp)
  mov    (%rsp),%rax
  addl   $0x1,0x8(%rsp)
  cmp    %eax,0x18(%rsp)
  jl     L50
L111:
  mov    (%rsp),%rbx
  mov    (%r14,%rbx,8),%rsi
  mov    %r12,%rdi
  call   <strcpy@plt>
  mov    0x0(%r13,%rbx,4),%eax
  mov    %eax,0x10(%rsp)
  mov    0x8(%rsp),%eax
  mov    %eax,%ebp
  cmp    %eax,%r15d
  jg     L138
  movslq %eax,%rbx
L242:
  mov    %ebx,%ebp
  mov    (%r14,%rbx,8),%rdi
  mov    %r12,%rsi
  call   <strcmp@plt>
  test   %rax,%rax
  jle    L138
  mov    (%r14,%rbx,8),%rsi
  mov    0x8(%r14,%rbx,8),%rdi
  call   <strcpy@plt>
  mov    0x0(%r13,%rbx,4),%eax
  mov    %eax,0x4(%r13,%rbx,4)
  lea    -0x1(%rbx),%ebp
  sub    $0x1,%rbx
  cmp    %ebx,%r15d
  jle    L242
  jmp    L138
L50:
  mov    0x1c(%rsp),%ecx
  test   %ecx,%ecx
  je     L114
  lea    -0x1(%rcx),%eax
  movslq %ecx,%rdx
  mov    0x40(%rsp,%rdx,4),%edx
  mov    %edx,0x18(%rsp)
  sub    $0x2,%ecx
  mov    %ecx,0x1c(%rsp)
  cltq
  mov    0x40(%rsp,%rax,4),%r15d
L62:
  mov    0x18(%rsp),%edx
  mov    %edx,%eax
  sub    %r15d,%eax
  cmp    $0x6,%eax
  jg     L56
  lea    0x1(%r15),%eax
  cmp    %eax,%edx
  jl     L50
  cltq
  mov    %rax,(%rsp)
  mov    %r15d,0x8(%rsp)
  lea    0x110(%rsp),%r12
  jmp    L111
L56:
  mov    0x18(%rsp),%ebp
  lea    0x0(%rbp,%r15,1),%ebx
  sar    %ebx
  lea    0x1(%r15),%eax
  mov    %eax,(%rsp)
  mov    %eax,%edx
  mov    %ebx,%esi
  mov    %r14,%rdi
  call   <s_swap@plt>
  movslq %ebx,%rbx
  lea    0x0(%r13,%rbx,4),%rdx
  mov    (%rdx),%ecx
  movslq %r15d,%rax
  lea    0x4(,%rax,4),%rsi
  mov    %rsi,0x8(%rsp)
  lea    0x0(%r13,%rsi,1),%rdi
  mov    %rdi,0x28(%rsp)
  mov    (%rdi),%esi
  mov    %esi,(%rdx)
  mov    %ecx,(%rdi)
  mov    %ebp,0x18(%rsp)
  movslq %ebp,%rbx
  lea    (%r14,%rbx,8),%rbp
  shl    $0x3,%rax
  mov    %rax,0x10(%rsp)
  lea    (%r14,%rax,1),%r12
  mov    0x0(%rbp),%rsi
  mov    (%r12),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jg     L124
L150:
  mov    0x10(%rsp),%rax
  lea    0x8(%r14,%rax,1),%rax
  mov    %rax,0x30(%rsp)
  mov    0x0(%rbp),%rsi
  mov    (%rax),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jg     L254
L12:
  mov    0x30(%rsp),%rax
  mov    (%rax),%rsi
  mov    (%r12),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jg     L218
L117:
  lea    0x110(%rsp),%rdi
  mov    0x30(%rsp),%rax
  mov    (%rax),%rsi
  call   <strcpy@plt>
  mov    0x28(%rsp),%rax
  mov    (%rax),%eax
  mov    %eax,0x38(%rsp)
  lea    0x2(%r15),%r12d
  movslq %r12d,%r12
  mov    0x18(%rsp),%eax
  lea    0x110(%rsp),%rcx
  mov    %r15d,0x3c(%rsp)
  mov    %r13,0x20(%rsp)
  mov    %eax,%r13d
  mov    %rcx,%r15
  jmp    L38
L124:
  mov    0x18(%rsp),%edx
  mov    %r15d,%esi
  mov    %r14,%rdi
  call   <s_swap@plt>
  mov    0x8(%rsp),%rsi
  lea    -0x4(%r13,%rsi,1),%rdx
  mov    (%rdx),%ecx
  lea    0x0(%r13,%rbx,4),%rax
  mov    (%rax),%esi
  mov    %esi,(%rdx)
  mov    %ecx,(%rax)
  jmp    L150
L254:
  mov    0x18(%rsp),%edx
  mov    (%rsp),%esi
  mov    %r14,%rdi
  call   <s_swap@plt>
  mov    0x28(%rsp),%rsi
  mov    (%rsi),%edx
  lea    0x0(%r13,%rbx,4),%rax
  mov    (%rax),%ecx
  mov    %ecx,(%rsi)
  mov    %edx,(%rax)
  jmp    L12
L218:
  mov    (%rsp),%edx
  mov    %r15d,%esi
  mov    %r14,%rdi
  call   <s_swap@plt>
  mov    0x8(%rsp),%rax
  lea    -0x4(%r13,%rax,1),%rax
  mov    (%rax),%edx
  mov    0x28(%rsp),%rsi
  mov    (%rsi),%ecx
  mov    %ecx,(%rax)
  mov    %edx,(%rsi)
  jmp    L117
L246:
  add    $0x1,%r12
L38:
  mov    %r12d,0x10(%rsp)
  mov    (%r14,%r12,8),%rdi
  mov    %r15,%rsi
  call   <strcmp@plt>
  test   %rax,%rax
  js     L246
  lea    -0x1(%r13),%ebx
  movslq %ebx,%rbx
  movslq %r13d,%r13
  lea    -0x8(%r14,%r13,8),%rbp
L1:
  mov    %ebx,0x8(%rsp)
  mov    %ebx,%r13d
  mov    %rbp,(%rsp)
  mov    %r15,%rsi
  mov    0x0(%rbp),%rdi
  call   <strcmp@plt>
  mov    %rbx,%rdx
  sub    $0x1,%rbx
  sub    $0x8,%rbp
  test   %rax,%rax
  jg     L1
  mov    %rdx,%rbx
  mov    %rbx,%rbp
  cmp    %r12d,%r13d
  jl     L137
  mov    0x10(%rsp),%esi
  mov    %r14,%rdi
  call   <s_swap@plt>
  mov    0x20(%rsp),%rsi
  mov    (%rsi,%r12,4),%edx
  lea    (%rsi,%rbx,4),%rax
  mov    (%rax),%ecx
  mov    %ecx,(%rsi,%r12,4)
  mov    %edx,(%rax)
  jmp    L246
L137:
  mov    0x3c(%rsp),%r15d
  mov    %r13d,%r12d
  mov    0x20(%rsp),%r13
  mov    (%rsp),%rbx
  mov    (%rbx),%rsi
  mov    0x30(%rsp),%rax
  mov    (%rax),%rdi
  call   <strcpy@plt>
  lea    0x110(%rsp),%rsi
  mov    (%rbx),%rdi
  call   <strcpy@plt>
  mov    %rbp,%rax
  lea    0x0(%r13,%rax,4),%rax
  mov    (%rax),%edx
  mov    0x28(%rsp),%rcx
  mov    %edx,(%rcx)
  mov    0x38(%rsp),%ecx
  mov    %ecx,(%rax)
  mov    0x1c(%rsp),%eax
  lea    0x2(%rax),%ebx
  cmp    $0x32,%ebx
  jg     L44
L19:
  mov    0x18(%rsp),%ecx
  mov    %ecx,%eax
  mov    0x10(%rsp),%esi
  sub    %esi,%eax
  add    $0x1,%eax
  mov    %r12d,%edx
  sub    %r15d,%edx
  cmp    %edx,%eax
  jl     L100
  movslq %ebx,%rax
  mov    %ecx,0x40(%rsp,%rax,4)
  mov    0x1c(%rsp),%eax
  add    $0x1,%eax
  cltq
  mov    %esi,0x40(%rsp,%rax,4)
  mov    0x8(%rsp),%eax
  sub    $0x1,%eax
  mov    %eax,0x18(%rsp)
  mov    %ebx,0x1c(%rsp)
  jmp    L62
L44:
  lea    D8(%rip),%rdi
  call   <printf@plt>
  mov    $0x0,%edi
  call   <exit@plt>
  jmp    L19
L100:
  movslq %ebx,%rdx
  mov    0x8(%rsp),%eax
  sub    $0x1,%eax
  mov    %eax,0x40(%rsp,%rdx,4)
  mov    0x1c(%rsp),%eax
  add    $0x1,%eax
  cltq
  mov    %r15d,0x40(%rsp,%rax,4)
  mov    %ebx,0x1c(%rsp)
  mov    0x10(%rsp),%r15d
  jmp    L62
L114:
  mov    0x178(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L87
  add    $0x188,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L87:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: data_label: D8
type_guessed: string

tool: D8: Stack error: NSTACK too small


assistant: ```c
void ArraySort_String(int n, char **Pair_Name, int *brr) {
  int i, ir = n - 1, j, k, m = 0, jstack = 0, b, NSTACK = 50, istack[NSTACK];
  int temp, MIN = 7;
  char p[100];
  for (;;) {
    if (ir - m < MIN) {
      for (j = m + 1; j <= ir; j++) {
        strcpy(p, Pair_Name[j]);
        b = brr[j];
        for (i = j - 1; i >= m; i--) {
          if (strcmp(Pair_Name[i], p) <= 0)
            break;
          strcpy(Pair_Name[i + 1], Pair_Name[i]);
          brr[i + 1] = brr[i];
        }
        strcpy(Pair_Name[i + 1], p);
        brr[i + 1] = b;
      }
      if (!jstack)
        return;
      ir = istack[jstack--];
      m = istack[jstack--];
    } else {
      k = (m + ir) >> 1;
      s_swap(Pair_Name, k, m + 1);
      temp = (brr[k]);
      (brr[k]) = brr[m + 1];
      (brr[m + 1]) = temp;
      ;
      if (strcmp(Pair_Name[m], Pair_Name[ir]) > 0) {
        s_swap(Pair_Name, m, ir);
        temp = (brr[m]);
        (brr[m]) = brr[ir];
        (brr[ir]) = temp;
        ;
      }
      if (strcmp(Pair_Name[m + 1], Pair_Name[ir]) > 0) {
        s_swap(Pair_Name, m + 1, ir);
        temp = (brr[m + 1]);
        (brr[m + 1]) = brr[ir];
        (brr[ir]) = temp;
        ;
      }
      if (strcmp(Pair_Name[m], Pair_Name[m + 1]) > 0) {
        s_swap(Pair_Name, m, m + 1);
        temp = (brr[m]);
        (brr[m]) = brr[m + 1];
        (brr[m + 1]) = temp;
        ;
      }
      i = m + 1;
      j = ir;
      strcpy(p, Pair_Name[m + 1]);
      b = brr[m + 1];
      for (;;) {
        do
          i++;
        while (strcmp(Pair_Name[i], p) < 0);
        do
          j--;
        while (strcmp(Pair_Name[j], p) > 0);
        if (j < i)
          break;
        s_swap(Pair_Name, i, j);
        temp = (brr[i]);
        (brr[i]) = brr[j];
        (brr[j]) = temp;
        ;
      }
      strcpy(Pair_Name[m + 1], Pair_Name[j]);
      strcpy(Pair_Name[j], p);
      brr[m + 1] = brr[j];
      brr[j] = b;
      jstack += 2;
      if (jstack > NSTACK) {
        printf("Stack error: NSTACK too small\n");
        exit(0);
      }
      if (ir - i + 1 >= j - m) {
        istack[jstack] = ir;
        istack[jstack - 1] = i;
        ir = j - 1;
      } else {
        istack[jstack] = j - 1;
        istack[jstack - 1] = m;
        m = i;
      }
    }
  }
}
```