// File: /workspace/github_cpp_makefile_star2_O1/wwdatabase[P]database/./smmana/sm.h
// Function: SM_Manager::create_table(char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, int*, int*, int*, int, int)
RC SM_Manager::create_table(const char* tablename,string attrname[],int attrtype[],int len[],int isnull[],int attrnum,int prim_key)//create two files
{
	table_entry tb;
	strcpy(tb.tablename,tablename);
	tb.prikeyNum = prim_key;
	tb.attrNum = attrnum;
	int record_size = attrnum/8+1;
	for(int i = 0;i < attrnum;i++)
	{
		switch(attrtype[i])
		{
			case ATTRINT :
				record_size+=4;
				tb.attrName.push_back(attrname[i]);
				tb.attrType.push_back(ATTRINT);
				tb.attrLength.push_back(4);
				tb.isNull.push_back(isnull[i]);
				break;
			case ATTRFLOAT:
				record_size+=4;
				tb.attrName.push_back(attrname[i]);
				tb.attrType.push_back(ATTRFLOAT);
				tb.attrLength.push_back(4);
				tb.isNull.push_back(isnull[i]);
				break;
			case ATTRSTRING:
				record_size+=len[i];
				tb.attrName.push_back(attrname[i]);
				tb.attrType.push_back(ATTRSTRING);
				tb.attrLength.push_back(len[i]);
				tb.isNull.push_back(isnull[i]);
				break;
			default:
				printf("Blackman question mark?\n");
				break;
		}
	}
	tb.recordSize = record_size;
	databases[current_db_index].table.push_back(tb);
	string create_location(databases[current_db_index].dbname);
	create_location  = create_location+"/"+tb.tablename;
	record_manager->createFile(create_location.c_str(),record_size,tb.attrType,tb.attrLength,tb.isNull,tb.prikeyNum);
	create_location  = create_location + ".www";
	//freopen(create_location.c_str(),"w",stdout);
	ofstream file1(create_location.c_str());
	file1 << tb.tablename << endl << tb.attrNum << " " << tb.prikeyNum<<" " <<tb.recordSize<< endl;
	//printf("%s\n%d %d\n",tb.tablename,tb.attrNum,tb.prikeyNum);
	for(int i = 0;i < tb.attrNum;i++)
	{
		file1 << tb.attrName[i] <<" "<<tb.attrType[i] <<" "<<tb.attrLength[i]<<" "<<tb.isNull[i]<< endl;
		//printf("%s %d %d %d\n",tb.attrName[i].c_str(),tb.attrType[i],tb.attrLength[i],tb.isNull[i]);
	}
	file1.close();
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x378, %rsp            # imm = 0x378
movq %r9, -0x30(%rbp)
movq %r8, -0x60(%rbp)
movq %rcx, %rbx
movq %rdx, %r15
movq %rdi, -0x58(%rbp)
movl 0x10(%rbp), %r12d
xorps %xmm0, %xmm0
leaq -0x150(%rbp), %rdi
movups %xmm0, 0xc0(%rdi)
movups %xmm0, 0xb0(%rdi)
movups %xmm0, 0xa0(%rdi)
movups %xmm0, 0x90(%rdi)
movups %xmm0, 0x80(%rdi)
movups %xmm0, 0x70(%rdi)
callq 0x21a0
leal 0x7(%r12), %r14d
testl %r12d, %r12d
cmovnsl %r12d, %r14d
sarl $0x3, %r14d
incl %r14d
movl 0x18(%rbp), %eax
leaq -0xe0(%rbp), %rcx
movl %eax, -0x4(%rcx)
movl %r12d, -0x8(%rcx)
testl %r12d, %r12d
jle 0x4241
movl %r12d, %r13d
shlq $0x2, %r13
xorl %r12d, %r12d
movl (%rbx,%r12), %eax
cmpl $0x3, %eax
je 0x404d
cmpl $0x2, %eax
je 0x4011
cmpl $0x1, %eax
jne 0x4091
leaq -0xe0(%rbp), %rdi
movq %r15, %rsi
callq 0x59da
movl $0x1, -0x398(%rbp)
movq -0xc0(%rbp), %rsi
cmpq -0xb8(%rbp), %rsi
je 0x412c
movl $0x1, (%rsi)
addq $0x4, %rsi
movq %rsi, -0xc0(%rbp)
jmp 0x413f
leaq -0xe0(%rbp), %rdi
movq %r15, %rsi
callq 0x59da
movl $0x2, -0x398(%rbp)
movq -0xc0(%rbp), %rsi
cmpq -0xb8(%rbp), %rsi
je 0x40a2
movl $0x2, (%rsi)
addq $0x4, %rsi
movq %rsi, -0xc0(%rbp)
jmp 0x40b5
movq -0x60(%rbp), %rax
addl (%rax,%r12), %r14d
leaq -0xe0(%rbp), %rdi
movq %r15, %rsi
callq 0x59da
movl $0x3, -0x398(%rbp)
movq -0xc0(%rbp), %rsi
cmpq -0xb8(%rbp), %rsi
je 0x40e9
movl $0x3, (%rsi)
addq $0x4, %rsi
movq %rsi, -0xc0(%rbp)
jmp 0x40fc
leaq 0x5427(%rip), %rdi      # 0x94bf
callq 0x22c0
jmp 0x4220
leaq -0xc8(%rbp), %rdi
leaq -0x398(%rbp), %rdx
callq 0x72f6
movl $0x4, -0x398(%rbp)
movq -0xa8(%rbp), %rsi
cmpq -0xa0(%rbp), %rsi
je 0x4173
movl $0x4, (%rsi)
addq $0x4, %rsi
movq %rsi, -0xa8(%rbp)
jmp 0x4186
leaq -0xc8(%rbp), %rdi
leaq -0x398(%rbp), %rdx
callq 0x72f6
movq -0x60(%rbp), %rax
leaq (%rax,%r12), %rdx
movq -0xa8(%rbp), %rsi
cmpq -0xa0(%rbp), %rsi
je 0x41b0
movl (%rdx), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, -0xa8(%rbp)
jmp 0x41bc
leaq -0xc8(%rbp), %rdi
leaq -0x398(%rbp), %rdx
callq 0x72f6
movl $0x4, -0x398(%rbp)
movq -0xa8(%rbp), %rsi
cmpq -0xa0(%rbp), %rsi
je 0x41e2
movl $0x4, (%rsi)
addq $0x4, %rsi
movq %rsi, -0xa8(%rbp)
jmp 0x41f5
leaq -0xb0(%rbp), %rdi
leaq -0x398(%rbp), %rdx
callq 0x72f6
addl $0x4, %r14d
movq -0x30(%rbp), %rax
leaq (%rax,%r12), %rdx
movq -0x90(%rbp), %rsi
cmpq -0x88(%rbp), %rsi
jne 0x4211
leaq -0x98(%rbp), %rdi
callq 0x7a0c
jmp 0x4220
leaq -0xb0(%rbp), %rdi
callq 0x7a0c
movq -0x30(%rbp), %rax
leaq (%rax,%r12), %rdx
movq -0x90(%rbp), %rsi
cmpq -0x88(%rbp), %rsi
jne 0x4211
leaq -0x98(%rbp), %rdi
callq 0x7a0c
jmp 0x4220
leaq -0xb0(%rbp), %rdi
leaq -0x398(%rbp), %rdx
callq 0x72f6
addl $0x4, %r14d
movq -0x30(%rbp), %rax
leaq (%rax,%r12), %rdx
movq -0x90(%rbp), %rsi
cmpq -0x88(%rbp), %rsi
je 0x4233
movl (%rdx), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, -0x90(%rbp)
addq $0x4, %r12
addq $0x20, %r15
cmpq %r12, %r13
jne 0x3fb3
jmp 0x4241
leaq -0x98(%rbp), %rdi
callq 0x7a0c
jmp 0x4220
leaq -0x150(%rbp), %rsi
movl %r14d, 0x64(%rsi)
movq -0x58(%rbp), %rbx
movslq 0x18(%rbx), %rax
movq (%rbx), %rcx
imulq $0x118, %rax, %rax      # imm = 0x118
leaq (%rcx,%rax), %rdi
addq $0x100, %rdi            # imm = 0x100
callq 0x5afc
movslq 0x18(%rbx), %rax
movq (%rbx), %rcx
imulq $0x118, %rax, %rbx      # imm = 0x118
addq %rcx, %rbx
leaq -0x40(%rbp), %r12
movq %r12, -0x10(%r12)
testq %rcx, %rcx
je 0x429d
movq %rbx, %rdi
callq 0x20c0
movq %rax, %rdx
addq %rbx, %rdx
jmp 0x42a2
movl $0x1, %edx
leaq -0x50(%rbp), %rdi
movq %rbx, %rsi
callq 0x7034
leaq -0x70(%rbp), %r15
movq %r15, -0x10(%r15)
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
addq %rsi, %rdx
leaq -0x80(%rbp), %rdi
callq 0x6f9a
leaq 0x5010(%rip), %rsi      # 0x92e1
leaq -0x80(%rbp), %rdi
callq 0x2380
leaq -0x80(%rbp), %rdi
leaq -0x150(%rbp), %rsi
callq 0x2380
leaq -0x388(%rbp), %r13
movq %r13, -0x10(%r13)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x4317
movq %rdx, -0x398(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x388(%rbp)
jmp 0x431f
movups (%rcx), %xmm0
movups %xmm0, (%r13)
movq 0x8(%rax), %rdx
leaq -0x398(%rbp), %rbx
movq %rdx, 0x8(%rbx)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq -0x50(%rbp), %rdi
movq %rbx, %rsi
callq 0x2220
movq (%rbx), %rdi
cmpq %r13, %rdi
je 0x4360
movq -0x388(%rbp), %rsi
incq %rsi
callq 0x21e0
movq -0x80(%rbp), %rdi
cmpq %r15, %rdi
je 0x4375
movq -0x70(%rbp), %rsi
incq %rsi
callq 0x21e0
movq -0x58(%rbp), %rax
movq 0x20(%rax), %rbx
movq -0x50(%rbp), %r15
leaq -0xc8(%rbp), %rsi
leaq -0x198(%rbp), %rdi
callq 0x5b38
leaq -0xb0(%rbp), %rsi
leaq -0x180(%rbp), %rdi
callq 0x5b38
leaq -0x98(%rbp), %rsi
leaq -0x168(%rbp), %rdi
callq 0x5b38
movl -0xe4(%rbp), %eax
movl %eax, (%rsp)
leaq -0x198(%rbp), %rcx
leaq -0x180(%rbp), %r8
leaq -0x168(%rbp), %r9
movq %rbx, %rdi
movq %r15, %rsi
movl %r14d, %edx
callq 0x2f3e
movq -0x168(%rbp), %rdi
testq %rdi, %rdi
je 0x4401
movq -0x158(%rbp), %rsi
subq %rdi, %rsi
callq 0x21e0
movq -0x180(%rbp), %rdi
testq %rdi, %rdi
je 0x441c
movq -0x170(%rbp), %rsi
subq %rdi, %rsi
callq 0x21e0
movq -0x198(%rbp), %rdi
testq %rdi, %rdi
je 0x4437
movq -0x188(%rbp), %rsi
subq %rdi, %rsi
callq 0x21e0
leaq -0x398(%rbp), %rdi
movq %r13, (%rdi)
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
addq %rsi, %rdx
callq 0x6f9a
leaq 0x4e8b(%rip), %rsi      # 0x92e3
leaq -0x398(%rbp), %rdi
callq 0x2380
leaq -0x50(%rbp), %rdi
leaq -0x398(%rbp), %rbx
movq %rbx, %rsi
callq 0x2220
movq (%rbx), %rdi
cmpq %r13, %rdi
je 0x448e
movq -0x388(%rbp), %rsi
incq %rsi
callq 0x21e0
movq -0x50(%rbp), %rsi
leaq -0x398(%rbp), %rdi
movl $0x10, %edx
callq 0x21f0
leaq -0x150(%rbp), %r14
movq %r14, %rdi
callq 0x20c0
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x2200
movq -0x398(%rbp), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x21b0
movsbl %al, %esi
leaq -0x398(%rbp), %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2120
movl -0xe8(%rbp), %esi
movq %rax, %rdi
callq 0x2310
movq %rax, %rbx
leaq 0x4bb1(%rip), %rsi      # 0x90b8
movl $0x1, %edx
movq %rax, %rdi
callq 0x2200
movl -0xe4(%rbp), %esi
movq %rbx, %rdi
callq 0x2310
movq %rax, %rbx
leaq 0x4b8c(%rip), %rsi      # 0x90b8
movl $0x1, %edx
movq %rax, %rdi
callq 0x2200
movl -0xec(%rbp), %esi
movq %rbx, %rdi
callq 0x2310
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21b0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2120
cmpl $0x0, -0xe8(%rbp)
jle 0x4660
movl $0x8, %r13d
xorl %r12d, %r12d
leaq -0x398(%rbp), %rbx
leaq 0x4b23(%rip), %r14      # 0x90b8
movq -0xe0(%rbp), %rax
movq -0x8(%rax,%r13), %rsi
movq (%rax,%r13), %rdx
movq %rbx, %rdi
callq 0x2200
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0x2200
movq -0xc8(%rbp), %rax
movl (%rax,%r12,4), %esi
movq %r15, %rdi
callq 0x2310
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0x2200
movq -0xb0(%rbp), %rax
movl (%rax,%r12,4), %esi
movq %r15, %rdi
callq 0x2310
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0x2200
movq -0x98(%rbp), %rax
movl (%rax,%r12,4), %esi
movq %r15, %rdi
callq 0x2310
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x21b0
movsbl %al, %esi
movq %r15, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2120
incq %r12
movslq -0xe8(%rbp), %rax
addq $0x20, %r13
cmpq %rax, %r12
jl 0x4595
leaq -0x398(%rbp), %rdi
callq 0x2250
movq 0x895d(%rip), %rax      # 0xcfd0
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq -0x390(%rbp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, -0x398(%rbp,%rcx)
callq 0x2170
leaq -0x2a0(%rbp), %rdi
callq 0x2080
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x46bb
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x21e0
movq -0x98(%rbp), %rdi
testq %rdi, %rdi
je 0x46d6
movq -0x88(%rbp), %rsi
subq %rdi, %rsi
callq 0x21e0
movq -0xb0(%rbp), %rdi
testq %rdi, %rdi
je 0x46f1
movq -0xa0(%rbp), %rsi
subq %rdi, %rsi
callq 0x21e0
movq -0xc8(%rbp), %rdi
testq %rdi, %rdi
je 0x470c
movq -0xb8(%rbp), %rsi
subq %rdi, %rsi
callq 0x21e0
leaq -0xe0(%rbp), %rdi
callq 0x5a26
xorl %eax, %eax
addq $0x378, %rsp            # imm = 0x378
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x47c8
movq %rax, %rbx
movq -0x398(%rbp), %rdi
cmpq %r13, %rdi
je 0x47f5
movq -0x388(%rbp), %rsi
jmp 0x47be
jmp 0x47c8
movq %rax, %rbx
movq -0x168(%rbp), %rdi
testq %rdi, %rdi
je 0x4772
movq -0x158(%rbp), %rsi
subq %rdi, %rsi
callq 0x21e0
jmp 0x4772
movq %rax, %rbx
movq -0x180(%rbp), %rdi
testq %rdi, %rdi
je 0x4792
movq -0x170(%rbp), %rsi
subq %rdi, %rsi
callq 0x21e0
jmp 0x4792
movq %rax, %rbx
movq -0x198(%rbp), %rdi
testq %rdi, %rdi
je 0x47f5
movq -0x188(%rbp), %rsi
subq %rdi, %rsi
jmp 0x47c1
jmp 0x47c8
jmp 0x47ae
movq %rax, %rbx
movq -0x80(%rbp), %rdi
cmpq %r15, %rdi
je 0x47f5
movq -0x70(%rbp), %rsi
incq %rsi
callq 0x21e0
jmp 0x47f5
movq %rax, %rbx
jmp 0x47f5
jmp 0x47dd
jmp 0x47dd
jmp 0x47dd
jmp 0x47dd
jmp 0x47dd
jmp 0x47dd
jmp 0x47dd
jmp 0x47e2
movq %rax, %rbx
jmp 0x480a
movq %rax, %rbx
leaq -0x398(%rbp), %rdi
callq 0x2280
leaq -0x40(%rbp), %r12
movq -0x50(%rbp), %rdi
cmpq %r12, %rdi
je 0x480a
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x21e0
leaq -0x150(%rbp), %rdi
callq 0x5bb8
movq %rbx, %rdi
callq 0x2320