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

```asm
<customerPin>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x78,%rsp
  mov    %rdi,-0x58(%rbp)
  mov    %esi,-0x5c(%rbp)
  mov    %rdx,-0x68(%rbp)
  mov    %rcx,-0x70(%rbp)
  mov    %r8,-0x78(%rbp)
  mov    %r9,-0x80(%rbp)
  mov    0x10(%rbp),%rax
  mov    %rax,-0x88(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x28(%rbp)
  xor    %eax,%eax
  mov    %rsp,%rax
  mov    %rax,%rbx
  mov    -0x5c(%rbp),%eax
  cltq
  sub    $0x1,%rax
  mov    %rax,-0x38(%rbp)
  mov    -0x5c(%rbp),%eax
  cltq
  mov    %rax,%r12
  mov    $0x0,%r13d
  mov    -0x5c(%rbp),%eax
  cltq
  mov    %rax,%r10
  mov    $0x0,%r11d
  mov    -0x5c(%rbp),%eax
  cltq
  mov    $0x10,%edx
  sub    $0x1,%rdx
  add    %rdx,%rax
  mov    $0x10,%edi
  mov    $0x0,%edx
  div    %rdi
  imul   $0x10,%rax,%rax
  mov    %rax,%rcx
  and    $0xfffffffffffff000,%rcx
  mov    %rsp,%rdx
  sub    %rcx,%rdx
L51:
  cmp    %rdx,%rsp
  je     L59
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L51
L59:
  mov    %rax,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  mov    %rax,%rdx
  and    $0xfff,%edx
  test   %rdx,%rdx
  je     L66
  and    $0xfff,%eax
  sub    $0x8,%rax
  add    %rsp,%rax
  orq    $0x0,(%rax)
L66:
  mov    %rsp,%rax
  add    $0x0,%rax
  mov    %rax,-0x30(%rbp)
  mov    -0x5c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x30(%rbp),%rax
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  mov    -0x5c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x80(%rbp),%rax
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  mov    -0x88(%rbp),%rax
  mov    $0x65,%edx
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  mov    -0x88(%rbp),%r8
  mov    -0x30(%rbp),%rdi
  mov    -0x70(%rbp),%rcx
  mov    -0x68(%rbp),%rdx
  mov    -0x5c(%rbp),%esi
  mov    -0x58(%rbp),%rax
  mov    %r8,%r9
  mov    %rdi,%r8
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <naturalpin@plt>
  mov    %eax,-0x44(%rbp)
  cmpl   $0xffffffff,-0x44(%rbp)
  jne    L31
  mov    $0xffffffff,%eax
  jmp    L44
L31:
  movl   $0x0,-0x44(%rbp)
  jmp    L5
L4:
  mov    -0x44(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <getHexValue@plt>
  mov    %eax,-0x40(%rbp)
  mov    -0x44(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x78(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <getHexValue@plt>
  mov    %eax,-0x3c(%rbp)
  mov    -0x40(%rbp),%edx
  mov    -0x3c(%rbp),%eax
  lea    (%rdx,%rax,1),%ecx
  movslq %ecx,%rax
  imul   $0x66666667,%rax,%rax
  shr    $0x20,%rax
  sar    $0x2,%eax
  mov    %ecx,%esi
  sar    $0x1f,%esi
  sub    %esi,%eax
  mov    %eax,%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  add    %eax,%eax
  sub    %eax,%ecx
  mov    %ecx,%edx
  mov    %edx,%edi
  mov    $0x0,%eax
  call   <getUChar@plt>
  mov    %eax,%edx
  mov    -0x44(%rbp),%eax
  movslq %eax,%rcx
  mov    -0x80(%rbp),%rax
  add    %rcx,%rax
  mov    %dl,(%rax)
  addl   $0x1,-0x44(%rbp)
L5:
  mov    -0x5c(%rbp),%eax
  sub    $0x1,%eax
  cmp    %eax,-0x44(%rbp)
  jl     L4
  mov    $0x0,%eax
L44:
  mov    %rbx,%rsp
  mov    -0x28(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L47
  call   <__stack_chk_fail@plt>
L47:
  lea    -0x18(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %rbp
  ret
```

assistant: ```c
int customerPin(unsigned const char *ipvk, const int ipinlength, unsigned const char *idectable, unsigned const char *ipinvaldat, unsigned char *ioffset, unsigned char *opin, char *errstatus) {
  unsigned char natPin[ipinlength];
  memset(natPin, '\0', ipinlength);
  memset(opin, '\0', ipinlength);
  memset(errstatus, '\0', 100 + 1);
  int k = naturalpin(ipvk, ipinlength, idectable, ipinvaldat, natPin, errstatus);
  if (k == -1)
    return -1;
  for (k = 0; k < ipinlength - 1; k++) {
    int i1nat = getHexValue(*(natPin + k));
    int i2off = getHexValue(*(ioffset + k));
    *(opin + k) = getUChar((i1nat + i2off) % 10);
  }
  return 0;
}
```