// File: /workspace/github_c_makefile_star2_O0/s3lase[P]v6shell/osh.c
// Function: atrim
static char *
atrim(UChar *ap)
{
	size_t siz;
	UChar buf[LINEMAX], c;
	UChar *a, *b;

	*buf = UCHAR(EOS);
	for (a = ap, b = buf; b < &buf[LINEMAX]; a++, b++) {
		switch (*a) {
		case EOS:
			*b = UCHAR(EOS);
			siz = (b - buf) + 1;
			(void)memcpy(ap, buf, siz);
			return (char *)ap;
		case DQUOT:
		case SQUOT:
			c = *a++;
			while (*a != c && b < &buf[LINEMAX]) {
				if (*a == EOS)
					goto aterr;
				*b++ = *a++;
			}
			b--;
			continue;
		case BQUOT:
			if (*++a == EOS) {
				a--, b--;
				continue;
			}
			break;
		}
		*b = *a;
	}

aterr:
	err(ESTATUS, "%s: %s %s\n", getmyname(), ERR_TRIM, (const char *)ap);
	/*NOTREACHED*/
	return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x850, %rsp            # imm = 0x850
movq %rdi, -0x10(%rbp)
movb $0x0, -0x820(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x830(%rbp)
leaq -0x820(%rbp), %rax
movq %rax, -0x838(%rbp)
movq -0x838(%rbp), %rax
leaq -0x820(%rbp), %rcx
addq $0x800, %rcx            # imm = 0x800
cmpq %rcx, %rax
jae 0x7138
movq -0x830(%rbp), %rax
movzbl (%rax), %eax
movl %eax, -0x83c(%rbp)
testl %eax, %eax
je 0x6fb1
jmp 0x6f83
movl -0x83c(%rbp), %eax
subl $0x22, %eax
je 0x6ff5
jmp 0x6f90
movl -0x83c(%rbp), %eax
subl $0x27, %eax
je 0x6ff5
jmp 0x6f9d
movl -0x83c(%rbp), %eax
subl $0x5c, %eax
je 0x70b7
jmp 0x70fd
movq -0x838(%rbp), %rax
movb $0x0, (%rax)
movq -0x838(%rbp), %rax
leaq -0x820(%rbp), %rcx
subq %rcx, %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
leaq -0x820(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x22a0
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x7196
movq -0x830(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x830(%rbp)
movb (%rax), %al
movb %al, -0x821(%rbp)
movq -0x830(%rbp), %rax
movzbl (%rax), %ecx
movzbl -0x821(%rbp), %edx
xorl %eax, %eax
cmpl %edx, %ecx
movb %al, -0x83d(%rbp)
je 0x7050
movq -0x838(%rbp), %rax
leaq -0x820(%rbp), %rcx
addq $0x800, %rcx            # imm = 0x800
cmpq %rcx, %rax
setb %al
movb %al, -0x83d(%rbp)
movb -0x83d(%rbp), %al
testb $0x1, %al
jne 0x705c
jmp 0x70a3
movq -0x830(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x0, %eax
jne 0x7070
jmp 0x713a
movq -0x830(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x830(%rbp)
movb (%rax), %cl
movq -0x838(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x838(%rbp)
movb %cl, (%rax)
jmp 0x7012
movq -0x838(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x838(%rbp)
jmp 0x710f
movq -0x830(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x830(%rbp)
movzbl 0x1(%rax), %eax
cmpl $0x0, %eax
jne 0x70fb
movq -0x830(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x830(%rbp)
movq -0x838(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x838(%rbp)
jmp 0x710f
jmp 0x70fd
movq -0x830(%rbp), %rax
movb (%rax), %cl
movq -0x838(%rbp), %rax
movb %cl, (%rax)
movq -0x830(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x830(%rbp)
movq -0x838(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x838(%rbp)
jmp 0x6f4f
jmp 0x713a
callq 0x2100
movl %eax, -0x848(%rbp)
callq 0x8e20
movl -0x848(%rbp), %edx
movl %eax, %esi
movl $0x7c, %eax
movl $0x2, %ecx
cmpl %esi, %edx
cmovel %ecx, %eax
movl %eax, -0x844(%rbp)
callq 0x8df0
movl -0x844(%rbp), %edi
movq %rax, %rdx
movq -0x10(%rbp), %r8
leaq 0x467d(%rip), %rsi      # 0xb7fd
leaq 0x4681(%rip), %rcx      # 0xb808
movb $0x0, %al
callq 0x8af0
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x850, %rsp            # imm = 0x850
popq %rbp
retq
nopw %cs:(%rax,%rax)