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

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x38,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  lea    -0x3c(%rbp),%rdx
  lea    -0x40(%rbp),%rsi
  lea    D2(%rip),%rdi
  call   <scanf@plt>
  mov    -0x40(%rbp),%ecx
  movslq -0x3c(%rbp),%rax
  lea    0x0(,%rax,4),%r13
  movslq %ecx,%rdx
  imul   %rdx,%rax
  lea    0xf(,%rax,4),%rax
  mov    %rax,%rdi
  and    $0xfffffffffffffff0,%rdi
  and    $0xfffffffffffff000,%rax
  mov    %rsp,%rsi
  sub    %rax,%rsi
L121:
  cmp    %rsi,%rsp
  je     L78
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L121
L78:
  mov    %rdi,%rax
  and    $0xfff,%eax
  sub    %rax,%rsp
  test   %rax,%rax
  je     L103
  orq    $0x0,-0x8(%rsp,%rax,1)
L103:
  mov    %rsp,%r14
  lea    0xf(,%rdx,4),%rax
  mov    %rax,%rdx
  and    $0xfffffffffffffff0,%rdx
  and    $0xfffffffffffff000,%rax
  mov    %rsp,%rsi
  sub    %rax,%rsi
L35:
  cmp    %rsi,%rsp
  je     L149
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L35
L149:
  mov    %rdx,%rax
  and    $0xfff,%eax
  sub    %rax,%rsp
  test   %rax,%rax
  je     L132
  orq    $0x0,-0x8(%rsp,%rax,1)
L132:
  mov    %rsp,-0x60(%rbp)
  lea    0xf(%r13),%rdx
  mov    %rdx,%rax
  and    $0xfffffffffffffff0,%rax
  and    $0xfffffffffffff000,%rdx
  mov    %rsp,%rsi
  sub    %rdx,%rsi
L50:
  cmp    %rsi,%rsp
  je     L38
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L50
L38:
  mov    %rax,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  je     L94
  orq    $0x0,-0x8(%rsp,%rdx,1)
L94:
  mov    %rsp,%r15
  test   %ecx,%ecx
  jle    L10
  shr    $0x2,%r13
  movq   $0x0,-0x50(%rbp)
  movq   $0x0,-0x48(%rbp)
  jmp    L137
L81:
  mov    %r12,%rsi
  lea    D1(%rip),%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  movslq %ebx,%rax
  imul   %r13,%rax
  mov    (%r14,%rax,4),%eax
  mov    %eax,(%r15,%rbx,4)
  add    $0x1,%rbx
  add    $0x4,%r12
  cmp    %ebx,-0x3c(%rbp)
  jg     L81
L100:
  movslq -0x54(%rbp),%rax
  imul   %r13,%rax
  mov    (%r14,%rax,4),%eax
  mov    -0x60(%rbp),%rdx
  mov    -0x48(%rbp),%rcx
  mov    %eax,(%rdx,%rcx,4)
  mov    %rcx,%rax
  add    $0x1,%rax
  mov    %rax,-0x48(%rbp)
  add    %r13,-0x50(%rbp)
  cmp    %eax,-0x40(%rbp)
  jle    L10
L137:
  mov    -0x48(%rbp),%eax
  mov    %eax,-0x54(%rbp)
  mov    -0x50(%rbp),%rax
  lea    (%r14,%rax,4),%r12
  mov    $0x0,%ebx
  cmpl   $0x0,-0x3c(%rbp)
  jg     L81
  jmp    L100
L10:
  mov    -0x3c(%rbp),%esi
  mov    %r15,%rdi
  call   <selection_sort@plt>
  mov    %rax,%rbx
  mov    -0x40(%rbp),%esi
  mov    -0x60(%rbp),%rdi
  call   <selection_sort@plt>
  lea    (%rbx,%rax,1),%esi
  lea    D1(%rip),%rdi
  call   <printf@plt>
  mov    -0x38(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L104
  mov    $0x0,%eax
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
L104:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: tag: D2
type_infered: string
name: retrieve_data
arguments: tag: D1
type_infered: string

tool: D2: %d %d

tool: D1: %d

assistant: ```c
int main(int argc, char const *argv[]) {
  int a, b, i, j, count = 0;
  scanf("%d %d", &a, &b);
  int c[a][b], d[a], e[b];
  for (i = 0; i < a; ++i) {
    for (j = 0; j < b; ++j) {
      scanf("%d", &c[i][j]);
      e[j] = c[j][0];
    }
    d[i] = c[i][0];
  }
  count += selection_sort(e, b) + selection_sort(d, a);
  printf("%d", count);
  return 0;
}
```