user: Converte this assembly snippet into its equivalent C code:

```asm
<down>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x28(%rbp)
  movl   $0x0,-0x10(%rbp)
  movl   $0x0,-0xc(%rbp)
  jmp    L22
L245:
  mov    -0xc(%rbp),%eax
  cltq
  add    $0xc,%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  test   %eax,%eax
  jne    L326
  mov    -0xc(%rbp),%eax
  cltq
  add    $0x8,%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  test   %eax,%eax
  jne    L191
  mov    -0xc(%rbp),%eax
  cltq
  add    $0x4,%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  test   %eax,%eax
  jne    L191
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  test   %eax,%eax
  je     L326
L191:
  movl   $0x1,-0x10(%rbp)
L326:
  mov    -0xc(%rbp),%eax
  cltq
  add    $0x8,%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  test   %eax,%eax
  jne    L19
  mov    -0xc(%rbp),%eax
  cltq
  add    $0x4,%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  test   %eax,%eax
  jne    L23
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  test   %eax,%eax
  je     L19
L23:
  movl   $0x1,-0x10(%rbp)
L19:
  mov    -0xc(%rbp),%eax
  cltq
  add    $0x4,%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  test   %eax,%eax
  jne    L258
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  test   %eax,%eax
  je     L258
  movl   $0x1,-0x10(%rbp)
L258:
  mov    -0xc(%rbp),%eax
  cltq
  add    $0xc,%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0xc(%rbp),%eax
  cltq
  add    $0x8,%rax
  lea    0x0(,%rax,4),%rcx
  mov    -0x28(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%eax
  cmp    %eax,%edx
  jne    L279
  mov    -0xc(%rbp),%eax
  cltq
  add    $0xc,%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  test   %eax,%eax
  je     L279
  movl   $0x1,-0x10(%rbp)
L279:
  mov    -0xc(%rbp),%eax
  cltq
  add    $0x8,%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0xc(%rbp),%eax
  cltq
  add    $0x4,%rax
  lea    0x0(,%rax,4),%rcx
  mov    -0x28(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%eax
  cmp    %eax,%edx
  jne    L212
  mov    -0xc(%rbp),%eax
  cltq
  add    $0x8,%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  test   %eax,%eax
  je     L212
  movl   $0x1,-0x10(%rbp)
L212:
  mov    -0xc(%rbp),%eax
  cltq
  add    $0x4,%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rcx
  mov    -0x28(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%eax
  cmp    %eax,%edx
  jne    L262
  mov    -0xc(%rbp),%eax
  cltq
  add    $0x4,%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  test   %eax,%eax
  je     L262
  movl   $0x1,-0x10(%rbp)
L262:
  addl   $0x1,-0xc(%rbp)
L22:
  cmpl   $0x3,-0xc(%rbp)
  jle    L245
  movl   $0x0,-0x14(%rbp)
  jmp    L276
L130:
  movl   $0x0,-0x8(%rbp)
  jmp    L117
L275:
  mov    -0x14(%rbp),%eax
  cltq
  add    $0xc,%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  test   %eax,%eax
  jne    L200
  mov    -0x14(%rbp),%eax
  cltq
  add    $0x8,%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    -0x14(%rbp),%edx
  movslq %edx,%rdx
  add    $0xc,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x28(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rax),%eax
  mov    %eax,(%rdx)
  mov    -0x14(%rbp),%eax
  cltq
  add    $0x4,%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    -0x14(%rbp),%edx
  movslq %edx,%rdx
  add    $0x8,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x28(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rax),%eax
  mov    %eax,(%rdx)
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    -0x14(%rbp),%edx
  movslq %edx,%rdx
  add    $0x4,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x28(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rax),%eax
  mov    %eax,(%rdx)
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movl   $0x0,(%rax)
L200:
  mov    -0x14(%rbp),%eax
  cltq
  add    $0x8,%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  test   %eax,%eax
  jne    L127
  mov    -0x14(%rbp),%eax
  cltq
  add    $0x4,%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    -0x14(%rbp),%edx
  movslq %edx,%rdx
  add    $0x8,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x28(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rax),%eax
  mov    %eax,(%rdx)
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    -0x14(%rbp),%edx
  movslq %edx,%rdx
  add    $0x4,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x28(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rax),%eax
  mov    %eax,(%rdx)
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movl   $0x0,(%rax)
L127:
  mov    -0x14(%rbp),%eax
  cltq
  add    $0x4,%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  test   %eax,%eax
  jne    L263
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    -0x14(%rbp),%edx
  movslq %edx,%rdx
  add    $0x4,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x28(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rax),%eax
  mov    %eax,(%rdx)
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movl   $0x0,(%rax)
L263:
  addl   $0x1,-0x8(%rbp)
L117:
  cmpl   $0x2,-0x8(%rbp)
  jle    L275
  addl   $0x1,-0x14(%rbp)
L276:
  cmpl   $0x3,-0x14(%rbp)
  jle    L130
  movl   $0x0,-0x14(%rbp)
  jmp    L280
L16:
  mov    -0x14(%rbp),%eax
  cltq
  add    $0xc,%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0x14(%rbp),%eax
  cltq
  add    $0x8,%rax
  lea    0x0(,%rax,4),%rcx
  mov    -0x28(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%eax
  cmp    %eax,%edx
  jne    L206
  mov    -0x14(%rbp),%eax
  cltq
  add    $0xc,%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%ecx
  mov    -0x14(%rbp),%eax
  cltq
  add    $0x8,%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0x14(%rbp),%eax
  cltq
  add    $0xc,%rax
  lea    0x0(,%rax,4),%rsi
  mov    -0x28(%rbp),%rax
  add    %rsi,%rax
  add    %ecx,%edx
  mov    %edx,(%rax)
  mov    -0x14(%rbp),%eax
  cltq
  add    $0x4,%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    -0x14(%rbp),%edx
  movslq %edx,%rdx
  add    $0x8,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x28(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rax),%eax
  mov    %eax,(%rdx)
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    -0x14(%rbp),%edx
  movslq %edx,%rdx
  add    $0x4,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x28(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rax),%eax
  mov    %eax,(%rdx)
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movl   $0x0,(%rax)
L206:
  mov    -0x14(%rbp),%eax
  cltq
  add    $0x8,%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0x14(%rbp),%eax
  cltq
  add    $0x4,%rax
  lea    0x0(,%rax,4),%rcx
  mov    -0x28(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%eax
  cmp    %eax,%edx
  jne    L82
  mov    -0x14(%rbp),%eax
  cltq
  add    $0x8,%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%ecx
  mov    -0x14(%rbp),%eax
  cltq
  add    $0x4,%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0x14(%rbp),%eax
  cltq
  add    $0x8,%rax
  lea    0x0(,%rax,4),%rsi
  mov    -0x28(%rbp),%rax
  add    %rsi,%rax
  add    %ecx,%edx
  mov    %edx,(%rax)
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    -0x14(%rbp),%edx
  movslq %edx,%rdx
  add    $0x4,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x28(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rax),%eax
  mov    %eax,(%rdx)
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movl   $0x0,(%rax)
L82:
  mov    -0x14(%rbp),%eax
  cltq
  add    $0x4,%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rcx
  mov    -0x28(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%eax
  cmp    %eax,%edx
  jne    L320
  mov    -0x14(%rbp),%eax
  cltq
  add    $0x4,%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%ecx
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0x14(%rbp),%eax
  cltq
  add    $0x4,%rax
  lea    0x0(,%rax,4),%rsi
  mov    -0x28(%rbp),%rax
  add    %rsi,%rax
  add    %ecx,%edx
  mov    %edx,(%rax)
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movl   $0x0,(%rax)
L320:
  movl   $0x0,-0x4(%rbp)
  jmp    L182
L241:
  mov    -0x14(%rbp),%eax
  cltq
  add    $0xc,%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  test   %eax,%eax
  jne    L290
  mov    -0x14(%rbp),%eax
  cltq
  add    $0x8,%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    -0x14(%rbp),%edx
  movslq %edx,%rdx
  add    $0xc,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x28(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rax),%eax
  mov    %eax,(%rdx)
  mov    -0x14(%rbp),%eax
  cltq
  add    $0x4,%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    -0x14(%rbp),%edx
  movslq %edx,%rdx
  add    $0x8,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x28(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rax),%eax
  mov    %eax,(%rdx)
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    -0x14(%rbp),%edx
  movslq %edx,%rdx
  add    $0x4,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x28(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rax),%eax
  mov    %eax,(%rdx)
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movl   $0x0,(%rax)
L290:
  mov    -0x14(%rbp),%eax
  cltq
  add    $0x8,%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  test   %eax,%eax
  jne    L299
  mov    -0x14(%rbp),%eax
  cltq
  add    $0x4,%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    -0x14(%rbp),%edx
  movslq %edx,%rdx
  add    $0x8,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x28(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rax),%eax
  mov    %eax,(%rdx)
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    -0x14(%rbp),%edx
  movslq %edx,%rdx
  add    $0x4,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x28(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rax),%eax
  mov    %eax,(%rdx)
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movl   $0x0,(%rax)
L299:
  mov    -0x14(%rbp),%eax
  cltq
  add    $0x4,%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  test   %eax,%eax
  jne    L74
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    -0x14(%rbp),%edx
  movslq %edx,%rdx
  add    $0x4,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x28(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rax),%eax
  mov    %eax,(%rdx)
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movl   $0x0,(%rax)
L74:
  addl   $0x1,-0x4(%rbp)
L182:
  cmpl   $0x1,-0x4(%rbp)
  jle    L241
  addl   $0x1,-0x14(%rbp)
L280:
  cmpl   $0x3,-0x14(%rbp)
  jle    L16
  mov    -0x10(%rbp),%eax
  pop    %rbp
  ret
```

