user: 请将以下的汇编代码转换成C语言代码:

```asm
<main>:
  endbr64
  push   %r12
  lea    D16(%rip),%rdi
  xor    %r12d,%r12d
  push   %rbp
  push   %rbx
  sub    $0x20,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rbx
  mov    %rbx,%rsi
  call   <scanf@plt>
  cmpb   $0x39,(%rsp)
  je     L315
L150:
  movzbl 0x6(%rsp),%eax
  cmp    $0x39,%al
  je     L292
  cmp    $0x35,%al
  jne    L96
  xor    %ebp,%ebp
  cmpb   $0x35,0x7(%rsp)
  je     L334
  nopl   (%rax)
L275:
  mov    %rbx,%rdi
  call   <strlen@plt>
  mov    %eax,%edx
  lea    -0x1(%rax),%edi
  test   %eax,%eax
  jle    L143
  cmp    $0xe,%edi
  jbe    L438
  movdqa D82(%rip),%xmm0
  paddb  (%rsp),%xmm0
  and    $0xfffffff0,%eax
  mov    %eax,%ecx
  movaps %xmm0,(%rsp)
  cmp    %eax,%edx
  je     L405
L244:
  mov    %edx,%esi
  sub    %eax,%esi
  lea    -0x1(%rsi),%r8d
  cmp    $0x6,%r8d
  jbe    L83
  movq   D82(%rip),%xmm1
  add    %rbx,%rax
  movq   (%rax),%xmm0
  paddb  %xmm1,%xmm0
  movq   %xmm0,(%rax)
  mov    %esi,%eax
  and    $0xfffffff8,%eax
  add    %eax,%ecx
  cmp    %eax,%esi
  je     L143
L83:
  movslq %ecx,%rax
  subb   $0x30,(%rsp,%rax,1)
  lea    0x1(%rcx),%eax
  cmp    %eax,%edx
  jle    L143
  cltq
  subb   $0x30,(%rsp,%rax,1)
  lea    0x2(%rcx),%eax
  cmp    %eax,%edx
  jle    L143
  cltq
  subb   $0x30,(%rsp,%rax,1)
  lea    0x3(%rcx),%eax
  cmp    %edx,%eax
  jge    L143
  cltq
  subb   $0x30,(%rsp,%rax,1)
  lea    0x4(%rcx),%eax
  cmp    %eax,%edx
  jle    L143
  cltq
  subb   $0x30,(%rsp,%rax,1)
  lea    0x5(%rcx),%eax
  cmp    %edx,%eax
  jge    L143
  cltq
  add    $0x6,%ecx
  subb   $0x30,(%rsp,%rax,1)
  cmp    %ecx,%edx
  jle    L143
  movslq %ecx,%rcx
  subb   $0x30,(%rsp,%rcx,1)
L143:
  xor    %r8d,%r8d
  test   %edi,%edi
  jle    L306
L405:
  sub    $0x2,%edx
  mov    %rbx,%rax
  xor    %esi,%esi
  mov    $0x1,%ecx
  lea    0x1(%rsp,%rdx,1),%r9
  xor    %r8d,%r8d
  xchg   %ax,%ax
L353:
  movsbl (%rax),%edx
  cmp    $0x9,%dl
  ja     L170
  imul   %ecx,%edx
  add    $0x1,%esi
  add    %edx,%r8d
  mov    %esi,%edx
  and    $0x1,%edx
  cmp    $0x1,%edx
  sbb    %ecx,%ecx
  and    $0xfffffffe,%ecx
  add    $0x3,%ecx
L170:
  add    $0x1,%rax
  cmp    %r9,%rax
  jne    L353
L306:
  mov    $0xcccccccd,%edx
  mov    %r8d,%eax
  movslq %edi,%rdi
  imul   %rdx,%rax
  shr    $0x23,%rax
  lea    (%rax,%rax,4),%eax
  add    %eax,%eax
  sub    %r8d,%eax
  lea    0xa(%rax),%edx
  movsbl (%rsp,%rdi,1),%eax
  cmp    %eax,%edx
  jne    L184
  test   %r12b,%r12b
  jne    L45
L184:
  lea    D20(%rip),%rdi
  call   <printf@plt>
L81:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L310
  add    $0x20,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L96:
  cmp    $0x34,%al
  jne    L325
  xor    %ebp,%ebp
  cmpb   $0x32,0x7(%rsp)
  jne    L275
  cmpb   $0x31,0x8(%rsp)
  jne    L275
  xor    %ebp,%ebp
  cmpb   $0x30,0x9(%rsp)
  sete   %bpl
  lea    0x0(%rbp,%rbp,2),%ebp
  jmp    L275
L292:
  xor    %ebp,%ebp
  cmpb   $0x33,0x7(%rsp)
  jne    L275
  cmpb   $0x33,0x8(%rsp)
  jne    L275
  cmpb   $0x33,0x9(%rsp)
  jne    L275
  cmpb   $0x34,0xa(%rsp)
  jne    L275
  xor    %ebp,%ebp
  cmpb   $0x36,0xb(%rsp)
  sete   %bpl
  jmp    L275
L315:
  cmpb   $0x37,0x1(%rsp)
  jne    L150
  movzbl 0x2(%rsp),%eax
  sub    $0x38,%eax
  cmp    $0x1,%al
  setbe  %r12b
  jmp    L150
L325:
  xor    %ebp,%ebp
  cmp    $0x30,%al
  jne    L275
  xor    %ebp,%ebp
  cmpb   $0x31,0x7(%rsp)
  sete   %bpl
  shl    $0x2,%ebp
  jmp    L275
L45:
  lea    D11(%rip),%rdi
  call   <printf@plt>
  cmp    $0x1,%ebp
  je     L416
  cmp    $0x2,%ebp
  je     L294
  cmp    $0x3,%ebp
  je     L51
  cmp    $0x4,%ebp
  jne    L81
  lea    D13(%rip),%rdi
  call   <printf@plt>
  jmp    L81
L334:
  cmpb   $0x35,0x8(%rsp)
  jne    L275
  cmpb   $0x38,0x9(%rsp)
  jne    L275
  xor    %ebp,%ebp
  cmpb   $0x33,0xa(%rsp)
  sete   %bpl
  add    %ebp,%ebp
  jmp    L275
L438:
  xor    %eax,%eax
  xor    %ecx,%ecx
  jmp    L244
L416:
  lea    D28(%rip),%rdi
  call   <printf@plt>
  jmp    L81
L51:
  lea    D8(%rip),%rdi
  call   <printf@plt>
  jmp    L81
L294:
  lea    D83(%rip),%rdi
  call   <printf@plt>
  jmp    L81
L310:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: tag: D16
type: string
name: parse_data
arguments: tag: D82
type: byte[16]
name: parse_data
arguments: tag: D20
type: string
name: parse_data
arguments: tag: D11
type: string
name: parse_data
arguments: tag: D13
type: string
name: parse_data
arguments: tag: D28
type: string
name: parse_data
arguments: tag: D8
type: string
name: parse_data
arguments: tag: D83
type: string

tool: D16: %s

tool: {"D82": [0xd0,0xd0,0xd0,0xd0,0xd0,0xd0,0xd0,0xd0,0xd0,0xd0,0xd0,0xd0,0xd0,0xd0,0xd0,0xd0]}

tool: D20: 0

tool: D11: 1

tool: D13: 
Pyramid Books

tool: D28: 
Bluebridge

tool: D8: 
FUNimation Productions, Ltd.

tool: D83: 
Alyson Books

assistant: ```c
int main() {
  char ISBN[20];
  int valid = 1, counter, l, sum = 0, check = 1, counter2 = 0, company = 0;
  scanf("%s", ISBN);
  if (ISBN[0] != '9' || ISBN[1] != '7' || (ISBN[2] != '8' && ISBN[2] != '9')) {
    valid = 0;
  }
  if (ISBN[6] == '9' && ISBN[7] == '3' && ISBN[8] == '3' && ISBN[9] == '3' && ISBN[10] == '4' && ISBN[11] == '6') {
    company = 1;
  }
  if (ISBN[6] == '5' && ISBN[7] == '5' && ISBN[8] == '5' && ISBN[9] == '8' && ISBN[10] == '3') {
    company = 2;
  }
  if (ISBN[6] == '4' && ISBN[7] == '2' && ISBN[8] == '1' && ISBN[9] == '0') {
    company = 3;
  }
  if (ISBN[6] == '0' && ISBN[7] == '1') {
    company = 4;
  }
  l = strlen(ISBN);
  for (counter = 0; counter < l; counter++) {
    if (ISBN[counter] > '9' && ISBN[counter] < '0' && ISBN[counter] != '-')
      valid = 0;
  }
  for (counter = 0; counter < l; counter++) {
    ISBN[counter] = (ISBN[counter] - 48);
  }
  for (counter = 0; counter < l - 1; counter++) {
    if (ISBN[counter] <= 9 && ISBN[counter] >= 0) {
      sum = sum + ISBN[counter] * check;
      counter2++;
      if (counter2 % 2 != 0) {
        check = 3;
      } else {
        check = 1;
      }
    }
  }
  if (ISBN[l - 1] != 10 - (sum % 10)) {
    valid = 0;
  }
  if (valid != 0) {
    printf("1");
    if (company == 1) {
      printf("\nBluebridge");
    }
    if (company == 2) {
      printf("\nAlyson Books");
    }
    if (company == 3) {
      printf("\nFUNimation Productions, Ltd.");
    }
    if (company == 4) {
      printf("\nPyramid Books");
    }
  } else {
    printf("0");
  }
  return 0;
}
```