// File: /workspace/github_c_makefile_star2_O2/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 0xc386
movl %edi, %ebx
cmpl $0x8f, %edi
je 0xc3af
cmpl $0x8e, %ebx
jne 0xc410
cmpb $0x1, 0x48063(%rip)     # 0x543f0
jne 0xc3f8
cmpl $0x0, 0x3ff0a(%rip)     # 0x4c2a0
jne 0xc3f8
movl $0x22, 0x4(%rsp)
movl $0x2e, (%rsp)
pushq $0x22
popq %rbx
jmp 0xc4ed
testl %edx, %edx
je 0xc45b
movb 0x48037(%rip), %al      # 0x543f4
leal -0xa1(%rdx), %ecx
cmpl $0x5d, %ecx
ja 0xc463
leal -0xf5(%rsi), %ecx
cmpl $0x9, %ecx
ja 0xc463
testb $0x1, %al
jne 0xc463
testb $0x1, 0x3ffc2(%rip)     # 0x4c3ac
jne 0xc463
imull $0x5e, %esi, %eax
addl %edx, %eax
addl $0x1008915, %eax        # imm = 0x1008915
jmp 0xc44c
movl $0x1013, 0x4(%rsp)      # imm = 0x1013
andl $0x7f, %esi
movl %esi, (%rsp)
movl $0x1013, %ebx           # imm = 0x1013
jmp 0xc4ed
cmpl $0x20, %ebx
jl 0xc4ed
movb 0x47fd5(%rip), %al      # 0x543f4
leal -0xa1(%rsi), %ecx
cmpl $0x5d, %ecx
ja 0xc48f
leal -0xf5(%rbx), %ecx
cmpl $0x9, %ecx
ja 0xc48f
testb $0x1, %al
jne 0xc48f
cmpl $0x0, 0x47fb8(%rip)     # 0x543f8
je 0xc48f
imull $0x5e, %ebx, %eax
addl %esi, %eax
addl $0x1008569, %eax        # imm = 0x1008569
movl %eax, (%rsp)
andl $0x0, 0x4(%rsp)
xorl %ebx, %ebx
jmp 0xc4ed
pushq $-0x1
popq %rax
jmp 0xc4fa
andl $0x7f, %esi
movl %esi, %ebx
orl $0x8f00, %ebx           # imm = 0x8F00
movl %ebx, 0x4(%rsp)
andl $0x7f, %edx
movl %edx, (%rsp)
testb $0x1, %al
je 0xc4ed
leaq 0xc(%rsp), %rax
leaq 0x8(%rsp), %rcx
movl %ebx, %edi
movl %edx, %esi
movq %rax, %rdx
jmp 0xc4b7
andl $0x7f, %esi
movl %esi, (%rsp)
andl $0x7f, %ebx
movl %ebx, 0x4(%rsp)
leal -0x79(%rbx), %ecx
cmpl $0x4, %ecx
setb %cl
andb %cl, %al
cmpb $0x1, %al
jne 0xc4ed
leaq 0xc(%rsp), %rdx
leaq 0x8(%rsp), %rcx
movl %ebx, %edi
callq 0x10d5b
testl %eax, %eax
jne 0xc4ed
movl 0xc(%rsp), %edi
movl 0x8(%rsp), %esi
leaq 0x4(%rsp), %rbx
movq %rsp, %rcx
movq %rbx, %rdx
callq 0x10ea6
movl (%rbx), %ebx
cmpl $0xff, %ebx
jg 0xc4ed
andl $0x7f, (%rsp)
andl $0x7f, %ebx
movl %ebx, 0x4(%rsp)
movl (%rsp), %esi
movl %ebx, %edi
callq *0x3fdb0(%rip)          # 0x4c2a8
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
retq