// File: /workspace/github_c_makefile_star2_O1/nurse[P]nkf/nkf.c
// Function: e_iconv
static nkf_char
e_iconv(nkf_char c2, nkf_char c1, nkf_char c0)
{
    if (c2 == JIS_X_0201_1976_K || c2 == SS2){
	if (iso2022jp_f && !x0201_f) {
	    c2 = GETA1; c1 = GETA2;
	} else {
	    c2 = JIS_X_0201_1976_K;
	    c1 &= 0x7f;
	}
#ifdef X0212_ENABLE
    }else if (c2 == 0x8f){
	if (c0 == 0){
	    return -1;
	}
	if (!cp51932_f && !x0213_f && 0xF5 <= c1 && c1 <= 0xFE && 0xA1 <= c0 && c0 <= 0xFE) {
	    /* encoding is eucJP-ms, so invert to Unicode Private User Area */
	    c1 = nkf_char_unicode_new((c1 - 0xF5) * 94 + c0 - 0xA1 + 0xE3AC);
	    c2 = 0;
	} else {
	    c2 = (c2 << 8) | (c1 & 0x7f);
	    c1 = c0 & 0x7f;
#ifdef SHIFTJIS_CP932
	    if (cp51932_f){
		nkf_char s2, s1;
		if (e2s_conv(c2, c1, &s2, &s1) == 0){
		    s2e_conv(s2, s1, &c2, &c1);
		    if (c2 < 0x100){
			c1 &= 0x7f;
			c2 &= 0x7f;
		    }
		}
	    }
#endif /* SHIFTJIS_CP932 */
	}
#endif /* X0212_ENABLE */
    } else if ((c2 == EOF) || (c2 == 0) || c2 < SP || c2 == ISO_8859_1) {
	/* NOP */
    } else {
	if (!cp51932_f && ms_ucs_map_f && 0xF5 <= c2 && c2 <= 0xFE && 0xA1 <= c1 && c1 <= 0xFE) {
	    /* encoding is eucJP-ms, so invert to Unicode Private User Area */
	    c1 = nkf_char_unicode_new((c2 - 0xF5) * 94 + c1 - 0xA1 + 0xE000);
	    c2 = 0;
	} else {
	    c1 &= 0x7f;
	    c2 &= 0x7f;
#ifdef SHIFTJIS_CP932
	    if (cp51932_f && 0x79 <= c2 && c2 <= 0x7c){
		nkf_char s2, s1;
		if (e2s_conv(c2, c1, &s2, &s1) == 0){
		    s2e_conv(s2, s1, &c2, &c1);
		    if (c2 < 0x100){
			c1 &= 0x7f;
			c2 &= 0x7f;
		    }
		}
	    }
#endif /* SHIFTJIS_CP932 */
	}
    }
    (*oconv)(c2, c1);
    return 0;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movl %edi, 0x4(%rsp)
movl %esi, (%rsp)
cmpl $0x1013, %edi           # imm = 0x1013
je 0xc550
cmpl $0x8f, %edi
je 0xc576
cmpl $0x8e, %edi
jne 0xc5ce
cmpb $0x1, 0x48ea9(%rip)     # 0x55400
jne 0xc5bb
cmpl $0x0, 0x40d50(%rip)     # 0x4d2b0
jne 0xc5bb
movl $0x22, 0x4(%rsp)
movl $0x2e, (%rsp)
jmp 0xc6a9
testl %edx, %edx
je 0xc61a
movb 0x48e80(%rip), %al      # 0x55404
leal -0xa1(%rdx), %ecx
cmpl $0x5d, %ecx
ja 0xc624
leal -0xf5(%rsi), %ecx
cmpl $0x9, %ecx
ja 0xc624
testb $0x1, %al
jne 0xc624
testb $0x1, 0x40e0f(%rip)     # 0x4d3bc
jne 0xc624
imull $0x5e, %esi, %eax
addl %edx, %eax
addl $0x1008915, %eax        # imm = 0x1008915
jmp 0xc60a
movl $0x1013, 0x4(%rsp)      # imm = 0x1013
andl $0x7f, %esi
movl %esi, (%rsp)
jmp 0xc6a9
cmpl $0x20, %edi
jl 0xc6a9
movb 0x48e27(%rip), %al      # 0x55404
leal -0xa1(%rsi), %ecx
cmpl $0x5d, %ecx
ja 0xc64e
leal -0xf5(%rdi), %ecx
cmpl $0x9, %ecx
ja 0xc64e
testb $0x1, %al
jne 0xc64e
cmpl $0x0, 0x48e0a(%rip)     # 0x55408
je 0xc64e
imull $0x5e, %edi, %eax
addl %esi, %eax
addl $0x1008569, %eax        # imm = 0x1008569
movl %eax, (%rsp)
movl $0x0, 0x4(%rsp)
jmp 0xc6a9
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0xc6b8
andl $0x7f, %esi
orl $0x8f00, %esi           # imm = 0x8F00
movl %esi, 0x4(%rsp)
andl $0x7f, %edx
movl %edx, (%rsp)
testb $0x1, %al
je 0xc6a9
leaq 0xc(%rsp), %rax
leaq 0x8(%rsp), %rcx
movl %esi, %edi
movl %edx, %esi
movq %rax, %rdx
jmp 0xc674
andl $0x7f, %esi
movl %esi, (%rsp)
andl $0x7f, %edi
movl %edi, 0x4(%rsp)
leal -0x79(%rdi), %ecx
cmpl $0x4, %ecx
setb %cl
andb %cl, %al
cmpb $0x1, %al
jne 0xc6a9
leaq 0xc(%rsp), %rdx
leaq 0x8(%rsp), %rcx
callq 0x10f40
testl %eax, %eax
jne 0xc6a9
movl 0xc(%rsp), %edi
movl 0x8(%rsp), %esi
leaq 0x4(%rsp), %rbx
movq %rsp, %rcx
movq %rbx, %rdx
callq 0x110a3
movl (%rbx), %eax
cmpl $0xff, %eax
jg 0xc6a9
andl $0x7f, (%rsp)
andl $0x7f, %eax
movl %eax, 0x4(%rsp)
movl 0x4(%rsp), %edi
movl (%rsp), %esi
callq *0x40c02(%rip)          # 0x4d2b8
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
retq