assistant: ```c
int down(int *f) {
  int x, a = 0;
  for (int i = 0; i < 4; i++) {
    if (*(f + 12 + i) == 0)
      if ((*(f + 8 + i) != 0) || (*(f + 4 + i) != 0) || (*(f + i) != 0))
        a = 1;
    if (*(f + 8 + i) == 0)
      if ((*(f + 4 + i) != 0) || (*(f + i) != 0))
        a = 1;
    if (*(f + 4 + i) == 0)
      if ((*(f + i) != 0))
        a = 1;
    if (((*(f + 12 + i)) == (*(f + 8 + i))) && ((*(f + 12 + i) != 0)))
      a = 1;
    if (((*(f + 8 + i)) == (*(f + 4 + i))) && ((*(f + 8 + i) != 0)))
      a = 1;
    if (((*(f + 4 + i)) == (*(f + i))) && ((*(f + 4 + i) != 0)))
      a = 1;
  }
  for (x = 0; x < 4; x++) {
    for (int i = 0; i < 3; i++) {
      if (*(f + 12 + x) == 0) {
        *(f + 12 + x) = *(f + 8 + x);
        *(f + 8 + x) = *(f + 4 + x);
        *(f + 4 + x) = *(f + x);
        *(f + x) = 0;
      }
      if (*(f + 8 + x) == 0) {
        *(f + 8 + x) = *(f + 4 + x);
        *(f + 4 + x) = *(f + x);
        *(f + x) = 0;
      }
      if (*(f + 4 + x) == 0) {
        *(f + 4 + x) = *(f + x);
        *(f + x) = 0;
      }
    }
  }
  for (x = 0; x < 4; x++) {
    if (*(f + 12 + x) == *(f + 8 + x)) {
      *(f + 12 + x) += *(f + 8 + x);
      *(f + 8 + x) = *(f + 4 + x);
      *(f + 4 + x) = *(f + x);
      *(f + x) = 0;
    }
    if (*(f + 8 + x) == *(f + 4 + x)) {
      *(f + 8 + x) += *(f + 4 + x);
      *(f + 4 + x) = *(f + x);
      *(f + x) = 0;
    }
    if (*(f + 4 + x) == *(f + x)) {
      *(f + 4 + x) += *(f + x);
      *(f + x) = 0;
    }
    for (int i = 0; i < 2; i++) {
      if (*(f + 12 + x) == 0) {
        *(f + 12 + x) = *(f + 8 + x);
        *(f + 8 + x) = *(f + 4 + x);
        *(f + 4 + x) = *(f + x);
        *(f + x) = 0;
      }
      if (*(f + 8 + x) == 0) {
        *(f + 8 + x) = *(f + 4 + x);
        *(f + 4 + x) = *(f + x);
        *(f + x) = 0;
      }
      if (*(f + 4 + x) == 0) {
        *(f + 4 + x) = *(f + x);
        *(f + x) = 0;
      }
    }
  }
  return a;
}
```