// File: swxlion[P]swxJson/tests/swxJsonAdvancedTest_fetch_v2.cpp
// Function: test_tuple()
void test_tuple()
{
	cout<<endl<<"[Test tuple] Pattern matched testing ..."<<endl;

	std::tuple<std::string, int, double, uint64_t, std::string> matchTuple;
	try {
		JsonPtr json = Json::parse(tupleDemo.c_str());
		cout<<"get json:"<<endl;
		cout<<json<<endl<<endl;

		json->wantTuple("aa", matchTuple);
		cout<<"Element 1: "<<std::get<0>(matchTuple)<<endl;
		cout<<"Element 2: "<<std::get<1>(matchTuple)<<endl;
		cout<<"Element 3: "<<std::get<2>(matchTuple)<<endl;
		cout<<"Element 4: "<<std::get<3>(matchTuple)<<endl;
		cout<<"Element 5: "<<std::get<4>(matchTuple)<<endl;

		test_tuple(json, false);
		test_tuple(json, true);
			
	}
	catch (const JsonError &e)
	{
		cout<<"[Error]: "<<e.message()<<" line: "<<e.lineNumber()<<", fun: "<<e.function()<<endl;
	}
}

// Assembly:
subq $0x228, %rsp            # imm = 0x228
movq 0x4cd9a(%rip), %rdi     # 0x97fd8
movq 0x4cd6b(%rip), %rsi     # 0x97fb0
movq %rsi, 0xc8(%rsp)
callq 0x4a360
movq %rax, %rdi
leaq 0x36f81(%rip), %rsi     # 0x821dd
callq 0x4a300
movq 0xc8(%rsp), %rsi
movq %rax, %rdi
callq 0x4a360
leaq 0x1d0(%rsp), %rdi
callq 0x4e220
leaq 0x4d093(%rip), %rdi     # 0x98318
callq 0x4a100
movq %rax, %rsi
leaq 0x1c0(%rsp), %rdi
callq 0x7d040
jmp 0x4b29c
movq 0x4cd35(%rip), %rdi     # 0x97fd8
leaq 0x36f5c(%rip), %rsi     # 0x82206
callq 0x4a300
movq %rax, 0xc0(%rsp)
jmp 0x4b2b9
movq 0xc0(%rsp), %rdi
movq 0x4cce8(%rip), %rsi     # 0x97fb0
callq 0x4a360
jmp 0x4b2cf
leaq 0x1a0(%rsp), %rdi
movq %rdi, 0xb0(%rsp)
leaq 0x1c0(%rsp), %rsi
callq 0x4e240
movq 0xb0(%rsp), %rsi
movq 0x4ccdd(%rip), %rdi     # 0x97fd8
callq 0x69de0
movq %rax, 0xb8(%rsp)
jmp 0x4b30a
movq 0xb8(%rsp), %rdi
movq 0x4cc97(%rip), %rsi     # 0x97fb0
callq 0x4a360
movq %rax, 0xa8(%rsp)
jmp 0x4b328
movq 0xa8(%rsp), %rdi
movq 0x4cc79(%rip), %rsi     # 0x97fb0
callq 0x4a360
jmp 0x4b33e
leaq 0x1a0(%rsp), %rdi
callq 0x4e270
leaq 0x1c0(%rsp), %rdi
callq 0x4ddf0
movq %rax, 0x98(%rsp)
leaq 0x127(%rsp), %rdi
movq %rdi, 0xa0(%rsp)
callq 0x4a530
movq 0xa0(%rsp), %rdx
leaq 0x36dbd(%rip), %rsi     # 0x82141
leaq 0x128(%rsp), %rdi
callq 0x4dcf0
jmp 0x4b393
leaq 0xff(%rsp), %rdi
movq %rdi, 0x90(%rsp)
callq 0x4a530
movq 0x90(%rsp), %rdx
leaq 0x36d8d(%rip), %rsi     # 0x82144
leaq 0x100(%rsp), %rdi
callq 0x4dcf0
jmp 0x4b3c6
movq 0x98(%rsp), %rsi
leaq 0x148(%rsp), %rdi
leaq 0x128(%rsp), %rdx
leaq 0x1d0(%rsp), %rcx
xorl %r8d, %r8d
leaq 0x100(%rsp), %r9
callq 0x4e280
jmp 0x4b3f8
leaq 0x148(%rsp), %rdi
callq 0x4e420
leaq 0x100(%rsp), %rdi
callq 0x4a5b8
leaq 0xff(%rsp), %rdi
callq 0x4a390
leaq 0x128(%rsp), %rdi
callq 0x4a5b8
leaq 0x127(%rsp), %rdi
callq 0x4a390
movq 0x4cb98(%rip), %rdi     # 0x97fd8
leaq 0x36d00(%rip), %rsi     # 0x82147
callq 0x4a300
movq %rax, 0x88(%rsp)
jmp 0x4b456
leaq 0x1d0(%rsp), %rdi
callq 0x4e430
movq 0x88(%rsp), %rdi
movq %rax, %rsi
callq 0x4a2c0
movq %rax, 0x80(%rsp)
jmp 0x4b47d
movq 0x80(%rsp), %rdi
movq 0x4cb24(%rip), %rsi     # 0x97fb0
callq 0x4a360
jmp 0x4b493
movq 0x4cb3e(%rip), %rdi     # 0x97fd8
leaq 0x36cb2(%rip), %rsi     # 0x82153
callq 0x4a300
movq %rax, 0x78(%rsp)
jmp 0x4b4ad
leaq 0x1d0(%rsp), %rdi
callq 0x4e440
movq 0x78(%rsp), %rdi
movl (%rax), %esi
callq 0x4a510
movq %rax, 0x70(%rsp)
jmp 0x4b4cd
movq 0x70(%rsp), %rdi
movq 0x4cad7(%rip), %rsi     # 0x97fb0
callq 0x4a360
jmp 0x4b4e0
movq 0x4caf1(%rip), %rdi     # 0x97fd8
leaq 0x36c71(%rip), %rsi     # 0x8215f
callq 0x4a300
movq %rax, 0x68(%rsp)
jmp 0x4b4fa
leaq 0x1d0(%rsp), %rdi
callq 0x4e450
movq 0x68(%rsp), %rdi
movsd (%rax), %xmm0
callq 0x4a580
movq %rax, 0x60(%rsp)
jmp 0x4b51c
movq 0x60(%rsp), %rdi
movq 0x4ca88(%rip), %rsi     # 0x97fb0
callq 0x4a360
jmp 0x4b52f
movq 0x4caa2(%rip), %rdi     # 0x97fd8
leaq 0x36c2e(%rip), %rsi     # 0x8216b
callq 0x4a300
movq %rax, 0x58(%rsp)
jmp 0x4b549
leaq 0x1d0(%rsp), %rdi
callq 0x4e460
movq 0x58(%rsp), %rdi
movq (%rax), %rsi
callq 0x4a0b0
movq %rax, 0x50(%rsp)
jmp 0x4b56a
movq 0x50(%rsp), %rdi
movq 0x4ca3a(%rip), %rsi     # 0x97fb0
callq 0x4a360
jmp 0x4b57d
movq 0x4ca54(%rip), %rdi     # 0x97fd8
leaq 0x36bec(%rip), %rsi     # 0x82177
callq 0x4a300
movq %rax, 0x48(%rsp)
jmp 0x4b597
leaq 0x1d0(%rsp), %rdi
callq 0x4e470
movq 0x48(%rsp), %rdi
movq %rax, %rsi
callq 0x4a2c0
movq %rax, 0x40(%rsp)
jmp 0x4b5b8
movq 0x40(%rsp), %rdi
movq 0x4c9ec(%rip), %rsi     # 0x97fb0
callq 0x4a360
jmp 0x4b5cb
leaq 0xe8(%rsp), %rdi
movq %rdi, 0x38(%rsp)
leaq 0x1c0(%rsp), %rsi
callq 0x4e240
movq 0x38(%rsp), %rdi
xorl %esi, %esi
callq 0x4a910
jmp 0x4b5f3
leaq 0xe8(%rsp), %rdi
callq 0x4e270
leaq 0xd8(%rsp), %rdi
movq %rdi, 0x30(%rsp)
leaq 0x1c0(%rsp), %rsi
callq 0x4e240
movq 0x30(%rsp), %rdi
movl $0x1, %esi
callq 0x4a910
jmp 0x4b62b
leaq 0xd8(%rsp), %rdi
callq 0x4e270
leaq 0x1c0(%rsp), %rdi
callq 0x4e270
jmp 0x4b858
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1b8(%rsp)
movl %eax, 0x1b4(%rsp)
jmp 0x4b769
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1b8(%rsp)
movl %eax, 0x1b4(%rsp)
jmp 0x4b75c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1b8(%rsp)
movl %eax, 0x1b4(%rsp)
leaq 0x1a0(%rsp), %rdi
callq 0x4e270
jmp 0x4b75c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1b8(%rsp)
movl %eax, 0x1b4(%rsp)
jmp 0x4b709
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1b8(%rsp)
movl %eax, 0x1b4(%rsp)
jmp 0x4b6ef
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1b8(%rsp)
movl %eax, 0x1b4(%rsp)
leaq 0x100(%rsp), %rdi
callq 0x4a5b8
leaq 0xff(%rsp), %rdi
callq 0x4a390
leaq 0x128(%rsp), %rdi
callq 0x4a5b8
leaq 0x127(%rsp), %rdi
callq 0x4a390
jmp 0x4b75c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1b8(%rsp)
movl %eax, 0x1b4(%rsp)
leaq 0xe8(%rsp), %rdi
callq 0x4e270
jmp 0x4b75c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1b8(%rsp)
movl %eax, 0x1b4(%rsp)
leaq 0xd8(%rsp), %rdi
callq 0x4e270
leaq 0x1c0(%rsp), %rdi
callq 0x4e270
movl 0x1b4(%rsp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0x4b8a0
movq 0x1b8(%rsp), %rdi
callq 0x4a0f0
movq %rax, 0xd0(%rsp)
movq 0x4c83f(%rip), %rdi     # 0x97fd8
leaq 0x36a70(%rip), %rsi     # 0x82210
callq 0x4a300
movq %rax, 0x28(%rsp)
jmp 0x4b7ac
movq 0xd0(%rsp), %rdi
callq 0x4e480
movq 0x28(%rsp), %rdi
movq %rax, %rsi
callq 0x4a2c0
movq %rax, 0x20(%rsp)
jmp 0x4b7cd
movq 0x20(%rsp), %rdi
leaq 0x36a41(%rip), %rsi     # 0x8221a
callq 0x4a300
movq %rax, 0x18(%rsp)
jmp 0x4b7e5
movq 0xd0(%rsp), %rdi
callq 0x4e490
movq 0x18(%rsp), %rdi
movl %eax, %esi
callq 0x4a510
movq %rax, 0x10(%rsp)
jmp 0x4b805
movq 0x10(%rsp), %rdi
leaq 0x36a11(%rip), %rsi     # 0x82222
callq 0x4a300
movq %rax, 0x8(%rsp)
jmp 0x4b81d
movq 0xd0(%rsp), %rdi
callq 0x4e4a0
movq 0x8(%rsp), %rdi
movq %rax, %rsi
callq 0x4a300
movq %rax, (%rsp)
jmp 0x4b83d
movq (%rsp), %rdi
movq 0x4c768(%rip), %rsi     # 0x97fb0
callq 0x4a360
jmp 0x4b84f
callq 0x4a4e0
jmp 0x4b856
jmp 0x4b858
leaq 0x1d0(%rsp), %rdi
callq 0x4e420
addq $0x228, %rsp            # imm = 0x228
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1b8(%rsp)
movl %eax, 0x1b4(%rsp)
callq 0x4a4e0
jmp 0x4b89e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1b8(%rsp)
movl %eax, 0x1b4(%rsp)
jmp 0x4b8a0
jmp 0x4b8a0
leaq 0x1d0(%rsp), %rdi
callq 0x4e420
movq 0x1b8(%rsp), %rdi
callq 0x4a520
movq %rax, %rdi
callq 0x4e020
nopw %cs:(%rax,%rax)