user: Translate the below assembly code into C programming language:

```asm
<convert_elf_phdrs>:
  endbr64
  mov    %rdi,%rax
  test   %esi,%esi
  jle    L13
  mov    %esi,%esi
  shl    $0x5,%rsi
  lea    (%rdi,%rsi,1),%rcx
L12:
  mov    (%rax),%edx
  mov    %edx,%esi
  shl    $0x18,%esi
  mov    %edx,%edi
  sar    $0x18,%edi
  or     %edi,%esi
  mov    %edx,%edi
  shl    $0x8,%edi
  and    $0xff0000,%edi
  or     %edi,%esi
  sar    $0x8,%edx
  and    $0xff00,%edx
  or     %esi,%edx
  mov    %edx,(%rax)
  mov    0x4(%rax),%edx
  mov    %edx,%esi
  shl    $0x18,%esi
  mov    %edx,%edi
  sar    $0x18,%edi
  or     %edi,%esi
  mov    %edx,%edi
  shl    $0x8,%edi
  and    $0xff0000,%edi
  or     %edi,%esi
  sar    $0x8,%edx
  and    $0xff00,%edx
  or     %esi,%edx
  mov    %edx,0x4(%rax)
  mov    0x8(%rax),%edx
  mov    %edx,%esi
  shl    $0x18,%esi
  mov    %edx,%edi
  sar    $0x18,%edi
  or     %edi,%esi
  mov    %edx,%edi
  shl    $0x8,%edi
  and    $0xff0000,%edi
  or     %edi,%esi
  sar    $0x8,%edx
  and    $0xff00,%edx
  or     %esi,%edx
  mov    %edx,0x8(%rax)
  mov    0xc(%rax),%edx
  mov    %edx,%esi
  shl    $0x18,%esi
  mov    %edx,%edi
  sar    $0x18,%edi
  or     %edi,%esi
  mov    %edx,%edi
  shl    $0x8,%edi
  and    $0xff0000,%edi
  or     %edi,%esi
  sar    $0x8,%edx
  and    $0xff00,%edx
  or     %esi,%edx
  mov    %edx,0xc(%rax)
  mov    0x10(%rax),%edx
  mov    %edx,%esi
  shl    $0x18,%esi
  mov    %edx,%edi
  sar    $0x18,%edi
  or     %edi,%esi
  mov    %edx,%edi
  shl    $0x8,%edi
  and    $0xff0000,%edi
  or     %edi,%esi
  sar    $0x8,%edx
  and    $0xff00,%edx
  or     %esi,%edx
  mov    %edx,0x10(%rax)
  mov    0x14(%rax),%edx
  mov    %edx,%esi
  shl    $0x18,%esi
  mov    %edx,%edi
  sar    $0x18,%edi
  or     %edi,%esi
  mov    %edx,%edi
  shl    $0x8,%edi
  and    $0xff0000,%edi
  or     %edi,%esi
  sar    $0x8,%edx
  and    $0xff00,%edx
  or     %esi,%edx
  mov    %edx,0x14(%rax)
  mov    0x18(%rax),%edx
  mov    %edx,%esi
  shl    $0x18,%esi
  mov    %edx,%edi
  sar    $0x18,%edi
  or     %edi,%esi
  mov    %edx,%edi
  shl    $0x8,%edi
  and    $0xff0000,%edi
  or     %edi,%esi
  sar    $0x8,%edx
  and    $0xff00,%edx
  or     %esi,%edx
  mov    %edx,0x18(%rax)
  mov    0x1c(%rax),%edx
  mov    %edx,%esi
  shl    $0x18,%esi
  mov    %edx,%edi
  sar    $0x18,%edi
  or     %edi,%esi
  mov    %edx,%edi
  shl    $0x8,%edi
  and    $0xff0000,%edi
  or     %edi,%esi
  sar    $0x8,%edx
  and    $0xff00,%edx
  or     %esi,%edx
  mov    %edx,0x1c(%rax)
  add    $0x20,%rax
  cmp    %rax,%rcx
  jne    L12
L13:
  ret
```

assistant: ```c
void convert_elf_phdrs(Elf32_Phdr *p, int num) {
  int i;
  for (i = 0; i < num; i++, p++) {
    p->p_type = ((unsigned int)((((uint32_t)(p->p_type) & (uint32_t)0x000000ffUL) << 24) | (((uint32_t)(p->p_type) & (uint32_t)0x0000ff00UL) << 8) | (((uint32_t)(p->p_type) & (uint32_t)0x00ff0000UL) >> 8) | (((uint32_t)(p->p_type) & (uint32_t)0xff000000UL) >> 24)));
    p->p_offset = ((unsigned int)((((uint32_t)(p->p_offset) & (uint32_t)0x000000ffUL) << 24) | (((uint32_t)(p->p_offset) & (uint32_t)0x0000ff00UL) << 8) | (((uint32_t)(p->p_offset) & (uint32_t)0x00ff0000UL) >> 8) | (((uint32_t)(p->p_offset) & (uint32_t)0xff000000UL) >> 24)));
    p->p_vaddr = ((unsigned int)((((uint32_t)(p->p_vaddr) & (uint32_t)0x000000ffUL) << 24) | (((uint32_t)(p->p_vaddr) & (uint32_t)0x0000ff00UL) << 8) | (((uint32_t)(p->p_vaddr) & (uint32_t)0x00ff0000UL) >> 8) | (((uint32_t)(p->p_vaddr) & (uint32_t)0xff000000UL) >> 24)));
    p->p_paddr = ((unsigned int)((((uint32_t)(p->p_paddr) & (uint32_t)0x000000ffUL) << 24) | (((uint32_t)(p->p_paddr) & (uint32_t)0x0000ff00UL) << 8) | (((uint32_t)(p->p_paddr) & (uint32_t)0x00ff0000UL) >> 8) | (((uint32_t)(p->p_paddr) & (uint32_t)0xff000000UL) >> 24)));
    p->p_filesz = ((unsigned int)((((uint32_t)(p->p_filesz) & (uint32_t)0x000000ffUL) << 24) | (((uint32_t)(p->p_filesz) & (uint32_t)0x0000ff00UL) << 8) | (((uint32_t)(p->p_filesz) & (uint32_t)0x00ff0000UL) >> 8) | (((uint32_t)(p->p_filesz) & (uint32_t)0xff000000UL) >> 24)));
    p->p_memsz = ((unsigned int)((((uint32_t)(p->p_memsz) & (uint32_t)0x000000ffUL) << 24) | (((uint32_t)(p->p_memsz) & (uint32_t)0x0000ff00UL) << 8) | (((uint32_t)(p->p_memsz) & (uint32_t)0x00ff0000UL) >> 8) | (((uint32_t)(p->p_memsz) & (uint32_t)0xff000000UL) >> 24)));
    p->p_flags = ((unsigned int)((((uint32_t)(p->p_flags) & (uint32_t)0x000000ffUL) << 24) | (((uint32_t)(p->p_flags) & (uint32_t)0x0000ff00UL) << 8) | (((uint32_t)(p->p_flags) & (uint32_t)0x00ff0000UL) >> 8) | (((uint32_t)(p->p_flags) & (uint32_t)0xff000000UL) >> 24)));
    p->p_align = ((unsigned int)((((uint32_t)(p->p_align) & (uint32_t)0x000000ffUL) << 24) | (((uint32_t)(p->p_align) & (uint32_t)0x0000ff00UL) << 8) | (((uint32_t)(p->p_align) & (uint32_t)0x00ff0000UL) >> 8) | (((uint32_t)(p->p_align) & (uint32_t)0xff000000UL) >> 24)));
  }
}
```