user: Translate the below assembly code into C programming language:

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  lea    -0x7a1000(%rsp),%r11
L170:
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  cmp    %r11,%rsp
  jne    L170
  sub    $0x248,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x7a1238(%rsp)
  xor    %eax,%eax
  lea    0x18(%rsp),%rsi
  lea    D1(%rip),%rdi
  call   <scanf@plt>
  cmpq   $0x0,0x18(%rsp)
  jle    L33
  movq   $0x1,0x8(%rsp)
  lea    D1(%rip),%r13
  jmp    L225
L25:
  lea    0x30(%rsp,%r14,8),%rbp
  mov    $0x0,%ebx
L27:
  mov    %rbp,%rsi
  mov    %r13,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  add    $0x1,%rbx
  add    $0x8,%rbp
  cmp    %rbx,0x28(%rsp)
  jg     L27
L163:
  add    $0x1,%r12
  add    $0x3e8,%r14
  cmp    %r12,0x20(%rsp)
  jle    L153
L92:
  cmpq   $0x0,0x28(%rsp)
  jg     L25
  jmp    L163
L90:
  mov    0x0(%rbp,%rbx,8),%rsi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  add    $0x1,%rbx
  cmp    %rbx,0x28(%rsp)
  jg     L90
L114:
  mov    $0xa,%edi
  call   <putchar@plt>
  add    $0x1,%r15
  mov    0x20(%rsp),%rbx
  add    $0x1f40,%rbp
  cmp    %r15,%rbx
  jle    L69
L13:
  mov    $0x0,%ebx
  cmpq   $0x0,0x28(%rsp)
  jg     L90
  jmp    L114
L69:
  test   %rbx,%rbx
  jle    L116
  mov    $0x0,%ebp
L98:
  mov    0x28(%rsp),%rsi
  mov    %r14,%rdi
  call   <sort_rows@plt>
  add    $0x1,%rbp
  add    $0x1f40,%r14
  cmp    %rbp,%rbx
  jne    L98
L116:
  mov    0x28(%rsp),%rbp
  test   %rbp,%rbp
  jle    L104
  mov    $0x0,%ebx
  lea    0x30(%rsp),%r12
L48:
  mov    %rbp,%rsi
  mov    %r12,%rdi
  call   <sort_cols@plt>
  add    $0x1,%rbx
  cmp    %rbx,%rbp
  jne    L48
L104:
  lea    D17(%rip),%rdi
  call   <puts@plt>
  cmpq   $0x0,0x20(%rsp)
  jle    L5
  lea    0x30(%rsp),%rbp
  mov    $0x0,%r14d
  lea    D62(%rip),%r12
  jmp    L115
L230:
  mov    0x0(%rbp,%rbx,8),%rsi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  add    $0x1,%rbx
  cmp    %rbx,0x28(%rsp)
  jg     L230
L144:
  mov    $0xa,%edi
  call   <putchar@plt>
  add    $0x1,%r14
  add    $0x1f40,%rbp
  cmp    %r14,0x20(%rsp)
  jle    L5
L115:
  mov    $0x0,%ebx
  cmpq   $0x0,0x28(%rsp)
  jg     L230
  jmp    L144
L5:
  mov    $0xa,%edi
  call   <putchar@plt>
  addq   $0x1,0x8(%rsp)
  mov    0x8(%rsp),%rax
  cmp    %rax,0x18(%rsp)
  jl     L33
L225:
  lea    0x28(%rsp),%rdx
  lea    0x20(%rsp),%rsi
  lea    D21(%rip),%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  mov    $0x0,%r14d
  mov    $0x0,%r12d
  cmpq   $0x0,0x20(%rsp)
  jg     L92
L153:
  lea    D5(%rip),%rdi
  call   <puts@plt>
  cmpq   $0x0,0x20(%rsp)
  jle    L116
  lea    0x30(%rsp),%r14
  mov    %r14,%rbp
  mov    $0x0,%r15d
  lea    D62(%rip),%r12
  jmp    L13
L33:
  mov    0x7a1238(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L160
  mov    $0x0,%eax
  add    $0x7a1248,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L160:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: label: D1
data_type: string
name: disassemble_data
arguments: label: D17
data_type: string
name: disassemble_data
arguments: label: D62
data_type: string
name: disassemble_data
arguments: label: D21
data_type: string
name: disassemble_data
arguments: label: D5
data_type: string

tool: D1: %lld

tool: D17: Sorted Array:

tool: D62: %lld 

tool: D21: %lld %lld

tool: D5: Original array:

assistant: ```c
int main() {
  long long int arr[1000][1000];
  long long int i, j, row_size, col_size;
  long long int k, x, y, z, t, n, m;
  scanf("%lld", &t);
  for (k = 1; k <= t; k++) {
    scanf("%lld %lld", &n, &m);
    for (x = 0; x < n; x++) {
      for (y = 0; y < m; y++) {
        scanf("%lld", &arr[x][y]);
      }
    }
    printf("Original array:\n");
    for (i = 0; i < n; i++) {
      for (j = 0; j < m; j++) {
        printf("%lld ", arr[i][j]);
      }
      printf("\n");
    }
    row_size = n;
    for (i = 0; i < row_size; i++) {
      sort_rows(arr[i], m);
    }
    col_size = m;
    for (i = 0; i < col_size; i++) {
      sort_cols(arr, col_size);
    }
    printf("Sorted Array:\n");
    for (i = 0; i < n; i++) {
      for (j = 0; j < m; j++) {
        printf("%lld ", arr[i][j]);
      }
      printf("\n");
    }
    printf("\n");
  }
  return 0;
}
```