user: Please show me the C implementation that matches the assembly code listed below:

```asm
<mp_unexp_add>:
  endbr64
  push   %r12
  mov    %rcx,%r10
  lea    -0x1(%rdi),%r11d
  push   %rbp
  push   %rbx
  mov    %r9,%rbx
  test   %edx,%edx
  jne    L81
  mov    (%r8),%eax
  add    (%rcx),%eax
  cmp    %esi,%eax
  jl     L21
  movslq %edi,%rdi
  xor    %r9d,%r9d
  mov    -0x4(%rcx,%rdi,4),%eax
  add    -0x4(%r8,%rdi,4),%eax
  cmp    %eax,%esi
  setle  %r9b
  mov    %r9d,%edx
  neg    %edx
  test   %r11d,%r11d
  jle    L1
  movslq %r11d,%r11
  nopl   (%rax)
L32:
  mov    -0x4(%r8,%r11,4),%eax
  add    -0x4(%r10,%r11,4),%eax
  xor    %r9d,%r9d
  mov    %esi,%ecx
  sub    %edx,%eax
  cmp    %eax,%esi
  setle  %r9b
  mov    %r9d,%edx
  neg    %edx
  and    %edx,%ecx
  sub    %ecx,%eax
  mov    %eax,(%rbx,%r11,4)
  sub    $0x1,%r11
  test   %r11d,%r11d
  jg     L32
L1:
  mov    %r9d,(%rbx)
  mov    %r9d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L21:
  xor    %ebp,%ebp
  test   %edi,%edi
  cmovle %edi,%ebp
  lea    -0x1(%rbp),%r9d
  cmp    %r11d,%ebp
  jg     L34
L35:
  movslq %ebp,%rax
  movslq %r11d,%rcx
  neg    %rax
  lea    (%r8,%rax,4),%r12
  xor    %eax,%eax
  nopl   0x0(%rax,%rax,1)
L14:
  mov    (%r12,%rcx,4),%edx
  add    (%r10,%rcx,4),%edx
  mov    %esi,%r8d
  sub    %eax,%edx
  xor    %eax,%eax
  cmp    %edx,%esi
  setle  %al
  neg    %eax
  and    %eax,%r8d
  sub    %r8d,%edx
  mov    %edx,(%rbx,%rcx,4)
  sub    $0x1,%rcx
  cmp    %ecx,%ebp
  jle    L14
  test   %r9d,%r9d
  js     L93
L94:
  movslq %r9d,%rcx
  nopw   0x0(%rax,%rax,1)
L83:
  mov    (%r10,%rcx,4),%edx
  sub    %eax,%edx
  xor    %eax,%eax
  cmp    %edx,%esi
  setle  %al
  neg    %eax
  mov    %eax,%r8d
  and    %esi,%r8d
  sub    %r8d,%edx
  mov    %edx,(%rbx,%rcx,4)
  sub    $0x1,%rcx
  test   %ecx,%ecx
  jns    L83
L93:
  test   %eax,%eax
  je     L34
  test   %r11d,%r11d
  jle    L57
  lea    -0x2(%rdi),%edx
  movslq %r11d,%r11
  mov    %rdx,%rax
  shl    $0x2,%r11
  lea    0x4(,%rdx,4),%rdx
  neg    %rax
  shl    $0x2,%rax
  lea    -0x4(%r11,%rax,1),%rsi
  add    %r11,%rax
  add    %rbx,%rsi
  lea    (%rbx,%rax,1),%rdi
  call   <memmove@plt>
L57:
  mov    $0x1,%r9d
  movl   $0x1,(%rbx)
  pop    %rbx
  mov    %r9d,%eax
  pop    %rbp
  pop    %r12
  ret
L81:
  cmp    %edi,%edx
  cmovg  %edi,%edx
  mov    %edx,%ebp
  lea    -0x1(%rdx),%r9d
  cmp    %r11d,%edx
  jle    L35
  test   %r9d,%r9d
  js     L34
  xor    %eax,%eax
  jmp    L94
L34:
  xor    %r9d,%r9d
  pop    %rbx
  pop    %rbp
  mov    %r9d,%eax
  pop    %r12
  ret
```

assistant: ```c
int mp_unexp_add(int n, int radix, int expdif, int in1[], int in2[], int out[]) {
  int j, x, carry;
  carry = 0;
  if (expdif == 0 && in1[0] + in2[0] >= radix) {
    x = in1[n - 1] + in2[n - 1];
    carry = x >= radix ? -1 : 0;
    for (j = n - 1; j > 0; j--) {
      x = in1[j - 1] + in2[j - 1] - carry;
      carry = x >= radix ? -1 : 0;
      out[j] = x - (radix & carry);
    }
    out[0] = -carry;
  } else {
    if (expdif > n) {
      expdif = n;
    }
    for (j = n - 1; j >= expdif; j--) {
      x = in1[j] + in2[j - expdif] - carry;
      carry = x >= radix ? -1 : 0;
      out[j] = x - (radix & carry);
    }
    for (j = expdif - 1; j >= 0; j--) {
      x = in1[j] - carry;
      carry = x >= radix ? -1 : 0;
      out[j] = x - (radix & carry);
    }
    if (carry != 0) {
      for (j = n - 1; j > 0; j--) {
        out[j] = out[j - 1];
      }
      out[0] = -carry;
    }
  }
  return -carry;
}
```