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

```asm
<rpio_get_rpi_revision>:
  endbr64
  push   %rbx
  sub    $0x410,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x408(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rdi
  call   <get_cpuinfo_revision@plt>
  test   %eax,%eax
  je     L149
  mov    %rsp,%rdi
  call   <strlen@plt>
  mov    %rsp,%rbx
  cmp    $0x4,%eax
  jle    L76
  cltq
  lea    -0x4(%rsp,%rax,1),%rbx
L76:
  lea    D56(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  mov    %rax,%rdx
  mov    $0x1,%eax
  test   %rdx,%rdx
  jne    L52
L3:
  mov    0x408(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L120
  add    $0x410,%rsp
  pop    %rbx
  ret
L52:
  lea    D67(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  mov    %rax,%rdx
  mov    $0x1,%eax
  test   %rdx,%rdx
  je     L3
  lea    D38(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  mov    %rax,%rdx
  mov    $0x2,%eax
  test   %rdx,%rdx
  je     L3
  lea    D73(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  mov    %rax,%rdx
  mov    $0x2,%eax
  test   %rdx,%rdx
  je     L3
  lea    D80(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  mov    %rax,%rdx
  mov    $0x2,%eax
  test   %rdx,%rdx
  je     L3
  lea    D104(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  mov    %rax,%rdx
  mov    $0x2,%eax
  test   %rdx,%rdx
  je     L3
  lea    D11(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  mov    %rax,%rdx
  mov    $0x2,%eax
  test   %rdx,%rdx
  je     L3
  lea    D54(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  mov    %rax,%rdx
  mov    $0x2,%eax
  test   %rdx,%rdx
  je     L3
  lea    D40(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  mov    %rax,%rdx
  mov    $0x2,%eax
  test   %rdx,%rdx
  je     L3
  lea    D52(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  mov    %rax,%rdx
  mov    $0x2,%eax
  test   %rdx,%rdx
  je     L3
  lea    D47(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  mov    %rax,%rdx
  mov    $0x2,%eax
  test   %rdx,%rdx
  je     L3
  lea    D6(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  neg    %rax
  sbb    %eax,%eax
  and    $0x3,%eax
  jmp    L3
L149:
  mov    $0xffffffff,%eax
  jmp    L3
L120:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: label: D56
type_infered: string
name: disassemble_data
arguments: label: D67
type_infered: string
name: disassemble_data
arguments: label: D38
type_infered: string
name: disassemble_data
arguments: label: D73
type_infered: string
name: disassemble_data
arguments: label: D80
type_infered: string
name: disassemble_data
arguments: label: D104
type_infered: string
name: disassemble_data
arguments: label: D11
type_infered: string
name: disassemble_data
arguments: label: D54
type_infered: string
name: disassemble_data
arguments: label: D40
type_infered: string
name: disassemble_data
arguments: label: D52
type_infered: string
name: disassemble_data
arguments: label: D47
type_infered: string
name: disassemble_data
arguments: label: D6
type_infered: string

tool: D56: 0002

tool: D67: 0003

tool: D38: 0004

tool: D73: 0005

tool: D80: 0006

tool: D104: 0007

tool: D11: 0008

tool: D54: 0009

tool: D40: 000d

tool: D52: 000e

tool: D47: 000f

tool: D6: 0011

assistant: ```c
int rpio_get_rpi_revision(void) {
  char raw_revision[1024];
  int len;
  char *revision;
  if (!get_cpuinfo_revision(raw_revision))
    return -1;
  len = strlen(raw_revision);
  if (len > 4)
    revision = ((char *)raw_revision) + len - 4;
  else
    revision = raw_revision;
  if ((strcmp(revision, "0002") == 0) || (strcmp(revision, "0003") == 0))
    return 1;
  else if ((strcmp(revision, "0004") == 0) || (strcmp(revision, "0005") == 0) || (strcmp(revision, "0006") == 0) || (strcmp(revision, "0007") == 0) || (strcmp(revision, "0008") == 0) || (strcmp(revision, "0009") == 0) || (strcmp(revision, "000d") == 0) || (strcmp(revision, "000e") == 0) || (strcmp(revision, "000f") == 0))
    return 2;
  else if (strcmp(revision, "0011") == 0)
    return 0;
  else
    return 3;
}
```