// File: /workspace/github_c_makefile_star2_O3/nurse[P]nkf/nkf.c
// Function: s_oconv
static void
s_oconv(nkf_char c2, nkf_char c1)
{
#ifdef NUMCHAR_OPTION
    if (c2 == 0 && nkf_char_unicode_p(c1)){
	w16e_conv(c1, &c2, &c1);
	if (c2 == 0 && nkf_char_unicode_p(c1)){
	    c2 = c1 & VALUE_MASK;
	    if (!x0213_f && 0xE000 <= c2 && c2 <= 0xE757) {
		/* CP932 UDC */
		c1 &= 0xFFF;
		c2 = c1 / 188 + (cp932inv_f ? 0xF0 : 0xEB);
		c1 = c1 % 188;
		c1 += 0x40 + (c1 > 0x3e);
		(*o_putc)(c2);
		(*o_putc)(c1);
		return;
	    } else {
		if(encode_fallback)(*encode_fallback)(c1);
		return;
	    }
	}
    }
#endif
    if (c2 == EOF) {
	(*o_putc)(EOF);
	return;
    } else if (c2 == 0) {
	output_mode = ASCII;
	(*o_putc)(c1);
    } else if (c2 == JIS_X_0201_1976_K) {
	output_mode = SHIFT_JIS;
	(*o_putc)(c1|0x80);
    } else if (c2 == ISO_8859_1) {
	output_mode = ISO_8859_1;
	(*o_putc)(c1 | 0x080);
#ifdef X0212_ENABLE
    } else if (is_eucg3(c2)){
	output_mode = SHIFT_JIS;
	if (e2s_conv(c2, c1, &c2, &c1) == 0){
	    (*o_putc)(c2);
	    (*o_putc)(c1);
	}
#endif
    } else {
	if (!nkf_isprint(c1) || !nkf_isprint(c2)) {
	    set_iconv(FALSE, 0);
	    return; /* too late to rescue this char */
	}
	output_mode = SHIFT_JIS;
	e2s_conv(c2, c1, &c2, &c1);

#ifdef SHIFTJIS_CP932
	if (cp932inv_f
	    && CP932INV_TABLE_BEGIN <= c2 && c2 <= CP932INV_TABLE_END){
	    nkf_char c = cp932inv[c2 - CP932INV_TABLE_BEGIN][c1 - 0x40];
	    if (c){
		c2 = c >> 8;
		c1 = c & 0xff;
	    }
	}
#endif /* SHIFTJIS_CP932 */

	(*o_putc)(c2);
	if (prefix_table[(unsigned char)c1]){
	    (*o_putc)(prefix_table[(unsigned char)c1]);
	}
	(*o_putc)(c1);
    }
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movl %edi, 0xc(%rsp)
movl %esi, 0x8(%rsp)
movl %esi, %eax
andl $0xff000000, %eax       # imm = 0xFF000000
xorl $0x1000000, %eax        # imm = 0x1000000
orl %edi, %eax
jne 0xcc91
leaq 0xc(%rsp), %rbx
leaq 0x8(%rsp), %rdx
movl %esi, %edi
movq %rbx, %rsi
callq 0x1191d
movl (%rbx), %edi
testl %edi, %edi
je 0xcccf
testl %edi, %edi
jg 0xccab
cmpl $-0x1, %edi
je 0xcd98
testl %edi, %edi
je 0xcd4f
jmp 0xcd5b
cmpl $0x1, %edi
je 0xcd9f
cmpl $0x1013, %edi           # imm = 0x1013
jne 0xcd5b
movl $0x9, 0x48752(%rip)     # 0x5541c
jmp 0xcda9
movl 0x8(%rsp), %edi
movl %edi, %eax
andl $0xff000000, %eax       # imm = 0xFF000000
cmpl $0x1000000, %eax        # imm = 0x1000000
jne 0xcd4f
movl %edi, %eax
andl $0xffffff, %eax         # imm = 0xFFFFFF
movl %eax, 0xc(%rsp)
addl $0xffff18a8, %eax       # imm = 0xFFFF18A8
cmpl $0xfffff8a8, %eax       # imm = 0xFFFFF8A8
jb 0xce74
testb $0x1, 0x406b9(%rip)     # 0x4d3bc
jne 0xce74
xorl %eax, %eax
cmpl $0x0, 0x405ae(%rip)     # 0x4d2c0
setne %al
leal (%rax,%rax,4), %eax
andl $0xfff, %edi            # imm = 0xFFF
imull $0xae5, %edi, %ecx      # imm = 0xAE5
shrl $0x13, %ecx
addl %ecx, %eax
addl $0xeb, %eax
movl %eax, 0xc(%rsp)
imull $0xbc, %ecx, %ecx
subl %ecx, %edi
movzwl %di, %ecx
cmpw $0x3f, %cx
sbbl $-0x1, %ecx
addl $0x40, %ecx
movl %ecx, 0x8(%rsp)
movl %eax, %edi
jmp 0xcd8c
movl $0x0, 0x486c3(%rip)     # 0x5541c
jmp 0xcd92
movl %edi, %eax
andl $0xff00, %eax           # imm = 0xFF00
cmpl $0x8f00, %eax           # imm = 0x8F00
jne 0xcdbe
movl $0x9, 0x486a9(%rip)     # 0x5541c
leaq 0x8(%rsp), %rcx
movl (%rcx), %esi
leaq 0xc(%rsp), %rdx
callq 0x10f30
testl %eax, %eax
jne 0xcdb8
movl 0xc(%rsp), %edi
callq *0x40536(%rip)          # 0x4d2c8
movl 0x8(%rsp), %edi
jmp 0xcdb2
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
jmp 0xcdb2
movl $0x1, 0x48673(%rip)     # 0x5541c
movl $0x80, %edi
orl 0x8(%rsp), %edi
callq *0x40510(%rip)          # 0x4d2c8
addq $0x10, %rsp
popq %rbx
retq
movl 0x8(%rsp), %esi
leal -0x20(%rsi), %eax
cmpl $0x5f, %eax
setb %al
leal -0x20(%rdi), %ecx
cmpl $0x5f, %ecx
setb %cl
testb %al, %cl
je 0xce8b
movl $0x9, 0x48636(%rip)     # 0x5541c
leaq 0xc(%rsp), %rbx
leaq 0x8(%rsp), %rcx
movq %rbx, %rdx
callq 0x10f30
cmpl $0x0, 0x404c1(%rip)     # 0x4d2c0
setne %cl
movl (%rbx), %edi
movl %edi, %eax
addl $0xffffff13, %eax       # imm = 0xFFFFFF13
cmpl $0x2, %eax
setb %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0xce46
movl %eax, %eax
movslq 0x8(%rsp), %rcx
imulq $0x17a, %rax, %rax      # imm = 0x17A
addq 0x40193(%rip), %rax     # 0x4cfc0
movzwl -0x80(%rax,%rcx,2), %eax
testl %eax, %eax
je 0xce46
movl %eax, %edi
shrl $0x8, %edi
movl %edi, 0xc(%rsp)
movzbl %al, %eax
movl %eax, 0x8(%rsp)
callq *0x4047c(%rip)          # 0x4d2c8
movl 0x8(%rsp), %edi
movzbl %dil, %eax
leaq 0x485d5(%rip), %rcx     # 0x55430
movzbl (%rax,%rcx), %eax
testl %eax, %eax
je 0xce6f
movl %eax, %edi
callq *0x4045d(%rip)          # 0x4d2c8
movl 0x8(%rsp), %edi
jmp 0xcdb2
movq 0x48595(%rip), %rax     # 0x55410
testq %rax, %rax
je 0xcdb8
callq *%rax
jmp 0xcdb8
xorl %edi, %edi
xorl %esi, %esi
callq 0x11c09
jmp 0xcdb8