// File: /workspace/github_c_makefile_star2_O2/nurse[P]nkf/nkf.c
// Function: s_status
static void
s_status(struct input_code *ptr, nkf_char c)
{
    switch(ptr->stat){
    case -1:
	status_check(ptr, c);
	break;
    case 0:
	if (c <= DEL){
	    break;
	}else if (nkf_char_unicode_p(c)){
	    break;
	}else if (0xa1 <= c && c <= 0xdf){
	    status_push_ch(ptr, SS2);
	    status_push_ch(ptr, c);
	    code_score(ptr);
	    status_clear(ptr);
	}else if ((0x81 <= c && c < 0xa0) || (0xe0 <= c && c <= 0xea)){
	    ptr->stat = 1;
	    status_push_ch(ptr, c);
	}else if (0xed <= c && c <= 0xee){
	    ptr->stat = 3;
	    status_push_ch(ptr, c);
#ifdef SHIFTJIS_CP932
	}else if (is_ibmext_in_sjis(c)){
	    ptr->stat = 2;
	    status_push_ch(ptr, c);
#endif /* SHIFTJIS_CP932 */
#ifdef X0212_ENABLE
	}else if (0xf0 <= c && c <= 0xfc){
	    ptr->stat = 1;
	    status_push_ch(ptr, c);
#endif /* X0212_ENABLE */
	}else{
	    status_disable(ptr);
	}
	break;
    case 1:
	if ((0x40 <= c && c <= 0x7e) || (0x80 <= c && c <= 0xfc)){
	    status_push_ch(ptr, c);
	    s2e_conv(ptr->buf[0], ptr->buf[1], &ptr->buf[0], &ptr->buf[1]);
	    code_score(ptr);
	    status_clear(ptr);
	}else{
	    status_disable(ptr);
	}
	break;
    case 2:
#ifdef SHIFTJIS_CP932
	if ((0x40 <= c && c <= 0x7e) || (0x80 <= c && c <= 0xfc)) {
	    status_push_ch(ptr, c);
	    if (s2e_conv(ptr->buf[0], ptr->buf[1], &ptr->buf[0], &ptr->buf[1]) == 0) {
		set_code_score(ptr, SCORE_CP932);
		status_clear(ptr);
		break;
	    }
	}
#endif /* SHIFTJIS_CP932 */
	status_disable(ptr);
	break;
    case 3:
	if ((0x40 <= c && c <= 0x7e) || (0x80 <= c && c <= 0xfc)){
	    status_push_ch(ptr, c);
	    s2e_conv(ptr->buf[0], ptr->buf[1], &ptr->buf[0], &ptr->buf[1]);
	    set_code_score(ptr, SCORE_CP932);
	    status_clear(ptr);
	}else{
	    status_disable(ptr);
	}
	break;
    }
}

// Assembly:
pushq %rbx
movl 0x8(%rdi), %eax
incl %eax
cmpl $0x4, %eax
ja 0xd67d
movq %rdi, %rbx
leaq 0x8b28(%rip), %rcx      # 0x16054
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
cmpl $0x7f, %esi
jg 0xd67d
cmpl $0x0, 0x46ed3(%rip)     # 0x54418
je 0xd67d
movabsq $0x8000000000, %rax     # imm = 0x8000000000
movq %rax, 0x8(%rbx)
jmp 0xd679
leal -0x40(%rsi), %eax
cmpl $0x3f, %eax
setae %al
leal -0x80(%rsi), %ecx
cmpl $0x7d, %ecx
setae %cl
testb %cl, %al
jne 0xd615
leaq 0x14(%rbx), %rdx
movslq 0x10(%rbx), %rax
leal 0x1(%rax), %ecx
movl %ecx, 0x10(%rbx)
movl %esi, 0x14(%rbx,%rax,4)
leaq 0x18(%rbx), %rcx
movl 0x14(%rbx), %edi
movl 0x18(%rbx), %esi
callq 0x10ea6
jmp 0xd671
leal -0x40(%rsi), %eax
cmpl $0x3f, %eax
setae %al
leal -0x80(%rsi), %ecx
cmpl $0x7d, %ecx
setae %cl
testb %cl, %al
jne 0xd615
leaq 0x14(%rbx), %rdx
movslq 0x10(%rbx), %rax
leal 0x1(%rax), %ecx
movl %ecx, 0x10(%rbx)
movl %esi, 0x14(%rbx,%rax,4)
leaq 0x18(%rbx), %rcx
movl 0x14(%rbx), %edi
movl 0x18(%rbx), %esi
callq 0x10ea6
jmp 0xd667
leal -0x40(%rsi), %eax
cmpl $0x3f, %eax
setae %al
leal -0x80(%rsi), %ecx
cmpl $0x7d, %ecx
setae %cl
testb %cl, %al
jne 0xd615
leaq 0x14(%rbx), %rdx
movslq 0x10(%rbx), %rax
leal 0x1(%rax), %ecx
movl %ecx, 0x10(%rbx)
movl %esi, 0x14(%rbx,%rax,4)
leaq 0x18(%rbx), %rcx
movl 0x14(%rbx), %edi
movl 0x18(%rbx), %esi
callq 0x10ea6
testl %eax, %eax
je 0xd671
movq %rbx, %rdi
popq %rbx
jmp 0x11d36
cmpl $0x80, %esi
setl %al
movl %esi, %ecx
andl $0x7f000000, %ecx       # imm = 0x7F000000
cmpl $0x1000000, %ecx        # imm = 0x1000000
sete %cl
orb %al, %cl
jne 0xd67d
leal -0xa1(%rsi), %eax
cmpl $0x3e, %eax
ja 0xd67f
movslq 0x10(%rbx), %rax
leal 0x1(%rax), %ecx
movl %ecx, 0x10(%rbx)
movl $0x8e, 0x14(%rbx,%rax,4)
movslq 0x10(%rbx), %rax
leal 0x1(%rax), %ecx
movl %ecx, 0x10(%rbx)
movl %esi, 0x14(%rbx,%rax,4)
movq %rbx, %rdi
callq 0x11c8e
jmp 0xd675
orb $0x8, 0xc(%rbx)
andl $0x0, 0x8(%rbx)
andl $0x0, 0x10(%rbx)
popq %rbx
retq
cmpl $0x80, %esi
setne %al
cmpl $0xa0, %esi
setb %cl
andb %al, %cl
leal -0xe0(%rsi), %eax
cmpl $0xb, %eax
setb %al
orb %cl, %al
cmpb $0x1, %al
jne 0xd6ae
movl $0x1, 0x8(%rbx)
jmp 0xd6d4
leal -0xed(%rsi), %eax
cmpl $0x1, %eax
ja 0xd6c2
movl $0x3, 0x8(%rbx)
jmp 0xd6d4
leal -0xfa(%rsi), %eax
cmpl $0x2, %eax
ja 0xd6e4
movl $0x2, 0x8(%rbx)
movslq 0x10(%rbx), %rax
leal 0x1(%rax), %ecx
movl %ecx, 0x10(%rbx)
movl %esi, 0x14(%rbx,%rax,4)
jmp 0xd67d
leal -0xf0(%rsi), %eax
cmpl $0xc, %eax
ja 0xd615
jmp 0xd6a5