// File: /workspace/github_c_makefile_star2_O0/blakemcbride[P]LISP9/ls9.c
// Function: blockwrite
void blockwrite(char *s, int k) {
	cell	n;

	if (1 == Plimit) return;
	if (Outstr != NIL) {
		while (Outptr + k >= Outmax) {
			n = mkstr(NULL, Outmax+1000);
			memcpy(string(n), string(Outstr), Outptr);
			Outmax += 1000;
			Outstr = n;
		}
		memcpy(&string(Outstr)[Outptr], s, k);
		Outptr += k;
		string(Outstr)[Outptr] = 0;
		return;
	}
	if (NULL == Ports[Outport])
		fatal("blockwrite: output port is not open");
	if (fwrite(s, 1, k, Ports[Outport]) != k)
		error("file write error, port",
			mkport(Outport, T_OUTPORT));
	if ((1 == Outport || 2 == Outport) && '\n' == s[k-1])
		flush();
	if (Plimit) {
		Plimit -= k;
		if (Plimit < 1) Plimit = 1;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl $0x1, %eax
cmpl 0x1d7be(%rip), %eax     # 0x20398
jne 0x2be1
jmp 0x2dd0
cmpl $-0x1, 0x1d568(%rip)    # 0x20150
je 0x2cfb
jmp 0x2bf0
movl 0x1d95a(%rip), %eax     # 0x20550
addl -0xc(%rbp), %eax
cmpl 0x1d94d(%rip), %eax     # 0x2054c
jl 0x2c85
movl 0x1d941(%rip), %esi     # 0x2054c
addl $0x3e8, %esi            # imm = 0x3E8
xorl %eax, %eax
movl %eax, %edi
callq 0x2880
movl %eax, -0x10(%rbp)
movq 0x1d734(%rip), %rdi     # 0x20358
movq 0x1d71d(%rip), %rax     # 0x20348
movslq -0x10(%rbp), %rcx
movslq (%rax,%rcx,4), %rax
shlq $0x2, %rax
addq %rax, %rdi
movq 0x1d717(%rip), %rsi     # 0x20358
movq 0x1d700(%rip), %rax     # 0x20348
movslq 0x1d501(%rip), %rcx     # 0x20150
movslq (%rax,%rcx,4), %rax
shlq $0x2, %rax
addq %rax, %rsi
movslq 0x1d8ef(%rip), %rdx     # 0x20550
callq 0x2150
movl 0x1d8e0(%rip), %eax     # 0x2054c
addl $0x3e8, %eax            # imm = 0x3E8
movl %eax, 0x1d8d5(%rip)     # 0x2054c
movl -0x10(%rbp), %eax
movl %eax, 0x1d4d0(%rip)     # 0x20150
jmp 0x2bf0
movq 0x1d6cc(%rip), %rdi     # 0x20358
movq 0x1d6b5(%rip), %rax     # 0x20348
movslq 0x1d4b6(%rip), %rcx     # 0x20150
movslq (%rax,%rcx,4), %rax
shlq $0x2, %rax
addq %rax, %rdi
movslq 0x1d8a4(%rip), %rax     # 0x20550
addq %rax, %rdi
movq -0x8(%rbp), %rsi
movslq -0xc(%rbp), %rdx
callq 0x2150
movl -0xc(%rbp), %eax
addl 0x1d88b(%rip), %eax     # 0x20550
movl %eax, 0x1d885(%rip)     # 0x20550
movq 0x1d686(%rip), %rax     # 0x20358
movq 0x1d66f(%rip), %rcx     # 0x20348
movslq 0x1d470(%rip), %rdx     # 0x20150
movslq (%rcx,%rdx,4), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movslq 0x1d85e(%rip), %rcx     # 0x20550
movb $0x0, (%rax,%rcx)
jmp 0x2dd0
movslq 0x1d446(%rip), %rdx     # 0x20148
xorl %eax, %eax
leaq 0x1d855(%rip), %rcx     # 0x20560
cmpq (%rcx,%rdx,8), %rax
jne 0x2d1d
leaq 0x186fe(%rip), %rdi     # 0x1b416
callq 0x29a0
movq -0x8(%rbp), %rdi
movslq -0xc(%rbp), %rdx
movslq 0x1d41c(%rip), %rcx     # 0x20148
leaq 0x1d82d(%rip), %rax     # 0x20560
movq (%rax,%rcx,8), %rcx
movl $0x1, %esi
callq 0x2210
movslq -0xc(%rbp), %rcx
cmpq %rcx, %rax
je 0x2d68
movl 0x1d3f8(%rip), %edi     # 0x20148
movl $0xfffffff0, %esi       # imm = 0xFFFFFFF0
callq 0x2b30
movl %eax, %esi
leaq 0x1869c(%rip), %rdi     # 0x1b3ff
callq 0x26c0
movl $0x1, %eax
cmpl 0x1d3d5(%rip), %eax     # 0x20148
je 0x2d82
movl $0x2, %eax
cmpl 0x1d3c8(%rip), %eax     # 0x20148
jne 0x2da1
movq -0x8(%rbp), %rax
movl -0xc(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %ecx
movl $0xa, %eax
cmpl %ecx, %eax
jne 0x2da1
callq 0x2af0
cmpl $0x0, 0x1d5f0(%rip)     # 0x20398
je 0x2dd0
movl -0xc(%rbp), %ecx
movl 0x1d5e5(%rip), %eax     # 0x20398
subl %ecx, %eax
movl %eax, 0x1d5dd(%rip)     # 0x20398
cmpl $0x1, 0x1d5d6(%rip)     # 0x20398
jge 0x2dce
movl $0x1, 0x1d5ca(%rip)     # 0x20398
jmp 0x2dd0
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)