// File: /workspace/github_c_makefile_star2_O2/nurse[P]nkf/nkf.c
// Function: e2w_conv
static nkf_char
e2w_conv(nkf_char c2, nkf_char c1)
{
    const unsigned short *p;

    if (c2 == JIS_X_0201_1976_K) {
	if (ms_ucs_map_f == UCS_MAP_CP10001) {
	    switch (c1) {
	    case 0x20:
		return 0xA0;
	    case 0x7D:
		return 0xA9;
	    }
	}
	p = euc_to_utf8_1byte;
#ifdef X0212_ENABLE
    } else if (is_eucg3(c2)){
	if(ms_ucs_map_f == UCS_MAP_ASCII&& c2 == NKF_INT32_C(0x8F22) && c1 == 0x43){
	    return 0xA6;
	}
	c2 = (c2&0x7f) - 0x21;
	if (0<=c2 && c2<sizeof_euc_to_utf8_2bytes)
	    p =
		x0213_f ? x0212_to_utf8_2bytes_x0213[c2] :
		x0212_to_utf8_2bytes[c2];
	else
	    return 0;
#endif
    } else {
	c2 &= 0x7f;
	c2 = (c2&0x7f) - 0x21;
	if (0<=c2 && c2<sizeof_euc_to_utf8_2bytes)
	    p =
		x0213_f ? euc_to_utf8_2bytes_x0213[c2] :
		ms_ucs_map_f == UCS_MAP_ASCII ? euc_to_utf8_2bytes[c2] :
		ms_ucs_map_f == UCS_MAP_CP10001 ? euc_to_utf8_2bytes_mac[c2] :
		euc_to_utf8_2bytes_ms[c2];
	else
	    return 0;
    }
    if (!p) return 0;
    c1 = (c1 & 0x7f) - 0x21;
    if (0<=c1 && c1<sizeof_euc_to_utf8_1byte) {
	nkf_char val = p[c1];
	if (x0213_f && 0xD800<=val && val<=0xDBFF) {
	    nkf_char euc = (c2+0x21)<<8 | (c1+0x21);
	    nkf_char low = 0;
	    if (p==x0212_to_utf8_2bytes_x0213[c2]) {
		X0213_SURROGATE_FIND(x0213_2_surrogate_table, sizeof_x0213_2_surrogate_table, euc);
	    } else {
		X0213_SURROGATE_FIND(x0213_1_surrogate_table, sizeof_x0213_1_surrogate_table, euc);
	    }
	    if (!low) return 0;
	    return UTF16_TO_UTF32(val, low);
	} else {
	    return val;
	}
    }
    return 0;
}

// Assembly:
cmpl $0x1013, %edi           # imm = 0x1013
jne 0x11ab0
leaq 0x5e1a(%rip), %rcx      # 0x178a0
movl $0x1013, %edi           # imm = 0x1013
cmpl $0x3, 0x42966(%rip)     # 0x543f8
jne 0x11b80
cmpl $0x20, %esi
je 0x11b37
cmpl $0x7d, %esi
jne 0x11b80
movl $0xa9, %eax
retq
movl %edi, %eax
andl $0xff00, %eax           # imm = 0xFF00
cmpl $0x8f00, %eax           # imm = 0x8F00
jne 0x11b05
cmpl $0x43, %esi
jne 0x11ad9
cmpl $0x8f22, %edi           # imm = 0x8F22
jne 0x11ad9
movl $0xa6, %eax
cmpl $0x0, 0x42921(%rip)     # 0x543f8
je 0x11aaf
andl $0x7f, %edi
cmpl $0x21, %edi
setb %al
cmpl $0x7f, %edi
sete %cl
orb %al, %cl
jne 0x11bf7
addl $-0x21, %edi
cmpb $0x0, 0x3a8b2(%rip)     # 0x4c3ac
je 0x11b5b
leaq 0x356bd(%rip), %rax     # 0x471c0
jmp 0x11b62
andl $0x7f, %edi
cmpl $0x21, %edi
setb %al
cmpl $0x7f, %edi
sete %cl
orb %al, %cl
jne 0x11bf7
addl $-0x21, %edi
cmpb $0x1, 0x3a886(%rip)     # 0x4c3ac
jne 0x11b3d
movl %edi, %eax
shlq $0x3, %rax
addq 0x3a49b(%rip), %rax     # 0x4bfd0
jmp 0x11b78
movl $0xa0, %eax
retq
movl 0x428b5(%rip), %ecx     # 0x543f8
movl %edi, %eax
shlq $0x3, %rax
cmpl $0x3, %ecx
je 0x11b68
testl %ecx, %ecx
jne 0x11b71
addq 0x3a447(%rip), %rax     # 0x4bfa0
jmp 0x11b78
leaq 0x3536e(%rip), %rax     # 0x46ed0
leaq (%rax,%rdi,8), %rax
jmp 0x11b78
addq 0x3a449(%rip), %rax     # 0x4bfb8
jmp 0x11b78
addq 0x3a408(%rip), %rax     # 0x4bf80
movq (%rax), %rcx
testq %rcx, %rcx
je 0x11bf7
andl $0x7f, %esi
cmpl $0x21, %esi
setb %al
cmpl $0x7f, %esi
sete %dl
orb %al, %dl
jne 0x11bf7
leal -0x21(%rsi), %eax
movzwl (%rcx,%rax,2), %eax
cmpb $0x1, 0x3a80b(%rip)     # 0x4c3ac
jne 0x11aaf
movl %eax, %edx
andl $0xfc00, %edx           # imm = 0xFC00
cmpw $0xd800, %dx            # imm = 0xD800
jne 0x11aaf
movl %edi, %r8d
shll $0x8, %edi
leal (%rdi,%rsi), %edx
addl $0x2100, %edx           # imm = 0x2100
leaq 0x355f0(%rip), %rsi     # 0x471c0
cmpq (%rsi,%r8,8), %rcx
je 0x11bfa
leaq 0xf433(%rip), %rcx      # 0x21010
addq $-0x6, %rcx
pushq $0x1b
popq %rsi
decq %rsi
je 0x11c21
movzwl 0x6(%rcx), %edi
addq $0x6, %rcx
cmpl %edi, %edx
jne 0x11be4
jmp 0x11c1b
xorl %eax, %eax
retq
leaq 0xf4af(%rip), %rcx      # 0x210b0
addq $-0x6, %rcx
movl $0x116, %esi            # imm = 0x116
decq %rsi
je 0x11c21
movzwl 0x6(%rcx), %edi
addq $0x6, %rcx
cmpl %edi, %edx
jne 0x11c0a
movzwl 0x4(%rcx), %ecx
jmp 0x11c23
xorl %ecx, %ecx
movzwl %cx, %ecx
shll $0xa, %eax
xorl %edx, %edx
testw %cx, %cx
leal -0x35fdc00(%rax,%rcx), %eax
cmovel %edx, %eax
retq