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

```asm
<expint>:
  endbr64
  push   %r15
  mov    %rsi,%r8
  lea    -0x1(%rdi),%r15d
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  cmp    $0x1,%rsi
  jle    L135
  movslq %edi,%rdi
  mov    $0x1c9c380,%r9d
  mov    $0x1c9c380,%ecx
  mov    $0x1e8480,%r10d
  add    %rsi,%rdi
  mov    $0xffffffff,%esi
  jmp    L36
  nopl   (%rax)
L101:
  sub    $0x1,%esi
  cmp    $0xffffff9b,%esi
  je     L109
L36:
  mov    %r15d,%eax
  add    $0x2,%rdi
  sub    %esi,%eax
  imul   %esi,%eax
  cltq
  cqto
  imul   %rax,%rcx
  idiv   %r10
  add    %rdi,%rcx
  lea    (%rcx,%rcx,4),%rcx
  add    %rcx,%rcx
  lea    (%rax,%rdi,1),%r10
  mov    %rcx,%rax
  imul   %r10,%rax
  imul   %rax,%r9
  cmp    $0x270f,%rax
  jg     L101
  neg    %r8
  imul   %r9,%r8
  mov    %r8,%r13
L109:
  add    $0x28,%rsp
  mov    %r13,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L135:
  cmp    $0x1,%r15d
  mov    %rsi,%r14
  lea    -0x2(%rdi),%eax
  mov    $0x1,%esi
  sbb    %r13,%r13
  sub    %edi,%esi
  mov    %eax,0x1c(%rsp)
  neg    %r14
  and    $0x3e6,%r13d
  movdqa D18(%rip),%xmm7
  mov    $0x1,%ebx
  mov    %esi,%ebp
  add    $0x2,%r13
  mov    $0x1,%r12d
  jmp    L84
  nopl   0x0(%rax)
L65:
  mov    %r12,%rax
  lea    0x0(%rbp,%rbx,1),%ecx
  neg    %rax
  movslq %ecx,%rcx
  cqto
  idiv   %rcx
L97:
  add    $0x1,%rbx
  add    %rax,%r13
  cmp    $0x65,%rbx
  je     L109
L84:
  mov    %r14,%rax
  mov    %ebx,%edi
  mov    %ebx,%ecx
  mov    %ebx,%r9d
  cqto
  idiv   %rbx
  imul   %rax,%r12
  cmp    %ebx,%r15d
  jne    L65
  cmpl   $0x3,0x1c(%rsp)
  jbe    L124
  movd   %r15d,%xmm5
  mov    %r15d,%edx
  pxor   %xmm1,%xmm1
  xor    %eax,%eax
  movdqa D6(%rip),%xmm2
  pshufd $0x0,%xmm5,%xmm6
  shr    $0x2,%edx
  pxor   %xmm5,%xmm5
  nopl   0x0(%rax)
L127:
  movdqa %xmm2,%xmm0
  movdqa %xmm5,%xmm3
  paddd  %xmm7,%xmm2
  add    $0x1,%eax
  paddd  %xmm6,%xmm0
  pcmpgtd %xmm0,%xmm3
  movdqa %xmm0,%xmm4
  punpckldq %xmm3,%xmm4
  punpckhdq %xmm3,%xmm0
  paddq  %xmm4,%xmm1
  paddq  %xmm0,%xmm1
  cmp    %eax,%edx
  jne    L127
  movdqa %xmm1,%xmm0
  mov    %edi,%r10d
  psrldq $0x8,%xmm0
  and    $0xfffffffc,%r10d
  paddq  %xmm0,%xmm1
  lea    0x1(%r10),%eax
  movq   %xmm1,%rdx
  add    $0xff,%rdx
  cmp    %edi,%r10d
  je     L38
L119:
  lea    (%rax,%rcx,1),%edi
  movslq %edi,%rdi
  add    %rdi,%rdx
  lea    0x1(%rax),%edi
  cmp    %r9d,%edi
  jg     L38
  add    %ecx,%edi
  movslq %edi,%rdi
  add    %rdi,%rdx
  lea    0x2(%rax),%edi
  cmp    %r9d,%edi
  jg     L38
  add    %ecx,%edi
  add    $0x3,%eax
  movslq %edi,%rdi
  add    %rdi,%rdx
  cmp    %r9d,%eax
  jg     L38
  add    %eax,%ecx
  movslq %ecx,%rcx
  add    %rcx,%rdx
L38:
  mov    %r8,%rdi
  mov    %rdx,0x10(%rsp)
  mov    %r8,0x8(%rsp)
  call   <foo@plt>
  mov    0x10(%rsp),%rdx
  mov    0x8(%rsp),%r8
  imul   %r12,%rax
  movdqa D18(%rip),%xmm7
  add    %rdx,%rax
  jmp    L97
L124:
  mov    $0xff,%edx
  mov    $0x1,%eax
  jmp    L119
```

tool_calls: name: unpack_data
arguments: data_label: D18
datatype: byte[16]
name: unpack_data
arguments: data_label: D6
datatype: byte[16]

tool: {"D18": [0x04,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x04,0x00,0x00,0x00]}

tool: {"D6": [0x01,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x04,0x00,0x00,0x00]}

assistant: ```c
long int expint(int n, long int x) {
  int i, ii, nm1;
  long int a, b, c, d, del, fact, h, psi, ans;
  nm1 = n - 1;
  if (x > 1) {
    b = x + n;
    c = 2e6;
    d = 3e7;
    h = d;
    for (i = 1; i <= 100; i++) {
      a = -i * (nm1 + i);
      b += 2;
      d = 10 * (a * d + b);
      c = b + a / c;
      del = c * d;
      h *= del;
      if (del < 10000) {
        ans = h * -x;
        return ans;
      }
    }
  } else {
    ans = nm1 != 0 ? 2 : 1000;
    fact = 1;
    for (i = 1; i <= 100; i++) {
      fact *= -x / i;
      if (i != nm1)
        del = -fact / (i - nm1);
      else {
        psi = 0x00FF;
        for (ii = 1; ii <= nm1; ii++)
          psi += ii + nm1;
        del = psi + fact * foo(x);
      }
      ans += del;
    }
  }
  return ans;
}
```