// File: /workspace/github_c_makefile_star2_O0/nurse[P]nkf/nkf.c
// Function: w_status
static void
w_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 (0xc0 <= c && c <= 0xdf){
	    ptr->stat = 1;
	    status_push_ch(ptr, c);
	}else if (0xe0 <= c && c <= 0xef){
	    ptr->stat = 2;
	    status_push_ch(ptr, c);
	}else if (0xf0 <= c && c <= 0xf4){
	    ptr->stat = 3;
	    status_push_ch(ptr, c);
	}else{
	    status_disable(ptr);
	}
	break;
    case 1:
    case 2:
	if (0x80 <= c && c <= 0xbf){
	    status_push_ch(ptr, c);
	    if (ptr->index > ptr->stat){
		int bom = (ptr->buf[0] == 0xef && ptr->buf[1] == 0xbb
			   && ptr->buf[2] == 0xbf);
		w2e_conv(ptr->buf[0], ptr->buf[1], ptr->buf[2],
			 &ptr->buf[0], &ptr->buf[1]);
		if (!bom){
		    code_score(ptr);
		}
		status_clear(ptr);
	    }
	}else{
	    status_disable(ptr);
	}
	break;
    case 3:
	if (0x80 <= c && c <= 0xbf){
	    if (ptr->index < ptr->stat){
		status_push_ch(ptr, c);
	    } else {
		status_clear(ptr);
	    }
	}else{
	    status_disable(ptr);
	}
	break;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movl 0x8(%rax), %eax
incl %eax
movl %eax, %ecx
movq %rcx, -0x18(%rbp)
subl $0x4, %eax
ja 0xe3da
movq -0x18(%rbp), %rax
leaq 0xde9a(%rip), %rcx      # 0x1c08c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0x13b70
jmp 0xe3da
cmpl $0x7f, -0xc(%rbp)
jg 0xe217
jmp 0xe3da
movl -0xc(%rbp), %eax
andl $0xff000000, %eax       # imm = 0xFF000000
cmpl $0x1000000, %eax        # imm = 0x1000000
jne 0xe22b
jmp 0xe3da
movl $0xc0, %eax
cmpl -0xc(%rbp), %eax
jg 0xe257
cmpl $0xdf, -0xc(%rbp)
jg 0xe257
movq -0x8(%rbp), %rax
movl $0x1, 0x8(%rax)
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0x13ba0
jmp 0xe2bc
movl $0xe0, %eax
cmpl -0xc(%rbp), %eax
jg 0xe283
cmpl $0xef, -0xc(%rbp)
jg 0xe283
movq -0x8(%rbp), %rax
movl $0x2, 0x8(%rax)
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0x13ba0
jmp 0xe2ba
movl $0xf0, %eax
cmpl -0xc(%rbp), %eax
jg 0xe2af
cmpl $0xf4, -0xc(%rbp)
jg 0xe2af
movq -0x8(%rbp), %rax
movl $0x3, 0x8(%rax)
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0x13ba0
jmp 0xe2b8
movq -0x8(%rbp), %rdi
callq 0x13d90
jmp 0xe2ba
jmp 0xe2bc
jmp 0xe2be
jmp 0xe2c0
jmp 0xe3da
movl $0x80, %eax
cmpl -0xc(%rbp), %eax
jg 0xe388
cmpl $0xbf, -0xc(%rbp)
jg 0xe388
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0x13ba0
movq -0x8(%rbp), %rax
movl 0x10(%rax), %eax
movq -0x8(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jle 0xe386
movq -0x8(%rbp), %rcx
xorl %eax, %eax
cmpl $0xef, 0x14(%rcx)
movb %al, -0x19(%rbp)
jne 0xe335
movq -0x8(%rbp), %rcx
xorl %eax, %eax
cmpl $0xbb, 0x18(%rcx)
movb %al, -0x19(%rbp)
jne 0xe335
movq -0x8(%rbp), %rax
cmpl $0xbf, 0x1c(%rax)
sete %al
movb %al, -0x19(%rbp)
movb -0x19(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movl 0x14(%rax), %edi
movq -0x8(%rbp), %rax
movl 0x18(%rax), %esi
movq -0x8(%rbp), %rax
movl 0x1c(%rax), %edx
movq -0x8(%rbp), %rcx
addq $0x14, %rcx
movq -0x8(%rbp), %r8
addq $0x14, %r8
addq $0x4, %r8
callq 0x127d0
cmpl $0x0, -0x10(%rbp)
jne 0xe37d
movq -0x8(%rbp), %rdi
callq 0x13bd0
movq -0x8(%rbp), %rdi
callq 0x13d70
jmp 0xe391
movq -0x8(%rbp), %rdi
callq 0x13d90
jmp 0xe3da
movl $0x80, %eax
cmpl -0xc(%rbp), %eax
jg 0xe3cf
cmpl $0xbf, -0xc(%rbp)
jg 0xe3cf
movq -0x8(%rbp), %rax
movl 0x10(%rax), %eax
movq -0x8(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jge 0xe3c4
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0x13ba0
jmp 0xe3cd
movq -0x8(%rbp), %rdi
callq 0x13d70
jmp 0xe3d8
movq -0x8(%rbp), %rdi
callq 0x13d90
jmp 0xe3da
addq $0x20, %rsp
popq %rbp
retq