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

```asm
<show_DECCIR>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %rdi,-0x48(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x3,-0x3c(%rbp)
  lea    -0x3c(%rbp),%rcx
  mov    -0x48(%rbp),%rax
  mov    $0x3b,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <scanto@plt>
  mov    %eax,-0x2c(%rbp)
  lea    -0x3c(%rbp),%rcx
  mov    -0x48(%rbp),%rax
  mov    $0x3b,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <scanto@plt>
  mov    %eax,-0x28(%rbp)
  lea    -0x3c(%rbp),%rcx
  mov    -0x48(%rbp),%rax
  mov    $0x3b,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <scanto@plt>
  mov    %eax,-0x24(%rbp)
  mov    $0xa,%esi
  mov    $0x5,%edi
  call   <vt_move@plt>
  mov    -0x24(%rbp),%ecx
  mov    -0x28(%rbp),%edx
  mov    -0x2c(%rbp),%eax
  mov    %eax,%esi
  lea    D269(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <show_result@plt>
  lea    -0x3c(%rbp),%rcx
  mov    -0x48(%rbp),%rax
  mov    $0x3b,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <scan_chr@plt>
  mov    %eax,-0x38(%rbp)
  mov    $0xa,%esi
  mov    $0x6,%edi
  call   <vt_move@plt>
  mov    -0x38(%rbp),%eax
  and    $0x40,%eax
  test   %eax,%eax
  je     L201
  mov    -0x38(%rbp),%eax
  and    $0x40,%eax
  test   %eax,%eax
  je     L176
  andl   $0xffffffbf,-0x38(%rbp)
  lea    D244(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <show_result@plt>
L176:
  cmpl   $0x0,-0x38(%rbp)
  jne    L275
  lea    D41(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <show_result@plt>
L275:
  mov    -0x38(%rbp),%eax
  and    $0x8,%eax
  test   %eax,%eax
  je     L226
  andl   $0xfffffff7,-0x38(%rbp)
  lea    D197(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <show_result@plt>
L226:
  mov    -0x38(%rbp),%eax
  and    $0x4,%eax
  test   %eax,%eax
  je     L219
  andl   $0xfffffffb,-0x38(%rbp)
  lea    D260(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <show_result@plt>
L219:
  mov    -0x38(%rbp),%eax
  and    $0x2,%eax
  test   %eax,%eax
  je     L49
  andl   $0xfffffffd,-0x38(%rbp)
  lea    D211(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <show_result@plt>
L49:
  mov    -0x38(%rbp),%eax
  and    $0x1,%eax
  test   %eax,%eax
  je     L201
  andl   $0xfffffffe,-0x38(%rbp)
  lea    D4(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <show_result@plt>
L201:
  cmpl   $0x0,-0x38(%rbp)
  je     L267
  mov    -0x38(%rbp),%eax
  mov    %eax,%esi
  lea    D61(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <show_result@plt>
L267:
  lea    -0x3c(%rbp),%rcx
  mov    -0x48(%rbp),%rax
  mov    $0x3b,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <scan_chr@plt>
  mov    %eax,-0x20(%rbp)
  mov    $0xa,%esi
  mov    $0x7,%edi
  call   <vt_move@plt>
  cmpl   $0x40,-0x20(%rbp)
  je     L142
  cmpl   $0x41,-0x20(%rbp)
  je     L257
  jmp    L76
L142:
  lea    D36(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <show_result@plt>
  jmp    L18
L257:
  lea    D224(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <show_result@plt>
  jmp    L18
L76:
  mov    -0x20(%rbp),%eax
  mov    %eax,%esi
  lea    D14(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <show_result@plt>
L18:
  lea    -0x3c(%rbp),%rcx
  mov    -0x48(%rbp),%rax
  mov    $0x3b,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <scan_chr@plt>
  mov    %eax,-0x34(%rbp)
  mov    $0xa,%esi
  mov    $0x8,%edi
  call   <vt_move@plt>
  mov    -0x34(%rbp),%eax
  and    $0x40,%eax
  test   %eax,%eax
  je     L103
  mov    -0x34(%rbp),%eax
  and    $0x40,%eax
  test   %eax,%eax
  je     L183
  andl   $0xffffffbf,-0x34(%rbp)
  lea    D60(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <show_result@plt>
L183:
  mov    -0x34(%rbp),%eax
  and    $0x8,%eax
  test   %eax,%eax
  je     L151
  andl   $0xfffffff7,-0x34(%rbp)
  lea    D162(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <show_result@plt>
L151:
  mov    -0x34(%rbp),%eax
  and    $0x4,%eax
  test   %eax,%eax
  je     L118
  andl   $0xfffffffb,-0x34(%rbp)
  lea    D1(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <show_result@plt>
L118:
  mov    -0x34(%rbp),%eax
  and    $0x2,%eax
  test   %eax,%eax
  je     L88
  andl   $0xfffffffd,-0x34(%rbp)
  lea    D66(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <show_result@plt>
L88:
  mov    -0x34(%rbp),%eax
  and    $0x1,%eax
  test   %eax,%eax
  je     L61
  andl   $0xfffffffe,-0x34(%rbp)
  lea    D278(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <show_result@plt>
  jmp    L61
L103:
  mov    -0x34(%rbp),%eax
  mov    %eax,%esi
  lea    D194(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <show_result@plt>
L61:
  lea    -0x3c(%rbp),%rcx
  mov    -0x48(%rbp),%rax
  mov    $0x3b,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <scanto@plt>
  mov    %eax,-0x1c(%rbp)
  lea    -0x3c(%rbp),%rcx
  mov    -0x48(%rbp),%rax
  mov    $0x3b,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <scanto@plt>
  mov    %eax,-0x18(%rbp)
  mov    $0xa,%esi
  mov    $0x9,%edi
  call   <vt_move@plt>
  mov    -0x18(%rbp),%edx
  mov    -0x1c(%rbp),%eax
  mov    %eax,%esi
  lea    D157(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <show_result@plt>
  lea    -0x3c(%rbp),%rcx
  mov    -0x48(%rbp),%rax
  mov    $0x3b,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <scan_chr@plt>
  mov    %eax,-0x30(%rbp)
  mov    $0xa,%esi
  mov    $0xa,%edi
  call   <vt_move@plt>
  mov    -0x30(%rbp),%eax
  and    $0x40,%eax
  test   %eax,%eax
  je     L263
  mov    -0x30(%rbp),%eax
  and    $0x40,%eax
  test   %eax,%eax
  je     L178
  andl   $0xffffffbf,-0x30(%rbp)
  lea    D98(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <show_result@plt>
L178:
  mov    -0x30(%rbp),%eax
  and    $0x8,%eax
  test   %eax,%eax
  je     L6
  andl   $0xfffffff7,-0x30(%rbp)
  lea    D186(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <show_result@plt>
L6:
  mov    -0x30(%rbp),%eax
  and    $0x4,%eax
  test   %eax,%eax
  je     L81
  andl   $0xfffffffb,-0x30(%rbp)
  lea    D76(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <show_result@plt>
L81:
  mov    -0x30(%rbp),%eax
  and    $0x2,%eax
  test   %eax,%eax
  je     L69
  andl   $0xfffffffd,-0x30(%rbp)
  lea    D138(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <show_result@plt>
L69:
  mov    -0x30(%rbp),%eax
  and    $0x1,%eax
  test   %eax,%eax
  je     L168
  andl   $0xfffffffe,-0x30(%rbp)
  lea    D9(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <show_result@plt>
  jmp    L168
L263:
  mov    -0x30(%rbp),%eax
  mov    %eax,%esi
  lea    D114(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <show_result@plt>
L168:
  movl   $0xb,-0x14(%rbp)
  mov    -0x14(%rbp),%eax
  mov    $0xa,%esi
  mov    %eax,%edi
  call   <vt_move@plt>
  lea    D256(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <show_result@plt>
  lea    D229(%rip),%rax
  mov    %rax,%rdi
  call   <println@plt>
  jmp    L15
L93:
  lea    -0x3c(%rbp),%rdx
  mov    -0x48(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <parse_Sdesig@plt>
  mov    %rax,-0x10(%rbp)
  mov    -0x10(%rbp),%rax
  mov    %rax,%rsi
  lea    D35(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <show_result@plt>
  lea    D229(%rip),%rax
  mov    %rax,%rdi
  call   <println@plt>
L15:
  mov    -0x3c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L93
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L206
  call   <__stack_chk_fail@plt>
L206:
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: data_label: D269
type_infered: string
name: disassemble_data
arguments: data_label: D244
type_infered: string
name: disassemble_data
arguments: data_label: D41
type_infered: string
name: disassemble_data
arguments: data_label: D197
type_infered: string
name: disassemble_data
arguments: data_label: D260
type_infered: string
name: disassemble_data
arguments: data_label: D211
type_infered: string
name: disassemble_data
arguments: data_label: D4
type_infered: string
name: disassemble_data
arguments: data_label: D61
type_infered: string
name: disassemble_data
arguments: data_label: D36
type_infered: string
name: disassemble_data
arguments: data_label: D224
type_infered: string
name: disassemble_data
arguments: data_label: D14
type_infered: string
name: disassemble_data
arguments: data_label: D60
type_infered: string
name: disassemble_data
arguments: data_label: D162
type_infered: string
name: disassemble_data
arguments: data_label: D1
type_infered: string
name: disassemble_data
arguments: data_label: D66
type_infered: string
name: disassemble_data
arguments: data_label: D278
type_infered: string
name: disassemble_data
arguments: data_label: D194
type_infered: string
name: disassemble_data
arguments: data_label: D157
type_infered: string
name: disassemble_data
arguments: data_label: D98
type_infered: string
name: disassemble_data
arguments: data_label: D186
type_infered: string
name: disassemble_data
arguments: data_label: D76
type_infered: string
name: disassemble_data
arguments: data_label: D138
type_infered: string
name: disassemble_data
arguments: data_label: D9
type_infered: string
name: disassemble_data
arguments: data_label: D114
type_infered: string
name: disassemble_data
arguments: data_label: D256
type_infered: string
name: disassemble_data
arguments: data_label: D229
type_infered: string
name: disassemble_data
arguments: data_label: D35
type_infered: string

tool: D269: Cursor (%d,%d), page %d

tool: D244: Rendition:

tool: D41:  normal

tool: D197:  reverse

tool: D260:  blinking

tool: D211:  underline

tool: D4:  bold

tool: D61:  -> unknown rendition (0x%x)

tool: D36: Selective erase: off

tool: D224: Selective erase: ON

tool: D14: Selective erase: unknown (0x%x)

tool: D60: Flags:

tool: D162:  autowrap pending

tool: D1:  SS3 pending

tool: D66:  SS2 pending

tool: D278:  origin-mode on

tool: D194:  -> unknown flag (0x%x)

tool: D157: Char set in GL: G%d, Char set in GR: G%d

tool: D98: Char set sizes:

tool: D186:  G3 is 96 char

tool: D76:  G2 is 96 char

tool: D138:  G1 is 96 char

tool: D9:  G0 is 96 char

tool: D114:  -> unknown char set size (0x%x)

tool: D256: Character set idents for G0...G3: 

tool: 

tool: D35:             %s


assistant: ```c
void show_DECCIR(char *report) {
  int Pr, Pc, Pp, Srend, Satt, Sflag, Pgl, Pgr, Scss;
  int pos = 3;
  int n;
  Pr = scanto(report, &pos, ';');
  Pc = scanto(report, &pos, ';');
  Pp = scanto(report, &pos, ';');
  vt_move(5, 10);
  show_result("Cursor (%d,%d), page %d", Pr, Pc, Pp);
  Srend = scan_chr(report, &pos, ';');
  vt_move(6, 10);
  if (Srend & 0x40) {
    if (Srend & 0x40) {
      Srend &= ~0x40;
      show_result("Rendition:");
    };
    if (Srend == 0)
      show_result(" normal");
    if (Srend & 0x08) {
      Srend &= ~0x08;
      show_result(" reverse");
    };
    if (Srend & 0x04) {
      Srend &= ~0x04;
      show_result(" blinking");
    };
    if (Srend & 0x02) {
      Srend &= ~0x02;
      show_result(" underline");
    };
    if (Srend & 0x01) {
      Srend &= ~0x01;
      show_result(" bold");
    };
  }
  if (Srend)
    show_result(" -> unknown rendition (0x%x)", Srend);
  Satt = scan_chr(report, &pos, ';');
  vt_move(7, 10);
  switch (Satt) {
  case 0x40:
    show_result("Selective erase: off");
    break;
  case 0x41:
    show_result("Selective erase: ON");
    break;
  default:
    show_result("Selective erase: unknown (0x%x)", Satt);
  }
  Sflag = scan_chr(report, &pos, ';');
  vt_move(8, 10);
  if (Sflag & 0x40) {
    if (Sflag & 0x40) {
      Sflag &= ~0x40;
      show_result("Flags:");
    };
    if (Sflag & 0x08) {
      Sflag &= ~0x08;
      show_result(" autowrap pending");
    };
    if (Sflag & 0x04) {
      Sflag &= ~0x04;
      show_result(" SS3 pending");
    };
    if (Sflag & 0x02) {
      Sflag &= ~0x02;
      show_result(" SS2 pending");
    };
    if (Sflag & 0x01) {
      Sflag &= ~0x01;
      show_result(" origin-mode on");
    };
  } else {
    show_result(" -> unknown flag (0x%x)", Sflag);
  }
  Pgl = scanto(report, &pos, ';');
  Pgr = scanto(report, &pos, ';');
  vt_move(9, 10);
  show_result("Char set in GL: G%d, Char set in GR: G%d", Pgl, Pgr);
  Scss = scan_chr(report, &pos, ';');
  vt_move(10, 10);
  if (Scss & 0x40) {
    if (Scss & 0x40) {
      Scss &= ~0x40;
      show_result("Char set sizes:");
    };
    if (Scss & 0x08) {
      Scss &= ~0x08;
      show_result(" G3 is 96 char");
    };
    if (Scss & 0x04) {
      Scss &= ~0x04;
      show_result(" G2 is 96 char");
    };
    if (Scss & 0x02) {
      Scss &= ~0x02;
      show_result(" G1 is 96 char");
    };
    if (Scss & 0x01) {
      Scss &= ~0x01;
      show_result(" G0 is 96 char");
    };
  } else {
    show_result(" -> unknown char set size (0x%x)", Scss);
  }
  n = 11;
  vt_move(n, 10);
  show_result("Character set idents for G0...G3: ");
  println("");
  while (report[pos] != '\0') {
    const char *result = parse_Sdesig(report, &pos);
    show_result("            %s\n", result);
    println("");
  }
}
```