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

```asm
<has_common_element>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x28(%rbp)
  mov    %esi,-0x2c(%rbp)
  mov    %rdx,-0x38(%rbp)
  mov    %ecx,-0x30(%rbp)
  cmpl   $0x9,-0x30(%rbp)
  jg     L29
  movl   $0x0,-0x10(%rbp)
  movl   $0x0,-0x14(%rbp)
  jmp    L145
L45:
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rcx
  mov    -0x38(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%eax
  cmp    %eax,%edx
  jne    L2
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  jmp    L49
L2:
  addl   $0x1,-0x10(%rbp)
L42:
  mov    -0x10(%rbp),%eax
  cmp    -0x30(%rbp),%eax
  jge    L30
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rcx
  mov    -0x28(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%eax
  cmp    %eax,%edx
  jle    L45
L30:
  addl   $0x1,-0x14(%rbp)
L145:
  mov    -0x14(%rbp),%eax
  cmp    -0x2c(%rbp),%eax
  jl     L42
  mov    $0x0,%eax
  jmp    L49
L29:
  movl   $0x0,-0x4(%rbp)
  movl   $0x0,-0x14(%rbp)
  jmp    L112
L40:
  mov    -0x30(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x8(%rbp)
  mov    -0x4(%rbp),%eax
  mov    %eax,-0xc(%rbp)
  jmp    L125
L28:
  mov    -0xc(%rbp),%edx
  mov    -0x8(%rbp),%eax
  add    %edx,%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  mov    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rcx
  mov    -0x28(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%eax
  cmp    %eax,%edx
  jle    L63
  mov    -0x4(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x8(%rbp)
  jmp    L125
L63:
  mov    -0x4(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rcx
  mov    -0x28(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%eax
  cmp    %eax,%edx
  jge    L76
  mov    -0x4(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0xc(%rbp)
  jmp    L125
L76:
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  jmp    L49
L125:
  mov    -0xc(%rbp),%eax
  cmp    -0x8(%rbp),%eax
  jle    L28
  addl   $0x1,-0x14(%rbp)
L112:
  mov    -0x14(%rbp),%eax
  cmp    -0x2c(%rbp),%eax
  jl     L40
  mov    $0x0,%eax
L49:
  pop    %rbp
  ret
```

assistant: ```c
extern int has_common_element(const int *a, const int a_cnt, const int *b, const int b_cnt) {
  int i;
  if (b_cnt < 10) {
    int j = 0;
    for (i = 0; i < a_cnt; i++)
      for (; j < b_cnt && !(b[j] > a[i]); j++)
        if (a[i] == b[j])
          return a[i];
    return 0;
  } else {
    int low, high;
    int mid = 0;
    for (i = 0; i < a_cnt; i++) {
      high = b_cnt - 1;
      low = mid;
      while (low <= high) {
        mid = (low + high) / 2;
        if (b[mid] > a[i])
          high = mid - 1;
        else if (b[mid] < a[i])
          low = mid + 1;
        else
          return a[i];
      }
    }
    return 0;
  }
}
```