// File: /workspace/github_c_makefile_star2_O3/nurse[P]nkf/nkf.c
// Function: mime_begin
static nkf_char
mime_begin(FILE *f)
{
    nkf_char c1 = 0;
    int i,k;

    /* In NONSTRICT mode, only =? is checked. In case of failure, we  */
    /* re-read and convert again from mime_buffer.  */

    /* =? has been checked */
    k = mime_input_state.last;
    mime_input_buf(mime_input_state.last++)='='; mime_input_buf(mime_input_state.last++)='?';
    for(i=2;i<MAXRECOVER;i++) {                   /* start at =? */
	/* We accept any character type even if it is breaked by new lines */
	c1 = (*i_getc)(f); mime_input_buf(mime_input_state.last++) = (unsigned char)c1;
	if (c1==LF||c1==SP||c1==CR||
	    c1=='-'||c1=='_'||is_alnum(c1)) continue;
	if (c1=='=') {
	    /* Failed. But this could be another MIME preemble */
	    (*i_ungetc)(c1,f);
	    mime_input_state.last--;
	    break;
	}
	if (c1!='?') break;
	else {
	    /* c1=='?' */
	    c1 = (*i_getc)(f); mime_input_buf(mime_input_state.last++) = (unsigned char)c1;
	    if (!(++i<MAXRECOVER) || c1==EOF) break;
	    if (c1=='b'||c1=='B') {
		mime_decode_mode = 'B';
	    } else if (c1=='q'||c1=='Q') {
		mime_decode_mode = 'Q';
	    } else {
		break;
	    }
	    c1 = (*i_getc)(f); mime_input_buf(mime_input_state.last++) = (unsigned char)c1;
	    if (!(++i<MAXRECOVER) || c1==EOF) break;
	    if (c1!='?') {
		mime_decode_mode = FALSE;
	    }
	    break;
	}
    }
    switch_mime_getc();
    if (!mime_decode_mode) {
	/* false MIME premble, restart from mime_buffer */
	mime_decode_mode = 1;  /* no decode, but read from the mime_buffer */
	/* Since we are in MIME mode until buffer becomes empty,    */
	/* we never go into mime_begin again for a while.           */
	return c1;
    }
    /* discard mime preemble, and goto MIME mode */
    mime_input_state.last = k;
    /* do no MIME integrity check */
    return c1;   /* used only for checking EOF */
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
movl 0x3fe77(%rip), %r15d    # 0x55a0c
leaq 0x3fa6c(%rip), %r12     # 0x55608
leal 0x1(%r15), %eax
movl %r15d, %ecx
andl $0x3ff, %ecx            # imm = 0x3FF
movb $0x3d, (%rcx,%r12)
leal 0x2(%r15), %ecx
movl %ecx, 0x3fe54(%rip)     # 0x55a0c
andl $0x3ff, %eax            # imm = 0x3FF
movb $0x3f, (%rax,%r12)
movl $0x2, %ebp
movabsq $0x200100002400, %r13   # imm = 0x200100002400
movq %r14, %rdi
callq *0x3774e(%rip)          # 0x4d328
movl %eax, %ebx
movl 0x3fe2a(%rip), %eax     # 0x55a0c
leal 0x1(%rax), %ecx
movl %ecx, 0x3fe21(%rip)     # 0x55a0c
andl $0x3ff, %eax            # imm = 0x3FF
movb %bl, (%rax,%r12)
cmpl $0x2d, %ebx
ja 0x15c01
movl %ebx, %eax
btq %rax, %r13
jb 0x15c1f
cmpl $0x5f, %ebx
je 0x15c1f
leal -0x30(%rbx), %eax
cmpl $0xa, %eax
jb 0x15c1f
movl %ebx, %eax
andl $-0x21, %eax
addl $-0x41, %eax
cmpl $0x1a, %eax
jae 0x15cc3
incl %ebp
cmpl $0x14, %ebp
jne 0x15bd1
movq 0x376fb(%rip), %rax     # 0x4d328
leaq -0x1529(%rip), %rcx     # 0x1470b
cmpq %rcx, %rax
je 0x15c96
movq %rax, 0x37710(%rip)     # 0x4d350
movq %rcx, 0x376e1(%rip)     # 0x4d328
movq 0x376e2(%rip), %rcx     # 0x4d330
movq %rcx, 0x37703(%rip)     # 0x4d358
leaq -0xd0f(%rip), %rdx      # 0x14f4d
movq %rdx, 0x376cd(%rip)     # 0x4d330
cmpl $0x8, 0x37636(%rip)     # 0x4d2a0
jne 0x15c96
movq %rax, 0x376ed(%rip)     # 0x4d360
leaq 0x32d(%rip), %rax       # 0x15fa7
movq %rax, 0x376cf(%rip)     # 0x4d350
movq %rcx, 0x376e0(%rip)     # 0x4d368
leaq 0x347(%rip), %rax       # 0x15fd6
movq %rax, 0x376c2(%rip)     # 0x4d358
cmpl $0x0, 0x3f8e3(%rip)     # 0x55580
je 0x15ca8
movl %r15d, 0x3fd66(%rip)    # 0x55a0c
jmp 0x15cb2
movl $0x1, 0x3f8ce(%rip)     # 0x55580
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x3f, %ebx
je 0x15cef
cmpl $0x3d, %ebx
jne 0x15c26
movl $0x3d, %ebx
movl $0x3d, %edi
movq %r14, %rsi
callq *0x3764c(%rip)          # 0x4d330
decl 0x3fd22(%rip)           # 0x55a0c
jmp 0x15c26
movq %r14, %rdi
callq *0x37630(%rip)          # 0x4d328
movl %eax, %ebx
movl 0x3fd0c(%rip), %eax     # 0x55a0c
leal 0x1(%rax), %ecx
movl %ecx, 0x3fd03(%rip)     # 0x55a0c
andl $0x3ff, %eax            # imm = 0x3FF
movb %bl, (%rax,%r12)
cmpl $0x13, %ebp
sete %al
cmpl $-0x1, %ebx
sete %cl
orb %al, %cl
jne 0x15c26
movl %ebx, %eax
andl $-0x21, %eax
cmpl $0x51, %eax
je 0x15d39
cmpl $0x42, %eax
jne 0x15c26
movl %eax, 0x3f841(%rip)     # 0x55580
movq %r14, %rdi
callq *0x375e0(%rip)          # 0x4d328
movl %eax, %ebx
movl 0x3fcbc(%rip), %eax     # 0x55a0c
leal 0x1(%rax), %ecx
movl %ecx, 0x3fcb3(%rip)     # 0x55a0c
andl $0x3ff, %eax            # imm = 0x3FF
movb %bl, (%rax,%r12)
cmpl $0x11, %ebp
ja 0x15c26
cmpl $-0x1, %ebx
je 0x15c26
cmpl $0x3f, %ebx
je 0x15c26
movl $0x0, 0x3f7f9(%rip)     # 0x55580
jmp 0x15c26