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

```asm
<video_all_stat_to_line_stat>:
  endbr64
  mov    %esi,%eax
  mov    %esi,%edx
  shr    $0x2,%edx
  xor    $0x1,%edx
  mov    %esi,%ecx
  shr    $0x6,%ecx
  and    %edx,%ecx
  and    $0x1,%ecx
  mov    %esi,%r8d
  and    $0x80,%r8d
  jne    L56
  cmp    $0xbf,%edi
  jg     L31
  mov    %esi,%r9d
  sar    %r9d
  and    $0x1,%r9d
  and    $0x1,%esi
  jne    L107
  test   $0x10,%al
  je     L108
  cmp    $0x9f,%edi
  jle    L108
L107:
  mov    %eax,%esi
  sar    $0x12,%esi
  mov    %eax,%edx
  sar    $0xe,%edx
  and    $0xf,%edx
  mov    %eax,%edi
  sar    $0xa,%edi
  and    $0xf,%edi
  and    $0x1,%esi
  jne    L51
  sar    $0x13,%eax
  and    $0x1,%eax
  mov    %esi,%r8d
  mov    $0x1,%r10d
  jmp    L47
L108:
  mov    %eax,%r8d
  sar    $0x3,%r8d
  mov    %eax,%edx
  shr    $0x9,%edx
  xor    $0x1,%edx
  test   %r9d,%r9d
  setne  %r9b
  movzbl %r9b,%r9d
  and    %edx,%r9d
  mov    %eax,%edx
  and    $0x100,%edx
  jne    L112
  and    $0x1,%r8d
  mov    %edx,%eax
  mov    %edx,%edi
  mov    %edx,%esi
  mov    $0x2,%r10d
  jmp    L47
L112:
  sar    $0x5,%eax
  or     %r8d,%eax
  and    $0x1,%eax
  mov    %eax,%r8d
  mov    %esi,%eax
  mov    %esi,%edi
  mov    %esi,%edx
  mov    $0x3,%r10d
  jmp    L47
L56:
  mov    $0x4,%r10d
  mov    $0x0,%eax
  mov    $0x0,%edi
  mov    $0x0,%edx
  mov    $0x0,%esi
  mov    $0x0,%r9d
  mov    $0x0,%r8d
  mov    $0x0,%ecx
L47:
  shl    $0xc,%edx
  shl    $0x8,%edi
  add    %edi,%edx
  shl    $0x7,%esi
  add    %esi,%edx
  mov    %r10d,%esi
  shl    $0x4,%esi
  add    %esi,%edx
  lea    (%rdx,%rax,8),%eax
  lea    (%rax,%rcx,4),%eax
  lea    (%rax,%r8,2),%eax
  add    %r9d,%eax
  ret
L31:
  mov    %r8d,%r10d
  mov    %r8d,%eax
  mov    %r8d,%edi
  mov    %r8d,%edx
  mov    %r8d,%esi
  mov    %r8d,%r9d
  mov    %r8d,%ecx
  jmp    L47
L51:
  mov    %esi,%r10d
  mov    %r8d,%eax
  jmp    L47
```

assistant: ```c
int video_all_stat_to_line_stat(int line, int new_all_stat) {
  int page, color, dbl;
  int st80, hires, annunc3, mix_t_gr;
  int altchar, text_color, bg_color, flash_state;
  int mode;
  st80 = new_all_stat & (1 << (2));
  hires = new_all_stat & (1 << (8));
  annunc3 = new_all_stat & (1 << (9));
  mix_t_gr = new_all_stat & (1 << (4));
  page = (((1) >= (31 - 6) + 1) ? ((new_all_stat) >> (31 - (31 - 6))) : (((new_all_stat) >> (31 - (31 - 6))) & ((1 << (1)) - 1))) && !st80;
  color = (((1) >= (31 - 3) + 1) ? ((new_all_stat) >> (31 - (31 - 3))) : (((new_all_stat) >> (31 - (31 - 3))) & ((1 << (1)) - 1)));
  dbl = (((1) >= (31 - 1) + 1) ? ((new_all_stat) >> (31 - (31 - 1))) : (((new_all_stat) >> (31 - (31 - 1))) & ((1 << (1)) - 1)));
  altchar = 0;
  text_color = 0;
  bg_color = 0;
  flash_state = 0;
  if (new_all_stat & (1 << (7))) {
    mode = 4;
    page = 0;
    dbl = 0;
    color = 0;
  } else {
    if (line >= 192) {
      mode = 0;
      page = 0;
      dbl = 0;
      color = 0;
    } else if ((new_all_stat & (1 << (0))) || (line >= 160 && mix_t_gr)) {
      mode = 1;
      color = 0;
      altchar = (((1) >= (31 - 18) + 1) ? ((new_all_stat) >> (31 - (31 - 18))) : (((new_all_stat) >> (31 - (31 - 18))) & ((1 << (1)) - 1)));
      text_color = (((4) >= (31 - 14) + 1) ? ((new_all_stat) >> (31 - (31 - 14))) : (((new_all_stat) >> (31 - (31 - 14))) & ((1 << (4)) - 1)));
      bg_color = (((4) >= (31 - 10) + 1) ? ((new_all_stat) >> (31 - (31 - 10))) : (((new_all_stat) >> (31 - (31 - 10))) & ((1 << (4)) - 1)));
      flash_state = (((1) >= (31 - 19) + 1) ? ((new_all_stat) >> (31 - (31 - 19))) : (((new_all_stat) >> (31 - (31 - 19))) & ((1 << (1)) - 1)));
      if (altchar) {
        flash_state = 0;
      }
    } else {
      dbl = dbl && !annunc3;
      if (hires) {
        color = color | (((1) >= (31 - 5) + 1) ? ((new_all_stat) >> (31 - (31 - 5))) : (((new_all_stat) >> (31 - (31 - 5))) & ((1 << (1)) - 1)));
        mode = 3;
      } else {
        mode = 2;
      }
    }
  }
  return ((text_color << 12) + (bg_color << 8) + (altchar << 7) + (mode << 4) + (flash_state << 3) + (page << 2) + (color << 1) + dbl);
}
```