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

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  lea    D0(%rip),%r14
  push   %r13
  lea    D17(%rip),%r13
  push   %r12
  lea    D16(%rip),%r12
  mov    %r13,%rsi
  push   %rbp
  mov    %r12,%rdi
  push   %rbx
  lea    D29(%rip),%rbx
  sub    $0x28,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  lea    0x14(%rsp),%rbp
  call   <printf@plt>
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <scanf@plt>
  jmp    L133
  nopl   0x0(%rax,%rax,1)
L37:
  test   %esi,%esi
  jne    L102
L165:
  cmp    $0x1,%r8d
  je     L85
L56:
  test   %r8d,%r8d
  jne    L7
L86:
  cmp    $0x1,%r9d
  je     L77
L109:
  test   %r9d,%r9d
  jne    L160
L34:
  cmp    $0x1,%r15d
  je     L41
L52:
  test   %r15d,%r15d
  je     L112
L110:
  mov    %r14,%rdi
  call   <puts@plt>
  mov    %r13,%rsi
  mov    %r12,%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <scanf@plt>
L133:
  mov    0x14(%rsp),%edx
  cmp    $0x2b67,%edx
  ja     L110
  movslq %edx,%rax
  mov    %edx,%ecx
  imul   $0x68db8bad,%rax,%rax
  sar    $0x1f,%ecx
  sar    $0x2c,%rax
  sub    %ecx,%eax
  imul   $0x2710,%eax,%ecx
  mov    %edx,%eax
  sub    $0x2710,%edx
  sub    %ecx,%eax
  mov    %eax,%esi
  imul   $0x10624dd3,%rsi,%rsi
  shr    $0x26,%rsi
  imul   $0x3e8,%esi,%edi
  sub    %edi,%eax
  mov    %eax,%r8d
  mov    %r8,%rcx
  imul   $0x51eb851f,%r8,%r8
  shr    $0x25,%r8
  imul   $0x64,%r8d,%eax
  sub    %eax,%ecx
  mov    $0xcccccccd,%eax
  mov    %ecx,%r9d
  imul   %rax,%r9
  shr    $0x23,%r9
  lea    (%r9,%r9,4),%eax
  add    %eax,%eax
  sub    %eax,%ecx
  cmp    $0x270f,%edx
  setbe  %dl
  mov    %ecx,0x14(%rsp)
  mov    %ecx,%r15d
  movzbl %dl,%edx
  shl    $0x4,%edx
  cmp    $0x1,%esi
  jne    L37
  add    $0x8,%edx
  cmp    $0x1,%r8d
  jne    L56
L85:
  add    $0x4,%edx
  cmp    $0x1,%r9d
  jne    L109
L77:
  add    $0x2,%edx
  cmp    $0x1,%r15d
  jne    L52
L41:
  add    $0x1,%edx
L112:
  xor    %eax,%eax
  lea    D50(%rip),%rsi
  lea    D57(%rip),%rdi
  call   <printf@plt>
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L139
  add    $0x28,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L7:
  mov    %r14,%rdi
  mov    %r9d,0x8(%rsp)
  mov    %edx,0x4(%rsp)
  call   <puts@plt>
  mov    %r13,%rsi
  mov    %r12,%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <scanf@plt>
  mov    0x8(%rsp),%r9d
  mov    0x4(%rsp),%edx
  jmp    L86
  nopw   0x0(%rax,%rax,1)
L102:
  mov    %r14,%rdi
  mov    %r9d,0xc(%rsp)
  mov    %r8d,0x8(%rsp)
  mov    %edx,0x4(%rsp)
  call   <puts@plt>
  mov    %r13,%rsi
  mov    %r12,%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <scanf@plt>
  mov    0xc(%rsp),%r9d
  mov    0x8(%rsp),%r8d
  mov    0x4(%rsp),%edx
  jmp    L165
  nopl   0x0(%rax)
L160:
  mov    %r14,%rdi
  mov    %edx,0x4(%rsp)
  call   <puts@plt>
  mov    %r13,%rsi
  mov    %r12,%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <scanf@plt>
  mov    0x4(%rsp),%edx
  jmp    L34
L139:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_label: D0
datatype: string
name: read_data
arguments: data_label: D17
datatype: string
name: read_data
arguments: data_label: D16
datatype: string
name: read_data
arguments: data_label: D29
datatype: string
name: read_data
arguments: data_label: D50
datatype: string
name: read_data
arguments: data_label: D57
datatype: string

tool: D0: You have not entered a binary number

tool: D17: Enter a valid binary number (up to 5 digits): 

tool: D16: %s

tool: D29: %d

tool: D50: The decimal equivalent is: 

tool: D57: %s%d

assistant: ```c
int main(void) {
  int number;
  int flag = 1;
  int numA;
  int numB;
  int numC;
  int numD;
  int numE;
  int decimal = 0;
  printf("%s", "Enter a valid binary number (up to 5 digits): ");
  scanf("%d", &number);
  while (flag != -1) {
    decimal = 0;
    if (number >= 0) {
      if (number <= 11111) {
        numA = number / 10000;
        number = number % 10000;
        numB = number / 1000;
        number = number % 1000;
        numC = number / 100;
        number = number % 100;
        numD = number / 10;
        number = number % 10;
        numE = number;
        if (numA == 1) {
          decimal = decimal + (numA * 16);
          flag = -1;
        } else if (numA == 0) {
          decimal = decimal + (numA * 16);
          flag = -1;
        } else {
          puts("You have not entered a binary number");
          printf("%s", "Enter a valid binary number (up to 5 digits): ");
          scanf("%d", &number);
          flag = 1;
        }
        if (numB == 1) {
          decimal = decimal + (numB * 8);
          flag = -1;
        } else if (numB == 0) {
          decimal = decimal + (numB * 8);
          flag = -1;
        } else {
          puts("You have not entered a binary number");
          printf("%s", "Enter a valid binary number (up to 5 digits): ");
          scanf("%d", &number);
          flag = 1;
        }
        if (numC == 1) {
          decimal = decimal + (numC * 4);
          flag = -1;
        } else if (numC == 0) {
          decimal = decimal + (numC * 4);
          flag = -1;
        } else {
          puts("You have not entered a binary number");
          printf("%s", "Enter a valid binary number (up to 5 digits): ");
          scanf("%d", &number);
          flag = 1;
        }
        if (numD == 1) {
          decimal = decimal + (numD * 2);
          flag = -1;
        } else if (numD == 0) {
          decimal = decimal + (numD * 2);
          flag = -1;
        } else {
          puts("You have not entered a binary number");
          printf("%s", "Enter a valid binary number (up to 5 digits): ");
          scanf("%d", &number);
          flag = 1;
        }
        if (numE == 1) {
          decimal = decimal + numE;
          flag = -1;
        } else if (numE == 0) {
          decimal = decimal + numE;
          flag = -1;
        } else {
          puts("You have not entered a binary number");
          printf("%s", "Enter a valid binary number (up to 5 digits): ");
          scanf("%d", &number);
          flag = 1;
        }
      } else {
        puts("You have not entered a binary number");
        printf("%s", "Enter a valid binary number (up to 5 digits): ");
        scanf("%d", &number);
        flag = 1;
      }
    } else {
      puts("You have not entered a binary number");
      printf("%s", "Enter a valid binary number (up to 5 digits): ");
      scanf("%d", &number);
      flag = 1;
    }
  }
  printf("%s%d", "The decimal equivalent is: ", decimal);
  return 0;
}
```