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

```asm
<masked_sad>:
  endbr64
  push   %r15
  lea    0x100(%r8),%rax
  mov    %rdi,%r15
  push   %r14
  movslq %esi,%r14
  push   %r13
  movslq %ecx,%r13
  push   %r12
  xor    %r12d,%r12d
  push   %rbp
  mov    %rdx,%rbp
  push   %rbx
  mov    %r8,%rbx
  sub    $0x18,%rsp
  mov    %rax,0x8(%rsp)
  jmp    L108
  nopl   (%rax)
L272:
  cmpb   $0x0,0x1(%rbx)
  jne    L244
L234:
  cmpb   $0x0,0x2(%rbx)
  jne    L255
L64:
  cmpb   $0x0,0x3(%rbx)
  jne    L314
L221:
  cmpb   $0x0,0x4(%rbx)
  jne    L156
L109:
  cmpb   $0x0,0x5(%rbx)
  jne    L238
L39:
  cmpb   $0x0,0x6(%rbx)
  jne    L4
L316:
  cmpb   $0x0,0x7(%rbx)
  jne    L136
L201:
  cmpb   $0x0,0x8(%rbx)
  jne    L326
L202:
  cmpb   $0x0,0x9(%rbx)
  jne    L172
L83:
  cmpb   $0x0,0xa(%rbx)
  jne    L309
L240:
  cmpb   $0x0,0xb(%rbx)
  jne    L219
L307:
  cmpb   $0x0,0xc(%rbx)
  jne    L323
L98:
  cmpb   $0x0,0xd(%rbx)
  jne    L206
L107:
  cmpb   $0x0,0xe(%rbx)
  jne    L220
L303:
  cmpb   $0x0,0xf(%rbx)
  jne    L140
L261:
  add    %r14,%r15
  add    %r13,%rbp
  add    $0x10,%rbx
  cmp    0x8(%rsp),%rbx
  je     L334
L108:
  cmpb   $0x0,(%rbx)
  je     L272
  movzbl (%r15),%edi
  sub    0x0(%rbp),%dil
  movzbl %dil,%edi
  call   <abs@plt>
  add    %eax,%r12d
  cmpb   $0x0,0x1(%rbx)
  je     L234
L244:
  movzbl 0x1(%r15),%edi
  sub    0x1(%rbp),%dil
  movzbl %dil,%edi
  call   <abs@plt>
  add    %eax,%r12d
  cmpb   $0x0,0x2(%rbx)
  je     L64
L255:
  movzbl 0x2(%r15),%edi
  sub    0x2(%rbp),%dil
  movzbl %dil,%edi
  call   <abs@plt>
  add    %eax,%r12d
  cmpb   $0x0,0x3(%rbx)
  je     L221
L314:
  movzbl 0x3(%r15),%edi
  sub    0x3(%rbp),%dil
  movzbl %dil,%edi
  call   <abs@plt>
  add    %eax,%r12d
  cmpb   $0x0,0x4(%rbx)
  je     L109
L156:
  movzbl 0x4(%r15),%edi
  sub    0x4(%rbp),%dil
  movzbl %dil,%edi
  call   <abs@plt>
  add    %eax,%r12d
  cmpb   $0x0,0x5(%rbx)
  je     L39
L238:
  movzbl 0x5(%r15),%edi
  sub    0x5(%rbp),%dil
  movzbl %dil,%edi
  call   <abs@plt>
  add    %eax,%r12d
  cmpb   $0x0,0x6(%rbx)
  je     L316
L4:
  movzbl 0x6(%r15),%edi
  sub    0x6(%rbp),%dil
  movzbl %dil,%edi
  call   <abs@plt>
  add    %eax,%r12d
  cmpb   $0x0,0x7(%rbx)
  je     L201
L136:
  movzbl 0x7(%r15),%edi
  sub    0x7(%rbp),%dil
  movzbl %dil,%edi
  call   <abs@plt>
  add    %eax,%r12d
  cmpb   $0x0,0x8(%rbx)
  je     L202
L326:
  movzbl 0x8(%r15),%edi
  sub    0x8(%rbp),%dil
  movzbl %dil,%edi
  call   <abs@plt>
  add    %eax,%r12d
  cmpb   $0x0,0x9(%rbx)
  je     L83
L172:
  movzbl 0x9(%r15),%edi
  sub    0x9(%rbp),%dil
  movzbl %dil,%edi
  call   <abs@plt>
  add    %eax,%r12d
  cmpb   $0x0,0xa(%rbx)
  je     L240
L309:
  movzbl 0xa(%r15),%edi
  sub    0xa(%rbp),%dil
  movzbl %dil,%edi
  call   <abs@plt>
  add    %eax,%r12d
  cmpb   $0x0,0xb(%rbx)
  je     L307
L219:
  movzbl 0xb(%r15),%edi
  sub    0xb(%rbp),%dil
  movzbl %dil,%edi
  call   <abs@plt>
  add    %eax,%r12d
  cmpb   $0x0,0xc(%rbx)
  je     L98
L323:
  movzbl 0xc(%r15),%edi
  sub    0xc(%rbp),%dil
  movzbl %dil,%edi
  call   <abs@plt>
  add    %eax,%r12d
  cmpb   $0x0,0xd(%rbx)
  je     L107
L206:
  movzbl 0xd(%r15),%edi
  sub    0xd(%rbp),%dil
  movzbl %dil,%edi
  call   <abs@plt>
  add    %eax,%r12d
  cmpb   $0x0,0xe(%rbx)
  je     L303
L220:
  movzbl 0xe(%r15),%edi
  sub    0xe(%rbp),%dil
  movzbl %dil,%edi
  call   <abs@plt>
  add    %eax,%r12d
  cmpb   $0x0,0xf(%rbx)
  je     L261
L140:
  movzbl 0xf(%r15),%edi
  sub    0xf(%rbp),%dil
  movzbl %dil,%edi
  call   <abs@plt>
  add    %eax,%r12d
  jmp    L261
L334:
  add    $0x18,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
int masked_sad(unsigned char *src, int p, unsigned char *dst, int dp, unsigned char *ym) {
  int i, j;
  unsigned sad = 0;
  for (i = 0; i < 16; i++, src += p, dst += dp, ym += 16)
    for (j = 0; j < 16; j++)
      if (ym[j])
        sad += abs(src[j] - dst[j]);
  return sad;
}
```