// File: swxlion[P]swxJson/tests/swxJsonAdvancedTest_fetch_v2.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->wantTuple("aa", 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->wantTuple("aa", 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 $0x358, %rsp            # imm = 0x358
movq %rdi, 0x110(%rsp)
movb %sil, %al
movq %rdi, 0x350(%rsp)
andb $0x1, %al
movb %al, 0x34f(%rsp)
movq 0x4d69e(%rip), %rdi     # 0x97fd8
movq %rdi, 0x118(%rsp)
leaq 0x37795(%rip), %rsi     # 0x820de
callq 0x4a300
movq %rax, %rdi
movb 0x34f(%rsp), %cl
leaq 0x377b9(%rip), %rax     # 0x82118
leaq 0x377b7(%rip), %rsi     # 0x8211d
testb $0x1, %cl
cmovneq %rax, %rsi
callq 0x4a300
movq %rax, %rdi
movq 0x4d634(%rip), %rsi     # 0x97fb0
callq 0x4a360
leaq 0x2c8(%rsp), %rdi
callq 0x4ddb0
leaq 0x298(%rsp), %rdi
callq 0x4ddd0
movq 0x118(%rsp), %rdi
leaq 0x37779(%rip), %rsi     # 0x82123
callq 0x4a300
movq %rax, 0x120(%rsp)
jmp 0x4a9b9
movq 0x120(%rsp), %rdi
movq 0x4d5e8(%rip), %rsi     # 0x97fb0
callq 0x4a360
jmp 0x4a9cf
movq 0x110(%rsp), %rdi
callq 0x4ddf0
movq %rax, 0x100(%rsp)
leaq 0x1e7(%rsp), %rdi
movq %rdi, 0x108(%rsp)
callq 0x4a530
movq 0x108(%rsp), %rdx
leaq 0x37739(%rip), %rsi     # 0x82141
leaq 0x1e8(%rsp), %rdi
callq 0x4dcf0
jmp 0x4aa17
movb 0x34f(%rsp), %al
movb %al, 0xf7(%rsp)
leaq 0x1bf(%rsp), %rdi
movq %rdi, 0xf8(%rsp)
callq 0x4a530
movq 0xf8(%rsp), %rdx
leaq 0x376fb(%rip), %rsi     # 0x82144
leaq 0x1c0(%rsp), %rdi
callq 0x4dcf0
jmp 0x4aa58
movq 0x100(%rsp), %rsi
movb 0xf7(%rsp), %al
movzbl %al, %r8d
andl $0x1, %r8d
leaq 0x208(%rsp), %rdi
leaq 0x1e8(%rsp), %rdx
leaq 0x2c8(%rsp), %rcx
leaq 0x1c0(%rsp), %r9
callq 0x4de00
jmp 0x4aa96
leaq 0x208(%rsp), %rdi
callq 0x4dfa0
leaq 0x1c0(%rsp), %rdi
callq 0x4a5b8
leaq 0x1bf(%rsp), %rdi
callq 0x4a390
leaq 0x1e8(%rsp), %rdi
callq 0x4a5b8
leaq 0x1e7(%rsp), %rdi
callq 0x4a390
movq 0x4d4fa(%rip), %rdi     # 0x97fd8
leaq 0x37662(%rip), %rsi     # 0x82147
callq 0x4a300
movq %rax, 0xe8(%rsp)
jmp 0x4aaf4
leaq 0x2c8(%rsp), %rdi
callq 0x4dfb0
movq 0xe8(%rsp), %rdi
movq %rax, %rsi
callq 0x4a2c0
movq %rax, 0xe0(%rsp)
jmp 0x4ab1b
movq 0xe0(%rsp), %rdi
movq 0x4d486(%rip), %rsi     # 0x97fb0
callq 0x4a360
jmp 0x4ab31
movq 0x4d4a0(%rip), %rdi     # 0x97fd8
leaq 0x37614(%rip), %rsi     # 0x82153
callq 0x4a300
movq %rax, 0xd8(%rsp)
jmp 0x4ab4e
leaq 0x2c8(%rsp), %rdi
callq 0x4dfc0
movq 0xd8(%rsp), %rdi
movl (%rax), %esi
callq 0x4a510
movq %rax, 0xd0(%rsp)
jmp 0x4ab74
movq 0xd0(%rsp), %rdi
movq 0x4d42d(%rip), %rsi     # 0x97fb0
callq 0x4a360
jmp 0x4ab8a
movq 0x4d447(%rip), %rdi     # 0x97fd8
leaq 0x375c7(%rip), %rsi     # 0x8215f
callq 0x4a300
movq %rax, 0xc8(%rsp)
jmp 0x4aba7
leaq 0x2c8(%rsp), %rdi
callq 0x4dfd0
movq 0xc8(%rsp), %rdi
movsd (%rax), %xmm0
callq 0x4a580
movq %rax, 0xc0(%rsp)
jmp 0x4abcf
movq 0xc0(%rsp), %rdi
movq 0x4d3d2(%rip), %rsi     # 0x97fb0
callq 0x4a360
jmp 0x4abe5
movq 0x4d3ec(%rip), %rdi     # 0x97fd8
leaq 0x37578(%rip), %rsi     # 0x8216b
callq 0x4a300
movq %rax, 0xb8(%rsp)
jmp 0x4ac02
leaq 0x2c8(%rsp), %rdi
callq 0x4dfe0
movq 0xb8(%rsp), %rdi
movq (%rax), %rsi
callq 0x4a0b0
movq %rax, 0xb0(%rsp)
jmp 0x4ac29
movq 0xb0(%rsp), %rdi
movq 0x4d378(%rip), %rsi     # 0x97fb0
callq 0x4a360
jmp 0x4ac3f
movq 0x4d392(%rip), %rdi     # 0x97fd8
leaq 0x3752a(%rip), %rsi     # 0x82177
callq 0x4a300
movq %rax, 0xa8(%rsp)
jmp 0x4ac5c
leaq 0x2c8(%rsp), %rdi
callq 0x4dff0
movq 0xa8(%rsp), %rdi
movq %rax, %rsi
callq 0x4a2c0
movq %rax, 0xa0(%rsp)
jmp 0x4ac83
movq 0xa0(%rsp), %rdi
movq 0x4d31e(%rip), %rsi     # 0x97fb0
callq 0x4a360
jmp 0x4ac99
movq 0x4d338(%rip), %rdi     # 0x97fd8
leaq 0x374dc(%rip), %rsi     # 0x82183
callq 0x4a300
movq %rax, 0x98(%rsp)
jmp 0x4acb6
leaq 0x2c8(%rsp), %rdi
callq 0x4e000
movq 0x98(%rsp), %rdi
movl (%rax), %esi
callq 0x4a510
movq %rax, 0x90(%rsp)
jmp 0x4acdc
movq 0x90(%rsp), %rdi
movq 0x4d2c5(%rip), %rsi     # 0x97fb0
callq 0x4a360
jmp 0x4acf2
movq 0x4d2df(%rip), %rdi     # 0x97fd8
leaq 0x3748f(%rip), %rsi     # 0x8218f
callq 0x4a300
movq %rax, 0x88(%rsp)
jmp 0x4ad0f
leaq 0x2c8(%rsp), %rdi
callq 0x4e010
movq 0x88(%rsp), %rdi
movq %rax, %rsi
callq 0x4a2c0
movq %rax, 0x80(%rsp)
jmp 0x4ad36
movq 0x80(%rsp), %rdi
movq 0x4d26b(%rip), %rsi     # 0x97fb0
callq 0x4a360
jmp 0x4ad4c
jmp 0x4ae53
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x290(%rsp)
movl %eax, 0x28c(%rsp)
jmp 0x4b1f4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x290(%rsp)
movl %eax, 0x28c(%rsp)
jmp 0x4add1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x290(%rsp)
movl %eax, 0x28c(%rsp)
jmp 0x4adb7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x290(%rsp)
movl %eax, 0x28c(%rsp)
leaq 0x1c0(%rsp), %rdi
callq 0x4a5b8
leaq 0x1bf(%rsp), %rdi
callq 0x4a390
leaq 0x1e8(%rsp), %rdi
callq 0x4a5b8
leaq 0x1e7(%rsp), %rdi
callq 0x4a390
jmp 0x4adf4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x290(%rsp)
movl %eax, 0x28c(%rsp)
movl 0x28c(%rsp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0x4b1f4
movq 0x290(%rsp), %rdi
callq 0x4a0f0
movq %rax, 0x1b0(%rsp)
movq 0x4d1b4(%rip), %rdi     # 0x97fd8
leaq 0x37370(%rip), %rsi     # 0x8219b
callq 0x4a300
movq %rax, 0x78(%rsp)
jmp 0x4ae37
movq 0x78(%rsp), %rdi
movq 0x4d16d(%rip), %rsi     # 0x97fb0
callq 0x4a360
jmp 0x4ae4a
callq 0x4a4e0
jmp 0x4ae51
jmp 0x4ae53
movq 0x4d17e(%rip), %rdi     # 0x97fd8
leaq 0x3735e(%rip), %rsi     # 0x821bf
callq 0x4a300
movq %rax, 0x70(%rsp)
jmp 0x4ae6d
movq 0x70(%rsp), %rdi
movq 0x4d137(%rip), %rsi     # 0x97fb0
callq 0x4a360
jmp 0x4ae80
movq 0x110(%rsp), %rdi
callq 0x4ddf0
movq %rax, 0x60(%rsp)
leaq 0x15f(%rsp), %rdi
movq %rdi, 0x68(%rsp)
callq 0x4a530
movq 0x68(%rsp), %rdx
leaq 0x37291(%rip), %rsi     # 0x82141
leaq 0x160(%rsp), %rdi
callq 0x4dcf0
jmp 0x4aebf
movb 0x34f(%rsp), %al
movb %al, 0x57(%rsp)
leaq 0x137(%rsp), %rdi
movq %rdi, 0x58(%rsp)
callq 0x4a530
movq 0x58(%rsp), %rdx
leaq 0x3725c(%rip), %rsi     # 0x82144
leaq 0x138(%rsp), %rdi
callq 0x4dcf0
jmp 0x4aef7
movq 0x60(%rsp), %rsi
movb 0x57(%rsp), %al
movzbl %al, %r8d
andl $0x1, %r8d
leaq 0x180(%rsp), %rdi
leaq 0x160(%rsp), %rdx
leaq 0x298(%rsp), %rcx
leaq 0x138(%rsp), %r9
callq 0x4e030
jmp 0x4af2f
leaq 0x180(%rsp), %rdi
callq 0x4e1d0
leaq 0x138(%rsp), %rdi
callq 0x4a5b8
leaq 0x137(%rsp), %rdi
callq 0x4a390
leaq 0x160(%rsp), %rdi
callq 0x4a5b8
leaq 0x15f(%rsp), %rdi
callq 0x4a390
movq 0x4d061(%rip), %rdi     # 0x97fd8
leaq 0x371c9(%rip), %rsi     # 0x82147
callq 0x4a300
movq %rax, 0x48(%rsp)
jmp 0x4af8a
leaq 0x298(%rsp), %rdi
callq 0x4e1e0
movq 0x48(%rsp), %rdi
movq %rax, %rsi
callq 0x4a2c0
movq %rax, 0x40(%rsp)
jmp 0x4afab
movq 0x40(%rsp), %rdi
movq 0x4cff9(%rip), %rsi     # 0x97fb0
callq 0x4a360
jmp 0x4afbe
movq 0x4d013(%rip), %rdi     # 0x97fd8
leaq 0x37187(%rip), %rsi     # 0x82153
callq 0x4a300
movq %rax, 0x38(%rsp)
jmp 0x4afd8
leaq 0x298(%rsp), %rdi
callq 0x4e1f0
movq 0x38(%rsp), %rdi
movl (%rax), %esi
callq 0x4a450
movq %rax, 0x30(%rsp)
jmp 0x4aff8
movq 0x30(%rsp), %rdi
movq 0x4cfac(%rip), %rsi     # 0x97fb0
callq 0x4a360
jmp 0x4b00b
movq 0x4cfc6(%rip), %rdi     # 0x97fd8
leaq 0x37146(%rip), %rsi     # 0x8215f
callq 0x4a300
movq %rax, 0x28(%rsp)
jmp 0x4b025
leaq 0x298(%rsp), %rdi
callq 0x4e200
movq 0x28(%rsp), %rdi
movss (%rax), %xmm0
callq 0x4a230
movq %rax, 0x20(%rsp)
jmp 0x4b047
movq 0x20(%rsp), %rdi
movq 0x4cf5d(%rip), %rsi     # 0x97fb0
callq 0x4a360
jmp 0x4b05a
movq 0x4cf77(%rip), %rdi     # 0x97fd8
leaq 0x37103(%rip), %rsi     # 0x8216b
callq 0x4a300
movq %rax, 0x18(%rsp)
jmp 0x4b074
leaq 0x298(%rsp), %rdi
callq 0x4e210
movq 0x18(%rsp), %rdi
movl (%rax), %esi
callq 0x4a510
movq %rax, 0x10(%rsp)
jmp 0x4b094
movq 0x10(%rsp), %rdi
movq 0x4cf10(%rip), %rsi     # 0x97fb0
callq 0x4a360
jmp 0x4b0a7
jmp 0x4b1b5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x290(%rsp)
movl %eax, 0x28c(%rsp)
callq 0x4a4e0
jmp 0x4b0c7
jmp 0x4b1f4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x290(%rsp)
movl %eax, 0x28c(%rsp)
jmp 0x4b133
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x290(%rsp)
movl %eax, 0x28c(%rsp)
jmp 0x4b119
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x290(%rsp)
movl %eax, 0x28c(%rsp)
leaq 0x138(%rsp), %rdi
callq 0x4a5b8
leaq 0x137(%rsp), %rdi
callq 0x4a390
leaq 0x160(%rsp), %rdi
callq 0x4a5b8
leaq 0x15f(%rsp), %rdi
callq 0x4a390
jmp 0x4b156
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x290(%rsp)
movl %eax, 0x28c(%rsp)
movl 0x28c(%rsp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0x4b1f4
movq 0x290(%rsp), %rdi
callq 0x4a0f0
movq %rax, 0x128(%rsp)
movq 0x4ce52(%rip), %rdi     # 0x97fd8
leaq 0x3700e(%rip), %rsi     # 0x8219b
callq 0x4a300
movq %rax, 0x8(%rsp)
jmp 0x4b199
movq 0x8(%rsp), %rdi
movq 0x4ce0b(%rip), %rsi     # 0x97fb0
callq 0x4a360
jmp 0x4b1ac
callq 0x4a4e0
jmp 0x4b1b3
jmp 0x4b1b5
leaq 0x298(%rsp), %rdi
callq 0x4e1d0
leaq 0x2c8(%rsp), %rdi
callq 0x4dfa0
addq $0x358, %rsp            # imm = 0x358
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x290(%rsp)
movl %eax, 0x28c(%rsp)
callq 0x4a4e0
jmp 0x4b1f2
jmp 0x4b1f4
leaq 0x298(%rsp), %rdi
callq 0x4e1d0
leaq 0x2c8(%rsp), %rdi
callq 0x4dfa0
movq 0x290(%rsp), %rdi
callq 0x4a520
movq %rax, %rdi
callq 0x4e020
nopw %cs:(%rax,%rax)