// File: /workspace/github_c_makefile_star2_O1/nurse[P]nkf/nkf.c
// Function: mime_begin_strict
static nkf_char
mime_begin_strict(FILE *f)
{
    nkf_char c1 = 0;
    int i,j,k;
    const unsigned char *p,*q;
    nkf_char r[MAXRECOVER];    /* recovery buffer, max mime pattern length */

    mime_decode_mode = FALSE;
    /* =? has been checked */
    j = 0;
    p = mime_pattern[j];
    r[0]='='; r[1]='?';

    for(i=2;p[i]>SP;i++) {                   /* start at =? */
	if (((r[i] = c1 = (*i_getc)(f))==EOF) || nkf_toupper(c1) != p[i]) {
	    /* pattern fails, try next one */
	    q = p;
	    while (mime_pattern[++j]) {
		p = mime_pattern[j];
		for(k=2;k<i;k++)              /* assume length(p) > i */
		    if (p[k]!=q[k]) break;
		if (k==i && nkf_toupper(c1)==p[k]) break;
	    }
	    p = mime_pattern[j];
	    if (p) continue;  /* found next one, continue */
	    /* all fails, output from recovery buffer */
	    (*i_ungetc)(c1,f);
	    for(j=0;j<i;j++) {
		(*oconv)(0,r[j]);
	    }
	    return c1;
	}
    }
    mime_decode_mode = p[i-2];

    mime_iconv_back = iconv;
    set_iconv(FALSE, mime_priority_func[j]);
    clr_code_score(find_inputcode_byfunc(mime_priority_func[j]), SCORE_iMIME);

    if (mime_decode_mode=='B') {
	mimebuf_f = unbuf_f;
	if (!unbuf_f) {
	    /* do MIME integrity check */
	    return mime_integrity(f,mime_pattern[j]);
	}
    }
    switch_mime_getc();
    mimebuf_f = TRUE;
    return c1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movl $0x0, 0x3fe27(%rip)     # 0x55580
movabsq $0x3f0000003d, %rax     # imm = 0x3F0000003D
movq %rax, 0x10(%rsp)
xorl %r15d, %r15d
leaq 0x2f3d(%rip), %r13      # 0x186af
leaq 0x2f38(%rip), %r14      # 0x186b1
movl $0x2, %ecx
leaq 0x31a9b(%rip), %r12     # 0x47220
xorl %ebp, %ebp
movq %rdi, 0x8(%rsp)
movq %rcx, %rbx
callq *0x37b93(%rip)          # 0x4d328
movl %eax, 0x10(%rsp,%rbx,4)
cmpl $-0x1, %eax
je 0x157b2
leal -0x61(%rax), %edx
leal -0x20(%rax), %ecx
cmpl $0x1a, %edx
cmovael %eax, %ecx
movzbl (%r14), %edx
cmpl %edx, %ecx
je 0x15830
incl %ebp
cmpl $0xa, %ebp
sete %r8b
je 0x158c8
leal -0x61(%rax), %edx
leal -0x20(%rax), %ecx
cmpl $0x1a, %edx
cmovael %eax, %ecx
movslq %ebp, %rbp
movq (%r12,%rbp,8), %rdx
movl $0x2, %esi
cmpq $0x3, %rbx
jb 0x15802
movl $0x2, %esi
movb (%rdx,%rsi), %dil
cmpb (%r13,%rsi), %dil
jne 0x15802
leaq (%r15,%rsi), %rdi
incq %rdi
incq %rsi
cmpq $0x2, %rdi
jne 0x157e4
movq %rbx, %rsi
movl %esi, %esi
cmpq %rsi, %rbx
jne 0x15811
movzbl (%rdx,%rsi), %esi
cmpl %esi, %ecx
je 0x15823
incq %rbp
cmpq $0xa, %rbp
sete %r8b
jne 0x157d0
jmp 0x158c8
movq %rdx, %r13
testb $0x1, %r8b
jne 0x158c8
leaq 0x1(%rbx), %rcx
leaq (%rbx,%r13), %r14
incq %r14
decq %r15
cmpb $0x20, (%r14)
movq 0x8(%rsp), %rdi
ja 0x1578c
movq %rax, %r14
decl %ebx
movslq %ebx, %rax
movzbl (%r13,%rax), %eax
movl %eax, 0x3fd1f(%rip)     # 0x55580
movq 0x37a70(%rip), %rax     # 0x4d2d8
movq %rax, 0x401a9(%rip)     # 0x55a18
movslq %ebp, %rbx
leaq 0x31a07(%rip), %rax     # 0x47280
movq (%rax,%rbx,8), %r15
xorl %edi, %edi
movq %r15, %rsi
callq 0x11bad
movl $0x27c, %eax            # imm = 0x27C
btq %rbx, %rax
jb 0x15911
cmpq $0x0, 0x378b6(%rip)     # 0x4d150
sete %cl
je 0x15911
cmpq %r15, 0x378d2(%rip)     # 0x4d178
je 0x15906
leaq 0x378a1(%rip), %rdx     # 0x4d150
cmpq $0x0, 0x38(%rdx)
sete %cl
je 0x15911
leaq 0x38(%rdx), %rax
cmpq %r15, 0x60(%rdx)
movq %rax, %rdx
jne 0x158af
jmp 0x1590d
movq %rax, %r15
movl %eax, %edi
movq 0x8(%rsp), %rsi
callq *0x37a58(%rip)          # 0x4d330
movl %ebx, %ebx
xorl %r14d, %r14d
movl 0x10(%rsp,%r14,4), %esi
xorl %edi, %edi
callq *0x379ce(%rip)          # 0x4d2b8
incq %r14
cmpq %r14, %rbx
jne 0x158dd
movq %r15, %rsi
movl %esi, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x37843(%rip), %rax     # 0x4d150
testb %cl, %cl
je 0x15913
xorl %eax, %eax
testq %rax, %rax
je 0x1591c
andb $0x7f, 0xc(%rax)
cmpl $0x42, 0x3fc5d(%rip)    # 0x55580
movq %r14, %rsi
jne 0x15939
movzbl 0x37a91(%rip), %eax     # 0x4d3c0
movl %eax, 0x3fc4f(%rip)     # 0x55584
testl %eax, %eax
je 0x159b8
movq 0x379e8(%rip), %rax     # 0x4d328
leaq -0x12d0(%rip), %rcx     # 0x14677
cmpq %rcx, %rax
je 0x159a9
movq %rax, 0x379fd(%rip)     # 0x4d350
movq %rcx, 0x379ce(%rip)     # 0x4d328
movq 0x379cf(%rip), %rcx     # 0x4d330
movq %rcx, 0x379f0(%rip)     # 0x4d358
leaq -0xaba(%rip), %rdx      # 0x14eb5
movq %rdx, 0x379ba(%rip)     # 0x4d330
cmpl $0x8, 0x37923(%rip)     # 0x4d2a0
jne 0x159a9
movq %rax, 0x379da(%rip)     # 0x4d360
leaq 0x613(%rip), %rax       # 0x15fa0
movq %rax, 0x379bc(%rip)     # 0x4d350
movq %rcx, 0x379cd(%rip)     # 0x4d368
leaq 0x62d(%rip), %rax       # 0x15fcf
movq %rax, 0x379af(%rip)     # 0x4d358
movl $0x1, 0x3fbd1(%rip)     # 0x55584
jmp 0x158f5
movq (%r12,%rbx,8), %rax
movl 0x40046(%rip), %ecx     # 0x55a08
movl %ecx, 0x40048(%rip)     # 0x55a10
movl %ecx, 0x4003e(%rip)     # 0x55a0c
movb (%rax), %dl
testb %dl, %dl
je 0x159fb
incq %rax
leaq 0x3fc2a(%rip), %rsi     # 0x55608
movl %ecx, %edi
leal 0x1(%rdi), %ecx
andl $0x3ff, %edi            # imm = 0x3FF
movb %dl, (%rdi,%rsi)
movb (%rax), %dl
incq %rax
testb %dl, %dl
jne 0x159de
movl %ecx, 0x40015(%rip)     # 0x55a10
movl 0x4000f(%rip), %ebx     # 0x55a10
movq 0x8(%rsp), %rdi
callq *0x3791c(%rip)          # 0x4d328
cmpl $-0x1, %eax
je 0x15aa5
xorl %r15d, %r15d
leaq 0x3fbe9(%rip), %r14     # 0x55608
movabsq $-0x5fff780000000000, %r12 # imm = 0xA000880000000000
movl %r15d, %ecx
movl %eax, %r15d
movl 0x3ffdb(%rip), %eax     # 0x55a10
movl 0x3ffcd(%rip), %edx     # 0x55a08
movl %eax, %esi
subl %edx, %esi
testl $0x3ff, %esi            # imm = 0x3FF
je 0x15aa2
movl %r15d, %edx
xorl $0x3d, %edx
xorl $0x3f, %ecx
orl %edx, %ecx
je 0x15b56
cmpl $0x3f, %r15d
ja 0x15a8b
movl %r15d, %ecx
btq %rcx, %r12
jae 0x15a8b
leal 0x1(%rax), %ecx
movl %ecx, 0x3ffa0(%rip)     # 0x55a10
andl $0x3ff, %eax            # imm = 0x3FF
movb %r15b, (%rax,%r14)
movq 0x8(%rsp), %rdi
callq *0x378a4(%rip)          # 0x4d328
cmpl $-0x1, %eax
jne 0x15a29
jmp 0x15aa5
leal -0x30(%r15), %ecx
cmpl $0xa, %ecx
jb 0x15a67
movl %r15d, %ecx
andl $-0x21, %ecx
addl $-0x41, %ecx
cmpl $0x19, %ecx
jbe 0x15a67
movl %r15d, %eax
movl 0x3ff65(%rip), %ecx     # 0x55a10
leaq 0x3fb56(%rip), %rdx     # 0x55608
leal 0x1(%rcx), %esi
movl %esi, 0x3ff55(%rip)     # 0x55a10
andl $0x3ff, %ecx            # imm = 0x3FF
movb %al, (%rcx,%rdx)
movl %esi, 0x3ff42(%rip)     # 0x55a0c
movl $0x1, 0x3faac(%rip)     # 0x55580
movq 0x3784d(%rip), %rax     # 0x4d328
movl $0x1, %esi
leaq -0x1470(%rip), %rcx     # 0x14677
cmpq %rcx, %rax
je 0x158f5
movq %rax, 0x37859(%rip)     # 0x4d350
movq %rcx, 0x3782a(%rip)     # 0x4d328
movq 0x3782b(%rip), %rcx     # 0x4d330
movq %rcx, 0x3784c(%rip)     # 0x4d358
leaq -0xc5e(%rip), %rdx      # 0x14eb5
movq %rdx, 0x37816(%rip)     # 0x4d330
cmpl $0x8, 0x3777f(%rip)     # 0x4d2a0
jne 0x158f5
movq %rax, 0x37832(%rip)     # 0x4d360
leaq 0x46b(%rip), %rax       # 0x15fa0
movq %rax, 0x37814(%rip)     # 0x4d350
movq %rcx, 0x37825(%rip)     # 0x4d368
leaq 0x485(%rip), %rax       # 0x15fcf
movq %rax, 0x37807(%rip)     # 0x4d358
jmp 0x158f5
leal 0x1(%rax), %ecx
movl %ecx, 0x3feb1(%rip)     # 0x55a10
andl $0x3ff, %eax            # imm = 0x3FF
movb $0x3d, (%rax,%r14)
movl %ebx, 0x3fea1(%rip)     # 0x55a10
jmp 0x15ad4