user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<main>:
  endbr64
  push   %rbp
  lea    D3(%rip),%rdi
  push   %rbx
  sub    $0x58,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x48(%rsp)
  xor    %eax,%eax
  lea    0x3c(%rsp),%rbx
  mov    %rbx,%rsi
  call   <scanf@plt>
  mov    %rbx,%rdi
  call   <strlen@plt>
  xor    %r8d,%r8d
  mov    %rsp,%rsi
  movslq %eax,%rdi
  cmp    $0xb,%edi
  mov    %rdi,%rcx
  setg   %r8b
  xor    %eax,%eax
  test   %edi,%edi
  jle    L142
  nop
L358:
  movsbl (%rbx,%rax,1),%edx
  sub    $0x30,%edx
  mov    %edx,(%rsi,%rax,4)
  add    $0x1,%rax
  cmp    %rdi,%rax
  jne    L358
L142:
  mov    (%rsp),%eax
  mov    0x4(%rsp),%esi
  mov    0x8(%rsp),%ebx
  mov    0xc(%rsp),%r9d
  test   %eax,%eax
  jne    L104
  test   %esi,%esi
  je     L349
L69:
  mov    0x10(%rsp),%edx
  mov    0x14(%rsp),%edi
  mov    %ecx,%r11d
  and    $0xfffffffd,%r11d
  lea    (%rdx,%rdx,4),%edx
  add    %edx,%edx
  lea    (%rdx,%rdi,1),%r10d
  cmp    $0x1,%r11d
  jne    L195
  cmp    $0x1f,%r10d
  jg     L311
L208:
  mov    %ecx,%r11d
  and    $0xfffffffd,%r11d
  cmp    $0x4,%r11d
  jne    L193
L127:
  cmp    $0x1e,%r10d
  jg     L64
L234:
  lea    (%rax,%rax,4),%r11d
  lea    (%rsi,%r11,2),%r11d
  test   $0x3,%r11b
  jne    L88
  cmp    $0x2a,%ecx
  ja     L96
  movabs $0x40000400004,%rbp
  shr    %cl,%rbp
  and    $0x1,%bpl
  jne    L187
L96:
  test   %r11d,%r11d
  sete   %r11b
  cmp    $0x1c,%r10d
  setg   %r10b
  test   %r10b,%r11b
  je     L65
  sub    $0x1,%ecx
  cmp    $0xb,%ecx
  setbe  %cl
  cmp    $0x1,%cl
  sbb    $0xffffffff,%r8d
L65:
  lea    (%rax,%rsi,2),%eax
  lea    (%rax,%rbx,4),%ecx
  lea    (%r9,%r9,4),%eax
  lea    (%rax,%rcx,2),%eax
  add    %edx,%eax
  lea    (%rdi,%rdi,8),%edx
  add    %edx,%eax
  mov    0x18(%rsp),%edx
  lea    (%rax,%rdx,8),%eax
  sub    %edx,%eax
  mov    0x1c(%rsp),%edx
  lea    (%rdx,%rdx,2),%edx
  add    %edx,%eax
  mov    0x20(%rsp),%edx
  lea    (%rdx,%rdx,2),%edx
  lea    (%rax,%rdx,2),%edx
  movslq %edx,%rax
  mov    %edx,%ecx
  imul   $0x2e8ba2e9,%rax,%rax
  sar    $0x1f,%ecx
  sar    $0x21,%rax
  sub    %ecx,%eax
  lea    (%rax,%rax,4),%ecx
  lea    (%rax,%rcx,2),%ecx
  mov    %edx,%eax
  xor    %edx,%edx
  sub    %ecx,%eax
  cmp    $0xa,%eax
  cmove  %edx,%eax
  cmp    %eax,0x24(%rsp)
  jne    L283
  test   %r8d,%r8d
  jne    L283
  lea    D0(%rip),%rdi
  call   <printf@plt>
