// File: /workspace/github_c_makefile_star2_O3/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
movq %rdi, %r8
movl $0x0, 0x3fde4(%rip)     # 0x55580
movabsq $0x3f0000003d, %rax     # imm = 0x3F0000003D
movq %rax, 0x10(%rsp)
xorl %r13d, %r13d
leaq 0x2f0a(%rip), %r15      # 0x186bf
leaq 0x2f05(%rip), %r14      # 0x186c1
movl $0x2, %ecx
leaq 0x31a58(%rip), %r12     # 0x47220
xorl %ebp, %ebp
movq %rdi, 0x8(%rsp)
movq %rcx, %rbx
movq %r8, %rdi
callq *0x37b4d(%rip)          # 0x4d328
movl %eax, 0x10(%rsp,%rbx,4)
cmpl $-0x1, %eax
je 0x157ff
leal -0x61(%rax), %edx
leal -0x20(%rax), %ecx
cmpl $0x1a, %edx
cmovael %eax, %ecx
movzbl (%r14), %edx
cmpl %edx, %ecx
jne 0x157ff
movq 0x8(%rsp), %r8
jmp 0x1586a
incl %ebp
cmpl $0xa, %ebp
movq 0x8(%rsp), %r8
je 0x158ea
leal -0x61(%rax), %ecx
leal -0x20(%rax), %edi
cmpl $0x1a, %ecx
cmovael %eax, %edi
movslq %ebp, %rbp
movq (%r12,%rbp,8), %rcx
movl $0x2, %edx
cmpq $0x3, %rbx
jb 0x1584c
movb (%rcx,%rdx), %sil
cmpb (%r15,%rdx), %sil
jne 0x1584a
leaq (%rdx,%r13), %rsi
incq %rsi
incq %rdx
cmpq $0x2, %rsi
jne 0x1582d
movq %rbx, %rdx
movl %edx, %edx
cmpq %rbx, %rdx
jne 0x15859
movzbl (%rcx,%rbx), %edx
cmpl %edx, %edi
je 0x15867
incq %rbp
cmpq $0xa, %rbp
jne 0x1581e
jmp 0x158ea
movq %rcx, %r15
leaq 0x1(%rbx), %rcx
leaq (%r15,%rbx), %r14
incq %r14
decq %r13
cmpb $0x20, (%r14)
ja 0x157cf
movq %rax, %r14
decl %ebx
movslq %ebx, %rax
movzbl (%r15,%rax), %eax
movl %eax, 0x3fceb(%rip)     # 0x55580
movq 0x37a3c(%rip), %rax     # 0x4d2d8
movq %rax, 0x40175(%rip)     # 0x55a18
movslq %ebp, %rbx
leaq 0x319d3(%rip), %rax     # 0x47280
movq (%rax,%rbx,8), %r15
xorl %edi, %edi
movq %r15, %rsi
callq 0x11c09
movl $0x27c, %eax            # imm = 0x27C
btq %rbx, %rax
jb 0x15928
cmpq $0x0, 0x37882(%rip)     # 0x4d150
je 0x15928
leaq 0x37885(%rip), %rax     # 0x4d15c
cmpq %r15, 0x1c(%rax)
je 0x15925
cmpq $0x0, 0x2c(%rax)
leaq 0x38(%rax), %rax
jne 0x158d7
jmp 0x15928
movq %rax, %r15
movq %rax, %rdi
movq %r8, %rsi
callq *0x37a37(%rip)          # 0x4d330
movl %ebx, %ebx
xorl %r14d, %r14d
movl 0x10(%rsp,%r14,4), %esi
xorl %edi, %edi
callq *0x379ad(%rip)          # 0x4d2b8
incq %r14
cmpq %r14, %rbx
jne 0x158fe
movq %r15, %rax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
andb $0x7f, (%rax)
cmpl $0x42, 0x3fc51(%rip)    # 0x55580
movq %r14, %rax
jne 0x15945
movzbl 0x37a85(%rip), %ecx     # 0x4d3c0
movl %ecx, 0x3fc43(%rip)     # 0x55584
testl %ecx, %ecx
je 0x159c4
movq 0x379dc(%rip), %rsi     # 0x4d328
leaq -0x1248(%rip), %rcx     # 0x1470b
cmpq %rcx, %rsi
je 0x159b5
movq %rsi, 0x379f1(%rip)     # 0x4d350
movq %rcx, 0x379c2(%rip)     # 0x4d328
movq 0x379c3(%rip), %rcx     # 0x4d330
movq %rcx, 0x379e4(%rip)     # 0x4d358
leaq -0xa2e(%rip), %rdx      # 0x14f4d
movq %rdx, 0x379ae(%rip)     # 0x4d330
cmpl $0x8, 0x37917(%rip)     # 0x4d2a0
jne 0x159b5
movq %rsi, 0x379ce(%rip)     # 0x4d360
leaq 0x60e(%rip), %rdx       # 0x15fa7
movq %rdx, 0x379b0(%rip)     # 0x4d350
movq %rcx, 0x379c1(%rip)     # 0x4d368
leaq 0x628(%rip), %rcx       # 0x15fd6
movq %rcx, 0x379a3(%rip)     # 0x4d358
movl $0x1, 0x3fbc5(%rip)     # 0x55584
jmp 0x15916
movq (%r12,%rbx,8), %rax
movl 0x4003a(%rip), %ebx     # 0x55a08
movl %ebx, 0x4003c(%rip)     # 0x55a10
movl %ebx, 0x40032(%rip)     # 0x55a0c
movb (%rax), %cl
testb %cl, %cl
je 0x15a0e
incq %rax
leaq 0x3fc1e(%rip), %rdx     # 0x55608
movq 0x8(%rsp), %rdi
movl %ebx, %esi
leal 0x1(%rsi), %ebx
andl $0x3ff, %esi            # imm = 0x3FF
movb %cl, (%rsi,%rdx)
movb (%rax), %cl
incq %rax
testb %cl, %cl
jne 0x159ef
movl %ebx, 0x40004(%rip)     # 0x55a10
jmp 0x15a13
movq 0x8(%rsp), %rdi
callq *0x3790f(%rip)          # 0x4d328
cmpl $-0x1, %eax
je 0x15aad
xorl %r14d, %r14d
leaq 0x3fbdc(%rip), %r15     # 0x55608
movabsq $-0x5fff780000000000, %r12 # imm = 0xA000880000000000
movl %r14d, %ecx
movl %eax, %r14d
movl 0x3ffce(%rip), %eax     # 0x55a10
movl 0x3ffc0(%rip), %edx     # 0x55a08
movl %eax, %esi
subl %edx, %esi
testl $0x3ff, %esi            # imm = 0x3FF
je 0x15aca
movl %r14d, %edx
xorl $0x3d, %edx
xorl $0x3f, %ecx
orl %edx, %ecx
je 0x15ab2
cmpl $0x3f, %r14d
ja 0x15a94
movl %r14d, %ecx
btq %rcx, %r12
jae 0x15a94
leal 0x1(%rax), %ecx
movl %ecx, 0x3ff97(%rip)     # 0x55a10
andl $0x3ff, %eax            # imm = 0x3FF
movb %r14b, (%rax,%r15)
movq 0x8(%rsp), %rdi
callq *0x3789b(%rip)          # 0x4d328
cmpl $-0x1, %eax
jne 0x15a36
jmp 0x15ac4
leal -0x30(%r14), %ecx
cmpl $0xa, %ecx
jb 0x15a70
movl %r14d, %ecx
andl $-0x21, %ecx
addl $-0x41, %ecx
cmpl $0x19, %ecx
jbe 0x15a70
jmp 0x15aca
movb $-0x1, %r14b
jmp 0x15aca
andl $0x3ff, %eax            # imm = 0x3FF
movb $0x3d, (%rax,%r15)
movl %ebx, 0x3ff4e(%rip)     # 0x55a10
jmp 0x15af9
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
movl 0x3ff40(%rip), %eax     # 0x55a10
leaq 0x3fb31(%rip), %rcx     # 0x55608
leal 0x1(%rax), %edx
movl %edx, 0x3ff30(%rip)     # 0x55a10
andl $0x3ff, %eax            # imm = 0x3FF
movb %r14b, (%rax,%rcx)
movl %edx, 0x3ff1d(%rip)     # 0x55a0c
movl $0x1, 0x3fa87(%rip)     # 0x55580
movq 0x37828(%rip), %rsi     # 0x4d328
movl $0x1, %eax
leaq -0x1401(%rip), %rcx     # 0x1470b
cmpq %rcx, %rsi
je 0x15916
movq %rsi, 0x37834(%rip)     # 0x4d350
movq %rcx, 0x37805(%rip)     # 0x4d328
movq 0x37806(%rip), %rcx     # 0x4d330
movq %rcx, 0x37827(%rip)     # 0x4d358
leaq -0xbeb(%rip), %rdx      # 0x14f4d
movq %rdx, 0x377f1(%rip)     # 0x4d330
cmpl $0x8, 0x3775a(%rip)     # 0x4d2a0
jne 0x15916
movq %rsi, 0x3780d(%rip)     # 0x4d360
leaq 0x44d(%rip), %rax       # 0x15fa7
movq %rax, 0x377ef(%rip)     # 0x4d350
movq %rcx, 0x37800(%rip)     # 0x4d368
leaq 0x467(%rip), %rax       # 0x15fd6
movq %rax, 0x377e2(%rip)     # 0x4d358
movl $0x1, %eax
jmp 0x15916