user: Converte this assembly snippet into its equivalent C code:

```asm
<__pnacl_start_linux_c>:
  endbr64
  push   %rbp
  lea    0x4(%rdi),%r8
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  mov    %rdi,%r13
  push   %r12
  push   %rbx
  sub    $0x28,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  movslq (%rdi),%rax
  mov    %r8,-0x50(%rbp)
  lea    0x8(,%rax,8),%rdx
  mov    %rax,%rbx
  lea    (%r8,%rdx,1),%r15
  mov    %rdx,-0x48(%rbp)
  mov    %r15,%rdi
  call   <count_envs@plt>
  lea    0x7(%rbx,%rax,1),%edi
  mov    %eax,%r14d
  shl    $0x2,%edi
  call   <alloca@plt>
  test   %ebx,%ebx
  mov    -0x48(%rbp),%rdx
  movl   $0x0,(%rax)
  mov    %rax,%rdi
  mov    %r14d,0x4(%rax)
  mov    %ebx,0x8(%rax)
  jle    L119
  lea    -0x1(%rbx),%eax
  mov    -0x50(%rbp),%r8
  lea    0x4(%rbx),%r12d
  cmp    $0x2,%eax
  jbe    L8
  mov    %ebx,%ecx
  lea    0xc(%rdi),%rax
  shr    $0x2,%ecx
  sub    $0x1,%ecx
  shl    $0x4,%rcx
  lea    0x1c(%rdi,%rcx,1),%rsi
  mov    %rdi,%rcx
  neg    %rcx
  lea    0x0(%r13,%rcx,2),%rcx
  nopl   0x0(%rax)
L3:
  movdqu -0x14(%rcx,%rax,2),%xmm0
  movdqu -0x4(%rcx,%rax,2),%xmm1
  add    $0x10,%rax
  shufps $0x88,%xmm1,%xmm0
  movups %xmm0,-0x10(%rax)
  cmp    %rsi,%rax
  jne    L3
  mov    %ebx,%eax
  mov    %ebx,%esi
  and    $0xfffffffc,%eax
  or     $0x3,%esi
  test   $0x3,%bl
  je     L7
L44:
  movslq %eax,%rcx
  movslq %esi,%rsi
  shl    $0x3,%rcx
  lea    0x0(,%rsi,4),%r9
  mov    0x4(%r13,%rcx,1),%r10
  mov    %r10d,(%rdi,%rsi,4)
  lea    0x1(%rax),%esi
  cmp    %esi,%ebx
  jle    L7
  mov    0x8(%r8,%rcx,1),%rsi
  add    $0x2,%eax
  mov    %esi,0x4(%rdi,%r9,1)
  cmp    %eax,%ebx
  jle    L7
  mov    0x10(%r8,%rcx,1),%rax
  mov    %eax,0x8(%rdi,%r9,1)
L7:
  add    $0x3,%ebx
  movslq %ebx,%rbx
  shl    $0x2,%rbx
  lea    0x4(%rbx),%rax
  lea    0x8(%rbx),%rcx
L108:
  movl   $0x0,(%rdi,%rbx,1)
  test   %r14d,%r14d
  jle    L65
  lea    -0x1(%r14),%eax
  cmp    $0x2,%eax
  jbe    L29
  movslq %r12d,%rax
  mov    %r14d,%ecx
  lea    (%rdi,%rax,4),%rax
  shr    $0x2,%ecx
  mov    %rax,%rsi
  shl    $0x4,%rcx
  neg    %rsi
  add    %rax,%rcx
  lea    0x4(%rdx,%rsi,2),%rdx
  add    %r13,%rdx
  nopw   0x0(%rax,%rax,1)
L155:
  movdqu (%rdx,%rax,2),%xmm0
  movdqu 0x10(%rdx,%rax,2),%xmm2
  add    $0x10,%rax
  shufps $0x88,%xmm2,%xmm0
  movups %xmm0,-0x10(%rax)
  cmp    %rcx,%rax
  jne    L155
  mov    %r14d,%eax
  and    $0xfffffffc,%eax
  lea    (%rax,%r12,1),%edx
  cmp    %r14d,%eax
  je     L39
L131:
  movslq %eax,%rcx
  movslq %edx,%rdx
  lea    0x0(,%rcx,8),%r8
  mov    (%r15,%rcx,8),%rcx
  lea    0x0(,%rdx,4),%rsi
  mov    %ecx,(%rdi,%rdx,4)
  lea    0x1(%rax),%edx
  cmp    %edx,%r14d
  jle    L39
  mov    0x8(%r15,%r8,1),%rdx
  add    $0x2,%eax
  mov    %edx,0x4(%rdi,%rsi,1)
  cmp    %eax,%r14d
  jle    L39
  mov    0x10(%r15,%r8,1),%rax
  mov    %eax,0x8(%rdi,%rsi,1)
L39:
  add    %r14d,%r12d
  movslq %r12d,%rax
  shl    $0x2,%rax
  lea    0x4(%rax),%rcx
L65:
  add    $0x2,%r12d
  movl   $0x0,(%rdi,%rax,1)
  movslq %r12d,%r12
  movl   $0x0,(%rdi,%rcx,1)
  movl   $0x0,(%rdi,%r12,4)
  call   <__pnacl_start@plt>
  mov    -0x38(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L43
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
  nopl   0x0(%rax,%rax,1)
L119:
  mov    $0x14,%ecx
  mov    $0x10,%eax
  mov    $0x4,%r12d
  mov    $0xc,%ebx
  jmp    L108
L8:
  xor    %eax,%eax
  mov    $0x3,%esi
  jmp    L44
L29:
  mov    %r12d,%edx
  xor    %eax,%eax
  jmp    L131
L43:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void __pnacl_start_linux_c(uint32_t *stack) {
  int argc = stack[0];
  char **argv = (char **)(stack + 1);
  char **envp = argv + argc + 1;
  int envc = count_envs(envp);
  int num_entries = 1 + 1 + 1 + argc + 1 + envc + 1 + 2;
  uint32_t *info = (uint32_t *)alloca(sizeof(uint32_t) * num_entries);
  int i = 0;
  int j;
  info[i++] = 0;
  info[i++] = envc;
  info[i++] = argc;
  for (j = 0; j < argc; j++)
    info[i++] = (uint32_t)argv[j];
  info[i++] = 0;
  for (j = 0; j < envc; j++)
    info[i++] = (uint32_t)envp[j];
  info[i++] = 0;
  info[i++] = 0;
  info[i++] = 0;
  __pnacl_start(info);
}
```