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

```asm
<version_cmp>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  movl   $0x0,-0x14(%rbp)
  mov    -0x28(%rbp),%rax
  mov    $0x3a,%esi
  mov    %rax,%rdi
  call   <strchr@plt>
  mov    %rax,-0x10(%rbp)
  mov    -0x30(%rbp),%rax
  mov    $0x3a,%esi
  mov    %rax,%rdi
  call   <strchr@plt>
  mov    %rax,-0x8(%rbp)
  cmpq   $0x0,-0x10(%rbp)
  je     L69
  cmpq   $0x0,-0x8(%rbp)
  je     L69
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  mov    %al,-0x20(%rbp)
  mov    -0x10(%rbp),%rax
  movb   $0x0,(%rax)
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  mov    %al,-0x1f(%rbp)
  mov    -0x8(%rbp),%rax
  movb   $0x0,(%rax)
  mov    -0x30(%rbp),%rdx
  mov    -0x28(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <version_subcmp@plt>
  mov    %eax,-0x14(%rbp)
  mov    -0x8(%rbp),%rax
  movzbl -0x1f(%rbp),%edx
  mov    %dl,(%rax)
  mov    -0x10(%rbp),%rax
  movzbl -0x20(%rbp),%edx
  mov    %dl,(%rax)
  jmp    L245
L69:
  cmpq   $0x0,-0x10(%rbp)
  je     L246
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  mov    %al,-0x1d(%rbp)
  mov    -0x10(%rbp),%rax
  movb   $0x0,(%rax)
  mov    -0x28(%rbp),%rax
  lea    D25(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <version_subcmp@plt>
  mov    %eax,-0x14(%rbp)
  mov    -0x10(%rbp),%rax
  movzbl -0x1d(%rbp),%edx
  mov    %dl,(%rax)
  jmp    L245
L246:
  cmpq   $0x0,-0x8(%rbp)
  je     L245
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  mov    %al,-0x1e(%rbp)
  mov    -0x8(%rbp),%rax
  movb   $0x0,(%rax)
  mov    -0x30(%rbp),%rax
  mov    %rax,%rsi
  lea    D25(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <version_subcmp@plt>
  mov    %eax,-0x14(%rbp)
  mov    -0x8(%rbp),%rax
  movzbl -0x1e(%rbp),%edx
  mov    %dl,(%rax)
L245:
  cmpq   $0x0,-0x10(%rbp)
  je     L317
  mov    -0x10(%rbp),%rax
  add    $0x1,%rax
  jmp    L334
L317:
  mov    -0x28(%rbp),%rax
L334:
  mov    %rax,-0x28(%rbp)
  cmpq   $0x0,-0x8(%rbp)
  je     L376
  mov    -0x8(%rbp),%rax
  add    $0x1,%rax
  jmp    L395
L376:
  mov    -0x30(%rbp),%rax
L395:
  mov    %rax,-0x30(%rbp)
  cmpl   $0x0,-0x14(%rbp)
  je     L276
  mov    -0x14(%rbp),%eax
  jmp    L120
L219:
  cmpq   $0x0,-0x10(%rbp)
  je     L269
  cmpq   $0x0,-0x8(%rbp)
  je     L269
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  mov    %al,-0x18(%rbp)
  mov    -0x10(%rbp),%rax
  movb   $0x0,(%rax)
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  mov    %al,-0x17(%rbp)
  mov    -0x8(%rbp),%rax
  movb   $0x0,(%rax)
  mov    -0x30(%rbp),%rdx
  mov    -0x28(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <version_subcmp@plt>
  mov    %eax,-0x14(%rbp)
  mov    -0x8(%rbp),%rax
  movzbl -0x17(%rbp),%edx
  mov    %dl,(%rax)
  mov    -0x10(%rbp),%rax
  movzbl -0x18(%rbp),%edx
  mov    %dl,(%rax)
  jmp    L210
L269:
  cmpq   $0x0,-0x10(%rbp)
  je     L308
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  mov    %al,-0x15(%rbp)
  mov    -0x10(%rbp),%rax
  movb   $0x0,(%rax)
  mov    -0x28(%rbp),%rax
  lea    D25(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <version_subcmp@plt>
  mov    %eax,-0x14(%rbp)
  mov    -0x10(%rbp),%rax
  movzbl -0x15(%rbp),%edx
  mov    %dl,(%rax)
  jmp    L210
L308:
  cmpq   $0x0,-0x8(%rbp)
  je     L210
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  mov    %al,-0x16(%rbp)
  mov    -0x8(%rbp),%rax
  movb   $0x0,(%rax)
  mov    -0x30(%rbp),%rax
  mov    %rax,%rsi
  lea    D25(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <version_subcmp@plt>
  mov    %eax,-0x14(%rbp)
  mov    -0x8(%rbp),%rax
  movzbl -0x16(%rbp),%edx
  mov    %dl,(%rax)
L210:
  cmpq   $0x0,-0x10(%rbp)
  je     L355
  mov    -0x10(%rbp),%rax
  add    $0x1,%rax
  jmp    L182
L355:
  mov    -0x28(%rbp),%rax
L182:
  mov    %rax,-0x28(%rbp)
  cmpq   $0x0,-0x8(%rbp)
  je     L361
  mov    -0x8(%rbp),%rax
  add    $0x1,%rax
  jmp    L389
L361:
  mov    -0x30(%rbp),%rax
L389:
  mov    %rax,-0x30(%rbp)
  cmpl   $0x0,-0x14(%rbp)
  je     L276
  mov    -0x14(%rbp),%eax
  jmp    L120
L276:
  mov    -0x28(%rbp),%rax
  mov    $0x2e,%esi
  mov    %rax,%rdi
  call   <strchr@plt>
  mov    %rax,-0x10(%rbp)
  mov    -0x30(%rbp),%rax
  mov    $0x2e,%esi
  mov    %rax,%rdi
  call   <strchr@plt>
  mov    %rax,-0x8(%rbp)
  cmpq   $0x0,-0x10(%rbp)
  jne    L1
  cmpq   $0x0,-0x8(%rbp)
  je     L135
L1:
  mov    $0x1,%eax
  jmp    L379
L135:
  mov    $0x0,%eax
L379:
  test   %eax,%eax
  jne    L219
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %rax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x10(%rbp)
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %rax,%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x8(%rbp)
  cmpq   $0x0,-0x10(%rbp)
  je     L109
  cmpq   $0x0,-0x8(%rbp)
  je     L109
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  mov    %al,-0x1c(%rbp)
  mov    -0x10(%rbp),%rax
  movb   $0x0,(%rax)
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  mov    %al,-0x1b(%rbp)
  mov    -0x8(%rbp),%rax
  movb   $0x0,(%rax)
  mov    -0x30(%rbp),%rdx
  mov    -0x28(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <version_subcmp@plt>
  mov    %eax,-0x14(%rbp)
  mov    -0x8(%rbp),%rax
  movzbl -0x1b(%rbp),%edx
  mov    %dl,(%rax)
  mov    -0x10(%rbp),%rax
  movzbl -0x1c(%rbp),%edx
  mov    %dl,(%rax)
  jmp    L44
L109:
  cmpq   $0x0,-0x10(%rbp)
  je     L286
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  mov    %al,-0x19(%rbp)
  mov    -0x10(%rbp),%rax
  movb   $0x0,(%rax)
  mov    -0x28(%rbp),%rax
  lea    D25(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <version_subcmp@plt>
  mov    %eax,-0x14(%rbp)
  mov    -0x10(%rbp),%rax
  movzbl -0x19(%rbp),%edx
  mov    %dl,(%rax)
  jmp    L44
L286:
  cmpq   $0x0,-0x8(%rbp)
  je     L44
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  mov    %al,-0x1a(%rbp)
  mov    -0x8(%rbp),%rax
  movb   $0x0,(%rax)
  mov    -0x30(%rbp),%rax
  mov    %rax,%rsi
  lea    D25(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <version_subcmp@plt>
  mov    %eax,-0x14(%rbp)
  mov    -0x8(%rbp),%rax
  movzbl -0x1a(%rbp),%edx
  mov    %dl,(%rax)
L44:
  cmpq   $0x0,-0x10(%rbp)
  je     L160
  mov    -0x10(%rbp),%rax
  add    $0x1,%rax
  jmp    L278
L160:
  mov    -0x28(%rbp),%rax
L278:
  mov    %rax,-0x28(%rbp)
  cmpq   $0x0,-0x8(%rbp)
  je     L228
  mov    -0x8(%rbp),%rax
  add    $0x1,%rax
  jmp    L299
L228:
  mov    -0x30(%rbp),%rax
L299:
  mov    %rax,-0x30(%rbp)
  cmpl   $0x0,-0x14(%rbp)
  je     L171
  mov    -0x14(%rbp),%eax
  jmp    L120
L171:
  mov    $0x0,%eax
L120:
  leave
  ret
```

