user: 请从给定的汇编指令推导出C源代码:

```asm
<insertsortsad>:
  endbr64
  cmp    $0x1,%edx
  jle    L157
  push   %r15
  lea    0x4(%rsi),%rax
  mov    $0x1,%r15d
  push   %r14
  lea    -0xc(%rsi),%r14
  push   %r13
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  lea    -0x8(%rdi),%rbp
  push   %rbx
  mov    %rsi,%rbx
  mov    %rax,-0x58(%rsp)
  lea    -0x4(%rdi),%rax
  mov    %rax,-0x18(%rsp)
  lea    0x8(%rdi),%rax
  mov    %rax,-0x30(%rsp)
  lea    0x8(%rsi),%rax
  mov    %rax,-0x28(%rsp)
  movslq %edx,%rax
  mov    %rax,-0x10(%rsp)
  movq   $0x4,-0x50(%rsp)
L105:
  mov    -0x58(%rsp),%rcx
  sub    -0x18(%rsp),%rcx
  lea    0x4(%r14),%r10
  xor    %eax,%eax
  lea    0x8(%rcx),%rsi
  mov    %r15d,-0x44(%rsp)
  mov    %r15d,%edx
  mov    %rsi,-0x20(%rsp)
  mov    -0x50(%rsp),%rsi
  mov    %r15d,-0x3c(%rsp)
  sub    $0x8,%rsi
  mov    %r10,-0x60(%rsp)
  mov    %rsi,-0x38(%rsp)
  jmp    L116
  nopl   0x0(%rax,%rax,1)
L50:
  add    $0x1,%rax
  add    $0x1,%ecx
  mov    %edi,%edx
  cmp    %r15,%rax
  je     L71
L116:
  mov    0xc(%rbp),%esi
  mov    %eax,%ecx
  lea    -0x1(%rdx),%edi
  cmp    %esi,(%r12,%rax,4)
  jle    L50
  cmpq   $0x8,-0x20(%rsp)
  mov    -0x58(%rsp),%r10
  mov    %eax,%r9d
  seta   %r11b
  cmp    -0x30(%rsp),%r14
  setae  %r8b
  cmp    -0x28(%rsp),%rbp
  mov    (%r10),%r13d
  setae  -0x3d(%rsp)
  movzbl -0x3d(%rsp),%r10d
  or     %r10d,%r8d
  and    %r11d,%r8d
  cmp    $0x1,%edx
  setne  %r11b
  test   %r11b,%r8b
  je     L9
  cmp    -0x3c(%rsp),%eax
  jge    L9
  cmp    %eax,-0x44(%rsp)
  mov    $0x1,%r11d
  cmovle %r11d,%edx
  cmp    $0x2,%edi
  jbe    L79
  mov    %edx,%r9d
  mov    -0x60(%rsp),%r10
  lea    -0x4(%rbp),%r11
  xor    %r8d,%r8d
  shr    $0x2,%r9d
  neg    %r9
  shl    $0x4,%r9
  nop
L183:
  movdqu (%r11,%r8,1),%xmm1
  movups %xmm1,0x0(%rbp,%r8,1)
  movdqu (%r14,%r8,1),%xmm2
  movups %xmm2,(%r10,%r8,1)
  sub    $0x10,%r8
  cmp    %r9,%r8
  jne    L183
  mov    -0x44(%rsp),%r8d
  mov    %edx,%r9d
  mov    %r10,-0x60(%rsp)
  and    $0xfffffffc,%r9d
  sub    %r9d,%r8d
  cmp    %r9d,%edx
  je     L194
L204:
  sub    %r9d,%edx
  cmp    $0x1,%edx
  je     L148
  mov    -0x38(%rsp),%r11
  neg    %r9
  mov    -0x50(%rsp),%r10
  shl    $0x2,%r9
  add    %r9,%r11
  lea    -0x4(%r10,%r9,1),%r9
  movq   (%r12,%r11,1),%xmm0
  movq   %xmm0,(%r12,%r9,1)
  mov    (%rbx,%r11,1),%r11
  mov    %r11,(%rbx,%r9,1)
  mov    %edx,%r9d
  and    $0xfffffffe,%r9d
  sub    %r9d,%r8d
  cmp    %r9d,%edx
  je     L194
L148:
  movslq %r8d,%r8
  lea    0x0(,%r8,4),%rdx
  mov    -0x4(%r12,%rdx,1),%r9d
  mov    %r9d,(%r12,%r8,4)
  mov    -0x4(%rbx,%rdx,1),%edx
  mov    %edx,(%rbx,%r8,4)
L194:
  mov    %esi,(%r12,%rax,4)
  add    $0x1,%ecx
  mov    %edi,%edx
  mov    %r13d,(%rbx,%rax,4)
  add    $0x1,%rax
  cmp    %r15,%rax
  jne    L116
L71:
  mov    -0x3c(%rsp),%r13d
  mov    -0x60(%rsp),%r10
  movslq %ecx,%rax
  mov    -0x58(%rsp),%rsi
  cmp    %r13d,%ecx
  jl     L98
  jmp    L32
  nopl   0x0(%rax)
L160:
  add    $0x1,%rax
  cmp    %eax,%r13d
  jle    L32
L98:
  mov    0xc(%rbp),%edx
  cmp    (%r12,%rax,4),%edx
  jge    L160
  mov    (%rsi),%ecx
  mov    %edx,(%r12,%rax,4)
  mov    %ecx,(%rbx,%rax,4)
  add    $0x1,%rax
  cmp    %eax,%r13d
  jg     L98
L32:
  addq   $0x4,-0x58(%rsp)
  add    $0x1,%r15
  mov    %r10,%r14
  add    $0x4,%rbp
  addq   $0x4,-0x18(%rsp)
  addq   $0x4,-0x30(%rsp)
  addq   $0x4,-0x28(%rsp)
  addq   $0x4,-0x50(%rsp)
  cmp    -0x10(%rsp),%r15
  jne    L105
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L9:
  mov    -0x60(%rsp),%r10
  mov    %r15,%rdi
L192:
  mov    -0x4(%r12,%rdi,4),%r8d
  mov    %r8d,(%r12,%rdi,4)
  mov    -0x4(%rbx,%rdi,4),%r8d
  mov    %r8d,(%rbx,%rdi,4)
  sub    $0x1,%rdi
  cmp    %edi,%r9d
  jl     L192
  mov    %r10,-0x60(%rsp)
  lea    -0x1(%rdx),%edi
  jmp    L194
L79:
  mov    -0x44(%rsp),%r8d
  xor    %r9d,%r9d
  jmp    L204
L157:
  ret
```

assistant: ```c
void insertsortsad(int arr[], int idx[], int len) {
  int i, j, k;
  for (i = 1; i <= len - 1; ++i) {
    for (j = 0; j < i; ++j) {
      if (arr[j] > arr[i]) {
        int temp, tempi;
        temp = arr[i];
        tempi = idx[i];
        for (k = i; k > j; k--) {
          arr[k] = arr[k - 1];
          idx[k] = idx[k - 1];
        }
        arr[j] = temp;
        idx[j] = tempi;
      }
    }
  }
}
```