// File: swxlion[P]swxJson/tests/swxJsonAdvancedTest_fetch.cpp
// Function: test_tuple(std::shared_ptr<swxJson::Json>, bool)
void test_tuple(JsonPtr json, bool compatibleMode)
{
	cout<<"[Test tuple] Pattern unmatched testing. Compatible mode: "<<(compatibleMode ? "True" : "False")<<endl;

	std::tuple<std::string, int, double, uint64_t, std::string, int, std::string> more;
	std::tuple<std::string, uint32_t, float, int> less;

	cout<<"---- more elements ----------"<<endl;
	try {
		(*json)["aa"].wantTuple(more, compatibleMode);

		cout<<"Element 1: "<<std::get<0>(more)<<endl;
		cout<<"Element 2: "<<std::get<1>(more)<<endl;
		cout<<"Element 3: "<<std::get<2>(more)<<endl;
		cout<<"Element 4: "<<std::get<3>(more)<<endl;
		cout<<"Element 5: "<<std::get<4>(more)<<endl;
		cout<<"Element 6: "<<std::get<5>(more)<<endl;
		cout<<"Element 7: "<<std::get<6>(more)<<endl;

	}
	catch (const JsonNodeTypeMissMatchError &e)
	{
		cout<<"[Expectant error]: Type miss match."<<endl;
	}

	cout<<"---- less elements ----------"<<endl;
	try {
		(*json)["aa"].wantTuple(less, compatibleMode);

		cout<<"Element 1: "<<std::get<0>(less)<<endl;
		cout<<"Element 2: "<<std::get<1>(less)<<endl;
		cout<<"Element 3: "<<std::get<2>(less)<<endl;
		cout<<"Element 4: "<<std::get<3>(less)<<endl;

	}
	catch (const JsonNodeTypeMissMatchError &e)
	{
		cout<<"[Expectant error]: Type miss match."<<endl;
	}
}