assistant: ```c
int version_cmp(char *a, char *b) {
  char *ap;
  char *bp;
  int r = 0;
  static char nil[1] = {'\0'};
  ap = strchr(a, (':')), bp = strchr(b, (':'));
  if (ap && bp) {
    do {
      char ap__c = *(ap);
      *(ap) = '\0';
      do {
        char bp__c = *(bp);
        *(bp) = '\0';
        r = version_subcmp(a, b);
        *(bp) = bp__c;
      } while (0);
      *(ap) = ap__c;
    } while (0);
  } else if (ap) {
    do {
      char ap__c = *(ap);
      *(ap) = '\0';
      r = version_subcmp(a, nil);
      *(ap) = ap__c;
    } while (0);
  } else if (bp) {
    do {
      char bp__c = *(bp);
      *(bp) = '\0';
      r = version_subcmp(nil, b);
      *(bp) = bp__c;
    } while (0);
  }
  a = ap ? (ap + 1) : a;
  b = bp ? (bp + 1) : b;
  if (r)
    return r;
  while (ap = strchr(a, ('.')), bp = strchr(b, ('.')), (ap || bp)) {
    if (ap && bp) {
      do {
        char ap__c = *(ap);
        *(ap) = '\0';
        do {
          char bp__c = *(bp);
          *(bp) = '\0';
          r = version_subcmp(a, b);
          *(bp) = bp__c;
        } while (0);
        *(ap) = ap__c;
      } while (0);
    } else if (ap) {
      do {
        char ap__c = *(ap);
        *(ap) = '\0';
        r = version_subcmp(a, nil);
        *(ap) = ap__c;
      } while (0);
    } else if (bp) {
      do {
        char bp__c = *(bp);
        *(bp) = '\0';
        r = version_subcmp(nil, b);
        *(bp) = bp__c;
      } while (0);
    }
    a = ap ? (ap + 1) : a;
    b = bp ? (bp + 1) : b;
    if (r)
      return r;
  }
  ap = strchr(a, ('\0')), bp = strchr(b, ('\0'));
  if (ap && bp) {
    do {
      char ap__c = *(ap);
      *(ap) = '\0';
      do {
        char bp__c = *(bp);
        *(bp) = '\0';
        r = version_subcmp(a, b);
        *(bp) = bp__c;
      } while (0);
      *(ap) = ap__c;
    } while (0);
  } else if (ap) {
    do {
      char ap__c = *(ap);
      *(ap) = '\0';
      r = version_subcmp(a, nil);
      *(ap) = ap__c;
    } while (0);
  } else if (bp) {
    do {
      char bp__c = *(bp);
      *(bp) = '\0';
      r = version_subcmp(nil, b);
      *(bp) = bp__c;
    } while (0);
  }
  a = ap ? (ap + 1) : a;
  b = bp ? (bp + 1) : b;
  if (r)
    return r;
  return 0;
}
```