user: Translate the below assembly code into C programming language:

```asm
<main>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x40,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x38(%rsp)
  xor    %eax,%eax
  movq   $0x0,0x20(%rsp)
  movq   $0x0,0x28(%rsp)
  cmp    $0x1,%edi
  jle    L49
  mov    0x8(%rsi),%rdi
  lea    D21(%rip),%rsi
  call   <fopen@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  je     L1
  lea    0x20(%rsp),%r14
  lea    0x4(%rsp),%r13
  mov    %rsp,%r12
  mov    %r14,%rcx
  mov    %r13,%rdx
  mov    %r12,%rsi
  mov    %rax,%rdi
  call   <get_encks_der_file@plt>
  mov    %rbx,%rdi
  call   <fclose@plt>
  lea    0xc(%rsp),%rbp
  lea    0x8(%rsp),%rbx
  mov    %rbp,%r8
  mov    %rbx,%rcx
  mov    %r14,%rdx
  mov    %r13,%rsi
  mov    %r12,%rdi
  call   <make_session_key@plt>
  lea    0x10(%rsp),%r13
  mov    $0x0,%ecx
  mov    %rbp,%rdx
  mov    %rbx,%rsi
  mov    %r13,%rdi
  call   <get_cryptogram@plt>
  lea    0x18(%rsp),%r12
  mov    $0x1,%ecx
  mov    %rbp,%rdx
  mov    %rbx,%rsi
  mov    %r12,%rdi
  call   <get_cryptogram@plt>
  mov    $0x8,%edx
  mov    %r13,%rsi
  lea    D6(%rip),%rdi
  call   <print_hex@plt>
  mov    $0x8,%edx
  mov    %r12,%rsi
  lea    D1(%rip),%rdi
  call   <print_hex@plt>
  mov    $0x0,%eax
L2:
  mov    0x38(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L14
  add    $0x40,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L49:
  mov    (%rsi),%rsi
  lea    D62(%rip),%rdi
  call   <printf@plt>
  lea    D41(%rip),%rdi
  call   <puts@plt>
  lea    D32(%rip),%rdi
  call   <puts@plt>
  mov    $0x1,%eax
  jmp    L2
L1:
  lea    D53(%rip),%rdi
  call   <perror@plt>
  mov    $0x1,%eax
  jmp    L2
L14:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: label: D21
datatype: string
name: read_data
arguments: label: D6
datatype: string
name: read_data
arguments: label: D1
datatype: string
name: read_data
arguments: label: D62
datatype: string
name: read_data
arguments: label: D41
datatype: string
name: read_data
arguments: label: D32
datatype: string
name: read_data
arguments: label: D53
datatype: string

tool: D21: r

tool: D6: Card Cryptogram

tool: D1: Host Cryptogram

tool: D62: Usage: ./%s <filename>


tool: D41: Put HC, CC, S ENC key, S MAC key to the file.

tool: D32: Bytes have to be seperated by white space.

tool: D53: fopen

assistant: ```c
int main(int argc, char *argv[]) {
  FILE *fd;
  char ccrgram[8];
  char hcrgram[8];
  char derdat[(8 * 2)] = {0};
  DES_key_schedule enc1, enc2;
  DES_key_schedule s_enc1, s_enc2;
  if (argc < 2) {
    printf("Usage: ./%s <filename>\n", argv[0]);
    printf("Put HC, CC, S ENC key, S MAC key to the file.\n");
    printf("Bytes have to be seperated by white space.\n");
    return 1;
  }
  fd = fopen(argv[1], "r");
  if (fd == NULL) {
    perror("fopen");
    return 1;
  }
  get_encks_der_file(fd, &enc1, &enc2, derdat);
  fclose(fd);
  make_session_key(&enc1, &enc2, derdat, &s_enc1, &s_enc2);
  get_cryptogram(ccrgram, &s_enc1, &s_enc2, 0);
  get_cryptogram(hcrgram, &s_enc1, &s_enc2, 1);
  print_hex("Card Cryptogram", ccrgram, 8);
  print_hex("Host Cryptogram", hcrgram, 8);
  return 0;
}
```