// File: /workspace/github_c_makefile_star2_O3/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 0xc526
movl %edi, %ebx
cmpl $0x8f, %edi
je 0xc551
cmpl $0x8e, %ebx
jne 0xc5b2
cmpb $0x1, 0x48ed3(%rip)     # 0x55400
jne 0xc59a
cmpl $0x0, 0x40d7a(%rip)     # 0x4d2b0
jne 0xc59a
movl $0x22, 0x4(%rsp)
movl $0x2e, (%rsp)
movl $0x22, %ebx
jmp 0xc694
testl %edx, %edx
je 0xc600
movb 0x48ea5(%rip), %al      # 0x55404
leal -0xa1(%rdx), %ecx
cmpl $0x5d, %ecx
ja 0xc60a
leal -0xf5(%rsi), %ecx
cmpl $0x9, %ecx
ja 0xc60a
testb $0x1, %al
jne 0xc60a
testb $0x1, 0x40e30(%rip)     # 0x4d3bc
jne 0xc60a
imull $0x5e, %esi, %eax
addl %edx, %eax
addl $0x1008915, %eax        # imm = 0x1008915
jmp 0xc5ee
movl $0x1013, 0x4(%rsp)      # imm = 0x1013
andl $0x7f, %esi
movl %esi, (%rsp)
movl $0x1013, %ebx           # imm = 0x1013
jmp 0xc694
cmpl $0x20, %ebx
jl 0xc694
movb 0x48e43(%rip), %al      # 0x55404
leal -0xa1(%rsi), %ecx
cmpl $0x5d, %ecx
ja 0xc636
leal -0xf5(%rbx), %ecx
cmpl $0x9, %ecx
ja 0xc636
testb $0x1, %al
jne 0xc636
cmpl $0x0, 0x48e26(%rip)     # 0x55408
je 0xc636
imull $0x5e, %ebx, %eax
addl %esi, %eax
addl $0x1008569, %eax        # imm = 0x1008569
movl %eax, (%rsp)
movl $0x0, 0x4(%rsp)
xorl %ebx, %ebx
jmp 0xc694
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0xc6a1
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 0xc694
leaq 0xc(%rsp), %rax
leaq 0x8(%rsp), %rcx
movl %ebx, %edi
movl %edx, %esi
movq %rax, %rdx
jmp 0xc65e
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 0xc694
leaq 0xc(%rsp), %rdx
leaq 0x8(%rsp), %rcx
movl %ebx, %edi
callq 0x10f30
testl %eax, %eax
jne 0xc694
movl 0xc(%rsp), %edi
movl 0x8(%rsp), %esi
leaq 0x4(%rsp), %rbx
movq %rsp, %rcx
movq %rbx, %rdx
callq 0x1108d
movl (%rbx), %ebx
cmpl $0xff, %ebx
jg 0xc694
andl $0x7f, (%rsp)
andl $0x7f, %ebx
movl %ebx, 0x4(%rsp)
movl (%rsp), %esi
movl %ebx, %edi
callq *0x40c19(%rip)          # 0x4d2b8
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
retq