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

```asm
<sortColors>:
  endbr64
  movslq %esi,%rsi
  lea    (%rdi,%rsi,4),%r8
  cmp    %r8,%rdi
  jae    L190
  push   %r12
  mov    %rdi,%rcx
  mov    %rdi,%rax
  xor    %r9d,%r9d
  push   %rbp
  xor    %edi,%edi
  xor    %esi,%esi
  push   %rbx
  jmp    L198
  nopw   0x0(%rax,%rax,1)
L25:
  cmp    $0x1,%edx
  adc    $0x0,%esi
L38:
  add    $0x4,%rax
  cmp    %r8,%rax
  jae    L58
L198:
  mov    (%rax),%edx
  cmp    $0x1,%edx
  je     L160
  cmp    $0x2,%edx
  jne    L25
  add    $0x4,%rax
  add    $0x1,%r9d
  cmp    %r8,%rax
  jb     L198
L58:
  movslq %esi,%rsi
  movslq %edi,%rdi
  movslq %r9d,%r9
  add    %rsi,%rdi
  lea    0x0(,%rsi,4),%r12
  add    %rdi,%r9
  lea    (%rcx,%r12,1),%rax
  lea    (%rcx,%rdi,4),%rbp
  lea    (%rcx,%r9,4),%rbx
  cmp    %rax,%rcx
  jae    L48
  mov    %rcx,%rdi
  mov    %r12,%rdx
  xor    %esi,%esi
  call   <memset@plt>
  mov    %rax,%rcx
  add    %r12,%rcx
L48:
  cmp    %rbp,%rcx
  jae    L106
  lea    -0x1(%rbp),%rdx
  mov    %rcx,%rax
  sub    %rcx,%rdx
  mov    %rdx,%rsi
  shr    $0x2,%rsi
  add    $0x1,%rsi
  cmp    $0xb,%rdx
  jbe    L87
  mov    %rsi,%rdx
  movdqa D4(%rip),%xmm0
  shr    $0x2,%rdx
  shl    $0x4,%rdx
  add    %rcx,%rdx
  nopl   (%rax)
L167:
  movups %xmm0,(%rax)
  add    $0x10,%rax
  cmp    %rdx,%rax
  jne    L167
  mov    %rsi,%rdx
  and    $0xfffffffffffffffc,%rdx
  lea    (%rcx,%rdx,4),%rax
  cmp    %rdx,%rsi
  je     L189
L87:
  lea    0x4(%rax),%rdx
  movl   $0x1,(%rax)
  cmp    %rdx,%rbp
  jbe    L189
  lea    0x8(%rax),%rdx
  movl   $0x1,0x4(%rax)
  cmp    %rdx,%rbp
  jbe    L189
  movl   $0x1,0x8(%rax)
L189:
  lea    (%rcx,%rsi,4),%rcx
L106:
  cmp    %rbx,%rcx
  jae    L98
  lea    -0x1(%rbx),%rdx
  mov    %rcx,%rax
  sub    %rcx,%rdx
  mov    %rdx,%rsi
  shr    $0x2,%rsi
  add    $0x1,%rsi
  cmp    $0xb,%rdx
  jbe    L119
  mov    %rsi,%rdx
  movdqa D3(%rip),%xmm0
  shr    $0x2,%rdx
  shl    $0x4,%rdx
  add    %rcx,%rdx
  nopl   0x0(%rax)
L59:
  movups %xmm0,(%rax)
  add    $0x10,%rax
  cmp    %rax,%rdx
  jne    L59
  mov    %rsi,%rax
  and    $0xfffffffffffffffc,%rax
  lea    (%rcx,%rax,4),%rcx
  cmp    %rsi,%rax
  je     L98
L119:
  lea    0x4(%rcx),%rax
  movl   $0x2,(%rcx)
  cmp    %rax,%rbx
  jbe    L98
  lea    0x8(%rcx),%rax
  movl   $0x2,0x4(%rcx)
  cmp    %rax,%rbx
  jbe    L98
  movl   $0x2,0x8(%rcx)
L98:
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
  nopw   0x0(%rax,%rax,1)
L160:
  add    $0x1,%edi
  jmp    L38
  nopl   0x0(%rax,%rax,1)
L190:
  ret
```

tool_calls: name: unpack_data
arguments: label: D4
type_guessed: byte[16]
name: unpack_data
arguments: label: D3
type_guessed: byte[16]

tool: {"D4": [0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00]}

tool: {"D3": [0x02,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x02,0x00,0x00,0x00]}

assistant: ```c
void sortColors(int *nums, int numsSize) {
  int red = 0, white = 0, blue = 0;
  for (int *p = nums; p < nums + numsSize; p++) {
    switch (*p) {
    case 0:
      red++;
      break;
    case 1:
      white++;
      break;
    case 2:
      blue++;
      break;
    default:
      break;
    }
  }
  int *p = nums;
  for (; p < nums + red; p++) {
    *p = 0;
  }
  for (; p < nums + red + white; p++) {
    *p = 1;
  }
  for (; p < nums + blue + red + white; p++) {
    *p = 2;
  }
}
```