// File: /workspace/github_c_makefile_star2_O3/nurse[P]nkf/nkf.c
// Function: z_conv
static void
z_conv(nkf_char c2, nkf_char c1)
{

    /* if (c2) c1 &= 0x7f; assertion */

    if (c2 == JIS_X_0201_1976_K && (c1 == 0x20 || c1 == 0x7D || c1 == 0x7E)) {
	(*o_zconv)(c2,c1);
	return;
    }

    if (x0201_f) {
	if (z_prev2 == JIS_X_0201_1976_K) {
	    if (c2 == JIS_X_0201_1976_K) {
		if (c1 == (0xde&0x7f)) { /* $BByE@(B */
		    z_prev2 = 0;
		    (*o_zconv)(dv[(z_prev1-SP)*2], dv[(z_prev1-SP)*2+1]);
		    return;
		} else if (c1 == (0xdf&0x7f) && ev[(z_prev1-SP)*2]) {  /* $BH>ByE@(B */
		    z_prev2 = 0;
		    (*o_zconv)(ev[(z_prev1-SP)*2], ev[(z_prev1-SP)*2+1]);
		    return;
		} else if (x0213_f && c1 == (0xdf&0x7f) && ev_x0213[(z_prev1-SP)*2]) {  /* $BH>ByE@(B */
		    z_prev2 = 0;
		    (*o_zconv)(ev_x0213[(z_prev1-SP)*2], ev_x0213[(z_prev1-SP)*2+1]);
		    return;
		}
	    }
	    z_prev2 = 0;
	    (*o_zconv)(cv[(z_prev1-SP)*2], cv[(z_prev1-SP)*2+1]);
	}
	if (c2 == JIS_X_0201_1976_K) {
	    if (dv[(c1-SP)*2] || ev[(c1-SP)*2] || (x0213_f && ev_x0213[(c1-SP)*2])) {
		/* wait for $BByE@(B or $BH>ByE@(B */
		z_prev1 = c1;
		z_prev2 = c2;
		return;
	    } else {
		(*o_zconv)(cv[(c1-SP)*2], cv[(c1-SP)*2+1]);
		return;
	    }
	}
    }

    if (c2 == EOF) {
	(*o_zconv)(c2, c1);
	return;
    }

    if (alpha_f&1 && c2 == 0x23) {
	/* JISX0208 Alphabet */
	c2 = 0;
    } else if (c2 == 0x21) {
	/* JISX0208 Kigou */
	if (0x21==c1) {
	    if (alpha_f&2) {
		c2 = 0;
		c1 = SP;
	    } else if (alpha_f&4) {
		(*o_zconv)(0, SP);
		(*o_zconv)(0, SP);
		return;
	    }
	} else if (alpha_f&1 && 0x20<c1 && c1<0x7f && fv[c1-0x20]) {
	    c2 =  0;
	    c1 = fv[c1-0x20];
	}
    }

    if (alpha_f&8 && c2 == 0) {
	/* HTML Entity */
	const char *entity = 0;
	switch (c1){
	case '>': entity = "&gt;"; break;
	case '<': entity = "&lt;"; break;
	case '\"': entity = "&quot;"; break;
	case '&': entity = "&amp;"; break;
	}
	if (entity){
	    while (*entity) (*o_zconv)(0, *entity++);
	    return;
	}
    }

    if (alpha_f & 16) {
	/* JIS X 0208 Katakana to JIS X 0201 Katakana */
	if (c2 == 0x21) {
	    nkf_char c = 0;
	    switch (c1) {
	    case 0x23:
		/* U+3002 (0x8142) Ideographic Full Stop -> U+FF61 (0xA1) Halfwidth Ideographic Full Stop */
		c = 0xA1;
		break;
	    case 0x56:
		/* U+300C (0x8175) Left Corner Bracket -> U+FF62 (0xA2) Halfwidth Left Corner Bracket */
		c = 0xA2;
		break;
	    case 0x57:
		/* U+300D (0x8176) Right Corner Bracket -> U+FF63 (0xA3) Halfwidth Right Corner Bracket */
		c = 0xA3;
		break;
	    case 0x22:
		/* U+3001 (0x8141) Ideographic Comma -> U+FF64 (0xA4) Halfwidth Ideographic Comma */
		c = 0xA4;
		break;
	    case 0x26:
		/* U+30FB (0x8145) Katakana Middle Dot -> U+FF65 (0xA5) Halfwidth Katakana Middle Dot */
		c = 0xA5;
		break;
	    case 0x3C:
		/* U+30FC (0x815B) Katakana-Hiragana Prolonged Sound Mark -> U+FF70 (0xB0) Halfwidth Katakana-Hiragana Prolonged Sound Mark */
		c = 0xB0;
		break;
	    case 0x2B:
		/* U+309B (0x814A) Katakana-Hiragana Voiced Sound Mark -> U+FF9E (0xDE) Halfwidth Katakana Voiced Sound Mark */
		c = 0xDE;
		break;
	    case 0x2C:
		/* U+309C (0x814B) Katakana-Hiragana Semi-Voiced Sound Mark -> U+FF9F (0xDF) Halfwidth Katakana Semi-Voiced Sound Mark */
		c = 0xDF;
		break;
	    }
	    if (c) {
		(*o_zconv)(JIS_X_0201_1976_K, c);
		return;
	    }
	} else if (c2 == 0x25) {
	    /* JISX0208 Katakana */
	    static const int fullwidth_to_halfwidth[] =
	    {
		0x0000, 0x2700, 0x3100, 0x2800, 0x3200, 0x2900, 0x3300, 0x2A00,
		0x3400, 0x2B00, 0x3500, 0x3600, 0x365E, 0x3700, 0x375E, 0x3800,
		0x385E, 0x3900, 0x395E, 0x3A00, 0x3A5E, 0x3B00, 0x3B5E, 0x3C00,
		0x3C5E, 0x3D00, 0x3D5E, 0x3E00, 0x3E5E, 0x3F00, 0x3F5E, 0x4000,
		0x405E, 0x4100, 0x415E, 0x2F00, 0x4200, 0x425E, 0x4300, 0x435E,
		0x4400, 0x445E, 0x4500, 0x4600, 0x4700, 0x4800, 0x4900, 0x4A00,
		0x4A5E, 0x4A5F, 0x4B00, 0x4B5E, 0x4B5F, 0x4C00, 0x4C5E, 0x4C5F,
		0x4D00, 0x4D5E, 0x4D5F, 0x4E00, 0x4E5E, 0x4E5F, 0x4F00, 0x5000,
		0x5100, 0x5200, 0x5300, 0x2C00, 0x5400, 0x2D00, 0x5500, 0x2E00,
		0x5600, 0x5700, 0x5800, 0x5900, 0x5A00, 0x5B00, 0x0000, 0x5C00,
		0x0000, 0x0000, 0x2600, 0x5D00, 0x335E, 0x0000, 0x0000, 0x365F,
		0x375F, 0x385F, 0x395F, 0x3A5F, 0x3E5F, 0x425F, 0x445F, 0x0000
	    };
	    if (fullwidth_to_halfwidth[c1-0x20]){
		c2 = fullwidth_to_halfwidth[c1-0x20];
		(*o_zconv)(JIS_X_0201_1976_K, c2>>8);
		if (c2 & 0xFF) {
		    (*o_zconv)(JIS_X_0201_1976_K, c2&0xFF);
		}
		return;
	    }
	} else if (c2 == 0 && nkf_char_unicode_p(c1) &&
	    ((c1&VALUE_MASK) == 0x3099 || (c1&VALUE_MASK) == 0x309A)) { /* $B9g@.MQByE@!&H>ByE@(B */
	    (*o_zconv)(JIS_X_0201_1976_K, 0x5E + (c1&VALUE_MASK) - 0x3099);
	    return;
	}
    }
    (*o_zconv)(c2,c1);
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %esi, %ebx
movl %edi, %ebp
cmpl $0x1013, %edi           # imm = 0x1013
jne 0x13fb5
leal -0x7d(%rbx), %eax
cmpl $0x2, %eax
jb 0x13fa4
cmpl $0x20, %ebx
jne 0x13fb5
movq 0x39345(%rip), %rax     # 0x4d2f0
movl $0x1013, %edi           # imm = 0x1013
jmp 0x141d5
cmpl $0x0, 0x392f4(%rip)     # 0x4d2b0
je 0x140ec
cmpb $0x1, 0x41637(%rip)     # 0x55600
jne 0x140ab
cmpl $0x1013, %ebp           # imm = 0x1013
jne 0x14076
cmpl $0x5f, %ebx
je 0x14025
cmpl $0x5e, %ebx
jne 0x14076
movb $0x0, 0x41610(%rip)     # 0x55600
movq 0x392f9(%rip), %rax     # 0x4d2f0
movl 0x41607(%rip), %ecx     # 0x55604
leal -0x40(,%rcx,2), %edx
movslq %edx, %rdx
leaq 0x3782(%rip), %rsi      # 0x17790
movzbl (%rdx,%rsi), %edi
leal -0x3f(,%rcx,2), %ecx
movslq %ecx, %rcx
movzbl (%rcx,%rsi), %esi
jmp 0x141d7
movl 0x415d9(%rip), %eax     # 0x55604
leal -0x40(,%rax,2), %ecx
addl %eax, %eax
movslq %ecx, %rcx
leaq 0x37e2(%rip), %rdx      # 0x17820
movzbl (%rcx,%rdx), %edi
testl %edi, %edi
je 0x1405e
movb $0x0, 0x415b3(%rip)     # 0x55600
movq 0x3929c(%rip), %rcx     # 0x4d2f0
addl $-0x3f, %eax
cltq
jmp 0x142ce
cmpb $0x1, 0x39357(%rip)     # 0x4d3bc
jne 0x14076
leaq 0x3842(%rip), %rdx      # 0x178b0
movzbl (%rcx,%rdx), %edi
testl %edi, %edi
jne 0x14046
movb $0x0, 0x41583(%rip)     # 0x55600
movl 0x41581(%rip), %eax     # 0x55604
leal -0x40(,%rax,2), %ecx
movslq %ecx, %rcx
leaq 0x34ec(%rip), %rdx      # 0x17580
movzbl (%rcx,%rdx), %edi
leal -0x3f(,%rax,2), %eax
cltq
movzbl (%rax,%rdx), %esi
callq *0x39245(%rip)          # 0x4d2f0
cmpl $0x1013, %ebp           # imm = 0x1013
jne 0x140ec
leal -0x40(,%rbx,2), %eax
cltq
leaq 0x36cd(%rip), %rcx      # 0x17790
cmpb $0x0, (%rax,%rcx)
jne 0x140da
leaq 0x3750(%rip), %rcx      # 0x17820
cmpb $0x0, (%rax,%rcx)
je 0x1429a
movl %ebx, 0x41524(%rip)     # 0x55604
movb $0x1, 0x41519(%rip)     # 0x55600
jmp 0x14307
cmpl $-0x1, %ebp
je 0x1412a
movl 0x41479(%rip), %eax     # 0x55570
cmpl $0x23, %ebp
sete %cl
xorl %edi, %edi
testb %al, %cl
jne 0x1413d
cmpl $0x21, %ebp
jne 0x1413b
cmpl $0x21, %ebx
jne 0x1418b
movl $0x20, %ebx
testb $0x2, %al
jne 0x1413d
testb $0x4, %al
jne 0x14328
movl $0x21, %ebx
xorl %ecx, %ecx
jmp 0x141c5
movq 0x391bf(%rip), %rax     # 0x4d2f0
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
jmp 0x141d5
movl %ebp, %edi
testl %edi, %edi
sete %cl
testb $0x8, %al
je 0x141ca
testl %edi, %edi
jne 0x141ca
xorl %edi, %edi
movb $0x1, %cl
cmpl $0x3b, %ebx
jg 0x14171
cmpl $0x22, %ebx
je 0x142da
cmpl $0x26, %ebx
jne 0x141ca
leaq 0x45e5(%rip), %rbx      # 0x18751
jmp 0x142ea
cmpl $0x3e, %ebx
je 0x142e3
cmpl $0x3c, %ebx
jne 0x141ca
leaq 0x45bf(%rip), %rbx      # 0x18745
jmp 0x142ea
testb $0x1, %al
sete %dl
leal -0x21(%rbx), %ecx
cmpl $0x5e, %ecx
setae %sil
xorl %ecx, %ecx
orb %dl, %sil
jne 0x141c5
leal -0x20(%rbx), %edx
leaq 0x3795(%rip), %rsi      # 0x17940
movzbl (%rdx,%rsi), %edx
testl %edx, %edx
movl $0x21, %esi
cmovel %esi, %ecx
cmovel %ebx, %edx
movl %ecx, %edi
movl %edx, %ebx
jmp 0x1413d
movl $0x21, %edi
testb $0x10, %al
jne 0x141df
movq 0x3911b(%rip), %rax     # 0x4d2f0
movl %ebx, %esi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmpq *%rax
cmpl $0x25, %edi
je 0x14214
cmpl $0x21, %edi
jne 0x14252
cmpl $0x3b, %ebx
jg 0x1430e
leal -0x22(%rbx), %eax
cmpl $0xa, %eax
ja 0x141ce
leaq 0x30f3(%rip), %rcx      # 0x172f4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0xa4, %esi
jmp 0x14370
movslq %ebx, %rax
leaq 0x33f2(%rip), %rcx      # 0x17610
movl -0x80(%rcx,%rax,4), %ebp
testl %ebp, %ebp
je 0x141ce
movl %ebp, %esi
sarl $0x8, %esi
movl $0x1013, %edi           # imm = 0x1013
callq *0x390ba(%rip)          # 0x4d2f0
andl $0xff, %ebp
je 0x14307
movq 0x390a7(%rip), %rax     # 0x4d2f0
movl $0x1013, %edi           # imm = 0x1013
movl %ebp, %esi
jmp 0x141d7
movl %ebx, %eax
andl $0xff000000, %eax       # imm = 0xFF000000
cmpl $0x1000000, %eax        # imm = 0x1000000
setne %al
xorb $0x1, %cl
orb %al, %cl
jne 0x141ce
movl %ebx, %esi
andl $0xffffff, %esi         # imm = 0xFFFFFF
leal -0x3099(%rsi), %eax
cmpl $0x1, %eax
ja 0x141ce
movq 0x39066(%rip), %rax     # 0x4d2f0
addl $0xffffcfc5, %esi       # imm = 0xFFFFCFC5
movl $0x1013, %edi           # imm = 0x1013
jmp 0x141d7
cmpb $0x1, 0x3911b(%rip)     # 0x4d3bc
jne 0x142b4
leaq 0x3606(%rip), %rcx      # 0x178b0
cmpb $0x0, (%rax,%rcx)
jne 0x140da
addl %ebx, %ebx
movq 0x39033(%rip), %rcx     # 0x4d2f0
leaq 0x32bc(%rip), %rdx      # 0x17580
movzbl (%rax,%rdx), %edi
addl $-0x3f, %ebx
movslq %ebx, %rax
movzbl (%rax,%rdx), %esi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmpq *%rcx
leaq 0x4469(%rip), %rbx      # 0x1874a
jmp 0x142ea
leaq 0x4456(%rip), %rbx      # 0x18740
movb (%rbx), %al
testb %al, %al
je 0x14307
incq %rbx
movsbl %al, %esi
xorl %edi, %edi
callq *0x38ff2(%rip)          # 0x4d2f0
movb (%rbx), %al
incq %rbx
testb %al, %al
jne 0x142f3
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
cmpl $0x3c, %ebx
je 0x14364
cmpl $0x57, %ebx
je 0x1436b
cmpl $0x56, %ebx
jne 0x141ce
movl $0xa2, %esi
jmp 0x14370
xorl %edi, %edi
movl $0x20, %esi
callq *0x38fbb(%rip)          # 0x4d2f0
movq 0x38fb4(%rip), %rax     # 0x4d2f0
xorl %edi, %edi
movl $0x20, %esi
jmp 0x141d7
movl $0xde, %esi
jmp 0x14370
movl $0xa5, %esi
jmp 0x14370
movl $0xa1, %esi
jmp 0x14370
movl $0xdf, %esi
jmp 0x14370
movl $0xb0, %esi
jmp 0x14370
movl $0xa3, %esi
movq 0x38f79(%rip), %rax     # 0x4d2f0
movl $0x1013, %edi           # imm = 0x1013
jmp 0x141d7