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

```asm
<main>:
  endbr64
  push   %r15
  lea    D27(%rip),%rsi
  lea    D236(%rip),%rdi
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  xor    %ebx,%ebx
  sub    $0x698,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x688(%rsp)
  xor    %eax,%eax
  lea    0x460(%rsp),%r14
  lea    0x570(%rsp),%r13
  call   <fopen@plt>
  mov    $0x2b,%edx
  mov    $0x1,%esi
  lea    D214(%rip),%rdi
  mov    %rax,%rcx
  mov    %rax,%r12
  call   <fwrite@plt>
  movdqa D93(%rip),%xmm0
  movaps %xmm0,0x400(%rsp)
  movdqa D130(%rip),%xmm0
  movaps %xmm0,0x410(%rsp)
  movdqa D74(%rip),%xmm0
  movaps %xmm0,0x420(%rsp)
  movdqa D113(%rip),%xmm0
  movaps %xmm0,0x430(%rsp)
  movdqa D200(%rip),%xmm0
  movaps %xmm0,0x440(%rsp)
  movdqa D16(%rip),%xmm0
  movaps %xmm0,0x450(%rsp)
  nopl   0x0(%rax)
L172:
  lea    -0x8(%rbx),%ebp
  mov    $0xff,%eax
  mov    $0x1f,%esi
  cmp    %eax,%ebp
  cmovg  %eax,%ebp
  xor    %eax,%eax
  test   %ebp,%ebp
  cmovs  %eax,%ebp
  mov    %ebp,%edi
  call   <mul8bit@plt>
  mov    $0x3f,%esi
  mov    %ebp,%edi
  movzbl 0x400(%rsp,%rax,1),%eax
  mov    %al,(%r14,%rbx,1)
  call   <mul8bit@plt>
  movzbl 0x420(%rsp,%rax,1),%eax
  mov    %al,0x0(%r13,%rbx,1)
  add    $0x1,%rbx
  cmp    $0x110,%rbx
  jne    L172
  mov    %r12,%rcx
  mov    $0x30,%edx
  mov    $0x1,%esi
  xor    %ebx,%ebx
  lea    D188(%rip),%rdi
  lea    D36(%rip),%rbp
  call   <fwrite@plt>
  lea    D75(%rip),%r15
  jmp    L128
  nopl   (%rax)
L169:
  movzbl (%r14,%rbx,1),%edx
  mov    %rbp,%rsi
  mov    %r12,%rdi
  xor    %eax,%eax
  add    $0x1,%rbx
  call   <fprintf@plt>
  cmp    $0x110,%rbx
  je     L129
L128:
  test   $0x7,%bl
  jne    L169
  mov    %r12,%rcx
  mov    $0x4,%edx
  mov    $0x1,%esi
  mov    %r15,%rdi
  call   <fwrite@plt>
  jmp    L169
L129:
  mov    %r12,%rcx
  mov    $0x5,%edx
  mov    $0x1,%esi
  xor    %ebx,%ebx
  lea    D73(%rip),%rdi
  lea    D75(%rip),%r15
  call   <fwrite@plt>
  mov    %r12,%rcx
  mov    $0x2f,%edx
  mov    $0x1,%esi
  lea    D11(%rip),%rdi
  call   <fwrite@plt>
  jmp    L98
  nopl   0x0(%rax,%rax,1)
L120:
  movzbl 0x0(%r13,%rbx,1),%edx
  mov    %rbp,%rsi
  mov    %r12,%rdi
  xor    %eax,%eax
  add    $0x1,%rbx
  call   <fprintf@plt>
  cmp    $0x110,%rbx
  je     L2
L98:
  test   $0x7,%bl
  jne    L120
  mov    %r12,%rcx
  mov    $0x4,%edx
  mov    $0x1,%esi
  mov    %r15,%rdi
  call   <fwrite@plt>
  jmp    L120
L2:
  mov    %r12,%rcx
  mov    $0x5,%edx
  mov    $0x1,%esi
  mov    %rsp,%rbx
  lea    D73(%rip),%rdi
  lea    0x200(%rsp),%rbp
  xor    %r14d,%r14d
  call   <fwrite@plt>
  mov    $0x20,%edx
  lea    0x400(%rsp),%rsi
  mov    %rbx,%rdi
  call   <prepare_opt_table@plt>
  mov    $0x40,%edx
  lea    0x420(%rsp),%rsi
  mov    %rbp,%rdi
  call   <prepare_opt_table@plt>
  mov    %r12,%rcx
  mov    $0x2e,%edx
  mov    $0x1,%esi
  lea    D176(%rip),%rdi
  lea    D46(%rip),%r13
  call   <fwrite@plt>
  lea    D75(%rip),%r15
  jmp    L103
  cs nopw 0x0(%rax,%rax,1)
L135:
  movzbl 0x1(%rbx,%r14,2),%ecx
  movzbl (%rbx,%r14,2),%edx
  mov    %r13,%rsi
  xor    %eax,%eax
  mov    %r12,%rdi
  add    $0x1,%r14
  call   <fprintf@plt>
  cmp    $0x100,%r14
  je     L83
L103:
  test   $0x3,%r14b
  jne    L135
  mov    %r12,%rcx
  mov    $0x4,%edx
  mov    $0x1,%esi
  mov    %r15,%rdi
  call   <fwrite@plt>
  jmp    L135
L83:
  mov    %r12,%rcx
  mov    $0x5,%edx
  mov    $0x1,%esi
  xor    %ebx,%ebx
  lea    D73(%rip),%rdi
  lea    D75(%rip),%r15
  call   <fwrite@plt>
  mov    %r12,%rcx
  mov    $0x2e,%edx
  mov    $0x1,%esi
  lea    D154(%rip),%rdi
  call   <fwrite@plt>
  jmp    L70
  nop
L74:
  movzbl 0x1(%rbp,%rbx,2),%ecx
  movzbl 0x0(%rbp,%rbx,2),%edx
  mov    %r13,%rsi
  mov    %r12,%rdi
  xor    %eax,%eax
  add    $0x1,%rbx
  call   <fprintf@plt>
  cmp    $0x100,%rbx
  je     L150
L70:
  test   $0x3,%bl
  jne    L74
  mov    %r12,%rcx
  mov    $0x4,%edx
  mov    $0x1,%esi
  mov    %r15,%rdi
  call   <fwrite@plt>
  jmp    L74
L150:
  mov    %r12,%rcx
  mov    $0x5,%edx
  mov    $0x1,%esi
  lea    D73(%rip),%rdi
  call   <fwrite@plt>
  lea    D208(%rip),%rdi
  mov    %r12,%rcx
  mov    $0x7,%edx
  mov    $0x1,%esi
  call   <fwrite@plt>
  mov    %r12,%rdi
  call   <fclose@plt>
  mov    0x688(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L89
  add    $0x698,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L89:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_label: D27
type_guessed: string
name: read_data
arguments: data_label: D236
type_guessed: string
name: read_data
arguments: data_label: D214
type_guessed: string
name: read_data
arguments: data_label: D93
type_guessed: byte[16]
name: read_data
arguments: data_label: D130
type_guessed: byte[16]
name: read_data
arguments: data_label: D74
type_guessed: byte[16]
name: read_data
arguments: data_label: D113
type_guessed: byte[16]
name: read_data
arguments: data_label: D200
type_guessed: byte[16]
name: read_data
arguments: data_label: D16
type_guessed: byte[16]
name: read_data
arguments: data_label: D188
type_guessed: string
name: read_data
arguments: data_label: D36
type_guessed: string
name: read_data
arguments: data_label: D75
type_guessed: string
name: read_data
arguments: data_label: D73
type_guessed: string
name: read_data
arguments: data_label: D11
type_guessed: string
name: read_data
arguments: data_label: D176
type_guessed: string
name: read_data
arguments: data_label: D46
type_guessed: string
name: read_data
arguments: data_label: D154
type_guessed: string
name: read_data
arguments: data_label: D208
type_guessed: string

tool: D27: w

tool: D236: dxt_tables.h

tool: D214: #ifndef DXT_TABLES_H
#define DXT_TABLES_H



tool: {"D93": [0x00,0x08,0x10,0x18,0x21,0x29,0x31,0x39,0x42,0x4a,0x52,0x5a,0x63,0x6b,0x73,0x7b]}

tool: {"D130": [0x84,0x8c,0x94,0x9c,0xa5,0xad,0xb5,0xbd,0xc6,0xce,0xd6,0xde,0xe7,0xef,0xf7,0xff]}

tool: {"D74": [0x00,0x04,0x08,0x0c,0x10,0x14,0x18,0x1c,0x20,0x24,0x28,0x2c,0x30,0x34,0x38,0x3c]}

tool: {"D113": [0x41,0x45,0x49,0x4d,0x51,0x55,0x59,0x5d,0x61,0x65,0x69,0x6d,0x71,0x75,0x79,0x7d]}

tool: {"D200": [0x82,0x86,0x8a,0x8e,0x92,0x96,0x9a,0x9e,0xa2,0xa6,0xaa,0xae,0xb2,0xb6,0xba,0xbe]}

tool: {"D16": [0xc3,0xc7,0xcb,0xcf,0xd3,0xd7,0xdb,0xdf,0xe3,0xe7,0xeb,0xef,0xf3,0xf7,0xfb,0xff]}

tool: D188: static const unsigned char quantRB[256 + 16] =
{

tool: D36: 0x%02x, 

tool: D75: 
   

tool: D73: 
};



tool: D11: static const unsigned char quantG[256 + 16] =
{

tool: D176: static const unsigned char omatch5[256][2] =
{

tool: D46: {0x%02x, 0x%02x}, 

tool: D154: static const unsigned char omatch6[256][2] =
{

tool: D208: #endif


assistant: ```c
int main(void) {
  FILE *fp;
  int i, v;
  unsigned char expand5[32];
  unsigned char expand6[64];
  unsigned char quantRB[256 + 16];
  unsigned char quantG[256 + 16];
  unsigned char omatch5[256][2];
  unsigned char omatch6[256][2];
  fp = fopen("dxt_tables.h", "w");
  fprintf(fp, "#ifndef DXT_TABLES_H\n"
              "#define DXT_TABLES_H\n\n");
  for (i = 0; i < 32; ++i)
    expand5[i] = (i << 3) | (i >> 2);
  for (i = 0; i < 64; ++i)
    expand6[i] = (i << 2) | (i >> 4);
  for (i = 0; i < 256 + 16; ++i) {
    v = i - 8;
    if (v < 0)
      v = 0;
    if (v > 255)
      v = 255;
    quantRB[i] = expand5[mul8bit(v, 31)];
    quantG[i] = expand6[mul8bit(v, 63)];
  }
  fprintf(fp, "static const unsigned char quantRB[256 + 16] =\n"
              "{");
  for (i = 0; i < 256 + 16; ++i) {
    if (i % 8 == 0)
      fprintf(fp, "\n   ");
    fprintf(fp, "0x%02x, ", quantRB[i]);
  }
  fprintf(fp, "\n};\n\n");
  fprintf(fp, "static const unsigned char quantG[256 + 16] =\n"
              "{");
  for (i = 0; i < 256 + 16; ++i) {
    if (i % 8 == 0)
      fprintf(fp, "\n   ");
    fprintf(fp, "0x%02x, ", quantG[i]);
  }
  fprintf(fp, "\n};\n\n");
  prepare_opt_table(&omatch5[0][0], expand5, 32);
  prepare_opt_table(&omatch6[0][0], expand6, 64);
  fprintf(fp, "static const unsigned char omatch5[256][2] =\n"
              "{");
  for (i = 0; i < 256; ++i) {
    if (i % 4 == 0)
      fprintf(fp, "\n   ");
    fprintf(fp, "{0x%02x, 0x%02x}, ", omatch5[i][0], omatch5[i][1]);
  }
  fprintf(fp, "\n};\n\n");
  fprintf(fp, "static const unsigned char omatch6[256][2] =\n"
              "{");
  for (i = 0; i < 256; ++i) {
    if (i % 4 == 0)
      fprintf(fp, "\n   ");
    fprintf(fp, "{0x%02x, 0x%02x}, ", omatch6[i][0], omatch6[i][1]);
  }
  fprintf(fp, "\n};\n\n");
  fprintf(fp, "#endif\n");
  fclose(fp);
  return (0);
}
```