user: 请将以下的汇编代码转换成C语言代码：

```asm
<do_translation>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %esi,-0x3c(%rbp)
  mov    %rdx,-0x48(%rbp)
  mov    %ecx,-0x40(%rbp)
  movl   $0x0,-0x18(%rbp)
  movl   $0x1,-0x14(%rbp)
  movl   $0x2,-0x10(%rbp)
  movl   $0x3,-0xc(%rbp)
  movl   $0x1,-0x8(%rbp)
  movl   $0x2,-0x4(%rbp)
  mov    -0x18(%rbp),%eax
  mov    %eax,-0x2c(%rbp)
  mov    -0x18(%rbp),%eax
  mov    %eax,-0x28(%rbp)
  movl   $0x0,-0x20(%rbp)
  mov    -0x38(%rbp),%rax
  mov    %rax,%rdi
  call   <next_char@plt>
  mov    %eax,-0x24(%rbp)
L280:
  cmpl   $0x0,-0x24(%rbp)
  js     L40
  mov    -0x2c(%rbp),%eax
  cmp    -0x18(%rbp),%eax
  jne    L131
  cmpl   $0x0,-0x3c(%rbp)
  je     L359
  cmpl   $0x3b,-0x24(%rbp)
  jne    L359
  mov    -0x28(%rbp),%eax
  cmp    -0x4(%rbp),%eax
  jne    L342
  mov    -0x20(%rbp),%eax
  mov    %eax,%edi
  call   <translate_char_without_h_suffix@plt>
  movsbl %al,%eax
  mov    -0x40(%rbp),%edx
  mov    -0x48(%rbp),%rcx
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <send_char@plt>
  jmp    L346
L342:
  mov    -0x28(%rbp),%eax
  cmp    -0x8(%rbp),%eax
  jne    L346
  cmpl   $0x4a,-0x20(%rbp)
  jne    L115
  mov    $0x19,%ecx
  jmp    L139
L115:
  mov    $0x39,%ecx
L139:
  mov    -0x40(%rbp),%edx
  mov    -0x48(%rbp),%rax
  mov    %rax,%rsi
  mov    %ecx,%edi
  call   <send_char@plt>
L346:
  mov    -0x18(%rbp),%eax
  mov    %eax,-0x28(%rbp)
  mov    -0x10(%rbp),%eax
  mov    %eax,-0x2c(%rbp)
  jmp    L142
L359:
  movl   $0xffffffff,-0x1c(%rbp)
  mov    -0x28(%rbp),%eax
  cmp    -0x8(%rbp),%eax
  jne    L315
  mov    -0x24(%rbp),%edx
  mov    -0x20(%rbp),%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <translate_j_and_char@plt>
  mov    %eax,-0x1c(%rbp)
  cmpl   $0x0,-0x1c(%rbp)
  jns    L203
  cmpl   $0x4a,-0x20(%rbp)
  jne    L56
  mov    $0x19,%ecx
  jmp    L178
L56:
  mov    $0x39,%ecx
L178:
  mov    -0x40(%rbp),%edx
  mov    -0x48(%rbp),%rax
  mov    %rax,%rsi
  mov    %ecx,%edi
  call   <send_char@plt>
  jmp    L203
L315:
  mov    -0x28(%rbp),%eax
  cmp    -0x4(%rbp),%eax
  jne    L203
  cmpl   $0x48,-0x24(%rbp)
  je     L200
  cmpl   $0x68,-0x24(%rbp)
  jne    L162
L200:
  mov    -0x20(%rbp),%eax
  mov    %eax,%edi
  call   <translate_char_and_h_suffix@plt>
  mov    %eax,-0x1c(%rbp)
  jmp    L203
L162:
  mov    -0x20(%rbp),%eax
  mov    %eax,%edi
  call   <translate_char_without_h_suffix@plt>
  movsbl %al,%eax
  mov    -0x40(%rbp),%edx
  mov    -0x48(%rbp),%rcx
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <send_char@plt>
L203:
  mov    -0x18(%rbp),%eax
  mov    %eax,-0x28(%rbp)
  cmpl   $0x0,-0x1c(%rbp)
  jns    L335
  mov    -0x24(%rbp),%eax
  mov    %eax,%edi
  call   <translate_char@plt>
  mov    %eax,-0x1c(%rbp)
  cmpl   $0x0,-0x1c(%rbp)
  jns    L335
  cmpl   $0xfffffffe,-0x1c(%rbp)
  jne    L242
  mov    -0x4(%rbp),%eax
  mov    %eax,-0x28(%rbp)
  jmp    L335
L242:
  cmpl   $0xfffffffd,-0x1c(%rbp)
  jne    L335
  mov    -0x8(%rbp),%eax
  mov    %eax,-0x28(%rbp)
L335:
  cmpl   $0x0,-0x1c(%rbp)
  js     L142
  mov    -0x1c(%rbp),%eax
  movsbl %al,%eax
  mov    -0x40(%rbp),%edx
  mov    -0x48(%rbp),%rcx
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <send_char@plt>
  jmp    L142
L131:
  mov    -0x2c(%rbp),%eax
  cmp    -0x14(%rbp),%eax
  jne    L197
  cmpl   $0x3b,-0x24(%rbp)
  jne    L193
  mov    -0x14(%rbp),%eax
  mov    %eax,-0x28(%rbp)
  mov    -0x10(%rbp),%eax
  mov    %eax,-0x2c(%rbp)
  jmp    L142
L193:
  mov    -0x24(%rbp),%eax
  movsbl %al,%eax
  mov    -0x40(%rbp),%edx
  mov    -0x48(%rbp),%rcx
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <send_char@plt>
  jmp    L142
L197:
  mov    -0x2c(%rbp),%eax
  cmp    -0x10(%rbp),%eax
  jne    L253
  cmpl   $0x3b,-0x24(%rbp)
  jne    L90
  mov    -0xc(%rbp),%eax
  mov    %eax,-0x2c(%rbp)
  jmp    L142
L90:
  mov    -0x40(%rbp),%edx
  mov    -0x48(%rbp),%rax
  mov    %rax,%rsi
  mov    $0x3b,%edi
  call   <send_char@plt>
  mov    -0x28(%rbp),%eax
  mov    %eax,-0x2c(%rbp)
  jmp    L282
L253:
  mov    -0x2c(%rbp),%eax
  cmp    -0xc(%rbp),%eax
  jne    L142
  cmpl   $0x3b,-0x24(%rbp)
  je     L235
  mov    -0x28(%rbp),%eax
  cmp    -0x18(%rbp),%eax
  jne    L81
  mov    -0x14(%rbp),%eax
  jmp    L453
L81:
  mov    -0x18(%rbp),%eax
L453:
  mov    %eax,-0x2c(%rbp)
  mov    -0x18(%rbp),%eax
  mov    %eax,-0x28(%rbp)
  jmp    L282
L235:
  mov    -0x40(%rbp),%edx
  mov    -0x48(%rbp),%rax
  mov    %rax,%rsi
  mov    $0x3b,%edi
  call   <send_char@plt>
  mov    -0x40(%rbp),%edx
  mov    -0x48(%rbp),%rax
  mov    %rax,%rsi
  mov    $0x3b,%edi
  call   <send_char@plt>
  mov    -0x28(%rbp),%eax
  mov    %eax,-0x2c(%rbp)
L142:
  mov    -0x24(%rbp),%eax
  mov    %eax,-0x20(%rbp)
  mov    -0x38(%rbp),%rax
  mov    %rax,%rdi
  call   <next_char@plt>
  mov    %eax,-0x24(%rbp)
L282:
  jmp    L280
L40:
  nop
  mov    -0x2c(%rbp),%eax
  cmp    -0x18(%rbp),%eax
  jne    L257
  mov    -0x28(%rbp),%eax
  cmp    -0x4(%rbp),%eax
  jne    L121
  mov    -0x20(%rbp),%eax
  mov    %eax,%edi
  call   <translate_char_without_h_suffix@plt>
  movsbl %al,%eax
  mov    -0x40(%rbp),%edx
  mov    -0x48(%rbp),%rcx
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <send_char@plt>
  jmp    L439
L121:
  mov    -0x28(%rbp),%eax
  cmp    -0x8(%rbp),%eax
  jne    L439
  cmpl   $0x4a,-0x20(%rbp)
  jne    L375
  mov    $0x19,%ecx
  jmp    L66
L375:
  mov    $0x39,%ecx
L66:
  mov    -0x40(%rbp),%edx
  mov    -0x48(%rbp),%rax
  mov    %rax,%rsi
  mov    %ecx,%edi
  call   <send_char@plt>
  jmp    L439
L257:
  mov    -0x2c(%rbp),%eax
  cmp    -0x10(%rbp),%eax
  jne    L439
  mov    -0x40(%rbp),%edx
  mov    -0x48(%rbp),%rax
  mov    %rax,%rsi
  mov    $0x3b,%edi
  call   <send_char@plt>
L439:
  nop
  leave
  ret
```

