// File: /workspace/github_c_makefile_star2_O3/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 0x305c
movq %rax, %rbx
testq %rax, %rax
sete %al
movl (%r14), %ecx
testl %ecx, %ecx
setne %dl
orb %al, %dl
cmpb $0x1, %dl
jne 0x1fea
leaq 0x3492(%rip), %rdi      # 0x5468
leaq 0x4(%rsp), %rsi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x1060
jmp 0x22f1
leaq 0x34a5(%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 0x3a74
movq %rax, %r14
testq %rax, %rax
sete %al
movl (%r15), %edx
testl %edx, %edx
setne %cl
orb %al, %cl
cmpb $0x1, %cl
jne 0x203c
leaq 0x3104(%rip), %rdi      # 0x5131
movq %r14, %rsi
xorl %eax, %eax
callq 0x1060
jmp 0x22e7
leaq 0x311d(%rip), %rdi      # 0x5160
movq %r14, %rsi
xorl %eax, %eax
callq 0x1060
leaq 0x345f(%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 0x3ed0
movq %rax, %r15
testq %rax, %rax
sete %al
movl (%r12), %edx
testl %edx, %edx
setne %cl
orb %al, %cl
cmpb $0x1, %cl
jne 0x20a1
leaq 0x34e5(%rip), %rdi      # 0x557a
movq %r15, %rsi
xorl %eax, %eax
callq 0x1060
jmp 0x20c6
leaq 0x3501(%rip), %rdi      # 0x55a9
movq %r15, %rsi
xorl %eax, %eax
callq 0x1060
movq %r15, %rdi
callq 0x1e67
movq %r15, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x3f7a
leaq 0x3424(%rip), %rdi      # 0x54f1
movl $0x1b, %esi
movl $0x1b, %edx
xorl %eax, %eax
callq 0x1060
movq %rsp, %r12
movq %r12, %rdi
callq 0x476c
movq %rax, %r15
testq %rax, %rax
sete %al
movl (%r12), %edx
testl %edx, %edx
setne %cl
orb %al, %cl
cmpb $0x1, %cl
jne 0x2118
leaq 0x3426(%rip), %rdi      # 0x552f
movq %r15, %rsi
xorl %eax, %eax
callq 0x1060
jmp 0x219a
leaq 0x343d(%rip), %rdi      # 0x555c
movq %r15, %rsi
xorl %eax, %eax
callq 0x1060
movq %rsp, %r13
movq %r14, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0x3ed0
movq %rax, %r12
testq %rax, %rax
sete %al
movl (%r13), %edx
testl %edx, %edx
setne %cl
orb %al, %cl
cmpb $0x1, %cl
jne 0x2166
leaq 0x341e(%rip), %rdi      # 0x5578
movq %r12, %rsi
xorl %eax, %eax
callq 0x1060
jmp 0x218b
leaq 0x343a(%rip), %rdi      # 0x55a7
movq %r12, %rsi
xorl %eax, %eax
callq 0x1060
movq %r12, %rdi
callq 0x1e67
movq %r12, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x3f7a
movq %r15, %rdi
movl $0xff, %esi
xorl %edx, %edx
callq 0x47b1
leaq 0x3424(%rip), %rdi      # 0x55c5
movl $0x1b, %esi
movl $0x1b, %edx
xorl %eax, %eax
callq 0x1060
movq %rsp, %r12
movq %r12, %rdi
callq 0x476c
movq %rax, %r15
testq %rax, %rax
sete %al
movl (%r12), %edx
testl %edx, %edx
setne %cl
orb %al, %cl
cmpb $0x1, %cl
jne 0x21ec
leaq 0x3352(%rip), %rdi      # 0x552f
movq %r15, %rsi
xorl %eax, %eax
callq 0x1060
jmp 0x22db
leaq 0x3369(%rip), %rdi      # 0x555c
movq %r15, %rsi
xorl %eax, %eax
callq 0x1060
leaq 0x33ff(%rip), %rdi      # 0x5603
movq %rsp, %rbp
movl $0x4, %esi
movq %rbp, %rdx
callq 0x4364
movq %rax, %r12
movl $0x2a, %edi
movq %rbp, %rsi
callq 0x2940
movq %rax, %rdi
movq %rbp, %rsi
callq 0x394e
movq %rax, %rdi
xorl %esi, %esi
movq %rbp, %rdx
callq 0x3ed0
movq %rax, %r13
movl (%rbp), %ecx
testl %ecx, %ecx
je 0x225a
leaq 0x33bb(%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 0x48b1
movq %r14, %rdi
movq %r15, %rsi
movq %rbp, %rdx
callq 0x3ed0
movq %rax, %r12
testq %rax, %rax
sete %al
movl (%rbp), %edx
testl %edx, %edx
setne %cl
orb %al, %cl
cmpb $0x1, %cl
jne 0x22a7
leaq 0x32dd(%rip), %rdi      # 0x5578
movq %r12, %rsi
xorl %eax, %eax
callq 0x1060
jmp 0x22cc
leaq 0x32f9(%rip), %rdi      # 0x55a7
movq %r12, %rsi
xorl %eax, %eax
callq 0x1060
movq %r12, %rdi
callq 0x1e67
movq %r12, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x3f7a
movq %r15, %rdi
movl $0xff, %esi
xorl %edx, %edx
callq 0x47b1
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x3bfc
movq %rbx, %rdi
xorl %esi, %esi
callq 0x3188
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq