// File: /workspace/github_c_makefile_star2_O0/phluid61[P]hsf/src/bytesequence.c
// Function: SH_ByteSequence__to_s
sh_char_t*
SH_ByteSequence__to_s(SH_ByteSequence* obj, int* err) {
	size_t size;
	size_t i;

	uint8_t b1;
	uint8_t b2;
	uint8_t b3;
	uint8_t b4;

	sh_char_t* str;
	sh_char_t* ptr;

	__cascade(err, (sh_char_t*)0);

	size = (obj->length * 4 + 2) / 3; /* 3in -> 4out */
	str = (sh_char_t*)malloc(sizeof(sh_char_t) * (size + 3));
	if ((sh_char_t*)0 == str) {
		__raise(err, SH_E_MALLOC_ERROR);
		return (sh_char_t*)0;
	}

	ptr = str;
	*ptr = SH_CHAR_C('*'); ptr ++;

	for (i = 0; i < obj->length; i += 3) {
		b1 = (obj->value[i] & 0xFC) >> 2;        /* xxxxxx__ -> __xxxxxx */
		b2 = (obj->value[i] & 0x03) << 4;        /* ______xx -> __xx____ */
		b3 = 0;
		b4 = 0;

		*ptr = _b64[b1]; ptr++;

		if ((i + 1) < obj->length) {
			b2 |= (obj->value[i+1] & 0xF0) >> 4; /* xxxx____ -> ____xxxx */
			b3  = (obj->value[i+1] & 0x0F) << 2; /* ____xxxx -> __xxxx__ */

			*ptr = _b64[b2]; ptr++;

			if ((i + 2) < obj->length) {
				b3 |= (obj->value[i+2] & 0xC0) >> 6; /* xx______ -> ______xx */
				b4  = (obj->value[i+2] & 0x3F);      /* __xxxxxx */

				*ptr = _b64[b3]; ptr++;
				*ptr = _b64[b4]; ptr++;
			} else {
				*ptr = _b64[b3]; ptr++;
				*ptr = SH_CHAR_C('='); ptr++;
			}
		} else {
			*ptr = _b64[b2]; ptr++;
			*ptr = SH_CHAR_C('='); ptr++;
			*ptr = SH_CHAR_C('='); ptr++;
		}
	}

	*ptr = SH_CHAR_C('*'); ptr ++;
	*ptr = SH_CHAR_C(0);

	__clear(err);
	return str;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
xorl %eax, %eax
cmpq -0x18(%rbp), %rax
je 0x132f
movq -0x18(%rbp), %rcx
xorl %eax, %eax
cmpl (%rcx), %eax
je 0x132f
movq $0x0, -0x8(%rbp)
jmp 0x15e3
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
shlq $0x2, %rax
addq $0x2, %rax
movl $0x3, %ecx
xorl %edx, %edx
divq %rcx
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
addq $0x3, %rdi
shlq $0x0, %rdi
callq 0x1050
movq %rax, -0x38(%rbp)
xorl %eax, %eax
cmpq -0x38(%rbp), %rax
jne 0x1389
xorl %eax, %eax
cmpq -0x18(%rbp), %rax
je 0x137c
movq -0x18(%rbp), %rax
movl $0x80000001, (%rax)     # imm = 0x80000001
movq $0x0, -0x8(%rbp)
jmp 0x15e3
movq -0x38(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movb $0x2a, (%rax)
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jae 0x15af
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq -0x28(%rbp), %rcx
movzbl (%rax,%rcx), %eax
andl $0xfc, %eax
sarl $0x2, %eax
movb %al, -0x29(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq -0x28(%rbp), %rcx
movzbl (%rax,%rcx), %eax
andl $0x3, %eax
shll $0x4, %eax
movb %al, -0x2a(%rbp)
movb $0x0, -0x2b(%rbp)
movb $0x0, -0x2c(%rbp)
movzbl -0x29(%rbp), %eax
movl %eax, %ecx
movq 0x2bd3(%rip), %rax      # 0x3fd8
movb (%rax,%rcx), %cl
movq -0x40(%rbp), %rax
movb %cl, (%rax)
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq -0x10(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jae 0x1554
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq -0x28(%rbp), %rcx
movzbl 0x1(%rax,%rcx), %ecx
andl $0xf0, %ecx
sarl $0x4, %ecx
movzbl -0x2a(%rbp), %eax
orl %ecx, %eax
movb %al, -0x2a(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq -0x28(%rbp), %rcx
movzbl 0x1(%rax,%rcx), %eax
andl $0xf, %eax
shll $0x2, %eax
movb %al, -0x2b(%rbp)
movzbl -0x2a(%rbp), %eax
movl %eax, %ecx
movq 0x2b60(%rip), %rax      # 0x3fd8
movb (%rax,%rcx), %cl
movq -0x40(%rbp), %rax
movb %cl, (%rax)
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
movq -0x28(%rbp), %rax
addq $0x2, %rax
movq -0x10(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jae 0x151d
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq -0x28(%rbp), %rcx
movzbl 0x2(%rax,%rcx), %ecx
andl $0xc0, %ecx
sarl $0x6, %ecx
movzbl -0x2b(%rbp), %eax
orl %ecx, %eax
movb %al, -0x2b(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq -0x28(%rbp), %rcx
movzbl 0x2(%rax,%rcx), %eax
andl $0x3f, %eax
movb %al, -0x2c(%rbp)
movzbl -0x2b(%rbp), %eax
movl %eax, %ecx
movq 0x2af4(%rip), %rax      # 0x3fd8
movb (%rax,%rcx), %cl
movq -0x40(%rbp), %rax
movb %cl, (%rax)
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
movzbl -0x2c(%rbp), %eax
movl %eax, %ecx
movq 0x2ad2(%rip), %rax      # 0x3fd8
movb (%rax,%rcx), %cl
movq -0x40(%rbp), %rax
movb %cl, (%rax)
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x1552
movzbl -0x2b(%rbp), %eax
movl %eax, %ecx
movq 0x2aae(%rip), %rax      # 0x3fd8
movb (%rax,%rcx), %cl
movq -0x40(%rbp), %rax
movb %cl, (%rax)
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movb $0x3d, (%rax)
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x159c
movzbl -0x2a(%rbp), %eax
movl %eax, %ecx
movq 0x2a77(%rip), %rax      # 0x3fd8
movb (%rax,%rcx), %cl
movq -0x40(%rbp), %rax
movb %cl, (%rax)
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movb $0x3d, (%rax)
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movb $0x3d, (%rax)
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x159e
movq -0x28(%rbp), %rax
addq $0x3, %rax
movq %rax, -0x28(%rbp)
jmp 0x13ac
movq -0x40(%rbp), %rax
movb $0x2a, (%rax)
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movb $0x0, (%rax)
xorl %eax, %eax
cmpq -0x18(%rbp), %rax
je 0x15db
movq -0x18(%rbp), %rax
movl $0x0, (%rax)
movq -0x38(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq