#include <iostream>
#include <fstream>      
#include <vector>
#include <string>
#include <stdio.h> // JDB -- should not be needed
#include <chrono>


using namespace std;

#define num_data_type 10
//#define INPUT_FILE "./input_file.csv"
#define INPUT_FILE "./input/nla.csv"

//#define INPUT_FILE "./input/go_track_trackspoints.csv"


typedef std::chrono::high_resolution_clock Clock;

int     D[4][256];
uint8_t E[4][256];

void add_transition (int state, uint8_t input, int next_state) {
	D[state][input] = next_state;
}

void add_default_transition(int state, int next_state) {
	for (int i = 0; i < 256; i++) {
		D[(int) state][i] = next_state;
	}
}

void add_emission(int state, uint8_t input, uint8_t value) {
	E[state][input] = value;
}

void add_default_emission(int state, uint8_t value) {
	for (int i = 0; i < 256; i++) {
		E[state][i] = value;
	}
}

void Dtable_generate(void) {
	for (int i = 0; i < 2; i++) {
		add_default_transition(i ,i);
	}
	add_default_transition(2 , 1);
	add_default_transition(3, 0);

	add_transition(0, '[', 1);
	add_transition(0, '\\', 3);
	add_transition(1, '\\', 2);
	add_transition(1, ']', 0);
}

void Etable_generate(void) {
	for(int i = 0; i < 3; i++) {
		add_default_emission(i, 0);
	}
	add_emission(0, ',', 1);
}

void parsedata (string s, uint8_t* comma_indices) {

	//default states
	int state = 0;
	int emission = 0;

	for (int i = 0; i < s.length(); i++) {
		emission = E[state][s[i]];
		state = D[state][s[i]];

		comma_indices[i] = emission;
	}
}

const int max_length(){

	std::ifstream is(INPUT_FILE);   // open file
	string line;
	int length = 0; 

	while (getline(is, line)){
		if(length < line.length())
			length = line.length();
	}
	is.close();
	
	return length; 
}

void seq_scan(uint8_t* comma_indices, int num_char) {
	for(int i = 1; i < num_char; i++) {
		comma_indices[i] = comma_indices[i - 1] + comma_indices[i];
	}
}

int main() {

	auto t1 = Clock::now();
	std::vector<std::vector<int>> output_vec;
	std::ifstream is(INPUT_FILE);
	string line;

	int state = 0;

	while(getline(is, line)) {
		std::vector<int> temp_vec;

		int len = line.length();
		for(int i = 0; i < len; i++){
			if(state == 0 && line[i] == ',') {
				temp_vec.push_back(i);
			}
			char c = line[i];
			if(state == 0) {
				if(c == '{')
					state = 1;
				else 
					state = 0;
			}
			else if(state == 1){
				if( c == '}')
					state = 0;
				else if (c == '\\')
					state = 2;
				else
					state = 1;
			}
			else {
				state = 2;
			}
		}

		output_vec.push_back(temp_vec);
	}

    auto t2 = Clock::now();

     cout << std::chrono::duration_cast<std::chrono::microseconds>(t2 - t1).count() << " microseconds" << endl;
	/*

	int len = output_vec.size();
	for(int i = 0; i < len; i++){
		int temp_len = output_vec[i].size();
		for(int j = 0; j < temp_len; j++) {
			printf("%d ", (output_vec[i])[j]);
		}
		printf("\n");
	}

	*/


	// std::ifstream is(INPUT_FILE);   // open file
	// string line;

	// //generate the tables
	// Dtable_generate();
	// Etable_generate();

	// // initialize bit vector
	// const int array_len = max_length();	
	// uint8_t* comma_indices = new uint8_t[array_len];

	// for (int i = 0; i < array_len; i++) {
	// 	comma_indices[i] = 0;
	// }

 //     auto t1 = Clock::now();

	// while (getline(is, line)) { 


	// 	parsedata(line, comma_indices); 
	// 	seq_scan(comma_indices, array_len);
		
	// 	int prev = 0; 
	// 	for(int i = 0; i < array_len; i++){
	// 		if(prev != comma_indices[i]) {
	// 			//std::cout << i << " ";
	// 		}
	// 		prev = comma_indices[i];
	// 		comma_indices[i] = 0;
	// 	}

	// 	//cout << endl;

	// }
	// is.close();

 //    auto t2 = Clock::now();

 //     cout << std::chrono::duration_cast<std::chrono::microseconds>(t2 - t1).count() << " microseconds" << endl;

	// delete [] comma_indices;
    return 0;
}


	.file	"tmpxft_00289895_00000000-6_seq_code.cudafe1.cpp"
	.text
#APP
	.globl _ZSt21ios_base_library_initv

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB4263:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE4263:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.globl	_Z14add_transitionihi
	.type	_Z14add_transitionihi, @function
_Z14add_transitionihi:
.LFB4228:
	.cfi_startproc
	endbr64
	movslq	%edi, %rdi
	movzbl	%sil, %esi
	leaq	D(%rip), %rax
	salq	$8, %rdi
	addq	%rsi, %rdi
	movl	%edx, (%rax,%rdi,4)
	ret
	.cfi_endproc
.LFE4228:
	.size	_Z14add_transitionihi, .-_Z14add_transitionihi
	.globl	_Z22add_default_transitionii
	.type	_Z22add_default_transitionii, @function
_Z22add_default_transitionii:
.LFB4229:
	.cfi_startproc
	endbr64
	movslq	%edi, %rdi
	leaq	D(%rip), %rax
	salq	$10, %rdi
	addq	%rax, %rdi
	xorl	%eax, %eax
.L4:
	movl	%esi, (%rdi,%rax,4)
	incq	%rax
	cmpq	$256, %rax
	jne	.L4
	ret
	.cfi_endproc
.LFE4229:
	.size	_Z22add_default_transitionii, .-_Z22add_default_transitionii
	.globl	_Z12add_emissionihh
	.type	_Z12add_emissionihh, @function
_Z12add_emissionihh:
.LFB4230:
	.cfi_startproc
	endbr64
	movslq	%edi, %rdi
	leaq	E(%rip), %rax
	movzbl	%sil, %esi
	salq	$8, %rdi
	addq	%rdi, %rax
	movb	%dl, (%rax,%rsi)
	ret
	.cfi_endproc
.LFE4230:
	.size	_Z12add_emissionihh, .-_Z12add_emissionihh
	.globl	_Z20add_default_emissionih
	.type	_Z20add_default_emissionih, @function
_Z20add_default_emissionih:
.LFB4231:
	.cfi_startproc
	endbr64
	movslq	%edi, %rdi
	leaq	E(%rip), %rax
	movl	$256, %ecx
	salq	$8, %rdi
	leaq	(%rdi,%rax), %rdx
	movl	%esi, %eax
	movq	%rdx, %rdi
	rep stosb
	ret
	.cfi_endproc
.LFE4231:
	.size	_Z20add_default_emissionih, .-_Z20add_default_emissionih
	.globl	_Z15Dtable_generatev
	.type	_Z15Dtable_generatev, @function
_Z15Dtable_generatev:
.LFB4232:
	.cfi_startproc
	endbr64
	xorl	%esi, %esi
	xorl	%edi, %edi
	call	_Z22add_default_transitionii
	movl	$1, %esi
	movl	$1, %edi
	call	_Z22add_default_transitionii
	movl	$2, %edi
	call	_Z22add_default_transitionii
	xorl	%esi, %esi
	movl	$3, %edi
	call	_Z22add_default_transitionii
	movabsq	$12884901889, %rax
	movq	$2, 1392+D(%rip)
	movq	%rax, 364+D(%rip)
	ret
	.cfi_endproc
.LFE4232:
	.size	_Z15Dtable_generatev, .-_Z15Dtable_generatev
	.globl	_Z15Etable_generatev
	.type	_Z15Etable_generatev, @function
_Z15Etable_generatev:
.LFB4233:
	.cfi_startproc
	endbr64
	xorl	%esi, %esi
	xorl	%edi, %edi
	call	_Z20add_default_emissionih
	movl	$1, %edi
	call	_Z20add_default_emissionih
	movl	$2, %edi
	call	_Z20add_default_emissionih
	movb	$1, 44+E(%rip)
	ret
	.cfi_endproc
.LFE4233:
	.size	_Z15Etable_generatev, .-_Z15Etable_generatev
	.globl	_Z9parsedataNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPh
	.type	_Z9parsedataNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPh, @function
_Z9parsedataNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPh:
.LFB4234:
	.cfi_startproc
	endbr64
	xorl	%edx, %edx
	xorl	%eax, %eax
	leaq	E(%rip), %r8
	leaq	D(%rip), %r9
.L12:
	cmpq	8(%rdi), %rdx
	jnb	.L14
	movq	(%rdi), %rcx
	salq	$8, %rax
	leaq	(%r8,%rax), %r10
	movsbq	(%rcx,%rdx), %rcx
	movb	(%r10,%rcx), %r10b
	addq	%rcx, %rax
	movslq	(%r9,%rax,4), %rax
	movb	%r10b, (%rsi,%rdx)
	incq	%rdx
	jmp	.L12
.L14:
	ret
	.cfi_endproc
.LFE4234:
	.size	_Z9parsedataNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPh, .-_Z9parsedataNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPh
	.globl	_Z8seq_scanPhi
	.type	_Z8seq_scanPhi, @function
_Z8seq_scanPhi:
.LFB4237:
	.cfi_startproc
	endbr64
	xorl	%eax, %eax
.L16:
	incq	%rax
	cmpl	%eax, %esi
	jle	.L18
	movb	-1(%rdi,%rax), %dl
	addb	%dl, (%rdi,%rax)
	jmp	.L16
.L18:
	ret
	.cfi_endproc
.LFE4237:
	.size	_Z8seq_scanPhi, .-_Z8seq_scanPhi
	.section	.text.startup,"ax",@progbits
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB4286:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	leaq	_ZL15__fatDeviceText(%rip), %rdi
	call	__cudaRegisterFatBinary@PLT
	movq	%rax, %rdi
	movq	%rax, _ZL20__cudaFatCubinHandle(%rip)
	call	__cudaRegisterFatBinaryEnd@PLT
	leaq	_ZL26__cudaUnregisterBinaryUtilv(%rip), %rdi
	popq	%rdx
	.cfi_def_cfa_offset 8
	jmp	atexit@PLT
	.cfi_endproc
.LFE4286:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"./input/nla.csv"
	.text
	.globl	_Z10max_lengthv
	.type	_Z10max_lengthv, @function
_Z10max_lengthv:
.LFB4235:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA4235
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	movl	$8, %edx
	leaq	.LC0(%rip), %rsi
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	xorl	%ebp, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	subq	$560, %rsp
	.cfi_def_cfa_offset 592
	movq	%fs:40, %rax
	movq	%rax, 552(%rsp)
	xorl	%eax, %eax
	leaq	32(%rsp), %rbx
	movq	%rsp, %r12
	movq	%rbx, %rdi
.LEHB0:
	call	_ZNSt14basic_ifstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode@PLT
.LEHE0:
	leaq	16(%rsp), %rax
	movb	$0, 16(%rsp)
	movq	%rax, (%rsp)
	xorl	%eax, %eax
	movq	%rax, 8(%rsp)
.L22:
	movq	%r12, %rsi
	movq	%rbx, %rdi
.LEHB1:
	call	_ZSt7getlineIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE@PLT
	movq	(%rax), %rdx
	movq	-24(%rdx), %rdx
	testb	$5, 32(%rax,%rdx)
	jne	.L31
	movq	8(%rsp), %rax
	movslq	%ebp, %rdx
	cmpq	%rax, %rdx
	cmovb	%eax, %ebp
	jmp	.L22
.L31:
	movq	%rbx, %rdi
	call	_ZNSt14basic_ifstreamIcSt11char_traitsIcEE5closeEv@PLT
.LEHE1:
	movq	%r12, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	%rbx, %rdi
	call	_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev@PLT
	movq	552(%rsp), %rax
	subq	%fs:40, %rax
	je	.L27
	jmp	.L29
.L28:
	endbr64
	movq	%rax, %rbp
.L25:
	movq	%r12, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	%rbx, %rdi
	call	_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev@PLT
	movq	552(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L29
	movq	%rbp, %rdi
.LEHB2:
	call	_Unwind_Resume@PLT
.LEHE2:
.L29:
	call	__stack_chk_fail@PLT
.L27:
	addq	$560, %rsp
	.cfi_def_cfa_offset 32
	movl	%ebp, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4235:
	.globl	__gxx_personality_v0
	.section	.gcc_except_table,"a",@progbits
.LLSDA4235:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE4235-.LLSDACSB4235
.LLSDACSB4235:
	.uleb128 .LEHB0-.LFB4235
	.uleb128 .LEHE0-.LEHB0
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB1-.LFB4235
	.uleb128 .LEHE1-.LEHB1
	.uleb128 .L28-.LFB4235
	.uleb128 0
	.uleb128 .LEHB2-.LFB4235
	.uleb128 .LEHE2-.LEHB2
	.uleb128 0
	.uleb128 0
.LLSDACSE4235:
	.text
	.size	_Z10max_lengthv, .-_Z10max_lengthv
	.section	.text._ZNSt6vectorIiSaIiEED2Ev,"axG",@progbits,_ZNSt6vectorIiSaIiEED5Ev,comdat
	.align 2
	.weak	_ZNSt6vectorIiSaIiEED2Ev
	.type	_ZNSt6vectorIiSaIiEED2Ev, @function
_ZNSt6vectorIiSaIiEED2Ev:
.LFB4665:
	.cfi_startproc
	endbr64
	movq	(%rdi), %rax
	testq	%rax, %rax
	je	.L32
	movq	16(%rdi), %rsi
	movq	%rax, %rdi
	subq	%rax, %rsi
	jmp	_ZdlPvm@PLT
.L32:
	ret
	.cfi_endproc
.LFE4665:
	.size	_ZNSt6vectorIiSaIiEED2Ev, .-_ZNSt6vectorIiSaIiEED2Ev
	.weak	_ZNSt6vectorIiSaIiEED1Ev
	.set	_ZNSt6vectorIiSaIiEED1Ev,_ZNSt6vectorIiSaIiEED2Ev
	.section	.text._ZNSt6vectorIS_IiSaIiEESaIS1_EED2Ev,"axG",@progbits,_ZNSt6vectorIS_IiSaIiEESaIS1_EED5Ev,comdat
	.align 2
	.weak	_ZNSt6vectorIS_IiSaIiEESaIS1_EED2Ev
	.type	_ZNSt6vectorIS_IiSaIiEESaIS1_EED2Ev, @function
_ZNSt6vectorIS_IiSaIiEESaIS1_EED2Ev:
.LFB4653:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	movq	8(%rdi), %r12
	movq	%rdi, %rbx
	movq	(%rdi), %rbp
.L35:
	cmpq	%rbp, %r12
	je	.L39
	movq	%rbp, %rdi
	addq	$24, %rbp
	call	_ZNSt6vectorIiSaIiEED1Ev
	jmp	.L35
.L39:
	movq	(%rbx), %rdi
	testq	%rdi, %rdi
	je	.L34
	movq	16(%rbx), %rsi
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	subq	%rdi, %rsi
	jmp	_ZdlPvm@PLT
.L34:
	.cfi_restore_state
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4653:
	.size	_ZNSt6vectorIS_IiSaIiEESaIS1_EED2Ev, .-_ZNSt6vectorIS_IiSaIiEESaIS1_EED2Ev
	.weak	_ZNSt6vectorIS_IiSaIiEESaIS1_EED1Ev
	.set	_ZNSt6vectorIS_IiSaIiEESaIS1_EED1Ev,_ZNSt6vectorIS_IiSaIiEESaIS1_EED2Ev
	.section	.rodata._ZNSt6vectorIiSaIiEE17_M_realloc_insertIJRKiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_.str1.1,"aMS",@progbits,1
.LC1:
	.string	"vector::_M_realloc_insert"
	.section	.text._ZNSt6vectorIiSaIiEE17_M_realloc_insertIJRKiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_,"axG",@progbits,_ZNSt6vectorIiSaIiEE17_M_realloc_insertIJRKiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_,comdat
	.align 2
	.weak	_ZNSt6vectorIiSaIiEE17_M_realloc_insertIJRKiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_
	.type	_ZNSt6vectorIiSaIiEE17_M_realloc_insertIJRKiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_, @function
_ZNSt6vectorIiSaIiEE17_M_realloc_insertIJRKiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_:
.LFB4878:
	.cfi_startproc
	endbr64
	movabsq	$2305843009213693951, %rcx
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movq	8(%rdi), %rax
	movq	(%rdi), %r14
	movq	%rax, %rbx
	movq	%rax, (%rsp)
	subq	%r14, %rbx
	sarq	$2, %rbx
	cmpq	%rcx, %rbx
	jne	.L41
	leaq	.LC1(%rip), %rdi
	call	_ZSt20__throw_length_errorPKc@PLT
.L41:
	cmpq	%r14, (%rsp)
	movl	$1, %eax
	movq	%rsi, %r15
	movq	%rdi, %r13
	cmovne	%rbx, %rax
	movq	%rsi, %rbp
	addq	%rax, %rbx
	setc	%al
	subq	%r14, %r15
	movzbl	%al, %eax
	testq	%rax, %rax
	jne	.L51
	xorl	%r12d, %r12d
	testq	%rbx, %rbx
	je	.L46
	movabsq	$2305843009213693951, %rax
	cmpq	%rax, %rbx
	cmova	%rax, %rbx
	jmp	.L45
.L51:
	movq	%rcx, %rbx
.L45:
	leaq	0(,%rbx,4), %rdi
	movq	%rdx, 8(%rsp)
	call	_Znwm@PLT
	movq	8(%rsp), %rdx
	movq	%rax, %r12
.L46:
	movl	(%rdx), %eax
	movl	%eax, (%r12,%r15)
	testq	%r15, %r15
	jle	.L47
	movq	%r15, %rdx
	movq	%r14, %rsi
	movq	%r12, %rdi
	call	memmove@PLT
.L47:
	movq	(%rsp), %rax
	leaq	4(%r12,%r15), %rdx
	subq	%rbp, %rax
	testq	%rax, %rax
	jle	.L48
	movq	%rdx, %rdi
	movq	%rbp, %rsi
	movq	%rax, %rcx
	rep movsb
.L48:
	leaq	(%rdx,%rax), %rbp
	testq	%r14, %r14
	je	.L49
	movq	16(%r13), %rsi
	movq	%r14, %rdi
	subq	%r14, %rsi
	call	_ZdlPvm@PLT
.L49:
	leaq	(%r12,%rbx,4), %rax
	movq	%r12, 0(%r13)
	movq	%rbp, 8(%r13)
	movq	%rax, 16(%r13)
	addq	$24, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4878:
	.size	_ZNSt6vectorIiSaIiEE17_M_realloc_insertIJRKiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_, .-_ZNSt6vectorIiSaIiEE17_M_realloc_insertIJRKiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_
	.section	.text._ZNSt6vectorIiSaIiEEC2ERKS1_,"axG",@progbits,_ZNSt6vectorIiSaIiEEC5ERKS1_,comdat
	.align 2
	.weak	_ZNSt6vectorIiSaIiEEC2ERKS1_
	.type	_ZNSt6vectorIiSaIiEEC2ERKS1_, @function
_ZNSt6vectorIiSaIiEEC2ERKS1_:
.LFB5096:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	movq	%rsi, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	movq	8(%rsi), %rbp
	movq	%rdi, %rbx
	subq	(%rsi), %rbp
	movq	$0, (%rdi)
	movq	$0, 8(%rdi)
	movq	$0, 16(%rdi)
	je	.L63
	movabsq	$9223372036854775804, %rax
	cmpq	%rbp, %rax
	jnb	.L60
	call	_ZSt28__throw_bad_array_new_lengthv@PLT
.L60:
	movq	%rbp, %rdi
	call	_Znwm@PLT
	movq	%rax, %rcx
	jmp	.L59
.L63:
	xorl	%ecx, %ecx
.L59:
	addq	%rcx, %rbp
	movq	%rcx, (%rbx)
	movq	%rcx, 8(%rbx)
	movq	%rbp, 16(%rbx)
	movq	(%r12), %rsi
	movq	8(%r12), %rbp
	subq	%rsi, %rbp
	cmpq	$4, %rbp
	jle	.L61
	movq	%rcx, %rdi
	movq	%rbp, %rdx
	call	memmove@PLT
	movq	%rax, %rcx
	jmp	.L62
.L61:
	jne	.L62
	movl	(%rsi), %eax
	movl	%eax, (%rcx)
.L62:
	addq	%rbp, %rcx
	movq	%rcx, 8(%rbx)
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE5096:
	.size	_ZNSt6vectorIiSaIiEEC2ERKS1_, .-_ZNSt6vectorIiSaIiEEC2ERKS1_
	.weak	_ZNSt6vectorIiSaIiEEC1ERKS1_
	.set	_ZNSt6vectorIiSaIiEEC1ERKS1_,_ZNSt6vectorIiSaIiEEC2ERKS1_
	.section	.text._ZNSt6vectorIS_IiSaIiEESaIS1_EE17_M_realloc_insertIJRKS1_EEEvN9__gnu_cxx17__normal_iteratorIPS1_S3_EEDpOT_,"axG",@progbits,_ZNSt6vectorIS_IiSaIiEESaIS1_EE17_M_realloc_insertIJRKS1_EEEvN9__gnu_cxx17__normal_iteratorIPS1_S3_EEDpOT_,comdat
	.align 2
	.weak	_ZNSt6vectorIS_IiSaIiEESaIS1_EE17_M_realloc_insertIJRKS1_EEEvN9__gnu_cxx17__normal_iteratorIPS1_S3_EEDpOT_
	.type	_ZNSt6vectorIS_IiSaIiEESaIS1_EE17_M_realloc_insertIJRKS1_EEEvN9__gnu_cxx17__normal_iteratorIPS1_S3_EEDpOT_, @function
_ZNSt6vectorIS_IiSaIiEESaIS1_EE17_M_realloc_insertIJRKS1_EEEvN9__gnu_cxx17__normal_iteratorIPS1_S3_EEDpOT_:
.LFB4884:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA4884
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movq	%rdx, %r14
	movabsq	$384307168202282325, %rdx
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movq	8(%rdi), %rax
	movq	(%rdi), %r13
	movq	%rsi, 8(%rsp)
	movq	%rax, %rbx
	movq	%rax, (%rsp)
	movabsq	$-6148914691236517205, %rax
	subq	%r13, %rbx
	sarq	$3, %rbx
	imulq	%rax, %rbx
	cmpq	%rdx, %rbx
	jne	.L66
	leaq	.LC1(%rip), %rdi
.LEHB3:
	call	_ZSt20__throw_length_errorPKc@PLT
.L66:
	cmpq	%r13, (%rsp)
	movl	$1, %eax
	movq	8(%rsp), %r15
	movq	%rdi, %r12
	cmovne	%rbx, %rax
	addq	%rax, %rbx
	setc	%al
	subq	%r13, %r15
	movzbl	%al, %eax
	testq	%rax, %rax
	jne	.L82
	xorl	%ebp, %ebp
	testq	%rbx, %rbx
	je	.L71
	movabsq	$384307168202282325, %rax
	cmpq	%rax, %rbx
	cmova	%rax, %rbx
	jmp	.L70
.L82:
	movq	%rdx, %rbx
.L70:
	imulq	$24, %rbx, %rdi
	call	_Znwm@PLT
.LEHE3:
	movq	%rax, %rbp
.L71:
	leaq	0(%rbp,%r15), %rax
	movq	%r14, %rsi
	movq	%rax, %rdi
	movq	%rax, %r15
.LEHB4:
	call	_ZNSt6vectorIiSaIiEEC1ERKS1_
.LEHE4:
	movq	%rbp, %r14
	movq	%r13, %r15
.L72:
	addq	$24, %r14
	cmpq	%r15, 8(%rsp)
	je	.L74
	movq	(%r15), %rcx
	xorl	%edx, %edx
	movq	%r15, %rdi
	addq	$24, %r15
	movq	%rdx, -24(%r15)
	movq	%rcx, -24(%r14)
	movq	-16(%r15), %rcx
	movq	%rdx, -16(%r15)
	movq	%rcx, -16(%r14)
	movq	-8(%r15), %rcx
	movq	%rdx, -8(%r15)
	movq	%rcx, -8(%r14)
	call	_ZNSt6vectorIiSaIiEED1Ev
	jmp	.L72
.L74:
	cmpq	%r15, (%rsp)
	je	.L94
	movq	(%r15), %rcx
	xorl	%eax, %eax
	movq	%r15, %rdi
	addq	$24, %r14
	movq	%rax, (%r15)
	addq	$24, %r15
	movq	%rcx, -24(%r14)
	movq	-16(%r15), %rcx
	movq	%rax, -16(%r15)
	movq	%rcx, -16(%r14)
	movq	-8(%r15), %rcx
	movq	%rax, -8(%r15)
	movq	%rcx, -8(%r14)
	call	_ZNSt6vectorIiSaIiEED1Ev
	jmp	.L74
.L94:
	testq	%r13, %r13
	je	.L76
	movq	16(%r12), %rsi
	movq	%r13, %rdi
	subq	%r13, %rsi
	call	_ZdlPvm@PLT
.L76:
	imulq	$24, %rbx, %rbx
	movq	%rbp, (%r12)
	movq	%r14, 8(%r12)
	addq	%rbp, %rbx
	movq	%rbx, 16(%r12)
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
.L85:
	.cfi_restore_state
	endbr64
	movq	%rax, %rdi
.L77:
	call	__cxa_begin_catch@PLT
	testq	%rbp, %rbp
	jne	.L78
	movq	%r15, %rdi
	call	_ZNSt6vectorIiSaIiEED1Ev
.L80:
.LEHB5:
	call	__cxa_rethrow@PLT
.LEHE5:
.L86:
	endbr64
	movq	%rax, %rbx
.L79:
	call	__cxa_end_catch@PLT
	movq	%rbx, %rdi
.LEHB6:
	call	_Unwind_Resume@PLT
.LEHE6:
.L78:
	imulq	$24, %rbx, %rsi
	movq	%rbp, %rdi
	call	_ZdlPvm@PLT
	jmp	.L80
	.cfi_endproc
.LFE4884:
	.section	.gcc_except_table
	.align 4
.LLSDA4884:
	.byte	0xff
	.byte	0x9b
	.uleb128 .LLSDATT4884-.LLSDATTD4884
.LLSDATTD4884:
	.byte	0x1
	.uleb128 .LLSDACSE4884-.LLSDACSB4884
.LLSDACSB4884:
	.uleb128 .LEHB3-.LFB4884
	.uleb128 .LEHE3-.LEHB3
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB4-.LFB4884
	.uleb128 .LEHE4-.LEHB4
	.uleb128 .L85-.LFB4884
	.uleb128 0x1
	.uleb128 .LEHB5-.LFB4884
	.uleb128 .LEHE5-.LEHB5
	.uleb128 .L86-.LFB4884
	.uleb128 0
	.uleb128 .LEHB6-.LFB4884
	.uleb128 .LEHE6-.LEHB6
	.uleb128 0
	.uleb128 0
.LLSDACSE4884:
	.byte	0x1
	.byte	0
	.align 4
	.long	0

.LLSDATT4884:
	.section	.text._ZNSt6vectorIS_IiSaIiEESaIS1_EE17_M_realloc_insertIJRKS1_EEEvN9__gnu_cxx17__normal_iteratorIPS1_S3_EEDpOT_,"axG",@progbits,_ZNSt6vectorIS_IiSaIiEESaIS1_EE17_M_realloc_insertIJRKS1_EEEvN9__gnu_cxx17__normal_iteratorIPS1_S3_EEDpOT_,comdat
	.size	_ZNSt6vectorIS_IiSaIiEESaIS1_EE17_M_realloc_insertIJRKS1_EEEvN9__gnu_cxx17__normal_iteratorIPS1_S3_EEDpOT_, .-_ZNSt6vectorIS_IiSaIiEESaIS1_EE17_M_realloc_insertIJRKS1_EEEvN9__gnu_cxx17__normal_iteratorIPS1_S3_EEDpOT_
	.section	.rodata.str1.1
.LC2:
	.string	" microseconds"
	.section	.text.startup
	.globl	main
	.type	main, @function
main:
.LFB4238:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA4238
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$648, %rsp
	.cfi_def_cfa_offset 704
	movq	%fs:40, %rax
	movq	%rax, 632(%rsp)
	xorl	%eax, %eax
	call	_ZNSt6chrono3_V212system_clock3nowEv@PLT
	xorl	%ecx, %ecx
	movl	$8, %edx
	leaq	.LC0(%rip), %rsi
	movq	%rax, %r13
	leaq	112(%rsp), %rax
	movq	%rcx, 32(%rsp)
	movq	%rax, %rdi
	movq	%rcx, 40(%rsp)
	movq	%rcx, 48(%rsp)
	movq	%rax, 8(%rsp)
.LEHB7:
	call	_ZNSt14basic_ifstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode@PLT
.LEHE7:
	leaq	96(%rsp), %rax
	xorl	%edx, %edx
	movb	$0, 96(%rsp)
	xorl	%ebx, %ebx
	movq	%rax, 80(%rsp)
	leaq	80(%rsp), %r12
	movq	%rdx, 88(%rsp)
.L96:
	movq	8(%rsp), %rdi
	movq	%r12, %rsi
.LEHB8:
	call	_ZSt7getlineIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE@PLT
.LEHE8:
	movq	(%rax), %rdx
	movq	-24(%rdx), %rdx
	testb	$5, 32(%rax,%rdx)
	jne	.L121
	xorl	%eax, %eax
	movl	88(%rsp), %r15d
	xorl	%ebp, %ebp
	movq	%rax, 56(%rsp)
	movq	%rax, 64(%rsp)
	movq	%rax, 72(%rsp)
.L97:
	movl	%ebp, 28(%rsp)
	cmpl	%ebp, %r15d
	jle	.L122
	movq	80(%rsp), %rax
	movslq	%ebp, %r14
	movb	(%rax,%r14), %al
	testl	%ebx, %ebx
	jne	.L99
	cmpb	$44, %al
	jne	.L99
	movq	64(%rsp), %rsi
	cmpq	72(%rsp), %rsi
	je	.L101
	movl	%ebp, (%rsi)
	addq	$4, %rsi
	movq	%rsi, 64(%rsp)
	jmp	.L99
.L101:
	leaq	28(%rsp), %rdx
	leaq	56(%rsp), %rdi
.LEHB9:
	call	_ZNSt6vectorIiSaIiEE17_M_realloc_insertIJRKiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_
.L99:
	movq	80(%rsp), %rax
	movb	(%rax,%r14), %al
	testl	%ebx, %ebx
	jne	.L102
	xorl	%ebx, %ebx
	cmpb	$123, %al
	sete	%bl
	jmp	.L103
.L102:
	cmpl	$1, %ebx
	jne	.L113
	cmpb	$125, %al
	je	.L114
	cmpb	$92, %al
	movl	$2, %eax
	cmove	%eax, %ebx
	jmp	.L103
.L113:
	movl	$2, %ebx
	jmp	.L103
.L114:
	xorl	%ebx, %ebx
.L103:
	incl	%ebp
	jmp	.L97
.L122:
	movq	40(%rsp), %rbp
	cmpq	48(%rsp), %rbp
	leaq	56(%rsp), %r14
	je	.L105
	movq	%r14, %rsi
	movq	%rbp, %rdi
	call	_ZNSt6vectorIiSaIiEEC1ERKS1_
	addq	$24, %rbp
	movq	%rbp, 40(%rsp)
	jmp	.L106
.L105:
	leaq	32(%rsp), %rdi
	movq	%r14, %rdx
	movq	%rbp, %rsi
	call	_ZNSt6vectorIS_IiSaIiEESaIS1_EE17_M_realloc_insertIJRKS1_EEEvN9__gnu_cxx17__normal_iteratorIPS1_S3_EEDpOT_
.LEHE9:
.L106:
	movq	%r14, %rdi
	call	_ZNSt6vectorIiSaIiEED1Ev
	jmp	.L96
.L121:
	call	_ZNSt6chrono3_V212system_clock3nowEv@PLT
	movl	$1000, %ecx
	leaq	_ZSt4cout(%rip), %rdi
	subq	%r13, %rax
	cqto
	idivq	%rcx
	movq	%rax, %rsi
.LEHB10:
	call	_ZNSo9_M_insertIlEERSoT_@PLT
	movq	%rax, %rdi
	leaq	.LC2(%rip), %rsi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	%rax, %rdi
	call	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@PLT
.LEHE10:
	movq	%r12, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	8(%rsp), %rdi
	call	_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev@PLT
	leaq	32(%rsp), %rdi
	call	_ZNSt6vectorIS_IiSaIiEESaIS1_EED1Ev
	movq	632(%rsp), %rax
	subq	%fs:40, %rax
	je	.L112
	jmp	.L119
.L117:
	endbr64
	movq	%rax, %rbx
.L108:
	leaq	56(%rsp), %rdi
	call	_ZNSt6vectorIiSaIiEED1Ev
	jmp	.L109
.L118:
	endbr64
	movq	%rax, %rbx
.L109:
	movq	%r12, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	8(%rsp), %rdi
	call	_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev@PLT
	jmp	.L110
.L116:
	endbr64
	movq	%rax, %rbx
.L110:
	leaq	32(%rsp), %rdi
	call	_ZNSt6vectorIS_IiSaIiEESaIS1_EED1Ev
	movq	632(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L119
	movq	%rbx, %rdi
.LEHB11:
	call	_Unwind_Resume@PLT
.LEHE11:
.L119:
	call	__stack_chk_fail@PLT
.L112:
	addq	$648, %rsp
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4238:
	.section	.gcc_except_table
.LLSDA4238:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE4238-.LLSDACSB4238
.LLSDACSB4238:
	.uleb128 .LEHB7-.LFB4238
	.uleb128 .LEHE7-.LEHB7
	.uleb128 .L116-.LFB4238
	.uleb128 0
	.uleb128 .LEHB8-.LFB4238
	.uleb128 .LEHE8-.LEHB8
	.uleb128 .L118-.LFB4238
	.uleb128 0
	.uleb128 .LEHB9-.LFB4238
	.uleb128 .LEHE9-.LEHB9
	.uleb128 .L117-.LFB4238
	.uleb128 0
	.uleb128 .LEHB10-.LFB4238
	.uleb128 .LEHE10-.LEHB10
	.uleb128 .L118-.LFB4238
	.uleb128 0
	.uleb128 .LEHB11-.LFB4238
	.uleb128 .LEHE11-.LEHB11
	.uleb128 0
	.uleb128 0
.LLSDACSE4238:
	.section	.text.startup
	.size	main, .-main
	.section	.nvFatBinSegment,"aw"
	.align 8
	.type	_ZL15__fatDeviceText, @object
	.size	_ZL15__fatDeviceText, 24
_ZL15__fatDeviceText:
	.long	1180844977
	.long	1
	.quad	fatbinData
	.quad	0
	.local	_ZL20__cudaFatCubinHandle
	.comm	_ZL20__cudaFatCubinHandle,8,8
	.globl	E
	.bss
	.align 32
	.type	E, @object
	.size	E, 1024
E:
	.zero	1024
	.globl	D
	.align 32
	.type	D, @object
	.size	D, 4096
D:
	.zero	4096
	.hidden	DW.ref.__gxx_personality_v0
	.weak	DW.ref.__gxx_personality_v0
	.section	.data.rel.local.DW.ref.__gxx_personality_v0,"awG",@progbits,DW.ref.__gxx_personality_v0,comdat
	.align 8
	.type	DW.ref.__gxx_personality_v0, @object
	.size	DW.ref.__gxx_personality_v0, 8
DW.ref.__gxx_personality_v0:
	.quad	__gxx_personality_v0
	.ident	"GCC: (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:


#include <hip/hip_runtime.h>
#include <iostream>
#include <fstream>      
#include <vector>
#include <string>
#include <stdio.h> // JDB -- should not be needed
#include <chrono>


using namespace std;

#define num_data_type 10
//#define INPUT_FILE "./input_file.csv"
#define INPUT_FILE "./input/nla.csv"

//#define INPUT_FILE "./input/go_track_trackspoints.csv"


typedef std::chrono::high_resolution_clock Clock;

int     D[4][256];
uint8_t E[4][256];

void add_transition (int state, uint8_t input, int next_state) {
	D[state][input] = next_state;
}

void add_default_transition(int state, int next_state) {
	for (int i = 0; i < 256; i++) {
		D[(int) state][i] = next_state;
	}
}

void add_emission(int state, uint8_t input, uint8_t value) {
	E[state][input] = value;
}

void add_default_emission(int state, uint8_t value) {
	for (int i = 0; i < 256; i++) {
		E[state][i] = value;
	}
}

void Dtable_generate(void) {
	for (int i = 0; i < 2; i++) {
		add_default_transition(i ,i);
	}
	add_default_transition(2 , 1);
	add_default_transition(3, 0);

	add_transition(0, '[', 1);
	add_transition(0, '\\', 3);
	add_transition(1, '\\', 2);
	add_transition(1, ']', 0);
}

void Etable_generate(void) {
	for(int i = 0; i < 3; i++) {
		add_default_emission(i, 0);
	}
	add_emission(0, ',', 1);
}

void parsedata (string s, uint8_t* comma_indices) {

	//default states
	int state = 0;
	int emission = 0;

	for (int i = 0; i < s.length(); i++) {
		emission = E[state][s[i]];
		state = D[state][s[i]];

		comma_indices[i] = emission;
	}
}

const int max_length(){

	std::ifstream is(INPUT_FILE);   // open file
	string line;
	int length = 0; 

	while (getline(is, line)){
		if(length < line.length())
			length = line.length();
	}
	is.close();
	
	return length; 
}

void seq_scan(uint8_t* comma_indices, int num_char) {
	for(int i = 1; i < num_char; i++) {
		comma_indices[i] = comma_indices[i - 1] + comma_indices[i];
	}
}

int main() {

	auto t1 = Clock::now();
	std::vector<std::vector<int>> output_vec;
	std::ifstream is(INPUT_FILE);
	string line;

	int state = 0;

	while(getline(is, line)) {
		std::vector<int> temp_vec;

		int len = line.length();
		for(int i = 0; i < len; i++){
			if(state == 0 && line[i] == ',') {
				temp_vec.push_back(i);
			}
			char c = line[i];
			if(state == 0) {
				if(c == '{')
					state = 1;
				else 
					state = 0;
			}
			else if(state == 1){
				if( c == '}')
					state = 0;
				else if (c == '\\')
					state = 2;
				else
					state = 1;
			}
			else {
				state = 2;
			}
		}

		output_vec.push_back(temp_vec);
	}

    auto t2 = Clock::now();

     cout << std::chrono::duration_cast<std::chrono::microseconds>(t2 - t1).count() << " microseconds" << endl;
	/*

	int len = output_vec.size();
	for(int i = 0; i < len; i++){
		int temp_len = output_vec[i].size();
		for(int j = 0; j < temp_len; j++) {
			printf("%d ", (output_vec[i])[j]);
		}
		printf("\n");
	}

	*/


	// std::ifstream is(INPUT_FILE);   // open file
	// string line;

	// //generate the tables
	// Dtable_generate();
	// Etable_generate();

	// // initialize bit vector
	// const int array_len = max_length();	
	// uint8_t* comma_indices = new uint8_t[array_len];

	// for (int i = 0; i < array_len; i++) {
	// 	comma_indices[i] = 0;
	// }

 //     auto t1 = Clock::now();

	// while (getline(is, line)) { 


	// 	parsedata(line, comma_indices); 
	// 	seq_scan(comma_indices, array_len);
		
	// 	int prev = 0; 
	// 	for(int i = 0; i < array_len; i++){
	// 		if(prev != comma_indices[i]) {
	// 			//std::cout << i << " ";
	// 		}
	// 		prev = comma_indices[i];
	// 		comma_indices[i] = 0;
	// 	}

	// 	//cout << endl;

	// }
	// is.close();

 //    auto t2 = Clock::now();

 //     cout << std::chrono::duration_cast<std::chrono::microseconds>(t2 - t1).count() << " microseconds" << endl;

	// delete [] comma_indices;
    return 0;
}


	.text
	.file	"seq_code.hip"
                                        # Start of file scope inline assembly
	.globl	_ZSt21ios_base_library_initv

                                        # End of file scope inline assembly
	.globl	_Z14add_transitionihi           # -- Begin function _Z14add_transitionihi
	.type	_Z14add_transitionihi,@function
_Z14add_transitionihi:                  # @_Z14add_transitionihi
	.cfi_startproc
# %bb.0:
	movslq	%edi, %rax
	movl	%esi, %ecx
	shlq	$10, %rax
	movl	%edx, D(%rax,%rcx,4)
	retq
.Lfunc_end0:
	.size	_Z14add_transitionihi, .Lfunc_end0-_Z14add_transitionihi
	.cfi_endproc
                                        # -- End function
	.globl	_Z22add_default_transitionii    # -- Begin function _Z22add_default_transitionii
	.type	_Z22add_default_transitionii,@function
_Z22add_default_transitionii:           # @_Z22add_default_transitionii
	.cfi_startproc
# %bb.0:
	movslq	%edi, %rax
	shlq	$10, %rax
	xorl	%ecx, %ecx
.LBB1_1:                                # =>This Inner Loop Header: Depth=1
	movl	%esi, D(%rax,%rcx,4)
	incq	%rcx
	cmpq	$256, %rcx                      # imm = 0x100
	jne	.LBB1_1
# %bb.2:
	retq
.Lfunc_end1:
	.size	_Z22add_default_transitionii, .Lfunc_end1-_Z22add_default_transitionii
	.cfi_endproc
                                        # -- End function
	.globl	_Z12add_emissionihh             # -- Begin function _Z12add_emissionihh
	.type	_Z12add_emissionihh,@function
_Z12add_emissionihh:                    # @_Z12add_emissionihh
	.cfi_startproc
# %bb.0:
	movslq	%edi, %rax
	movl	%esi, %ecx
	shlq	$8, %rax
	movb	%dl, E(%rax,%rcx)
	retq
.Lfunc_end2:
	.size	_Z12add_emissionihh, .Lfunc_end2-_Z12add_emissionihh
	.cfi_endproc
                                        # -- End function
	.globl	_Z20add_default_emissionih      # -- Begin function _Z20add_default_emissionih
	.type	_Z20add_default_emissionih,@function
_Z20add_default_emissionih:             # @_Z20add_default_emissionih
	.cfi_startproc
# %bb.0:
	movslq	%edi, %rax
	shlq	$8, %rax
	leaq	E(%rax), %rdi
	movl	$256, %edx                      # imm = 0x100
	jmp	memset@PLT                      # TAILCALL
.Lfunc_end3:
	.size	_Z20add_default_emissionih, .Lfunc_end3-_Z20add_default_emissionih
	.cfi_endproc
                                        # -- End function
	.globl	_Z15Dtable_generatev            # -- Begin function _Z15Dtable_generatev
	.type	_Z15Dtable_generatev,@function
_Z15Dtable_generatev:                   # @_Z15Dtable_generatev
	.cfi_startproc
# %bb.0:
	movb	$1, %al
	xorl	%ecx, %ecx
.LBB4_1:                                # =>This Loop Header: Depth=1
                                        #     Child Loop BB4_2 Depth 2
	movq	%rcx, %rdx
	shlq	$10, %rdx
	xorl	%esi, %esi
.LBB4_2:                                #   Parent Loop BB4_1 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	movl	%ecx, D(%rdx,%rsi,4)
	incq	%rsi
	cmpq	$256, %rsi                      # imm = 0x100
	jne	.LBB4_2
# %bb.3:                                # %_Z22add_default_transitionii.exit11
                                        #   in Loop: Header=BB4_1 Depth=1
	movl	$1, %ecx
	testb	$1, %al
	movl	$0, %eax
	jne	.LBB4_1
# %bb.4:                                # %.preheader.preheader
	movq	$-1024, %rax                    # imm = 0xFC00
.LBB4_5:                                # %.preheader
                                        # =>This Inner Loop Header: Depth=1
	movl	$1, D+3072(%rax)
	addq	$4, %rax
	jne	.LBB4_5
# %bb.6:                                # %_Z22add_default_transitionii.exit.preheader
	pushq	%rax
	.cfi_def_cfa_offset 16
	movl	$D+3072, %edi
	movl	$1024, %edx                     # imm = 0x400
	xorl	%esi, %esi
	callq	memset@PLT
	movabsq	$12884901889, %rax              # imm = 0x300000001
	movq	%rax, D+364(%rip)
	movq	$2, D+1392(%rip)
	popq	%rax
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end4:
	.size	_Z15Dtable_generatev, .Lfunc_end4-_Z15Dtable_generatev
	.cfi_endproc
                                        # -- End function
	.globl	_Z15Etable_generatev            # -- Begin function _Z15Etable_generatev
	.type	_Z15Etable_generatev,@function
_Z15Etable_generatev:                   # @_Z15Etable_generatev
	.cfi_startproc
# %bb.0:
	pushq	%rax
	.cfi_def_cfa_offset 16
	movl	$E, %edi
	movl	$768, %edx                      # imm = 0x300
	xorl	%esi, %esi
	callq	memset@PLT
	movb	$1, E+44(%rip)
	popq	%rax
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end5:
	.size	_Z15Etable_generatev, .Lfunc_end5-_Z15Etable_generatev
	.cfi_endproc
                                        # -- End function
	.globl	_Z9parsedataNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPh # -- Begin function _Z9parsedataNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPh
	.type	_Z9parsedataNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPh,@function
_Z9parsedataNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPh: # @_Z9parsedataNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPh
	.cfi_startproc
# %bb.0:
	cmpq	$0, 8(%rdi)
	je	.LBB6_3
# %bb.1:                                # %.lr.ph.preheader
	xorl	%eax, %eax
	xorl	%ecx, %ecx
.LBB6_2:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	movslq	%ecx, %rcx
	movq	(%rdi), %rdx
	movsbq	(%rdx,%rax), %rdx
	movq	%rcx, %r8
	shlq	$8, %r8
	movb	E(%r8,%rdx), %r8b
	shlq	$10, %rcx
	movl	D(%rcx,%rdx,4), %ecx
	movb	%r8b, (%rsi,%rax)
	incq	%rax
	cmpq	%rax, 8(%rdi)
	ja	.LBB6_2
.LBB6_3:                                # %._crit_edge
	retq
.Lfunc_end6:
	.size	_Z9parsedataNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPh, .Lfunc_end6-_Z9parsedataNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPh
	.cfi_endproc
                                        # -- End function
	.globl	_Z10max_lengthv                 # -- Begin function _Z10max_lengthv
	.type	_Z10max_lengthv,@function
_Z10max_lengthv:                        # @_Z10max_lengthv
.Lfunc_begin0:
	.cfi_startproc
	.cfi_personality 3, __gxx_personality_v0
	.cfi_lsda 3, .Lexception0
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r12
	.cfi_def_cfa_offset 32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	subq	$552, %rsp                      # imm = 0x228
	.cfi_def_cfa_offset 592
	.cfi_offset %rbx, -40
	.cfi_offset %r12, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	leaq	32(%rsp), %r14
	movl	$.L.str, %esi
	movq	%r14, %rdi
	movl	$8, %edx
	callq	_ZNSt14basic_ifstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode
	leaq	16(%rsp), %r12
	movq	%r12, -16(%r12)
	movq	$0, -8(%r12)
	movb	$0, (%r12)
	xorl	%ebx, %ebx
	movq	%rsp, %r15
.LBB7_1:                                # =>This Inner Loop Header: Depth=1
	movq	32(%rsp), %rax
	movq	-24(%rax), %rdi
	addq	%r14, %rdi
.Ltmp0:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp1:
# %bb.2:                                # %.noexc
                                        #   in Loop: Header=BB7_1 Depth=1
.Ltmp2:
	movsbl	%al, %edx
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_ZSt7getlineIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EES4_
.Ltmp3:
# %bb.3:                                #   in Loop: Header=BB7_1 Depth=1
	movq	(%rax), %rcx
	movq	-24(%rcx), %rcx
	testb	$5, 32(%rax,%rcx)
	jne	.LBB7_10
# %bb.4:                                #   in Loop: Header=BB7_1 Depth=1
	movslq	%ebx, %rax
	movq	8(%rsp), %rcx
	cmpq	%rax, %rcx
	cmovbel	%ebx, %ecx
	movl	%ecx, %ebx
	jmp	.LBB7_1
.LBB7_10:
.Ltmp5:
	leaq	32(%rsp), %rdi
	callq	_ZNSt14basic_ifstreamIcSt11char_traitsIcEE5closeEv
.Ltmp6:
# %bb.11:
	movq	(%rsp), %rdi
	cmpq	%r12, %rdi
	je	.LBB7_13
# %bb.12:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i4
	callq	_ZdlPv
.LBB7_13:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit6
	leaq	32(%rsp), %rdi
	callq	_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev
	movl	%ebx, %eax
	addq	$552, %rsp                      # imm = 0x228
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.LBB7_6:                                # %.loopexit.split-lp
	.cfi_def_cfa_offset 592
.Ltmp7:
	jmp	.LBB7_7
.LBB7_5:                                # %.loopexit
.Ltmp4:
.LBB7_7:
	movq	%rax, %rbx
	movq	(%rsp), %rdi
	cmpq	%r12, %rdi
	je	.LBB7_9
# %bb.8:                                # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i
	callq	_ZdlPv
.LBB7_9:                                # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit
	leaq	32(%rsp), %rdi
	callq	_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev
	movq	%rbx, %rdi
	callq	_Unwind_Resume@PLT
.Lfunc_end7:
	.size	_Z10max_lengthv, .Lfunc_end7-_Z10max_lengthv
	.cfi_endproc
	.section	.gcc_except_table,"a",@progbits
	.p2align	2, 0x0
GCC_except_table7:
.Lexception0:
	.byte	255                             # @LPStart Encoding = omit
	.byte	255                             # @TType Encoding = omit
	.byte	1                               # Call site Encoding = uleb128
	.uleb128 .Lcst_end0-.Lcst_begin0
.Lcst_begin0:
	.uleb128 .Lfunc_begin0-.Lfunc_begin0    # >> Call Site 1 <<
	.uleb128 .Ltmp0-.Lfunc_begin0           #   Call between .Lfunc_begin0 and .Ltmp0
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp0-.Lfunc_begin0           # >> Call Site 2 <<
	.uleb128 .Ltmp3-.Ltmp0                  #   Call between .Ltmp0 and .Ltmp3
	.uleb128 .Ltmp4-.Lfunc_begin0           #     jumps to .Ltmp4
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp5-.Lfunc_begin0           # >> Call Site 3 <<
	.uleb128 .Ltmp6-.Ltmp5                  #   Call between .Ltmp5 and .Ltmp6
	.uleb128 .Ltmp7-.Lfunc_begin0           #     jumps to .Ltmp7
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp6-.Lfunc_begin0           # >> Call Site 4 <<
	.uleb128 .Lfunc_end7-.Ltmp6             #   Call between .Ltmp6 and .Lfunc_end7
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end0:
	.p2align	2, 0x0
                                        # -- End function
	.text
	.globl	_Z8seq_scanPhi                  # -- Begin function _Z8seq_scanPhi
	.type	_Z8seq_scanPhi,@function
_Z8seq_scanPhi:                         # @_Z8seq_scanPhi
	.cfi_startproc
# %bb.0:
	cmpl	$2, %esi
	jl	.LBB8_3
# %bb.1:                                # %.lr.ph.preheader
	movl	%esi, %eax
	movb	(%rdi), %cl
	movl	$1, %edx
.LBB8_2:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	addb	(%rdi,%rdx), %cl
	movb	%cl, (%rdi,%rdx)
	incq	%rdx
	cmpq	%rdx, %rax
	jne	.LBB8_2
.LBB8_3:                                # %._crit_edge
	retq
.Lfunc_end8:
	.size	_Z8seq_scanPhi, .Lfunc_end8-_Z8seq_scanPhi
	.cfi_endproc
                                        # -- End function
	.section	.rodata.cst16,"aM",@progbits,16
	.p2align	4, 0x0                          # -- Begin function main
.LCPI9_0:
	.zero	16
	.text
	.globl	main
	.type	main,@function
main:                                   # @main
.Lfunc_begin1:
	.cfi_startproc
	.cfi_personality 3, __gxx_personality_v0
	.cfi_lsda 3, .Lexception1
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$632, %rsp                      # imm = 0x278
	.cfi_def_cfa_offset 688
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	callq	_ZNSt6chrono3_V212system_clock3nowEv
	movq	%rax, 72(%rsp)                  # 8-byte Spill
	xorps	%xmm0, %xmm0
	movaps	%xmm0, 80(%rsp)
	movq	$0, 96(%rsp)
.Ltmp8:
	leaq	112(%rsp), %r14
	movl	$.L.str, %esi
	movq	%r14, %rdi
	movl	$8, %edx
	callq	_ZNSt14basic_ifstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode
.Ltmp9:
# %bb.1:
	leaq	32(%rsp), %rax
	movq	%rax, -16(%rax)
	movq	$0, -8(%rax)
	movb	$0, (%rax)
	xorl	%ebx, %ebx
	leaq	48(%rsp), %r12
	leaq	12(%rsp), %r13
	xorl	%ebp, %ebp
.LBB9_2:                                # =>This Loop Header: Depth=1
                                        #     Child Loop BB9_7 Depth 2
	movq	112(%rsp), %rax
	movq	-24(%rax), %rdi
	addq	%r14, %rdi
.Ltmp11:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp12:
# %bb.3:                                # %.noexc
                                        #   in Loop: Header=BB9_2 Depth=1
.Ltmp13:
	movsbl	%al, %edx
	movq	%r14, %rdi
	leaq	16(%rsp), %rsi
	callq	_ZSt7getlineIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EES4_
.Ltmp14:
# %bb.4:                                #   in Loop: Header=BB9_2 Depth=1
	movq	(%rax), %rcx
	movq	-24(%rcx), %rcx
	testb	$5, 32(%rax,%rcx)
	jne	.LBB9_25
# %bb.5:                                #   in Loop: Header=BB9_2 Depth=1
	xorps	%xmm0, %xmm0
	movaps	%xmm0, 48(%rsp)
	movq	$0, 64(%rsp)
	movl	24(%rsp), %r15d
	movl	$0, 12(%rsp)
	testl	%r15d, %r15d
	jle	.LBB9_19
# %bb.6:                                # %.lr.ph.preheader
                                        #   in Loop: Header=BB9_2 Depth=1
	xorl	%eax, %eax
	movl	%ebp, %ecx
.LBB9_7:                                # %.lr.ph
                                        #   Parent Loop BB9_2 Depth=1
                                        # =>  This Inner Loop Header: Depth=2
	cmpl	$1, %ecx
	je	.LBB9_17
# %bb.8:                                # %.lr.ph
                                        #   in Loop: Header=BB9_7 Depth=2
	movl	$2, %ebp
	testl	%ecx, %ecx
	jne	.LBB9_18
# %bb.9:                                #   in Loop: Header=BB9_7 Depth=2
	movslq	%eax, %rdx
	movq	16(%rsp), %rcx
	cmpb	$44, (%rcx,%rdx)
	jne	.LBB9_16
# %bb.10:                               #   in Loop: Header=BB9_7 Depth=2
	movq	56(%rsp), %rsi
	cmpq	64(%rsp), %rsi
	je	.LBB9_14
# %bb.11:                               #   in Loop: Header=BB9_7 Depth=2
	movl	%eax, (%rsi)
	addq	$4, %rsi
	movq	%rsi, 56(%rsp)
	jmp	.LBB9_16
.LBB9_17:                               #   in Loop: Header=BB9_7 Depth=2
	movq	16(%rsp), %rcx
	movslq	%eax, %rdx
	movb	(%rcx,%rdx), %cl
	xorl	%ebp, %ebp
	cmpb	$92, %cl
	sete	%bpl
	incl	%ebp
	cmpb	$125, %cl
	cmovel	%ebx, %ebp
	jmp	.LBB9_18
.LBB9_14:                               #   in Loop: Header=BB9_7 Depth=2
.Ltmp27:
	movq	%r12, %rdi
	movq	%r13, %rdx
	callq	_ZNSt6vectorIiSaIiEE17_M_realloc_insertIJRKiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_
.Ltmp28:
# %bb.15:                               # %._crit_edge42
                                        #   in Loop: Header=BB9_7 Depth=2
	movq	16(%rsp), %rcx
.LBB9_16:                               #   in Loop: Header=BB9_7 Depth=2
	movslq	12(%rsp), %rax
	xorl	%ebp, %ebp
	cmpb	$123, (%rcx,%rax)
	sete	%bpl
.LBB9_18:                               #   in Loop: Header=BB9_7 Depth=2
	incl	%eax
	movl	%eax, 12(%rsp)
	movl	%ebp, %ecx
	cmpl	%r15d, %eax
	jl	.LBB9_7
.LBB9_19:                               # %._crit_edge
                                        #   in Loop: Header=BB9_2 Depth=1
.Ltmp30:
	leaq	80(%rsp), %rdi
	movq	%r12, %rsi
	callq	_ZNSt6vectorIS_IiSaIiEESaIS1_EE9push_backERKS1_
.Ltmp31:
# %bb.20:                               #   in Loop: Header=BB9_2 Depth=1
	movq	48(%rsp), %rdi
	testq	%rdi, %rdi
	je	.LBB9_2
# %bb.21:                               #   in Loop: Header=BB9_2 Depth=1
	callq	_ZdlPv
	jmp	.LBB9_2
.LBB9_25:
	callq	_ZNSt6chrono3_V212system_clock3nowEv
	subq	72(%rsp), %rax                  # 8-byte Folded Reload
	movabsq	$2361183241434822607, %rcx      # imm = 0x20C49BA5E353F7CF
	imulq	%rcx
	movq	%rdx, %rsi
	shrq	$63, %rsi
	sarq	$7, %rdx
	addq	%rdx, %rsi
.Ltmp16:
	movl	$_ZSt4cout, %edi
	callq	_ZNSo9_M_insertIlEERSoT_
.Ltmp17:
# %bb.26:                               # %_ZNSolsEl.exit
.Ltmp18:
	movq	%rax, %rbx
	movl	$.L.str.1, %esi
	movl	$13, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp19:
# %bb.27:                               # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit
	movq	(%rbx), %rax
	movq	-24(%rax), %rdi
	addq	%rbx, %rdi
.Ltmp20:
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
.Ltmp21:
# %bb.28:                               # %.noexc33
.Ltmp22:
	movsbl	%al, %esi
	movq	%rbx, %rdi
	callq	_ZNSo3putEc
.Ltmp23:
# %bb.29:                               # %.noexc34
.Ltmp24:
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
.Ltmp25:
# %bb.30:                               # %_ZNSolsEPFRSoS_E.exit
	movq	16(%rsp), %rdi
	leaq	32(%rsp), %rax
	cmpq	%rax, %rdi
	je	.LBB9_32
# %bb.31:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i
	callq	_ZdlPv
.LBB9_32:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit
	leaq	112(%rsp), %rdi
	callq	_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev
	leaq	80(%rsp), %rdi
	callq	_ZNSt6vectorIS_IiSaIiEESaIS1_EED2Ev
	xorl	%eax, %eax
	addq	$632, %rsp                      # imm = 0x278
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.LBB9_12:
	.cfi_def_cfa_offset 688
.Ltmp10:
	movq	%rax, %rbx
	jmp	.LBB9_38
.LBB9_33:
.Ltmp26:
	jmp	.LBB9_34
.LBB9_22:
.Ltmp32:
	jmp	.LBB9_23
.LBB9_39:
.Ltmp29:
.LBB9_23:
	movq	%rax, %rbx
	movq	48(%rsp), %rdi
	testq	%rdi, %rdi
	je	.LBB9_35
# %bb.24:
	callq	_ZdlPv
	jmp	.LBB9_35
.LBB9_13:
.Ltmp15:
.LBB9_34:
	movq	%rax, %rbx
.LBB9_35:
	leaq	32(%rsp), %rax
	movq	16(%rsp), %rdi
	cmpq	%rax, %rdi
	je	.LBB9_37
# %bb.36:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i30
	callq	_ZdlPv
.LBB9_37:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit32
	leaq	112(%rsp), %rdi
	callq	_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev
.LBB9_38:
	leaq	80(%rsp), %rdi
	callq	_ZNSt6vectorIS_IiSaIiEESaIS1_EED2Ev
	movq	%rbx, %rdi
	callq	_Unwind_Resume@PLT
.Lfunc_end9:
	.size	main, .Lfunc_end9-main
	.cfi_endproc
	.section	.gcc_except_table,"a",@progbits
	.p2align	2, 0x0
GCC_except_table9:
.Lexception1:
	.byte	255                             # @LPStart Encoding = omit
	.byte	255                             # @TType Encoding = omit
	.byte	1                               # Call site Encoding = uleb128
	.uleb128 .Lcst_end1-.Lcst_begin1
.Lcst_begin1:
	.uleb128 .Ltmp8-.Lfunc_begin1           # >> Call Site 1 <<
	.uleb128 .Ltmp9-.Ltmp8                  #   Call between .Ltmp8 and .Ltmp9
	.uleb128 .Ltmp10-.Lfunc_begin1          #     jumps to .Ltmp10
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp11-.Lfunc_begin1          # >> Call Site 2 <<
	.uleb128 .Ltmp14-.Ltmp11                #   Call between .Ltmp11 and .Ltmp14
	.uleb128 .Ltmp15-.Lfunc_begin1          #     jumps to .Ltmp15
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp27-.Lfunc_begin1          # >> Call Site 3 <<
	.uleb128 .Ltmp28-.Ltmp27                #   Call between .Ltmp27 and .Ltmp28
	.uleb128 .Ltmp29-.Lfunc_begin1          #     jumps to .Ltmp29
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp30-.Lfunc_begin1          # >> Call Site 4 <<
	.uleb128 .Ltmp31-.Ltmp30                #   Call between .Ltmp30 and .Ltmp31
	.uleb128 .Ltmp32-.Lfunc_begin1          #     jumps to .Ltmp32
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp16-.Lfunc_begin1          # >> Call Site 5 <<
	.uleb128 .Ltmp25-.Ltmp16                #   Call between .Ltmp16 and .Ltmp25
	.uleb128 .Ltmp26-.Lfunc_begin1          #     jumps to .Ltmp26
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp25-.Lfunc_begin1          # >> Call Site 6 <<
	.uleb128 .Lfunc_end9-.Ltmp25            #   Call between .Ltmp25 and .Lfunc_end9
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end1:
	.p2align	2, 0x0
                                        # -- End function
	.section	.text._ZNSt6vectorIS_IiSaIiEESaIS1_EE9push_backERKS1_,"axG",@progbits,_ZNSt6vectorIS_IiSaIiEESaIS1_EE9push_backERKS1_,comdat
	.weak	_ZNSt6vectorIS_IiSaIiEESaIS1_EE9push_backERKS1_ # -- Begin function _ZNSt6vectorIS_IiSaIiEESaIS1_EE9push_backERKS1_
	.p2align	1, 0x90
	.type	_ZNSt6vectorIS_IiSaIiEESaIS1_EE9push_backERKS1_,@function
_ZNSt6vectorIS_IiSaIiEESaIS1_EE9push_backERKS1_: # @_ZNSt6vectorIS_IiSaIiEESaIS1_EE9push_backERKS1_
	.cfi_startproc
# %bb.0:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset %rbx, -16
	movq	%rsi, %rdx
	movq	%rdi, %rbx
	movq	8(%rdi), %rsi
	cmpq	16(%rdi), %rsi
	je	.LBB10_2
# %bb.1:
	movq	%rsi, %rdi
	movq	%rdx, %rsi
	callq	_ZNSt6vectorIiSaIiEEC2ERKS1_
	addq	$24, 8(%rbx)
	popq	%rbx
	.cfi_def_cfa_offset 8
	retq
.LBB10_2:
	.cfi_def_cfa_offset 16
	movq	%rbx, %rdi
	popq	%rbx
	.cfi_def_cfa_offset 8
	jmp	_ZNSt6vectorIS_IiSaIiEESaIS1_EE17_M_realloc_insertIJRKS1_EEEvN9__gnu_cxx17__normal_iteratorIPS1_S3_EEDpOT_ # TAILCALL
.Lfunc_end10:
	.size	_ZNSt6vectorIS_IiSaIiEESaIS1_EE9push_backERKS1_, .Lfunc_end10-_ZNSt6vectorIS_IiSaIiEESaIS1_EE9push_backERKS1_
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt6vectorIS_IiSaIiEESaIS1_EED2Ev,"axG",@progbits,_ZNSt6vectorIS_IiSaIiEESaIS1_EED2Ev,comdat
	.weak	_ZNSt6vectorIS_IiSaIiEESaIS1_EED2Ev # -- Begin function _ZNSt6vectorIS_IiSaIiEESaIS1_EED2Ev
	.p2align	1, 0x90
	.type	_ZNSt6vectorIS_IiSaIiEESaIS1_EED2Ev,@function
_ZNSt6vectorIS_IiSaIiEESaIS1_EED2Ev:    # @_ZNSt6vectorIS_IiSaIiEESaIS1_EED2Ev
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	(%rdi), %rbx
	movq	8(%rdi), %r15
	cmpq	%r15, %rbx
	je	.LBB11_6
# %bb.1:                                # %.lr.ph.i.i.i.preheader
	movq	%rdi, %r14
.LBB11_2:                               # %.lr.ph.i.i.i
                                        # =>This Inner Loop Header: Depth=1
	movq	(%rbx), %rdi
	testq	%rdi, %rdi
	je	.LBB11_4
# %bb.3:                                #   in Loop: Header=BB11_2 Depth=1
	callq	_ZdlPv
.LBB11_4:                               # %_ZSt8_DestroyISt6vectorIiSaIiEEEvPT_.exit.i.i.i
                                        #   in Loop: Header=BB11_2 Depth=1
	addq	$24, %rbx
	cmpq	%r15, %rbx
	jne	.LBB11_2
# %bb.5:                                # %_ZSt8_DestroyIPSt6vectorIiSaIiEES2_EvT_S4_RSaIT0_E.exitthread-pre-split
	movq	(%r14), %rbx
.LBB11_6:                               # %_ZSt8_DestroyIPSt6vectorIiSaIiEES2_EvT_S4_RSaIT0_E.exit
	testq	%rbx, %rbx
	je	.LBB11_7
# %bb.8:
	movq	%rbx, %rdi
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	jmp	_ZdlPv                          # TAILCALL
.LBB11_7:                               # %_ZNSt12_Vector_baseISt6vectorIiSaIiEESaIS2_EED2Ev.exit
	.cfi_def_cfa_offset 32
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end11:
	.size	_ZNSt6vectorIS_IiSaIiEESaIS1_EED2Ev, .Lfunc_end11-_ZNSt6vectorIS_IiSaIiEESaIS1_EED2Ev
	.cfi_endproc
                                        # -- End function
	.section	.text.__clang_call_terminate,"axG",@progbits,__clang_call_terminate,comdat
	.hidden	__clang_call_terminate          # -- Begin function __clang_call_terminate
	.weak	__clang_call_terminate
	.type	__clang_call_terminate,@function
__clang_call_terminate:                 # @__clang_call_terminate
	.cfi_startproc
# %bb.0:
	pushq	%rax
	.cfi_def_cfa_offset 16
	callq	__cxa_begin_catch
	callq	_ZSt9terminatev
.Lfunc_end12:
	.size	__clang_call_terminate, .Lfunc_end12-__clang_call_terminate
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt6vectorIiSaIiEE17_M_realloc_insertIJRKiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_,"axG",@progbits,_ZNSt6vectorIiSaIiEE17_M_realloc_insertIJRKiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_,comdat
	.weak	_ZNSt6vectorIiSaIiEE17_M_realloc_insertIJRKiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_ # -- Begin function _ZNSt6vectorIiSaIiEE17_M_realloc_insertIJRKiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_
	.p2align	1, 0x90
	.type	_ZNSt6vectorIiSaIiEE17_M_realloc_insertIJRKiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_,@function
_ZNSt6vectorIiSaIiEE17_M_realloc_insertIJRKiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_: # @_ZNSt6vectorIiSaIiEE17_M_realloc_insertIJRKiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movq	%rdx, (%rsp)                    # 8-byte Spill
	movq	%rsi, %r12
	movq	%rdi, %rbx
	movl	$1, %esi
	movl	$.L.str.2, %edx
	callq	_ZNKSt6vectorIiSaIiEE12_M_check_lenEmPKc
	movq	(%rbx), %r13
	movq	8(%rbx), %r15
	movq	%r12, 8(%rsp)                   # 8-byte Spill
	subq	%r13, %r12
	movq	%r12, %r14
	sarq	$2, %r14
	testq	%rax, %rax
	movq	%rax, 16(%rsp)                  # 8-byte Spill
	je	.LBB13_1
# %bb.2:
	movq	%rbx, %rdi
	movq	%rax, %rsi
	xorl	%edx, %edx
	callq	_ZNSt15__new_allocatorIiE8allocateEmPKv
	movq	%rax, %rbp
	jmp	.LBB13_3
.LBB13_1:
	xorl	%ebp, %ebp
.LBB13_3:                               # %_ZNSt12_Vector_baseIiSaIiEE11_M_allocateEm.exit
	movq	(%rsp), %rax                    # 8-byte Reload
	movl	(%rax), %eax
	movl	%eax, (%rbp,%r14,4)
	testq	%r12, %r12
	jle	.LBB13_5
# %bb.4:
	movq	%rbp, %rdi
	movq	%r13, %rsi
	movq	%r12, %rdx
	callq	memmove@PLT
.LBB13_5:                               # %_ZNSt6vectorIiSaIiEE11_S_relocateEPiS2_S2_RS0_.exit
	addq	%rbp, %r12
	addq	$4, %r12
	movq	8(%rsp), %rsi                   # 8-byte Reload
	subq	%rsi, %r15
	testq	%r15, %r15
	jle	.LBB13_7
# %bb.6:
	movq	%r12, %rdi
	movq	%r15, %rdx
	callq	memmove@PLT
.LBB13_7:                               # %_ZNSt6vectorIiSaIiEE11_S_relocateEPiS2_S2_RS0_.exit16
	testq	%r13, %r13
	je	.LBB13_9
# %bb.8:
	movq	%r13, %rdi
	callq	_ZdlPv
.LBB13_9:                               # %_ZNSt12_Vector_baseIiSaIiEE13_M_deallocateEPim.exit
	addq	%r15, %r12
	movq	%rbp, (%rbx)
	movq	%r12, 8(%rbx)
	movq	16(%rsp), %rax                  # 8-byte Reload
	leaq	(,%rax,4), %rax
	addq	%rbp, %rax
	movq	%rax, 16(%rbx)
	addq	$24, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end13:
	.size	_ZNSt6vectorIiSaIiEE17_M_realloc_insertIJRKiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_, .Lfunc_end13-_ZNSt6vectorIiSaIiEE17_M_realloc_insertIJRKiEEEvN9__gnu_cxx17__normal_iteratorIPiS1_EEDpOT_
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNKSt6vectorIiSaIiEE12_M_check_lenEmPKc,"axG",@progbits,_ZNKSt6vectorIiSaIiEE12_M_check_lenEmPKc,comdat
	.weak	_ZNKSt6vectorIiSaIiEE12_M_check_lenEmPKc # -- Begin function _ZNKSt6vectorIiSaIiEE12_M_check_lenEmPKc
	.p2align	1, 0x90
	.type	_ZNKSt6vectorIiSaIiEE12_M_check_lenEmPKc,@function
_ZNKSt6vectorIiSaIiEE12_M_check_lenEmPKc: # @_ZNKSt6vectorIiSaIiEE12_M_check_lenEmPKc
	.cfi_startproc
# %bb.0:
	movabsq	$2305843009213693951, %rcx      # imm = 0x1FFFFFFFFFFFFFFF
	movq	8(%rdi), %r8
	subq	(%rdi), %r8
	sarq	$2, %r8
	movq	%rcx, %rax
	subq	%r8, %rax
	cmpq	%rsi, %rax
	jb	.LBB14_2
# %bb.1:
	cmpq	%rsi, %r8
	cmovaq	%r8, %rsi
	leaq	(%rsi,%r8), %rax
	cmpq	%rcx, %rax
	cmovaeq	%rcx, %rax
	addq	%r8, %rsi
	cmovbq	%rcx, %rax
	retq
.LBB14_2:
	pushq	%rax
	.cfi_def_cfa_offset 16
	movq	%rdx, %rdi
	callq	_ZSt20__throw_length_errorPKc
.Lfunc_end14:
	.size	_ZNKSt6vectorIiSaIiEE12_M_check_lenEmPKc, .Lfunc_end14-_ZNKSt6vectorIiSaIiEE12_M_check_lenEmPKc
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt15__new_allocatorIiE8allocateEmPKv,"axG",@progbits,_ZNSt15__new_allocatorIiE8allocateEmPKv,comdat
	.weak	_ZNSt15__new_allocatorIiE8allocateEmPKv # -- Begin function _ZNSt15__new_allocatorIiE8allocateEmPKv
	.p2align	1, 0x90
	.type	_ZNSt15__new_allocatorIiE8allocateEmPKv,@function
_ZNSt15__new_allocatorIiE8allocateEmPKv: # @_ZNSt15__new_allocatorIiE8allocateEmPKv
	.cfi_startproc
# %bb.0:
	pushq	%rax
	.cfi_def_cfa_offset 16
	movq	%rsi, %rax
	shrq	$61, %rax
	jne	.LBB15_1
# %bb.3:
	shlq	$2, %rsi
	movq	%rsi, %rdi
	popq	%rax
	.cfi_def_cfa_offset 8
	jmp	_Znwm                           # TAILCALL
.LBB15_1:
	.cfi_def_cfa_offset 16
	shrq	$62, %rsi
	je	.LBB15_2
# %bb.4:
	callq	_ZSt28__throw_bad_array_new_lengthv
.LBB15_2:
	callq	_ZSt17__throw_bad_allocv
.Lfunc_end15:
	.size	_ZNSt15__new_allocatorIiE8allocateEmPKv, .Lfunc_end15-_ZNSt15__new_allocatorIiE8allocateEmPKv
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt6vectorIS_IiSaIiEESaIS1_EE17_M_realloc_insertIJRKS1_EEEvN9__gnu_cxx17__normal_iteratorIPS1_S3_EEDpOT_,"axG",@progbits,_ZNSt6vectorIS_IiSaIiEESaIS1_EE17_M_realloc_insertIJRKS1_EEEvN9__gnu_cxx17__normal_iteratorIPS1_S3_EEDpOT_,comdat
	.weak	_ZNSt6vectorIS_IiSaIiEESaIS1_EE17_M_realloc_insertIJRKS1_EEEvN9__gnu_cxx17__normal_iteratorIPS1_S3_EEDpOT_ # -- Begin function _ZNSt6vectorIS_IiSaIiEESaIS1_EE17_M_realloc_insertIJRKS1_EEEvN9__gnu_cxx17__normal_iteratorIPS1_S3_EEDpOT_
	.p2align	1, 0x90
	.type	_ZNSt6vectorIS_IiSaIiEESaIS1_EE17_M_realloc_insertIJRKS1_EEEvN9__gnu_cxx17__normal_iteratorIPS1_S3_EEDpOT_,@function
_ZNSt6vectorIS_IiSaIiEESaIS1_EE17_M_realloc_insertIJRKS1_EEEvN9__gnu_cxx17__normal_iteratorIPS1_S3_EEDpOT_: # @_ZNSt6vectorIS_IiSaIiEESaIS1_EE17_M_realloc_insertIJRKS1_EEEvN9__gnu_cxx17__normal_iteratorIPS1_S3_EEDpOT_
.Lfunc_begin2:
	.cfi_startproc
	.cfi_personality 3, __gxx_personality_v0
	.cfi_lsda 3, .Lexception2
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movq	%rdx, 16(%rsp)                  # 8-byte Spill
	movq	%rsi, %r13
	movq	%rdi, %rbx
	movl	$1, %esi
	movl	$.L.str.2, %edx
	callq	_ZNKSt6vectorIS_IiSaIiEESaIS1_EE12_M_check_lenEmPKc
	movq	%rax, %rsi
	movq	(%rbx), %r12
	movq	8(%rbx), %rbp
	movq	%r13, %rax
	subq	%r12, %rax
	sarq	$3, %rax
	movabsq	$-6148914691236517205, %r14     # imm = 0xAAAAAAAAAAAAAAAB
	imulq	%rax, %r14
	testq	%rsi, %rsi
	movq	%rsi, 8(%rsp)                   # 8-byte Spill
	je	.LBB16_1
# %bb.2:
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_ZNSt15__new_allocatorISt6vectorIiSaIiEEE8allocateEmPKv
	movq	%rax, %r15
	jmp	.LBB16_3
.LBB16_1:
	xorl	%r15d, %r15d
.LBB16_3:                               # %_ZNSt12_Vector_baseISt6vectorIiSaIiEESaIS2_EE11_M_allocateEm.exit
	leaq	(%r14,%r14,2), %rax
	leaq	(%r15,%rax,8), %r14
.Ltmp33:
	movq	%r14, %rdi
	movq	16(%rsp), %rsi                  # 8-byte Reload
	callq	_ZNSt6vectorIiSaIiEEC2ERKS1_
.Ltmp34:
# %bb.4:                                # %_ZNSt16allocator_traitsISaISt6vectorIiSaIiEEEE9constructIS2_JRKS2_EEEvRS3_PT_DpOT0_.exit
	movq	%r15, %r14
	cmpq	%r13, %r12
	je	.LBB16_7
# %bb.5:                                # %.lr.ph.i.i.i.preheader
	xorps	%xmm0, %xmm0
	movq	%r15, %r14
	movq	%r12, %rax
.LBB16_6:                               # %.lr.ph.i.i.i
                                        # =>This Inner Loop Header: Depth=1
	movq	(%rax), %rcx
	movq	%rcx, (%r14)
	movq	8(%rax), %rcx
	movq	%rcx, 8(%r14)
	movq	16(%rax), %rcx
	movq	%rcx, 16(%r14)
	movups	%xmm0, (%rax)
	movq	$0, 16(%rax)
	addq	$24, %r14
	addq	$24, %rax
	cmpq	%r13, %rax
	jne	.LBB16_6
.LBB16_7:                               # %_ZNSt6vectorIS_IiSaIiEESaIS1_EE11_S_relocateEPS1_S4_S4_RS2_.exit
	addq	$24, %r14
	cmpq	%r13, %rbp
	je	.LBB16_10
# %bb.8:                                # %.lr.ph.i.i.i27.preheader
	xorps	%xmm0, %xmm0
.LBB16_9:                               # %.lr.ph.i.i.i27
                                        # =>This Inner Loop Header: Depth=1
	movq	(%r13), %rax
	movq	%rax, (%r14)
	movq	8(%r13), %rax
	movq	%rax, 8(%r14)
	movq	16(%r13), %rax
	movq	%rax, 16(%r14)
	movups	%xmm0, (%r13)
	movq	$0, 16(%r13)
	addq	$24, %r14
	addq	$24, %r13
	cmpq	%rbp, %r13
	jne	.LBB16_9
.LBB16_10:                              # %_ZNSt6vectorIS_IiSaIiEESaIS1_EE11_S_relocateEPS1_S4_S4_RS2_.exit32
	testq	%r12, %r12
	je	.LBB16_12
# %bb.11:
	movq	%r12, %rdi
	callq	_ZdlPv
.LBB16_12:                              # %_ZNSt12_Vector_baseISt6vectorIiSaIiEESaIS2_EE13_M_deallocateEPS2_m.exit
	movq	%r15, (%rbx)
	movq	%r14, 8(%rbx)
	movq	8(%rsp), %rax                   # 8-byte Reload
	leaq	(%rax,%rax,2), %rax
	leaq	(%r15,%rax,8), %rax
	movq	%rax, 16(%rbx)
	addq	$24, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.LBB16_13:
	.cfi_def_cfa_offset 80
.Ltmp35:
	movq	%rax, %rdi
	callq	__cxa_begin_catch
	testq	%r15, %r15
	jne	.LBB16_15
# %bb.14:
	movq	(%r14), %r15
	testq	%r15, %r15
	je	.LBB16_16
.LBB16_15:                              # %_ZNSt12_Vector_baseISt6vectorIiSaIiEESaIS2_EE13_M_deallocateEPS2_m.exit35.sink.split
	movq	%r15, %rdi
	callq	_ZdlPv
.LBB16_16:                              # %_ZNSt12_Vector_baseISt6vectorIiSaIiEESaIS2_EE13_M_deallocateEPS2_m.exit35
.Ltmp36:
	callq	__cxa_rethrow
.Ltmp37:
# %bb.20:
.LBB16_17:
.Ltmp38:
	movq	%rax, %rbx
.Ltmp39:
	callq	__cxa_end_catch
.Ltmp40:
# %bb.18:
	movq	%rbx, %rdi
	callq	_Unwind_Resume@PLT
.LBB16_19:
.Ltmp41:
	movq	%rax, %rdi
	callq	__clang_call_terminate
.Lfunc_end16:
	.size	_ZNSt6vectorIS_IiSaIiEESaIS1_EE17_M_realloc_insertIJRKS1_EEEvN9__gnu_cxx17__normal_iteratorIPS1_S3_EEDpOT_, .Lfunc_end16-_ZNSt6vectorIS_IiSaIiEESaIS1_EE17_M_realloc_insertIJRKS1_EEEvN9__gnu_cxx17__normal_iteratorIPS1_S3_EEDpOT_
	.cfi_endproc
	.section	.gcc_except_table._ZNSt6vectorIS_IiSaIiEESaIS1_EE17_M_realloc_insertIJRKS1_EEEvN9__gnu_cxx17__normal_iteratorIPS1_S3_EEDpOT_,"aG",@progbits,_ZNSt6vectorIS_IiSaIiEESaIS1_EE17_M_realloc_insertIJRKS1_EEEvN9__gnu_cxx17__normal_iteratorIPS1_S3_EEDpOT_,comdat
	.p2align	2, 0x0
GCC_except_table16:
.Lexception2:
	.byte	255                             # @LPStart Encoding = omit
	.byte	3                               # @TType Encoding = udata4
	.uleb128 .Lttbase0-.Lttbaseref0
.Lttbaseref0:
	.byte	1                               # Call site Encoding = uleb128
	.uleb128 .Lcst_end2-.Lcst_begin2
.Lcst_begin2:
	.uleb128 .Lfunc_begin2-.Lfunc_begin2    # >> Call Site 1 <<
	.uleb128 .Ltmp33-.Lfunc_begin2          #   Call between .Lfunc_begin2 and .Ltmp33
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp33-.Lfunc_begin2          # >> Call Site 2 <<
	.uleb128 .Ltmp34-.Ltmp33                #   Call between .Ltmp33 and .Ltmp34
	.uleb128 .Ltmp35-.Lfunc_begin2          #     jumps to .Ltmp35
	.byte	1                               #   On action: 1
	.uleb128 .Ltmp34-.Lfunc_begin2          # >> Call Site 3 <<
	.uleb128 .Ltmp36-.Ltmp34                #   Call between .Ltmp34 and .Ltmp36
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp36-.Lfunc_begin2          # >> Call Site 4 <<
	.uleb128 .Ltmp37-.Ltmp36                #   Call between .Ltmp36 and .Ltmp37
	.uleb128 .Ltmp38-.Lfunc_begin2          #     jumps to .Ltmp38
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp39-.Lfunc_begin2          # >> Call Site 5 <<
	.uleb128 .Ltmp40-.Ltmp39                #   Call between .Ltmp39 and .Ltmp40
	.uleb128 .Ltmp41-.Lfunc_begin2          #     jumps to .Ltmp41
	.byte	1                               #   On action: 1
	.uleb128 .Ltmp40-.Lfunc_begin2          # >> Call Site 6 <<
	.uleb128 .Lfunc_end16-.Ltmp40           #   Call between .Ltmp40 and .Lfunc_end16
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end2:
	.byte	1                               # >> Action Record 1 <<
                                        #   Catch TypeInfo 1
	.byte	0                               #   No further actions
	.p2align	2, 0x0
                                        # >> Catch TypeInfos <<
	.long	0                               # TypeInfo 1
.Lttbase0:
	.p2align	2, 0x0
                                        # -- End function
	.section	.text._ZNSt6vectorIiSaIiEEC2ERKS1_,"axG",@progbits,_ZNSt6vectorIiSaIiEEC2ERKS1_,comdat
	.weak	_ZNSt6vectorIiSaIiEEC2ERKS1_    # -- Begin function _ZNSt6vectorIiSaIiEEC2ERKS1_
	.p2align	1, 0x90
	.type	_ZNSt6vectorIiSaIiEEC2ERKS1_,@function
_ZNSt6vectorIiSaIiEEC2ERKS1_:           # @_ZNSt6vectorIiSaIiEEC2ERKS1_
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r12
	.cfi_def_cfa_offset 32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	pushq	%rax
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -40
	.cfi_offset %r12, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movq	8(%rsi), %rax
	movq	(%rsi), %rcx
	movq	%rax, %r12
	subq	%rcx, %r12
	sarq	$2, %r12
	xorps	%xmm0, %xmm0
	movups	%xmm0, (%rdi)
	movq	$0, 16(%rdi)
	cmpq	%rcx, %rax
	je	.LBB17_1
# %bb.2:
	movq	%rbx, %rdi
	movq	%r12, %rsi
	xorl	%edx, %edx
	callq	_ZNSt15__new_allocatorIiE8allocateEmPKv
	movq	%rax, %r15
	jmp	.LBB17_3
.LBB17_1:
	xorl	%r15d, %r15d
.LBB17_3:
	movq	%r15, (%rbx)
	movq	%r15, 8(%rbx)
	leaq	(%r15,%r12,4), %rax
	movq	%rax, 16(%rbx)
	movq	(%r14), %rsi
	movq	8(%r14), %r14
	subq	%rsi, %r14
	cmpq	$5, %r14
	jl	.LBB17_5
# %bb.4:
	movq	%r15, %rdi
	movq	%r14, %rdx
	callq	memmove@PLT
.LBB17_7:
	addq	%r14, %r15
	movq	%r15, 8(%rbx)
	addq	$8, %rsp
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.LBB17_5:
	.cfi_def_cfa_offset 48
	cmpq	$4, %r14
	jne	.LBB17_7
# %bb.6:
	movl	(%rsi), %eax
	movl	%eax, (%r15)
	jmp	.LBB17_7
.Lfunc_end17:
	.size	_ZNSt6vectorIiSaIiEEC2ERKS1_, .Lfunc_end17-_ZNSt6vectorIiSaIiEEC2ERKS1_
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNKSt6vectorIS_IiSaIiEESaIS1_EE12_M_check_lenEmPKc,"axG",@progbits,_ZNKSt6vectorIS_IiSaIiEESaIS1_EE12_M_check_lenEmPKc,comdat
	.weak	_ZNKSt6vectorIS_IiSaIiEESaIS1_EE12_M_check_lenEmPKc # -- Begin function _ZNKSt6vectorIS_IiSaIiEESaIS1_EE12_M_check_lenEmPKc
	.p2align	1, 0x90
	.type	_ZNKSt6vectorIS_IiSaIiEESaIS1_EE12_M_check_lenEmPKc,@function
_ZNKSt6vectorIS_IiSaIiEESaIS1_EE12_M_check_lenEmPKc: # @_ZNKSt6vectorIS_IiSaIiEESaIS1_EE12_M_check_lenEmPKc
	.cfi_startproc
# %bb.0:
	movabsq	$384307168202282325, %rcx       # imm = 0x555555555555555
	movq	8(%rdi), %rax
	subq	(%rdi), %rax
	sarq	$3, %rax
	movabsq	$-6148914691236517205, %rdi     # imm = 0xAAAAAAAAAAAAAAAB
	imulq	%rax, %rdi
	movq	%rcx, %rax
	subq	%rdi, %rax
	cmpq	%rsi, %rax
	jb	.LBB18_2
# %bb.1:
	cmpq	%rsi, %rdi
	cmovaq	%rdi, %rsi
	leaq	(%rsi,%rdi), %rax
	cmpq	%rcx, %rax
	cmovaeq	%rcx, %rax
	addq	%rdi, %rsi
	cmovbq	%rcx, %rax
	retq
.LBB18_2:
	pushq	%rax
	.cfi_def_cfa_offset 16
	movq	%rdx, %rdi
	callq	_ZSt20__throw_length_errorPKc
.Lfunc_end18:
	.size	_ZNKSt6vectorIS_IiSaIiEESaIS1_EE12_M_check_lenEmPKc, .Lfunc_end18-_ZNKSt6vectorIS_IiSaIiEESaIS1_EE12_M_check_lenEmPKc
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt15__new_allocatorISt6vectorIiSaIiEEE8allocateEmPKv,"axG",@progbits,_ZNSt15__new_allocatorISt6vectorIiSaIiEEE8allocateEmPKv,comdat
	.weak	_ZNSt15__new_allocatorISt6vectorIiSaIiEEE8allocateEmPKv # -- Begin function _ZNSt15__new_allocatorISt6vectorIiSaIiEEE8allocateEmPKv
	.p2align	1, 0x90
	.type	_ZNSt15__new_allocatorISt6vectorIiSaIiEEE8allocateEmPKv,@function
_ZNSt15__new_allocatorISt6vectorIiSaIiEEE8allocateEmPKv: # @_ZNSt15__new_allocatorISt6vectorIiSaIiEEE8allocateEmPKv
	.cfi_startproc
# %bb.0:
	pushq	%rax
	.cfi_def_cfa_offset 16
	movabsq	$384307168202282326, %rax       # imm = 0x555555555555556
	cmpq	%rax, %rsi
	jae	.LBB19_1
# %bb.3:
	shlq	$3, %rsi
	leaq	(%rsi,%rsi,2), %rdi
	popq	%rax
	.cfi_def_cfa_offset 8
	jmp	_Znwm                           # TAILCALL
.LBB19_1:
	.cfi_def_cfa_offset 16
	movabsq	$768614336404564651, %rax       # imm = 0xAAAAAAAAAAAAAAB
	cmpq	%rax, %rsi
	jb	.LBB19_2
# %bb.4:
	callq	_ZSt28__throw_bad_array_new_lengthv
.LBB19_2:
	callq	_ZSt17__throw_bad_allocv
.Lfunc_end19:
	.size	_ZNSt15__new_allocatorISt6vectorIiSaIiEEE8allocateEmPKv, .Lfunc_end19-_ZNSt15__new_allocatorISt6vectorIiSaIiEEE8allocateEmPKv
	.cfi_endproc
                                        # -- End function
	.type	D,@object                       # @D
	.bss
	.globl	D
	.p2align	4, 0x0
D:
	.zero	4096
	.size	D, 4096

	.type	E,@object                       # @E
	.globl	E
	.p2align	4, 0x0
E:
	.zero	1024
	.size	E, 1024

	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"./input/nla.csv"
	.size	.L.str, 16

	.type	.L.str.1,@object                # @.str.1
.L.str.1:
	.asciz	" microseconds"
	.size	.L.str.1, 14

	.type	.L.str.2,@object                # @.str.2
.L.str.2:
	.asciz	"vector::_M_realloc_insert"
	.size	.L.str.2, 26

	.type	__hip_cuid_,@object             # @__hip_cuid_
	.bss
	.globl	__hip_cuid_
__hip_cuid_:
	.byte	0                               # 0x0
	.size	__hip_cuid_, 1

	.ident	"AMD clang version 18.0.0git (https://github.com/RadeonOpenCompute/llvm-project roc-6.3.2 25012 e5bf7e55c91490b07c49d8960fa7983d864936c4)"
	.section	".note.GNU-stack","",@progbits
	.addrsig
	.addrsig_sym __gxx_personality_v0
	.addrsig_sym _Unwind_Resume
	.addrsig_sym _ZSt4cout
	.addrsig_sym __hip_cuid_

	.text
	.p2alignl 7, 3214868480
	.fill 96, 4, 3214868480
	.type	__hip_cuid_,@object             ; @__hip_cuid_
	.section	.bss,"aw",@nobits
	.globl	__hip_cuid_
__hip_cuid_:
	.byte	0                               ; 0x0
	.size	__hip_cuid_, 1

	.ident	"AMD clang version 18.0.0git (https://github.com/RadeonOpenCompute/llvm-project roc-6.3.2 25012 e5bf7e55c91490b07c49d8960fa7983d864936c4)"
	.section	".note.GNU-stack","",@progbits
	.addrsig
	.addrsig_sym __hip_cuid_
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.amdgpu_metadata
---
amdhsa.kernels:  []
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
