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

```asm
<ex3>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  xor    %ebp,%ebp
  push   %rbx
  sub    $0xc8,%rsp
  movdqa D47(%rip),%xmm0
  movdqa D57(%rip),%xmm5
  mov    %fs:0x28,%rax
  mov    %rax,0xb8(%rsp)
  xor    %eax,%eax
  mov    %rsp,%r9
  lea    0x28(%rsp),%r12
  lea    0x60(%rsp),%rbx
  movaps %xmm0,(%rsp)
  movdqa D66(%rip),%xmm0
  mov    D22(%rip),%rax
  lea    0xb0(%rsp),%rsi
  movaps %xmm0,0x10(%rsp)
  movdqa D63(%rip),%xmm0
  mov    %rax,0x20(%rsp)
  movaps %xmm0,0x60(%rsp)
  pxor   %xmm0,%xmm0
  movaps %xmm0,0x70(%rsp)
  movdqa D41(%rip),%xmm0
  movaps %xmm0,0x80(%rsp)
  movdqa D10(%rip),%xmm0
  movaps %xmm0,0x90(%rsp)
  movdqa D11(%rip),%xmm0
  movaps %xmm0,0xa0(%rsp)
  xchg   %ax,%ax
L54:
  mov    (%r9),%edx
  movdqa %xmm5,%xmm1
  mov    %ebp,%r11d
  mov    %ebp,%r8d
  mov    %rbx,%rax
  lea    -0x1(%rbp),%r10d
  shr    $0x2,%r11d
  and    $0xfffffffc,%r8d
  movd   %edx,%xmm6
  pshufd $0x0,%xmm6,%xmm0
  movdqa %xmm0,%xmm4
  pcmpeqd 0x40(%rsp),%xmm0
  pcmpeqd 0x30(%rsp),%xmm4
  pand   %xmm0,%xmm1
  pand   %xmm5,%xmm4
  pandn  %xmm4,%xmm0
  movdqa %xmm0,%xmm3
  por    %xmm1,%xmm3
  jmp    L35
  nopl   0x0(%rax,%rax,1)
L74:
  add    $0x4,%rax
  cmp    %rax,%rsi
  je     L31
L35:
  cmp    (%rax),%edx
  jne    L74
  test   %ebp,%ebp
  je     L141
  cmp    $0x2,%r10d
  jbe    L103
  movdqa %xmm4,%xmm2
  cmp    $0x1,%r11d
  jbe    L29
  movdqa %xmm3,%xmm2
L29:
  movdqa %xmm2,%xmm1
  mov    %r8d,%ecx
  psrldq $0x8,%xmm1
  movdqa %xmm1,%xmm0
  pcmpgtd %xmm2,%xmm0
  pand   %xmm0,%xmm1
  pandn  %xmm2,%xmm0
  por    %xmm1,%xmm0
  movdqa %xmm0,%xmm2
  psrldq $0x4,%xmm2
  movdqa %xmm2,%xmm1
  pcmpgtd %xmm0,%xmm1
  pand   %xmm1,%xmm2
  pandn  %xmm0,%xmm1
  por    %xmm2,%xmm1
  movd   %xmm1,%edi
  cmp    %r8d,%ebp
  je     L160
L79:
  movslq %ecx,%r13
  add    $0x1,%ecx
  cmp    0x30(%rsp,%r13,4),%edx
  je     L55
  cmp    %ebp,%ecx
  jge    L160
L98:
  movslq %ecx,%r13
  cmp    0x30(%rsp,%r13,4),%edx
  je     L74
  add    $0x1,%ecx
  cmp    %ebp,%ecx
  jge    L160
  movslq %ecx,%rcx
  cmp    0x30(%rsp,%rcx,4),%edx
  je     L74
L160:
  test   %edi,%edi
  jne    L74
  cs nopw 0x0(%rax,%rax,1)
L141:
  movslq %ebp,%rax
  add    $0x1,%ebp
  mov    %edx,0x30(%rsp,%rax,4)
  nopw   0x0(%rax,%rax,1)
L31:
  add    $0x4,%r9
  cmp    %r9,%r12
  jne    L54
  lea    0x30(%rsp),%r12
  mov    %ebp,%esi
  mov    %r12,%rdi
  call   <insertionSort@plt>
  lea    D50(%rip),%rdx
  mov    %ebp,%esi
  mov    %r12,%rdi
  call   <printIArray@plt>
  mov    0xb8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L118
  add    $0xc8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  xchg   %ax,%ax
L55:
  mov    $0x1,%edi
  cmp    %ebp,%ecx
  jl     L98
  jmp    L74
L103:
  xor    %ecx,%ecx
  xor    %edi,%edi
  jmp    L79
L118:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: label: D47
type_infered: byte[16]
name: unpack_data
arguments: label: D57
type_infered: byte[16]
name: unpack_data
arguments: label: D66
type_infered: byte[16]
name: unpack_data
arguments: label: D22
type_infered: byte[8]
name: unpack_data
arguments: label: D63
type_infered: byte[16]
name: unpack_data
arguments: label: D41
type_infered: byte[16]
name: unpack_data
arguments: label: D10
type_infered: byte[16]
name: unpack_data
arguments: label: D11
type_infered: byte[16]
name: unpack_data
arguments: label: D50
type_infered: string

tool: {"D47": [0x01,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x09,0x00,0x00,0x00]}

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

tool: {"D66": [0x05,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x07,0x00,0x00,0x00,0x08,0x00,0x00,0x00]}

tool: {"D22": [0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00]}

tool: {"D63": [0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00]}

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

tool: {"D10": [0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x02,0x00,0x00,0x00]}

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

tool: D50: Conjunto Semelhanca: 

assistant: ```c
void ex3() {
  int a[10] = {1, 2, 3, 9, 5, 6, 7, 8, 0, 4};
  int b[20] = {0, 3, 0, 4, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2};
  int out[10];
  int j = 0;
  for (int i = 0; i < 10; i++) {
    for (int k = 0; k < 20; k++) {
      if (a[i] == b[k]) {
        int test = 0;
        for (int l = 0; l < j; l++) {
          if (out[l] == a[i])
            test = 1;
        }
        if (!test) {
          out[j++] = a[i];
          break;
        }
      }
    }
  }
  insertionSort(out, j);
  printIArray(out, j, "Conjunto Semelhanca: ");
}
```