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

```asm
<WildComp2>:
  endbr64
  push   %r15
  push   %r14
  mov    %rdi,%r14
  push   %r13
  mov    %rsi,%r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  call   <strlen@plt>
  mov    %r13,%rdi
  mov    %rax,%rbp
  mov    %eax,%r12d
  call   <strlen@plt>
  test   %ebp,%ebp
  je     L56
  test   %eax,%eax
  je     L418
  cmp    %eax,%ebp
  cmovl  %eax,%ebp
  test   %ebp,%ebp
  jle    L211
  xor    %r12d,%r12d
  xor    %ebx,%ebx
L448:
  movslq %ebx,%rax
  movsbl (%r14,%rax,1),%edi
  call   <toupper@plt>
  mov    %eax,%r15d
  movslq %r12d,%rax
  movsbl 0x0(%r13,%rax,1),%edi
  call   <toupper@plt>
  cmp    %eax,%r15d
  je     L268
  test   %r15d,%r15d
  je     L189
  test   %eax,%eax
  je     L202
  cmp    $0x2a,%r15d
  je     L156
  cmp    $0x2a,%eax
  je     L360
  cmp    $0x3f,%r15d
  je     L268
  cmp    $0x3f,%eax
  mov    %eax,(%rsp)
  je     L268
  mov    %r15d,%edi
  call   <toupper@plt>
  mov    (%rsp),%edi
  mov    %eax,%r15d
  call   <toupper@plt>
  cmp    %eax,%r15d
  jne    L473
L268:
  add    $0x1,%r12d
L90:
  add    $0x1,%ebx
  cmp    %ebx,%ebp
  jg     L448
  nopl   0x0(%rax)
L453:
  xor    %r12d,%r12d
  cmp    %ebx,%ebp
  sete   %r12b
L115:
  add    $0x18,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L418:
  test   %ebp,%ebp
  je     L56
  xor    %r12d,%r12d
  test   %eax,%eax
  jne    L115
  cmp    $0x1,%ebp
  je     L434
  cmp    $0x2,%ebp
  jne    L115
  cmpb   $0x2e,(%r14)
  jne    L115
  xor    %r12d,%r12d
  cmpb   $0x2a,0x1(%r14)
  sete   %r12b
  jmp    L115
  nopl   0x0(%rax)
L156:
  add    $0x1,%ebx
  mov    %eax,0xc(%rsp)
  movslq %ebx,%rax
  movsbl (%r14,%rax,1),%edi
  test   %dil,%dil
  je     L493
  call   <toupper@plt>
  add    $0x1,%r12d
  movslq %r12d,%r15
  mov    %eax,(%rsp)
  movsbl 0x0(%r13,%r15,1),%edi
  test   %dil,%dil
  je     L453
  cmp    %r12d,%ebp
  mov    0xc(%rsp),%r8d
  jg     L340
  jmp    L452
  nopw   0x0(%rax,%rax,1)
L409:
  add    $0x1,%r15
  cmp    %r15d,%ebp
  jle    L453
  movsbl 0x0(%r13,%r15,1),%edi
L340:
  call   <toupper@plt>
  mov    %r15d,%r12d
  mov    %eax,%r8d
  cmp    %eax,(%rsp)
  je     L268
  test   %eax,%eax
  jne    L409
L452:
  cmp    (%rsp),%r8d
  je     L268
  xor    %r12d,%r12d
  cmp    %ebx,%ebp
  sete   %r12b
  jmp    L115
  nopl   0x0(%rax,%rax,1)
L56:
  cmp    $0x1,%eax
  je     L344
  cmp    $0x2,%eax
  jne    L115
  cmpb   $0x2e,0x0(%r13)
  jne    L115
  xor    %r12d,%r12d
  cmpb   $0x2a,0x1(%r13)
  sete   %r12b
  jmp    L115
  cs nopw 0x0(%rax,%rax,1)
L360:
  lea    0x1(%r12),%eax
  cltq
  movsbl 0x0(%r13,%rax,1),%edi
  test   %dil,%dil
  je     L493
  call   <toupper@plt>
  add    $0x1,%ebx
  movslq %ebx,%rdx
  mov    %eax,0xc(%rsp)
  add    %r14,%rdx
  movsbl (%rdx),%edi
  test   %dil,%dil
  je     L453
  cmp    %ebx,%ebp
  jg     L217
  nopl   0x0(%rax,%rax,1)
L280:
  cmp    0xc(%rsp),%r15d
  jne    L453
  nopl   0x0(%rax,%rax,1)
L260:
  add    $0x2,%r12d
  jmp    L90
  nopl   0x0(%rax)
L4:
  test   %eax,%eax
  je     L280
  mov    (%rsp),%rdx
  add    $0x1,%ebx
  add    $0x1,%rdx
  cmp    %ebx,%ebp
  je     L453
  movsbl (%rdx),%edi
L217:
  mov    %rdx,(%rsp)
  call   <toupper@plt>
  mov    %eax,%r15d
  cmp    %eax,0xc(%rsp)
  jne    L4
  jmp    L260
  xchg   %ax,%ax
L344:
  xor    %r12d,%r12d
  cmpb   $0x2a,0x0(%r13)
  sete   %r12b
  jmp    L115
L211:
  xor    %ebx,%ebx
  jmp    L453
  nopl   0x0(%rax,%rax,1)
L434:
  xor    %r12d,%r12d
  cmpb   $0x2a,(%r14)
  sete   %r12b
  jmp    L115
L189:
  cmp    $0x2a,%eax
  jne    L453
  lea    0x1(%r12),%eax
  mov    $0x1,%r12d
  cltq
  cmpb   $0x0,0x0(%r13,%rax,1)
  je     L115
  jmp    L453
  nopw   0x0(%rax,%rax,1)
L202:
  cmp    $0x2a,%r15d
  jne    L453
  add    $0x1,%ebx
  mov    $0x1,%r12d
  movslq %ebx,%rax
  cmpb   $0x0,(%r14,%rax,1)
  je     L115
  jmp    L453
L473:
  xor    %r12d,%r12d
  jmp    L115
L493:
  mov    $0x1,%r12d
  jmp    L115
```

