user: Please show me the C implementation that matches the assembly code listed below:

```asm
<majorityElement>:
  endbr64
  push   %r14
  mov    %rdx,%r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  mov    $0x8,%edi
  push   %rbx
  mov    %esi,%ebx
  call   <malloc@plt>
  mov    %rax,%r9
  test   %ebx,%ebx
  jle    L209
  lea    -0x1(%rbx),%eax
  mov    %rbp,%rdi
  xor    %esi,%esi
  xor    %ecx,%ecx
  mov    %rax,%r10
  lea    0x4(%rbp,%rax,4),%r8
  mov    %rbp,%rax
  jmp    L54
L288:
  cmp    %edx,%r13d
  je     L112
  test   %esi,%esi
  je     L5
  cmp    %edx,%r12d
  je     L251
  sub    $0x1,%ecx
  sub    $0x1,%esi
L256:
  add    $0x4,%rax
  cmp    %r8,%rax
  je     L15
L54:
  mov    (%rax),%edx
  test   %ecx,%ecx
  jne    L288
  test   %esi,%esi
  je     L367
  cmp    %edx,%r12d
  je     L251
L367:
  add    $0x4,%rax
  mov    %edx,%r13d
  mov    $0x1,%ecx
  cmp    %r8,%rax
  jne    L54
L15:
  movl   $0x0,(%r14)
  test   %ecx,%ecx
  je     L221
  cmp    $0x2,%r10d
  jbe    L310
  mov    %ebx,%eax
  movd   %r13d,%xmm3
  pxor   %xmm1,%xmm1
  shr    $0x2,%eax
  pshufd $0x0,%xmm3,%xmm2
  sub    $0x1,%eax
  shl    $0x4,%rax
  lea    0x10(%rbp,%rax,1),%rdx
  mov    %rbp,%rax
  nopl   0x0(%rax,%rax,1)
L50:
  movdqu (%rax),%xmm0
  add    $0x10,%rax
  pcmpeqd %xmm2,%xmm0
  psubd  %xmm0,%xmm1
  cmp    %rax,%rdx
  jne    L50
  movdqa %xmm1,%xmm0
  mov    %ebx,%edx
  psrldq $0x8,%xmm0
  and    $0xfffffffc,%edx
  paddd  %xmm0,%xmm1
  movdqa %xmm1,%xmm0
  psrldq $0x4,%xmm0
  paddd  %xmm0,%xmm1
  movd   %xmm1,%eax
  test   $0x3,%bl
  je     L223
L33:
  movslq %edx,%rcx
  lea    0x0(,%rcx,4),%r8
  cmp    0x0(%rbp,%rcx,4),%r13d
  jne    L73
  add    $0x1,%eax
L73:
  lea    0x1(%rdx),%ecx
  cmp    %ecx,%ebx
  jle    L223
  cmp    0x4(%rbp,%r8,1),%r13d
  jne    L254
  add    $0x1,%eax
L254:
  add    $0x2,%edx
  cmp    %ebx,%edx
  jge    L223
  cmp    0x8(%rbp,%r8,1),%r13d
  je     L144
L223:
  movslq %ebx,%rdx
  mov    %ebx,%ecx
  imul   $0x55555556,%rdx,%rdx
  sar    $0x1f,%ecx
  shr    $0x20,%rdx
  sub    %ecx,%edx
  cmp    %eax,%edx
  jl     L103
L221:
  test   %esi,%esi
  je     L90
  cmp    $0x2,%r10d
  jbe    L280
  mov    %ebx,%eax
  movd   %r12d,%xmm4
  pxor   %xmm1,%xmm1
  shr    $0x2,%eax
  pshufd $0x0,%xmm4,%xmm2
  sub    $0x1,%eax
  shl    $0x4,%rax
  lea    0x10(%rbp,%rax,1),%rax
  nopl   0x0(%rax,%rax,1)
L228:
  movdqu (%rdi),%xmm0
  add    $0x10,%rdi
  pcmpeqd %xmm2,%xmm0
  psubd  %xmm0,%xmm1
  cmp    %rdi,%rax
  jne    L228
  movdqa %xmm1,%xmm0
  mov    %ebx,%edx
  psrldq $0x8,%xmm0
  and    $0xfffffffc,%edx
  paddd  %xmm0,%xmm1
  movdqa %xmm1,%xmm0
  psrldq $0x4,%xmm0
  paddd  %xmm0,%xmm1
  movd   %xmm1,%eax
  test   $0x3,%bl
  je     L188
L346:
  movslq %edx,%rcx
  lea    0x0(,%rcx,4),%rsi
  cmp    %r12d,0x0(%rbp,%rcx,4)
  jne    L353
  add    $0x1,%eax
L353:
  lea    0x1(%rdx),%ecx
  cmp    %ebx,%ecx
  jge    L188
  cmp    %r12d,0x4(%rbp,%rsi,1)
  jne    L109
  add    $0x1,%eax
L109:
  add    $0x2,%edx
  cmp    %ebx,%edx
  jge    L188
  cmp    %r12d,0x8(%rbp,%rsi,1)
  jne    L188
  add    $0x1,%eax
L188:
  movslq %ebx,%rdx
  sar    $0x1f,%ebx
  imul   $0x55555556,%rdx,%rdx
  shr    $0x20,%rdx
  sub    %ebx,%edx
  cmp    %eax,%edx
  jge    L90
  movslq (%r14),%rax
  lea    0x1(%rax),%edx
  mov    %edx,(%r14)
  mov    %r12d,(%r9,%rax,4)
L90:
  pop    %rbx
  mov    %r9,%rax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   0x0(%rax)
L5:
  mov    %edx,%r12d
  mov    $0x1,%esi
  jmp    L256
  nopl   (%rax)
L112:
  add    $0x1,%ecx
  jmp    L256
  nopl   0x0(%rax,%rax,1)
L251:
  add    $0x1,%esi
  mov    %edx,%r12d
  jmp    L256
  nopl   0x0(%rax,%rax,1)
L103:
  movl   $0x1,(%r14)
  mov    %r13d,(%r9)
  jmp    L221
  nop
L144:
  add    $0x1,%eax
  jmp    L223
L280:
  xor    %edx,%edx
  xor    %eax,%eax
  jmp    L346
  nopl   0x0(%rax)
L209:
  pop    %rbx
  mov    %r9,%rax
  pop    %rbp
  movl   $0x0,(%r14)
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L310:
  xor    %edx,%edx
  xor    %eax,%eax
  jmp    L33
```

assistant: ```c
int *majorityElement(int *nums, int numsSize, int *returnSize) {
  int n1, n2, c1, c2;
  int *res = (int *)malloc(2 * sizeof(int));
  c1 = c2 = 0;
  for (int i = 0; i < numsSize; i++) {
    if (c1 > 0 && n1 == nums[i]) {
      c1++;
      continue;
    }
    if (c2 > 0 && n2 == nums[i]) {
      c2++;
      continue;
    }
    if (c1 == 0) {
      n1 = nums[i];
      c1 = 1;
      continue;
    }
    if (c2 == 0) {
      n2 = nums[i];
      c2 = 1;
      continue;
    }
    c1--;
    c2--;
  }
  *returnSize = 0;
  if (c1 > 0) {
    c1 = 0;
    for (int i = 0; i < numsSize; i++) {
      if (n1 == nums[i])
        c1++;
    }
    if (c1 > numsSize / 3) {
      res[(*returnSize)++] = n1;
    }
  }
  if (c2 > 0) {
    c2 = 0;
    for (int i = 0; i < numsSize; i++) {
      if (n2 == nums[i])
        c2++;
    }
    if (c2 > numsSize / 3) {
      res[(*returnSize)++] = n2;
    }
  }
  return res;
}
```