// File: /workspace/github_cpp_makefile_star2_O2/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 $0x388, %rsp            # imm = 0x388
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, 0xc(%rdi)
movups %xmm0, (%rdi)
movq %rdi, -0x38(%rbp)
callq 0x5976
movq %rax, 0x20(%rbx)
leaq 0x27f6(%rip), %rdi      # 0x741b
callq 0x22b0
movq %rax, %r14
xorps %xmm0, %xmm0
movaps %xmm0, -0x80(%rbp)
andq $0x0, -0x70(%rbp)
leaq -0x3b0(%rbp), %r12
leaq -0x2b0(%rbp), %r13
leaq 0x27cc(%rip), %rbx      # 0x741a
movq %r14, %rdi
callq 0x22c0
movq %rax, %r15
testq %rax, %rax
je 0x4cd9
leaq 0x13(%r15), %rsi
movq %r12, %rdi
movq %r13, %rdx
callq 0x46c6
cmpb $0x4, 0x12(%r15)
jne 0x4ccc
movq %r12, %rdi
movq %rbx, %rsi
callq 0x59c1
testb %al, %al
jne 0x4ccc
movq %r12, %rdi
leaq 0x278e(%rip), %rsi      # 0x741b
callq 0x59c1
testb %al, %al
jne 0x4ccc
xorps %xmm0, %xmm0
leaq -0x1b0(%rbp), %r15
movups %xmm0, (%r15)
andq $0x0, 0x10(%r15)
movq -0x3b0(%rbp), %rsi
movq %r13, %rdi
callq 0x21a0
movq -0x38(%rbp), %rdi
movq %r13, %rsi
callq 0x4a40
movq %r15, %rdi
callq 0x58da
movq %r12, %rdi
callq 0x20b0
jmp 0x4c4e
movq %r14, %rdi
callq 0x22f0
leaq 0x25fc(%rip), %r12      # 0x72e4
leaq -0x3b0(%rbp), %rbx
leaq -0x64(%rbp), %r15
leaq -0x190(%rbp), %r14
xorl %esi, %esi
movq -0x38(%rbp), %rax
movq (%rax), %rdi
movq 0x8(%rax), %rax
subq %rdi, %rax
cqto
movl $0x118, %ecx            # imm = 0x118
idivq %rcx
cmpq %rsi, %rax
jbe 0x4f98
movq %rsi, -0x60(%rbp)
imulq $0x118, %rsi, %rcx      # imm = 0x118
movq %rcx, -0x50(%rbp)
addq %rcx, %rdi
callq 0x22b0
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rdi
callq 0x22c0
testq %rax, %rax
je 0x4f83
addq $0x13, %rax
leaq -0x2b0(%rbp), %rdi
movq %rax, %rsi
callq 0x21a0
cmpw $0x2e, -0x2b0(%rbp)
je 0x4d38
leaq -0x2b0(%rbp), %rdi
leaq 0x26a5(%rip), %rsi      # 0x741a
pushq $0x3
popq %rdx
callq 0x21f0
testl %eax, %eax
je 0x4d38
leaq -0x2b0(%rbp), %rdi
callq 0x20a0
movl %eax, %ecx
movq %rcx, %rax
testl %eax, %eax
jle 0x4d38
leaq -0x1(%rax), %rcx
cmpb $0x2e, -0x2b0(%rbp,%rcx)
jne 0x4d8f
leaq (%rax,%rbp), %rdi
addq $-0x2b0, %rdi           # imm = 0xFD50
movq %r12, %rsi
movq %rcx, -0x58(%rbp)
callq 0x2260
movq -0x58(%rbp), %rcx
testl %eax, %eax
jne 0x4d8f
movq -0x38(%rbp), %rax
movq (%rax), %rsi
addq -0x50(%rbp), %rsi
leaq -0xa0(%rbp), %r12
movq %r12, %rdi
movq %rbx, %rdx
callq 0x46c6
leaq -0x170(%rbp), %r13
movq %r13, %rdi
movq %r12, %rsi
leaq 0x24ed(%rip), %rdx      # 0x72e1
callq 0x4b15
movq %rbx, %rdi
movq %r13, %rsi
leaq -0x2b0(%rbp), %rdx
callq 0x4aec
movq %r12, %rdi
movq %rbx, %rsi
callq 0x2220
movq %rbx, %rdi
callq 0x20b0
movq %r13, %rdi
callq 0x20b0
movq -0xa0(%rbp), %rdi
leaq 0x25e9(%rip), %rsi      # 0x741d
callq 0x2210
movq %rax, %r12
testq %rax, %rax
jne 0x4e5c
movq 0x6190(%rip), %rdi      # 0xafd8
leaq 0x25d0(%rip), %rsi      # 0x741f
callq 0x21b0
movq %rax, %rdi
callq 0x20d0
leaq -0x100(%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 %r12, %rdi
leaq 0x25b2(%rip), %rsi      # 0x7439
leaq -0x170(%rbp), %rdx
leaq -0x108(%rbp), %rcx
leaq -0x104(%rbp), %r8
leaq -0x10c(%rbp), %r9
xorl %eax, %eax
callq 0x2370
xorl %r13d, %r13d
cmpl -0x108(%rbp), %r13d
jge 0x4f32
movq %r12, %rdi
leaq 0x2579(%rip), %rsi      # 0x7439
movq %rbx, %rdx
leaq -0x40(%rbp), %rcx
leaq -0x3c(%rbp), %r8
movq %r15, %r9
xorl %eax, %eax
callq 0x2370
movq %r14, %rdi
movq %rbx, %rsi
leaq -0x29(%rbp), %rdx
callq 0x46c6
leaq -0x100(%rbp), %rdi
movq %r14, %rsi
callq 0x59fe
movq %r14, %rdi
callq 0x20b0
leaq -0xe8(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x4a88
leaq -0xd0(%rbp), %rdi
leaq -0x3c(%rbp), %rsi
callq 0x4a88
leaq -0xb8(%rbp), %rdi
movq %r15, %rsi
callq 0x4a88
incl %r13d
jmp 0x4ead
movq -0x38(%rbp), %rax
movq (%rax), %rax
movq -0x50(%rbp), %rcx
leaq (%rax,%rcx), %rdi
addq $0x100, %rdi            # imm = 0x100
leaq -0x170(%rbp), %r13
movq %r13, %rsi
callq 0x4aae
movq %r12, %rdi
callq 0x21c0
movq %r13, %rdi
callq 0x4ba6
leaq -0xa0(%rbp), %rdi
callq 0x20b0
leaq 0x236a(%rip), %r12      # 0x72e4
movq -0x58(%rbp), %rcx
jmp 0x4d8f
movq -0x48(%rbp), %rdi
callq 0x22f0
movq -0x60(%rbp), %rsi
incq %rsi
jmp 0x4cfc
leaq -0x80(%rbp), %rdi
callq 0x4986
addq $0x388, %rsp            # imm = 0x388
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x5028
movq %rax, %rbx
movq %r15, %rdi
callq 0x58da
leaq -0x3b0(%rbp), %rdi
jmp 0x501a
jmp 0x4fd4
jmp 0x4fd4
jmp 0x4fd4
jmp 0x4fea
movq %rax, %rbx
jmp 0x501f
movq %rax, %rbx
leaq -0x170(%rbp), %rdi
callq 0x20b0
jmp 0x5013
movq %rax, %rbx
jmp 0x5013
jmp 0x5004
movq %rax, %rbx
leaq -0x190(%rbp), %rdi
callq 0x20b0
jmp 0x5007
jmp 0x5004
movq %rax, %rbx
leaq -0x170(%rbp), %rdi
callq 0x4ba6
leaq -0xa0(%rbp), %rdi
callq 0x20b0
leaq -0x80(%rbp), %rdi
callq 0x4986
movq -0x38(%rbp), %rdi
callq 0x59d2
movq %rbx, %rdi
callq 0x2330
nop