user: 请从给定的汇编指令推导出C源代码：

```asm
<find_gt_nd2>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x8,%rsp
  cmp    $0x1,%rsi
  je     L131
  mov    %rsi,%rbp
  lea    0x0(,%rsi,4),%edi
  test   $0x1,%sil
  jne    L83
  call   <malloc@plt>
  mov    %rax,%r13
  test   %rbp,%rbp
  je     L118
  mov    $0xffffffff,%r12d
L9:
  xor    %eax,%eax
  xor    %esi,%esi
  mov    $0x1,%edi
  mov    $0x1,%ecx
  jmp    L148
  cs nopw 0x0(%rax,%rax,1)
L65:
  add    $0x2,%rax
  cmp    %rax,%rbp
  jbe    L66
L148:
  mov    (%rbx,%rax,4),%edx
  cmp    0x4(%rbx,%rax,4),%edx
  jne    L65
  mov    %edx,0x0(%r13,%rsi,4)
  cmp    %r12d,%edx
  jne    L137
  cmp    $0xffffffff,%r12d
  jne    L222
L137:
  add    $0x2,%rax
  mov    %rcx,%rsi
  add    $0x1,%rcx
  cmp    %rax,%rbp
  ja     L148
L66:
  movslq %edi,%rdi
  shr    %rcx
  cmp    %rcx,%rdi
  ja     L94
  test   %rsi,%rsi
  jne    L149
L94:
  add    $0x8,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L83:
  mov    -0x4(%rbx,%rsi,4),%r12d
  call   <malloc@plt>
  mov    %rax,%r13
  jmp    L9
  nop
L222:
  mov    %rcx,%rsi
  add    $0x1,%edi
  add    $0x1,%rcx
  jmp    L65
  nopl   0x0(%rax)
L131:
  mov    (%rdi),%r12d
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  mov    %r12d,%eax
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax)
L149:
  mov    %r13,%rdi
  call   <find_gt_nd2>
  mov    %r13,%rdi
  mov    %eax,%r12d
  call   <free@plt>
  cmp    $0xffffffff,%r12d
  je     L118
  test   %rbp,%rbp
  mov    $0x1,%ecx
  cmovne %rbp,%rcx
  cmp    $0x3,%rbp
  jbe    L19
  mov    %rcx,%rdx
  movd   %r12d,%xmm3
  mov    %rbx,%rax
  shr    $0x2,%rdx
  pshufd $0x0,%xmm3,%xmm2
  pxor   %xmm0,%xmm0
  shl    $0x4,%rdx
  add    %rbx,%rdx
  nopw   0x0(%rax,%rax,1)
L138:
  movdqu (%rax),%xmm1
  add    $0x10,%rax
  pcmpeqd %xmm2,%xmm1
  psubd  %xmm1,%xmm0
  cmp    %rax,%rdx
  jne    L138
  movdqa %xmm0,%xmm1
  mov    %rcx,%rdx
  psrldq $0x8,%xmm1
  and    $0xfffffffffffffffc,%rdx
  and    $0x3,%ecx
  paddd  %xmm1,%xmm0
  movdqa %xmm0,%xmm1
  psrldq $0x4,%xmm1
  paddd  %xmm1,%xmm0
  movd   %xmm0,%eax
  je     L216
L164:
  lea    0x0(,%rdx,4),%rcx
  cmp    %r12d,(%rbx,%rdx,4)
  jne    L46
  add    $0x1,%eax
L46:
  lea    0x1(%rdx),%rsi
  cmp    %rbp,%rsi
  jae    L216
  cmp    %r12d,0x4(%rbx,%rcx,1)
  jne    L128
  add    $0x1,%eax
L128:
  add    $0x2,%rdx
  cmp    %rdx,%rbp
  jbe    L216
  cmp    0x8(%rbx,%rcx,1),%r12d
  jne    L216
  add    $0x1,%eax
L216:
  cltq
  shr    %rbp
  cmp    %rbp,%rax
  ja     L94
  nopl   0x0(%rax)
L118:
  mov    $0xffffffff,%r12d
  jmp    L94
L19:
  xor    %edx,%edx
  xor    %eax,%eax
  jmp    L164
```

assistant: ```c
int find_gt_nd2(int *sequence, size_t sequence_size) {
  if (sequence_size == 1) {
    return sequence[0];
  }
  int odd_cnt = 1;
  int odd_num = sequence_size % 2 ? sequence[sequence_size - 1] : -1;
  size_t next_sequence_size = 0;
  int *next_sequence = (int *)malloc(sizeof(int) * sequence_size);
  for (size_t i = 0; i < sequence_size; i += 2) {
    if (sequence[i] == sequence[i + 1]) {
      next_sequence[next_sequence_size++] = sequence[i];
      if (odd_num != -1 && odd_num == sequence[i]) {
        ++odd_cnt;
      }
    }
  }
  if (odd_cnt > (next_sequence_size + 1) / 2) {
    return odd_num;
  }
  if (next_sequence_size == 0) {
    if (odd_num != -1) {
      return odd_num;
    }
    return -1;
  }
  int result = find_gt_nd2(next_sequence, next_sequence_size);
  free(next_sequence);
  if (result == -1) {
    return -1;
  }
  int count = 0;
  for (size_t i = 0; i < sequence_size; ++i) {
    if (sequence[i] == result) {
      ++count;
    }
  }
  if (count > sequence_size / 2) {
    return result;
  }
  return -1;
}
```