// File: /workspace/github_c_makefile_star2_O1/phluid61[P]hsf/main.c
// Function: do_sh_item
void do_sh_item() {
	sh_char_t value[4] = "foo";

	SH_Token* obj;
	SH_BareItem* bi;
	SH_Item* item;

	SH_dict* params;

	SH_Key  *key1;
	SH_Item *val1;

	int err = 0;

	obj = SH_Token__init(value, 3, &err);
	if ((SH_Token*)0 == obj || err) {
		printf("* unable to init SH_Token(%s): [%llX] 0x%08X\n", (char*)value, (long long)obj, err);
	} else {
		printf("+ init SH_Token(%s): [%llX]\n", (char*)value, (long long)obj);
		bi = SH_BareItem__init_token(obj, &err);
		if ((SH_BareItem*)0 == bi || err) {
			printf("  * unable to init SH_BareItem: [%llX] 0x%08X\n", (long long)bi, err);
		} else {
			printf("  + init SH_BareItem: [%llX]\n", (long long)bi);

			printf("  %c[36m--- create an item without any parameters -----%c[0m\n", 0x1b, 0x1b);
			item = SH_Item__init(bi, (SH_dict*)0, &err);
			if ((SH_Item*)0 == item || err) {
				printf("    * unable to init SH_Item: [%llX] 0x%08X\n", (long long)item, err);
			} else {
				printf("    + init SH_Item: [%llX]\n", (long long)item);
				__do_sh_item(item);

				SH_Item__destroy(item, SH_FALSE, 0);
			}

			printf("  %c[36m--- create an item with explicit parameters ---%c[0m\n", 0x1b, 0x1b);
			params = SH_dict__init(&err);
			if ((SH_dict*)0 == params || err) {
				printf("    * unable to init SH_dict: [%llX] 0x%08X\n", (long long)params, err);
			} else {
				printf("    + init SH_dict: [%llX]\n", (long long)params);

				item = SH_Item__init(bi, params, &err);
				if ((SH_Item*)0 == item || err) {
					printf("      * unable to init SH_Item: [%llX] 0x%08X\n", (long long)item, err);
				} else {
					printf("      + init SH_Item: [%llX]\n", (long long)item);
					__do_sh_item(item);

					SH_Item__destroy(item, SH_FALSE, 0);
				}

				SH_dict__destroy(params, SH_TRUE, 0);
			}

			printf("  %c[36m--- create an item with defined parameters ----%c[0m\n", 0x1b, 0x1b);
			params = SH_dict__init(&err);
			if ((SH_dict*)0 == params || err) {
				printf("    * unable to init SH_dict: [%llX] 0x%08X\n", (long long)params, err);
			} else {
				printf("    + init SH_dict: [%llX]\n", (long long)params);

				/* FIXME: catch errors here: */
				key1 = SH_Key__init((unsigned char*)"test", 4, &err);
				val1 = SH_Item__init(SH_BareItem__init_integer(SH_Integer__init(SH_INT_C(42), &err), &err), 0, &err);
				if (err) {
					printf("      x [%llX]=[%llX] 0x%08X\n", (long long)key1, (long long)val1, err);
				}
				SH_dict__add(params, key1, val1, &err);

				item = SH_Item__init(bi, params, &err);
				if ((SH_Item*)0 == item || err) {
					printf("      * unable to init SH_Item: [%llX] 0x%08X\n", (long long)item, err);
				} else {
					printf("      + init SH_Item: [%llX]\n", (long long)item);
					__do_sh_item(item);

					SH_Item__destroy(item, SH_FALSE, 0);
				}

				SH_dict__destroy(params, SH_TRUE, 0);
			}

			SH_BareItem__destroy(bi, SH_FALSE, 0);
		}

		SH_Token__destroy(obj, 0);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x4(%rsp), %rdi
movl $0x6f6f66, (%rdi)       # imm = 0x6F6F66
movq %rsp, %r14
movl $0x0, (%r14)
movl $0x3, %esi
movq %r14, %rdx
callq 0x2fe8
movq %rax, %rbx
testq %rax, %rax
sete %al
movl (%r14), %ecx
testl %ecx, %ecx
setne %dl
orb %al, %dl
cmpb $0x1, %dl
jne 0x1fd7
leaq 0x34a5(%rip), %rdi      # 0x5468
leaq 0x4(%rsp), %rsi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x1060
jmp 0x22de
leaq 0x34b8(%rip), %rdi      # 0x5496
leaq 0x4(%rsp), %rsi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x1060
movq %rsp, %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3940
movq %rax, %r14
testq %rax, %rax
sete %al
movl (%r15), %edx
testl %edx, %edx
setne %cl
orb %al, %cl
cmpb $0x1, %cl
jne 0x2029
leaq 0x3117(%rip), %rdi      # 0x5131
movq %r14, %rsi
xorl %eax, %eax
callq 0x1060
jmp 0x22d4
leaq 0x3130(%rip), %rdi      # 0x5160
movq %r14, %rsi
xorl %eax, %eax
callq 0x1060
leaq 0x3472(%rip), %rdi      # 0x54b3
movl $0x1b, %esi
movl $0x1b, %edx
xorl %eax, %eax
callq 0x1060
movq %rsp, %r12
movq %r14, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x3d64
movq %rax, %r15
testq %rax, %rax
sete %al
movl (%r12), %edx
testl %edx, %edx
setne %cl
orb %al, %cl
cmpb $0x1, %cl
jne 0x208e
leaq 0x34f8(%rip), %rdi      # 0x557a
movq %r15, %rsi
xorl %eax, %eax
callq 0x1060
jmp 0x20b3
leaq 0x3514(%rip), %rdi      # 0x55a9
movq %r15, %rsi
xorl %eax, %eax
callq 0x1060
movq %r15, %rdi
callq 0x1e54
movq %r15, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x3df2
leaq 0x3437(%rip), %rdi      # 0x54f1
movl $0x1b, %esi
movl $0x1b, %edx
xorl %eax, %eax
callq 0x1060
movq %rsp, %r12
movq %r12, %rdi
callq 0x4564
movq %rax, %r15
testq %rax, %rax
sete %al
movl (%r12), %edx
testl %edx, %edx
setne %cl
orb %al, %cl
cmpb $0x1, %cl
jne 0x2105
leaq 0x3439(%rip), %rdi      # 0x552f
movq %r15, %rsi
xorl %eax, %eax
callq 0x1060
jmp 0x2187
leaq 0x3450(%rip), %rdi      # 0x555c
movq %r15, %rsi
xorl %eax, %eax
callq 0x1060
movq %rsp, %r13
movq %r14, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0x3d64
movq %rax, %r12
testq %rax, %rax
sete %al
movl (%r13), %edx
testl %edx, %edx
setne %cl
orb %al, %cl
cmpb $0x1, %cl
jne 0x2153
leaq 0x3431(%rip), %rdi      # 0x5578
movq %r12, %rsi
xorl %eax, %eax
callq 0x1060
jmp 0x2178
leaq 0x344d(%rip), %rdi      # 0x55a7
movq %r12, %rsi
xorl %eax, %eax
callq 0x1060
movq %r12, %rdi
callq 0x1e54
movq %r12, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x3df2
movq %r15, %rdi
movl $0xff, %esi
xorl %edx, %edx
callq 0x459b
leaq 0x3437(%rip), %rdi      # 0x55c5
movl $0x1b, %esi
movl $0x1b, %edx
xorl %eax, %eax
callq 0x1060
movq %rsp, %r12
movq %r12, %rdi
callq 0x4564
movq %rax, %r15
testq %rax, %rax
sete %al
movl (%r12), %edx
testl %edx, %edx
setne %cl
orb %al, %cl
cmpb $0x1, %cl
jne 0x21d9
leaq 0x3365(%rip), %rdi      # 0x552f
movq %r15, %rsi
xorl %eax, %eax
callq 0x1060
jmp 0x22c8
leaq 0x337c(%rip), %rdi      # 0x555c
movq %r15, %rsi
xorl %eax, %eax
callq 0x1060
leaq 0x3412(%rip), %rdi      # 0x5603
movq %rsp, %rbp
movl $0x4, %esi
movq %rbp, %rdx
callq 0x41a4
movq %rax, %r12
movl $0x2a, %edi
movq %rbp, %rsi
callq 0x292c
movq %rax, %rdi
movq %rbp, %rsi
callq 0x385f
movq %rax, %rdi
xorl %esi, %esi
movq %rbp, %rdx
callq 0x3d64
movq %rax, %r13
movl (%rbp), %ecx
testl %ecx, %ecx
je 0x2247
leaq 0x33ce(%rip), %rdi      # 0x5608
movq %r12, %rsi
movq %r13, %rdx
xorl %eax, %eax
callq 0x1060
movq %rsp, %rbp
movq %r15, %rdi
movq %r12, %rsi
movq %r13, %rdx
movq %rbp, %rcx
callq 0x469b
movq %r14, %rdi
movq %r15, %rsi
movq %rbp, %rdx
callq 0x3d64
movq %rax, %r12
testq %rax, %rax
sete %al
movl (%rbp), %edx
testl %edx, %edx
setne %cl
orb %al, %cl
cmpb $0x1, %cl
jne 0x2294
leaq 0x32f0(%rip), %rdi      # 0x5578
movq %r12, %rsi
xorl %eax, %eax
callq 0x1060
jmp 0x22b9
leaq 0x330c(%rip), %rdi      # 0x55a7
movq %r12, %rsi
xorl %eax, %eax
callq 0x1060
movq %r12, %rdi
callq 0x1e54
movq %r12, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x3df2
movq %r15, %rdi
movl $0xff, %esi
xorl %edx, %edx
callq 0x459b
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x3a6c
movq %rbx, %rdi
xorl %esi, %esi
callq 0x310c
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq