user: Translate the below assembly code into C programming language:

```asm
<refine>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0xa8,%rsp
  mov    %rdi,-0x98(%rbp)
  mov    %rsi,-0xa0(%rbp)
  mov    %edx,-0xa4(%rbp)
  mov    %ecx,-0xa8(%rbp)
  mov    %r8d,-0xac(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x18(%rbp)
  xor    %eax,%eax
  movl   $0x1,-0x88(%rbp)
  mov    -0xa4(%rbp),%eax
  mov    %eax,-0x7c(%rbp)
  mov    -0xa8(%rbp),%eax
  mov    %eax,-0x78(%rbp)
  mov    -0xac(%rbp),%eax
  mov    %eax,-0x74(%rbp)
  mov    -0xa8(%rbp),%eax
  mov    %eax,-0x6c(%rbp)
  mov    -0xac(%rbp),%eax
  mov    %eax,-0x68(%rbp)
  mov    -0xa4(%rbp),%eax
  mov    %eax,-0x64(%rbp)
  mov    -0xac(%rbp),%eax
  mov    %eax,-0x5c(%rbp)
  mov    -0xa4(%rbp),%eax
  mov    %eax,-0x58(%rbp)
  mov    -0xa8(%rbp),%eax
  mov    %eax,-0x54(%rbp)
  mov    -0xa4(%rbp),%eax
  mov    %eax,-0x4c(%rbp)
  mov    -0xac(%rbp),%eax
  mov    %eax,-0x48(%rbp)
  mov    -0xa8(%rbp),%eax
  mov    %eax,-0x44(%rbp)
  mov    -0xac(%rbp),%eax
  mov    %eax,-0x3c(%rbp)
  mov    -0xa8(%rbp),%eax
  mov    %eax,-0x38(%rbp)
  mov    -0xa4(%rbp),%eax
  mov    %eax,-0x34(%rbp)
  mov    -0xa8(%rbp),%eax
  mov    %eax,-0x2c(%rbp)
  mov    -0xa4(%rbp),%eax
  mov    %eax,-0x28(%rbp)
  mov    -0xac(%rbp),%eax
  mov    %eax,-0x24(%rbp)
  mov    -0xa0(%rbp),%rax
  mov    (%rax),%eax
  mov    %eax,-0x84(%rbp)
  mov    -0xa4(%rbp),%eax
  cmp    -0xa8(%rbp),%eax
  je     L38
  mov    -0xa8(%rbp),%eax
  cmp    -0xac(%rbp),%eax
  je     L38
  mov    -0xa4(%rbp),%eax
  cmp    -0xac(%rbp),%eax
  je     L38
  mov    $0x0,%ebx
  jmp    L109
L12:
  movslq %ebx,%rax
  shl    $0x4,%rax
  mov    %rax,%rdx
  mov    -0x98(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  lea    -0x80(%rbp),%rax
  mov    $0x3,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <equal@plt>
  test   %rax,%rax
  jne    L130
  movslq %ebx,%rax
  shl    $0x4,%rax
  mov    %rax,%rdx
  mov    -0x98(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  lea    -0x70(%rbp),%rax
  mov    $0x3,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <equal@plt>
  test   %rax,%rax
  jne    L130
  movslq %ebx,%rax
  shl    $0x4,%rax
  mov    %rax,%rdx
  mov    -0x98(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  lea    -0x60(%rbp),%rax
  mov    $0x3,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <equal@plt>
  test   %rax,%rax
  jne    L130
  movslq %ebx,%rax
  shl    $0x4,%rax
  mov    %rax,%rdx
  mov    -0x98(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  lea    -0x50(%rbp),%rax
  mov    $0x3,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <equal@plt>
  test   %rax,%rax
  jne    L130
  movslq %ebx,%rax
  shl    $0x4,%rax
  mov    %rax,%rdx
  mov    -0x98(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  lea    -0x40(%rbp),%rax
  mov    $0x3,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <equal@plt>
  test   %rax,%rax
  jne    L130
  movslq %ebx,%rax
  shl    $0x4,%rax
  mov    %rax,%rdx
  mov    -0x98(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  lea    -0x30(%rbp),%rax
  mov    $0x3,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <equal@plt>
  test   %rax,%rax
  jne    L130
  add    $0x1,%ebx
L109:
  cmp    -0x84(%rbp),%ebx
  jl     L12
  cmpl   $0x1,-0x88(%rbp)
  jne    L102
  mov    -0xa0(%rbp),%rax
  mov    (%rax),%eax
  cltq
  shl    $0x4,%rax
  mov    %rax,%rdx
  mov    -0x98(%rbp),%rax
  add    %rax,%rdx
  mov    -0xa4(%rbp),%eax
  mov    %eax,0x4(%rdx)
  mov    -0xa0(%rbp),%rax
  mov    (%rax),%eax
  cltq
  shl    $0x4,%rax
  mov    %rax,%rdx
  mov    -0x98(%rbp),%rax
  add    %rax,%rdx
  mov    -0xa8(%rbp),%eax
  mov    %eax,0x8(%rdx)
  mov    -0xa0(%rbp),%rax
  mov    (%rax),%eax
  cltq
  shl    $0x4,%rax
  mov    %rax,%rdx
  mov    -0x98(%rbp),%rax
  add    %rax,%rdx
  mov    -0xac(%rbp),%eax
  mov    %eax,0xc(%rdx)
  mov    -0xa0(%rbp),%rax
  mov    (%rax),%eax
  lea    0x1(%rax),%edx
  mov    -0xa0(%rbp),%rax
  mov    %edx,(%rax)
  jmp    L102
L38:
  nop
  jmp    L102
L130:
  nop
L102:
  mov    -0x18(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L35
  call   <__stack_chk_fail@plt>
L35:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

assistant: ```c
void refine(int triples[20000][4], int *len, int first, int second, int third) {
  register int i;
  int t1[4], t2[4], t3[4], t4[4], t5[4], t6[4];
  int check_len;
  int write = 1;
  t1[1] = first;
  t1[2] = second;
  t1[3] = third;
  t2[1] = second;
  t2[2] = third;
  t2[3] = first;
  t3[1] = third;
  t3[2] = first;
  t3[3] = second;
  t4[1] = first;
  t4[2] = third;
  t4[3] = second;
  t5[1] = third;
  t5[2] = second;
  t5[3] = first;
  t6[1] = second;
  t6[2] = first;
  t6[3] = third;
  check_len = *len;
  if ((first == second) || (second == third) || (first == third))
    return;
  for (i = 0; i < check_len; i++) {
    if ((equal(t1, triples[i], 3)) || (equal(t2, triples[i], 3)) || (equal(t3, triples[i], 3)) || (equal(t4, triples[i], 3)) || (equal(t5, triples[i], 3)) || (equal(t6, triples[i], 3)))
      return;
  }
  if (write == 1) {
    triples[(*len)][1] = first;
    triples[(*len)][2] = second;
    triples[(*len)][3] = third;
    (*len) = (*len) + 1;
  }
}
```