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

```asm
<build_packet>:
  endbr64
  push   %r13
  mov    %rdx,%r13
  pxor   %xmm0,%xmm0
  push   %r12
  mov    %esi,%r12d
  push   %rbp
  sub    $0x60,%r12d
  push   %rbx
  mov    %rdi,%rbx
  rol    $0x8,%r12w
  sub    $0x8,%rsp
  mov    (%rdi),%rax
  mov    D18(%rip),%rdx
  movups %xmm0,(%rax)
  mov    %rdx,0x10(%rax)
  mov    D10(%rip),%rdx
  mov    0x8(%rdi),%rax
  mov    %rdx,0x10(%rax)
  movups %xmm0,(%rax)
  mov    $0x8,%eax
  pxor   %xmm0,%xmm0
  mov    %ax,0x10(%rdi)
  mov    D22(%rip),%rax
  movq   $0x0,0x58(%rdi)
  mov    %rax,0x18(%rdi)
  lea    -0x18(%rsi),%eax
  rol    $0x8,%ax
  movq   $0x100000a,0x30(%rdi)
  mov    %ax,0x20(%rdi)
  mov    D38(%rip),%rax
  movups %xmm0,0x48(%rdi)
  mov    %rax,0x24(%rdi)
  mov    %r13,%rdi
  call   <myrand@plt>
  mov    %r13,%rdi
  mov    %eax,%ebp
  call   <myrand@plt>
  shl    $0x18,%rbp
  mov    %r13,%rdi
  shl    $0x8,%rax
  and    $0xff000000,%ebp
  and    $0xff0000,%eax
  or     %rax,%rbp
  call   <myrand@plt>
  mov    %r13,%rdi
  shr    $0x8,%rax
  and    $0xff00,%eax
  or     %rax,%rbp
  call   <myrand@plt>
  movq   $0x0,0x40(%rbx)
  mov    0x1c(%rbx),%esi
  lea    0x18(%rbx),%rdi
  shr    $0x18,%rax
  and    $0xff,%eax
  or     %rbp,%rax
  mov    %rax,0x38(%rbx)
  call   <ip_fast_csum@plt>
  mov    %r13,%rdi
  mov    %rax,0x40(%rbx)
  call   <myrand@plt>
  mov    %r12w,0x64(%rbx)
  mov    %eax,%edx
  mov    %eax,%ecx
  shr    $0x10,%eax
  movq   $0x0,0x68(%rbx)
  shl    $0x8,%eax
  shr    $0x18,%ecx
  or     %eax,%ecx
  rol    $0x8,%dx
  shl    $0x10,%ecx
  movzwl %dx,%eax
  or     %ecx,%eax
  mov    %eax,0x60(%rbx)
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

tool_calls: name: retrieve_data
arguments: label: D18
type_infered: byte[8]
name: retrieve_data
arguments: label: D10
type_infered: byte[8]
name: retrieve_data
arguments: label: D22
type_infered: byte[8]
name: retrieve_data
arguments: label: D38
type_infered: byte[8]

tool: {"D18": [0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00]}

tool: {"D10": [0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00]}

tool: {"D22": [0x04,0x00,0x00,0x00,0x05,0x00,0x00,0x00]}

tool: {"D38": [0x20,0x00,0x00,0x00,0x11,0x00,0x00,0x00]}

assistant: ```c
void build_packet(char *buf, int size, uint64_t *seed) {
  struct ethhdr *eth;
  struct iphdr *ip;
  struct udphdr *udp;
  uint32_t rand_val;
  eth = (struct ethhdr *)buf;
  eth->h_dest[0] = 0x00;
  eth->h_dest[1] = 0x00;
  eth->h_dest[2] = 0x00;
  eth->h_dest[3] = 0x00;
  eth->h_dest[4] = 0x00;
  eth->h_dest[5] = 0x02;
  eth->h_source[0] = 0x00;
  eth->h_source[1] = 0x00;
  eth->h_source[2] = 0x00;
  eth->h_source[3] = 0x00;
  eth->h_source[4] = 0x00;
  eth->h_source[5] = 0x01;
  eth->h_proto = (((((unsigned short)(0x0800) & 0xFF)) << 8) | (((unsigned short)(0x0800) & 0xFF00) >> 8));
  ip = (struct iphdr *)(buf + sizeof(*eth));
  ip->version = 4;
  ip->ihl = 5;
  ip->tos = 0;
  ip->tot_len = (((((unsigned short)(size - sizeof(*eth)) & 0xFF)) << 8) | (((unsigned short)(size - sizeof(*eth)) & 0xFF00) >> 8));
  ip->id = 0;
  ip->frag_off = 0;
  ip->ttl = 32;
  ip->protocol = 17;
  ip->saddr = (((((unsigned long)(0x0A000001) & 0xFF)) << 24) | ((((unsigned long)(0x0A000001) & 0xFF00)) << 8) | ((((unsigned long)(0x0A000001) & 0xFF0000)) >> 8) | ((((unsigned long)(0x0A000001) & 0xFF000000)) >> 24));
  ip->daddr = (((((unsigned long)(myrand(seed)) & 0xFF)) << 24) | ((((unsigned long)(myrand(seed)) & 0xFF00)) << 8) | ((((unsigned long)(myrand(seed)) & 0xFF0000)) >> 8) | ((((unsigned long)(myrand(seed)) & 0xFF000000)) >> 24));
  ip->check = 0;
  ip->check = ip_fast_csum(ip, ip->ihl);
  udp = (struct udphdr *)((char *)ip + sizeof(*ip));
  rand_val = myrand(seed);
  udp->source = (((((unsigned short)(rand_val & 0xFFFF) & 0xFF)) << 8) | (((unsigned short)(rand_val & 0xFFFF) & 0xFF00) >> 8));
  udp->dest = (((((unsigned short)((rand_val >> 16) & 0xFFFF) & 0xFF)) << 8) | (((unsigned short)((rand_val >> 16) & 0xFFFF) & 0xFF00) >> 8));
  udp->len = (((((unsigned short)(size - sizeof(*eth) - sizeof(*ip)) & 0xFF)) << 8) | (((unsigned short)(size - sizeof(*eth) - sizeof(*ip)) & 0xFF00) >> 8));
  udp->check = 0;
}
```