user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<load_programs>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %edx,-0x24(%rbp)
  movl   $0x0,-0x4(%rbp)
  jmp    L32
L8:
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  shl    $0x2,%rax
  add    %rdx,%rax
  shl    $0x3,%rax
  mov    %rax,%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    D3(%rip),%rax
  mov    (%rax),%rax
  cmp    %rax,%rdx
  jne    L21
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  shl    $0x2,%rax
  add    %rdx,%rax
  shl    $0x3,%rax
  mov    %rax,%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    0x10(%rax),%rdx
  mov    -0x4(%rbp),%eax
  movslq %eax,%rcx
  mov    %rcx,%rax
  shl    $0x2,%rax
  add    %rcx,%rax
  shl    $0x3,%rax
  mov    %rax,%rcx
  mov    -0x20(%rbp),%rax
  add    %rcx,%rax
  mov    0x8(%rax),%eax
  movslq %eax,%rcx
  mov    -0x18(%rbp),%rax
  add    %rax,%rcx
  mov    -0x4(%rbp),%eax
  movslq %eax,%rsi
  mov    %rsi,%rax
  shl    $0x2,%rax
  add    %rsi,%rax
  shl    $0x3,%rax
  mov    %rax,%rsi
  mov    -0x20(%rbp),%rax
  add    %rsi,%rax
  mov    0x20(%rax),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  shl    $0x2,%rax
  add    %rdx,%rax
  shl    $0x3,%rax
  mov    %rax,%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    0x10(%rax),%rcx
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  shl    $0x2,%rax
  add    %rdx,%rax
  shl    $0x3,%rax
  mov    %rax,%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    0x18(%rax),%rax
  cmp    %rax,%rcx
  jge    L21
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  shl    $0x2,%rax
  add    %rdx,%rax
  shl    $0x3,%rax
  mov    %rax,%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    0x18(%rax),%rax
  mov    %eax,%ecx
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  shl    $0x2,%rax
  add    %rdx,%rax
  shl    $0x3,%rax
  mov    %rax,%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    0x10(%rax),%rax
  mov    %eax,%edx
  mov    %ecx,%eax
  sub    %edx,%eax
  mov    %eax,%ecx
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  shl    $0x2,%rax
  add    %rdx,%rax
  shl    $0x3,%rax
  mov    %rax,%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    0x10(%rax),%rax
  mov    %rax,%rsi
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  shl    $0x2,%rax
  add    %rdx,%rax
  shl    $0x3,%rax
  mov    %rax,%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    0x20(%rax),%rax
  add    %rsi,%rax
  mov    %ecx,%edx
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
L21:
  addl   $0x1,-0x4(%rbp)
L32:
  mov    -0x4(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jl     L8
  nop
  nop
  leave
  ret
```

assistant: ```c
void load_programs(unsigned char *image, Elf64_Phdr *hdrs, int nhdr) {
  int i;
  for (i = 0; i < nhdr; i++) {
    if (hdrs[i].p_type == PT_LOAD) {

      ;
      memcpy((void *)hdrs[i].p_vaddr, image + hdrs[i].p_offset, hdrs[i].p_filesz);
      if (hdrs[i].p_filesz < hdrs[i].p_memsz) {
        memset((void *)hdrs[i].p_vaddr + hdrs[i].p_filesz, 0, hdrs[i].p_memsz - hdrs[i].p_filesz);
      }
    }
  }
}
```