// Assembly:
subq $0x288, %rsp            # imm = 0x288
movq %rdi, 0xe0(%rsp)
movb %sil, %al
movq %rdi, 0x280(%rsp)
andb $0x1, %al
movb %al, 0x27f(%rsp)
movq 0x4969e(%rip), %rdi     # 0x92fd8
movq %rdi, 0xe8(%rsp)
leaq 0x33795(%rip), %rsi     # 0x7d0de
callq 0x49300
movq %rax, %rdi
movb 0x27f(%rsp), %cl
leaq 0x337b9(%rip), %rax     # 0x7d118
leaq 0x337b7(%rip), %rsi     # 0x7d11d
testb $0x1, %cl
cmovneq %rax, %rsi
callq 0x49300
movq %rax, %rdi
movq 0x49634(%rip), %rsi     # 0x92fb0
callq 0x49360
leaq 0x1f8(%rsp), %rdi
callq 0x4ca50
leaq 0x1c8(%rsp), %rdi
callq 0x4ca70
movq 0xe8(%rsp), %rdi
leaq 0x33779(%rip), %rsi     # 0x7d123
callq 0x49300
movq %rax, 0xf0(%rsp)
jmp 0x499b9
movq 0xf0(%rsp), %rdi
movq 0x495e8(%rip), %rsi     # 0x92fb0
callq 0x49360
jmp 0x499cf
movq 0xe0(%rsp), %rdi
callq 0x4ca90
movq %rax, %rdi
leaq 0x3375b(%rip), %rsi     # 0x7d141
callq 0x6b100
movq %rax, 0xd8(%rsp)
jmp 0x499f5
movq 0xd8(%rsp), %rsi
movzbl 0x27f(%rsp), %ecx
andl $0x1, %ecx
leaq 0x138(%rsp), %rdi
leaq 0x1f8(%rsp), %rdx
callq 0x4cac0
jmp 0x49a1f
leaq 0x138(%rsp), %rdi
callq 0x4cd70
movq 0x495a5(%rip), %rdi     # 0x92fd8
leaq 0x3370a(%rip), %rsi     # 0x7d144
callq 0x49300
movq %rax, 0xd0(%rsp)
jmp 0x49a49
leaq 0x1f8(%rsp), %rdi
callq 0x4cd80
movq 0xd0(%rsp), %rdi
movq %rax, %rsi
callq 0x492c0
movq %rax, 0xc8(%rsp)
jmp 0x49a70
movq 0xc8(%rsp), %rdi
movq 0x49531(%rip), %rsi     # 0x92fb0
callq 0x49360
jmp 0x49a86
movq 0x4954b(%rip), %rdi     # 0x92fd8
leaq 0x336bc(%rip), %rsi     # 0x7d150
callq 0x49300
movq %rax, 0xc0(%rsp)
jmp 0x49aa3
leaq 0x1f8(%rsp), %rdi
callq 0x4cd90
movq 0xc0(%rsp), %rdi
movl (%rax), %esi
callq 0x49510
movq %rax, 0xb8(%rsp)
jmp 0x49ac9
movq 0xb8(%rsp), %rdi
movq 0x494d8(%rip), %rsi     # 0x92fb0
callq 0x49360
jmp 0x49adf
movq 0x494f2(%rip), %rdi     # 0x92fd8
leaq 0x3366f(%rip), %rsi     # 0x7d15c
callq 0x49300
movq %rax, 0xb0(%rsp)
jmp 0x49afc
leaq 0x1f8(%rsp), %rdi
callq 0x4cda0
movq 0xb0(%rsp), %rdi
movsd (%rax), %xmm0
callq 0x49580
movq %rax, 0xa8(%rsp)
jmp 0x49b24
movq 0xa8(%rsp), %rdi
movq 0x4947d(%rip), %rsi     # 0x92fb0
callq 0x49360
jmp 0x49b3a
movq 0x49497(%rip), %rdi     # 0x92fd8
leaq 0x33620(%rip), %rsi     # 0x7d168
callq 0x49300
movq %rax, 0xa0(%rsp)
jmp 0x49b57
leaq 0x1f8(%rsp), %rdi
callq 0x4cdb0
movq 0xa0(%rsp), %rdi
movq (%rax), %rsi
callq 0x490b0
movq %rax, 0x98(%rsp)
jmp 0x49b7e
movq 0x98(%rsp), %rdi
movq 0x49423(%rip), %rsi     # 0x92fb0
callq 0x49360
jmp 0x49b94
movq 0x4943d(%rip), %rdi     # 0x92fd8
leaq 0x335d2(%rip), %rsi     # 0x7d174
callq 0x49300
movq %rax, 0x90(%rsp)
jmp 0x49bb1
leaq 0x1f8(%rsp), %rdi
callq 0x4cdc0
movq 0x90(%rsp), %rdi
movq %rax, %rsi
callq 0x492c0
movq %rax, 0x88(%rsp)
jmp 0x49bd8
movq 0x88(%rsp), %rdi
movq 0x493c9(%rip), %rsi     # 0x92fb0
callq 0x49360
jmp 0x49bee
movq 0x493e3(%rip), %rdi     # 0x92fd8
leaq 0x33584(%rip), %rsi     # 0x7d180
callq 0x49300
movq %rax, 0x80(%rsp)
jmp 0x49c0b
leaq 0x1f8(%rsp), %rdi
callq 0x4cdd0
movq 0x80(%rsp), %rdi
movl (%rax), %esi
callq 0x49510
movq %rax, 0x78(%rsp)
jmp 0x49c2e
movq 0x78(%rsp), %rdi
movq 0x49376(%rip), %rsi     # 0x92fb0
callq 0x49360
jmp 0x49c41
movq 0x49390(%rip), %rdi     # 0x92fd8
leaq 0x3353d(%rip), %rsi     # 0x7d18c
callq 0x49300
movq %rax, 0x70(%rsp)
jmp 0x49c5b
leaq 0x1f8(%rsp), %rdi
callq 0x4cde0
movq 0x70(%rsp), %rdi
movq %rax, %rsi
callq 0x492c0
movq %rax, 0x68(%rsp)
jmp 0x49c7c
movq 0x68(%rsp), %rdi
movq 0x49328(%rip), %rsi     # 0x92fb0
callq 0x49360
jmp 0x49c8f
jmp 0x49d20
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1c0(%rsp)
movl %eax, 0x1bc(%rsp)
jmp 0x49fb2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1c0(%rsp)
movl %eax, 0x1bc(%rsp)
movl 0x1bc(%rsp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0x49fb2
movq 0x1c0(%rsp), %rdi
callq 0x490f0
movq %rax, 0x130(%rsp)
movq 0x492e7(%rip), %rdi     # 0x92fd8
leaq 0x334a0(%rip), %rsi     # 0x7d198
callq 0x49300
movq %rax, 0x60(%rsp)
jmp 0x49d04
movq 0x60(%rsp), %rdi
movq 0x492a0(%rip), %rsi     # 0x92fb0
callq 0x49360
jmp 0x49d17
callq 0x494e0
jmp 0x49d1e
jmp 0x49d20
movq 0x492b1(%rip), %rdi     # 0x92fd8
leaq 0x3348e(%rip), %rsi     # 0x7d1bc
callq 0x49300
movq %rax, 0x58(%rsp)
jmp 0x49d3a
movq 0x58(%rsp), %rdi
movq 0x4926a(%rip), %rsi     # 0x92fb0
callq 0x49360
jmp 0x49d4d
movq 0xe0(%rsp), %rdi
callq 0x4ca90
movq %rax, %rdi
leaq 0x333dd(%rip), %rsi     # 0x7d141
callq 0x6b100
movq %rax, 0x50(%rsp)
jmp 0x49d70
movq 0x50(%rsp), %rsi
movzbl 0x27f(%rsp), %ecx
andl $0x1, %ecx
leaq 0x100(%rsp), %rdi
leaq 0x1c8(%rsp), %rdx
callq 0x4ce00
jmp 0x49d97
leaq 0x100(%rsp), %rdi
callq 0x4d0b0
movq 0x4922d(%rip), %rdi     # 0x92fd8
leaq 0x33392(%rip), %rsi     # 0x7d144
callq 0x49300
movq %rax, 0x48(%rsp)
jmp 0x49dbe
leaq 0x1c8(%rsp), %rdi
callq 0x4d0c0
movq 0x48(%rsp), %rdi
movq %rax, %rsi
callq 0x492c0
movq %rax, 0x40(%rsp)
jmp 0x49ddf
movq 0x40(%rsp), %rdi
movq 0x491c5(%rip), %rsi     # 0x92fb0
callq 0x49360
jmp 0x49df2
movq 0x491df(%rip), %rdi     # 0x92fd8
leaq 0x33350(%rip), %rsi     # 0x7d150
callq 0x49300
movq %rax, 0x38(%rsp)
jmp 0x49e0c
leaq 0x1c8(%rsp), %rdi
callq 0x4d0d0
movq 0x38(%rsp), %rdi
movl (%rax), %esi
callq 0x49450
movq %rax, 0x30(%rsp)
jmp 0x49e2c
movq 0x30(%rsp), %rdi
movq 0x49178(%rip), %rsi     # 0x92fb0
callq 0x49360
jmp 0x49e3f
movq 0x49192(%rip), %rdi     # 0x92fd8
leaq 0x3330f(%rip), %rsi     # 0x7d15c
callq 0x49300
movq %rax, 0x28(%rsp)
jmp 0x49e59
leaq 0x1c8(%rsp), %rdi
callq 0x4d0e0
movq 0x28(%rsp), %rdi
movss (%rax), %xmm0
callq 0x49230
movq %rax, 0x20(%rsp)
jmp 0x49e7b
movq 0x20(%rsp), %rdi
movq 0x49129(%rip), %rsi     # 0x92fb0
callq 0x49360
jmp 0x49e8e
movq 0x49143(%rip), %rdi     # 0x92fd8
leaq 0x332cc(%rip), %rsi     # 0x7d168
callq 0x49300
movq %rax, 0x18(%rsp)
jmp 0x49ea8
leaq 0x1c8(%rsp), %rdi
callq 0x4d0f0
movq 0x18(%rsp), %rdi
movl (%rax), %esi
callq 0x49510
movq %rax, 0x10(%rsp)
jmp 0x49ec8
movq 0x10(%rsp), %rdi
movq 0x490dc(%rip), %rsi     # 0x92fb0
callq 0x49360
jmp 0x49edb
jmp 0x49f73
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1c0(%rsp)
movl %eax, 0x1bc(%rsp)
callq 0x494e0
jmp 0x49efb
jmp 0x49fb2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1c0(%rsp)
movl %eax, 0x1bc(%rsp)
movl 0x1bc(%rsp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0x49fb2
movq 0x1c0(%rsp), %rdi
callq 0x490f0
movq %rax, 0xf8(%rsp)
movq 0x49094(%rip), %rdi     # 0x92fd8
leaq 0x3324d(%rip), %rsi     # 0x7d198
callq 0x49300
movq %rax, 0x8(%rsp)
jmp 0x49f57
movq 0x8(%rsp), %rdi
movq 0x4904d(%rip), %rsi     # 0x92fb0
callq 0x49360
jmp 0x49f6a
callq 0x494e0
jmp 0x49f71
jmp 0x49f73
leaq 0x1c8(%rsp), %rdi
callq 0x4d0b0
leaq 0x1f8(%rsp), %rdi
callq 0x4cd70
addq $0x288, %rsp            # imm = 0x288
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1c0(%rsp)
movl %eax, 0x1bc(%rsp)
callq 0x494e0
jmp 0x49fb0
jmp 0x49fb2
leaq 0x1c8(%rsp), %rdi
callq 0x4d0b0
leaq 0x1f8(%rsp), %rdi
callq 0x4cd70
movq 0x1c0(%rsp), %rdi
callq 0x49520
movq %rax, %rdi
callq 0x4cdf0
nopw %cs:(%rax,%rax)