// File: wwdatabase[P]database/./smmana/sm.h
// Function: SM_Manager::show_table(char const*)
RC SM_Manager::show_table(const char* tablename)
{
	cout << "Show table:" << endl;
	if(strcmp(tablename,"*") == 0)
	{
		cout << "show all tables!" << endl;
		for(int i = 0;i < databases.size();i++)
		{
			printf("Database name: %s\n",databases[i].dbname);
			for(int j = 0;j < databases[i].table.size();j++)
			{
				printf("Table name: %s\n",databases[i].table[j].tablename);
				printf("Table info:\n");
				cout << "Record Size: " << databases[i].table[j].recordSize << endl;
				for(int k = 0; k< databases[i].table[j].attrNum;k++)
				{
					cout << databases[i].table[j].attrName[k] <<" "<<databases[i].table[j].attrType[k] << " " << databases[i].table[j].attrLength[k] << " " << databases[i].table[j].isNull[k] << endl;
				}
				cout <<"Primary key number: " <<databases[i].table[j].prikeyNum << endl;
			}
		}

	}
	else
	{
		cout << "show one table!" << endl;
		for(int i = 0;i < databases.size();i++)
		{
			for(int j = 0;j < databases[i].table.size();j++)
			{
				if(strcmp(tablename,databases[i].table[j].tablename) == 0)
				{
					printf("Database name: %s\n",databases[i].dbname);
					printf("Table name: %s\n",databases[i].table[j].tablename);
					printf("Table info:\n");
					cout << "Record Size: " << databases[i].table[j].recordSize << endl;
					cout << "Attribute name|Attribute type|Attribute length|isnull" << endl;
					for(int k = 0; k< databases[i].table[j].attrNum;k++)
					{
						cout << databases[i].table[j].attrName[k] <<" "<<databases[i].table[j].attrType[k] << " " << databases[i].table[j].attrLength[k] << " " << databases[i].table[j].isNull[k] << endl;
					}
					cout <<"Primary key number: " <<databases[i].table[j].prikeyNum << endl;
					break;
				}
			}
		}
	}

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
movq 0x10fe6(%rip), %rdi     # 0x15fd8
leaq 0xa2fa(%rip), %rsi      # 0xf2f3
callq 0x2200
movq %rax, %rdi
movq 0x10fc0(%rip), %rsi     # 0x15fc8
callq 0x2240
movq -0x10(%rbp), %rdi
leaq 0xa1dc(%rip), %rsi      # 0xf1f4
callq 0x2300
cmpl $0x0, %eax
jne 0x535a
movq 0x10fab(%rip), %rdi     # 0x15fd8
leaq 0xa2cb(%rip), %rsi      # 0xf2ff
callq 0x2200
movq %rax, %rdi
movq 0x10f85(%rip), %rsi     # 0x15fc8
callq 0x2240
movl $0x0, -0x14(%rbp)
movq -0x30(%rbp), %rdi
movslq -0x14(%rbp), %rax
movq %rax, -0x38(%rbp)
callq 0x6c20
movq %rax, %rcx
movq -0x38(%rbp), %rax
cmpq %rcx, %rax
jae 0x5355
movq -0x30(%rbp), %rdi
movslq -0x14(%rbp), %rsi
callq 0x6c50
movq %rax, %rsi
leaq 0xa211(%rip), %rdi      # 0xf298
movb $0x0, %al
callq 0x2040
movl $0x0, -0x18(%rbp)
movq -0x30(%rbp), %rdi
movslq -0x18(%rbp), %rax
movq %rax, -0x40(%rbp)
movslq -0x14(%rbp), %rsi
callq 0x6c50
movq %rax, %rdi
addq $0x100, %rdi            # imm = 0x100
callq 0x6c70
movq %rax, %rcx
movq -0x40(%rbp), %rax
cmpq %rcx, %rax
jae 0x5345
movq -0x30(%rbp), %rdi
movslq -0x14(%rbp), %rsi
callq 0x6c50
movq %rax, %rdi
addq $0x100, %rdi            # imm = 0x100
movslq -0x18(%rbp), %rsi
callq 0x6ca0
movq %rax, %rsi
leaq 0xa21d(%rip), %rdi      # 0xf310
movb $0x0, %al
callq 0x2040
leaq 0xa21f(%rip), %rdi      # 0xf320
movb $0x0, %al
callq 0x2040
movq 0x10ec9(%rip), %rdi     # 0x15fd8
leaq 0xa217(%rip), %rsi      # 0xf32d
callq 0x2200
movq -0x30(%rbp), %rdi
movq %rax, -0x48(%rbp)
movslq -0x14(%rbp), %rsi
callq 0x6c50
movq %rax, %rdi
addq $0x100, %rdi            # imm = 0x100
movslq -0x18(%rbp), %rsi
callq 0x6ca0
movq -0x48(%rbp), %rdi
movl 0x64(%rax), %esi
callq 0x23b0
movq %rax, %rdi
movq 0x10e73(%rip), %rsi     # 0x15fc8
callq 0x2240
movl $0x0, -0x1c(%rbp)
movq -0x30(%rbp), %rdi
movl -0x1c(%rbp), %eax
movl %eax, -0x4c(%rbp)
movslq -0x14(%rbp), %rsi
callq 0x6c50
movq %rax, %rdi
addq $0x100, %rdi            # imm = 0x100
movslq -0x18(%rbp), %rsi
callq 0x6ca0
movq %rax, %rcx
movl -0x4c(%rbp), %eax
cmpl 0x68(%rcx), %eax
jge 0x52e5
movq -0x30(%rbp), %rdi
movslq -0x14(%rbp), %rsi
callq 0x6c50
movq %rax, %rdi
addq $0x100, %rdi            # imm = 0x100
movslq -0x18(%rbp), %rsi
callq 0x6ca0
movq %rax, %rdi
addq $0x70, %rdi
movslq -0x1c(%rbp), %rsi
callq 0x6fc0
movq %rax, %rsi
movq 0x10e08(%rip), %rdi     # 0x15fd8
callq 0x21e0
movq %rax, %rdi
leaq 0x9e61(%rip), %rsi      # 0xf040
callq 0x2200
movq -0x30(%rbp), %rdi
movq %rax, -0x68(%rbp)
movslq -0x14(%rbp), %rsi
callq 0x6c50
movq %rax, %rdi
addq $0x100, %rdi            # imm = 0x100
movslq -0x18(%rbp), %rsi
callq 0x6ca0
movq %rax, %rdi
addq $0x88, %rdi
movslq -0x1c(%rbp), %rsi
callq 0x6670
movq -0x68(%rbp), %rdi
movl (%rax), %esi
callq 0x23b0
movq %rax, %rdi
leaq 0x9e10(%rip), %rsi      # 0xf040
callq 0x2200
movq -0x30(%rbp), %rdi
movq %rax, -0x60(%rbp)
movslq -0x14(%rbp), %rsi
callq 0x6c50
movq %rax, %rdi
addq $0x100, %rdi            # imm = 0x100
movslq -0x18(%rbp), %rsi
callq 0x6ca0
movq %rax, %rdi
addq $0xa0, %rdi
movslq -0x1c(%rbp), %rsi
callq 0x6670
movq -0x60(%rbp), %rdi
movl (%rax), %esi
callq 0x23b0
movq %rax, %rdi
leaq 0x9dbf(%rip), %rsi      # 0xf040
callq 0x2200
movq -0x30(%rbp), %rdi
movq %rax, -0x58(%rbp)
movslq -0x14(%rbp), %rsi
callq 0x6c50
movq %rax, %rdi
addq $0x100, %rdi            # imm = 0x100
movslq -0x18(%rbp), %rsi
callq 0x6ca0
movq %rax, %rdi
addq $0xb8, %rdi
movslq -0x1c(%rbp), %rsi
callq 0x6670
movq -0x58(%rbp), %rdi
movl (%rax), %esi
callq 0x23b0
movq %rax, %rdi
movq 0x10cf6(%rip), %rsi     # 0x15fc8
callq 0x2240
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x5161
movq 0x10cec(%rip), %rdi     # 0x15fd8
leaq 0xa048(%rip), %rsi      # 0xf33b
callq 0x2200
movq -0x30(%rbp), %rdi
movq %rax, -0x70(%rbp)
movslq -0x14(%rbp), %rsi
callq 0x6c50
movq %rax, %rdi
addq $0x100, %rdi            # imm = 0x100
movslq -0x18(%rbp), %rsi
callq 0x6ca0
movq -0x70(%rbp), %rdi
movl 0x6c(%rax), %esi
callq 0x23b0
movq %rax, %rdi
movq 0x10c96(%rip), %rsi     # 0x15fc8
callq 0x2240
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x5095
jmp 0x5347
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x504f
jmp 0x5718
movq 0x10c77(%rip), %rdi     # 0x15fd8
leaq 0x9fe8(%rip), %rsi      # 0xf350
callq 0x2200
movq %rax, %rdi
movq 0x10c51(%rip), %rsi     # 0x15fc8
callq 0x2240
movl $0x0, -0x20(%rbp)
movq -0x30(%rbp), %rdi
movslq -0x20(%rbp), %rax
movq %rax, -0x78(%rbp)
callq 0x6c20
movq %rax, %rcx
movq -0x78(%rbp), %rax
cmpq %rcx, %rax
jae 0x5716
movl $0x0, -0x24(%rbp)
movq -0x30(%rbp), %rdi
movslq -0x24(%rbp), %rax
movq %rax, -0x80(%rbp)
movslq -0x20(%rbp), %rsi
callq 0x6c50
movq %rax, %rdi
addq $0x100, %rdi            # imm = 0x100
callq 0x6c70
movq %rax, %rcx
movq -0x80(%rbp), %rax
cmpq %rcx, %rax
jae 0x5706
movq -0x30(%rbp), %rdi
movq -0x10(%rbp), %rax
movq %rax, -0x88(%rbp)
movslq -0x20(%rbp), %rsi
callq 0x6c50
movq %rax, %rdi
addq $0x100, %rdi            # imm = 0x100
movslq -0x24(%rbp), %rsi
callq 0x6ca0
movq -0x88(%rbp), %rdi
movq %rax, %rsi
callq 0x2300
cmpl $0x0, %eax
jne 0x56f6
movq -0x30(%rbp), %rdi
movslq -0x20(%rbp), %rsi
callq 0x6c50
movq %rax, %rsi
leaq 0x9e5f(%rip), %rdi      # 0xf298
movb $0x0, %al
callq 0x2040
movq -0x30(%rbp), %rdi
movslq -0x20(%rbp), %rsi
callq 0x6c50
movq %rax, %rdi
addq $0x100, %rdi            # imm = 0x100
movslq -0x24(%rbp), %rsi
callq 0x6ca0
movq %rax, %rsi
leaq 0x9ea6(%rip), %rdi      # 0xf310
movb $0x0, %al
callq 0x2040
leaq 0x9ea8(%rip), %rdi      # 0xf320
movb $0x0, %al
callq 0x2040
movq 0x10b52(%rip), %rdi     # 0x15fd8
leaq 0x9ea0(%rip), %rsi      # 0xf32d
callq 0x2200
movq -0x30(%rbp), %rdi
movq %rax, -0x90(%rbp)
movslq -0x20(%rbp), %rsi
callq 0x6c50
movq %rax, %rdi
addq $0x100, %rdi            # imm = 0x100
movslq -0x24(%rbp), %rsi
callq 0x6ca0
movq -0x90(%rbp), %rdi
movl 0x64(%rax), %esi
callq 0x23b0
movq %rax, %rdi
movq 0x10af6(%rip), %rsi     # 0x15fc8
callq 0x2240
movq 0x10afa(%rip), %rdi     # 0x15fd8
leaq 0x9e7b(%rip), %rsi      # 0xf360
callq 0x2200
movq %rax, %rdi
movq 0x10ad4(%rip), %rsi     # 0x15fc8
callq 0x2240
movl $0x0, -0x28(%rbp)
movq -0x30(%rbp), %rdi
movl -0x28(%rbp), %eax
movl %eax, -0x94(%rbp)
movslq -0x20(%rbp), %rsi
callq 0x6c50
movq %rax, %rdi
addq $0x100, %rdi            # imm = 0x100
movslq -0x24(%rbp), %rsi
callq 0x6ca0
movq %rax, %rcx
movl -0x94(%rbp), %eax
cmpl 0x68(%rcx), %eax
jge 0x569c
movq -0x30(%rbp), %rdi
movslq -0x20(%rbp), %rsi
callq 0x6c50
movq %rax, %rdi
addq $0x100, %rdi            # imm = 0x100
movslq -0x24(%rbp), %rsi
callq 0x6ca0
movq %rax, %rdi
addq $0x70, %rdi
movslq -0x28(%rbp), %rsi
callq 0x6fc0
movq %rax, %rsi
movq 0x10a63(%rip), %rdi     # 0x15fd8
callq 0x21e0
movq %rax, %rdi
leaq 0x9abc(%rip), %rsi      # 0xf040
callq 0x2200
movq -0x30(%rbp), %rdi
movq %rax, -0xb0(%rbp)
movslq -0x20(%rbp), %rsi
callq 0x6c50
movq %rax, %rdi
addq $0x100, %rdi            # imm = 0x100
movslq -0x24(%rbp), %rsi
callq 0x6ca0
movq %rax, %rdi
addq $0x88, %rdi
movslq -0x28(%rbp), %rsi
callq 0x6670
movq -0xb0(%rbp), %rdi
movl (%rax), %esi
callq 0x23b0
movq %rax, %rdi
leaq 0x9a65(%rip), %rsi      # 0xf040
callq 0x2200
movq -0x30(%rbp), %rdi
movq %rax, -0xa8(%rbp)
movslq -0x20(%rbp), %rsi
callq 0x6c50
movq %rax, %rdi
addq $0x100, %rdi            # imm = 0x100
movslq -0x24(%rbp), %rsi
callq 0x6ca0
movq %rax, %rdi
addq $0xa0, %rdi
movslq -0x28(%rbp), %rsi
callq 0x6670
movq -0xa8(%rbp), %rdi
movl (%rax), %esi
callq 0x23b0
movq %rax, %rdi
leaq 0x9a0e(%rip), %rsi      # 0xf040
callq 0x2200
movq -0x30(%rbp), %rdi
movq %rax, -0xa0(%rbp)
movslq -0x20(%rbp), %rsi
callq 0x6c50
movq %rax, %rdi
addq $0x100, %rdi            # imm = 0x100
movslq -0x24(%rbp), %rsi
callq 0x6ca0
movq %rax, %rdi
addq $0xb8, %rdi
movslq -0x28(%rbp), %rsi
callq 0x6670
movq -0xa0(%rbp), %rdi
movl (%rax), %esi
callq 0x23b0
movq %rax, %rdi
movq 0x1093f(%rip), %rsi     # 0x15fc8
callq 0x2240
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x5500
movq 0x10935(%rip), %rdi     # 0x15fd8
leaq 0x9c91(%rip), %rsi      # 0xf33b
callq 0x2200
movq -0x30(%rbp), %rdi
movq %rax, -0xb8(%rbp)
movslq -0x20(%rbp), %rsi
callq 0x6c50
movq %rax, %rdi
addq $0x100, %rdi            # imm = 0x100
movslq -0x24(%rbp), %rsi
callq 0x6ca0
movq -0xb8(%rbp), %rdi
movl 0x6c(%rax), %esi
callq 0x23b0
movq %rax, %rdi
movq 0x108d9(%rip), %rsi     # 0x15fc8
callq 0x2240
jmp 0x5706
jmp 0x56f8
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x53ab
jmp 0x5708
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x5383
jmp 0x5718
xorl %eax, %eax
addq $0xc0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)