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

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x110,%rsp
  mov    %edi,-0x104(%rbp)
  mov    %rsi,-0x110(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x0,-0x100(%rbp)
  movl   $0x0,-0xfc(%rbp)
  movl   $0x0,-0xf4(%rbp)
  lea    D95(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  cmpl   $0x1,-0x104(%rbp)
  jle    L37
  mov    -0x110(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rax
  lea    D23(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L38
  lea    D4(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    -0xd0(%rbp),%rax
  mov    %rax,%rsi
  lea    D9(%rip),%rax
  mov    %rax,%rdi
  call   <scanf@plt>
  mov    -0xd0(%rbp),%eax
  cmp    $0xffff,%eax
  ja     L173
  mov    -0xd0(%rbp),%eax
  test   %eax,%eax
  jne    L11
L173:
  lea    D42(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    $0xffffffff,%eax
  jmp    L25
L11:
  mov    -0xd0(%rbp),%eax
  mov    %eax,-0xb0(%rbp)
  jmp    L26
L43:
  mov    -0x100(%rbp),%eax
  cltq
  movl   $0x0,-0xf0(%rbp,%rax,4)
  jmp    L32
L5:
  mov    -0x100(%rbp),%eax
  cltq
  mov    -0xf0(%rbp,%rax,4),%edx
  mov    -0xd0(%rbp),%eax
  and    $0x1,%eax
  or     %eax,%edx
  mov    -0x100(%rbp),%eax
  cltq
  mov    %edx,-0xf0(%rbp,%rax,4)
  cmpl   $0x3,-0xfc(%rbp)
  je     L141
  mov    -0x100(%rbp),%eax
  cltq
  mov    -0xf0(%rbp,%rax,4),%eax
  lea    (%rax,%rax,1),%edx
  mov    -0x100(%rbp),%eax
  cltq
  mov    %edx,-0xf0(%rbp,%rax,4)
L141:
  mov    -0xd0(%rbp),%eax
  shr    %eax
  mov    %eax,-0xd0(%rbp)
  addl   $0x1,-0xfc(%rbp)
L32:
  cmpl   $0x3,-0xfc(%rbp)
  jle    L5
  movl   $0x0,-0xfc(%rbp)
  addl   $0x1,-0x100(%rbp)
L26:
  cmpl   $0x3,-0x100(%rbp)
  jle    L43
  mov    -0xec(%rbp),%edi
  mov    -0xf0(%rbp),%esi
  mov    -0xe4(%rbp),%ecx
  mov    -0xe8(%rbp),%edx
  mov    -0xb0(%rbp),%eax
  mov    %edi,%r9d
  mov    %esi,%r8d
  mov    %eax,%esi
  lea    D36(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L104
L38:
  lea    D94(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  jmp    L210
L37:
  nop
L210:
  movl   $0x0,-0xf8(%rbp)
  jmp    L182
L234:
  mov    -0xf8(%rbp),%eax
  cltq
  movl   $0x0,-0xd0(%rbp,%rax,4)
  mov    -0xf8(%rbp),%eax
  cltq
  movl   $0x0,-0xb0(%rbp,%rax,4)
  mov    -0xf8(%rbp),%eax
  cltq
  movl   $0x0,-0xf0(%rbp,%rax,4)
  addl   $0x1,-0xf8(%rbp)
L182:
  cmpl   $0x3,-0xf8(%rbp)
  jle    L234
  lea    D101(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    -0xd0(%rbp),%rax
  mov    %rax,%rsi
  lea    D9(%rip),%rax
  mov    %rax,%rdi
  call   <scanf@plt>
  mov    -0xd0(%rbp),%eax
  cmp    $0xff,%eax
  ja     L3
  mov    -0xd0(%rbp),%eax
  test   %eax,%eax
  jne    L79
L3:
  lea    D42(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  jmp    L104
L79:
  mov    -0xd0(%rbp),%eax
  mov    %eax,-0xb0(%rbp)
  jmp    L35
L238:
  mov    -0x100(%rbp),%eax
  cltq
  movl   $0x0,-0xf0(%rbp,%rax,4)
  jmp    L112
L73:
  mov    -0x100(%rbp),%eax
  cltq
  mov    -0xf0(%rbp,%rax,4),%edx
  mov    -0xd0(%rbp),%eax
  and    $0x1,%eax
  or     %eax,%edx
  mov    -0x100(%rbp),%eax
  cltq
  mov    %edx,-0xf0(%rbp,%rax,4)
  cmpl   $0x3,-0xfc(%rbp)
  je     L139
  mov    -0x100(%rbp),%eax
  cltq
  mov    -0xf0(%rbp,%rax,4),%eax
  lea    (%rax,%rax,1),%edx
  mov    -0x100(%rbp),%eax
  cltq
  mov    %edx,-0xf0(%rbp,%rax,4)
L139:
  mov    -0xd0(%rbp),%eax
  shr    %eax
  mov    %eax,-0xd0(%rbp)
  addl   $0x1,-0xfc(%rbp)
L112:
  cmpl   $0x3,-0xfc(%rbp)
  jle    L73
  movl   $0x0,-0xfc(%rbp)
  addl   $0x1,-0x100(%rbp)
L35:
  cmpl   $0x1,-0x100(%rbp)
  jle    L238
  movl   $0x0,-0x100(%rbp)
  mov    -0xf0(%rbp),%eax
  not    %eax
  and    $0xf,%eax
  mov    %eax,-0xe8(%rbp)
  mov    -0xec(%rbp),%eax
  not    %eax
  and    $0xf,%eax
  mov    %eax,-0xe4(%rbp)
  mov    -0xe4(%rbp),%edi
  mov    -0xe8(%rbp),%esi
  mov    -0xec(%rbp),%ecx
  mov    -0xf0(%rbp),%edx
  mov    -0xb0(%rbp),%eax
  mov    %edi,%r9d
  mov    %esi,%r8d
  mov    %eax,%esi
  lea    D36(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    -0x90(%rbp),%rax
  mov    $0x80,%edx
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  mov    -0xe4(%rbp),%esi
  mov    -0xe8(%rbp),%r8d
  mov    -0xec(%rbp),%edi
  mov    -0xf0(%rbp),%ecx
  mov    -0xb0(%rbp),%edx
  lea    -0x90(%rbp),%rax
  sub    $0x8,%rsp
  push   %rsi
  mov    %r8d,%r9d
  mov    %edi,%r8d
  lea    D19(%rip),%rsi
  mov    %rax,%rdi
  call   <sprintf@plt>
  add    $0x10,%rsp
  lea    -0x90(%rbp),%rax
  mov    %rax,%rdi
  call   <system@plt>
  jmp    L210
L104:
  mov    $0x0,%eax
L25:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L162
  call   <__stack_chk_fail@plt>
L162:
  leave
  ret
```

tool_calls: name: parse_data
arguments: data_tag: D95
type_infered: string
name: parse_data
arguments: data_tag: D23
type_infered: string
name: parse_data
arguments: data_tag: D4
type_infered: string
name: parse_data
arguments: data_tag: D9
type_infered: string
name: parse_data
arguments: data_tag: D42
type_infered: string
name: parse_data
arguments: data_tag: D36
type_infered: string
name: parse_data
arguments: data_tag: D94
type_infered: string
name: parse_data
arguments: data_tag: D101
type_infered: string
name: parse_data
arguments: data_tag: D19
type_infered: string

tool: D95: 

HELP: input tran -c to enter client code mode!


tool: D23: -c

tool: D4: Please enter your client code(for example 0x1234):

tool: D9: %x

tool: D42: ERROR CODE!

tool: D36: 0x%x ==> 0x%x%x%x%x


tool: D94: Wrong argument!

tool: D101: Please enter your key code(for example 0x56):

tool: D19: echo "0x%x --  0x%x%x%x%x " >> key_code 

assistant: ```c
int main(int argc, char **argv) {
  unsigned int m_val[8];
  unsigned int m_val_tmp;
  unsigned int m_input[8];
  unsigned int m_input_tmp[8];
  int i0 = 0, i1 = 0, i2 = 0;
  printf("\n\nHELP: input tran -c to enter client code mode!\n\n");
  if (argc >= 2) {
    ;
  }
  if (argc >= 2) {
    if (strcmp(argv[1], "-c") == 0) {
      printf("Please enter your client code(for example 0x1234):\n");
      scanf("%x", &m_input);
      if (m_input[0] > 0xFFFF || m_input[0] <= 0) {
        printf("ERROR CODE!\n");
        return -1;
      }
      m_input_tmp[0] = m_input[0];
      while (i0 < 4) {
        m_val[i0] = 0;
        while (i1 < 4) {
          m_val[i0] |= m_input[0] & 0x01;
          if (i1 != 3)
            m_val[i0] <<= 1;
          m_input[0] >>= 1;
          i1++;
        }
        i1 = 0;
        i0++;
      }
      printf("0x%x ==> 0x%x%x%x%x\n", m_input_tmp[0], m_val[2], m_val[3], m_val[0], m_val[1]);
    } else {
      printf("Wrong argument!\n");
      goto KEY_CODE;
    }
  } else {
  KEY_CODE:
    while (1) {
      int i2 = 0;
      char m_out[128];
      while (i2 < 4) {
        m_input[i2] = 0;
        m_input_tmp[i2] = 0;
        m_val[i2] = 0;
        i2++;
      }
      printf("Please enter your key code(for example 0x56):\n");
      scanf("%x", &m_input);
      ;
      if (m_input[0] > 0xff || m_input[0] <= 0) {
        printf("ERROR CODE!\n");
        break;
      }
      m_input_tmp[0] = m_input[0];
      while (i0 < 2) {
        m_val[i0] = 0;
        while (i1 < 4) {
          m_val[i0] |= m_input[0] & 0x01;
          ;
          if (i1 != 3)
            m_val[i0] <<= 1;
          m_input[0] >>= 1;
          i1++;
        }
        i1 = 0;
        i0++;
      }
      i0 = 0;
      m_val[2] = ~m_val[0] & 0x0F;
      m_val[3] = ~m_val[1] & 0x0F;
      printf("0x%x ==> 0x%x%x%x%x\n", m_input_tmp[0], m_val[0], m_val[1], m_val[2], m_val[3]);
      memset(m_out, 0x0, sizeof(m_out));
      sprintf(m_out, "echo \"0x%x --  0x%x%x%x%x \" >> key_code ", m_input_tmp[0], m_val[0], m_val[1], m_val[2], m_val[3]);
      system(m_out);
    }
  }
}
```