user: What would the C source look like for the assembly code provided here?

```asm
<sortints>:
  endbr64
  push   %r14
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x298,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x288(%rsp)
  xor    %eax,%eax
  cmp    $0x1,%esi
  jle    L306
  mov    %rdi,(%rsp)
  mov    %esi,0x8(%rsp)
  mov    $0x1,%ebx
  jmp    L5
L314:
  cmp    $0x1,%r10d
  jle    L103
  mov    $0x1,%edi
  jmp    L10
L185:
  movslq %ecx,%rcx
  mov    %esi,(%r8,%rcx,4)
  add    $0x1,%rdi
  cmp    %edi,%r10d
  jle    L241
L10:
  mov    (%r8,%rdi,4),%esi
  mov    %rdi,%rax
L67:
  mov    %eax,%ecx
  mov    -0x4(%r8,%rax,4),%edx
  cmp    %esi,%edx
  jle    L185
  mov    %edx,(%r8,%rax,4)
  sub    $0x1,%rax
  mov    %eax,%ecx
  test   %eax,%eax
  jne    L67
  jmp    L185
L241:
  mov    %r11d,%ebx
L281:
  test   %ebx,%ebx
  jle    L306
L5:
  lea    -0x1(%rbx),%r11d
  movslq %r11d,%rax
  shl    $0x4,%rax
  mov    (%rsp,%rax,1),%r8
  mov    0x8(%rsp,%rax,1),%r10d
  cmp    $0x9,%r10d
  jle    L314
  cmp    $0x13f,%r10d
  jg     L215
  mov    (%r8),%ecx
  mov    %r10d,%eax
  shr    $0x1f,%eax
  add    %r10d,%eax
  sar    %eax
  cltq
  mov    (%r8,%rax,4),%eax
  cmp    %eax,%ecx
  jg     L115
  movslq %r10d,%rdx
  mov    -0x4(%r8,%rdx,4),%edx
  cmp    %edx,%ecx
  cmovl  %edx,%ecx
  cmp    %edx,%eax
  cmovle %eax,%ecx
L149:
  movslq %r10d,%rax
  lea    -0x4(%r8,%rax,4),%rax
  mov    %r8,%r9
  mov    %rax,%rdi
  mov    %r8,%rbp
  jmp    L316
L115:
  movslq %r10d,%rdx
  mov    -0x4(%r8,%rdx,4),%edx
  cmp    %edx,%eax
  cmovl  %edx,%eax
  cmp    %edx,%ecx
  cmovg  %eax,%ecx
  jmp    L149
L215:
  mov    (%r8),%ecx
  mov    0x4(%r8),%eax
  cmp    %eax,%ecx
  jg     L339
  mov    0x8(%r8),%edx
  cmp    %edx,%ecx
  cmovl  %edx,%ecx
  cmp    %edx,%eax
  cmovle %eax,%ecx
L420:
  mov    %r10d,%eax
  shr    $0x1f,%eax
  add    %r10d,%eax
  sar    %eax
  cltq
  lea    0x0(,%rax,4),%rsi
  mov    -0x4(%r8,%rsi,1),%edx
  mov    (%r8,%rax,4),%eax
  cmp    %eax,%edx
  jg     L342
  mov    0x4(%r8,%rsi,1),%esi
  cmp    %esi,%edx
  cmovl  %esi,%edx
  cmp    %esi,%eax
  cmovle %eax,%edx
L371:
  movslq %r10d,%rsi
  shl    $0x2,%rsi
  mov    -0xc(%r8,%rsi,1),%eax
  mov    -0x8(%r8,%rsi,1),%edi
  cmp    %edi,%eax
  jg     L408
  mov    -0x4(%r8,%rsi,1),%esi
  cmp    %esi,%eax
  cmovl  %esi,%eax
  cmp    %esi,%edi
  cmovle %edi,%eax
L354:
  cmp    %edx,%ecx
  jg     L104
  cmp    %eax,%ecx
  cmovl  %eax,%ecx
  cmp    %eax,%edx
  cmovle %edx,%ecx
  jmp    L149
L339:
  mov    0x8(%r8),%edx
  cmp    %edx,%eax
  cmovl  %edx,%eax
  cmp    %edx,%ecx
  cmovg  %eax,%ecx
  jmp    L420
L342:
  mov    0x4(%r8,%rsi,1),%esi
  cmp    %esi,%eax
  cmovl  %esi,%eax
  cmp    %esi,%edx
  cmovg  %eax,%edx
  jmp    L371
L408:
  mov    -0x4(%r8,%rsi,1),%esi
  cmp    %esi,%edi
  cmovl  %esi,%edi
  cmp    %esi,%eax
  cmovg  %edi,%eax
  jmp    L354
L104:
  cmp    %eax,%edx
  cmovl  %eax,%edx
  cmp    %eax,%ecx
  cmovg  %edx,%ecx
  jmp    L149
L218:
  sub    $0x4,%rax
  cmp    %rax,%rsi
  ja     L242
L286:
  mov    (%rax),%edx
  cmp    %ecx,%edx
  jl     L359
  jne    L218
  mov    (%rdi),%edx
  mov    %edx,(%rax)
  mov    %ecx,(%rdi)
  sub    $0x4,%rdi
  jmp    L218
L359:
  cmp    %rax,%rsi
  ja     L242
  mov    (%rsi),%edx
  mov    (%rax),%r12d
  mov    %r12d,(%rsi)
  mov    %edx,(%rax)
  sub    $0x4,%rax
L427:
  add    $0x4,%r9
L316:
  mov    %r9,%rsi
  cmp    %rax,%r9
  ja     L242
  mov    (%r9),%edx
  cmp    %ecx,%edx
  jg     L286
  jne    L427
  mov    0x0(%rbp),%edx
  mov    %edx,(%rsi)
  mov    %ecx,0x0(%rbp)
  add    $0x4,%rbp
  jmp    L427
L242:
  mov    %rsi,%r12
  sub    %rbp,%r12
  sar    $0x2,%r12
  mov    %rbp,%r9
  sub    %r8,%r9
  sar    $0x2,%r9
  cmp    %r9d,%r12d
  cmovle %r12d,%r9d
  movslq %r9d,%rdx
  shl    $0x2,%rdx
  mov    %rsi,%rbp
  sub    %rdx,%rbp
  test   %r9d,%r9d
  jle    L392
  mov    %r9d,%r9d
  mov    $0x0,%edx
L144:
  mov    0x0(%rbp,%rdx,4),%r14d
  mov    %r14d,(%r8,%rdx,4)
  mov    %ecx,0x0(%rbp,%rdx,4)
  add    $0x1,%rdx
  cmp    %r9,%rdx
  jne    L144
L392:
  mov    %rdi,%r9
  sub    %rax,%r9
  sar    $0x2,%r9
  lea    -0x1(%r10),%edx
  sub    %r8,%rdi
  sar    $0x2,%rdi
  sub    %edi,%edx
  cmp    %r9d,%edx
  cmovg  %r9d,%edx
  mov    %r10d,%eax
  sub    %edx,%eax
  cltq
  lea    (%r8,%rax,4),%rbp
  test   %edx,%edx
  jle    L181
  mov    %edx,%edx
  mov    $0x0,%eax
L208:
  mov    (%rsi,%rax,4),%edi
  mov    %edi,0x0(%rbp,%rax,4)
  mov    %ecx,(%rsi,%rax,4)
  add    $0x1,%rax
  cmp    %rdx,%rax
  jne    L208
L181:
  cmp    %r9d,%r12d
  jle    L152
  cmp    $0x1,%r12d
  jle    L183
  movslq %r11d,%r11
  shl    $0x4,%r11
  mov    %r12d,0x8(%rsp,%r11,1)
  mov    %ebx,%r11d
L183:
  mov    %r11d,%ebx
  cmp    $0x1,%r9d
  jle    L281
  movslq %r11d,%rax
  shl    $0x4,%rax
  sub    %r9d,%r10d
  movslq %r10d,%rdx
  lea    (%r8,%rdx,4),%rdx
  mov    %rdx,(%rsp,%rax,1)
  mov    %r9d,0x8(%rsp,%rax,1)
  lea    0x1(%r11),%ebx
  jmp    L281
L152:
  cmp    $0x1,%r9d
  jle    L222
  movslq %r11d,%r11
  shl    $0x4,%r11
  sub    %r9d,%r10d
  movslq %r10d,%rax
  lea    (%r8,%rax,4),%rax
  mov    %rax,(%rsp,%r11,1)
  mov    %r9d,0x8(%rsp,%r11,1)
  mov    %ebx,%r11d
L222:
  mov    %r11d,%ebx
  cmp    $0x1,%r12d
  jle    L281
  movslq %r11d,%rax
  shl    $0x4,%rax
  mov    %r8,(%rsp,%rax,1)
  mov    %r12d,0x8(%rsp,%rax,1)
  lea    0x1(%r11),%ebx
  jmp    L281
L103:
  mov    %r11d,%ebx
  jmp    L281
L306:
  mov    0x288(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L254
  add    $0x298,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r14
  ret
L254:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void sortints(int *x, int n) {
  int i, j;
  int a, d, ba, dc, s, nn;
  int tmp1, v, v1, v2, v3;
  int *x0, *xa, *xb, *xc, *xd, *xh, *xl;
  struct {
    int *addr;
    int len;
  } stack[40];
  int top;
  top = 0;
  if (n > 1) {
    stack[top].addr = x;
    stack[top].len = n;
    ++top;
  }
  while (top > 0) {
    --top;
    x0 = stack[top].addr;
    nn = stack[top].len;
    if (nn < 10) {
      for (i = 1; i < nn; ++i) {
        tmp1 = x0[i];
        for (j = i; x0[j - 1] > tmp1;) {
          x0[j] = x0[j - 1];
          if (--j == 0)
            break;
        }
        x0[j] = tmp1;
      }
      continue;
    }
    if (nn < 320)
      v = ((x0[0]) <= (x0[nn / 2]) ? ((x0[nn / 2]) <= (x0[nn - 1]) ? (x0[nn / 2]) : (x0[nn - 1]) <= (x0[0]) ? (x0[0]) : (x0[nn - 1])) : ((x0[0]) <= (x0[nn - 1]) ? (x0[0]) : (x0[nn - 1]) <= (x0[nn / 2]) ? (x0[nn / 2]) : (x0[nn - 1])));
    else {
      v1 = ((x0[0]) <= (x0[1]) ? ((x0[1]) <= (x0[2]) ? (x0[1]) : (x0[2]) <= (x0[0]) ? (x0[0]) : (x0[2])) : ((x0[0]) <= (x0[2]) ? (x0[0]) : (x0[2]) <= (x0[1]) ? (x0[1]) : (x0[2])));
      v2 = ((x0[nn / 2 - 1]) <= (x0[nn / 2]) ? ((x0[nn / 2]) <= (x0[nn / 2 + 1]) ? (x0[nn / 2]) : (x0[nn / 2 + 1]) <= (x0[nn / 2 - 1]) ? (x0[nn / 2 - 1]) : (x0[nn / 2 + 1])) : ((x0[nn / 2 - 1]) <= (x0[nn / 2 + 1]) ? (x0[nn / 2 - 1]) : (x0[nn / 2 + 1]) <= (x0[nn / 2]) ? (x0[nn / 2]) : (x0[nn / 2 + 1])));
      v3 = ((x0[nn - 3]) <= (x0[nn - 2]) ? ((x0[nn - 2]) <= (x0[nn - 1]) ? (x0[nn - 2]) : (x0[nn - 1]) <= (x0[nn - 3]) ? (x0[nn - 3]) : (x0[nn - 1])) : ((x0[nn - 3]) <= (x0[nn - 1]) ? (x0[nn - 3]) : (x0[nn - 1]) <= (x0[nn - 2]) ? (x0[nn - 2]) : (x0[nn - 1])));
      v = ((v1) <= (v2) ? ((v2) <= (v3) ? (v2) : (v3) <= (v1) ? (v1) : (v3)) : ((v1) <= (v3) ? (v1) : (v3) <= (v2) ? (v2) : (v3)));
    }
    xa = xb = x0;
    xc = xd = x0 + (nn - 1);
    for (;;) {
      while (xb <= xc && *xb <= v) {
        if (*xb == v) {
          *xb = *xa;
          *xa = v;
          ++xa;
        }
        ++xb;
      }
      while (xc >= xb && *xc >= v) {
        if (*xc == v) {
          *xc = *xd;
          *xd = v;
          --xd;
        }
        --xc;
      }
      if (xb > xc)
        break;
      tmp1 = *xb;
      *xb = *xc;
      *xc = tmp1;
      ;
      ++xb;
      --xc;
    }
    a = xa - x0;
    ba = xb - xa;
    if (ba > a)
      s = a;
    else
      s = ba;
    for (xl = x0, xh = xb - s; s > 0; --s) {
      *xl = *xh;
      *xh = v;
      ++xl;
      ++xh;
    }
    d = xd - x0;
    dc = xd - xc;
    if (dc > nn - 1 - d)
      s = nn - 1 - d;
    else
      s = dc;
    for (xl = xb, xh = x0 + (nn - s); s > 0; --s) {
      *xh = *xl;
      *xl = v;
      ++xl;
      ++xh;
    }
    if (ba > dc) {
      if (ba > 1) {
        stack[top].addr = x0;
        stack[top].len = ba;
        ++top;
      }
      if (dc > 1) {
        stack[top].addr = x0 + (nn - dc);
        stack[top].len = dc;
        ++top;
      }
    } else {
      if (dc > 1) {
        stack[top].addr = x0 + (nn - dc);
        stack[top].len = dc;
        ++top;
      }
      if (ba > 1) {
        stack[top].addr = x0;
        stack[top].len = ba;
        ++top;
      }
    }
  }
}
```