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

```asm
<main>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  lea    D96(%rip),%rdi
  call   <puts@plt>
  lea    D38(%rip),%rsi
  lea    D114(%rip),%rdi
  call   <fopen@plt>
  mov    %rax,%rbp
  mov    $0x0,%ebx
  lea    D52(%rip),%r12
  test   %rax,%rax
  je     L42
L51:
  mov    %ebx,%edx
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <fprintf@plt>
  add    $0x1,%ebx
  cmp    $0x100,%ebx
  jne    L51
  mov    %rbp,%rdi
  call   <fclose@plt>
  lea    D114(%rip),%rbx
  mov    %rbx,%rsi
  lea    D67(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    D104(%rip),%rsi
  mov    %rbx,%rdi
  call   <check_sha256_sum@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  je     L31
  mov    $0x40,%edx
  lea    D104(%rip),%rsi
  mov    %rax,%rdi
  call   <memcmp@plt>
  test   %rax,%rax
  jne    L45
  lea    D77(%rip),%rdi
  call   <puts@plt>
L39:
  lea    D114(%rip),%rdi
  call   <remove@plt>
  mov    $0x0,%eax
L22:
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L42:
  lea    D160(%rip),%rdi
  call   <puts@plt>
  mov    $0x1,%eax
  jmp    L22
L31:
  lea    D84(%rip),%rdi
  call   <puts@plt>
  jmp    L39
L45:
  lea    D98(%rip),%rdi
  call   <puts@plt>
  lea    D104(%rip),%r8
  lea    D90(%rip),%rcx
  mov    %rbx,%rdx
  lea    D103(%rip),%rsi
  lea    D89(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    %rbx,%rdi
  call   <free@plt>
  jmp    L39
```

tool_calls: name: parse_data
arguments: tag: D96
type_infered: string
name: parse_data
arguments: tag: D38
type_infered: string
name: parse_data
arguments: tag: D114
type_infered: string
name: parse_data
arguments: tag: D52
type_infered: string
name: parse_data
arguments: tag: D67
type_infered: string
name: parse_data
arguments: tag: D104
type_infered: string
name: parse_data
arguments: tag: D77
type_infered: string
name: parse_data
arguments: tag: D160
type_infered: string
name: parse_data
arguments: tag: D84
type_infered: string
name: parse_data
arguments: tag: D98
type_infered: string
name: parse_data
arguments: tag: D90
type_infered: string
name: parse_data
arguments: tag: D103
type_infered: string
name: parse_data
arguments: tag: D89
type_infered: string

tool: D96: Running test for SHA256:


tool: D38: wb

tool: D114: test_sha256.dat

tool: D52: %c

tool: D67: Checking file %s ... 

tool: D104: 40aff2e9d2d8922e47afd4648e6967497158785fbd1da870e7110266bf944880

tool: D77: Memory Error!


tool: D160: Cannot write test file!

tool: D84: CORRECT!


tool: D98: FALSE!

tool: D90: Assumed:

tool: D103: Calculated:

tool: D89: %-12s%s
%-12s%s



assistant: ```c
int main(void) {
  short i;
  unsigned char *ascii = NULL;
  FILE *fp = NULL;
  char *filename = "test_sha256.dat";
  char *assumed = "40aff2e9d2d8922e47afd4648e6967497158785fbd1da870e7110266bf944880";
  printf("Running test for SHA256:\n\n");
  fp = fopen(filename, "wb");
  if (!fp) {
    printf("Cannot write test file!\n");
    return 1;
  }
  for (i = 0x00; i <= 0xFF; i++) {
    fprintf(fp, "%c", i);
  }
  fclose(fp);
  printf("Checking file %s ... ", filename);
  ascii = check_sha256_sum(filename, (unsigned char *)assumed);
  if (ascii == NULL) {
    printf("CORRECT!\n\n");
  } else {
    if (memcmp(ascii, assumed, 64) == 0) {
      printf("Memory Error!\n\n");
    } else {
      printf("FALSE!\n");
      printf("%-12s%s\n%-12s%s\n\n", "Calculated:", ascii, "Assumed:", assumed);
      free(ascii);
    }
  }
  remove(filename);
  return 0;
}
```