L167:
  mov    0x48(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L346
  add    $0x58,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  ret
L311:
  add    $0x1,%r8d
L193:
  cmp    $0x33,%ecx
  ja     L234
  movabs $0xa5000a5000a00,%r11
  shr    %cl,%r11
  and    $0x1,%r11b
  je     L234
  jmp    L127
L283:
  lea    D24(%rip),%rdi
  call   <printf@plt>
  jmp    L167
L88:
  cmp    $0x2a,%ecx
  ja     L65
  movabs $0x40000400004,%r11
  shr    %cl,%r11
  and    $0x1,%r11b
  je     L65
  cmp    $0x1c,%r10d
  jle    L65
  add    $0x1,%r8d
  jmp    L65
L104:
  test   %esi,%esi
  je     L69
  imul   $0xa,%ebx,%ecx
  add    %r9d,%ecx
  lea    -0x1(%rcx),%edx
  cmp    $0xb,%edx
  jbe    L69
  lea    -0x15(%rcx),%edx
  cmp    $0xb,%edx
  jbe    L69
  lea    -0x29(%rcx),%edx
  cmp    $0xc,%edx
  sbb    $0xffffffff,%r8d
L15:
  imul   $0xa,0x10(%rsp),%edx
  mov    0x14(%rsp),%edi
  lea    (%rdx,%rdi,1),%r10d
L195:
  cmp    $0x34,%ecx
  ja     L208
  movabs $0x15aa015aa015a0,%r11
  shr    %cl,%r11
  and    $0x1,%r11b
  je     L208
  cmp    $0x1f,%r10d
  jle    L208
  mov    %ecx,%r11d
  add    $0x1,%r8d
  and    $0xfffffffd,%r11d
  cmp    $0x4,%r11d
  jne    L193
L64:
  add    $0x1,%r8d
  jmp    L234
L349:
  imul   $0xa,%ebx,%ecx
  add    %r9d,%ecx
  lea    -0x1(%rcx),%edx
  cmp    $0xb,%edx
  jbe    L69
  lea    -0x29(%rcx),%edx
  cmp    $0xb,%edx
  jbe    L69
  add    $0x1,%r8d
  jmp    L15
L187:
  cmp    $0x1d,%r10d
  jle    L96
  add    $0x1,%r8d
  jmp    L96
L346:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: data_label: D3
datatype: string
name: disassemble_data
arguments: data_label: D0
datatype: string
name: disassemble_data
arguments: data_label: D24
datatype: string

tool: D3: %s

tool: D0: 1

tool: D24: 0

assistant: ```c
int main() {
  int arr[12];
  char string[12];
  int i = 0, x = 0, y = 0, z = 0, k = 0, sum = 0, del = 0, Error = 0;
  scanf("%s", string);
  x = strlen(string);
  if (x > 11) {
    Error++;
  }
  while (i < x) {
    arr[i] = string[i] - '0';
    i++;
  }
  i = 0;
  if (arr[0] == 0 && arr[1] == 0) {
    x = (arr[2] * 10) + arr[3];
    if ((x >= 1 && x <= 12) || (x >= 41 && x <= 52)) {
      i = 0;
    } else {
      Error++;
    }
  }
  if (arr[0] != 0 && arr[1] != 0) {
    x = (arr[2] * 10) + arr[3];
    if ((x >= 1 && x <= 12) || (x >= 21 && x <= 32) || (x >= 41 && x <= 52)) {
      i = 0;
    } else {
      Error++;
    }
  }
  y = (arr[4] * 10) + arr[5];
  if (x == 1 || x == 3 || x == 5 || x == 7 || x == 8 || x == 10 || x == 12 || x == 21 || x == 23 || x == 25 || x == 27 || x == 28 || x == 30 || x == 32 || x == 41 || x == 43 || x == 45 || x == 47 || x == 48 || x == 50 || x == 52) {
    if (y > 31) {
      Error++;
    }
  }
  if (x == 4 || x == 6 || x == 9 || x == 11 || x == 24 || x == 26 || x == 29 || x == 31 || x == 44 || x == 46 || x == 49 || x == 51) {
    if (y > 30) {
      Error++;
    }
  }
  z = (arr[0] * 10) + arr[1];
  k = z % 4;
  if (k == 0) {
    if (x == 2 || x == 22 || x == 42) {
      if (y > 29) {
        Error++;
      }
    }
  }
  if (k != 0) {
    if (x == 2 || x == 22 || x == 42) {
      if (y > 28) {
        Error++;
      }
    }
  }
  if (z == 0 && x >= 1 && x <= 12) {
    if (x == 2 || x == 22 || 42) {
      if (y > 28) {
        Error++;
      }
    }
  }
  sum = (arr[0] * 2) + (arr[1] * 4) + (arr[2] * 8) + (arr[3] * 5) + (arr[4] * 10) + (arr[5] * 9) + (arr[6] * 7) + (arr[7] * 3) + (arr[8] * 6);
  del = sum % 11;
  if (del == 10) {
    del = 0;
  }
  if (arr[9] != del) {
    Error++;
  }
  if (Error == 0) {
    printf("1");
  } else {
    printf("0");
  }
  return 0;
}
```