// File: /workspace/github_c_makefile_star2_O0/nurse[P]nkf/nkf.c
// Function: unicode_to_jis_common
static int
unicode_to_jis_common(nkf_char c2, nkf_char c1, nkf_char c0, nkf_char *p2, nkf_char *p1)
{
    const unsigned short *const *pp;
    const unsigned short *const *const *ppp;
    static const char no_best_fit_chars_table_C2[] =
    {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
	1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
	1, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 2, 1, 1, 2,
	0, 0, 1, 1, 0, 1, 0, 1, 2, 1, 1, 1, 1, 1, 1, 1};
    static const char no_best_fit_chars_table_C2_ms[] =
    {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
	1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
	1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0,
	0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 0};
    static const char no_best_fit_chars_table_932_C2[] =
    {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
	1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
	1, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1,
	0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0};
    static const char no_best_fit_chars_table_932_C3[] =
    {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
	1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1,
	1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
	1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1};
    nkf_char ret = 0;

    if(c2 < 0x80){
	*p2 = 0;
	*p1 = c2;
    }else if(c2 < 0xe0){
	if(no_best_fit_chars_f){
	    if(ms_ucs_map_f == UCS_MAP_CP932){
		switch(c2){
		case 0xC2:
		    if(no_best_fit_chars_table_932_C2[c1&0x3F]) return 1;
		    break;
		case 0xC3:
		    if(no_best_fit_chars_table_932_C3[c1&0x3F]) return 1;
		    break;
		}
	    }else if(!cp932inv_f){
		switch(c2){
		case 0xC2:
		    if(no_best_fit_chars_table_C2[c1&0x3F]) return 1;
		    break;
		case 0xC3:
		    if(no_best_fit_chars_table_932_C3[c1&0x3F]) return 1;
		    break;
		}
	    }else if(ms_ucs_map_f == UCS_MAP_MS){
		if(c2 == 0xC2 && no_best_fit_chars_table_C2_ms[c1&0x3F]) return 1;
	    }else if(ms_ucs_map_f == UCS_MAP_CP10001){
		switch(c2){
		case 0xC2:
		    switch(c1){
		    case 0xA2:
		    case 0xA3:
		    case 0xA5:
		    case 0xA6:
		    case 0xAC:
		    case 0xAF:
		    case 0xB8:
			return 1;
		    }
		    break;
		}
	    }
	}
	pp =
	    ms_ucs_map_f == UCS_MAP_CP932 ? utf8_to_euc_2bytes_932 :
	    ms_ucs_map_f == UCS_MAP_MS ? utf8_to_euc_2bytes_ms :
	    ms_ucs_map_f == UCS_MAP_CP10001 ? utf8_to_euc_2bytes_mac :
	    x0213_f ? utf8_to_euc_2bytes_x0213 :
	    utf8_to_euc_2bytes;
	ret =  unicode_to_jis_common2(c2, c1, pp, sizeof_utf8_to_euc_2bytes, p2, p1);
    }else if(c0 < 0xF0){
	if(no_best_fit_chars_f){
	    if(ms_ucs_map_f == UCS_MAP_CP932){
		if(c2 == 0xE3 && c1 == 0x82 && c0 == 0x94) return 1;
	    }else if(ms_ucs_map_f == UCS_MAP_MS){
		switch(c2){
		case 0xE2:
		    switch(c1){
		    case 0x80:
			if(c0 == 0x94 || c0 == 0x96 || c0 == 0xBE) return 1;
			break;
		    case 0x88:
			if(c0 == 0x92) return 1;
			break;
		    }
		    break;
		case 0xE3:
		    if(c1 == 0x80 || c0 == 0x9C) return 1;
		    break;
		}
	    }else if(ms_ucs_map_f == UCS_MAP_CP10001){
		switch(c2){
		case 0xE3:
		    switch(c1){
		    case 0x82:
			if(c0 == 0x94) return 1;
			break;
		    case 0x83:
			if(c0 == 0xBB) return 1;
			break;
		    }
		    break;
		}
	    }else{
		switch(c2){
		case 0xE2:
		    switch(c1){
		    case 0x80:
			if(c0 == 0x95) return 1;
			break;
		    case 0x88:
			if(c0 == 0xA5) return 1;
			break;
		    }
		    break;
		case 0xEF:
		    switch(c1){
		    case 0xBC:
			if(c0 == 0x8D) return 1;
			break;
		    case 0xBD:
			if(c0 == 0x9E && !cp932inv_f) return 1;
			break;
		    case 0xBF:
			if(0xA0 <= c0 && c0 <= 0xA5) return 1;
			break;
		    }
		    break;
		}
	    }
	}
	ppp =
	    ms_ucs_map_f == UCS_MAP_CP932 ? utf8_to_euc_3bytes_932 :
	    ms_ucs_map_f == UCS_MAP_MS ? utf8_to_euc_3bytes_ms :
	    ms_ucs_map_f == UCS_MAP_CP10001 ? utf8_to_euc_3bytes_mac :
	    x0213_f ? utf8_to_euc_3bytes_x0213 :
	    utf8_to_euc_3bytes;
	ret = unicode_to_jis_common2(c1, c0, ppp[c2 - 0xE0], sizeof_utf8_to_euc_C2, p2, p1);
    }else return -1;
#ifdef SHIFTJIS_CP932
    if (!ret&& is_eucg3(*p2)) {
	if (cp932inv_f) {
	    if (encode_fallback) ret = 1;
	}
	else {
	    nkf_char s2, s1;
	    if (e2s_conv(*p2, *p1, &s2, &s1) == 0) {
		s2e_conv(s2, s1, p2, p1);
	    }else{
		ret = 1;
	    }
	}
    }
#endif
    return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movl %edi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq %rcx, -0x18(%rbp)
movq %r8, -0x20(%rbp)
movl $0x0, -0x34(%rbp)
cmpl $0x80, -0x8(%rbp)
jge 0x128d4
movq -0x18(%rbp), %rax
movl $0x0, (%rax)
movl -0x8(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
jmp 0x12e34
cmpl $0xe0, -0x8(%rbp)
jge 0x12b18
cmpl $0x0, 0x47b84(%rip)     # 0x5a46c
je 0x12a7b
cmpl $0x2, 0x47b73(%rip)     # 0x5a468
jne 0x1295f
movl -0x8(%rbp), %eax
movl %eax, -0x40(%rbp)
subl $0xc2, %eax
je 0x12912
jmp 0x12906
movl -0x40(%rbp), %eax
subl $0xc3, %eax
je 0x12936
jmp 0x1295a
movl -0xc(%rbp), %eax
andl $0x3f, %eax
movslq %eax, %rcx
leaq 0x9d6e(%rip), %rax      # 0x1c690
cmpb $0x0, (%rax,%rcx)
je 0x12934
movl $0x1, -0x4(%rbp)
jmp 0x12ead
jmp 0x1295a
movl -0xc(%rbp), %eax
andl $0x3f, %eax
movslq %eax, %rcx
leaq 0x9d8a(%rip), %rax      # 0x1c6d0
cmpb $0x0, (%rax,%rcx)
je 0x12958
movl $0x1, -0x4(%rbp)
jmp 0x12ead
jmp 0x1295a
jmp 0x12a79
cmpl $0x0, 0x3f93a(%rip)     # 0x522a0
jne 0x129d0
movl -0x8(%rbp), %eax
movl %eax, -0x44(%rbp)
subl $0xc2, %eax
je 0x12983
jmp 0x12977
movl -0x44(%rbp), %eax
subl $0xc3, %eax
je 0x129a7
jmp 0x129cb
movl -0xc(%rbp), %eax
andl $0x3f, %eax
movslq %eax, %rcx
leaq 0x9c7d(%rip), %rax      # 0x1c610
cmpb $0x0, (%rax,%rcx)
je 0x129a5
movl $0x1, -0x4(%rbp)
jmp 0x12ead
jmp 0x129cb
movl -0xc(%rbp), %eax
andl $0x3f, %eax
movslq %eax, %rcx
leaq 0x9d19(%rip), %rax      # 0x1c6d0
cmpb $0x0, (%rax,%rcx)
je 0x129c9
movl $0x1, -0x4(%rbp)
jmp 0x12ead
jmp 0x129cb
jmp 0x12a77
cmpl $0x1, 0x47a91(%rip)     # 0x5a468
jne 0x12a09
cmpl $0xc2, -0x8(%rbp)
jne 0x12a07
movl -0xc(%rbp), %eax
andl $0x3f, %eax
movslq %eax, %rcx
leaq 0x9c5e(%rip), %rax      # 0x1c650
movsbl (%rax,%rcx), %eax
cmpl $0x0, %eax
je 0x12a07
movl $0x1, -0x4(%rbp)
jmp 0x12ead
jmp 0x12a75
cmpl $0x3, 0x47a58(%rip)     # 0x5a468
jne 0x12a73
movl -0x8(%rbp), %eax
subl $0xc2, %eax
jne 0x12a71
jmp 0x12a1e
movl -0xc(%rbp), %eax
movl %eax, -0x48(%rbp)
addl $0xffffff5e, %eax       # imm = 0xFFFFFF5E
subl $0x2, %eax
jb 0x12a63
jmp 0x12a30
movl -0x48(%rbp), %eax
addl $0xffffff5b, %eax       # imm = 0xFFFFFF5B
subl $0x2, %eax
jb 0x12a63
jmp 0x12a3f
movl -0x48(%rbp), %eax
subl $0xac, %eax
je 0x12a63
jmp 0x12a4b
movl -0x48(%rbp), %eax
subl $0xaf, %eax
je 0x12a63
jmp 0x12a57
movl -0x48(%rbp), %eax
subl $0xb8, %eax
jne 0x12a6f
jmp 0x12a63
movl $0x1, -0x4(%rbp)
jmp 0x12ead
jmp 0x12a71
jmp 0x12a73
jmp 0x12a75
jmp 0x12a77
jmp 0x12a79
jmp 0x12a7b
cmpl $0x2, 0x479e6(%rip)     # 0x5a468
jne 0x12a91
leaq 0x3b165(%rip), %rax     # 0x4dbf0
movq %rax, -0x50(%rbp)
jmp 0x12aec
cmpl $0x1, 0x479d0(%rip)     # 0x5a468
jne 0x12aa7
leaq 0x3adcf(%rip), %rax     # 0x4d870
movq %rax, -0x58(%rbp)
jmp 0x12ae4
cmpl $0x3, 0x479ba(%rip)     # 0x5a468
jne 0x12abd
leaq 0x3b4b9(%rip), %rax     # 0x4df70
movq %rax, -0x60(%rbp)
jmp 0x12adc
movl 0x3f959(%rip), %edx     # 0x5241c
leaq 0x3aa26(%rip), %rax     # 0x4d4f0
leaq 0x3b81f(%rip), %rcx     # 0x4e2f0
cmpl $0x0, %edx
cmovneq %rcx, %rax
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x28(%rbp)
movl -0x8(%rbp), %edi
movl -0xc(%rbp), %esi
movq -0x28(%rbp), %rdx
movq -0x18(%rbp), %r8
movq -0x20(%rbp), %r9
movl $0x70, %ecx
callq 0x12ec0
movl %eax, -0x34(%rbp)
jmp 0x12e32
cmpl $0xf0, -0x10(%rbp)
jge 0x12e27
cmpl $0x0, 0x47940(%rip)     # 0x5a46c
je 0x12d6b
cmpl $0x2, 0x4792f(%rip)     # 0x5a468
jne 0x12b67
cmpl $0xe3, -0x8(%rbp)
jne 0x12b62
cmpl $0x82, -0xc(%rbp)
jne 0x12b62
cmpl $0x94, -0x10(%rbp)
jne 0x12b62
movl $0x1, -0x4(%rbp)
jmp 0x12ead
jmp 0x12d69
cmpl $0x1, 0x478fa(%rip)     # 0x5a468
jne 0x12c11
movl -0x8(%rbp), %eax
movl %eax, -0x64(%rbp)
subl $0xe2, %eax
je 0x12b8f
jmp 0x12b83
movl -0x64(%rbp), %eax
subl $0xe3, %eax
je 0x12bec
jmp 0x12c0c
movl -0xc(%rbp), %eax
movl %eax, -0x68(%rbp)
subl $0x80, %eax
je 0x12baa
jmp 0x12b9e
movl -0x68(%rbp), %eax
subl $0x88, %eax
je 0x12bd3
jmp 0x12bea
cmpl $0x94, -0x10(%rbp)
je 0x12bc5
cmpl $0x96, -0x10(%rbp)
je 0x12bc5
cmpl $0xbe, -0x10(%rbp)
jne 0x12bd1
movl $0x1, -0x4(%rbp)
jmp 0x12ead
jmp 0x12bea
cmpl $0x92, -0x10(%rbp)
jne 0x12be8
movl $0x1, -0x4(%rbp)
jmp 0x12ead
jmp 0x12bea
jmp 0x12c0c
cmpl $0x80, -0xc(%rbp)
je 0x12bfe
cmpl $0x9c, -0x10(%rbp)
jne 0x12c0a
movl $0x1, -0x4(%rbp)
jmp 0x12ead
jmp 0x12c0c
jmp 0x12d67
cmpl $0x3, 0x47850(%rip)     # 0x5a468
jne 0x12c76
movl -0x8(%rbp), %eax
subl $0xe3, %eax
jne 0x12c71
jmp 0x12c26
movl -0xc(%rbp), %eax
movl %eax, -0x6c(%rbp)
subl $0x82, %eax
je 0x12c41
jmp 0x12c35
movl -0x6c(%rbp), %eax
subl $0x83, %eax
je 0x12c58
jmp 0x12c6f
cmpl $0x94, -0x10(%rbp)
jne 0x12c56
movl $0x1, -0x4(%rbp)
jmp 0x12ead
jmp 0x12c6f
cmpl $0xbb, -0x10(%rbp)
jne 0x12c6d
movl $0x1, -0x4(%rbp)
jmp 0x12ead
jmp 0x12c6f
jmp 0x12c71
jmp 0x12d65
movl -0x8(%rbp), %eax
movl %eax, -0x70(%rbp)
subl $0xe2, %eax
je 0x12c94
jmp 0x12c85
movl -0x70(%rbp), %eax
subl $0xef, %eax
je 0x12ce2
jmp 0x12d63
movl -0xc(%rbp), %eax
movl %eax, -0x74(%rbp)
subl $0x80, %eax
je 0x12caf
jmp 0x12ca3
movl -0x74(%rbp), %eax
subl $0x88, %eax
je 0x12cc6
jmp 0x12cdd
cmpl $0x95, -0x10(%rbp)
jne 0x12cc4
movl $0x1, -0x4(%rbp)
jmp 0x12ead
jmp 0x12cdd
cmpl $0xa5, -0x10(%rbp)
jne 0x12cdb
movl $0x1, -0x4(%rbp)
jmp 0x12ead
jmp 0x12cdd
jmp 0x12d63
movl -0xc(%rbp), %eax
movl %eax, -0x78(%rbp)
subl $0xbc, %eax
je 0x12d09
jmp 0x12cf1
movl -0x78(%rbp), %eax
subl $0xbd, %eax
je 0x12d20
jmp 0x12cfd
movl -0x78(%rbp), %eax
subl $0xbf, %eax
je 0x12d40
jmp 0x12d61
cmpl $0x8d, -0x10(%rbp)
jne 0x12d1e
movl $0x1, -0x4(%rbp)
jmp 0x12ead
jmp 0x12d61
cmpl $0x9e, -0x10(%rbp)
jne 0x12d3e
cmpl $0x0, 0x3f570(%rip)     # 0x522a0
jne 0x12d3e
movl $0x1, -0x4(%rbp)
jmp 0x12ead
jmp 0x12d61
movl $0xa0, %eax
cmpl -0x10(%rbp), %eax
jg 0x12d5f
cmpl $0xa5, -0x10(%rbp)
jg 0x12d5f
movl $0x1, -0x4(%rbp)
jmp 0x12ead
jmp 0x12d61
jmp 0x12d63
jmp 0x12d65
jmp 0x12d67
jmp 0x12d69
jmp 0x12d6b
cmpl $0x2, 0x476f6(%rip)     # 0x5a468
jne 0x12d81
leaq 0x3c9f5(%rip), %rax     # 0x4f770
movq %rax, -0x80(%rbp)
jmp 0x12dee
cmpl $0x1, 0x476e0(%rip)     # 0x5a468
jne 0x12d9a
leaq 0x3c95f(%rip), %rax     # 0x4f6f0
movq %rax, -0x88(%rbp)
jmp 0x12de3
cmpl $0x3, 0x476c7(%rip)     # 0x5a468
jne 0x12db3
leaq 0x3ca46(%rip), %rax     # 0x4f7f0
movq %rax, -0x90(%rbp)
jmp 0x12dd5
movl 0x3f663(%rip), %edx     # 0x5241c
leaq 0x3c6b0(%rip), %rax     # 0x4f470
leaq 0x3dca9(%rip), %rcx     # 0x50a70
cmpl $0x0, %edx
cmovneq %rcx, %rax
movq %rax, -0x90(%rbp)
movq -0x90(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x88(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x80(%rbp), %rax
movq %rax, -0x30(%rbp)
movl -0xc(%rbp), %edi
movl -0x10(%rbp), %esi
movq -0x30(%rbp), %rax
movl -0x8(%rbp), %ecx
subl $0xe0, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdx
movq -0x18(%rbp), %r8
movq -0x20(%rbp), %r9
movl $0x40, %ecx
callq 0x12ec0
movl %eax, -0x34(%rbp)
jmp 0x12e30
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x12ead
jmp 0x12e32
jmp 0x12e34
cmpl $0x0, -0x34(%rbp)
jne 0x12ea7
movq -0x18(%rbp), %rax
movl (%rax), %eax
movzwl %ax, %eax
sarl $0x8, %eax
cmpl $0x8f, %eax
jne 0x12ea7
cmpl $0x0, 0x3f44c(%rip)     # 0x522a0
je 0x12e69
cmpq $0x0, 0x47612(%rip)     # 0x5a470
je 0x12e67
movl $0x1, -0x34(%rbp)
jmp 0x12ea5
movq -0x18(%rbp), %rax
movl (%rax), %edi
movq -0x20(%rbp), %rax
movl (%rax), %esi
leaq -0x38(%rbp), %rdx
leaq -0x3c(%rbp), %rcx
callq 0x11f30
cmpl $0x0, %eax
jne 0x12e9c
movl -0x38(%rbp), %edi
movl -0x3c(%rbp), %esi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
callq 0x121e0
jmp 0x12ea3
movl $0x1, -0x34(%rbp)
jmp 0x12ea5
jmp 0x12ea7
movl -0x34(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x90, %rsp
popq %rbp
retq
nopl (%rax)