// File: /workspace/github_c_makefile_star2_O0/s3lase[P]v6shell/osh.c
// Function: gcat
static char *
gcat(const char *src1, const char *src2, bool slash)
{
	size_t siz;
	char *b, buf[PATHMAX], c, *dst;
	const char *s;

	if (src1 == NULL || src2 == NULL) {
		/* never true, but appease splint(1) */
		err(-2, FMT2S, getmyname(), "gcat: Invalid argument");
		return NULL;
	}

	*buf = EOS, b = buf, s = src1;
	while ((c = *s++) != EOS) {
		if (b >= &buf[PATHMAX - 1]) {
			err(-2, FMT2S, getmyname(), strerror(ENAMETOOLONG));
			return NULL;
		}
		*b++ = c;
	}
	if (slash)
		*b++ = SLASH;
	s = src2;
	do {
		if (b >= &buf[PATHMAX]) {
			err(-2, FMT2S, getmyname(), strerror(ENAMETOOLONG));
			return NULL;
		}
		*b++ = c = *s++;
	} while (c != EOS);

	siz = b - buf;
	gavtot += siz;
	if (gavtot > GAVMAX) {
		err(-2, FMT2S, getmyname(), ERR_E2BIG);
		return NULL;
	}
	dst = xmalloc(siz);

	(void)memcpy(dst, buf, siz);
	return dst;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1060, %rsp           # imm = 0x1060
movb %dl, %al
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
andb $0x1, %al
movb %al, -0x19(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x71d8
cmpq $0x0, -0x18(%rbp)
jne 0x7207
callq 0x8df0
movq %rax, %rdx
movl $0xfffffffe, %edi       # imm = 0xFFFFFFFE
leaq 0x45b5(%rip), %rsi      # 0xb7a1
leaq 0x4621(%rip), %rcx      # 0xb814
movb $0x0, %al
callq 0x8af0
movq $0x0, -0x8(%rbp)
jmp 0x7403
movb $0x0, -0x1030(%rbp)
leaq -0x1030(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x1048(%rbp)
movq -0x1048(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x1048(%rbp)
movb (%rax), %al
movb %al, -0x1031(%rbp)
movsbl %al, %eax
cmpl $0x0, %eax
je 0x72bc
movq -0x30(%rbp), %rax
leaq -0x1030(%rbp), %rcx
addq $0xfff, %rcx            # imm = 0xFFF
cmpq %rcx, %rax
jb 0x72a0
callq 0x8df0
movq %rax, -0x1050(%rbp)
movl $0x24, %edi
callq 0x2380
movq -0x1050(%rbp), %rdx
movq %rax, %rcx
movl $0xfffffffe, %edi       # imm = 0xFFFFFFFE
leaq 0x4515(%rip), %rsi      # 0xb7a1
movb $0x0, %al
callq 0x8af0
movq $0x0, -0x8(%rbp)
jmp 0x7403
movb -0x1031(%rbp), %cl
movq -0x30(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x30(%rbp)
movb %cl, (%rax)
jmp 0x7224
testb $0x1, -0x19(%rbp)
je 0x72d4
movq -0x30(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x30(%rbp)
movb $0x2f, (%rax)
movq -0x18(%rbp), %rax
movq %rax, -0x1048(%rbp)
movq -0x30(%rbp), %rax
leaq -0x1030(%rbp), %rcx
addq $0x1000, %rcx           # imm = 0x1000
cmpq %rcx, %rax
jb 0x7336
callq 0x8df0
movq %rax, -0x1058(%rbp)
movl $0x24, %edi
callq 0x2380
movq -0x1058(%rbp), %rdx
movq %rax, %rcx
movl $0xfffffffe, %edi       # imm = 0xFFFFFFFE
leaq 0x447f(%rip), %rsi      # 0xb7a1
movb $0x0, %al
callq 0x8af0
movq $0x0, -0x8(%rbp)
jmp 0x7403
movq -0x1048(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x1048(%rbp)
movb (%rax), %cl
movb %cl, -0x1031(%rbp)
movq -0x30(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x30(%rbp)
movb %cl, (%rax)
movsbl -0x1031(%rbp), %eax
cmpl $0x0, %eax
jne 0x72df
movq -0x30(%rbp), %rax
leaq -0x1030(%rbp), %rcx
subq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
addq 0xbf7f(%rip), %rax      # 0x13310
movq %rax, 0xbf78(%rip)      # 0x13310
cmpq $0x100000, 0xbf6d(%rip) # imm = 0x100000
jbe 0x73d1
callq 0x8df0
movq %rax, %rdx
movl $0xfffffffe, %edi       # imm = 0xFFFFFFFE
leaq 0x43e8(%rip), %rsi      # 0xb7a1
leaq 0x446b(%rip), %rcx      # 0xb82b
movb $0x0, %al
callq 0x8af0
movq $0x0, -0x8(%rbp)
jmp 0x7403
movq -0x28(%rbp), %rdi
callq 0x4ae0
movq %rax, -0x1040(%rbp)
movq -0x1040(%rbp), %rdi
leaq -0x1030(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x22a0
movq -0x1040(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x1060, %rsp           # imm = 0x1060
popq %rbp
retq