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

```asm
<risolvi>:
  endbr64
  mov    %edi,%ecx
  test   %edi,%edi
  jle    L182
  push   %r15
  lea    -0x1(%rcx),%eax
  mov    %ecx,%r11d
  mov    %rsi,%rdi
  push   %r14
  mov    %rdx,%r10
  push   %r13
  push   %r12
  push   %rbp
  lea    0x0(,%r11,4),%rbp
  push   %rbx
  xor    %ebx,%ebx
  mov    %rax,-0x38(%rsp)
  lea    (%rax,%rax,4),%rax
  shl    $0x3,%rax
  mov    %rax,-0x30(%rsp)
  lea    0x28(%rsi,%rax,1),%r9
  nopl   (%rax)
L276:
  lea    (%rdi,%rbx,1),%rax
  xor    %r8d,%r8d
  xor    %esi,%esi
  nopl   0x0(%rax)
L472:
  mov    (%rax),%edx
  cmp    %esi,%edx
  jle    L9
  add    $0x1,%r8d
  mov    %edx,%esi
L9:
  add    $0x28,%rax
  cmp    %r9,%rax
  jne    L472
  cmp    %r8d,(%r10,%rbx,1)
  jne    L353
  add    $0x4,%rbx
  lea    0x4(%rax),%r9
  cmp    %rbp,%rbx
  jne    L276
  movslq %ecx,%rax
  mov    %rdi,-0x10(%rsp)
  lea    (%r11,%r11,4),%r11
  xor    %edx,%edx
  mov    %rax,-0x28(%rsp)
  shl    $0x2,%rax
  shl    $0x3,%r11
  mov    %rax,-0x20(%rsp)
  lea    (%rdi,%rax,1),%r8
  add    %r10,%rax
  mov    %rax,-0x18(%rsp)
  mov    %rax,%r9
  lea    -0x2(%rcx),%eax
  cltq
  mov    %r10,-0x8(%rsp)
  lea    (%rdi,%rax,4),%r12
  lea    -0x3(%rcx),%eax
  cltq
  lea    (%rdi,%rax,4),%r13
  lea    -0x4(%rcx),%eax
  cltq
  lea    (%rdi,%rax,4),%r14
  lea    -0x5(%rcx),%eax
  cltq
  lea    (%rdi,%rax,4),%r15
  lea    -0x6(%rcx),%eax
  cltq
  lea    (%rdi,%rax,4),%rbp
  lea    -0x7(%rcx),%eax
  cltq
  lea    (%rdi,%rax,4),%rax
  mov    %rax,-0x60(%rsp)
  lea    -0x8(%rcx),%eax
  cltq
  lea    (%rdi,%rax,4),%rax
  mov    %rax,-0x58(%rsp)
  lea    -0x9(%rcx),%eax
  cltq
  lea    (%rdi,%rax,4),%rax
  mov    %rax,-0x50(%rsp)
  lea    -0xa(%rcx),%eax
  cltq
  lea    (%rdi,%rax,4),%rax
  mov    %rax,-0x48(%rsp)
  lea    -0xb(%rcx),%eax
  cltq
  lea    (%rdi,%rax,4),%rax
  mov    %rax,-0x40(%rsp)
  nopl   0x0(%rax,%rax,1)
L577:
  mov    -0x4(%r8),%eax
  mov    $0x1,%esi
  test   %eax,%eax
  jg     L72
  xor    %esi,%esi
  xor    %eax,%eax
L72:
  cmp    $0x1,%ecx
  je     L61
  mov    (%r12,%rdx,1),%edi
  cmp    %edi,%eax
  jge    L240
  add    $0x1,%esi
  mov    %edi,%eax
L240:
  cmp    $0x2,%ecx
  je     L61
  mov    0x0(%r13,%rdx,1),%edi
  cmp    %edi,%eax
  jge    L166
  add    $0x1,%esi
  mov    %edi,%eax
L166:
  cmp    $0x3,%ecx
  je     L61
  mov    (%r14,%rdx,1),%edi
  cmp    %edi,%eax
  jge    L490
  add    $0x1,%esi
  mov    %edi,%eax
L490:
  cmp    $0x4,%ecx
  je     L61
  mov    (%r15,%rdx,1),%edi
  cmp    %edi,%eax
  jge    L365
  add    $0x1,%esi
  mov    %edi,%eax
L365:
  cmp    $0x5,%ecx
  je     L61
  mov    0x0(%rbp,%rdx,1),%edi
  cmp    %edi,%eax
  jge    L52
  add    $0x1,%esi
  mov    %edi,%eax
L52:
  cmp    $0x6,%ecx
  je     L61
  mov    -0x60(%rsp),%rbx
  mov    (%rbx,%rdx,1),%edi
  cmp    %edi,%eax
  jge    L20
  add    $0x1,%esi
  mov    %edi,%eax
L20:
  cmp    $0x7,%ecx
  je     L61
  mov    -0x58(%rsp),%rbx
  mov    (%rbx,%rdx,1),%edi
  cmp    %edi,%eax
  jge    L397
  add    $0x1,%esi
  mov    %edi,%eax
L397:
  cmp    $0x8,%ecx
  je     L61
  mov    -0x50(%rsp),%rbx
  mov    (%rbx,%rdx,1),%edi
  cmp    %edi,%eax
  jge    L395
  add    $0x1,%esi
  mov    %edi,%eax
L395:
  cmp    $0x9,%ecx
  je     L61
  mov    -0x48(%rsp),%rbx
  mov    (%rbx,%rdx,1),%edi
  cmp    %edi,%eax
  jge    L68
  add    $0x1,%esi
  mov    %edi,%eax
L68:
  cmp    $0xa,%ecx
  je     L61
  mov    -0x40(%rsp),%rbx
  mov    (%rbx,%rdx,1),%edi
  cmp    %edi,%eax
  jge    L422
  add    $0x1,%esi
  mov    %edi,%eax
L422:
  mov    %r8,%r10
  mov    $0xb,%edi
  cmp    $0xb,%ecx
  je     L61
L216:
  mov    -0x30(%r10),%ebx
  cmp    %eax,%ebx
  jle    L249
  add    $0x1,%esi
  mov    %ebx,%eax
L249:
  add    $0x1,%edi
  sub    $0x4,%r10
  cmp    %ecx,%edi
  jne    L216
  nopl   0x0(%rax,%rax,1)
L61:
  cmp    %esi,(%r9)
  jne    L353
  add    $0x28,%rdx
  add    $0x28,%r8
  add    $0x4,%r9
  cmp    %r11,%rdx
  jne    L577
  mov    -0x28(%rsp),%rsi
  mov    -0x10(%rsp),%rdi
  mov    -0x8(%rsp),%r10
  mov    -0x18(%rsp),%rbx
  lea    (%rsi,%rsi,4),%rax
  add    -0x20(%rsp),%rbx
  lea    (%rsi,%rax,2),%rax
  mov    -0x30(%rsp),%rsi
  mov    %rbx,%r11
  lea    -0x54(%rdi,%rax,4),%r8
  lea    (%rcx,%rcx,1),%eax
  cltq
  add    -0x38(%rsp),%rax
  sub    %rsi,%r8
  lea    0x4(%r10,%rax,4),%rbp
  lea    0x28(%rsi),%r10
  nopw   0x0(%rax,%rax,1)
L296:
  lea    (%r10,%r8,1),%rax
  xor    %r9d,%r9d
  xor    %esi,%esi
  nopl   0x0(%rax)
L237:
  mov    (%rax),%edx
  cmp    %esi,%edx
  jle    L43
  add    $0x1,%r9d
  mov    %edx,%esi
L43:
  sub    $0x28,%rax
  cmp    %r8,%rax
  jne    L237
  cmp    %r9d,(%r11)
  jne    L353
  add    $0x4,%r11
  lea    -0x4(%rax),%r8
  cmp    %rbp,%r11
  jne    L296
  mov    -0x28(%rsp),%rax
  add    -0x20(%rsp),%rbx
  lea    (%rax,%rax,4),%rax
  lea    -0x28(%rdi,%rax,8),%rdx
  xor    %edi,%edi
  nopl   0x0(%rax,%rax,1)
L162:
  mov    (%rdx),%eax
  mov    $0x1,%esi
  test   %eax,%eax
  jg     L294
  xor    %esi,%esi
  xor    %eax,%eax
L294:
  cmp    $0x1,%ecx
  je     L366
  mov    0x4(%rdx),%r8d
  cmp    %eax,%r8d
  jle    L266
  add    $0x1,%esi
  mov    %r8d,%eax
L266:
  cmp    $0x2,%ecx
  je     L366
  mov    0x8(%rdx),%r8d
  cmp    %eax,%r8d
  jle    L66
  add    $0x1,%esi
  mov    %r8d,%eax
L66:
  cmp    $0x3,%ecx
  je     L366
  mov    0xc(%rdx),%r8d
  cmp    %r8d,%eax
  jge    L56
  add    $0x1,%esi
  mov    %r8d,%eax
L56:
  cmp    $0x4,%ecx
  je     L366
  mov    0x10(%rdx),%r8d
  cmp    %r8d,%eax
  jge    L171
  add    $0x1,%esi
  mov    %r8d,%eax
L171:
  cmp    $0x5,%ecx
  je     L366
  mov    0x14(%rdx),%r8d
  cmp    %r8d,%eax
  jge    L453
  add    $0x1,%esi
  mov    %r8d,%eax
L453:
  cmp    $0x6,%ecx
  je     L366
  mov    0x18(%rdx),%r8d
  cmp    %r8d,%eax
  jge    L359
  add    $0x1,%esi
  mov    %r8d,%eax
L359:
  cmp    $0x7,%ecx
  je     L366
  mov    0x1c(%rdx),%r8d
  cmp    %r8d,%eax
  jge    L323
  add    $0x1,%esi
  mov    %r8d,%eax
L323:
  cmp    $0x8,%ecx
  je     L366
  mov    0x20(%rdx),%r8d
  cmp    %r8d,%eax
  jge    L93
  add    $0x1,%esi
  mov    %r8d,%eax
L93:
  cmp    $0x9,%ecx
  je     L366
  mov    0x24(%rdx),%r8d
  cmp    %r8d,%eax
  jge    L290
  add    $0x1,%esi
  mov    %r8d,%eax
L290:
  cmp    $0xa,%ecx
  je     L366
  mov    0x28(%rdx),%r8d
  cmp    %r8d,%eax
  jge    L201
  add    $0x1,%esi
  mov    %r8d,%eax
L201:
  mov    $0xb,%r8d
  cmp    $0xb,%ecx
  je     L366
L402:
  mov    (%rdx,%r8,4),%r9d
  cmp    %eax,%r9d
  jle    L152
  add    $0x1,%esi
  mov    %r9d,%eax
L152:
  add    $0x1,%r8
  cmp    %r8d,%ecx
  jg     L402
  nopw   0x0(%rax,%rax,1)
L366:
  cmp    %esi,(%rbx,%rdi,4)
  jne    L353
  add    $0x1,%rdi
  sub    $0x28,%rdx
  cmp    %edi,%ecx
  jg     L162
  mov    $0x1,%eax
  jmp    L186
  nopl   0x0(%rax)
L353:
  xor    %eax,%eax
L186:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L182:
  mov    $0x1,%eax
  ret
```

