// File: /workspace/github_c_makefile_star2_O3/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 0x11d48
leaq 0x6b82(%rip), %rdx      # 0x188a0
movl $0x1013, %edi           # imm = 0x1013
cmpl $0x3, 0x436de(%rip)     # 0x55408
jne 0x11e1d
cmpl $0x20, %esi
je 0x11dd0
cmpl $0x7d, %esi
jne 0x11e1d
movl $0xa9, %eax
retq
movl %edi, %eax
andl $0xff00, %eax           # imm = 0xFF00
cmpl $0x8f00, %eax           # imm = 0x8F00
jne 0x11d72
cmpl $0x43, %esi
jne 0x11da4
cmpl $0x8f22, %edi           # imm = 0x8F22
jne 0x11da4
movl $0xa6, %eax
cmpl $0x0, 0x43699(%rip)     # 0x55408
jne 0x11da4
retq
andl $0x7f, %edi
cmpl $0x21, %edi
setb %al
cmpl $0x7f, %edi
sete %cl
orb %al, %cl
jne 0x11e9f
addl $-0x21, %edi
cmpb $0x1, 0x3b629(%rip)     # 0x4d3bc
jne 0x11dd6
movl %edi, %eax
shlq $0x3, %rax
addq 0x3b226(%rip), %rax     # 0x4cfc8
jmp 0x11e11
andl $0x7f, %edi
cmpl $0x21, %edi
setb %al
cmpl $0x7f, %edi
sete %cl
orb %al, %cl
jne 0x11e9f
addl $-0x21, %edi
cmpb $0x0, 0x3b5f7(%rip)     # 0x4d3bc
je 0x11df4
leaq 0x363e2(%rip), %rax     # 0x481b0
jmp 0x11dfb
movl $0xa0, %eax
retq
movl 0x4362c(%rip), %ecx     # 0x55408
movl %edi, %eax
shlq $0x3, %rax
cmpl $0x3, %ecx
je 0x11e01
testl %ecx, %ecx
jne 0x11e0a
addq 0x3b19e(%rip), %rax     # 0x4cf90
jmp 0x11e11
leaq 0x360c5(%rip), %rax     # 0x47ec0
leaq (%rax,%rdi,8), %rax
jmp 0x11e11
addq 0x3b1a0(%rip), %rax     # 0x4cfa8
jmp 0x11e11
addq 0x3b15f(%rip), %rax     # 0x4cf70
movq (%rax), %rdx
testq %rdx, %rdx
je 0x11e9f
andl $0x7f, %esi
cmpl $0x21, %esi
setb %cl
cmpl $0x7f, %esi
sete %r8b
xorl %eax, %eax
orb %cl, %r8b
jne 0x11d71
leal -0x21(%rsi), %ecx
movzwl (%rdx,%rcx,2), %ecx
cmpb $0x1, 0x3b576(%rip)     # 0x4d3bc
jne 0x11ea2
movl %ecx, %r8d
andl $0xfc00, %r8d           # imm = 0xFC00
movzwl %r8w, %r8d
cmpl $0xd800, %r8d           # imm = 0xD800
jne 0x11ea2
movl %edi, %r8d
shll $0x8, %edi
addl %edi, %esi
addl $0x2100, %esi           # imm = 0x2100
leaq 0x3633c(%rip), %rdi     # 0x481b0
cmpq (%rdi,%r8,8), %rdx
je 0x11ea5
xorl %edx, %edx
leaq 0x1018d(%rip), %rdi     # 0x22010
movzwl (%rdi,%rdx), %r8d
cmpl %r8d, %esi
je 0x11eca
addq $0x6, %rdx
cmpq $0x9c, %rdx
jne 0x11e83
jmp 0x11d71
xorl %eax, %eax
retq
movl %ecx, %eax
retq
xorl %edx, %edx
leaq 0x10202(%rip), %rdi     # 0x220b0
movzwl (%rdi,%rdx), %r8d
cmpl %r8d, %esi
je 0x11ed3
addq $0x6, %rdx
cmpq $0x67e, %rdx            # imm = 0x67E
jne 0x11eae
jmp 0x11d71
addq 0x3b107(%rip), %rdx     # 0x4cfd8
jmp 0x11eda
addq 0x3b0d6(%rip), %rdx     # 0x4cfb0
movzwl 0x4(%rdx), %edx
testw %dx, %dx
je 0x11d71
movzwl %dx, %eax
shll $0xa, %ecx
addl %ecx, %eax
addl $0xfca02400, %eax       # imm = 0xFCA02400
retq