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

```asm
<prv_check_time_offset>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  cmpl   $0x3,-0x1c(%rbp)
  je     L117
  cmpl   $0x5,-0x1c(%rbp)
  je     L117
  cmpl   $0x6,-0x1c(%rbp)
  je     L117
  mov    $0x0,%eax
  jmp    L157
L117:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2d,%al
  je     L335
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2b,%al
  je     L335
  mov    $0x0,%eax
  jmp    L157
L335:
  mov    -0x18(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  cmp    $0x30,%eax
  je     L196
  cmp    $0x31,%eax
  je     L88
  jmp    L216
L196:
  mov    -0x18(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  jle    L62
  mov    -0x18(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  cmp    $0x39,%al
  jle    L35
L62:
  mov    $0x0,%eax
  jmp    L157
L88:
  mov    -0x18(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  jle    L223
  mov    -0x18(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  cmp    $0x32,%al
  jle    L6
L223:
  mov    $0x0,%eax
  jmp    L157
L216:
  mov    $0x0,%eax
  jmp    L157
L35:
  nop
  jmp    L126
L6:
  nop
L126:
  cmpl   $0x6,-0x1c(%rbp)
  je     L230
  cmpl   $0x6,-0x1c(%rbp)
  jg     L219
  cmpl   $0x3,-0x1c(%rbp)
  je     L296
  cmpl   $0x5,-0x1c(%rbp)
  je     L22
  jmp    L219
L296:
  mov    $0x1,%eax
  jmp    L157
L22:
  movl   $0x3,-0x4(%rbp)
  jmp    L228
L230:
  mov    -0x18(%rbp),%rax
  add    $0x3,%rax
  movzbl (%rax),%eax
  cmp    $0x3a,%al
  je     L56
  mov    $0x0,%eax
  jmp    L157
L56:
  movl   $0x4,-0x4(%rbp)
  jmp    L228
L219:
  mov    $0x0,%eax
  jmp    L157
L228:
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  jle    L239
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x35,%al
  jle    L14
L239:
  mov    $0x0,%eax
  jmp    L157
L14:
  mov    -0x4(%rbp),%eax
  cltq
  lea    0x1(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  jle    L39
  mov    -0x4(%rbp),%eax
  cltq
  lea    0x1(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x39,%al
  jle    L103
L39:
  mov    $0x0,%eax
  jmp    L157
L103:
  mov    $0x1,%eax
L157:
  pop    %rbp
  ret
```

assistant: ```c
int prv_check_time_offset(char *buffer, int length) {
  int min_index;
  if (length != 3 && length != 5 && length != 6) {
    return 0;
  }
  if (buffer[0] != '-' && buffer[0] != '+') {
    return 0;
  }
  switch (buffer[1]) {
  case '0':
    if (buffer[2] < '0' || buffer[2] > '9') {
      return 0;
    }
    break;
  case '1':
    if (buffer[2] < '0' || buffer[2] > '2') {
      return 0;
    }
    break;
  default:
    return 0;
  }
  switch (length) {
  case 3:
    return 1;
  case 5:
    min_index = 3;
    break;
  case 6:
    if (buffer[3] != ':') {
      return 0;
    }
    min_index = 4;
    break;
  default:
    return 0;
  }
  if (buffer[min_index] < '0' || buffer[min_index] > '5') {
    return 0;
  }
  if (buffer[min_index + 1] < '0' || buffer[min_index + 1] > '9') {
    return 0;
  }
  return 1;
}
```