// File: /workspace/github_c_makefile_star2_O1/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 0x3fe83(%rip), %r15d    # 0x55a0c
leaq 0x3fa78(%rip), %r12     # 0x55608
leal 0x1(%r15), %eax
movl %eax, 0x3fe72(%rip)     # 0x55a0c
movl %r15d, %ecx
andl $0x3ff, %ecx            # imm = 0x3FF
movb $0x3d, (%rcx,%r12)
leal 0x2(%r15), %ecx
movl %ecx, 0x3fe5a(%rip)     # 0x55a0c
andl $0x3ff, %eax            # imm = 0x3FF
movb $0x3f, (%rax,%r12)
movl $0x2, %ebp
movabsq $0x200100002400, %r13   # imm = 0x200100002400
movq %r14, %rdi
callq *0x37754(%rip)          # 0x4d328
movl %eax, %ebx
movl 0x3fe30(%rip), %eax     # 0x55a0c
leal 0x1(%rax), %ecx
movl %ecx, 0x3fe27(%rip)     # 0x55a0c
andl $0x3ff, %eax            # imm = 0x3FF
movb %bl, (%rax,%r12)
cmpl $0x2d, %ebx
ja 0x15bfb
movl %ebx, %eax
btq %rax, %r13
jb 0x15c19
cmpl $0x5f, %ebx
je 0x15c19
leal -0x30(%rbx), %eax
cmpl $0xa, %eax
jb 0x15c19
movl %ebx, %eax
andl $-0x21, %eax
addl $-0x41, %eax
cmpl $0x1a, %eax
jae 0x15cbd
incl %ebp
cmpl $0x14, %ebp
jne 0x15bcb
movq 0x37701(%rip), %rax     # 0x4d328
leaq -0x15b7(%rip), %rcx     # 0x14677
cmpq %rcx, %rax
je 0x15c90
movq %rax, 0x37716(%rip)     # 0x4d350
movq %rcx, 0x376e7(%rip)     # 0x4d328
movq 0x376e8(%rip), %rcx     # 0x4d330
movq %rcx, 0x37709(%rip)     # 0x4d358
leaq -0xda1(%rip), %rdx      # 0x14eb5
movq %rdx, 0x376d3(%rip)     # 0x4d330
cmpl $0x8, 0x3763c(%rip)     # 0x4d2a0
jne 0x15c90
movq %rax, 0x376f3(%rip)     # 0x4d360
leaq 0x32c(%rip), %rax       # 0x15fa0
movq %rax, 0x376d5(%rip)     # 0x4d350
movq %rcx, 0x376e6(%rip)     # 0x4d368
leaq 0x346(%rip), %rax       # 0x15fcf
movq %rax, 0x376c8(%rip)     # 0x4d358
cmpl $0x0, 0x3f8e9(%rip)     # 0x55580
je 0x15ca2
movl %r15d, 0x3fd6c(%rip)    # 0x55a0c
jmp 0x15cac
movl $0x1, 0x3f8d4(%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 0x15ce9
cmpl $0x3d, %ebx
jne 0x15c20
movl $0x3d, %ebx
movl $0x3d, %edi
movq %r14, %rsi
callq *0x37652(%rip)          # 0x4d330
decl 0x3fd28(%rip)           # 0x55a0c
jmp 0x15c20
movq %r14, %rdi
callq *0x37636(%rip)          # 0x4d328
movl %eax, %ebx
movl 0x3fd12(%rip), %eax     # 0x55a0c
leal 0x1(%rax), %ecx
movl %ecx, 0x3fd09(%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 0x15c20
movl %ebx, %eax
andl $-0x21, %eax
cmpl $0x51, %eax
je 0x15d33
cmpl $0x42, %eax
jne 0x15c20
movl %eax, 0x3f847(%rip)     # 0x55580
movq %r14, %rdi
callq *0x375e6(%rip)          # 0x4d328
movl %eax, %ebx
movl 0x3fcc2(%rip), %eax     # 0x55a0c
leal 0x1(%rax), %ecx
movl %ecx, 0x3fcb9(%rip)     # 0x55a0c
andl $0x3ff, %eax            # imm = 0x3FF
movb %bl, (%rax,%r12)
cmpl $0x11, %ebp
ja 0x15c20
cmpl $-0x1, %ebx
je 0x15c20
cmpl $0x3f, %ebx
je 0x15c20
movl $0x0, 0x3f7ff(%rip)     # 0x55580
jmp 0x15c20