// File: /workspace/github_cpp_makefile_star2_O3/wwdatabase[P]database/./smmana/sm.h
// Function: SM_Manager::drop_table(char const*)
RC SM_Manager::drop_table(const char* tablename)//////////////need more
{
	for(int i = 0;i < databases[current_db_index].table.size();i++)
	{
		if(strcmp(tablename,databases[current_db_index].table[i].tablename) == 0)
		{// delete this table,
			string de_file(databases[i].dbname);
			de_file = de_file + "/"+tablename;
			record_manager->destroyFile(de_file.c_str());
			databases[current_db_index].table.erase(databases[current_db_index].table.begin()+i);
			de_file = de_file+".www";
			record_manager->destroyFile(de_file.c_str());
			return 0;
				//delete corresponding table info
		}

	}
	printf("Table %s does not exists!\n",tablename);
	return 0;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rsi, %r14
movslq 0x18(%rdi), %rax
movq %rdi, -0x98(%rbp)
movq (%rdi), %rcx
imulq $0x118, %rax, %rax      # imm = 0x118
movq 0x100(%rcx,%rax), %r12
movq %rcx, -0x50(%rbp)
movq 0x108(%rcx,%rax), %rax
subq %r12, %rax
je 0x482a
sarq $0x4, %rax
movabsq $0x4ec4ec4ec4ec4ec5, %rbx # imm = 0x4EC4EC4EC4EC4EC5
imulq %rax, %rbx
cmpq $0x1, %rbx
adcq $0x0, %rbx
xorl %r13d, %r13d
movq -0x50(%rbp), %r15
movq %r14, %rdi
movq %r12, %rsi
callq 0x2240
testl %eax, %eax
je 0x4840
addq $-0xd0, %r13
addq $0x118, %r15            # imm = 0x118
addq $0xd0, %r12
decq %rbx
jne 0x4801
leaq 0x4ab7(%rip), %rdi      # 0x92e8
movq %r14, %rsi
xorl %eax, %eax
callq 0x2050
jmp 0x49d4
leaq -0x38(%rbp), %rax
movq %rax, -0x10(%rax)
cmpq $0x0, -0x50(%rbp)
je 0x485f
movq %r15, %rdi
callq 0x20c0
movq %rax, %rdx
addq %r15, %rdx
jmp 0x4864
movl $0x1, %edx
leaq -0x48(%rbp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x6f98
leaq -0x80(%rbp), %rbx
movq %rbx, -0x10(%rbx)
movq (%r12), %rsi
movq 0x8(%r12), %rdx
addq %rsi, %rdx
leaq -0x90(%rbp), %rdi
callq 0x6efa
leaq 0x4a47(%rip), %rsi      # 0x92e1
leaq -0x90(%rbp), %rdi
callq 0x2380
leaq -0x90(%rbp), %rdi
movq %r14, %rsi
callq 0x2380
leaq -0x60(%rbp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x48d9
movq %rdx, -0x70(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x60(%rbp)
jmp 0x48e0
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rdx
leaq -0x70(%rbp), %r14
movq %rdx, 0x8(%r14)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq -0x48(%rbp), %rdi
movq %r14, %rsi
callq 0x2220
movq (%r14), %rdi
cmpq %r15, %rdi
je 0x491b
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x21e0
movq -0x90(%rbp), %rdi
cmpq %rbx, %rdi
je 0x4933
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x21e0
movq -0x48(%rbp), %rsi
callq 0x395c
movq -0x98(%rbp), %rcx
movslq 0x18(%rcx), %rax
movq (%rcx), %rcx
imulq $0x118, %rax, %rax      # imm = 0x118
leaq (%rcx,%rax), %rdi
addq $0x100, %rdi            # imm = 0x100
movq (%rdi), %rsi
subq %r13, %rsi
callq 0x7f3e
leaq -0x70(%rbp), %rdi
movq %r15, (%rdi)
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
addq %rsi, %rdx
callq 0x6efa
leaq 0x495e(%rip), %rsi      # 0x92e3
leaq -0x70(%rbp), %rdi
callq 0x2380
leaq -0x48(%rbp), %rdi
leaq -0x70(%rbp), %rbx
movq %rbx, %rsi
callq 0x2220
movq (%rbx), %rdi
cmpq %r15, %rdi
je 0x49b2
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x21e0
movq -0x48(%rbp), %rsi
callq 0x395c
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x49d4
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x21e0
xorl %eax, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x70(%rbp), %rdi
cmpq %r15, %rdi
je 0x4a22
movq -0x60(%rbp), %rsi
jmp 0x4a13
jmp 0x4a1f
jmp 0x4a1f
jmp 0x49fd
movq %rbx, %rcx
movq %rax, %rbx
movq -0x90(%rbp), %rdi
cmpq %rcx, %rdi
je 0x4a22
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x21e0
jmp 0x4a22
jmp 0x4a1f
movq %rax, %rbx
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x4a3b
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x21e0
movq %rbx, %rdi
callq 0x2320
nop