user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<main>:
  endbr64
  push   %r15
  lea    D8(%rip),%rdi
  push   %r14
  push   %r13
  push   %r12
  lea    D9(%rip),%r12
  push   %rbp
  push   %rbx
  sub    $0x48,%rsp
  movdqa D41(%rip),%xmm0
  mov    %fs:0x28,%rax
  mov    %rax,0x38(%rsp)
  xor    %eax,%eax
  mov    D29(%rip),%rax
  lea    0x38(%rsp),%r14
  lea    0x10(%rsp),%rbx
  movaps %xmm0,0x10(%rsp)
  movdqa D2(%rip),%xmm0
  mov    %rbx,%r13
  mov    %rax,0x30(%rsp)
  xor    %eax,%eax
  movaps %xmm0,0x20(%rsp)
  call   <printf@plt>
  mov    %r14,0x8(%rsp)
  nop
L139:
  mov    0x0(%r13),%esi
  mov    %r12,%rdi
  xor    %eax,%eax
  add    $0x4,%r13
  call   <printf@plt>
  cmp    %r14,%r13
  jne    L139
  mov    %rbx,%rax
  mov    $0x8,%r14d
  mov    $0x7,%r13d
  mov    $0x6,%r11d
  mov    $0x5,%r10d
  mov    $0x4,%r9d
  mov    $0x3,%r8d
  mov    $0x2,%esi
  mov    $0x9,%ecx
  jmp    L164
  nopl   (%rax)
L159:
  mov    %r15d,%ebp
L59:
  cmp    $0xa,%esi
  je     L66
  mov    0x8(%rax),%r15d
  cmp    %r15d,%edx
  jle    L183
  mov    %esi,%ebp
  mov    %r15d,%edx
L183:
  cmp    $0xa,%r8d
  je     L66
  mov    0xc(%rax),%r15d
  cmp    %r15d,%edx
  jle    L167
  mov    %r8d,%ebp
  mov    %r15d,%edx
L167:
  cmp    $0xa,%r9d
  je     L66
  mov    0x10(%rax),%r15d
  cmp    %r15d,%edx
  jle    L95
  mov    %r9d,%ebp
  mov    %r15d,%edx
L95:
  cmp    $0xa,%r10d
  je     L66
  mov    0x14(%rax),%r15d
  cmp    %r15d,%edx
  jle    L24
  mov    %r10d,%ebp
  mov    %r15d,%edx
L24:
  cmp    $0xa,%r11d
  je     L66
  mov    0x18(%rax),%r15d
  cmp    %r15d,%edx
  jle    L118
  mov    %r11d,%ebp
  mov    %r15d,%edx
L118:
  cmp    $0xa,%r13d
  je     L66
  mov    0x1c(%rax),%r15d
  cmp    %r15d,%edx
  jle    L41
  mov    %r13d,%ebp
  mov    %r15d,%edx
L41:
  cmp    $0xa,%r14d
  je     L66
  mov    0x20(%rax),%r15d
  cmp    %r15d,%edx
  jle    L20
  mov    %r14d,%ebp
  mov    %r15d,%edx
L20:
  cmp    $0xa,%ecx
  je     L149
  cmp    %edx,0x24(%rax)
  mov    $0x9,%edx
  cmovl  %edx,%ebp
L66:
  movslq %ebp,%rdx
  add    $0x1,%ecx
  add    $0x4,%rax
  mov    0x10(%rsp,%rdx,4),%r15d
  add    $0x1,%esi
  mov    %edi,0x10(%rsp,%rdx,4)
  add    $0x1,%r8d
  add    $0x1,%r9d
  add    $0x1,%r10d
  add    $0x1,%r11d
  add    $0x1,%r13d
  mov    %r15d,-0x4(%rax)
  add    $0x1,%r14d
  cmp    $0x12,%ecx
  je     L127
L164:
  mov    (%rax),%edi
  mov    0x4(%rax),%edx
  lea    -0x8(%rcx),%r15d
  cmp    %edi,%edx
  jl     L159
  mov    %edi,%edx
  jmp    L59
  nop
L127:
  lea    D58(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    0x8(%rsp),%rbp
  nopl   0x0(%rax,%rax,1)
L16:
  mov    (%rbx),%esi
  mov    %r12,%rdi
  xor    %eax,%eax
  add    $0x4,%rbx
  call   <printf@plt>
  cmp    %rbp,%rbx
  jne    L16
  mov    0x38(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L105
  add    $0x48,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L149:
  movslq %ebp,%rdx
  add    $0x4,%rax
  add    $0x1,%esi
  add    $0x1,%r8d
  mov    0x10(%rsp,%rdx,4),%ecx
  add    $0x1,%r9d
  mov    %edi,0x10(%rsp,%rdx,4)
  add    $0x1,%r10d
  add    $0x1,%r11d
  add    $0x1,%r13d
  add    $0x1,%r14d
  mov    %ecx,-0x4(%rax)
  mov    $0xb,%ecx
  jmp    L164
L105:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: data_tag: D8
type: string
name: parse_data
arguments: data_tag: D9
type: string
name: parse_data
arguments: data_tag: D41
type: byte[16]
name: parse_data
arguments: data_tag: D29
type: byte[8]
name: parse_data
arguments: data_tag: D2
type: byte[16]
name: parse_data
arguments: data_tag: D58
type: string

tool: D8: Order before:

tool: D9: %5d

tool: {"D41": [0x08,0x00,0x00,0x00,0x1b,0x00,0x00,0x00,0x1e,0x00,0x00,0x00,0x04,0x00,0x00,0x00]}

tool: {"D29": [0x18,0x00,0x00,0x00,0x23,0x00,0x00,0x00]}

tool: {"D2": [0x05,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x11,0x00,0x00,0x00,0x13,0x00,0x00,0x00]}

tool: D58: 
Order after:

assistant: ```c
void main() {
  int orders[10] = {8, 27, 30, 4, 5, 2, 17, 19, 24, 35};
  int i, j, amount = 10, min, ex, position;
  printf("Order before:");
  for (i = 0; i < amount; i++) {
    printf("%5d", orders[i]);
  }
  for (i = 0; i < amount - 1; i++) {
    min = orders[i];
    for (j = i + 1; j < amount; j++) {
      if (orders[j] < min) {
        min = orders[j];
        position = j;
      }
    }
    ex = orders[position];
    orders[position] = orders[i];
    orders[i] = ex;
  }
  printf("\nOrder after:");
  for (i = 0; i < amount; i++) {
    printf("%5d", orders[i]);
  }
}
```