// File: /workspace/github_cpp_makefile_star2_O1/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 0x6c72
movq %rax, 0x20(%rbx)
leaq 0x37c2(%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 0x5d55
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 0x7034
cmpb $0x4, 0x12(%rbx)
jne 0x5d2a
movq %r12, %rdi
leaq 0x3745(%rip), %rsi      # 0x941a
callq 0x2070
testl %eax, %eax
je 0x5d2a
movq %r12, %rdi
leaq 0x3733(%rip), %rsi      # 0x941b
callq 0x2070
testl %eax, %eax
je 0x5d2a
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 0x5a90
movq %r15, %rdi
callq 0x6bbe
movq -0x280(%rbp), %rdi
leaq -0x270(%rbp), %rax
cmpq %rax, %rdi
je 0x5c84
movq -0x270(%rbp), %rsi
incq %rsi
callq 0x21e0
jmp 0x5c84
movq %r14, %rdi
callq 0x22d0
movq -0x30(%rbp), %rax
movq (%rax), %rdi
cmpq %rdi, 0x8(%rax)
je 0x6221
leaq 0x356f(%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 0x61e5
addq $0x13, %rax
leaq -0x3a0(%rbp), %rdi
movq %rax, %rsi
callq 0x21a0
cmpw $0x2e, -0x3a0(%rbp)
je 0x5da3
movl -0x3a0(%rbp), %eax
movl $0x2e2e, %ecx           # imm = 0x2E2E
xorl %ecx, %eax
movzbl -0x39e(%rbp), %ecx
orw %ax, %cx
je 0x5da3
leaq -0x3a0(%rbp), %rdi
callq 0x20c0
movq %rax, %r12
testl %r12d, %r12d
jle 0x5da3
andl $0x7fffffff, %r12d      # imm = 0x7FFFFFFF
cmpb $0x2e, -0x3a1(%rbp,%r12)
jne 0x61ce
leaq (%r12,%rbp), %rdi
addq $-0x3a0, %rdi           # imm = 0xFC60
movq %r15, %rsi
callq 0x2240
testl %eax, %eax
jne 0x61ce
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 0x5e5c
movq %r13, %rdi
callq 0x20c0
movq %rax, %rdx
addq %r13, %rdx
jmp 0x5e61
movl $0x1, %edx
leaq -0x60(%rbp), %rdi
movq %r13, %rsi
callq 0x7034
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 0x6f9a
movq %r15, %rdi
leaq 0x3442(%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 0x5ee3
movq %rdx, -0x280(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x270(%rbp)
jmp 0x5eea
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 0x5f2b
movq -0x270(%rbp), %rsi
incq %rsi
callq 0x21e0
movq -0x168(%rbp), %rdi
leaq -0x158(%rbp), %rax
cmpq %rax, %rdi
je 0x5f4d
movq -0x158(%rbp), %rsi
incq %rsi
callq 0x21e0
movq -0x60(%rbp), %rdi
leaq 0x34c5(%rip), %rsi      # 0x941d
callq 0x2210
movq %rax, %r13
testq %rax, %rax
jne 0x5faf
movl $0x19, %edx
movq 0x7067(%rip), %rdi      # 0xcfd8
leaq 0x34a7(%rip), %rsi      # 0x941f
callq 0x2200
movq 0x7054(%rip), %rcx      # 0xcfd8
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x21b0
movsbl %al, %esi
movq 0x7036(%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 0x345f(%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 0x6127
xorl %r15d, %r15d
movq %r13, %rdi
leaq 0x3422(%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 0x7034
leaq -0xf8(%rbp), %rdi
movq %r14, %rsi
callq 0x6d1c
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0x6081
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x21e0
movq -0xd8(%rbp), %rsi
cmpq -0xd0(%rbp), %rsi
je 0x60a3
movl -0x3c(%rbp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, -0xd8(%rbp)
jmp 0x60b3
leaq -0xe0(%rbp), %rdi
leaq -0x3c(%rbp), %rdx
callq 0x7a0c
movq -0xc0(%rbp), %rsi
cmpq -0xb8(%rbp), %rsi
je 0x60d5
movl -0x38(%rbp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, -0xc0(%rbp)
jmp 0x60e5
leaq -0xc8(%rbp), %rdi
leaq -0x38(%rbp), %rdx
callq 0x7a0c
movq -0xa8(%rbp), %rsi
cmpq -0xa0(%rbp), %rsi
je 0x6107
movl -0x34(%rbp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, -0xa8(%rbp)
jmp 0x6117
leaq -0xb0(%rbp), %rdi
leaq -0x34(%rbp), %rdx
callq 0x7a0c
incl %r15d
cmpl -0x100(%rbp), %r15d
jl 0x600d
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 0x5afc
movq %r13, %rdi
callq 0x21c0
movq -0xb0(%rbp), %rdi
testq %rdi, %rdi
je 0x616c
movq -0xa0(%rbp), %rsi
subq %rdi, %rsi
callq 0x21e0
movq -0xc8(%rbp), %rdi
testq %rdi, %rdi
leaq 0x3167(%rip), %r15      # 0x92e4
je 0x618e
movq -0xb8(%rbp), %rsi
subq %rdi, %rsi
callq 0x21e0
movq -0xe0(%rbp), %rdi
testq %rdi, %rdi
je 0x61a9
movq -0xd0(%rbp), %rsi
subq %rdi, %rsi
callq 0x21e0
leaq -0xf8(%rbp), %rdi
callq 0x5a26
movq -0x60(%rbp), %rdi
leaq -0x50(%rbp), %rax
cmpq %rax, %rdi
je 0x61ce
movq -0x50(%rbp), %rsi
incq %rsi
callq 0x21e0
leaq -0x1(%r12), %rax
cmpq $0x1, %r12
movq %rax, %r12
jg 0x5e06
jmp 0x5da3
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 0x5d85
leaq -0x180(%rbp), %rdi
callq 0x5a26
addq $0x378, %rsp            # imm = 0x378
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x6367
movq %rax, %rbx
movq %r15, %rdi
callq 0x6bbe
movq -0x280(%rbp), %rdi
leaq -0x270(%rbp), %rax
cmpq %rax, %rdi
je 0x635b
movq -0x270(%rbp), %rsi
jmp 0x6353
jmp 0x627d
jmp 0x627d
jmp 0x627d
jmp 0x6285
movq %rax, %rbx
jmp 0x635b
movq %rax, %rbx
movq -0x168(%rbp), %rdi
leaq -0x158(%rbp), %rax
cmpq %rax, %rdi
je 0x6342
movq -0x158(%rbp), %rsi
incq %rsi
callq 0x21e0
jmp 0x6342
jmp 0x62b5
movq %rax, %rbx
jmp 0x6342
jmp 0x62e2
jmp 0x62e2
movq %rax, %rbx
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0x62e5
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x21e0
jmp 0x62e5
movq %rax, %rbx
movq -0xb0(%rbp), %rdi
testq %rdi, %rdi
je 0x6300
movq -0xa0(%rbp), %rsi
subq %rdi, %rsi
callq 0x21e0
movq -0xc8(%rbp), %rdi
testq %rdi, %rdi
je 0x631b
movq -0xb8(%rbp), %rsi
subq %rdi, %rsi
callq 0x21e0
movq -0xe0(%rbp), %rdi
testq %rdi, %rdi
je 0x6336
movq -0xd0(%rbp), %rsi
subq %rdi, %rsi
callq 0x21e0
leaq -0xf8(%rbp), %rdi
callq 0x5a26
movq -0x60(%rbp), %rdi
leaq -0x50(%rbp), %rax
cmpq %rax, %rdi
je 0x635b
movq -0x50(%rbp), %rsi
incq %rsi
callq 0x21e0
leaq -0x180(%rbp), %rdi
callq 0x5a26
movq -0x30(%rbp), %rdi
callq 0x6cc4
movq %rbx, %rdi
callq 0x2320