// File: /workspace/github_c_makefile_star2_O3/phluid61[P]hsf/src/item.c
// Function: SH_Item__to_s
sh_char_t*
SH_Item__to_s(SH_Item* obj, int* err) {
	sh_char_t* obj_s;
	sh_char_t* tmp_s;
	sh_char_t* s;
	sh_char_t* ptr;

	size_t i;
	size_t n;
	size_t total;

	__sh_item__string str;
	str.length = (size_t)0;
	str.n = (size_t)0;

	obj_s = SH_BareItem__to_s(obj->item, err);
	__cascade(err, (sh_char_t*)0);

	SH_dict__each(obj->params, &__SH_Item__to_s_param, (void*)(&str), err);
	if (__catch(err)) {
		free(obj_s);
		for (i = 0; i < str.n; i++) {
			free(str.a[i]);
		}
		__cascade(err, (sh_char_t*)0);
	}

	n = strlen((const char*)obj_s);

	total = n;
	total += str.length;
	total += str.n; /* ';' and '=' for every pair */
	total += 1; /* NULL */

	s = (sh_char_t*)malloc(sizeof(sh_char_t) * total);
	if ((sh_char_t*)0 == s) {
		__raise(err, SH_E_MALLOC_ERROR);
		return (sh_char_t*)0;
	}

	ptr = s;

	if (n > 0) {
		memcpy((void*)ptr, (const void*)obj_s, n);
		free(obj_s);
		ptr += n;
	}

	for (i = 0; i < str.n; i++) {
		tmp_s = str.a[i];

		/* if the string is NULL, it was (probably) a SH_TRUE value, so don't emit anything */
		if ((sh_char_t*)0 != tmp_s) {
			*ptr = (i % 2 ? SH_CHAR_C('=') : SH_CHAR_C(';'));
			ptr ++;

			n = strlen((const char*)tmp_s);
			memcpy((void*)ptr, (const void*)tmp_s, n);
			free(str.a[i]);
			ptr += n;
		}
	}

	*ptr = SH_CHAR_C(0);

	return s;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2028, %rsp           # imm = 0x2028
movq %rsi, %r15
movq %rdi, %rbx
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq (%rdi), %rdi
callq 0x10f0
movq %rax, %r14
testq %r15, %r15
je 0x158b
cmpl $0x0, (%r15)
jne 0x1679
movq 0x8(%rbx), %rdi
movq 0x2a9e(%rip), %rsi      # 0x3fe0
leaq 0x10(%rsp), %rbx
movq %rbx, %rdx
movq %r15, %rcx
callq 0x1080
cmpl $0x0, (%r15)
movq 0x8(%rbx), %r13
je 0x15a9
movq %r14, %rdi
callq 0x1040
testq %r13, %r13
je 0x166c
xorl %ebx, %ebx
movq 0x20(%rsp,%rbx,8), %rdi
callq 0x1040
incq %rbx
movq 0x18(%rsp), %r13
cmpq %r13, %rbx
jb 0x156f
jmp 0x166f
movq 0x8(%rbx), %rdi
movq 0x2a4a(%rip), %rsi      # 0x3fe0
leaq 0x10(%rsp), %rbx
movq %rbx, %rdx
xorl %ecx, %ecx
callq 0x1080
movq 0x8(%rbx), %r13
movq %r14, %rdi
callq 0x1070
movq %rax, %r12
movq 0x10(%rsp), %rax
addq %r12, %rax
leaq (%rax,%r13), %rdi
incq %rdi
callq 0x10d0
testq %rax, %rax
je 0x165e
movq %rax, %rbx
movq %rax, %rbp
testq %r12, %r12
je 0x15f8
movq %rbx, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x10c0
movq %r14, %rdi
callq 0x1040
movq %rbx, %rbp
addq %r12, %rbp
movq %rbx, 0x8(%rsp)
testq %r13, %r13
je 0x1653
xorl %ebx, %ebx
movq 0x20(%rsp,%rbx,8), %r14
testq %r14, %r14
je 0x164b
movl %ebx, %eax
andb $0x1, %al
addb %al, %al
addb $0x3b, %al
movb %al, (%rbp)
leaq 0x1(%rbp), %r15
movq %r14, %rdi
callq 0x1070
movq %rax, %r12
movq %r15, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x10c0
movq 0x20(%rsp,%rbx,8), %rdi
callq 0x1040
addq %r12, %rbp
incq %rbp
movq 0x18(%rsp), %r13
incq %rbx
cmpq %r13, %rbx
jb 0x1604
movb $0x0, (%rbp)
movq 0x8(%rsp), %rax
jmp 0x167b
testq %r15, %r15
je 0x1679
movl $0x80000001, (%r15)     # imm = 0x80000001
jmp 0x1679
xorl %r13d, %r13d
cmpl $0x0, (%r15)
je 0x15a9
xorl %eax, %eax
addq $0x2028, %rsp           # imm = 0x2028
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq