// File: yasz24[P]eau2/tests/./../src/dataframe/schema.h
// Function: Schema::Schema(char const*)
Schema(const char* types) {
        assert(types != nullptr);
        bool schemaValid = true;
        size_t types_len =  strlen(types);
        //loop through character by character to validate schema.
        for (size_t i = 0; i < types_len; i++)
        {
            char c = types[i];
            //todo: find a better way to do this.
            if (!this->valid_col_char_(c)) {
                // the schema is invalid, create an empty schema.
                schemaValid = false;
                break;
            }
        }

        if (schemaValid) {
            if (this->capacity_ - 1 < types_len) {
                this->capacity_ = 2 * types_len;
            }
            //allocate a buffer.
            this->val_ = new char[this->capacity_ + 1];
            for (size_t i=0; i < types_len; i++) {
			    this->val_[i] = types[i];
		    }
            //set the empty_index_ to the length of types.
            this->empty_index_ = types_len;
        } else {
            this->val_ = new char[this->capacity_ + 1];
        }
        //null terminate the string.
        this->val_[this->capacity_] = '\0';

        //initialize num_rows
        this->num_rows_ = 0;
        //initialize the row and col maps.
        this->col_name_idx = new Map();
        this->row_name_idx = new Map();
        this->col_idx_name = new Map();
        this->row_idx_name = new Map();
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x50(%rbp)
callq 0x15470
movq -0x50(%rbp), %rax
leaq 0x2a78d(%rip), %rcx     # 0x3e958
addq $0x10, %rcx
movq %rcx, (%rax)
movq $0x64, 0x10(%rax)
movq $0x0, 0x20(%rax)
cmpq $0x0, -0x10(%rbp)
je 0x141eb
jmp 0x1420a
leaq 0x1b9a7(%rip), %rdi     # 0x2fb99
leaq 0x1b9b1(%rip), %rsi     # 0x2fbaa
movl $0x56, %edx
leaq 0x1b9c1(%rip), %rcx     # 0x2fbc6
callq 0x7170
movb $0x1, -0x11(%rbp)
movq -0x10(%rbp), %rdi
callq 0x7110
movq %rax, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpq -0x20(%rbp), %rax
jae 0x1427d
movq -0x50(%rbp), %rdi
movq -0x10(%rbp), %rax
movq -0x28(%rbp), %rcx
movb (%rax,%rcx), %al
movb %al, -0x29(%rbp)
movsbl -0x29(%rbp), %esi
callq 0x26090
movb %al, -0x51(%rbp)
jmp 0x1424d
movb -0x51(%rbp), %al
testb $0x1, %al
jne 0x1426d
jmp 0x14256
movb $0x0, -0x11(%rbp)
jmp 0x1427d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x14457
jmp 0x1426f
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x14223
testb $0x1, -0x11(%rbp)
je 0x14312
movq -0x50(%rbp), %rax
movq 0x10(%rax), %rax
subq $0x1, %rax
cmpq -0x20(%rbp), %rax
jae 0x142a8
movq -0x50(%rbp), %rax
movq -0x20(%rbp), %rcx
shlq %rcx
movq %rcx, 0x10(%rax)
movq -0x50(%rbp), %rax
movq 0x10(%rax), %rdi
incq %rdi
callq 0x7030
movq %rax, -0x60(%rbp)
jmp 0x142be
movq -0x50(%rbp), %rax
movq -0x60(%rbp), %rcx
movq %rcx, 0x18(%rax)
movq $0x0, -0x48(%rbp)
movq -0x48(%rbp), %rax
cmpq -0x20(%rbp), %rax
jae 0x14304
movq -0x50(%rbp), %rax
movq -0x10(%rbp), %rcx
movq -0x48(%rbp), %rdx
movb (%rcx,%rdx), %dl
movq 0x18(%rax), %rax
movq -0x48(%rbp), %rcx
movb %dl, (%rax,%rcx)
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
jmp 0x142d2
movq -0x50(%rbp), %rax
movq -0x20(%rbp), %rcx
movq %rcx, 0x20(%rax)
jmp 0x14334
movq -0x50(%rbp), %rax
movq 0x10(%rax), %rdi
incq %rdi
callq 0x7030
movq %rax, -0x68(%rbp)
jmp 0x14328
movq -0x50(%rbp), %rax
movq -0x68(%rbp), %rcx
movq %rcx, 0x18(%rax)
movq -0x50(%rbp), %rax
movq 0x10(%rax), %rdx
movq 0x18(%rax), %rcx
movb $0x0, (%rcx,%rdx)
movq $0x0, 0x28(%rax)
movl $0x30, %edi
callq 0x7250
movq %rax, -0x70(%rbp)
jmp 0x1435c
movq -0x70(%rbp), %rdi
callq 0x260f0
jmp 0x14367
movq -0x50(%rbp), %rax
movq -0x70(%rbp), %rcx
movq %rcx, 0x30(%rax)
movl $0x30, %edi
callq 0x7250
movq %rax, -0x78(%rbp)
jmp 0x14383
movq -0x78(%rbp), %rdi
callq 0x260f0
jmp 0x1438e
movq -0x50(%rbp), %rax
movq -0x78(%rbp), %rcx
movq %rcx, 0x38(%rax)
movl $0x30, %edi
callq 0x7250
movq %rax, -0x80(%rbp)
jmp 0x143aa
movq -0x80(%rbp), %rdi
callq 0x260f0
jmp 0x143b5
movq -0x50(%rbp), %rax
movq -0x80(%rbp), %rcx
movq %rcx, 0x40(%rax)
movl $0x30, %edi
callq 0x7250
movq %rax, -0x88(%rbp)
jmp 0x143d4
movq -0x88(%rbp), %rdi
callq 0x260f0
jmp 0x143e2
movq -0x50(%rbp), %rax
movq -0x88(%rbp), %rcx
movq %rcx, 0x48(%rax)
addq $0x90, %rsp
popq %rbp
retq
movq -0x70(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
callq 0x7220
jmp 0x14457
movq -0x78(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
callq 0x7220
jmp 0x14457
movq -0x80(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
callq 0x7220
jmp 0x14457
movq -0x88(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
callq 0x7220
movq -0x50(%rbp), %rdi
callq 0x15740
movq -0x38(%rbp), %rdi
callq 0x7370
nopl (%rax)