assistant: ```c
int WildComp2(char *lp1, char *lp2) {
  int flg;
  int i1, i2, j1, j2, ilen;
  int c, d;
  flg = 0;
  i1 = (int)strlen(lp1);
  i2 = (int)strlen(lp2);
  if (i1 && i2) {
    ilen = i1;
    if (i2 > i1)
      ilen = i2;
    j2 = 0;
    for (j1 = 0; j1 < ilen; j1++) {
      c = toupper(lp1[j1]);
      d = toupper(lp2[j2]);
      if (c == d) {
        j2++;
        continue;
      }
      if (c == 0) {
        if (d == '*') {
          j2++;
          if (lp2[j2] == 0) {
            flg = 1;
          }
        }
        break;
      }
      if (d == 0) {
        if (c == '*') {
          j1++;
          if (lp1[j1] == 0) {
            flg = 1;
          }
        }
        break;
      }
      {
        if (c == '*') {
          j1++;
          if (lp1[j1] == 0) {
            flg = 1;
            break;
          }
          c = toupper(lp1[j1]);
          j2++;
          if (lp2[j2] == 0)
            break;
          for (; j2 < ilen; j2++) {
            d = toupper(lp2[j2]);
            if (c == d)
              break;
            if (d == 0)
              break;
          }
          if (c == d) {
            j2++;
            continue;
          }
          break;
        }
        if (d == '*') {
          j2++;
          if (lp2[j2] == 0) {
            flg = 1;
            break;
          }
          d = toupper(lp2[j2]);
          j1++;
          if (lp1[j1] == 0)
            break;
          for (; j1 < ilen; j1++) {
            c = toupper(lp1[j1]);
            if (c == d)
              break;
            if (c == 0)
              break;
          }
          if (c == d) {
            j2++;
            continue;
          }
          break;
        }
        if ((c == '?') || (d == '?')) {
        } else {
          if (toupper(c) != toupper(d))
            break;
        }
      }
      j2++;
    }
    if (!flg && (j1 == ilen))
      flg = 1;
  } else {
    if (i1 == 0) {
      if ((i2 == 1) && (*lp2 == '*')) {
        flg = 1;
      } else if ((i2 == 2) && (lp2[0] == '.') && (lp2[1] == '*')) {
        flg = 1;
      }
    } else if (i2 == 0) {
      if ((i1 == 1) && (*lp1 == '*')) {
        flg = 1;
      } else if ((i1 == 2) && (lp1[0] == '.') && (lp1[1] == '*')) {
        flg = 1;
      }
    }
  }
  return flg;
}
```