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

```asm
<sortints>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x298,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x288(%rsp)
  xor    %eax,%eax
  cmp    $0x1,%esi
  jle    L91
  mov    $0x1,%ebx
  mov    %esi,%r9d
  mov    %rdi,(%rsp)
  mov    %rdi,%r8
  mov    %esi,0x8(%rsp)
  lea    -0x1(%rbx),%r10d
  cmp    $0x9,%r9d
  jle    L409
  nopw   0x0(%rax,%rax,1)
L1:
  mov    %r9d,%eax
  movslq %r9d,%rdx
  mov    (%r8),%esi
  sar    %eax
  shl    $0x2,%rdx
  cltq
  mov    (%r8,%rax,4),%ecx
  lea    0x0(,%rax,4),%rbp
  lea    -0x4(%r8,%rdx,1),%rax
  mov    (%rax),%r11d
  cmp    $0x13f,%r9d
  jg     L44
  cmp    %ecx,%esi
  jg     L107
  cmp    %r11d,%esi
  cmovl  %r11d,%esi
  cmp    %r11d,%ecx
  cmovle %ecx,%esi
L300:
  cmp    %rax,%r8
  ja     L15
  mov    %r8,%rcx
  lea    0x4(%r8),%rbp
  mov    %rax,%rdi
  mov    %r8,%r12
  nopl   (%rax)
L467:
  mov    %rcx,%r11
  cmp    %esi,(%rcx)
  jg     L458
  jne    L39
  mov    (%r12),%edx
  add    $0x4,%r12
  mov    %edx,(%rcx)
  mov    %esi,-0x4(%r12)
L39:
  mov    %rbp,%r11
L473:
  add    $0x4,%rcx
  add    $0x4,%rbp
  cmp    %rax,%r11
  jbe    L467
L275:
  mov    %r12,%r15
  mov    %r11,%rdx
  mov    %r11,%r13
  sub    %r12,%rdx
  sub    %r8,%r15
  sar    $0x2,%rdx
  sar    $0x2,%r15
  cmp    %r15d,%edx
  mov    %edx,%ebp
  cmovle %edx,%r15d
  movslq %r15d,%r14
  lea    0x0(,%r14,4),%rcx
  sub    %rcx,%r13
  mov    %rdi,%rcx
  sub    %rax,%rcx
  sar    $0x2,%rcx
  mov    %ecx,%r12d
  test   %r15d,%r15d
  jle    L239
  xor    %eax,%eax
  cs nopw 0x0(%rax,%rax,1)
L315:
  mov    0x0(%r13,%rax,4),%r15d
  mov    %r15d,(%r8,%rax,4)
  mov    %esi,0x0(%r13,%rax,4)
  add    $0x1,%rax
  cmp    %rax,%r14
  jne    L315
L239:
  sub    %r8,%rdi
  lea    -0x1(%r9),%eax
  sar    $0x2,%rdi
  sub    %edi,%eax
  mov    %ecx,%edi
  cmp    %ecx,%eax
  cmovle %eax,%edi
  mov    %r9d,%eax
  sub    %edi,%eax
  cltq
  lea    (%r8,%rax,4),%r14
  test   %edi,%edi
  jle    L82
  movslq %edi,%rdi
  xor    %eax,%eax
  nop
L376:
  mov    (%r11,%rax,4),%r13d
  mov    %r13d,(%r14,%rax,4)
  mov    %esi,(%r11,%rax,4)
  add    $0x1,%rax
  cmp    %rax,%rdi
  jne    L376
L82:
  cmp    %ecx,%edx
  jle    L78
  cmp    $0x1,%edx
  jle    L324
  movslq %r10d,%r10
  shl    $0x4,%r10
  mov    %edx,0x8(%rsp,%r10,1)
  cmp    $0x1,%ecx
  jle    L94
L364:
  sub    %ecx,%r9d
  movslq %ebx,%rax
  movslq %r9d,%rdx
  shl    $0x4,%rax
  mov    %ecx,%r9d
  lea    (%r8,%rdx,4),%rdx
  mov    %ecx,0x8(%rsp,%rax,1)
  mov    %rdx,(%rsp,%rax,1)
  movslq %ebx,%rax
  add    $0x1,%ebx
L461:
  shl    $0x4,%rax
  lea    -0x1(%rbx),%r10d
  mov    (%rsp,%rax,1),%r8
  cmp    $0x9,%r9d
  jg     L1
L409:
  cmp    $0x1,%r9d
  jle    L15
  lea    0x4(%r8),%rdi
  mov    $0x1,%r11d
  nopl   0x0(%rax,%rax,1)
L430:
  mov    (%rdi),%esi
  mov    %rdi,%rax
  jmp    L478
  nop
L174:
  mov    %edx,(%rax)
  lea    -0x4(%rcx),%rax
  cmp    %rax,%r8
  je     L481
L478:
  mov    -0x4(%rax),%edx
  mov    %rax,%rcx
  cmp    %esi,%edx
  jg     L174
  add    $0x1,%r11d
  mov    %esi,(%rcx)
  add    $0x4,%rdi
  cmp    %r9d,%r11d
  jne    L430
  nopl   0x0(%rax,%rax,1)
L15:
  test   %r10d,%r10d
  je     L91
L432:
  lea    -0x1(%r10),%eax
  mov    %r10d,%ebx
  cltq
  mov    %rax,%rdx
  shl    $0x4,%rdx
  mov    0x8(%rsp,%rdx,1),%r9d
  jmp    L461
  nopl   0x0(%rax,%rax,1)
L423:
  jne    L197
  mov    (%rdi),%edx
  sub    $0x4,%rdi
  mov    %edx,(%rax)
  mov    %esi,0x4(%rdi)
L197:
  sub    $0x4,%rax
L458:
  cmp    %rax,%rcx
  ja     L275
  mov    (%rax),%edx
  cmp    %esi,%edx
  jge    L423
  cmp    %rax,%rcx
  ja     L275
  mov    (%rcx),%r11d
  sub    $0x4,%rax
  mov    %edx,(%rcx)
  mov    %r11d,0x4(%rax)
  mov    %rbp,%r11
  jmp    L473
L78:
  cmp    $0x1,%r12d
  jle    L103
  sub    %r12d,%r9d
  movslq %r10d,%r10
  movslq %r9d,%rax
  shl    $0x4,%r10
  lea    (%r8,%rax,4),%rax
  mov    %r12d,0x8(%rsp,%r10,1)
  mov    %rax,(%rsp,%r10,1)
  cmp    $0x1,%ebp
  jle    L94
L246:
  movslq %ebx,%rax
  mov    %ebp,%r9d
  shl    $0x4,%rax
  mov    %r8,(%rsp,%rax,1)
  mov    %ebp,0x8(%rsp,%rax,1)
  movslq %ebx,%rax
  add    $0x1,%ebx
  jmp    L461
L44:
  mov    0x4(%r8),%edi
  mov    0x8(%r8),%r12d
  cmp    %esi,%edi
  jl     L99
  cmp    %esi,%r12d
  cmovge %r12d,%esi
  cmp    %r12d,%edi
  cmovg  %esi,%edi
L90:
  mov    -0x4(%r8,%rbp,1),%esi
  mov    0x4(%r8,%rbp,1),%ebp
  cmp    %ecx,%esi
  jg     L64
  cmp    %ebp,%esi
  cmovl  %ebp,%esi
  cmp    %ecx,%ebp
  cmovge %ecx,%esi
L193:
  mov    -0xc(%r8,%rdx,1),%ecx
  mov    -0x8(%r8,%rdx,1),%edx
  cmp    %edx,%ecx
  jg     L121
  cmp    %r11d,%ecx
  cmovl  %r11d,%ecx
  cmp    %r11d,%edx
  cmovle %edx,%ecx
L232:
  cmp    %esi,%edi
  jg     L229
  cmp    %ecx,%edi
  cmovl  %ecx,%edi
  cmp    %ecx,%esi
  cmovg  %edi,%esi
  jmp    L300
  nopw   0x0(%rax,%rax,1)
L481:
  mov    %r8,%rcx
  add    $0x1,%r11d
  add    $0x4,%rdi
  mov    %esi,(%rcx)
  cmp    %r9d,%r11d
  jne    L430
  jmp    L15
L107:
  cmp    %r11d,%ecx
  cmovl  %r11d,%ecx
  cmp    %r11d,%esi
  cmovg  %ecx,%esi
  jmp    L300
L229:
  cmp    %ecx,%esi
  cmovl  %ecx,%esi
  cmp    %ecx,%edi
  cmovle %edi,%esi
  jmp    L300
L121:
  cmp    %r11d,%edx
  cmovl  %r11d,%edx
  cmp    %r11d,%ecx
  cmovg  %edx,%ecx
  jmp    L232
L64:
  cmp    %ecx,%ebp
  cmovge %ebp,%ecx
  cmp    %ebp,%esi
  cmovg  %ecx,%esi
  jmp    L193
L99:
  cmp    %r12d,%edi
  cmovl  %r12d,%edi
  cmp    %esi,%r12d
  cmovge %esi,%edi
  jmp    L90
L94:
  mov    %ebx,%r10d
  jmp    L432
L324:
  cmp    $0x1,%ecx
  jle    L15
  mov    %r10d,%ebx
  jmp    L364
L103:
  cmp    $0x1,%ebp
  jle    L15
  mov    %r10d,%ebx
  jmp    L246
L91:
  mov    0x288(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L476
  add    $0x298,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L476:
  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;
      }
    }
  }
}
```