user: Converte this assembly snippet into its equivalent C code:

```asm
<poly_add>:
  endbr64
  lea    (%rsi,%rsi,1),%r10d
  push   %r15
  mov    %rdx,%r9
  lea    (%rcx,%rcx,1),%esi
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  test   %r10d,%r10d
  jle    L96
  test   %esi,%esi
  jle    L62
  mov    $0x2,%ebp
  xor    %edx,%edx
  xor    %ecx,%ecx
  jmp    L125
  nopl   0x0(%rax)
L42:
  jle    L109
  mov    -0x4(%rdi,%rbx,1),%r11d
  add    $0x2,%ecx
  mov    %r11d,-0x8(%r8,%rbp,4)
  mov    (%r12),%r11d
L16:
  mov    %r11d,-0x4(%r8,%rbp,4)
  cmp    %r10d,%ecx
  jge    L92
L46:
  add    $0x2,%rbp
  cmp    %esi,%edx
  jge    L156
L125:
  lea    0x1(%rcx),%ebx
  lea    0x1(%rdx),%r11d
  mov    %ebp,%eax
  movslq %ebx,%rbx
  movslq %r11d,%r11
  shl    $0x2,%rbx
  shl    $0x2,%r11
  lea    (%r9,%r11,1),%r13
  lea    (%rdi,%rbx,1),%r12
  mov    0x0(%r13),%r15d
  cmp    %r15d,(%r12)
  jne    L42
  mov    -0x4(%r9,%r11,1),%r11d
  add    -0x4(%rdi,%rbx,1),%r11d
  add    $0x2,%ecx
  add    $0x2,%edx
  mov    %r11d,-0x8(%r8,%rbp,4)
  mov    (%r12),%r11d
  mov    %r11d,-0x4(%r8,%rbp,4)
  cmp    %r10d,%ecx
  jl     L46
  nopl   0x0(%rax)
L92:
  cmp    %esi,%edx
  jge    L200
  movslq %eax,%rbx
  movslq %edx,%rbp
  lea    0x0(,%rbx,4),%rcx
  lea    (%r9,%rbp,4),%r10
  lea    (%r8,%rcx,1),%rdi
  lea    0x10(%r8,%rcx,1),%rcx
  lea    0x10(,%rbp,4),%r11
  cmp    %rcx,%r10
  jae    L201
  add    %r9,%r11
  cmp    %r11,%rdi
  jb     L208
L201:
  sub    $0x1,%esi
  mov    %esi,%ecx
  sub    %edx,%ecx
  mov    %ecx,%r12d
  shr    %r12d
  add    $0x1,%r12d
  cmp    $0x1,%ecx
  jbe    L124
  mov    %r12d,%r11d
  xor    %ecx,%ecx
  shr    %r11d
  shl    $0x4,%r11
  nopw   0x0(%rax,%rax,1)
L154:
  movdqu (%r10,%rcx,1),%xmm0
  movups %xmm0,(%rdi,%rcx,1)
  add    $0x10,%rcx
  cmp    %rcx,%r11
  jne    L154
  mov    %r12d,%ecx
  and    $0xfffffffe,%ecx
  and    $0x1,%r12d
  je     L58
L163:
  add    %rcx,%rcx
  add    %rcx,%rbp
  add    %rbx,%rcx
  mov    (%r9,%rbp,4),%rdi
  mov    %rdi,(%r8,%rcx,4)
L58:
  sub    %edx,%esi
  and    $0xfffffffe,%esi
  lea    0x2(%rax,%rsi,1),%eax
L200:
  pop    %rbx
  sar    %eax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  cs nopw 0x0(%rax,%rax,1)
L109:
  mov    -0x4(%r9,%r11,1),%r11d
  add    $0x2,%edx
  mov    %r11d,-0x8(%r8,%rbp,4)
  mov    0x0(%r13),%r11d
  jmp    L16
L62:
  xor    %eax,%eax
  xor    %edx,%edx
  xor    %ecx,%ecx
  nopl   0x0(%rax)
L156:
  movslq %eax,%rbx
  movslq %ecx,%rbp
  lea    0x0(,%rbx,4),%r11
  mov    %rbx,-0x10(%rsp)
  lea    (%rdi,%rbp,4),%r14
  lea    (%r8,%r11,1),%rbx
  lea    0x10(%r8,%r11,1),%r11
  lea    0x10(,%rbp,4),%r12
  cmp    %r11,%r14
  jae    L186
  add    %rdi,%r12
  cmp    %r12,%rbx
  jb     L102
L186:
  lea    -0x1(%r10),%r13d
  mov    $0x1,%r12d
  mov    %r13d,%r11d
  sub    %ecx,%r11d
  mov    %r11d,%r15d
  shr    %r15d
  add    $0x1,%r15d
  cmp    %ecx,%r10d
  cmovle %r12d,%r15d
  jle    L17
  cmp    $0x1,%r11d
  jbe    L17
  mov    %r15d,%r12d
  xor    %r11d,%r11d
  shr    %r12d
  shl    $0x4,%r12
  nopw   0x0(%rax,%rax,1)
L68:
  movdqu (%r14,%r11,1),%xmm1
  movups %xmm1,(%rbx,%r11,1)
  add    $0x10,%r11
  cmp    %r11,%r12
  jne    L68
  mov    %r15d,%r11d
  and    $0xfffffffe,%r11d
  and    $0x1,%r15d
  je     L126
L140:
  add    %r11,%r11
  add    %r11,%rbp
  add    -0x10(%rsp),%r11
  mov    (%rdi,%rbp,4),%rdi
  mov    %rdi,(%r8,%r11,4)
L126:
  sub    %ecx,%r13d
  and    $0xfffffffe,%r13d
  cmp    %ecx,%r10d
  mov    $0x0,%ecx
  cmovle %ecx,%r13d
  lea    0x2(%rax,%r13,1),%eax
  jmp    L92
  nopl   0x0(%rax)
L102:
  mov    (%rdi,%rbp,4),%r11d
  add    $0x8,%rbx
  mov    %r11d,-0x8(%rbx)
  mov    0x4(%rdi,%rbp,4),%r11d
  add    $0x2,%rbp
  mov    %r11d,-0x4(%rbx)
  cmp    %ebp,%r10d
  jg     L102
  lea    -0x1(%r10),%r13d
  jmp    L126
  nopl   0x0(%rax)
L208:
  sub    $0x1,%esi
  mov    %rdi,%rcx
  mov    %r10,%r9
  mov    %rsi,%rdi
  sub    %rdx,%rdi
  and    $0xfffffffe,%edi
  add    %rbx,%rdi
  lea    0x8(%r8,%rdi,4),%r8
  nopw   0x0(%rax,%rax,1)
L83:
  mov    (%r9),%edi
  add    $0x8,%rcx
  add    $0x8,%r9
  mov    %edi,-0x8(%rcx)
  mov    -0x4(%r9),%edi
  mov    %edi,-0x4(%rcx)
  cmp    %rcx,%r8
  jne    L83
  jmp    L58
L124:
  xor    %ecx,%ecx
  jmp    L163
L96:
  xor    %eax,%eax
  xor    %edx,%edx
  jmp    L92
L17:
  xor    %r11d,%r11d
  jmp    L140
```

assistant: ```c
int poly_add(int *a, int n1, int *b, int n2, int *c) {
  int i = 0, j = 0, k = 0;
  while (i < n1 * 2 && j < n2 * 2) {
    if (a[i + 1] == b[j + 1]) {
      c[k] = a[i] + b[j];
      c[k + 1] = a[i + 1];
      k += 2;
      i += 2;
      j += 2;
    } else if (a[i + 1] > b[j + 1]) {
      c[k] = a[i];
      c[k + 1] = a[i + 1];
      k += 2;
      i += 2;
    } else {
      c[k] = b[j];
      c[k + 1] = b[j + 1];
      k += 2;
      j += 2;
    }
  }
  while (i < n1 * 2) {
    c[k] = a[i];
    c[k + 1] = a[i + 1];
    k += 2;
    i += 2;
  }
  while (j < n2 * 2) {
    c[k] = b[j];
    c[k + 1] = b[j + 1];
    k += 2;
    j += 2;
  }
  return k / 2;
}
```