#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int next_char(int /*<<< orphan*/ *);
int /*<<< orphan*/ send_char(char, int /*<<< orphan*/ *, int);
int translate_char(int);
int translate_char_and_h_suffix(int);
char translate_char_without_h_suffix(int);
int translate_j_and_char(int, int);
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);
  }
}


x86 assembly (clang, -O0):
<do_translation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x1,-0x24(%rbp)
movl   $0x2,-0x28(%rbp)
movl   $0x3,-0x2c(%rbp)
movl   $0x1,-0x30(%rbp)
movl   $0x2,-0x34(%rbp)
movl   $0x0,-0x38(%rbp)
movl   $0x0,-0x3c(%rbp)
movl   $0x0,-0x44(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <next_char@plt>
mov    %eax,-0x40(%rbp)
cmpl   $0x0,-0x40(%rbp)
jge    11d0 <do_translation+0x70>
jmp    147e <do_translation+0x31e>
cmpl   $0x0,-0x38(%rbp)
jne    1379 <do_translation+0x219>
cmpl   $0x0,-0xc(%rbp)
je     1258 <do_translation+0xf8>
cmpl   $0x3b,-0x40(%rbp)
jne    1258 <do_translation+0xf8>
cmpl   $0x2,-0x3c(%rbp)
jne    1214 <do_translation+0xb4>
mov    -0x44(%rbp),%edi
call   1080 <translate_char_without_h_suffix@plt>
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
movsbl %al,%edi
call   1050 <send_char@plt>
jmp    1245 <do_translation+0xe5>
cmpl   $0x1,-0x3c(%rbp)
jne    1240 <do_translation+0xe0>
mov    -0x44(%rbp),%edx
mov    $0x439,%eax
mov    $0x419,%ecx
cmp    $0x4a,%edx
cmove  %ecx,%eax
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
movsbl %al,%edi
call   1050 <send_char@plt>
jmp    1245 <do_translation+0xe5>
movl   $0x0,-0x3c(%rbp)
movl   $0x2,-0x38(%rbp)
jmp    1374 <do_translation+0x214>
movl   $0xffffffff,-0x48(%rbp)
cmpl   $0x1,-0x3c(%rbp)
jne    12a8 <do_translation+0x148>
mov    -0x44(%rbp),%edi
mov    -0x40(%rbp),%esi
call   1070 <translate_j_and_char@plt>
mov    %eax,-0x48(%rbp)
cmpl   $0x0,-0x48(%rbp)
jge    12a3 <do_translation+0x143>
mov    -0x44(%rbp),%edx
mov    $0x439,%eax
mov    $0x419,%ecx
cmp    $0x4a,%edx
cmove  %ecx,%eax
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
movsbl %al,%edi
call   1050 <send_char@plt>
jmp    12f7 <do_translation+0x197>
cmpl   $0x2,-0x3c(%rbp)
jne    12f2 <do_translation+0x192>
cmpl   $0x48,-0x40(%rbp)
je     12c6 <do_translation+0x166>
cmpl   $0x68,-0x40(%rbp)
jne    12d6 <do_translation+0x176>
mov    -0x44(%rbp),%edi
call   1040 <translate_char_and_h_suffix@plt>
mov    %eax,-0x48(%rbp)
jmp    12ed <do_translation+0x18d>
mov    -0x44(%rbp),%edi
call   1080 <translate_char_without_h_suffix@plt>
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
movsbl %al,%edi
call   1050 <send_char@plt>
jmp    12f2 <do_translation+0x192>
jmp    12f7 <do_translation+0x197>
movl   $0x0,-0x3c(%rbp)
cmpl   $0x0,-0x48(%rbp)
jge    1353 <do_translation+0x1f3>
mov    -0x40(%rbp),%edi
call   1060 <translate_char@plt>
mov    %eax,-0x48(%rbp)
cmpl   $0x0,-0x48(%rbp)
jge    134e <do_translation+0x1ee>
cmpl   $0xfffffffe,-0x48(%rbp)
jne    1333 <do_translation+0x1d3>
movl   $0x2,-0x3c(%rbp)
jmp    1349 <do_translation+0x1e9>
cmpl   $0xfffffffd,-0x48(%rbp)
jne    1344 <do_translation+0x1e4>
movl   $0x1,-0x3c(%rbp)
jmp    1349 <do_translation+0x1e9>
jmp    134e <do_translation+0x1ee>
jmp    1353 <do_translation+0x1f3>
cmpl   $0x0,-0x48(%rbp)
jl     136f <do_translation+0x20f>
mov    -0x48(%rbp),%eax
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
movsbl %al,%edi
call   1050 <send_char@plt>
jmp    1374 <do_translation+0x214>
jmp    1467 <do_translation+0x307>
cmpl   $0x1,-0x38(%rbp)
jne    13b7 <do_translation+0x257>
cmpl   $0x3b,-0x40(%rbp)
jne    13a0 <do_translation+0x240>
movl   $0x1,-0x3c(%rbp)
movl   $0x2,-0x38(%rbp)
jmp    13b2 <do_translation+0x252>
mov    -0x40(%rbp),%eax
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
movsbl %al,%edi
call   1050 <send_char@plt>
jmp    1462 <do_translation+0x302>
cmpl   $0x2,-0x38(%rbp)
jne    13f8 <do_translation+0x298>
cmpl   $0x3b,-0x40(%rbp)
jne    13d7 <do_translation+0x277>
movl   $0x3,-0x38(%rbp)
jmp    13f3 <do_translation+0x293>
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
mov    $0x3b,%edi
call   1050 <send_char@plt>
mov    -0x3c(%rbp),%eax
mov    %eax,-0x38(%rbp)
jmp    11c1 <do_translation+0x61>
jmp    145d <do_translation+0x2fd>
cmpl   $0x3,-0x38(%rbp)
jne    1458 <do_translation+0x2f8>
cmpl   $0x3b,-0x40(%rbp)
je     142b <do_translation+0x2cb>
mov    -0x3c(%rbp),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmove  %ecx,%eax
mov    %eax,-0x38(%rbp)
movl   $0x0,-0x3c(%rbp)
jmp    11c1 <do_translation+0x61>
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
mov    $0x3b,%edi
call   1050 <send_char@plt>
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
mov    $0x3b,%edi
call   1050 <send_char@plt>
mov    -0x3c(%rbp),%eax
mov    %eax,-0x38(%rbp)
jmp    1458 <do_translation+0x2f8>
jmp    145d <do_translation+0x2fd>
jmp    1462 <do_translation+0x302>
jmp    1467 <do_translation+0x307>
mov    -0x40(%rbp),%eax
mov    %eax,-0x44(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <next_char@plt>
mov    %eax,-0x40(%rbp)
jmp    11c1 <do_translation+0x61>
cmpl   $0x0,-0x38(%rbp)
jne    14e4 <do_translation+0x384>
cmpl   $0x2,-0x3c(%rbp)
jne    14ae <do_translation+0x34e>
mov    -0x44(%rbp),%edi
call   1080 <translate_char_without_h_suffix@plt>
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
movsbl %al,%edi
call   1050 <send_char@plt>
jmp    14df <do_translation+0x37f>
cmpl   $0x1,-0x3c(%rbp)
jne    14da <do_translation+0x37a>
mov    -0x44(%rbp),%edx
mov    $0x439,%eax
mov    $0x419,%ecx
cmp    $0x4a,%edx
cmove  %ecx,%eax
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
movsbl %al,%edi
call   1050 <send_char@plt>
jmp    14df <do_translation+0x37f>
jmp    1504 <do_translation+0x3a4>
cmpl   $0x2,-0x38(%rbp)
jne    14ff <do_translation+0x39f>
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
mov    $0x3b,%edi
call   1050 <send_char@plt>
jmp    1504 <do_translation+0x3a4>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_translation>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %ecx,%r12d
mov    %rdx,%rbx
mov    %esi,0x8(%rsp)
mov    %rdi,0x10(%rsp)
call   1030 <next_char@plt>
test   %eax,%eax
js     139b <do_translation+0x23b>
xor    %r13d,%r13d
xor    %r15d,%r15d
xor    %r14d,%r14d
jmp    11bb <do_translation+0x5b>
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0x3,%r14d
mov    0x10(%rsp),%rdi
call   1030 <next_char@plt>
mov    %ebp,%r13d
test   %eax,%eax
js     137b <do_translation+0x21b>
mov    %eax,%ebp
mov    %r15d,0xc(%rsp)
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmp    $0x2,%r14d
jne    11f0 <do_translation+0x90>
cmp    $0x3b,%ebp
je     11a0 <do_translation+0x40>
mov    $0x3b,%edi
mov    %rbx,%rsi
mov    %r12d,%edx
call   1050 <send_char@plt>
mov    %r15d,%r14d
jmp    11d0 <do_translation+0x70>
cmp    $0x1,%r14d
je     1220 <do_translation+0xc0>
test   %r14d,%r14d
je     1240 <do_translation+0xe0>
cmp    $0x3b,%ebp
je     134e <do_translation+0x1ee>
xor    %r14d,%r14d
test   %r15d,%r15d
sete   %r14b
xor    %r15d,%r15d
jmp    11d0 <do_translation+0x70>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
cmp    $0x3b,%ebp
jne    126f <do_translation+0x10f>
mov    $0x1,%r15d
mov    $0x2,%r14d
jmp    11a6 <do_translation+0x46>
cs nopw 0x0(%rax,%rax,1)
cmpl   $0x0,0x8(%rsp)
je     1289 <do_translation+0x129>
cmp    $0x3b,%ebp
jne    1289 <do_translation+0x129>
mov    $0x2,%r14d
cmp    $0x1,%r15d
je     12b1 <do_translation+0x151>
cmp    $0x2,%r15d
jne    12ec <do_translation+0x18c>
mov    %r13d,%edi
call   1080 <translate_char_without_h_suffix@plt>
movsbl %al,%edi
jmp    12c1 <do_translation+0x161>
movsbl %bpl,%edi
mov    %rbx,%rsi
mov    %r12d,%edx
call   1050 <send_char@plt>
mov    $0x1,%r14d
jmp    11a6 <do_translation+0x46>
cmp    $0x2,%r15d
je     12d4 <do_translation+0x174>
cmp    $0x1,%r15d
jne    1307 <do_translation+0x1a7>
mov    %r13d,%edi
mov    %ebp,%esi
call   1070 <translate_j_and_char@plt>
test   %eax,%eax
jns    1312 <do_translation+0x1b2>
cmp    $0x4a,%r13d
setne  %al
shl    $0x5,%al
or     $0x19,%al
jmp    12f9 <do_translation+0x199>
xor    %edi,%edi
cmp    $0x4a,%r13d
setne  %dil
shl    $0x5,%edi
or     $0x19,%edi
mov    %rbx,%rsi
mov    %r12d,%edx
call   1050 <send_char@plt>
xor    %r15d,%r15d
jmp    11a6 <do_translation+0x46>
mov    %ebp,%eax
and    $0xffffffdf,%eax
mov    %r13d,%edi
cmp    $0x48,%eax
jne    12f4 <do_translation+0x194>
call   1040 <translate_char_and_h_suffix@plt>
test   %eax,%eax
jns    1312 <do_translation+0x1b2>
jmp    1307 <do_translation+0x1a7>
xor    %r15d,%r15d
jmp    11a6 <do_translation+0x46>
call   1080 <translate_char_without_h_suffix@plt>
movsbl %al,%edi
mov    %rbx,%rsi
mov    %r12d,%edx
call   1050 <send_char@plt>
mov    %ebp,%edi
call   1060 <translate_char@plt>
test   %eax,%eax
js     132b <do_translation+0x1cb>
movsbl %al,%edi
mov    %rbx,%rsi
mov    %r12d,%edx
call   1050 <send_char@plt>
xor    %r14d,%r14d
xor    %r15d,%r15d
jmp    11a6 <do_translation+0x46>
xor    %r14d,%r14d
cmp    $0xfffffffe,%eax
je     1343 <do_translation+0x1e3>
cmp    $0xfffffffd,%eax
jne    1320 <do_translation+0x1c0>
mov    $0x1,%r15d
jmp    11a6 <do_translation+0x46>
mov    $0x2,%r15d
jmp    11a6 <do_translation+0x46>
mov    $0x3b,%edi
mov    %rbx,%rsi
mov    %r12d,%edx
call   1050 <send_char@plt>
mov    $0x3b,%edi
mov    %rbx,%rsi
mov    %r12d,%edx
call   1050 <send_char@plt>
mov    0xc(%rsp),%r15d
mov    %r15d,%r14d
jmp    11a6 <do_translation+0x46>
cmp    $0x2,%r14d
je     13aa <do_translation+0x24a>
test   %r14d,%r14d
jne    139b <do_translation+0x23b>
cmp    $0x1,%r15d
je     13ae <do_translation+0x24e>
cmp    $0x2,%r15d
jne    139b <do_translation+0x23b>
mov    %ebp,%edi
call   1080 <translate_char_without_h_suffix@plt>
jmp    13b9 <do_translation+0x259>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    $0x3b,%al
jmp    13b9 <do_translation+0x259>
cmp    $0x4a,%ebp
setne  %al
shl    $0x5,%al
or     $0x19,%al
movsbl %al,%edi
mov    %rbx,%rsi
mov    %r12d,%edx
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <send_char@plt>

LLVM IR (-O0):
define void @do_translation(i32* %0, i32 %1, i32* %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
store i32* %0, i32** %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store i32 %3, i32* %8
store i32 0, i32* %9
store i32 1, i32* %10
store i32 2, i32* %11
store i32 3, i32* %12
store i32 1, i32* %13
store i32 2, i32* %14
store i32 0, i32* %15
store i32 0, i32* %16
store i32 0, i32* %18
%20 = load i32*, i32** %5
%21 = call i32 @next_char(i32* %20)
store i32 %21, i32* %17
br label %22
22: ; preds = %177, %160, %148, %4
%23 = load i32, i32* %17
%24 = icmp slt i32 %23, 0
br i1 %24, label %25, label %26
25: ; preds = %22
br label %181
26: ; preds = %22
%27 = load i32, i32* %15
%28 = icmp eq i32 %27, 0
br i1 %28, label %29, label %127
29: ; preds = %26
%30 = load i32, i32* %6
%31 = icmp ne i32 %30, 0
br i1 %31, label %32, label %58
32: ; preds = %29
%33 = load i32, i32* %17
%34 = icmp eq i32 %33, 59
br i1 %34, label %35, label %58
35: ; preds = %32
%36 = load i32, i32* %16
%37 = icmp eq i32 %36, 2
br i1 %37, label %38, label %44
38: ; preds = %35
%39 = load i32, i32* %18
%40 = call signext i8 @translate_char_without_h_suffix(i32 %39)
%41 = load i32*, i32** %7
%42 = load i32, i32* %8
%43 = call i32 @send_char(i8 signext %40, i32* %41, i32 %42)
br label %57
44: ; preds = %35
%45 = load i32, i32* %16
%46 = icmp eq i32 %45, 1
br i1 %46, label %47, label %56
47: ; preds = %44
%48 = load i32, i32* %18
%49 = icmp eq i32 %48, 74
%50 = zext i1 %49 to i64
%51 = select i1 %49, i32 1049, i32 1081
%52 = trunc i32 %51 to i8
%53 = load i32*, i32** %7
%54 = load i32, i32* %8
%55 = call i32 @send_char(i8 signext %52, i32* %53, i32 %54)
br label %56
56: ; preds = %47, %44
br label %57
57: ; preds = %56, %38
store i32 0, i32* %16
store i32 2, i32* %15
br label %126
58: ; preds = %32, %29
store i32 -1, i32* %19
%59 = load i32, i32* %16
%60 = icmp eq i32 %59, 1
br i1 %60, label %61, label %77
61: ; preds = %58
%62 = load i32, i32* %18
%63 = load i32, i32* %17
%64 = call i32 @translate_j_and_char(i32 %62, i32 %63)
store i32 %64, i32* %19
%65 = load i32, i32* %19
%66 = icmp slt i32 %65, 0
br i1 %66, label %67, label %76
67: ; preds = %61
%68 = load i32, i32* %18
%69 = icmp eq i32 %68, 74
%70 = zext i1 %69 to i64
%71 = select i1 %69, i32 1049, i32 1081
%72 = trunc i32 %71 to i8
%73 = load i32*, i32** %7
%74 = load i32, i32* %8
%75 = call i32 @send_char(i8 signext %72, i32* %73, i32 %74)
br label %76
76: ; preds = %67, %61
br label %97
77: ; preds = %58
%78 = load i32, i32* %16
%79 = icmp eq i32 %78, 2
br i1 %79, label %80, label %96
80: ; preds = %77
%81 = load i32, i32* %17
%82 = icmp eq i32 %81, 72
br i1 %82, label %86, label %83
83: ; preds = %80
%84 = load i32, i32* %17
%85 = icmp eq i32 %84, 104
br i1 %85, label %86, label %89
86: ; preds = %83, %80
%87 = load i32, i32* %18
%88 = call i32 @translate_char_and_h_suffix(i32 %87)
store i32 %88, i32* %19
br label %95
89: ; preds = %83
%90 = load i32, i32* %18
%91 = call signext i8 @translate_char_without_h_suffix(i32 %90)
%92 = load i32*, i32** %7
%93 = load i32, i32* %8
%94 = call i32 @send_char(i8 signext %91, i32* %92, i32 %93)
br label %95
95: ; preds = %89, %86
br label %96
96: ; preds = %95, %77
br label %97
97: ; preds = %96, %76
store i32 0, i32* %16
%98 = load i32, i32* %19
%99 = icmp slt i32 %98, 0
br i1 %99, label %100, label %116
100: ; preds = %97
%101 = load i32, i32* %17
%102 = call i32 @translate_char(i32 %101)
store i32 %102, i32* %19
%103 = load i32, i32* %19
%104 = icmp slt i32 %103, 0
br i1 %104, label %105, label %115
105: ; preds = %100
%106 = load i32, i32* %19
%107 = icmp eq i32 %106, -2
br i1 %107, label %108, label %109
108: ; preds = %105
store i32 2, i32* %16
br label %114
109: ; preds = %105
%110 = load i32, i32* %19
%111 = icmp eq i32 %110, -3
br i1 %111, label %112, label %113
112: ; preds = %109
store i32 1, i32* %16
br label %113
113: ; preds = %112, %109
br label %114
114: ; preds = %113, %108
br label %115
115: ; preds = %114, %100
br label %116
116: ; preds = %115, %97
%117 = load i32, i32* %19
%118 = icmp sge i32 %117, 0
br i1 %118, label %119, label %125
119: ; preds = %116
%120 = load i32, i32* %19
%121 = trunc i32 %120 to i8
%122 = load i32*, i32** %7
%123 = load i32, i32* %8
%124 = call i32 @send_char(i8 signext %121, i32* %122, i32 %123)
br label %125
125: ; preds = %119, %116
br label %126
126: ; preds = %125, %57
br label %177
127: ; preds = %26
%128 = load i32, i32* %15
%129 = icmp eq i32 %128, 1
br i1 %129, label %130, label %141
130: ; preds = %127
%131 = load i32, i32* %17
%132 = icmp eq i32 %131, 59
br i1 %132, label %133, label %134
133: ; preds = %130
store i32 1, i32* %16
store i32 2, i32* %15
br label %140
134: ; preds = %130
%135 = load i32, i32* %17
%136 = trunc i32 %135 to i8
%137 = load i32*, i32** %7
%138 = load i32, i32* %8
%139 = call i32 @send_char(i8 signext %136, i32* %137, i32 %138)
br label %140
140: ; preds = %134, %133
br label %176
141: ; preds = %127
%142 = load i32, i32* %15
%143 = icmp eq i32 %142, 2
br i1 %143, label %144, label %154
144: ; preds = %141
%145 = load i32, i32* %17
%146 = icmp eq i32 %145, 59
br i1 %146, label %147, label %148
147: ; preds = %144
store i32 3, i32* %15
br label %153
148: ; preds = %144
%149 = load i32*, i32** %7
%150 = load i32, i32* %8
%151 = call i32 @send_char(i8 signext 59, i32* %149, i32 %150)
%152 = load i32, i32* %16
store i32 %152, i32* %15
br label %22
153: ; preds = %147
br label %175
154: ; preds = %141
%155 = load i32, i32* %15
%156 = icmp eq i32 %155, 3
br i1 %156, label %157, label %174
157: ; preds = %154
%158 = load i32, i32* %17
%159 = icmp ne i32 %158, 59
br i1 %159, label %160, label %165
160: ; preds = %157
%161 = load i32, i32* %16
%162 = icmp eq i32 %161, 0
%163 = zext i1 %162 to i64
%164 = select i1 %162, i32 1, i32 0
store i32 %164, i32* %15
store i32 0, i32* %16
br label %22
165: ; preds = %157
%166 = load i32*, i32** %7
%167 = load i32, i32* %8
%168 = call i32 @send_char(i8 signext 59, i32* %166, i32 %167)
%169 = load i32*, i32** %7
%170 = load i32, i32* %8
%171 = call i32 @send_char(i8 signext 59, i32* %169, i32 %170)
%172 = load i32, i32* %16
store i32 %172, i32* %15
br label %173
173: ; preds = %165
br label %174
174: ; preds = %173, %154
br label %175
175: ; preds = %174, %153
br label %176
176: ; preds = %175, %140
br label %177
177: ; preds = %176, %126
%178 = load i32, i32* %17
store i32 %178, i32* %18
%179 = load i32*, i32** %5
%180 = call i32 @next_char(i32* %179)
store i32 %180, i32* %17
br label %22
181: ; preds = %25
%182 = load i32, i32* %15
%183 = icmp eq i32 %182, 0
br i1 %183, label %184, label %207
184: ; preds = %181
%185 = load i32, i32* %16
%186 = icmp eq i32 %185, 2
br i1 %186, label %187, label %193
187: ; preds = %184
%188 = load i32, i32* %18
%189 = call signext i8 @translate_char_without_h_suffix(i32 %188)
%190 = load i32*, i32** %7
%191 = load i32, i32* %8
%192 = call i32 @send_char(i8 signext %189, i32* %190, i32 %191)
br label %206
193: ; preds = %184
%194 = load i32, i32* %16
%195 = icmp eq i32 %194, 1
br i1 %195, label %196, label %205
196: ; preds = %193
%197 = load i32, i32* %18
%198 = icmp eq i32 %197, 74
%199 = zext i1 %198 to i64
%200 = select i1 %198, i32 1049, i32 1081
%201 = trunc i32 %200 to i8
%202 = load i32*, i32** %7
%203 = load i32, i32* %8
%204 = call i32 @send_char(i8 signext %201, i32* %202, i32 %203)
br label %205
205: ; preds = %196, %193
br label %206
206: ; preds = %205, %187
br label %215
207: ; preds = %181
%208 = load i32, i32* %15
%209 = icmp eq i32 %208, 2
br i1 %209, label %210, label %214
210: ; preds = %207
%211 = load i32*, i32** %7
%212 = load i32, i32* %8
%213 = call i32 @send_char(i8 signext 59, i32* %211, i32 %212)
br label %214
214: ; preds = %210, %207
br label %215
215: ; preds = %214, %206
ret void
}

LLVM IR (-O2):
define void @do_translation(i32* %0, i32 %1, i32* %2, i32 %3) {
%5 = tail call i32 @next_char(i32* %0)
%6 = icmp slt i32 %5, 0
br i1 %6, label %87, label %7
7: ; preds = %4
%8 = icmp ne i32 %1, 0
br label %9
9: ; preds = %7, %72
%10 = phi i32 [ 0, %7 ], [ %11, %72 ]
%11 = phi i32 [ %5, %7 ], [ %75, %72 ]
%12 = phi i32 [ 0, %7 ], [ %74, %72 ]
%13 = phi i32 [ 0, %7 ], [ %73, %72 ]
%14 = icmp eq i32 %11, 59
br label %15
15: ; preds = %66, %9
%16 = phi i32 [ %12, %9 ], [ 0, %66 ]
%17 = phi i32 [ %13, %9 ], [ %68, %66 ]
br label %18
18: ; preds = %63, %15
%19 = phi i32 [ %17, %15 ], [ %16, %63 ]
switch i32 %19, label %65 [
i32 0, label %20
i32 1, label %58
i32 2, label %62
]
20: ; preds = %18
%21 = select i1 %8, i1 %14, i1 false
br i1 %21, label %22, label %30
22: ; preds = %20
switch i32 %16, label %72 [
i32 2, label %23
i32 1, label %26
]
23: ; preds = %22
%24 = tail call signext i8 @translate_char_without_h_suffix(i32 %10)
%25 = tail call i32 @send_char(i8 signext %24, i32* %2, i32 %3)
br label %72
26: ; preds = %22
%27 = icmp eq i32 %10, 74
%28 = select i1 %27, i8 25, i8 57
%29 = tail call i32 @send_char(i8 signext %28, i32* %2, i32 %3)
br label %72
30: ; preds = %20
switch i32 %16, label %48 [
i32 1, label %31
i32 2, label %37
]
31: ; preds = %30
%32 = tail call i32 @translate_j_and_char(i32 %10, i32 %11)
%33 = icmp slt i32 %32, 0
br i1 %33, label %34, label %54
34: ; preds = %31
%35 = icmp eq i32 %10, 74
%36 = select i1 %35, i8 25, i8 57
br label %45
37: ; preds = %30
%38 = and i32 %11, -33
%39 = icmp eq i32 %38, 72
br i1 %39, label %42, label %40
40: ; preds = %37
%41 = tail call signext i8 @translate_char_without_h_suffix(i32 %10)
br label %45
42: ; preds = %37
%43 = tail call i32 @translate_char_and_h_suffix(i32 %10)
%44 = icmp slt i32 %43, 0
br i1 %44, label %48, label %54
45: ; preds = %34, %40
%46 = phi i8 [ %41, %40 ], [ %36, %34 ]
%47 = tail call i32 @send_char(i8 signext %46, i32* %2, i32 %3)
br label %48
48: ; preds = %45, %30, %42
%49 = tail call i32 @translate_char(i32 %11)
%50 = icmp slt i32 %49, 0
br i1 %50, label %51, label %54
51: ; preds = %48
switch i32 %49, label %53 [
i32 -2, label %72
i32 -3, label %52
]
52: ; preds = %51
br label %72
53: ; preds = %51
br label %72
54: ; preds = %31, %48, %42
%55 = phi i32 [ %43, %42 ], [ %49, %48 ], [ %32, %31 ]
%56 = trunc i32 %55 to i8
%57 = tail call i32 @send_char(i8 signext %56, i32* %2, i32 %3)
br label %72
58: ; preds = %18
br i1 %14, label %72, label %59
59: ; preds = %58
%60 = trunc i32 %11 to i8
%61 = tail call i32 @send_char(i8 signext %60, i32* %2, i32 %3)
br label %72
62: ; preds = %18
br i1 %14, label %72, label %63
63: ; preds = %62
%64 = tail call i32 @send_char(i8 signext 59, i32* %2, i32 %3)
br label %18
65: ; preds = %18
br i1 %14, label %69, label %66
66: ; preds = %65
%67 = icmp eq i32 %16, 0
%68 = zext i1 %67 to i32
br label %15
69: ; preds = %65
%70 = tail call i32 @send_char(i8 signext 59, i32* %2, i32 %3)
%71 = tail call i32 @send_char(i8 signext 59, i32* %2, i32 %3)
br label %72
72: ; preds = %62, %52, %53, %51, %58, %54, %23, %26, %22, %59, %69
%73 = phi i32 [ 1, %59 ], [ %12, %69 ], [ 2, %22 ], [ 2, %26 ], [ 2, %23 ], [ 0, %54 ], [ 2, %58 ], [ 0, %51 ], [ 0, %53 ], [ 0, %52 ], [ 3, %62 ]
%74 = phi i32 [ %16, %59 ], [ %12, %69 ], [ 0, %22 ], [ 0, %26 ], [ 0, %23 ], [ 0, %54 ], [ 1, %58 ], [ 2, %51 ], [ 0, %53 ], [ 1, %52 ], [ %16, %62 ]
%75 = tail call i32 @next_char(i32* %0)
%76 = icmp slt i32 %75, 0
br i1 %76, label %77, label %9
77: ; preds = %72
switch i32 %73, label %87 [
i32 0, label %78
i32 2, label %84
]
78: ; preds = %77
switch i32 %74, label %87 [
i32 2, label %79
i32 1, label %81
]
79: ; preds = %78
%80 = tail call signext i8 @translate_char_without_h_suffix(i32 %11)
br label %84
81: ; preds = %78
%82 = icmp eq i32 %11, 74
%83 = select i1 %82, i8 25, i8 57
br label %84
84: ; preds = %77, %81, %79
%85 = phi i8 [ %80, %79 ], [ %83, %81 ], [ 59, %77 ]
%86 = tail call i32 @send_char(i8 signext %85, i32* %2, i32 %3)
br label %87
87: ; preds = %84, %4, %77, %78
ret void
}