assistant: ```c
void do_translation(FILE *input_stream, int with_latin_escapes, FILE *output_stream, int output_encoding) {
  const int NORMAL = 0;
  const int AS_IS = 1;
  const int AFTER_SWITCH_CHAR = 2;
  const int AFTER_2_SWITCH_CHARS = 3;
  const int AFTER_J_PREFIX = 1;
  const int BEFORE_H_SUFFIX = 2;
  int state = NORMAL, substate = NORMAL;
  int c, prev_c = 0;
  c = next_char(input_stream);
  for (;;) {
    if (c < 0) {
      break;
    }
    if (state == NORMAL) {
      if (with_latin_escapes && c == ';') {
        if (substate == BEFORE_H_SUFFIX) {
          send_char((translate_char_without_h_suffix(prev_c)), output_stream, output_encoding);
        } else if (substate == AFTER_J_PREFIX) {
          send_char((prev_c == 'J' ? 0x419 : 0x439), output_stream, output_encoding);
        }
        substate = NORMAL;
        state = AFTER_SWITCH_CHAR;
      } else {
        int translated = -1;
        if (substate == AFTER_J_PREFIX) {
          translated = translate_j_and_char(prev_c, c);
          if (translated < 0) {
            send_char((prev_c == 'J' ? 0x419 : 0x439), output_stream, output_encoding);
          }
        } else if (substate == BEFORE_H_SUFFIX) {
          if (c == 'H' || c == 'h') {
            translated = translate_char_and_h_suffix(prev_c);
          } else {
            send_char((translate_char_without_h_suffix(prev_c)), output_stream, output_encoding);
          }
        }
        substate = NORMAL;
        if (translated < 0) {
          translated = translate_char(c);
          if (translated < 0) {
            if (translated == -2) {
              substate = BEFORE_H_SUFFIX;
            } else if (translated == -3) {
              substate = AFTER_J_PREFIX;
            }
          }
        }
        if (translated >= 0) {
          send_char((translated), output_stream, output_encoding);
        }
      }
    } else if (state == AS_IS) {
      if (c == ';') {
        substate = AS_IS;
        state = AFTER_SWITCH_CHAR;
      } else {
        send_char((c), output_stream, output_encoding);
      }
    } else if (state == AFTER_SWITCH_CHAR) {
      if (c == ';') {
        state = AFTER_2_SWITCH_CHARS;
      } else {
        send_char((';'), output_stream, output_encoding);
        state = substate;
        continue;
      }
    } else if (state == AFTER_2_SWITCH_CHARS) {
      if (c != ';') {
        state = (substate == NORMAL) ? AS_IS : NORMAL;
        substate = NORMAL;
        continue;
      } else {
        send_char((';'), output_stream, output_encoding);
        send_char((';'), output_stream, output_encoding);
        state = substate;
      }
    }
    prev_c = c;
    c = next_char(input_stream);
  }
  if (state == NORMAL) {
    if (substate == BEFORE_H_SUFFIX) {
      send_char((translate_char_without_h_suffix(prev_c)), output_stream, output_encoding);
    } else if (substate == AFTER_J_PREFIX) {
      send_char((prev_c == 'J' ? 0x419 : 0x439), output_stream, output_encoding);
    }
  } else if (state == AFTER_SWITCH_CHAR) {
    send_char((';'), output_stream, output_encoding);
  }
}
```