user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<majorityElement1>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %esi,-0x3c(%rbp)
  mov    %rdx,-0x48(%rbp)
  movl   $0x0,-0x24(%rbp)
  movl   $0x0,-0x20(%rbp)
  movl   $0x0,-0x14(%rbp)
  jmp    L86
L7:
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    %eax,-0x1c(%rbp)
  jne    L151
  addl   $0x1,-0x24(%rbp)
  jmp    L49
L151:
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    %eax,-0x18(%rbp)
  jne    L51
  addl   $0x1,-0x20(%rbp)
  jmp    L49
L51:
  cmpl   $0x0,-0x24(%rbp)
  jne    L63
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x1c(%rbp)
  movl   $0x1,-0x24(%rbp)
  jmp    L49
L63:
  cmpl   $0x0,-0x20(%rbp)
  jne    L40
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x18(%rbp)
  movl   $0x1,-0x20(%rbp)
  jmp    L49
L40:
  subl   $0x1,-0x24(%rbp)
  subl   $0x1,-0x20(%rbp)
L49:
  addl   $0x1,-0x14(%rbp)
L86:
  mov    -0x14(%rbp),%eax
  cmp    -0x3c(%rbp),%eax
  jl     L7
  movl   $0x0,-0x20(%rbp)
  mov    -0x20(%rbp),%eax
  mov    %eax,-0x24(%rbp)
  movl   $0x0,-0x10(%rbp)
  jmp    L9
L36:
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    %eax,-0x1c(%rbp)
  jne    L47
  addl   $0x1,-0x24(%rbp)
  jmp    L163
L47:
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    %eax,-0x18(%rbp)
  jne    L163
  addl   $0x1,-0x20(%rbp)
L163:
  addl   $0x1,-0x10(%rbp)
L9:
  mov    -0x10(%rbp),%eax
  cmp    -0x3c(%rbp),%eax
  jl     L36
  mov    $0x8,%edi
  call   <malloc@plt>
  mov    %rax,-0x8(%rbp)
  movl   $0x0,-0xc(%rbp)
  mov    -0x3c(%rbp),%eax
  movslq %eax,%rdx
  imul   $0x55555556,%rdx,%rdx
  shr    $0x20,%rdx
  sar    $0x1f,%eax
  mov    %eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  cmp    %eax,-0x24(%rbp)
  jle    L157
  mov    -0xc(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0xc(%rbp)
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x8(%rbp),%rax
  add    %rax,%rdx
  mov    -0x1c(%rbp),%eax
  mov    %eax,(%rdx)
L157:
  mov    -0x3c(%rbp),%eax
  movslq %eax,%rdx
  imul   $0x55555556,%rdx,%rdx
  shr    $0x20,%rdx
  sar    $0x1f,%eax
  mov    %eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  cmp    %eax,-0x20(%rbp)
  jle    L56
  mov    -0xc(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0xc(%rbp)
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x8(%rbp),%rax
  add    %rax,%rdx
  mov    -0x18(%rbp),%eax
  mov    %eax,(%rdx)
L56:
  mov    -0x48(%rbp),%rax
  mov    -0xc(%rbp),%edx
  mov    %edx,(%rax)
  mov    -0x8(%rbp),%rax
  leave
  ret
```

assistant: ```c
int *majorityElement1(int *nums, int size, int *returnSize) {
  int count1 = 0, count2 = 0;
  int a, b;
  for (int i = 0; i < size; i++) {
    if (nums[i] == a)
      count1++;
    else if (nums[i] == b)
      count2++;
    else {
      if (count1 == 0)
        a = nums[i], count1 = 1;
      else if (count2 == 0)
        b = nums[i], count2 = 1;
      else
        count1--, count2--;
    }
  }
  count1 = count2 = 0;
  for (int i = 0; i < size; i++)
    if (nums[i] == a)
      count1++;
    else if (nums[i] == b)
      count2++;
  int *res = (int *)malloc(sizeof(int) * 2);
  int index = 0;
  if (count1 > size / 3)
    res[index++] = a;
  if (count2 > size / 3)
    res[index++] = b;
  *returnSize = index;
  return res;
}
```