user: Please show me the C implementation that matches the assembly code listed below:

```asm
<gostmac>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r12
  push   %rbx
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  mov    %rdx,-0x28(%rbp)
  mov    %rcx,-0x30(%rbp)
  mov    $0x0,%r12d
  mov    $0x0,%ebx
  jmp    L0
L5:
  mov    -0x18(%rbp),%rax
  lea    0x8(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  mov    (%rax),%rax
  xor    %rax,%r12
  mov    -0x18(%rbp),%rax
  lea    0x8(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  mov    (%rax),%rbx
  mov    -0x30(%rbp),%rax
  mov    (%rax),%rax
  add    %r12,%rax
  mov    %rax,%rdi
  call   <f@plt>
  xor    %rax,%rbx
  mov    -0x30(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rax
  add    %rbx,%rax
  mov    %rax,%rdi
  call   <f@plt>
  xor    %rax,%r12
  mov    -0x30(%rbp),%rax
  add    $0x10,%rax
  mov    (%rax),%rax
  add    %r12,%rax
  mov    %rax,%rdi
  call   <f@plt>
  xor    %rax,%rbx
  mov    -0x30(%rbp),%rax
  add    $0x18,%rax
  mov    (%rax),%rax
  add    %rbx,%rax
  mov    %rax,%rdi
  call   <f@plt>
  xor    %rax,%r12
  mov    -0x30(%rbp),%rax
  add    $0x20,%rax
  mov    (%rax),%rax
  add    %r12,%rax
  mov    %rax,%rdi
  call   <f@plt>
  xor    %rax,%rbx
  mov    -0x30(%rbp),%rax
  add    $0x28,%rax
  mov    (%rax),%rax
  add    %rbx,%rax
  mov    %rax,%rdi
  call   <f@plt>
  xor    %rax,%r12
  mov    -0x30(%rbp),%rax
  add    $0x30,%rax
  mov    (%rax),%rax
  add    %r12,%rax
  mov    %rax,%rdi
  call   <f@plt>
  xor    %rax,%rbx
  mov    -0x30(%rbp),%rax
  add    $0x38,%rax
  mov    (%rax),%rax
  add    %rbx,%rax
  mov    %rax,%rdi
  call   <f@plt>
  xor    %rax,%r12
  mov    -0x30(%rbp),%rax
  mov    (%rax),%rax
  add    %r12,%rax
  mov    %rax,%rdi
  call   <f@plt>
  xor    %rax,%rbx
  mov    -0x30(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rax
  add    %rbx,%rax
  mov    %rax,%rdi
  call   <f@plt>
  xor    %rax,%r12
  mov    -0x30(%rbp),%rax
  add    $0x10,%rax
  mov    (%rax),%rax
  add    %r12,%rax
  mov    %rax,%rdi
  call   <f@plt>
  xor    %rax,%rbx
  mov    -0x30(%rbp),%rax
  add    $0x18,%rax
  mov    (%rax),%rax
  add    %rbx,%rax
  mov    %rax,%rdi
  call   <f@plt>
  xor    %rax,%r12
  mov    -0x30(%rbp),%rax
  add    $0x20,%rax
  mov    (%rax),%rax
  add    %r12,%rax
  mov    %rax,%rdi
  call   <f@plt>
  xor    %rax,%rbx
  mov    -0x30(%rbp),%rax
  add    $0x28,%rax
  mov    (%rax),%rax
  add    %rbx,%rax
  mov    %rax,%rdi
  call   <f@plt>
  xor    %rax,%r12
  mov    -0x30(%rbp),%rax
  add    $0x30,%rax
  mov    (%rax),%rax
  add    %r12,%rax
  mov    %rax,%rdi
  call   <f@plt>
  xor    %rax,%rbx
  mov    -0x30(%rbp),%rax
  add    $0x38,%rax
  mov    (%rax),%rax
  add    %rbx,%rax
  mov    %rax,%rdi
  call   <f@plt>
  xor    %rax,%r12
L0:
  mov    -0x1c(%rbp),%eax
  lea    -0x1(%rax),%edx
  mov    %edx,-0x1c(%rbp)
  test   %eax,%eax
  jne    L5
  mov    -0x28(%rbp),%rax
  mov    %r12,(%rax)
  mov    -0x28(%rbp),%rax
  add    $0x8,%rax
  mov    %rbx,(%rax)
  nop
  add    $0x20,%rsp
  pop    %rbx
  pop    %r12
  pop    %rbp
  ret
```

assistant: ```c
void gostmac(uint32_t const *in, int len, uint32_t out[2], uint32_t const key[8]) {
  register uint32_t n1, n2;
  n1 = 0;
  n2 = 0;
  while (len--) {
    n1 ^= *in++;
    n2 = *in++;
    n2 ^= f(n1 + key[0]);
    n1 ^= f(n2 + key[1]);
    n2 ^= f(n1 + key[2]);
    n1 ^= f(n2 + key[3]);
    n2 ^= f(n1 + key[4]);
    n1 ^= f(n2 + key[5]);
    n2 ^= f(n1 + key[6]);
    n1 ^= f(n2 + key[7]);
    n2 ^= f(n1 + key[0]);
    n1 ^= f(n2 + key[1]);
    n2 ^= f(n1 + key[2]);
    n1 ^= f(n2 + key[3]);
    n2 ^= f(n1 + key[4]);
    n1 ^= f(n2 + key[5]);
    n2 ^= f(n1 + key[6]);
    n1 ^= f(n2 + key[7]);
  }
  out[0] = n1;
  out[1] = n2;
}
```