// File: /workspace/github_c_makefile_star2_O0/nurse[P]nkf/nkf.c
// Function: fold_conv
static void
fold_conv(nkf_char c2, nkf_char c1)
{
    nkf_char prev0;
    nkf_char fold_state;

    if (c1== CR && !fold_preserve_f) {
	fold_state=0;  /* ignore cr */
    }else if (c1== LF&&f_prev==CR && fold_preserve_f) {
	f_prev = LF;
	fold_state=0;  /* ignore cr */
    } else if (c1== BS) {
	if (f_line>0) f_line--;
	fold_state =  1;
    } else if (c2==EOF && f_line != 0) {    /* close open last line */
	fold_state = LF;
    } else if ((c1==LF && !fold_preserve_f)
	       || ((c1==CR||(c1==LF&&f_prev!=CR))
		   && fold_preserve_f)) {
	/* new line */
	if (fold_preserve_f) {
	    f_prev = c1;
	    f_line = 0;
	    fold_state =  CR;
	} else if ((f_prev == c1)
		   || (f_prev == LF)
		  ) {        /* duplicate newline */
	    if (f_line) {
		f_line = 0;
		fold_state =  LF;    /* output two newline */
	    } else {
		f_line = 0;
		fold_state =  1;
	    }
	} else  {
	    if (f_prev&0x80) {     /* Japanese? */
		f_prev = c1;
		fold_state =  0;       /* ignore given single newline */
	    } else if (f_prev==SP) {
		fold_state =  0;
	    } else {
		f_prev = c1;
		if (++f_line<=fold_len)
		    fold_state =  SP;
		else {
		    f_line = 0;
		    fold_state =  CR;        /* fold and output nothing */
		}
	    }
	}
    } else if (c1=='\f') {
	f_prev = LF;
	f_line = 0;
	fold_state =  LF;            /* output newline and clear */
    } else if ((c2==0 && nkf_isblank(c1)) || (c2 == '!' && c1 == '!')) {
	/* X0208 kankaku or ascii space */
	if (f_prev == SP) {
	    fold_state = 0;         /* remove duplicate spaces */
	} else {
	    f_prev = SP;
	    if (++f_line<=fold_len)
		fold_state = SP;         /* output ASCII space only */
	    else {
		f_prev = SP; f_line = 0;
		fold_state = CR;        /* fold and output nothing */
	    }
	}
    } else {
	prev0 = f_prev; /* we still need this one... , but almost done */
	f_prev = c1;
	if (c2 || c2 == JIS_X_0201_1976_K)
	    f_prev |= 0x80;  /* this is Japanese */
	f_line += c2 == JIS_X_0201_1976_K ? 1: char_size(c2,c1);
	if (f_line<=fold_len) {   /* normal case */
	    fold_state = 1;
	} else {
	    if (f_line>fold_len+fold_margin) { /* too many kinsoku suspension */
		f_line = char_size(c2,c1);
		fold_state =  LF;       /* We can't wait, do fold now */
	    } else if (c2 == JIS_X_0201_1976_K) {
		/* simple kinsoku rules  return 1 means no folding  */
		if (c1==(0xde&0x7f)) fold_state = 1; /* $B!+(B*/
		else if (c1==(0xdf&0x7f)) fold_state = 1; /* $B!,(B*/
		else if (c1==(0xa4&0x7f)) fold_state = 1; /* $B!#(B*/
		else if (c1==(0xa3&0x7f)) fold_state = 1; /* $B!$(B*/
		else if (c1==(0xa1&0x7f)) fold_state = 1; /* $B!W(B*/
		else if (c1==(0xb0&0x7f)) fold_state = 1; /* - */
		else if (SP<=c1 && c1<=(0xdf&0x7f)) {      /* X0201 */
		    f_line = 1;
		    fold_state = LF;/* add one new f_line before this character */
		} else {
		    f_line = 1;
		    fold_state = LF;/* add one new f_line before this character */
		}
	    } else if (c2==0) {
		/* kinsoku point in ASCII */
		if (  c1==')'||    /* { [ ( */
		    c1==']'||
		    c1=='}'||
		    c1=='.'||
		    c1==','||
		    c1=='!'||
		    c1=='?'||
		    c1=='/'||
		    c1==':'||
		    c1==';') {
		    fold_state = 1;
		    /* just after special */
		} else if (!is_alnum(prev0)) {
		    f_line = char_size(c2,c1);
		    fold_state = LF;
		} else if ((prev0==SP) ||   /* ignored new f_line */
			   (prev0==LF)||        /* ignored new f_line */
			   (prev0&0x80)) {        /* X0208 - ASCII */
		    f_line = char_size(c2,c1);
		    fold_state = LF;/* add one new f_line before this character */
		} else {
		    fold_state = 1;  /* default no fold in ASCII */
		}
	    } else {
		if (c2=='!') {
		    if (c1=='"')  fold_state = 1; /* $B!"(B */
		    else if (c1=='#')  fold_state = 1; /* $B!#(B */
		    else if (c1=='W')  fold_state = 1; /* $B!W(B */
		    else if (c1=='K')  fold_state = 1; /* $B!K(B */
		    else if (c1=='$')  fold_state = 1; /* $B!$(B */
		    else if (c1=='%')  fold_state = 1; /* $B!%(B */
		    else if (c1=='\'') fold_state = 1; /* $B!\(B */
		    else if (c1=='(')  fold_state = 1; /* $B!((B */
		    else if (c1==')')  fold_state = 1; /* $B!)(B */
		    else if (c1=='*')  fold_state = 1; /* $B!*(B */
		    else if (c1=='+')  fold_state = 1; /* $B!+(B */
		    else if (c1==',')  fold_state = 1; /* $B!,(B */
		    /* default no fold in kinsoku */
		    else {
			fold_state = LF;
			f_line = char_size(c2,c1);
			/* add one new f_line before this character */
		    }
		} else {
		    f_line = char_size(c2,c1);
		    fold_state = LF;
		    /* add one new f_line before this character */
		}
	    }
	}
    }
    /* terminator process */
    switch(fold_state) {
    case LF:
	oconv_newline(o_fconv);
	(*o_fconv)(c2,c1);
	break;
    case 0:
	return;
    case CR:
	oconv_newline(o_fconv);
	break;
    case TAB:
    case SP:
	(*o_fconv)(0,SP);
	break;
    default:
	(*o_fconv)(c2,c1);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
cmpl $0xd, -0x8(%rbp)
jne 0x164a9
cmpl $0x0, 0x44139(%rip)     # 0x5a5d4
jne 0x164a9
movl $0x0, -0x10(%rbp)
jmp 0x16a78
cmpl $0xa, -0x8(%rbp)
jne 0x164d7
cmpl $0xd, 0x441a2(%rip)     # 0x5a658
jne 0x164d7
cmpl $0x0, 0x44115(%rip)     # 0x5a5d4
je 0x164d7
movl $0xa, 0x4418d(%rip)     # 0x5a658
movl $0x0, -0x10(%rbp)
jmp 0x16a76
cmpl $0x8, -0x8(%rbp)
jne 0x16501
cmpl $0x0, 0x44170(%rip)     # 0x5a654
jle 0x164f5
movl 0x44168(%rip), %eax     # 0x5a654
addl $-0x1, %eax
movl %eax, 0x4415f(%rip)     # 0x5a654
movl $0x1, -0x10(%rbp)
jmp 0x16a74
cmpl $-0x1, -0x4(%rbp)
jne 0x1651c
cmpl $0x0, 0x44146(%rip)     # 0x5a654
je 0x1651c
movl $0xa, -0x10(%rbp)
jmp 0x16a72
cmpl $0xa, -0x8(%rbp)
jne 0x1652b
cmpl $0x0, 0x440ab(%rip)     # 0x5a5d4
je 0x16555
cmpl $0xd, -0x8(%rbp)
je 0x16548
cmpl $0xa, -0x8(%rbp)
jne 0x1663b
cmpl $0xd, 0x44116(%rip)     # 0x5a658
je 0x1663b
cmpl $0x0, 0x44085(%rip)     # 0x5a5d4
je 0x1663b
cmpl $0x0, 0x44078(%rip)     # 0x5a5d4
je 0x1657d
movl -0x8(%rbp), %eax
movl %eax, 0x440f1(%rip)     # 0x5a658
movl $0x0, 0x440e3(%rip)     # 0x5a654
movl $0xd, -0x10(%rbp)
jmp 0x16636
movl 0x440d5(%rip), %eax     # 0x5a658
cmpl -0x8(%rbp), %eax
je 0x16591
cmpl $0xa, 0x440c9(%rip)     # 0x5a658
jne 0x165c0
cmpl $0x0, 0x440bc(%rip)     # 0x5a654
je 0x165ad
movl $0x0, 0x440b0(%rip)     # 0x5a654
movl $0xa, -0x10(%rbp)
jmp 0x165be
movl $0x0, 0x4409d(%rip)     # 0x5a654
movl $0x1, -0x10(%rbp)
jmp 0x16634
movl 0x44092(%rip), %eax     # 0x5a658
andl $0x80, %eax
cmpl $0x0, %eax
je 0x165e2
movl -0x8(%rbp), %eax
movl %eax, 0x4407f(%rip)     # 0x5a658
movl $0x0, -0x10(%rbp)
jmp 0x16632
cmpl $0x20, 0x4406f(%rip)    # 0x5a658
jne 0x165f4
movl $0x0, -0x10(%rbp)
jmp 0x16630
movl -0x8(%rbp), %eax
movl %eax, 0x4405b(%rip)     # 0x5a658
movl 0x44051(%rip), %eax     # 0x5a654
addl $0x1, %eax
movl %eax, 0x44048(%rip)     # 0x5a654
cmpl 0x43fca(%rip), %eax     # 0x5a5dc
jg 0x1661d
movl $0x20, -0x10(%rbp)
jmp 0x1662e
movl $0x0, 0x4402d(%rip)     # 0x5a654
movl $0xd, -0x10(%rbp)
jmp 0x16630
jmp 0x16632
jmp 0x16634
jmp 0x16636
jmp 0x16a70
cmpl $0xc, -0x8(%rbp)
jne 0x16661
movl $0xa, 0x4400d(%rip)     # 0x5a658
movl $0x0, 0x43fff(%rip)     # 0x5a654
movl $0xa, -0x10(%rbp)
jmp 0x16a6e
cmpl $0x0, -0x4(%rbp)
jne 0x16673
cmpl $0x20, -0x8(%rbp)
je 0x1667f
cmpl $0x9, -0x8(%rbp)
je 0x1667f
cmpl $0x21, -0x4(%rbp)
jne 0x166dd
cmpl $0x21, -0x8(%rbp)
jne 0x166dd
cmpl $0x20, 0x43fd2(%rip)    # 0x5a658
jne 0x16691
movl $0x0, -0x10(%rbp)
jmp 0x166d8
movl $0x20, 0x43fbd(%rip)    # 0x5a658
movl 0x43fb3(%rip), %eax     # 0x5a654
addl $0x1, %eax
movl %eax, 0x43faa(%rip)     # 0x5a654
cmpl 0x43f2c(%rip), %eax     # 0x5a5dc
jg 0x166bb
movl $0x20, -0x10(%rbp)
jmp 0x166d6
movl $0x20, 0x43f93(%rip)    # 0x5a658
movl $0x0, 0x43f85(%rip)     # 0x5a654
movl $0xd, -0x10(%rbp)
jmp 0x166d8
jmp 0x16a6c
movl 0x43f75(%rip), %eax     # 0x5a658
movl %eax, -0xc(%rbp)
movl -0x8(%rbp), %eax
movl %eax, 0x43f69(%rip)     # 0x5a658
cmpl $0x0, -0x4(%rbp)
jne 0x166fe
cmpl $0x1013, -0x4(%rbp)     # imm = 0x1013
jne 0x1670f
movl 0x43f54(%rip), %eax     # 0x5a658
orl $0x80, %eax
movl %eax, 0x43f49(%rip)     # 0x5a658
cmpl $0x1013, -0x4(%rbp)     # imm = 0x1013
jne 0x16722
movl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x16738
movl -0x4(%rbp), %edx
movl $0x1, %eax
movl $0x2, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
addl 0x43f13(%rip), %eax     # 0x5a654
movl %eax, 0x43f0d(%rip)     # 0x5a654
movl 0x43f07(%rip), %eax     # 0x5a654
cmpl 0x43e89(%rip), %eax     # 0x5a5dc
jg 0x16761
movl $0x1, -0x10(%rbp)
jmp 0x16a6a
movl 0x43eed(%rip), %eax     # 0x5a654
movl 0x43e6f(%rip), %ecx     # 0x5a5dc
addl 0x3bb59(%rip), %ecx     # 0x522cc
cmpl %ecx, %eax
jle 0x1679c
movl -0x4(%rbp), %edx
movl $0x1, %eax
movl $0x2, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
movl %eax, 0x43ec4(%rip)     # 0x5a654
movl $0xa, -0x10(%rbp)
jmp 0x16a68
cmpl $0x1013, -0x4(%rbp)     # imm = 0x1013
jne 0x1684b
cmpl $0x5e, -0x8(%rbp)
jne 0x167bb
movl $0x1, -0x10(%rbp)
jmp 0x16846
cmpl $0x5f, -0x8(%rbp)
jne 0x167ca
movl $0x1, -0x10(%rbp)
jmp 0x16844
cmpl $0x24, -0x8(%rbp)
jne 0x167d9
movl $0x1, -0x10(%rbp)
jmp 0x16842
cmpl $0x23, -0x8(%rbp)
jne 0x167e8
movl $0x1, -0x10(%rbp)
jmp 0x16840
cmpl $0x21, -0x8(%rbp)
jne 0x167f7
movl $0x1, -0x10(%rbp)
jmp 0x1683e
cmpl $0x30, -0x8(%rbp)
jne 0x16806
movl $0x1, -0x10(%rbp)
jmp 0x1683c
movl $0x20, %eax
cmpl -0x8(%rbp), %eax
jg 0x16829
cmpl $0x5f, -0x8(%rbp)
jg 0x16829
movl $0x1, 0x43e34(%rip)     # 0x5a654
movl $0xa, -0x10(%rbp)
jmp 0x1683a
movl $0x1, 0x43e21(%rip)     # 0x5a654
movl $0xa, -0x10(%rbp)
jmp 0x1683c
jmp 0x1683e
jmp 0x16840
jmp 0x16842
jmp 0x16844
jmp 0x16846
jmp 0x16a66
cmpl $0x0, -0x4(%rbp)
jne 0x1693a
cmpl $0x29, -0x8(%rbp)
je 0x16891
cmpl $0x5d, -0x8(%rbp)
je 0x16891
cmpl $0x7d, -0x8(%rbp)
je 0x16891
cmpl $0x2e, -0x8(%rbp)
je 0x16891
cmpl $0x2c, -0x8(%rbp)
je 0x16891
cmpl $0x21, -0x8(%rbp)
je 0x16891
cmpl $0x3f, -0x8(%rbp)
je 0x16891
cmpl $0x2f, -0x8(%rbp)
je 0x16891
cmpl $0x3a, -0x8(%rbp)
je 0x16891
cmpl $0x3b, -0x8(%rbp)
jne 0x1689d
movl $0x1, -0x10(%rbp)
jmp 0x16935
movl $0x61, %eax
cmpl -0xc(%rbp), %eax
jg 0x168ad
cmpl $0x7a, -0xc(%rbp)
jle 0x168ef
movl $0x41, %eax
cmpl -0xc(%rbp), %eax
jg 0x168bd
cmpl $0x5a, -0xc(%rbp)
jle 0x168ef
movl $0x30, %eax
cmpl -0xc(%rbp), %eax
jg 0x168cd
cmpl $0x39, -0xc(%rbp)
jle 0x168ef
movl -0x4(%rbp), %edx
movl $0x1, %eax
movl $0x2, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
movl %eax, 0x43d6e(%rip)     # 0x5a654
movl $0xa, -0x10(%rbp)
jmp 0x16933
cmpl $0x20, -0xc(%rbp)
je 0x16908
cmpl $0xa, -0xc(%rbp)
je 0x16908
movl -0xc(%rbp), %eax
andl $0x80, %eax
cmpl $0x0, %eax
je 0x1692a
movl -0x4(%rbp), %edx
movl $0x1, %eax
movl $0x2, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
movl %eax, 0x43d33(%rip)     # 0x5a654
movl $0xa, -0x10(%rbp)
jmp 0x16931
movl $0x1, -0x10(%rbp)
jmp 0x16933
jmp 0x16935
jmp 0x16a64
cmpl $0x21, -0x4(%rbp)
jne 0x16a42
cmpl $0x22, -0x8(%rbp)
jne 0x16956
movl $0x1, -0x10(%rbp)
jmp 0x16a40
cmpl $0x23, -0x8(%rbp)
jne 0x16968
movl $0x1, -0x10(%rbp)
jmp 0x16a3e
cmpl $0x57, -0x8(%rbp)
jne 0x1697a
movl $0x1, -0x10(%rbp)
jmp 0x16a3c
cmpl $0x4b, -0x8(%rbp)
jne 0x1698c
movl $0x1, -0x10(%rbp)
jmp 0x16a3a
cmpl $0x24, -0x8(%rbp)
jne 0x1699e
movl $0x1, -0x10(%rbp)
jmp 0x16a38
cmpl $0x25, -0x8(%rbp)
jne 0x169b0
movl $0x1, -0x10(%rbp)
jmp 0x16a36
cmpl $0x27, -0x8(%rbp)
jne 0x169bf
movl $0x1, -0x10(%rbp)
jmp 0x16a34
cmpl $0x28, -0x8(%rbp)
jne 0x169ce
movl $0x1, -0x10(%rbp)
jmp 0x16a32
cmpl $0x29, -0x8(%rbp)
jne 0x169dd
movl $0x1, -0x10(%rbp)
jmp 0x16a30
cmpl $0x2a, -0x8(%rbp)
jne 0x169ec
movl $0x1, -0x10(%rbp)
jmp 0x16a2e
cmpl $0x2b, -0x8(%rbp)
jne 0x169fb
movl $0x1, -0x10(%rbp)
jmp 0x16a2c
cmpl $0x2c, -0x8(%rbp)
jne 0x16a0a
movl $0x1, -0x10(%rbp)
jmp 0x16a2a
movl $0xa, -0x10(%rbp)
movl -0x4(%rbp), %edx
movl $0x1, %eax
movl $0x2, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
movl %eax, 0x43c2a(%rip)     # 0x5a654
jmp 0x16a2c
jmp 0x16a2e
jmp 0x16a30
jmp 0x16a32
jmp 0x16a34
jmp 0x16a36
jmp 0x16a38
jmp 0x16a3a
jmp 0x16a3c
jmp 0x16a3e
jmp 0x16a40
jmp 0x16a62
movl -0x4(%rbp), %edx
movl $0x1, %eax
movl $0x2, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
movl %eax, 0x43bf9(%rip)     # 0x5a654
movl $0xa, -0x10(%rbp)
jmp 0x16a64
jmp 0x16a66
jmp 0x16a68
jmp 0x16a6a
jmp 0x16a6c
jmp 0x16a6e
jmp 0x16a70
jmp 0x16a72
jmp 0x16a74
jmp 0x16a76
jmp 0x16a78
movl -0x10(%rbp), %eax
movq %rax, -0x20(%rbp)
subq $0x20, %rax
ja 0x16ad5
movq -0x20(%rbp), %rax
leaq 0x5880(%rip), %rcx      # 0x1c310
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x3b838(%rip), %rdi     # 0x522d8
callq 0x18cf0
movq 0x3b82c(%rip), %rax     # 0x522d8
movl -0x4(%rbp), %edi
movl -0x8(%rbp), %esi
callq *%rax
jmp 0x16ae4
jmp 0x16ae4
movq 0x3b819(%rip), %rdi     # 0x522d8
callq 0x18cf0
jmp 0x16ae4
xorl %edi, %edi
movl $0x20, %esi
callq *0x3b805(%rip)          # 0x522d8
jmp 0x16ae4
movq 0x3b7fc(%rip), %rax     # 0x522d8
movl -0x4(%rbp), %edi
movl -0x8(%rbp), %esi
callq *%rax
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)