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

```asm
<c_linear_combine_channels>:
  endbr64
  mov    %edi,%eax
  push   %r15
  mov    %esi,%edi
  mov    %edx,%esi
  push   %r14
  mov    %rcx,%rdx
  mov    %r8d,%ecx
  mov    %r9d,%r8d
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    0x38(%rsp),%r9d
  mov    0x40(%rsp),%r10
  mov    0x48(%rsp),%r11d
  mov    0x50(%rsp),%ebx
  mov    0x58(%rsp),%ebp
  mov    0x60(%rsp),%r12
  mov    0x68(%rsp),%r13d
  mov    0x70(%rsp),%r14d
  mov    0x78(%rsp),%r15d
  cmp    $0x3,%eax
  je     L48
  jg     L5
  cmp    $0x1,%eax
  je     L3
  cmp    $0x2,%eax
  jne    L33
  mov    %r15d,0x70(%rsp)
  mov    %r14d,0x68(%rsp)
  mov    %r13d,0x60(%rsp)
  mov    %r12,0x58(%rsp)
  mov    %ebp,0x50(%rsp)
  mov    %ebx,0x48(%rsp)
  mov    %r11d,0x40(%rsp)
  mov    %r10,0x38(%rsp)
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    10a0 <c_linear_combine_channels_word16@plt>
  nopw   0x0(%rax,%rax,1)
L5:
  cmp    $0x4,%eax
  jne    L33
  mov    %r15d,0x70(%rsp)
  mov    %r14d,0x68(%rsp)
  mov    %r13d,0x60(%rsp)
  mov    %r12,0x58(%rsp)
  mov    %ebp,0x50(%rsp)
  mov    %ebx,0x48(%rsp)
  mov    %r11d,0x40(%rsp)
  mov    %r10,0x38(%rsp)
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    10b0 <c_linear_combine_channels_float@plt>
  nopw   0x0(%rax,%rax,1)
L48:
  mov    %r15d,0x70(%rsp)
  mov    %r14d,0x68(%rsp)
  mov    %r13d,0x60(%rsp)
  mov    %r12,0x58(%rsp)
  mov    %ebp,0x50(%rsp)
  mov    %ebx,0x48(%rsp)
  mov    %r11d,0x40(%rsp)
  mov    %r10,0x38(%rsp)
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1090 <c_linear_combine_channels_word32@plt>
  nopl   (%rax)
L33:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L3:
  mov    %r15d,0x70(%rsp)
  mov    %r14d,0x68(%rsp)
  mov    %r13d,0x60(%rsp)
  mov    %r12,0x58(%rsp)
  mov    %ebp,0x50(%rsp)
  mov    %ebx,0x48(%rsp)
  mov    %r11d,0x40(%rsp)
  mov    %r10,0x38(%rsp)
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1080 <c_linear_combine_channels_word8@plt>
```

assistant: ```c
void c_linear_combine_channels(int k_type, float weight1, float weight2, int width, int height, void *p1, int nchn1, int pad1, int ofs1, void *p2, int nchn2, int pad2, int ofs2, void *p3, int nchn3, int pad3, int ofs3) {
  switch (k_type) {
  case 1:
    c_linear_combine_channels_word8(weight1, weight2, width, height, p1, nchn1, pad1, ofs1, p2, nchn2, pad2, ofs2, p3, nchn3, pad3, ofs3);
    ;
    break;
  case 2:
    c_linear_combine_channels_word16(weight1, weight2, width, height, p1, nchn1, pad1, ofs1, p2, nchn2, pad2, ofs2, p3, nchn3, pad3, ofs3);
    ;
    break;
  case 3:
    c_linear_combine_channels_word32(weight1, weight2, width, height, p1, nchn1, pad1, ofs1, p2, nchn2, pad2, ofs2, p3, nchn3, pad3, ofs3);
    ;
    break;
  case 4:
    c_linear_combine_channels_float(weight1, weight2, width, height, p1, nchn1, pad1, ofs1, p2, nchn2, pad2, ofs2, p3, nchn3, pad3, ofs3);
    ;
    break;
  }
}
```