user: Demonstrate the C code that generates the assembly output below:

```asm
<gauss>:
  endbr64
  push   %r15
  movslq %ecx,%rax
  push   %r14
  push   %r13
  mov    %r8d,%r13d
  push   %r12
  mov    %rax,%r12
  push   %rbp
  push   %rbx
  mov    %edx,%ebx
  sub    $0x68,%rsp
  mov    %rdi,0x20(%rsp)
  lea    0x0(,%rax,4),%edi
  mov    %rsi,0x50(%rsp)
  mov    %edx,0x28(%rsp)
  mov    %rax,0x58(%rsp)
  call   <malloc@plt>
  mov    %rax,0x40(%rsp)
  lea    -0x1(%r12),%eax
  mov    %eax,0x48(%rsp)
  test   %ebx,%ebx
  jle    L323
  test   %eax,%eax
  jle    L138
  lea    -0x2(%r12),%eax
  xor    %r14d,%r14d
  xor    %esi,%esi
  mov    %r12d,%r15d
  mov    %rax,0x38(%rsp)
  lea    -0x2(%rbx),%eax
  movq   $0x0,0x18(%rsp)
  mov    %eax,0x4c(%rsp)
  nopl   0x0(%rax)
L48:
  mov    0x18(%rsp),%rax
  mov    0x28(%rsp),%r8d
  mov    %r14d,0x34(%rsp)
  lea    0x0(,%r14,4),%rbx
  mov    %r14d,0x30(%rsp)
  lea    0x0(,%rax,8),%rcx
  mov    0x20(%rsp),%rax
  add    %rcx,%rax
  mov    %rax,(%rsp)
  mov    %rax,%rdx
  mov    %esi,%eax
  nopl   (%rax)
L45:
  mov    (%rdx),%rdi
  mov    (%rdi,%rbx,1),%edi
  test   %edi,%edi
  je     L178
  cmp    $0xffffffff,%eax
  je     L356
  mov    (%rsp),%rdi
  mov    %r14d,0xc(%rsp)
  mov    (%rdi),%rdi
  cmp    %r14d,%r15d
  jle    L15
  mov    0x20(%rsp),%rdx
  cltq
  mov    (%rdx,%rax,8),%rdx
  mov    %r14,%rax
  xchg   %ax,%ax
L240:
  mov    (%rdi,%rax,4),%r8d
  mov    (%rdx,%rax,4),%r9d
  mov    %r9d,(%rdi,%rax,4)
  mov    %r8d,(%rdx,%rax,4)
  add    $0x1,%rax
  cmp    %eax,%r15d
  jg     L240
L15:
  lea    0x1(%rsi),%eax
  mov    %eax,0x2c(%rsp)
  cmp    %eax,0x28(%rsp)
  jle    L207
  mov    0x4c(%rsp),%eax
  mov    0x20(%rsp),%rdx
  mov    %rbx,%r12
  mov    %r15d,%ebx
  sub    %esi,%eax
  add    0x18(%rsp),%rax
  lea    0x8(%rdx,%rcx,1),%rbp
  lea    0x10(%rdx,%rax,8),%rax
  mov    %rax,0x10(%rsp)
  nop
L120:
  mov    0x0(%rbp),%rax
  mov    (%rdi,%r12,1),%edi
  mov    %r13d,%esi
  mov    (%rax,%r12,1),%r15d
  call   <invMod@plt>
  neg    %r15d
  imul   %r15d,%eax
  cltd
  idiv   %r13d
  mov    %edx,%r11d
  cmp    0xc(%rsp),%ebx
  jle    L192
  mov    (%rsp),%rax
  mov    0x0(%rbp),%rsi
  mov    %r14,%rcx
  mov    (%rax),%rdi
  nopw   0x0(%rax,%rax,1)
L172:
  mov    (%rdi,%rcx,4),%eax
  imul   %r11d,%eax
  add    (%rsi,%rcx,4),%eax
  cltd
  idiv   %r13d
  mov    %edx,(%rsi,%rcx,4)
  add    $0x1,%rcx
  cmp    %ecx,%ebx
  jg     L172
  add    $0x8,%rbp
  cmp    %rbp,0x10(%rsp)
  jne    L120
L201:
  mov    %ebx,%r15d
  mov    %r12,%rbx
L207:
  mov    (%rdi,%rbx,1),%edi
  mov    %r13d,%esi
  call   <invMod@plt>
  mov    %eax,%ecx
  cmp    0xc(%rsp),%r15d
  jle    L159
  mov    (%rsp),%rax
  mov    (%rax),%rdx
  mov    0x48(%rsp),%eax
  sub    0x34(%rsp),%eax
  add    %r14,%rax
  lea    (%rdx,%rbx,1),%r9
  lea    0x4(%rdx,%rax,4),%rsi
  nopl   0x0(%rax)
L55:
  mov    (%r9),%eax
  add    $0x4,%r9
  imul   %ecx,%eax
  cltd
  idiv   %r13d
  mov    %edx,-0x4(%r9)
  cmp    %r9,%rsi
  jne    L55
L159:
  mov    0x18(%rsp),%rbx
  mov    0x40(%rsp),%rax
  mov    0x30(%rsp),%edi
  mov    %edi,(%rax,%rbx,4)
  mov    0x2c(%rsp),%ebx
  cmp    %ebx,0x28(%rsp)
  jle    L184
  cmp    %r14,0x38(%rsp)
  je     L318
  movslq 0x2c(%rsp),%rax
  add    $0x1,%r14
  mov    %rax,0x18(%rsp)
  mov    %rax,%rsi
  jmp    L48
  nopw   0x0(%rax,%rax,1)
L178:
  add    $0x1,%eax
  add    $0x8,%rdx
  cmp    %eax,%r8d
  jg     L45
L356:
  cmp    %r14,0x38(%rsp)
  je     L82
  add    $0x1,%r14
  cmp    %esi,0x28(%rsp)
  jg     L48
  mov    %r15d,%r12d
L153:
  lea    -0x1(%rsi),%ebx
L216:
  mov    0x58(%rsp),%rax
  mov    0x20(%rsp),%rdi
  mov    0x50(%rsp),%r8
  mov    0x18(%rsp),%r9
  lea    -0x4(,%rax,4),%rcx
  xor    %eax,%eax
  nopl   (%rax)
L107:
  mov    (%rdi,%rax,8),%rdx
  mov    (%rdx,%rcx,1),%edx
  mov    %edx,(%r8,%rax,4)
  add    $0x1,%rax
  cmp    %rax,%r9
  jne    L107
  cmp    0x48(%rsp),%esi
  jge    L208
L99:
  lea    -0x2(%r12),%eax
  mov    0x18(%rsp),%rdi
  sub    %esi,%eax
  add    $0x1,%esi
  lea    0x4(,%rax,4),%rdx
  cmp    %esi,%r12d
  mov    $0x4,%eax
  cmovle %rax,%rdx
  mov    0x50(%rsp),%rax
  xor    %esi,%esi
  lea    (%rax,%rdi,4),%rdi
  call   <memset@plt>
L312:
  cmp    $0xffffffff,%ebx
  je     L330
L208:
  mov    0x50(%rsp),%r10
  mov    0x40(%rsp),%r9
  movslq %ebx,%rdi
  mov    0x20(%rsp),%r11
  mov    0x48(%rsp),%r8d
  lea    (%r10,%rdi,4),%rsi
  sub    %r10,%r9
L197:
  mov    (%r9,%rsi,1),%eax
  lea    0x1(%rax),%edx
  mov    (%rsi),%eax
  cmp    %r8d,%edx
  jge    L108
  mov    (%r11,%rdi,8),%rbx
  movslq %edx,%rdx
  nopl   (%rax)
L143:
  mov    (%rbx,%rdx,4),%ecx
  imul   (%r10,%rdx,4),%ecx
  add    $0x1,%rdx
  sub    %ecx,%eax
  mov    %eax,(%rsi)
  cmp    %edx,%r8d
  jg     L143
L108:
  cltd
  sub    $0x1,%rdi
  sub    $0x4,%rsi
  idiv   %r13d
  lea    (%rdx,%r13,1),%eax
  cltd
  idiv   %r13d
  mov    %edx,0x4(%rsi)
  test   %edi,%edi
  jns    L197
L330:
  mov    0x40(%rsp),%rdi
  call   <free@plt>
  add    $0x68,%rsp
  mov    $0x1,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  cs nopw 0x0(%rax,%rax,1)
L192:
  mov    (%rsp),%rax
  add    $0x8,%rbp
  mov    (%rax),%rdi
  cmp    %rbp,0x10(%rsp)
  jne    L120
  jmp    L201
L318:
  mov    %r15d,%r12d
L43:
  mov    0x58(%rsp),%rax
  mov    0x20(%rsp),%rsi
  mov    0x28(%rsp),%edi
  lea    -0x4(,%rax,4),%rcx
  movslq 0x2c(%rsp),%rax
  jmp    L30
  nopl   0x0(%rax,%rax,1)
L79:
  add    $0x1,%rax
  cmp    %eax,%edi
  jle    L175
L30:
  mov    (%rsi,%rax,8),%rdx
  mov    (%rdx,%rcx,1),%edx
  test   %edx,%edx
  je     L79
  mov    0x40(%rsp),%rdi
  call   <free@plt>
  add    $0x68,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L82:
  mov    %esi,0x2c(%rsp)
  mov    %r15d,%r12d
  jmp    L43
L323:
  mov    $0xffffffff,%ebx
L210:
  mov    0x48(%rsp),%eax
  test   %eax,%eax
  jle    L312
  movq   $0x0,0x18(%rsp)
  xor    %esi,%esi
  jmp    L99
L138:
  movl   $0x0,0x2c(%rsp)
  jmp    L43
L175:
  mov    0x2c(%rsp),%eax
  lea    -0x1(%rax),%ebx
  test   %eax,%eax
  je     L210
  movslq 0x2c(%rsp),%rax
  mov    %rax,0x18(%rsp)
  mov    %rax,%rsi
  jmp    L216
L184:
  movslq %ebx,%rax
  mov    %r15d,%r12d
  mov    %rax,0x18(%rsp)
  mov    %rax,%rsi
  jmp    L153
```

