// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x30, %rsp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
cmpl $0x1013, -0x4(%rbp)     # imm = 0x1013
jne 0x16b2d
cmpl $0x20, -0x8(%rbp)
je 0x16b19
cmpl $0x7d, -0x8(%rbp)
je 0x16b19
cmpl $0x7e, -0x8(%rbp)
jne 0x16b2d
movq 0x3b7b0(%rip), %rax     # 0x522d0
movl -0x4(%rbp), %edi
movl -0x8(%rbp), %esi
callq *%rax
jmp 0x170d2
cmpl $0x0, 0x3b75c(%rip)     # 0x52290
je 0x16da0
cmpl $0x1013, 0x43b20(%rip)  # imm = 0x1013
jne 0x16ce3
cmpl $0x1013, -0x4(%rbp)     # imm = 0x1013
jne 0x16c9b
cmpl $0x5e, -0x8(%rbp)
jne 0x16baa
movl $0x0, 0x43afd(%rip)     # 0x5a664
movq 0x3b762(%rip), %rax     # 0x522d0
movl 0x43af4(%rip), %ecx     # 0x5a668
subl $0x20, %ecx
shll %ecx
movslq %ecx, %rdx
leaq 0x601d(%rip), %rcx      # 0x1cba0
movzbl (%rcx,%rdx), %edi
movl 0x43adb(%rip), %ecx     # 0x5a668
subl $0x20, %ecx
shll %ecx
addl $0x1, %ecx
movslq %ecx, %rdx
leaq 0x6001(%rip), %rcx      # 0x1cba0
movzbl (%rcx,%rdx), %esi
callq *%rax
jmp 0x170d2
cmpl $0x5f, -0x8(%rbp)
jne 0x16c1b
movl 0x43ab2(%rip), %eax     # 0x5a668
subl $0x20, %eax
shll %eax
movslq %eax, %rcx
leaq 0x606b(%rip), %rax      # 0x1cc30
movzbl (%rax,%rcx), %eax
cmpl $0x0, %eax
je 0x16c1b
movl $0x0, 0x43a8c(%rip)     # 0x5a664
movq 0x3b6f1(%rip), %rax     # 0x522d0
movl 0x43a83(%rip), %ecx     # 0x5a668
subl $0x20, %ecx
shll %ecx
movslq %ecx, %rdx
leaq 0x603c(%rip), %rcx      # 0x1cc30
movzbl (%rcx,%rdx), %edi
movl 0x43a6a(%rip), %ecx     # 0x5a668
subl $0x20, %ecx
shll %ecx
addl $0x1, %ecx
movslq %ecx, %rdx
leaq 0x6020(%rip), %rcx      # 0x1cc30
movzbl (%rcx,%rdx), %esi
callq *%rax
jmp 0x170d2
cmpl $0x0, 0x3b7fa(%rip)     # 0x5241c
je 0x16c95
cmpl $0x5f, -0x8(%rbp)
jne 0x16c95
movl 0x43a38(%rip), %eax     # 0x5a668
subl $0x20, %eax
shll %eax
movslq %eax, %rcx
leaq 0x6081(%rip), %rax      # 0x1ccc0
movzbl (%rax,%rcx), %eax
cmpl $0x0, %eax
je 0x16c95
movl $0x0, 0x43a12(%rip)     # 0x5a664
movq 0x3b677(%rip), %rax     # 0x522d0
movl 0x43a09(%rip), %ecx     # 0x5a668
subl $0x20, %ecx
shll %ecx
movslq %ecx, %rdx
leaq 0x6052(%rip), %rcx      # 0x1ccc0
movzbl (%rcx,%rdx), %edi
movl 0x439f0(%rip), %ecx     # 0x5a668
subl $0x20, %ecx
shll %ecx
addl $0x1, %ecx
movslq %ecx, %rdx
leaq 0x6036(%rip), %rcx      # 0x1ccc0
movzbl (%rcx,%rdx), %esi
callq *%rax
jmp 0x170d2
jmp 0x16c97
jmp 0x16c99
jmp 0x16c9b
movl $0x0, 0x439bf(%rip)     # 0x5a664
movq 0x3b624(%rip), %rax     # 0x522d0
movl 0x439b6(%rip), %ecx     # 0x5a668
subl $0x20, %ecx
shll %ecx
movslq %ecx, %rdx
leaq 0x5ccf(%rip), %rcx      # 0x1c990
movzbl (%rcx,%rdx), %edi
movl 0x4399d(%rip), %ecx     # 0x5a668
subl $0x20, %ecx
shll %ecx
addl $0x1, %ecx
movslq %ecx, %rdx
leaq 0x5cb3(%rip), %rcx      # 0x1c990
movzbl (%rcx,%rdx), %esi
callq *%rax
cmpl $0x1013, -0x4(%rbp)     # imm = 0x1013
jne 0x16d9e
movl -0x8(%rbp), %eax
subl $0x20, %eax
shll %eax
movslq %eax, %rcx
leaq 0x5e9e(%rip), %rax      # 0x1cba0
movzbl (%rax,%rcx), %eax
cmpl $0x0, %eax
jne 0x16d4a
movl -0x8(%rbp), %eax
subl $0x20, %eax
shll %eax
movslq %eax, %rcx
leaq 0x5f13(%rip), %rax      # 0x1cc30
movzbl (%rax,%rcx), %eax
cmpl $0x0, %eax
jne 0x16d4a
cmpl $0x0, 0x3b6ef(%rip)     # 0x5241c
je 0x16d61
movl -0x8(%rbp), %eax
subl $0x20, %eax
shll %eax
movslq %eax, %rcx
leaq 0x5f7f(%rip), %rax      # 0x1ccc0
movzbl (%rax,%rcx), %eax
cmpl $0x0, %eax
je 0x16d61
movl -0x8(%rbp), %eax
movl %eax, 0x43915(%rip)     # 0x5a668
movl -0x4(%rbp), %eax
movl %eax, 0x43908(%rip)     # 0x5a664
jmp 0x170d2
movq 0x3b568(%rip), %rax     # 0x522d0
movl -0x8(%rbp), %ecx
subl $0x20, %ecx
shll %ecx
movslq %ecx, %rdx
leaq 0x5c16(%rip), %rcx      # 0x1c990
movzbl (%rcx,%rdx), %edi
movl -0x8(%rbp), %ecx
subl $0x20, %ecx
shll %ecx
addl $0x1, %ecx
movslq %ecx, %rdx
leaq 0x5bfd(%rip), %rcx      # 0x1c990
movzbl (%rcx,%rdx), %esi
callq *%rax
jmp 0x170d2
jmp 0x16da0
cmpl $-0x1, -0x4(%rbp)
jne 0x16dba
movq 0x3b523(%rip), %rax     # 0x522d0
movl -0x4(%rbp), %edi
movl -0x8(%rbp), %esi
callq *%rax
jmp 0x170d2
movl 0x43810(%rip), %eax     # 0x5a5d0
andl $0x1, %eax
cmpl $0x0, %eax
je 0x16dda
cmpl $0x23, -0x4(%rbp)
jne 0x16dda
movl $0x0, -0x4(%rbp)
jmp 0x16e98
cmpl $0x21, -0x4(%rbp)
jne 0x16e96
movl $0x21, %eax
cmpl -0x8(%rbp), %eax
jne 0x16e3d
movl 0x437dc(%rip), %eax     # 0x5a5d0
andl $0x2, %eax
cmpl $0x0, %eax
je 0x16e0c
movl $0x0, -0x4(%rbp)
movl $0x20, -0x8(%rbp)
jmp 0x16e3b
movl 0x437be(%rip), %eax     # 0x5a5d0
andl $0x4, %eax
cmpl $0x0, %eax
je 0x16e39
xorl %edi, %edi
movl $0x20, %esi
callq *0x3b4a9(%rip)          # 0x522d0
xorl %edi, %edi
movl $0x20, %esi
callq *0x3b49c(%rip)          # 0x522d0
jmp 0x170d2
jmp 0x16e3b
jmp 0x16e94
movl 0x4378d(%rip), %eax     # 0x5a5d0
andl $0x1, %eax
cmpl $0x0, %eax
je 0x16e92
movl $0x20, %eax
cmpl -0x8(%rbp), %eax
jge 0x16e92
cmpl $0x7f, -0x8(%rbp)
jge 0x16e92
movl -0x8(%rbp), %eax
subl $0x20, %eax
movslq %eax, %rcx
leaq 0x5ee5(%rip), %rax      # 0x1cd50
movzbl (%rax,%rcx), %eax
cmpl $0x0, %eax
je 0x16e92
movl $0x0, -0x4(%rbp)
movl -0x8(%rbp), %eax
subl $0x20, %eax
movslq %eax, %rcx
leaq 0x5ec5(%rip), %rax      # 0x1cd50
movzbl (%rax,%rcx), %eax
movl %eax, -0x8(%rbp)
jmp 0x16e94
jmp 0x16e96
jmp 0x16e98
movl 0x43732(%rip), %eax     # 0x5a5d0
andl $0x8, %eax
cmpl $0x0, %eax
je 0x16f4b
cmpl $0x0, -0x4(%rbp)
jne 0x16f4b
movq $0x0, -0x10(%rbp)
movl -0x8(%rbp), %eax
addl $-0x22, %eax
movl %eax, %ecx
movq %rcx, -0x20(%rbp)
subl $0x1c, %eax
ja 0x16f13
movq -0x20(%rbp), %rax
leaq 0x54bc(%rip), %rcx      # 0x1c394
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x6c6f(%rip), %rax      # 0x1db57
movq %rax, -0x10(%rbp)
jmp 0x16f13
leaq 0x6c67(%rip), %rax      # 0x1db5c
movq %rax, -0x10(%rbp)
jmp 0x16f13
leaq 0x6c5f(%rip), %rax      # 0x1db61
movq %rax, -0x10(%rbp)
jmp 0x16f13
leaq 0x6c59(%rip), %rax      # 0x1db68
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x16f49
jmp 0x16f1c
movq -0x10(%rbp), %rax
cmpb $0x0, (%rax)
je 0x16f44
movq 0x3b3a4(%rip), %rax     # 0x522d0
movq -0x10(%rbp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, -0x10(%rbp)
movsbl (%rcx), %esi
xorl %edi, %edi
callq *%rax
jmp 0x16f1c
jmp 0x170d2
jmp 0x16f4b
movl 0x4367f(%rip), %eax     # 0x5a5d0
andl $0x10, %eax
cmpl $0x0, %eax
je 0x170c3
cmpl $0x21, -0x4(%rbp)
jne 0x16ffa
movl $0x0, -0x14(%rbp)
movl -0x8(%rbp), %eax
addl $-0x22, %eax
movl %eax, %ecx
movq %rcx, -0x28(%rbp)
subl $0x35, %eax
ja 0x16fd9
movq -0x28(%rbp), %rax
leaq 0x547e(%rip), %rcx      # 0x1c408
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0xa1, -0x14(%rbp)
jmp 0x16fd9
movl $0xa2, -0x14(%rbp)
jmp 0x16fd9
movl $0xa3, -0x14(%rbp)
jmp 0x16fd9
movl $0xa4, -0x14(%rbp)
jmp 0x16fd9
movl $0xa5, -0x14(%rbp)
jmp 0x16fd9
movl $0xb0, -0x14(%rbp)
jmp 0x16fd9
movl $0xde, -0x14(%rbp)
jmp 0x16fd9
movl $0xdf, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
je 0x16ff5
movq 0x3b2ea(%rip), %rax     # 0x522d0
movl -0x14(%rbp), %esi
movl $0x1013, %edi           # imm = 0x1013
callq *%rax
jmp 0x170d2
jmp 0x170c1
cmpl $0x25, -0x4(%rbp)
jne 0x17068
movl -0x8(%rbp), %eax
subl $0x20, %eax
movslq %eax, %rcx
leaq 0x5a10(%rip), %rax      # 0x1ca20
cmpl $0x0, (%rax,%rcx,4)
je 0x17066
movl -0x8(%rbp), %eax
subl $0x20, %eax
movslq %eax, %rcx
leaq 0x59fa(%rip), %rax      # 0x1ca20
movl (%rax,%rcx,4), %eax
movl %eax, -0x4(%rbp)
movq 0x3b29d(%rip), %rax     # 0x522d0
movl -0x4(%rbp), %esi
sarl $0x8, %esi
movl $0x1013, %edi           # imm = 0x1013
callq *%rax
movl -0x4(%rbp), %eax
andl $0xff, %eax
cmpl $0x0, %eax
je 0x17064
movq 0x3b27c(%rip), %rax     # 0x522d0
movl -0x4(%rbp), %esi
andl $0xff, %esi
movl $0x1013, %edi           # imm = 0x1013
callq *%rax
jmp 0x170d2
jmp 0x170bf
cmpl $0x0, -0x4(%rbp)
jne 0x170bd
movl -0x8(%rbp), %eax
andl $0xff000000, %eax       # imm = 0xFF000000
cmpl $0x1000000, %eax        # imm = 0x1000000
jne 0x170bd
movl -0x8(%rbp), %eax
andl $0xffffff, %eax         # imm = 0xFFFFFF
cmpl $0x3099, %eax           # imm = 0x3099
je 0x1709b
movl -0x8(%rbp), %eax
andl $0xffffff, %eax         # imm = 0xFFFFFF
cmpl $0x309a, %eax           # imm = 0x309A
jne 0x170bd
movq 0x3b22e(%rip), %rax     # 0x522d0
movl -0x8(%rbp), %esi
andl $0xffffff, %esi         # imm = 0xFFFFFF
addl $0x5e, %esi
subl $0x3099, %esi           # imm = 0x3099
movl $0x1013, %edi           # imm = 0x1013
callq *%rax
jmp 0x170d2
jmp 0x170bf
jmp 0x170c1
jmp 0x170c3
movq 0x3b206(%rip), %rax     # 0x522d0
movl -0x4(%rbp), %edi
movl -0x8(%rbp), %esi
callq *%rax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)