// File: /workspace/github_cpp_makefile_star2_O3/wwdatabase[P]database/./smmana/sm.h
// Function: SM_Manager::SM_Manager()
SM_Manager(){ //init the database
		record_manager = RecordManager::getInstance();
		DIR* nowdir = opendir(".");
		dirent* nowf;
		vector<string> dbs;
		while((nowf = readdir(nowdir))!= NULL)
		{
			string fileName(nowf->d_name);
			if(nowf->d_type == DT_DIR)
			{
				if(fileName == ".."||fileName == ".")
					continue;
				DB db;
				strcpy(db.dbname,fileName.c_str());
				databases.push_back(db);
			}
		}
		closedir(nowdir);
		for(int i = 0;i < databases.size();i++)
		{
			nowdir = opendir(databases[i].dbname);
		//	printf("rua: %s\n",databases[i].dbname);
			while((nowf = readdir(nowdir))!= NULL)
			{
				char c[255];
				strcpy(c,nowf->d_name);
				if(strcmp(c,".") == 0 || strcmp(c,"..")==0)
					continue;
				int len = strlen(c);
				for(int j = len-1;j >= 0;j--)
				{
					if(c[j] == '.')
					{
						if(strcmp(c+j+1,"www") == 0)// got table info
						{
				//			cout << databases[i].dbname << endl;;
							string path_(databases[i].dbname);
							path_ =path_+ "/"+c;
							FILE* in;
							in = fopen(path_.c_str(),"r");
							if(in == NULL)
								cout << "cannot open the .www file" << endl;
							table_entry tb;
							char temp_attr_name[255];
							int temp_type;
							int temp_attrlen;
							int temp_isnull;
							char temp_name[255];
							fscanf(in,"%s%d%d%d",tb.tablename,&tb.attrNum,&tb.prikeyNum,&tb.recordSize);

								for(int k = 0;k < tb.attrNum;k++)
								{
									fscanf(in,"%s%d%d%d",temp_attr_name,&temp_type,&temp_attrlen,&temp_isnull);
									tb.attrName.push_back(temp_attr_name);
									tb.attrType.push_back(temp_type);
									tb.attrLength.push_back(temp_attrlen);
									tb.isNull.push_back(temp_isnull);
								}
							databases[i].table.push_back(tb);
							fclose(in);
						}
					}
				}

			}
			closedir(nowdir);


		}

	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x378, %rsp            # imm = 0x378
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, 0xc(%rdi)
movups %xmm0, (%rdi)
movq %rdi, -0x30(%rbp)
callq 0x6bc6
movq %rax, 0x20(%rbx)
leaq 0x3884(%rip), %rdi      # 0x941b
callq 0x2290
movq %rax, %r14
xorps %xmm0, %xmm0
movaps %xmm0, -0x180(%rbp)
movq $0x0, -0x170(%rbp)
leaq -0x2a0(%rbp), %r15
leaq -0x280(%rbp), %r12
movq %r14, %rdi
callq 0x22a0
movq %rax, %rbx
testq %rax, %rax
je 0x5c93
leaq 0x13(%rbx), %r13
leaq -0x270(%rbp), %rax
movq %rax, -0x280(%rbp)
movq %r13, %rdi
callq 0x20c0
leaq (%rbx,%rax), %rdx
addq $0x13, %rdx
movq %r12, %rdi
movq %r13, %rsi
callq 0x6f98
cmpb $0x4, 0x12(%rbx)
jne 0x5c68
movq %r12, %rdi
leaq 0x3807(%rip), %rsi      # 0x941a
callq 0x2070
testl %eax, %eax
je 0x5c68
movq %r12, %rdi
leaq 0x37f5(%rip), %rsi      # 0x941b
callq 0x2070
testl %eax, %eax
je 0x5c68
xorps %xmm0, %xmm0
movups %xmm0, (%r15)
movq $0x0, 0x10(%r15)
movq -0x280(%rbp), %rsi
leaq -0x3a0(%rbp), %rbx
movq %rbx, %rdi
callq 0x21a0
movq -0x30(%rbp), %rdi
movq %rbx, %rsi
callq 0x59ce
movq %r15, %rdi
callq 0x6b12
movq -0x280(%rbp), %rdi
leaq -0x270(%rbp), %rax
cmpq %rax, %rdi
je 0x5bc2
movq -0x270(%rbp), %rsi
incq %rsi
callq 0x21e0
jmp 0x5bc2
movq %r14, %rdi
callq 0x22d0
movq -0x30(%rbp), %rax
movq (%rax), %rdi
cmpq %rdi, 0x8(%rax)
je 0x615f
leaq 0x3631(%rip), %r15      # 0x92e4
leaq -0x280(%rbp), %rbx
leaq -0x90(%rbp), %r14
xorl %edx, %edx
movq %rdx, -0x98(%rbp)
imulq $0x118, %rdx, %rcx      # imm = 0x118
movq %rcx, -0x70(%rbp)
addq %rcx, %rdi
callq 0x2290
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rdi
callq 0x22a0
testq %rax, %rax
je 0x6123
addq $0x13, %rax
leaq -0x3a0(%rbp), %rdi
movq %rax, %rsi
callq 0x21a0
cmpw $0x2e, -0x3a0(%rbp)
je 0x5ce1
movl -0x3a0(%rbp), %eax
movl $0x2e2e, %ecx           # imm = 0x2E2E
xorl %ecx, %eax
movzbl -0x39e(%rbp), %ecx
orw %ax, %cx
je 0x5ce1
leaq -0x3a0(%rbp), %rdi
callq 0x20c0
movq %rax, %r12
testl %r12d, %r12d
jle 0x5ce1
andl $0x7fffffff, %r12d      # imm = 0x7FFFFFFF
cmpb $0x2e, -0x3a1(%rbp,%r12)
jne 0x610c
leaq (%r12,%rbp), %rdi
addq $-0x3a0, %rdi           # imm = 0xFC60
movq %r15, %rsi
callq 0x2240
testl %eax, %eax
jne 0x610c
movq -0x30(%rbp), %rax
movq (%rax), %rax
movq -0x70(%rbp), %rcx
leaq (%rax,%rcx), %r13
leaq -0x50(%rbp), %rcx
movq %rcx, -0x60(%rbp)
testq %rax, %rax
je 0x5d9a
movq %r13, %rdi
callq 0x20c0
movq %rax, %rdx
addq %r13, %rdx
jmp 0x5d9f
movl $0x1, %edx
leaq -0x60(%rbp), %rdi
movq %r13, %rsi
callq 0x6f98
leaq -0x158(%rbp), %rax
movq %rax, -0x168(%rbp)
movq -0x60(%rbp), %rsi
movq -0x58(%rbp), %rdx
addq %rsi, %rdx
leaq -0x168(%rbp), %r15
movq %r15, %rdi
callq 0x6efa
movq %r15, %rdi
leaq 0x3504(%rip), %rsi      # 0x92e1
callq 0x2380
movq %r15, %rdi
leaq -0x3a0(%rbp), %rsi
callq 0x2380
leaq -0x270(%rbp), %r15
movq %r15, -0x280(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x5e21
movq %rdx, -0x280(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x270(%rbp)
jmp 0x5e28
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rdx
movq %rdx, -0x278(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq -0x60(%rbp), %rdi
movq %rbx, %rsi
callq 0x2220
movq -0x280(%rbp), %rdi
cmpq %r15, %rdi
je 0x5e69
movq -0x270(%rbp), %rsi
incq %rsi
callq 0x21e0
movq -0x168(%rbp), %rdi
leaq -0x158(%rbp), %rax
cmpq %rax, %rdi
je 0x5e8b
movq -0x158(%rbp), %rsi
incq %rsi
callq 0x21e0
movq -0x60(%rbp), %rdi
leaq 0x3587(%rip), %rsi      # 0x941d
callq 0x2210
movq %rax, %r13
testq %rax, %rax
jne 0x5eed
movl $0x19, %edx
movq 0x7129(%rip), %rdi      # 0xcfd8
leaq 0x3569(%rip), %rsi      # 0x941f
callq 0x2200
movq 0x7116(%rip), %rcx      # 0xcfd8
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x21b0
movsbl %al, %esi
movq 0x70f8(%rip), %rdi      # 0xcfd8
callq 0x2040
movq %rax, %rdi
callq 0x2120
leaq -0xf8(%rbp), %rax
xorps %xmm0, %xmm0
movups %xmm0, 0x50(%rax)
movups %xmm0, 0x40(%rax)
movups %xmm0, 0x30(%rax)
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
movq %r13, %rdi
leaq 0x3521(%rip), %rsi      # 0x9439
leaq -0x168(%rbp), %rdx
leaq -0x100(%rbp), %rcx
leaq -0xfc(%rbp), %r8
leaq -0x104(%rbp), %r9
xorl %eax, %eax
callq 0x2360
cmpl $0x0, -0x100(%rbp)
jle 0x6065
xorl %r15d, %r15d
movq %r13, %rdi
leaq 0x34e4(%rip), %rsi      # 0x9439
movq %rbx, %rdx
leaq -0x3c(%rbp), %rcx
leaq -0x38(%rbp), %r8
leaq -0x34(%rbp), %r9
xorl %eax, %eax
callq 0x2360
leaq -0x80(%rbp), %rax
movq %rax, -0x90(%rbp)
movq %rbx, %rdi
callq 0x20c0
leaq (%rax,%rbp), %rdx
addq $-0x280, %rdx           # imm = 0xFD80
movq %r14, %rdi
movq %rbx, %rsi
callq 0x6f98
leaq -0xf8(%rbp), %rdi
movq %r14, %rsi
callq 0x6c74
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0x5fbf
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x21e0
movq -0xd8(%rbp), %rsi
cmpq -0xd0(%rbp), %rsi
je 0x5fe1
movl -0x3c(%rbp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, -0xd8(%rbp)
jmp 0x5ff1
leaq -0xe0(%rbp), %rdi
leaq -0x3c(%rbp), %rdx
callq 0x7940
movq -0xc0(%rbp), %rsi
cmpq -0xb8(%rbp), %rsi
je 0x6013
movl -0x38(%rbp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, -0xc0(%rbp)
jmp 0x6023
leaq -0xc8(%rbp), %rdi
leaq -0x38(%rbp), %rdx
callq 0x7940
movq -0xa8(%rbp), %rsi
cmpq -0xa0(%rbp), %rsi
je 0x6045
movl -0x34(%rbp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, -0xa8(%rbp)
jmp 0x6055
leaq -0xb0(%rbp), %rdi
leaq -0x34(%rbp), %rdx
callq 0x7940
incl %r15d
cmpl -0x100(%rbp), %r15d
jl 0x5f4b
movq -0x30(%rbp), %rax
movq (%rax), %rax
movq -0x70(%rbp), %rcx
leaq (%rax,%rcx), %rdi
addq $0x100, %rdi            # imm = 0x100
leaq -0x168(%rbp), %rsi
callq 0x5a3a
movq %r13, %rdi
callq 0x21c0
movq -0xb0(%rbp), %rdi
testq %rdi, %rdi
je 0x60aa
movq -0xa0(%rbp), %rsi
subq %rdi, %rsi
callq 0x21e0
movq -0xc8(%rbp), %rdi
testq %rdi, %rdi
leaq 0x3229(%rip), %r15      # 0x92e4
je 0x60cc
movq -0xb8(%rbp), %rsi
subq %rdi, %rsi
callq 0x21e0
movq -0xe0(%rbp), %rdi
testq %rdi, %rdi
je 0x60e7
movq -0xd0(%rbp), %rsi
subq %rdi, %rsi
callq 0x21e0
leaq -0xf8(%rbp), %rdi
callq 0x5960
movq -0x60(%rbp), %rdi
leaq -0x50(%rbp), %rax
cmpq %rax, %rdi
je 0x610c
movq -0x50(%rbp), %rsi
incq %rsi
callq 0x21e0
leaq -0x1(%r12), %rax
cmpq $0x1, %r12
movq %rax, %r12
jg 0x5d44
jmp 0x5ce1
movq -0x68(%rbp), %rdi
callq 0x22d0
movq -0x98(%rbp), %rdx
incq %rdx
movq -0x30(%rbp), %rax
movq (%rax), %rdi
movq 0x8(%rax), %rax
subq %rdi, %rax
sarq $0x3, %rax
movabsq $-0x5075075075075075, %rcx # imm = 0xAF8AF8AF8AF8AF8B
imulq %rcx, %rax
cmpq %rdx, %rax
ja 0x5cc3
leaq -0x180(%rbp), %rdi
callq 0x5960
addq $0x378, %rsp            # imm = 0x378
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x62a5
movq %rax, %rbx
movq %r15, %rdi
callq 0x6b12
movq -0x280(%rbp), %rdi
leaq -0x270(%rbp), %rax
cmpq %rax, %rdi
je 0x6299
movq -0x270(%rbp), %rsi
jmp 0x6291
jmp 0x61bb
jmp 0x61bb
jmp 0x61bb
jmp 0x61c3
movq %rax, %rbx
jmp 0x6299
movq %rax, %rbx
movq -0x168(%rbp), %rdi
leaq -0x158(%rbp), %rax
cmpq %rax, %rdi
je 0x6280
movq -0x158(%rbp), %rsi
incq %rsi
callq 0x21e0
jmp 0x6280
jmp 0x61f3
movq %rax, %rbx
jmp 0x6280
jmp 0x6220
jmp 0x6220
movq %rax, %rbx
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0x6223
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x21e0
jmp 0x6223
movq %rax, %rbx
movq -0xb0(%rbp), %rdi
testq %rdi, %rdi
je 0x623e
movq -0xa0(%rbp), %rsi
subq %rdi, %rsi
callq 0x21e0
movq -0xc8(%rbp), %rdi
testq %rdi, %rdi
je 0x6259
movq -0xb8(%rbp), %rsi
subq %rdi, %rsi
callq 0x21e0
movq -0xe0(%rbp), %rdi
testq %rdi, %rdi
je 0x6274
movq -0xd0(%rbp), %rsi
subq %rdi, %rsi
callq 0x21e0
leaq -0xf8(%rbp), %rdi
callq 0x5960
movq -0x60(%rbp), %rdi
leaq -0x50(%rbp), %rax
cmpq %rax, %rdi
je 0x6299
movq -0x50(%rbp), %rsi
incq %rsi
callq 0x21e0
leaq -0x180(%rbp), %rdi
callq 0x5960
movq -0x30(%rbp), %rdi
callq 0x6c16
movq %rbx, %rdi
callq 0x2320