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

```asm
<decbin>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %edx,-0x34(%rbp)
  movl   $0x0,-0x18(%rbp)
  movl   $0x0,-0x8(%rbp)
  movl   $0x0,-0x1c(%rbp)
  mov    -0x34(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x4(%rbp)
  jmp    L67
L42:
  movl   $0x0,-0x18(%rbp)
  mov    -0x1c(%rbp),%eax
  mov    %eax,-0x14(%rbp)
  jmp    L87
L46:
  cmpl   $0x0,-0x18(%rbp)
  jle    L26
  mov    -0x18(%rbp),%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  add    %eax,%eax
  mov    %eax,%ecx
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  add    %ecx,%eax
  mov    %eax,-0x18(%rbp)
  mov    -0x18(%rbp),%eax
  cltd
  shr    $0x1f,%edx
  add    %edx,%eax
  and    $0x1,%eax
  sub    %edx,%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rax,%rdx
  mov    -0x18(%rbp),%eax
  mov    %eax,%ecx
  shr    $0x1f,%ecx
  add    %ecx,%eax
  sar    %eax
  mov    %eax,(%rdx)
  movl   $0x0,-0x18(%rbp)
  jmp    L55
L26:
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cltd
  shr    $0x1f,%edx
  add    %edx,%eax
  and    $0x1,%eax
  sub    %edx,%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    -0x14(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x28(%rbp),%rdx
  add    %rcx,%rdx
  mov    %eax,%ecx
  shr    $0x1f,%ecx
  add    %ecx,%eax
  sar    %eax
  mov    %eax,(%rdx)
L55:
  mov    -0x18(%rbp),%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  add    %eax,%eax
  mov    %eax,%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x18(%rbp)
  addl   $0x1,-0x14(%rbp)
L87:
  mov    -0x14(%rbp),%eax
  cmp    -0x4(%rbp),%eax
  jle    L46
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rax,%rdx
  mov    -0xc(%rbp),%eax
  mov    %eax,(%rdx)
  addl   $0x1,-0x8(%rbp)
  mov    -0x1c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  test   %eax,%eax
  jne    L67
  addl   $0x1,-0x1c(%rbp)
L67:
  mov    -0x1c(%rbp),%eax
  cmp    -0x4(%rbp),%eax
  jle    L42
  movl   $0x0,-0x10(%rbp)
  jmp    L19
L71:
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,%esi
  lea    D3(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  addl   $0x1,-0x10(%rbp)
L19:
  mov    -0x10(%rbp),%eax
  cmp    -0x8(%rbp),%eax
  jl     L71
  nop
  nop
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: label: D3
datatype: string

tool: D3: %d

assistant: ```c
void decbin(int num[], int res[], int size) {
  int left, right, temp = 0, i, j, rem, k = 0;
  left = 0;
  right = size - 1;
  while (left <= right) {
    temp = 0;
    for (i = left; i <= right; i++) {
      if (temp > 0) {
        temp = temp * 10 + num[i];
        rem = temp % 2;
        num[i] = temp / 2;
        temp = 0;
      } else {
        rem = num[i] % 2;
        num[i] = num[i] / 2;
      }
      temp = temp * 10 + rem;
    }
    res[k] = rem;
    k++;
    if (num[left] == 0)
      left++;
  }
  for (j = 0; j < k; ++j) {
    printf("%d", res[j]);
  }
}
```