user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<is_magic>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %edi,-0x14(%rbp)
  mov    %rsi,-0x20(%rbp)
  cmpq   $0x0,-0x20(%rbp)
  je     L117
  cmpl   $0x0,-0x14(%rbp)
  jg     L1
L117:
  mov    $0x0,%eax
  jmp    L50
L1:
  mov    -0x14(%rbp),%eax
  add    $0x1,%eax
  add    %eax,%eax
  mov    $0x4,%esi
  mov    %eax,%edi
  call   <calloc@plt>
  mov    %rax,-0x8(%rbp)
  movl   $0x0,-0x10(%rbp)
  jmp    L125
L40:
  movl   $0x0,-0xc(%rbp)
  jmp    L115
L23:
  mov    -0xc(%rbp),%ecx
  mov    -0x10(%rbp),%edx
  mov    -0x14(%rbp),%esi
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <mat_elem@plt>
  mov    %eax,%edx
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rcx
  mov    -0x8(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%ecx
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rsi
  mov    -0x8(%rbp),%rax
  add    %rsi,%rax
  add    %ecx,%edx
  mov    %edx,(%rax)
  mov    -0xc(%rbp),%ecx
  mov    -0x10(%rbp),%edx
  mov    -0x14(%rbp),%esi
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <mat_elem@plt>
  mov    %eax,%edx
  mov    -0x14(%rbp),%ecx
  mov    -0xc(%rbp),%eax
  add    %ecx,%eax
  cltq
  lea    0x0(,%rax,4),%rcx
  mov    -0x8(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%ecx
  mov    -0x14(%rbp),%esi
  mov    -0xc(%rbp),%eax
  add    %esi,%eax
  cltq
  lea    0x0(,%rax,4),%rsi
  mov    -0x8(%rbp),%rax
  add    %rsi,%rax
  add    %ecx,%edx
  mov    %edx,(%rax)
  mov    -0x10(%rbp),%eax
  cmp    -0xc(%rbp),%eax
  jne    L54
  mov    -0xc(%rbp),%ecx
  mov    -0x10(%rbp),%edx
  mov    -0x14(%rbp),%esi
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <mat_elem@plt>
  mov    %eax,%edx
  mov    -0x14(%rbp),%eax
  add    %eax,%eax
  cltq
  lea    0x0(,%rax,4),%rcx
  mov    -0x8(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%ecx
  mov    -0x14(%rbp),%eax
  add    %eax,%eax
  cltq
  lea    0x0(,%rax,4),%rsi
  mov    -0x8(%rbp),%rax
  add    %rsi,%rax
  add    %ecx,%edx
  mov    %edx,(%rax)
L54:
  mov    -0x10(%rbp),%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  add    $0x1,%eax
  cmp    %eax,-0x14(%rbp)
  jne    L25
  mov    -0xc(%rbp),%ecx
  mov    -0x10(%rbp),%edx
  mov    -0x14(%rbp),%esi
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <mat_elem@plt>
  mov    %eax,%edx
  mov    -0x14(%rbp),%eax
  add    %eax,%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,4),%rcx
  mov    -0x8(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%ecx
  mov    -0x14(%rbp),%eax
  add    %eax,%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,4),%rsi
  mov    -0x8(%rbp),%rax
  add    %rsi,%rax
  add    %ecx,%edx
  mov    %edx,(%rax)
L25:
  addl   $0x1,-0xc(%rbp)
L115:
  mov    -0xc(%rbp),%eax
  cmp    -0x14(%rbp),%eax
  jl     L23
  addl   $0x1,-0x10(%rbp)
L125:
  mov    -0x10(%rbp),%eax
  cmp    -0x14(%rbp),%eax
  jl     L40
  movl   $0x1,-0x10(%rbp)
  jmp    L67
L122:
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0x10(%rbp),%eax
  cltq
  shl    $0x2,%rax
  lea    -0x4(%rax),%rcx
  mov    -0x8(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%eax
  cmp    %eax,%edx
  je     L21
  mov    $0x0,%eax
  jmp    L50
L21:
  addl   $0x1,-0x10(%rbp)
L67:
  mov    -0x14(%rbp),%eax
  add    $0x1,%eax
  add    %eax,%eax
  cmp    %eax,-0x10(%rbp)
  jl     L122
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    $0x1,%eax
L50:
  leave
  ret
```

assistant: ```c
int is_magic(int N, int *m[]) {
  int i, j;
  int *sum;
  if (m == NULL || N <= 0)
    return 0;
  sum = calloc(N + N + 2, sizeof(int));
  for (i = 0; i < N; i++)
    for (j = 0; j < N; j++) {
      sum[i] += mat_elem(m, N, i, j);
      sum[N + j] += mat_elem(m, N, i, j);
      if (i == j)
        sum[N + N] += mat_elem(m, N, i, j);
      if ((i + j + 1) == N)
        sum[N + N + 1] += mat_elem(m, N, i, j);
    }
  for (i = 1; i < N + N + 2; i++)
    if (sum[i] != sum[i - 1])
      return 0;
  free(sum);
  return 1;
}
```