// File: /workspace/github_c_makefile_star2_O2/mloar[P]charset/iso2022.c
// Function: read_iso2022
static void read_iso2022(charset_spec const *charset, long int input_chr,
			 charset_state *state,
			 void (*emit)(void *ctx, long int output),
			 void *emitctx)
{
    struct iso2022_mode const *mode = (struct iso2022_mode *)charset->data;

    /* dump_state(state); */
    /*
     * We have to make fairly efficient use of the 64 bits of state
     * available to us.  Long-term state goes in s1, and consists of
     * the identities of the character sets designated as G0/G1/G2/G3
     * and the locking-shift states for GL and GR.  Short-term state
     * goes in s0: The bottom half of s0 accumulates characters for an
     * escape sequence or a multi-byte character, while the top three
     * bits indicate what they're being accumulated for.  After DOCS,
     * the bottom 29 bits of state are available for the DOCS function
     * to use -- the UTF-8 one uses the bottom 26 for UTF-8 decoding
     * and the top two to recognised ESC % @.
     *
     * s0[31:29] = state enum
     * s0[24:0] = accumulated bytes
     * s1[31:30] = GL locking-shift state
     * s1[29:28] = GR locking-shift state
     * s1[27:21] = G3 charset
     * s1[20:14] = G2 charset
     * s1[13:7] = G1 charset
     * s1[6:0] = G0 charset
     */

#define LEFT 30
#define RIGHT 28
#define LOCKING_SHIFT(n,side) \
	(state->s1 = (state->s1 & ~(3UL<<(side))) | ((n ## UL)<<(side)))
#define MODE ((state->s0 & 0xe0000000UL) >> 29)
#define ENTER_MODE(m) (state->s0 = (state->s0 & ~0xe0000000UL) | ((unsigned long)(m)<<29))
#define SINGLE_SHIFT(n) ENTER_MODE(SS2CHAR - 2 + (n))
#define ASSERT_IDLE do {						\
	if (state->s0 != 0) emit(emitctx, ERROR);			\
	state->s0 = 0;							\
} while (0)

    if (state->s1 == 0) {
	/*
	 * Since there's no LS0R, this means we must just have started.
	 * Set up a sane initial state (LS0, LS1R, ASCII in G0/G1/G2/G3).
	 */
	LOCKING_SHIFT(0, LEFT);
	LOCKING_SHIFT(1, RIGHT);
	designate(state, 0, mode->ltype, mode->li, mode->lf);
	designate(state, 1, mode->rtype, mode->ri, mode->rf);
	designate(state, 2, S4, 0, 'B');
	designate(state, 3, S4, 0, 'B');
    }

    if (MODE == DOCSUTF8) {
	docs_utf8(input_chr, state, emit, emitctx);
	return;
    }
    if (MODE == DOCSCTEXT) {
	docs_ctext(input_chr, state, emit, emitctx);
	return;
    }

    if ((input_chr & 0x60) == 0x00) {
	/* C0 or C1 control */
	ASSERT_IDLE;
	switch (input_chr) {
	  case ESC:
	    ENTER_MODE(ESCSEQ);
	    break;
	  case LS0:
	    LOCKING_SHIFT(0, LEFT);
	    break;
	  case LS1:
	    LOCKING_SHIFT(1, LEFT);
	    break;
	  case SS2:
	    SINGLE_SHIFT(2);
	    break;
	  case SS3:
	    SINGLE_SHIFT(3);
	    break;
	  default:
	    emit(emitctx, input_chr);
	    break;
	}
    } else if ((input_chr & 0x80) || MODE < ESCSEQ) {
	int is_gl = 0;
	struct iso2022_subcharset const *subcs;
	unsigned container;
	long input_7bit;
	/*
	 * Actual data.
	 * Force idle state if we're in mid escape sequence, or in a
	 * multi-byte character with a different top bit.
	 */
	if (MODE >= ESCSEQ ||
	    ((state->s0 & 0x00ff0000L) != 0 && 
	     (((state->s0 >> 16) ^ input_chr) & 0x80)))
	    ASSERT_IDLE;
	if (MODE == SS2CHAR || MODE == SS3CHAR) /* Single-shift */
	    container = MODE - SS2CHAR + 2;
	else if (input_chr >= 0x80) /* GR */
	    container = (state->s1 >> 28) & 3;
	else { /* GL */
	    container = state->s1 >> 30;
	    is_gl = 1;
	}
	input_7bit = input_chr & ~0x80;
	subcs = &iso2022_subcharsets[(state->s1 >> (container * 7)) & 0x7f];
	if ((subcs->type == S4 || subcs->type == M4) &&
	    (input_7bit == 0x20 || input_7bit == 0x7f)) {
	    /* characters not in 94-char set */
	    if (is_gl) emit(emitctx, input_7bit);
	    else emit(emitctx, ERROR);
	} else if (subcs->type == M4 || subcs->type == M6) {
	    if ((state->s0 & 0x00ff0000L) == 0) {
		state->s0 |= input_chr << 16;
		return;
	    } else {
		emit(emitctx,
		     subcs->from_dbcs(((state->s0 >> 16) & 0x7f) +
				      subcs->offset,
				      input_7bit + subcs->offset));
	    }
	} else {
	    if ((state->s0 & 0x00ff0000L) != 0)
		emit(emitctx, ERROR);
	    emit(emitctx, subcs->sbcs_base ?
		 sbcs_to_unicode(subcs->sbcs_base, input_7bit + subcs->offset):
		 ERROR);
	}
	state->s0 = 0;
    } else {
	unsigned i1, i2;
	if (MODE == ESCPASS) {
	    emit(emitctx, input_chr);
	    if ((input_chr & 0xf0) != 0x20)
		ENTER_MODE(IDLE);
	    return;
	}

	/*
	 * Intermediate bytes shall be any of the 16 positions of
	 * column 02 of the code table; they are denoted by the symbol
	 * I.
	 */
	if ((input_chr & 0xf0) == 0x20) {
	    if (((state->s0 >> 16) & 0xff) == 0)
		state->s0 |= input_chr << 16;
	    else if (((state->s0 >> 8) & 0xff) == 0)
		state->s0 |= input_chr << 8;
	    else {
		/* Long escape sequence.  Switch to ESCPASS or ESCDROP. */
		i1 = (state->s0 >> 16) & 0xff;
		i2 = (state->s0 >> 8) & 0xff;
		switch (i1) {
		  case '(': case ')': case '*': case '+':
		  case '-': case '.': case '/':
		  case '$':
		    ENTER_MODE(ESCDROP);
		    break;
		  default:
		    emit(emitctx, ESC);
		    emit(emitctx, i1);
		    emit(emitctx, i2);
		    emit(emitctx, input_chr);
		    state->s0 = 0;
		    ENTER_MODE(ESCPASS);
		    break;
		}
	    }
	    return;
	}

	/*
	 * Final bytes shall be any of the 79 positions of columns 03
	 * to 07 of the code table excluding position 07/15; they are
	 * denoted by the symbol F.
	 */
	i1 = (state->s0 >> 16) & 0xff;
	i2 = (state->s0 >> 8) & 0xff;
	if (MODE == ESCDROP)
	    input_chr = 0; /* Make sure it won't match. */
	state->s0 = 0;
	switch (i1) {
	  case 0: /* No intermediate bytes */
	    switch (input_chr) {
	      case 'N': /* SS2 */
		SINGLE_SHIFT(2);
		break;
	      case 'O': /* SS3 */
		SINGLE_SHIFT(3);
		break;
	      case 'n': /* LS2 */
		LOCKING_SHIFT(2, LEFT);
		break;
	      case 'o': /* LS3 */
		LOCKING_SHIFT(3, LEFT);
		break;
	      case '|': /* LS3R */
		LOCKING_SHIFT(3, RIGHT);
		break;
	      case '}': /* LS2R */
		LOCKING_SHIFT(2, RIGHT);
		break;
	      case '~': /* LS1R */
		LOCKING_SHIFT(1, RIGHT);
		break;
	      default:
		/* Unsupported escape sequence.  Spit it back out. */
		emit(emitctx, ESC);
		emit(emitctx, input_chr);
	    }
	    break;
	  case ' ': /* ACS */
	    /*
	     * Various coding structure facilities specify that designating
	     * a code element also invokes it.  As far as I can see, invoking
	     * it now will have the same practical effect, since those
	     * facilities also ban the use of locking shifts.
	     */
	    switch (input_chr) {
	      case 'A': /* G0 element used and invoked into GL */
		LOCKING_SHIFT(0, LEFT);
		break;
	      case 'C': /* G0 in GL, G1 in GR */
	      case 'D': /* Ditto, at least for 8-bit codes */
	      case 'L': /* ISO 4873 (ECMA-43) level 1 */
	      case 'M': /* ISO 4873 (ECMA-43) level 2 */
		LOCKING_SHIFT(0, LEFT);
		LOCKING_SHIFT(1, RIGHT);
		break;
	    }
	    break;
	  case '&': /* IRR */
	    /*
	     * IRR (Identify Revised Registration) is ignored here,
	     * since any revised registration must be
	     * upward-compatible with the old one, so either we'll
	     * support the new one or we'll emit ERROR when we run
	     * into a new character.  In either case, there's nothing
	     * to be done here.
	     */
	    break;
	  case '(': /* GZD4 */  case ')': /* G1D4 */
	  case '*': /* G2D4 */  case '+': /* G3D4 */
	    designate(state, i1 - '(', S4, i2, input_chr);
	    break;
	  case '-': /* G1D6 */  case '.': /* G2D6 */  case '/': /* G3D6 */
	    designate(state, i1 - ',', S6, i2, input_chr);
	    break;
	  case '$': /* G?DM? */
	    switch (i2) {
	      case 0: /* Obsolete version of GZDM4 */
		i2 = '(';
	      case '(': /* GZDM4 */  case ')': /* G1DM4 */
	      case '*': /* G2DM4 */  case '+': /* G3DM4 */
		designate(state, i2 - '(', M4, 0, input_chr);
		break;
	      case '-': /* G1DM6 */
	      case '.': /* G2DM6 */  case '/': /* G3DM6 */
		designate(state, i2 - ',', M6, 0, input_chr);
		break;
	      default:
		emit(emitctx, ERROR);
		break;
	    }
	  case '%': /* DOCS */
	    /* XXX What's a reasonable way to handle an unrecognised DOCS? */
	    switch (i2) {
	      case 0:
		switch (input_chr) {
		  case 'G':
		    ENTER_MODE(DOCSUTF8);
		    break;
		}
		break;
	      case '/':
		switch (input_chr) {
		  case '1': case '2':
		    ENTER_MODE(DOCSCTEXT);
		    break;
		}
		break;
	    }
	    break;
	  default:
	    /* Unsupported nF escape sequence.  Re-emit it. */
	    emit(emitctx, ESC);
	    emit(emitctx, i1);
	    if (i2) emit(emitctx, i2);
	    emit(emitctx, input_chr);
	    break;
	}
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %r8, %r15
movq %rcx, %r8
movq %rdx, %r13
movq %rsi, %r14
cmpq $0x0, 0x8(%rdx)
jne 0x71a7
movq 0x18(%rdi), %rbx
movq $0x10000000, 0x8(%r13)  # imm = 0x10000000
movsbl 0x4(%rbx), %edx
movsbl 0x5(%rbx), %ecx
movq %r8, %r12
movsbl 0x6(%rbx), %r8d
movq %r13, %rdi
xorl %esi, %esi
callq 0x7fe9
movsbl 0x7(%rbx), %edx
movsbl 0x8(%rbx), %ecx
movsbl 0x9(%rbx), %r8d
pushq $0x1
popq %rsi
movq %r13, %rdi
callq 0x7fe9
pushq $0x2
popq %rsi
pushq $0x42
popq %rbp
movq %r13, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
movl %ebp, %r8d
callq 0x7fe9
pushq $0x3
popq %rsi
movq %r13, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
movl %ebp, %r8d
callq 0x7fe9
movq %r12, %r8
movq (%r13), %rbx
movl %ebx, %eax
shrl $0x1d, %eax
cmpl $0x7, %eax
je 0x71f4
cmpl $0x6, %eax
jne 0x724e
movq %rbx, %rsi
shrl $0x1a, %ebx
andl $0x3, %ebx
cmpl $0x1, %ebx
sete %cl
cmpq $0x25, %r14
sete %dl
movl $0x8000000, %eax        # imm = 0x8000000
testb %cl, %dl
je 0x72c9
movq $-0xc000001, %rcx       # imm = 0xF3FFFFFF
andq (%r13), %rcx
orq %rax, %rcx
jmp 0x72f1
movl %ebx, %ebp
shrl $0x8, %ebp
andl $0x3fff, %ebp           # imm = 0x3FFF
je 0x72fa
movq %r14, 0x8(%rsp)
movl %ebx, %r12d
shrl $0x16, %r12d
andl $0xf, %r12d
movl %ebx, %r14d
shrl $0x1a, %r14d
andl $0x3, %r14d
cmpl $0xe, %r12d
je 0x7419
cmpl $0xf, %r12d
jne 0x7442
cmpl $0x3, %r14d
jne 0x7597
movl $0xffff, %esi           # imm = 0xFFFF
movq %r15, %rdi
callq *%r8
jmp 0x75d5
testb $0x60, %r14b
je 0x7325
testb %r14b, %r14b
setns %cl
cmpl $0x3, %eax
setae %dl
testb %dl, %cl
jne 0x7385
movl %ebx, %eax
andl $0xe0000000, %eax       # imm = 0xE0000000
cmpl $0x40000000, %eax       # imm = 0x40000000
ja 0x728c
testl $0xff0000, %ebx         # imm = 0xFF0000
je 0x72a4
movl %ebx, %eax
shrl $0x10, %eax
xorb %r14b, %al
jns 0x72a4
movl $0xffff, %esi           # imm = 0xFFFF
movq %r15, %rdi
movq %r8, %rbx
callq *%r8
movq %rbx, %r8
andq $0x0, (%r13)
xorl %ebx, %ebx
movl %ebx, %eax
shrl $0x1d, %eax
decq %rax
cmpq $0x1, %rax
ja 0x74c5
movq %rbx, %rdi
movl %ebx, %ecx
shrl $0x1d, %ecx
incl %ecx
movq 0x8(%r13), %rdx
jmp 0x74e1
cmpl $0x2, %ebx
setne %al
cmpq $0x40, %r14
setne %cl
orb %al, %cl
jne 0x73be
shlq $0x26, %rsi
je 0x72ef
movl $0xffff, %esi           # imm = 0xFFFF
movq %r15, %rdi
callq *%r8
xorl %ecx, %ecx
movq %rcx, (%r13)
jmp 0x77dd
testb %bl, %bl
je 0x731d
movl %ebx, %eax
andl $0x7f, %eax
shll $0x7, %eax
andl $0x7f, %r14d
orq %rax, %r14
je 0x75ef
andl $0xf0000000, %ebx       # imm = 0xF0000000
shlq $0x8, %r14
orq %r14, %rbx
jmp 0x75f1
testq %rbx, %rbx
je 0x733b
movl $0xffff, %esi           # imm = 0xFFFF
movq %r15, %rdi
movq %r8, %rbx
callq *%r8
movq %rbx, %r8
andq $0x0, (%r13)
cmpq $0xe, %r14
je 0x776a
cmpq $0xf, %r14
je 0x772f
cmpq $0x8f, %r14
je 0x7746
cmpq $0x8e, %r14
je 0x7739
cmpq $0x1b, %r14
jne 0x7753
movq $0x60000000, (%r13)     # imm = 0x60000000
jmp 0x77dd
cmpl $0x5, %eax
jne 0x74e8
movq %r15, %rdi
movq %r14, %rsi
callq *%r8
andl $0x70, %r14d
cmpl $0x20, %r14d
je 0x77dd
movabsq $-0xc0000001, %rax      # imm = 0xFFFFFFFF3FFFFFFF
addq $-0x20000000, %rax      # imm = 0xE0000000
andq %rax, (%r13)
jmp 0x77dd
testl %ebx, %ebx
je 0x73f2
pushq $0x1b
popq %rdi
movq %r13, %rsi
movq %r8, %rdx
movq %r15, %rcx
movq %r8, %r12
callq 0x809d
movq %r12, %r8
cmpl $0x1, %ebx
je 0x73f2
pushq $0x25
popq %rdi
movq %r13, %rsi
movq %r8, %rdx
movq %r15, %rcx
callq 0x809d
movq %r12, %r8
movl $0x4000000, %eax        # imm = 0x4000000
cmpq $0x1b, %r14
je 0x71e1
movq %r14, %rdi
movq %r13, %rsi
movq %r8, %rdx
movq %r15, %rcx
callq 0x809d
xorl %eax, %eax
jmp 0x71e1
cmpq $0x2, 0x8(%rsp)
jne 0x75d5
andl $0xf0000000, %ebx       # imm = 0xF0000000
shll $0x1a, %r14d
leaq (%rbx,%r14), %rax
addq $0x3c00000, %rax        # imm = 0x3C00000
movq %rax, (%r13)
jmp 0x75d5
movq %rbp, 0x10(%rsp)
movq %rbx, 0x20(%rsp)
movq %r13, 0x28(%rsp)
movl %r14d, %eax
imulq $0x18, %rax, %rax
leaq 0x9f461(%rip), %rbp     # 0xa68c0
addq %rax, %rbp
shll $0x1a, %r14d
pushq $0xe
popq %rax
movq %rax, 0x18(%rsp)
movq %rbp, 0x30(%rsp)
movl $0xc000000, %ebx        # imm = 0xC000000
cmpq $0xc000000, %r14        # imm = 0xC000000
je 0x756f
movq (%rbp), %r13
movq 0x30(%rsp), %rax
movq (%rax), %r15
movq %r13, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x6070
testl %eax, %eax
jne 0x7555
movsbq (%r13,%r12), %rax
cmpq 0x8(%rsp), %rax
jge 0x7555
addq $0x4000000, %r14        # imm = 0x4000000
addq $0x18, %rbp
jmp 0x7478
movq 0x8(%r13), %rdx
movq %rbx, %rdi
cmpq $0x80, %r14
jl 0x75fa
movl %edx, %ecx
shrl $0x1c, %ecx
andl $0x3, %ecx
movb $0x1, %al
jmp 0x7603
movl %r14d, %ecx
andl $0x70, %ecx
cmpl $0x20, %ecx
jne 0x7692
movq %rbx, %rax
shrq $0x10, %rax
movq %rax, %r12
andq $0xff, %r12
je 0x77b3
movzbl %bh, %ebp
testl %ebp, %ebp
je 0x7319
cmpb $0x2f, %al
ja 0x7922
movzbl %al, %eax
movabsq $0xef1000000000, %rcx   # imm = 0xEF1000000000
btq %rax, %rcx
jae 0x7922
movabsq $-0xc0000001, %rax      # imm = 0xFFFFFFFF3FFFFFFF
addq $-0x20000000, %rax      # imm = 0xE0000000
andq %rax, %rbx
btsq $0x1f, %rbx
jmp 0x75f1
movq (%rbp), %r13
movq %r13, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x6070
testl %eax, %eax
je 0x7784
movq 0x10(%rsp), %rbp
movq 0x20(%rsp), %rax
andl $0xf0000000, %eax       # imm = 0xF0000000
orq %rbx, %rax
movq 0x18(%rsp), %rcx
shll $0x16, %ecx
orq %rax, %rcx
movq 0x28(%rsp), %r13
movq %rcx, (%r13)
jmp 0x75d5
movl %r14d, %eax
imulq $0x18, %rax, %rax
leaq 0x38(%rsp), %r12
andq $0x0, 0x8(%r12)
leaq 0x9f310(%rip), %rcx     # 0xa68c0
movq 0x10(%rax,%rcx), %rdi
movzbl %bl, %eax
movq %rax, (%r12)
movq 0x8(%rsp), %rsi
movq %r12, %rdx
movq %r8, %rcx
movq %r15, %r8
callq *0x8(%rdi)
movb (%r12), %al
movb %al, (%r13)
decl %ebp
je 0x75ef
movq $-0x3fff01, %rax        # imm = 0xFFC000FF
andq (%r13), %rax
shll $0x8, %ebp
orq %rax, %rbp
movq %rbp, %rbx
jmp 0x75f1
xorl %ebx, %ebx
movq %rbx, (%r13)
jmp 0x77dd
movq %rdx, %rcx
shrq $0x1e, %rcx
xorl %eax, %eax
movq %r14, %r12
andq $-0x81, %r12
imull $0x7, %ecx, %ecx
shrq %cl, %rdx
andl $0x7f, %edx
imulq $0x28, %rdx, %rdx
leaq 0x9ec6f(%rip), %rbx     # 0xa6290
movzbl (%rdx,%rbx), %ecx
testb $-0x3, %cl
jne 0x7658
cmpq $0x20, %r14
je 0x7648
cmpq $0x7f, %r14
je 0x7648
cmpq $0xff, %r14
je 0x7648
cmpq $0xa0, %r14
jne 0x7658
testb %al, %al
movl $0xffff, %eax           # imm = 0xFFFF
cmovneq %rax, %r12
jmp 0x77cf
addq %rdx, %rbx
andb $-0x2, %cl
cmpb $0x2, %cl
jne 0x76ec
testl $0xff0000, %edi         # imm = 0xFF0000
je 0x77bc
movl 0x4(%rbx), %eax
shrl $0x10, %edi
andl $0x7f, %edi
addl %eax, %edi
addl %eax, %r12d
movl %r12d, %esi
movq %r8, %r14
callq *0x10(%rbx)
movq %r14, %r8
jmp 0x7727
movq %r13, %rdx
movl %ebx, %r13d
shrl $0x10, %r13d
movl $0xff, %r12d
andl %r12d, %r13d
shrl $0x8, %ebx
movq %rbx, %rsi
andl %ebx, %r12d
xorl %ecx, %ecx
cmpl $0x4, %eax
cmoveq %rcx, %r14
movq %rdx, %rbx
andq $0x0, (%rdx)
leal -0x20(%r13), %eax
cmpl $0xf, %eax
ja 0x7822
leaq 0x542ba(%rip), %rcx     # 0x5b98c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
addl $-0x28, %r13d
movq %rbx, %rdi
movl %r13d, %esi
xorl %edx, %edx
jmp 0x77f9
testl $0xff0000, %edi         # imm = 0xFF0000
je 0x7705
movl $0xffff, %esi           # imm = 0xFFFF
movq %r15, %rdi
movq %r8, %r14
callq *%r8
movq %r14, %r8
movq 0x8(%rbx), %rdi
testq %rdi, %rdi
je 0x77c9
movslq 0x4(%rbx), %rax
addq %rax, %r12
movq %r12, %rsi
movq %r8, %rbx
callq 0x9224
movq %rbx, %r8
movq %rax, %r12
jmp 0x77cf
andb $0x3f, 0xb(%r13)
jmp 0x77dd
movq $0x20000000, (%r13)     # imm = 0x20000000
jmp 0x77dd
movq $0x40000000, (%r13)     # imm = 0x40000000
jmp 0x77dd
movq %r15, %rdi
movq %r14, %rsi
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmpq *%r8
movabsq $-0xc0000001, %rax      # imm = 0xFFFFFFFF3FFFFFFF
andq 0x8(%r13), %rax
orq $0x40000000, %rax       # imm = 0x40000000
movq %rax, 0x8(%r13)
jmp 0x77dd
movsbq (%r13,%r12), %rax
cmpq 0x8(%rsp), %rax
movq 0x10(%rsp), %rbp
jne 0x7574
cmpb $0x0, 0x1(%r13,%r12)
je 0x7812
cmpl $0xf, %r12d
je 0x7a7b
leaq 0x1(%r12), %rax
jmp 0x7815
shlq $0x10, %r14
jmp 0x731d
shlq $0x10, %r14
orq %r14, %rdi
movq %rdi, (%r13)
jmp 0x77dd
movl $0xffff, %r12d          # imm = 0xFFFF
movq %r15, %rdi
movq %r12, %rsi
callq *%r8
andq $0x0, (%r13)
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
addl $-0x2c, %r13d
pushq $0x1
popq %rdx
movq %rbx, %rdi
movl %r13d, %esi
movl %r12d, %ecx
movl %r14d, %r8d
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x7fe9
pushq $0xf
popq %rax
movq %rax, 0x18(%rsp)
movq %r14, %rbx
jmp 0x7574
testl %r13d, %r13d
jne 0x7879
cmpq $0x7e, %r14
je 0x7a31
cmpq $0x4f, %r14
je 0x7a6f
cmpq $0x6e, %r14
je 0x7a57
cmpq $0x6f, %r14
je 0x79fe
cmpq $0x7c, %r14
je 0x7a28
cmpq $0x7d, %r14
je 0x7a12
cmpq $0x4e, %r14
jne 0x7a3d
movq $0x20000000, (%rbx)     # imm = 0x20000000
jmp 0x77dd
pushq $0x1b
popq %rsi
movq %r15, %rdi
movq %r8, %rbx
callq *%r8
movl %r13d, %esi
movq %r15, %rdi
movq %rbx, %r13
callq *%rbx
testl %r12d, %r12d
je 0x789e
movl %r12d, %esi
movq %r15, %rdi
callq *%r13
movq %r15, %rdi
movq %r14, %rsi
movq %r13, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmpq *%rax
movzbl %sil, %eax
leal -0x28(%rax), %ecx
cmpl $0x4, %ecx
jb 0x795a
leal -0x2d(%rax), %ecx
cmpl $0x3, %ecx
movq %rbx, %rdi
jae 0x79e1
leal -0x2c(%r12), %esi
pushq $0x3
jmp 0x7964
addq $-0x41, %r14
cmpq $0xc, %r14
ja 0x77dd
movl $0x180c, %eax           # imm = 0x180C
btq %r14, %rax
jae 0x79cf
movabsq $-0xc0000001, %rax      # imm = 0xFFFFFFFF3FFFFFFF
addq $-0x30000000, %rax      # imm = 0xD0000000
andq 0x8(%rbx), %rax
orq $0x10000000, %rax       # imm = 0x10000000
movq %rax, 0x8(%rbx)
jmp 0x77dd
pushq $0x1b
popq %rsi
movq %r15, %rdi
movq %r8, %rbx
callq *%r8
movq %r15, %rdi
movq %r12, %rsi
callq *%rbx
movq %r15, %rdi
movq %rbp, %rsi
callq *%rbx
movq %r15, %rdi
movq %r14, %rsi
callq *%rbx
movl $0x80000000, %eax       # imm = 0x80000000
orq $0x20000000, %rax       # imm = 0x20000000
movq %rax, (%r13)
jmp 0x77dd
movq %rbx, %rdi
leal -0x28(%r12), %esi
pushq $0x2
popq %rdx
xorl %ecx, %ecx
movl %r14d, %r8d
callq 0x7fe9
cmpl $0x2f, %r12d
je 0x79ab
testl %r12d, %r12d
jne 0x77dd
cmpq $0x47, %r14
jne 0x77dd
movabsq $-0xc0000001, %rax      # imm = 0xFFFFFFFF3FFFFFFF
addq $-0x20000000, %rax      # imm = 0xE0000000
andq (%rbx), %rax
movl $0x80000000, %ecx       # imm = 0x80000000
addq %rcx, %rax
addq $0x40000000, %rax       # imm = 0x40000000
jmp 0x79c7
addq $-0x31, %r14
cmpq $0x1, %r14
ja 0x77dd
movl $0x80000000, %eax       # imm = 0x80000000
orq (%rbx), %rax
orq $0x60000000, %rax       # imm = 0x60000000
movq %rax, (%rbx)
jmp 0x77dd
testq %r14, %r14
jne 0x77dd
andb $0x3f, 0xb(%rbx)
jmp 0x77dd
testl %eax, %eax
jne 0x79ee
pushq $0x28
popq %r12
jmp 0x795d
movl $0xffff, %esi           # imm = 0xFFFF
movq %r15, %rdi
callq *%r8
jmp 0x796f
movl $0x80000000, %eax       # imm = 0x80000000
orq 0x8(%rbx), %rax
orq $0x40000000, %rax       # imm = 0x40000000
jmp 0x7919
movq $-0x30000001, %rax      # imm = 0xCFFFFFFF
andq 0x8(%rbx), %rax
orq $0x20000000, %rax       # imm = 0x20000000
jmp 0x7919
orb $0x30, 0xb(%rbx)
jmp 0x77dd
movq $-0x30000001, %rax      # imm = 0xCFFFFFFF
jmp 0x790f
pushq $0x1b
popq %rsi
movq %r15, %rdi
movq %r8, %rbx
callq *%r8
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rax
jmp 0x78a7
movabsq $-0xc0000001, %rax      # imm = 0xFFFFFFFF3FFFFFFF
andq 0x8(%rbx), %rax
btsq $0x1f, %rax
jmp 0x7919
movq $0x40000000, (%rbx)     # imm = 0x40000000
jmp 0x77dd
leaq 0x54034(%rip), %rdi     # 0x5bab6
leaq 0x53f64(%rip), %rsi     # 0x5b9ed
leaq 0x54036(%rip), %rcx     # 0x5bac6
movl $0x1ea, %edx            # imm = 0x1EA
callq 0x6060