user: What is the c source code of the assembly code below?

```asm
<udp4_checksum>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x30,%rsp
  mov    %r8,%r12
  mov    %r9d,%ebx
  mov    %rdi,-0x40(%rbp)
  mov    %esi,-0x38(%rbp)
  mov    %rdx,-0x50(%rbp)
  mov    %ecx,-0x48(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x28(%rbp)
  xor    %eax,%eax
  mov    D7(%rip),%rax
  movslq (%rax),%rax
  add    $0xf,%rax
  mov    %rax,%rcx
  and    $0xfffffffffffffff0,%rcx
  and    $0xfffffffffffff000,%rax
  mov    %rsp,%rdx
  sub    %rax,%rdx
L38:
  cmp    %rdx,%rsp
  je     L21
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L38
L21:
  mov    %rcx,%rax
  and    $0xfff,%eax
  sub    %rax,%rsp
  test   %rax,%rax
  je     L37
  orq    $0x0,-0x8(%rsp,%rax,1)
L37:
  mov    %rsp,%r13
  lea    -0x40(%rbp),%r14
  lea    -0x38(%rbp),%rsi
  mov    $0x4,%edx
  mov    %rsp,%rdi
  call   <memcpy@plt>
  lea    -0x3c(%rbp),%rsi
  lea    0x4(%rsp),%rdi
  mov    $0x4,%edx
  call   <memcpy@plt>
  movb   $0x0,0x8(%rsp)
  lea    0x9(%rsp),%rdi
  mov    $0x4,%edx
  mov    %r14,%rsi
  call   <memcpy@plt>
  lea    -0x50(%rbp),%r14
  lea    0xd(%rsp),%rdi
  mov    $0x4,%edx
  mov    %r14,%rsi
  call   <memcpy@plt>
  lea    -0x48(%rbp),%rsi
  lea    0x11(%rsp),%rdi
  mov    $0x4,%edx
  call   <memcpy@plt>
  lea    -0x4c(%rbp),%rsi
  lea    0x15(%rsp),%rdi
  mov    $0x4,%edx
  call   <memcpy@plt>
  lea    0x19(%rsp),%rdi
  mov    $0x4,%edx
  mov    %r14,%rsi
  call   <memcpy@plt>
  movb   $0x0,0x1d(%rsp)
  movb   $0x0,0x1e(%rsp)
  lea    0x1f(%rsp),%r14
  mov    %ebx,%edx
  mov    %r12,%rsi
  mov    %r14,%rdi
  call   <memcpy@plt>
  movslq %ebx,%rax
  add    %r14,%rax
  mov    %ebx,%ecx
  shr    $0x1f,%ecx
  lea    (%rbx,%rcx,1),%edx
  and    $0x1,%edx
  sub    %ecx,%edx
  test   %edx,%edx
  jle    L26
  movb   $0x0,(%rax)
  lea    0x20(%rbx),%esi
L55:
  mov    %r13,%rdi
  call   <checksum@plt>
  mov    -0x28(%rbp),%rdx
  sub    %fs:0x28,%rdx
  jne    L0
  lea    -0x20(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %rbp
  ret
L26:
  lea    0x1f(%rbx),%esi
  jmp    L55
L0:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
uint16_t udp4_checksum(struct ip iphdr, struct udphdr udphdr, uint8_t *payload, int payloadlen) {
  char buf[IP_MAXPACKET];
  char *ptr;
  int chksumlen = 0;
  int i;
  ptr = &buf[0];
  memcpy(ptr, &iphdr.ip_src.s_addr, sizeof(iphdr.ip_src.s_addr));
  ptr += sizeof(iphdr.ip_src.s_addr);
  chksumlen += sizeof(iphdr.ip_src.s_addr);
  memcpy(ptr, &iphdr.ip_dst.s_addr, sizeof(iphdr.ip_dst.s_addr));
  ptr += sizeof(iphdr.ip_dst.s_addr);
  chksumlen += sizeof(iphdr.ip_dst.s_addr);
  *ptr = 0;
  ptr++;
  chksumlen += 1;
  memcpy(ptr, &iphdr.ip_p, sizeof(iphdr.ip_p));
  ptr += sizeof(iphdr.ip_p);
  chksumlen += sizeof(iphdr.ip_p);
  memcpy(ptr, &udphdr.len, sizeof(udphdr.len));
  ptr += sizeof(udphdr.len);
  chksumlen += sizeof(udphdr.len);
  memcpy(ptr, &udphdr.source, sizeof(udphdr.source));
  ptr += sizeof(udphdr.source);
  chksumlen += sizeof(udphdr.source);
  memcpy(ptr, &udphdr.dest, sizeof(udphdr.dest));
  ptr += sizeof(udphdr.dest);
  chksumlen += sizeof(udphdr.dest);
  memcpy(ptr, &udphdr.len, sizeof(udphdr.len));
  ptr += sizeof(udphdr.len);
  chksumlen += sizeof(udphdr.len);
  *ptr = 0;
  ptr++;
  *ptr = 0;
  ptr++;
  chksumlen += 2;
  memcpy(ptr, payload, payloadlen);
  ptr += payloadlen;
  chksumlen += payloadlen;
  for (i = 0; i < payloadlen % 2; i++, ptr++) {
    *ptr = 0;
    ptr++;
    chksumlen++;
  }
  return checksum((uint16_t *)buf, chksumlen);
}
```