assistant: ```c
int gauss(int **a, int *x, int m, int n, int q) {
  int rank = 0, i, j, k, l, *pivot = (int *)malloc(sizeof(int) * n);
  for (i = 0, j = 0; i < m && j < n - 1; ++j) {
    int p = -1, tmp = 0;
    for (k = i; p < 0 && k < m; ++k) {
      if (a[k][j] != 0)
        p = k;
    }
    if (p == -1)
      continue;
    for (k = j; k < n; ++k)
      tmp = a[i][k], a[i][k] = a[p][k], a[p][k] = tmp;
    for (k = i + 1; k < m; ++k) {
      tmp = -a[k][j] * invMod(a[i][j], q) % q;
      for (l = j; l < n; ++l)
        a[k][l] = (a[k][l] + tmp * a[i][l]) % q;
    }
    tmp = invMod(a[i][j], q);
    for (k = j; k < n; ++k)
      a[i][k] = a[i][k] * tmp % q;
    pivot[i++] = j, rank++;
  }
  for (i = rank; i < m; ++i)
    if (a[i][n - 1] != 0) {
      free(pivot);
      return 0;
    }
  for (i = 0; i < rank; ++i)
    x[i] = a[i][n - 1];
  for (i = rank; i < n - 1; ++i)
    x[i] = 0;
  for (i = rank - 1; i >= 0; --i) {
    for (j = pivot[i] + 1; j < n - 1; ++j)
      x[i] -= a[i][j] * x[j];
    x[i] -= x[i] / q * q, x[i] = (x[i] + q) % q;
  }
  free(pivot);
  return 1;
}
```