assistant: ```c
int risolvi(int n, int mat[10][10], int valori[40]) {
  int i = 0, j = 0;
  int curMax = 0;
  int curVisibili = 0;
  for (i = 0; i < n; i++) {
    curVisibili = 0;
    curMax = 0;
    for (j = 0; j < n; j++) {
      if (mat[j][i] > curMax) {
        curMax = mat[j][i];
        curVisibili++;
      }
    }
    if (curVisibili != valori[i])
      return 0;
  }
  for (i = 0; i < n; i++) {
    curVisibili = 0;
    curMax = 0;
    for (j = 0; j < n; j++) {
      if (mat[i][n - j - 1] > curMax) {
        curMax = mat[i][n - j - 1];
        curVisibili++;
      }
    }
    if (curVisibili != valori[i + n])
      return 0;
  }
  for (i = 0; i < n; i++) {
    curVisibili = 0;
    curMax = 0;
    for (j = 0; j < n; j++) {
      if (mat[n - j - 1][n - i - 1] > curMax) {
        curMax = mat[n - j - 1][n - i - 1];
        curVisibili++;
      }
    }
    if (curVisibili != valori[i + 2 * n])
      return 0;
  }
  for (i = 0; i < n; i++) {
    curVisibili = 0;
    curMax = 0;
    for (j = 0; j < n; j++) {
      if (mat[n - i - 1][j] > curMax) {
        curMax = mat[n - i - 1][j];
        curVisibili++;
      }
    }
    if (curVisibili != valori[i + 3 * n])
      return 0;
  }
  return 1;
}
```