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

```asm
<urlify>:
  endbr64
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  lea    -0x1(%rsi),%ebx
  sub    $0x10,%rsp
  test   %esi,%esi
  jle    L129
  cmp    $0xe,%ebx
  jbe    L96
  mov    %esi,%edx
  pxor   %xmm1,%xmm1
  pxor   %xmm5,%xmm5
  mov    %rdi,%rax
  shr    $0x4,%edx
  movdqa D13(%rip),%xmm7
  movdqa D1(%rip),%xmm6
  pxor   %xmm4,%xmm4
  sub    $0x1,%edx
  shl    $0x4,%rdx
  lea    0x10(%rdi,%rdx,1),%rdx
  nopl   0x0(%rax,%rax,1)
L83:
  movdqu (%rax),%xmm0
  movdqa %xmm5,%xmm3
  add    $0x10,%rax
  pcmpeqb %xmm7,%xmm0
  pand   %xmm6,%xmm0
  pcmpgtb %xmm0,%xmm3
  movdqa %xmm0,%xmm2
  punpcklbw %xmm3,%xmm2
  punpckhbw %xmm3,%xmm0
  movdqa %xmm4,%xmm3
  pcmpgtw %xmm2,%xmm3
  movdqa %xmm2,%xmm8
  punpcklwd %xmm3,%xmm8
  punpckhwd %xmm3,%xmm2
  movdqa %xmm0,%xmm3
  paddd  %xmm8,%xmm1
  paddd  %xmm2,%xmm1
  movdqa %xmm4,%xmm2
  pcmpgtw %xmm0,%xmm2
  punpcklwd %xmm2,%xmm3
  punpckhwd %xmm2,%xmm0
  paddd  %xmm3,%xmm1
  paddd  %xmm0,%xmm1
  cmp    %rdx,%rax
  jne    L83
  movdqa %xmm1,%xmm0
  mov    %esi,%edx
  psrldq $0x8,%xmm0
  and    $0xfffffff0,%edx
  paddd  %xmm0,%xmm1
  movdqa %xmm1,%xmm0
  psrldq $0x4,%xmm0
  paddd  %xmm0,%xmm1
  movd   %xmm1,%eax
  test   $0xf,%sil
  je     L249
L135:
  movslq %edx,%rcx
  cmpb   $0x20,0x0(%rbp,%rcx,1)
  sete   %cl
  movzbl %cl,%ecx
  add    %ecx,%eax
  lea    0x1(%rdx),%ecx
  cmp    %esi,%ecx
  jge    L249
  movslq %ecx,%rcx
  cmpb   $0x20,0x0(%rbp,%rcx,1)
  sete   %cl
  movzbl %cl,%ecx
  add    %ecx,%eax
  lea    0x2(%rdx),%ecx
  cmp    %ecx,%esi
  jle    L249
  movslq %ecx,%rcx
  cmpb   $0x20,0x0(%rbp,%rcx,1)
  sete   %cl
  movzbl %cl,%ecx
  add    %ecx,%eax
  lea    0x3(%rdx),%ecx
  cmp    %ecx,%esi
  jle    L249
  movslq %ecx,%rcx
  cmpb   $0x20,0x0(%rbp,%rcx,1)
  sete   %cl
  movzbl %cl,%ecx
  add    %ecx,%eax
  lea    0x4(%rdx),%ecx
  cmp    %ecx,%esi
  jle    L249
  movslq %ecx,%rcx
  cmpb   $0x20,0x0(%rbp,%rcx,1)
  sete   %cl
  movzbl %cl,%ecx
  add    %ecx,%eax
  lea    0x5(%rdx),%ecx
  cmp    %ecx,%esi
  jle    L249
  movslq %ecx,%rcx
  cmpb   $0x20,0x0(%rbp,%rcx,1)
  sete   %cl
  movzbl %cl,%ecx
  add    %ecx,%eax
  lea    0x6(%rdx),%ecx
  cmp    %ecx,%esi
  jle    L249
  movslq %ecx,%rcx
  cmpb   $0x20,0x0(%rbp,%rcx,1)
  sete   %cl
  movzbl %cl,%ecx
  add    %ecx,%eax
  lea    0x7(%rdx),%ecx
  cmp    %ecx,%esi
  jle    L249
  movslq %ecx,%rcx
  cmpb   $0x20,0x0(%rbp,%rcx,1)
  sete   %cl
  movzbl %cl,%ecx
  add    %ecx,%eax
  lea    0x8(%rdx),%ecx
  cmp    %ecx,%esi
  jle    L249
  movslq %ecx,%rcx
  cmpb   $0x20,0x0(%rbp,%rcx,1)
  sete   %cl
  movzbl %cl,%ecx
  add    %ecx,%eax
  lea    0x9(%rdx),%ecx
  cmp    %ecx,%esi
  jle    L249
  movslq %ecx,%rcx
  cmpb   $0x20,0x0(%rbp,%rcx,1)
  sete   %cl
  movzbl %cl,%ecx
  add    %ecx,%eax
  lea    0xa(%rdx),%ecx
  cmp    %ecx,%esi
  jle    L249
  movslq %ecx,%rcx
  cmpb   $0x20,0x0(%rbp,%rcx,1)
  sete   %cl
  movzbl %cl,%ecx
  add    %ecx,%eax
  lea    0xb(%rdx),%ecx
  cmp    %ecx,%esi
  jle    L249
  movslq %ecx,%rcx
  cmpb   $0x20,0x0(%rbp,%rcx,1)
  sete   %cl
  movzbl %cl,%ecx
  add    %ecx,%eax
  lea    0xc(%rdx),%ecx
  cmp    %ecx,%esi
  jle    L249
  movslq %ecx,%rcx
  cmpb   $0x20,0x0(%rbp,%rcx,1)
  sete   %cl
  movzbl %cl,%ecx
  add    %ecx,%eax
  lea    0xd(%rdx),%ecx
  cmp    %ecx,%esi
  jle    L249
  movslq %ecx,%rcx
  cmpb   $0x20,0x0(%rbp,%rcx,1)
  sete   %cl
  add    $0xe,%edx
  movzbl %cl,%ecx
  add    %ecx,%eax
  cmp    %edx,%esi
  jle    L249
  movslq %edx,%rdx
  cmpb   $0x20,0x0(%rbp,%rdx,1)
  sete   %dl
  movzbl %dl,%edx
  add    %edx,%eax
  nop
L249:
  lea    (%rsi,%rax,2),%r12d
  mov    %r12d,%edi
  call   <malloc@plt>
  lea    -0x1(%r12),%ecx
  movslq %r12d,%r12
  movb   $0x0,(%rax,%r12,1)
  mov    %rax,%r8
L143:
  movslq %ebx,%rax
  jmp    L228
  nopl   0x0(%rax)
L195:
  sub    $0x1,%rax
  mov    %dil,(%rdx)
  mov    %esi,%ecx
  test   %eax,%eax
  js     L221
L228:
  movzbl 0x0(%rbp,%rax,1),%edi
  movslq %ecx,%rdx
  lea    -0x1(%rcx),%esi
  add    %r8,%rdx
  cmp    $0x20,%dil
  jne    L195
  movb   $0x30,(%rdx)
  lea    -0x2(%rcx),%edx
  movslq %esi,%rsi
  sub    $0x1,%rax
  movslq %edx,%rdx
  movb   $0x32,(%r8,%rsi,1)
  sub    $0x3,%ecx
  movb   $0x25,(%r8,%rdx,1)
  test   %eax,%eax
  jns    L228
L221:
  add    $0x10,%rsp
  mov    %r8,%rsi
  lea    D9(%rip),%rdi
  pop    %rbx
  pop    %rbp
  pop    %r12
  jmp    1060 <printf@plt>
  nopl   0x0(%rax)
L129:
  mov    %esi,%edi
  mov    %esi,0xc(%rsp)
  call   <malloc@plt>
  movslq 0xc(%rsp),%r12
  mov    %rax,%r8
  movb   $0x0,(%rax,%r12,1)
  test   %ebx,%ebx
  js     L221
  mov    %ebx,%ecx
  jmp    L143
  nopl   0x0(%rax,%rax,1)
L96:
  xor    %eax,%eax
  xor    %edx,%edx
  jmp    L135
```

tool_calls: name: unpack_data
arguments: tag: D13
type_infered: byte[16]
name: unpack_data
arguments: tag: D1
type_infered: byte[16]
name: unpack_data
arguments: tag: D9
type_infered: string

tool: {"D13": [0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20]}

tool: {"D1": [0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01]}

tool: D9: 
%s

assistant: ```c
void urlify(char *word, int length) {
  int i = 0, whitespaceCount = 0;
  int extraSpace = 0;
  char *newWord;
  for (; i < length; i++)
    if (word[i] == ' ')
      whitespaceCount++;
  extraSpace = (length) + (whitespaceCount * 2);
  newWord = malloc(sizeof(char) * extraSpace);
  newWord[extraSpace--] = '\0';
  for (i = length - 1; i >= 0; i--) {
    if (word[i] == ' ') {
      newWord[extraSpace--] = '0';
      newWord[extraSpace--] = '2';
      newWord[extraSpace--] = '%';
    } else {
      newWord[extraSpace--] = word[i];
    }
  }
  printf("\n%s", newWord);
}
```