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

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movq   $0x0,-0x20(%rbp)
  movq   $0x0,-0x18(%rbp)
  movl   $0x0,-0x10(%rbp)
  movl   $0x0,-0x3c(%rbp)
  movl   $0x0,-0x38(%rbp)
  movl   $0x0,-0x34(%rbp)
  movl   $0x0,-0x30(%rbp)
  movl   $0x0,-0x2c(%rbp)
  movl   $0x0,-0x28(%rbp)
  movl   $0x0,-0x24(%rbp)
  lea    -0x20(%rbp),%rax
  mov    %rax,%rsi
  lea    D39(%rip),%rax
  mov    %rax,%rdi
  call   <scanf@plt>
  movl   $0x0,-0x44(%rbp)
  jmp    L196
L94:
  cmpl   $0x2,-0x30(%rbp)
  jne    L160
  mov    -0x44(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x28(%rbp)
  jmp    L201
L10:
  mov    -0x24(%rbp),%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  add    %eax,%eax
  mov    %eax,%edx
  mov    -0x28(%rbp),%eax
  cltq
  movzbl -0x20(%rbp,%rax,1),%eax
  movsbl %al,%eax
  sub    $0x30,%eax
  add    %edx,%eax
  mov    %eax,-0x24(%rbp)
  addl   $0x1,-0x28(%rbp)
L201:
  mov    -0x28(%rbp),%eax
  cltq
  movzbl -0x20(%rbp,%rax,1),%eax
  cmp    $0x2d,%al
  jne    L10
  addl   $0x1,-0x30(%rbp)
L160:
  mov    -0x44(%rbp),%eax
  cltq
  movzbl -0x20(%rbp,%rax,1),%eax
  cmp    $0x2d,%al
  jne    L119
  addl   $0x1,-0x30(%rbp)
  mov    -0x44(%rbp),%eax
  mov    %eax,-0x40(%rbp)
  jmp    L115
L24:
  mov    -0x40(%rbp),%eax
  add    $0x1,%eax
  cltq
  movzbl -0x20(%rbp,%rax,1),%edx
  mov    -0x40(%rbp),%eax
  cltq
  mov    %dl,-0x20(%rbp,%rax,1)
  addl   $0x1,-0x40(%rbp)
L115:
  lea    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  cmp    %eax,-0x40(%rbp)
  jl     L24
L119:
  addl   $0x1,-0x44(%rbp)
L196:
  lea    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  cmp    %eax,-0x44(%rbp)
  jl     L94
  lea    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  cmp    $0xd,%eax
  je     L87
  movl   $0x1,-0x3c(%rbp)
L87:
  movzbl -0x20(%rbp),%eax
  cmp    $0x39,%al
  je     L289
  movzbl -0x1f(%rbp),%eax
  cmp    $0x37,%al
  je     L289
  movzbl -0x1e(%rbp),%eax
  cmp    $0x38,%al
  je     L289
  movzbl -0x1e(%rbp),%eax
  cmp    $0x39,%al
  je     L289
  movl   $0x1,-0x38(%rbp)
L289:
  movl   $0x0,-0x44(%rbp)
  jmp    L136
L220:
  mov    -0x44(%rbp),%eax
  cltq
  movzbl -0x20(%rbp,%rax,1),%eax
  movsbl %al,%eax
  sub    $0x30,%eax
  add    %eax,-0x2c(%rbp)
  addl   $0x2,-0x44(%rbp)
L136:
  lea    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  sub    $0x1,%eax
  cmp    %eax,-0x44(%rbp)
  jl     L220
  movl   $0x1,-0x44(%rbp)
  jmp    L151
L85:
  mov    -0x44(%rbp),%eax
  cltq
  movzbl -0x20(%rbp,%rax,1),%eax
  movsbl %al,%eax
  lea    -0x30(%rax),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  add    %eax,-0x2c(%rbp)
  addl   $0x2,-0x44(%rbp)
L151:
  lea    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  sub    $0x1,%eax
  cmp    %eax,-0x44(%rbp)
  jl     L85
  mov    -0x2c(%rbp),%edx
  movslq %edx,%rax
  imul   $0x66666667,%rax,%rax
  shr    $0x20,%rax
  sar    $0x2,%eax
  mov    %edx,%esi
  sar    $0x1f,%esi
  sub    %esi,%eax
  mov    %eax,%ecx
  mov    %ecx,%eax
  shl    $0x2,%eax
  add    %ecx,%eax
  add    %eax,%eax
  mov    %edx,%ecx
  sub    %eax,%ecx
  mov    $0xa,%eax
  sub    %ecx,%eax
  mov    %eax,%edx
  movzbl -0x14(%rbp),%eax
  movsbl %al,%eax
  sub    $0x30,%eax
  cmp    %eax,%edx
  je     L316
  movl   $0x1,-0x34(%rbp)
L316:
  cmpl   $0x1,-0x3c(%rbp)
  je     L287
  cmpl   $0x1,-0x38(%rbp)
  je     L287
  cmpl   $0x1,-0x34(%rbp)
  jne    L321
L287:
  lea    D0(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  jmp    L319
L321:
  lea    D23(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  cmpl   $0xe3de2,-0x24(%rbp)
  je     L290
  cmpl   $0xe3de2,-0x24(%rbp)
  jg     L319
  cmpl   $0xd91f,-0x24(%rbp)
  je     L185
  cmpl   $0xd91f,-0x24(%rbp)
  jg     L319
  cmpl   $0x1,-0x24(%rbp)
  je     L226
  cmpl   $0x1072,-0x24(%rbp)
  je     L270
  jmp    L319
L290:
  lea    D41(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  jmp    L319
L185:
  lea    D25(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  jmp    L319
L270:
  lea    D42(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  jmp    L319
L226:
  lea    D27(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  nop
L319:
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L101
  call   <__stack_chk_fail@plt>
L101:
  leave
  ret
```

tool_calls: name: read_data
arguments: label: D39
datatype: string
name: read_data
arguments: label: D0
datatype: string
name: read_data
arguments: label: D23
datatype: string
name: read_data
arguments: label: D41
datatype: string
name: read_data
arguments: label: D25
datatype: string
name: read_data
arguments: label: D42
datatype: string
name: read_data
arguments: label: D27
datatype: string

tool: D39: %20[^
]

tool: D0: 0

tool: D23: 1

tool: D41: 
Bluebridge

tool: D25: 
Alyson Books

tool: D42: 
FUNimation Productions, Ltd.

tool: D27: 
Pyramid Books

assistant: ```c
int main() {
  char isbn[20] = {0};
  int i, j, a = 0, b = 0, c = 0, d = 0, sum = 0, s = 0, k = 0;
  scanf("%20[^\n]", isbn);
  for (i = 0; i < strlen(isbn); i++) {
    if (d == 2) {
      for (s = i - 1; isbn[s] != '-'; s++)
        k = k * 10 + (isbn[s] - 48);
      d++;
    }
    if (isbn[i] == '-') {
      d++;
      for (j = i; j < strlen(isbn); j++)
        isbn[j] = isbn[j + 1];
    }
  }
  if (strlen(isbn) != 13)
    a = 1;
  if (isbn[0] != '9' && isbn[1] != '7' && isbn[2] != '8' && isbn[2] != '9')
    b = 1;
  for (i = 0; i < strlen(isbn) - 1; i += 2)
    sum += isbn[i] - 48;
  for (i = 1; i < strlen(isbn) - 1; i += 2)
    sum = sum + 3 * (isbn[i] - 48);
  if ((10 - sum % 10) != isbn[12] - 48)
    c = 1;
  if (a == 1 || b == 1 || c == 1)
    printf("0");
  else {
    printf("1");
    switch (k) {
    case 933346:
      printf("\nBluebridge");
      break;
    case 55583:
      printf("\nAlyson Books");
      break;
    case 4210:
      printf("\nFUNimation Productions, Ltd.");
      break;
    case 01:
      printf("\nPyramid Books");
      break;
    }
  }
  return 0;
}
```