// File: /workspace/github_cpp_makefile_star2_O3/hkbu-victor[P]SFastLDA/super_fast_final1_d.cpp
// Function: main
int main(int argc, char **argv){
  	char line[ 80 ];
    int n, i, j, docId, wordId, count, max_doc, max_word;
    FILE *fr;

    parse_args(argc, argv);

    //square_limit = 10000000;
    square_limit = 0;
    printf("\nSFastLDA doc-by-doc: Opening and reading dataset file...\n");
    printf("*******************************************************\n");

    D = 0; W = 0; nTokens = 0; max_doc = 0; max_word = 0;
    fr = fopen(dFile,"rt");
    if (fr == NULL){
    	printf("\n\nCannot find the UCI Bag-of-words format input corpus file %s !!!\n\n\n", dFile);
    	exit(1);
    }
    fgets(line, 80, fr);
    sscanf(line, "%d", &D);
    fgets(line, 80, fr);
    sscanf(line, "%d", &W);
    fgets(line, 80, fr);

    int lineNo = 3;

    while (fgets(line, 80, fr) != NULL){
      	sscanf( line, "%d %d %d", &docId, &wordId, &count);
      	lineNo++;
      	nTokens += count;
      	if (docId > max_doc) max_doc = docId;
      	if (wordId > max_word) max_word = wordId;
      	if ((docId <= 0)||(wordId<=0)||(count<=0)){
      		printf("***********************************");
      		return -1;
      	}
      	if ((lineNo % 2000000) == 0)
			printf("reading input data (first pass) : processing line %d \n", lineNo);
    }
    printf("\nTotal documents: %d, Vocab Size : %d, Num. Tokens : %d\n", D, W, nTokens);
    printf("\nTotal documents: %d, Vocab Size : %d, Num. Tokens : %d\n", max_doc, max_word, nTokens);

    //allocate memory
    d = (int *) calloc(nTokens, sizeof(int));
    w = (int *) calloc(nTokens, sizeof(int));
    //victor z = (int *) calloc(nTokens, sizeof(int));
    z = (int *) calloc(nTokens, sizeof(int));
    doc_lens = (int *) calloc(D, sizeof(int));
    word_lens = (int *) calloc(W, sizeof(int));

    rewind(fr);

    fgets(line, 80, fr); fgets(line, 80, fr); fgets(line, 80, fr);
    lineNo = 3;
    n = 0;
    while (fgets(line, 80, fr) != NULL){
    	sscanf( line, "%d %d %d", &docId, &wordId, &count);
    	lineNo++;
    	doc_lens[ docId-1 ] += count;
    	word_lens[ wordId-1 ] += count;
    	for (i=0; i<count; i++){
    		d[n] = docId - 1;
    		w[n] = wordId - 1;
    		n++;
    	}
    	if ((lineNo % 2000000) == 0)
    		printf("reading input data (second pass)  : processing line %d \n", lineNo);
    }
    fclose(fr);

    for (i=0; i<W; i++){
    	if (word_lens[i] > square_limit)
    		square_limit = word_lens[i];
    }

    printf("Square limit: %d\n", square_limit);
    printf( "Arguments:\n" );
    printf( "\tNumber of words      W = %d\n"    , W );
    printf( "\tNumber of docs       D = %d\n"    , D );
    printf( "\tNumber of topics     T = %d\n"    , T );
    printf( "\tNumber of iterations N = %d\n"    , NN );
    printf( "\tHyperparameter   ALPHA = %4.4f\n" , argALPHA );
    printf( "\tHyperparameter    BETA = %4.4f\n" , BETA );
    printf( "\tSeed number            = %d\n"    , SEED );
    printf( "\tNumber of tokens       = %d\n"    , nTokens );
    if (oFile != NULL){
    	printf("\n\tOutput file: %s.\n\n", oFile);
    }else{
    	printf("\n\tNo output file specified.\n\n");
    }


    ztot = new int[T]; std::fill_n(ztot, T, 0);
    ALPHA = new double[T]; std::fill_n(ALPHA, T, argALPHA);
    ALPHA_W_2_norm = new double[W];	//summation over topics of ALPHA*wi
    D_pair_count = new int[D]; std::fill_n(D_pair_count, D, 0);
    W_pair_count = new int[W]; std::fill_n(W_pair_count, W, 0);
    pivotal_topic_indexes = new int[T];
    pivotal_topic_values = new double[T];
    w_pivotal_topic_indexes = new int[T];
    w_pivotal_topic_values = new double[T];
    common_topic_indexes = new int[T];
    ONE_OVER_Z = new double[T];
    square_increment = new long[square_limit];
    square_decrement = new long[square_limit];
    square_of = new long[square_limit];
    ALPHA_square = new double[T];
    di_array = new int[T];

    dpIdx = new DoublePair*[D];
    //victor dpVal = new int*[D];
    dpVal = new int*[D];
    for (i=0; i<D; i++){
    	if (doc_lens[i] < T){
    		dpIdx[i] = new DoublePair[doc_lens[i]];
    		//victor dpVal[i] = new int[doc_lens[i]];
    		dpVal[i] = new int[doc_lens[i]];
    		for (j=0; j<doc_lens[i]; j++){
    			dpIdx[i][j].index = -1;
    		}
    		std::fill_n(dpVal[i], doc_lens[i], 0);
    	}else{
    		dpIdx[i] = new DoublePair[T];
    		//victor dpVal[i] = new int[T];
    		dpVal[i] = new int[T];
    		for (j=0; j<T; j++){
    			dpIdx[i][j].index = -1;
    		}
			std::fill_n(dpVal[i], T, 0);
    	}
    }

    //victor wpIdx = new int*[W];
    wpIdx = new int*[W];
    wpVal = new int*[W];
    for (i=0; i<W; i++){
    	if (word_lens[i] < T){
    		//victor
    		wpIdx[i] = new int[word_lens[i]];
    		std::fill_n(wpIdx[i], word_lens[i], -1);
    	}else{
    		//victor
    		wpIdx[i] = new int[T];
    		std::fill_n(wpIdx[i], T, -1);
    	}
    	wpVal[i] = new int[T];
    	std::fill_n(wpVal[i], T, 0);
    }


    GibbsSamplerLDA();

    if (oFile != NULL){
    	export_results(oFile);
    	printf("\nOutput file is written to %s", oFile);
    }

    printf("\nFinished !!!\n");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
callq 0x1335
xorl %ebp, %ebp
movl %ebp, 0x3209(%rip)      # 0x612c
leaq 0x16c9(%rip), %rdi      # 0x45f3
callq 0x1140
leaq 0x16f7(%rip), %rdi      # 0x462d
callq 0x1140
movl %ebp, 0x31d3(%rip)      # 0x6114
movl %ebp, 0x31d1(%rip)      # 0x6118
movl %ebp, 0x31db(%rip)      # 0x6128
movq 0x318c(%rip), %rdi      # 0x60e0
leaq 0x11ae(%rip), %rsi      # 0x4109
callq 0x10f0
testq %rax, %rax
je 0x38f2
movq %rax, %rbx
leaq 0x20(%rsp), %r14
movq %r14, %rdi
movl $0x50, %esi
movq %rax, %rdx
callq 0x1160
leaq 0x11d0(%rip), %r15      # 0x4158
leaq 0x3185(%rip), %rdx      # 0x6114
movq %r14, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x10d0
movq %r14, %rdi
movl $0x50, %esi
movq %rbx, %rdx
callq 0x1160
leaq 0x3165(%rip), %rdx      # 0x6118
movq %r14, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x10d0
movq %r14, %rdi
movl $0x50, %esi
movq %rbx, %rdx
callq 0x1160
movq %r14, %rdi
movl $0x50, %esi
movq %rbx, %rdx
callq 0x1160
movl $0x0, %r14d
testq %rax, %rax
je 0x30a4
movl $0xfffffffc, %r12d      # imm = 0xFFFFFFFC
movl $0x4, %r15d
leaq 0x20(%rsp), %r13
xorl %r14d, %r14d
xorl %ebp, %ebp
movq %r13, %rdi
leaq 0x1143(%rip), %rsi      # 0x4152
leaq 0xc(%rsp), %rdx
leaq 0x8(%rsp), %rcx
leaq 0x4(%rsp), %r8
xorl %eax, %eax
callq 0x10d0
movl 0x4(%rsp), %eax
addl %eax, 0x30f9(%rip)      # 0x6128
movl 0xc(%rsp), %edx
cmpl %ebp, %edx
cmovgl %edx, %ebp
movl 0x8(%rsp), %ecx
cmpl %r14d, %ecx
cmovgl %ecx, %r14d
testl %edx, %edx
jle 0x338e
testl %ecx, %ecx
jle 0x338e
testl %eax, %eax
jle 0x338e
movl %r15d, %eax
imulq $0x431bde83, %rax, %rax # imm = 0x431BDE83
shrq $0x33, %rax
imull $0x1e8480, %eax, %eax   # imm = 0x1E8480
addl %r12d, %eax
jne 0x3085
leaq 0x10e0(%rip), %rdi      # 0x415b
movl %r15d, %esi
xorl %eax, %eax
callq 0x1040
movq %r13, %rdi
movl $0x50, %esi
movq %rbx, %rdx
callq 0x1160
decl %r12d
incl %r15d
testq %rax, %rax
jne 0x3005
movl 0x306a(%rip), %esi      # 0x6114
movl 0x3068(%rip), %edx      # 0x6118
movl 0x3072(%rip), %ecx      # 0x6128
leaq 0x10d5(%rip), %r15      # 0x4192
movq %r15, %rdi
xorl %eax, %eax
callq 0x1040
movl 0x305b(%rip), %ecx      # 0x6128
movq %r15, %rdi
movl %ebp, %esi
movl %r14d, %edx
xorl %eax, %eax
callq 0x1040
movslq 0x3045(%rip), %r14      # 0x6128
movl $0x4, %esi
movq %r14, %rdi
callq 0x1080
movq %rax, 0x3059(%rip)      # 0x6150
movl $0x4, %esi
movq %r14, %rdi
callq 0x1080
movq %rax, 0x304d(%rip)      # 0x6158
movl $0x4, %esi
movq %r14, %rdi
callq 0x1080
movq %rax, 0x3051(%rip)      # 0x6170
movslq 0x2fee(%rip), %rdi      # 0x6114
movl $0x4, %esi
callq 0x1080
movq %rax, 0x3029(%rip)      # 0x6160
movslq 0x2fda(%rip), %rdi      # 0x6118
movl $0x4, %esi
callq 0x1080
movq %rax, 0x3019(%rip)      # 0x6168
movq %rbx, %rdi
callq 0x1050
leaq 0x20(%rsp), %r14
movq %r14, %rdi
movl $0x50, %esi
movq %rbx, %rdx
callq 0x1160
movq %r14, %rdi
movl $0x50, %esi
movq %rbx, %rdx
callq 0x1160
movq %r14, %rdi
movl $0x50, %esi
movq %rbx, %rdx
callq 0x1160
movq %r14, %rdi
movl $0x50, %esi
movq %rbx, %rdx
callq 0x1160
testq %rax, %rax
je 0x327a
movl $0x3, %ebp
leaq 0x20(%rsp), %r15
leaq 0x8(%rsp), %r13
leaq 0x4(%rsp), %r14
xorl %r12d, %r12d
movq %r15, %rdi
leaq 0xf8c(%rip), %rsi       # 0x4152
leaq 0xc(%rsp), %rdx
movq %r13, %rcx
movq %r14, %r8
xorl %eax, %eax
callq 0x10d0
movl 0x4(%rsp), %eax
movq 0x2f7d(%rip), %rcx      # 0x6160
movslq 0xc(%rsp), %rdx
addl %eax, -0x4(%rcx,%rdx,4)
movl 0x4(%rsp), %eax
movq 0x2f71(%rip), %rcx      # 0x6168
movslq 0x8(%rsp), %rdx
addl %eax, -0x4(%rcx,%rdx,4)
cmpl $0x0, 0x4(%rsp)
jle 0x323f
movslq %r12d, %rax
shlq $0x2, %rax
movq 0x2f3b(%rip), %rcx      # 0x6150
addq %rax, %rcx
addq 0x2f39(%rip), %rax      # 0x6158
xorl %edx, %edx
movl 0xc(%rsp), %esi
decl %esi
movl %esi, (%rcx,%rdx,4)
movl 0x8(%rsp), %esi
decl %esi
movl %esi, (%rax,%rdx,4)
incq %rdx
cmpl 0x4(%rsp), %edx
jl 0x3221
addl %edx, %r12d
incl %ebp
imull $0x68c26139, %ebp, %eax # imm = 0x68C26139
rorl $0x7, %eax
cmpl $0x863, %eax            # imm = 0x863
ja 0x3261
leaq 0xf73(%rip), %rdi       # 0x41cb
movl %ebp, %esi
xorl %eax, %eax
callq 0x1040
movq %r15, %rdi
movl $0x50, %esi
movq %rbx, %rdx
callq 0x1160
testq %rax, %rax
jne 0x31bc
movq %rbx, %rdi
callq 0x10e0
movslq 0x2e8f(%rip), %rax      # 0x6118
movl 0x2e9d(%rip), %esi      # 0x612c
testq %rax, %rax
jle 0x32b4
movq 0x2ecd(%rip), %rcx      # 0x6168
xorl %edx, %edx
movl (%rcx,%rdx,4), %edi
cmpl %esi, %edi
jle 0x32ac
movl %edi, 0x2e82(%rip)      # 0x612c
movl %edi, %esi
incq %rdx
cmpq %rdx, %rax
jne 0x329d
leaq 0xf49(%rip), %rdi       # 0x4204
xorl %eax, %eax
callq 0x1040
leaq 0x139c(%rip), %rdi      # 0x4665
callq 0x1140
movl 0x2e44(%rip), %esi      # 0x6118
leaq 0xf3b(%rip), %rdi       # 0x4216
xorl %eax, %eax
callq 0x1040
movl 0x2e2c(%rip), %esi      # 0x6114
leaq 0xf45(%rip), %rdi       # 0x4234
xorl %eax, %eax
callq 0x1040
movl 0x2e0c(%rip), %esi      # 0x6108
leaq 0xf4f(%rip), %rdi       # 0x4252
xorl %eax, %eax
callq 0x1040
movl 0x2dfc(%rip), %esi      # 0x610c
leaq 0xf59(%rip), %rdi       # 0x4270
xorl %eax, %eax
callq 0x1040
movsd 0x2e62(%rip), %xmm0     # 0x6188
leaq 0xf61(%rip), %rdi       # 0x428e
movb $0x1, %al
callq 0x1040
movsd 0x2e54(%rip), %xmm0     # 0x6190
leaq 0xf6c(%rip), %rdi       # 0x42af
movb $0x1, %al
callq 0x1040
movl 0x2dc0(%rip), %esi      # 0x6110
leaq 0xf79(%rip), %rdi       # 0x42d0
xorl %eax, %eax
callq 0x1040
movl 0x2dc4(%rip), %esi      # 0x6128
leaq 0xf83(%rip), %rdi       # 0x42ee
xorl %eax, %eax
callq 0x1040
movq 0x2d6f(%rip), %rsi      # 0x60e8
testq %rsi, %rsi
je 0x33a6
leaq 0xf87(%rip), %rdi       # 0x430c
xorl %eax, %eax
callq 0x1040
jmp 0x33b2
leaq 0x12ac(%rip), %rdi      # 0x4641
xorl %eax, %eax
callq 0x1040
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x38e3
leaq 0x12c3(%rip), %rdi      # 0x4670
callq 0x1140
movslq 0x2d4f(%rip), %r15      # 0x6108
leaq (,%r15,4), %r14
testq %r15, %r15
movq $-0x1, %r12
movq %r14, %rdi
cmovsq %r12, %rdi
movq %rdi, %rbx
callq 0x1030
movq %rax, 0x2d4f(%rip)      # 0x6130
testq %r15, %r15
jle 0x33f3
movq %rax, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x1070
leaq (,%r15,8), %rdi
testl %r15d, %r15d
cmovsq %r12, %rdi
movq %rdi, 0x18(%rsp)
callq 0x1030
movq %rax, 0x2d9d(%rip)      # 0x61b0
testl %r15d, %r15d
jle 0x34c6
movsd 0x2d64(%rip), %xmm0     # 0x6188
movabsq $0x1fffffffffffffff, %rdx # imm = 0x1FFFFFFFFFFFFFFF
addq %rdx, %r15
andq %r15, %rdx
andl $0x1, %r15d
negq %r15
leaq (%rdx,%r15), %rcx
addq $0x2, %rcx
movq %rdx, %xmm1
pshufd $0x44, %xmm1, %xmm1     # xmm1 = xmm1[0,1,0,1]
xorl %edx, %edx
movdqa 0xbc9(%rip), %xmm2      # 0x4020
movdqa 0xbd1(%rip), %xmm3      # 0x4030
pxor %xmm3, %xmm1
pcmpeqd %xmm4, %xmm4
movq %rdx, %xmm5
pshufd $0x44, %xmm5, %xmm5     # xmm5 = xmm5[0,1,0,1]
por %xmm2, %xmm5
pxor %xmm3, %xmm5
movdqa %xmm5, %xmm6
pcmpgtd %xmm1, %xmm6
pcmpeqd %xmm1, %xmm5
pshufd $0xf5, %xmm5, %xmm7     # xmm7 = xmm5[1,1,3,3]
pand %xmm6, %xmm7
pshufd $0xf5, %xmm6, %xmm5     # xmm5 = xmm6[1,1,3,3]
por %xmm7, %xmm5
movd %xmm5, %esi
notl %esi
testb $0x1, %sil
je 0x34a8
movsd %xmm0, (%rax,%rdx,8)
pxor %xmm4, %xmm5
pextrw $0x4, %xmm5, %esi
testb $0x1, %sil
je 0x34bd
movsd %xmm0, 0x8(%rax,%rdx,8)
addq $0x2, %rdx
cmpq %rdx, %rcx
jne 0x3467
movslq 0x2c4b(%rip), %rbp      # 0x6118
leaq (,%rbp,8), %rdi
testq %rbp, %rbp
movq $-0x1, %r12
movq %rdi, 0x10(%rsp)
cmovsq %r12, %rdi
callq 0x1030
movq %rax, 0x2ce4(%rip)      # 0x61d8
movslq 0x2c19(%rip), %r14      # 0x6114
leaq (,%r14,4), %r13
testq %r14, %r14
movq %r13, %rdi
cmovsq %r12, %rdi
callq 0x1030
movq %rax, 0x2c5f(%rip)      # 0x6178
testq %r14, %r14
jle 0x352b
movq %rax, %rdi
xorl %esi, %esi
movq %r13, %rdx
callq 0x1070
movq %rbp, %r13
shlq $0x2, %r13
testl %ebp, %ebp
cmovnsq %r13, %r12
movq %r12, %rdi
callq 0x1030
movq %rax, 0x2c39(%rip)      # 0x6180
testl %ebp, %ebp
jle 0x3558
movq %rax, %rdi
xorl %esi, %esi
movq %r13, %rdx
callq 0x1070
movq %rbx, %rdi
callq 0x1030
movq %rax, 0x2bd1(%rip)      # 0x6138
movq 0x18(%rsp), %r15
movq %r15, %rdi
callq 0x1030
movq %rax, 0x2c45(%rip)      # 0x61c0
movq %rbx, %rdi
callq 0x1030
movq %rax, 0x2bb6(%rip)      # 0x6140
movq %r15, %rdi
callq 0x1030
movq %rax, 0x2c2f(%rip)      # 0x61c8
movq %rbx, %rdi
callq 0x1030
movq %rax, 0x2ba0(%rip)      # 0x6148
movq %r15, %rdi
callq 0x1030
movq %rax, 0x2c19(%rip)      # 0x61d0
movslq 0x2b6e(%rip), %rax      # 0x612c
leaq (,%rax,8), %r12
testq %rax, %rax
movq $-0x1, %r13
cmovsq %r13, %r12
movq %r12, %rdi
callq 0x1030
movq %rax, 0x2b0d(%rip)      # 0x60f0
movq %r12, %rdi
callq 0x1030
movq %rax, 0x2b06(%rip)      # 0x60f8
movq %r12, %rdi
callq 0x1030
movq %rax, 0x2aff(%rip)      # 0x6100
movq %r15, %rdi
callq 0x1030
movq %rax, 0x2ba8(%rip)      # 0x61b8
movq %rbx, %rdi
callq 0x1030
movq %r14, %rbx
shlq $0x3, %rbx
testl %r14d, %r14d
movq %rax, 0x2be7(%rip)      # 0x6210
cmovsq %r13, %rbx
movq %rbx, %rdi
callq 0x1030
movq %rax, 0x2c14(%rip)      # 0x6250
movq %rbx, %rdi
callq 0x1030
movq %rax, 0x2bbd(%rip)      # 0x6208
testl %r14d, %r14d
movq 0x10(%rsp), %rbx
jle 0x3797
movq 0x2b00(%rip), %rbx      # 0x6160
xorl %r14d, %r14d
movslq (%rbx,%r14,4), %rax
movslq 0x2a9a(%rip), %r15      # 0x6108
cmpl %r15d, %eax
jge 0x36ee
movq %rax, %rdi
shlq $0x3, %rdi
testl %eax, %eax
cmovsq %r13, %rdi
callq 0x1030
movq 0x2bc4(%rip), %rcx      # 0x6250
movq %rax, (%rcx,%r14,8)
movq 0x2ac9(%rip), %rax      # 0x6160
movslq (%rax,%r14,4), %rax
leaq (,%rax,4), %rdi
testq %rax, %rax
cmovsq %r13, %rdi
callq 0x1030
movq 0x2b52(%rip), %rcx      # 0x6208
movq %rax, (%rcx,%r14,8)
movq 0x2a9f(%rip), %rbx      # 0x6160
cmpl $0x0, (%rbx,%r14,4)
jle 0x3776
movq 0x2b7d(%rip), %rax      # 0x6250
movq (%rax,%r14,8), %rcx
xorl %edx, %edx
movl $0xffffffff, (%rcx,%rdx,8) # imm = 0xFFFFFFFF
incq %rdx
movslq (%rbx,%r14,4), %rax
cmpq %rax, %rdx
jl 0x36d9
jmp 0x375a
leaq (,%r15,8), %rdi
movq %r15, %rbx
shlq $0x2, %rbx
testl %r15d, %r15d
cmovsq %r13, %rdi
cmovsq %r13, %rbx
callq 0x1030
movq 0x2b3c(%rip), %rcx      # 0x6250
movq %rax, (%rcx,%r14,8)
movq %rbx, %rdi
callq 0x1030
movq 0x2ae1(%rip), %rcx      # 0x6208
movq %rax, (%rcx,%r14,8)
movq 0x2a2e(%rip), %rbx      # 0x6160
testl %r15d, %r15d
jle 0x3776
movq 0x2b12(%rip), %rax      # 0x6250
movq (%rax,%r14,8), %rcx
xorl %edx, %edx
movl $0xffffffff, (%rcx,%rdx,8) # imm = 0xFFFFFFFF
incq %rdx
movslq 0x29b3(%rip), %rax      # 0x6108
cmpq %rax, %rdx
jl 0x3744
testl %eax, %eax
jle 0x3776
movq 0x2aa3(%rip), %rcx      # 0x6208
movq (%rcx,%r14,8), %rdi
movl %eax, %edx
shlq $0x2, %rdx
xorl %esi, %esi
callq 0x1070
incq %r14
movslq 0x2994(%rip), %rax      # 0x6114
cmpq %rax, %r14
jl 0x3663
movslq 0x2988(%rip), %rbp      # 0x6118
movq %rbp, %rbx
shlq $0x3, %rbx
testl %ebp, %ebp
cmovsq %r13, %rbx
movq %rbx, %rdi
callq 0x1030
movq %rax, 0x2a54(%rip)      # 0x6200
movq %rbx, %rdi
callq 0x1030
movq %rax, 0x2a3d(%rip)      # 0x61f8
testl %ebp, %ebp
jle 0x38aa
movl 0x293e(%rip), %r12d     # 0x6108
xorl %r14d, %r14d
movq $-0x1, %r15
movq 0x298d(%rip), %rax      # 0x6168
movslq (%rax,%r14,4), %rax
cmpl %r12d, %eax
jge 0x380e
movq %rax, %rdi
shlq $0x2, %rdi
testl %eax, %eax
cmovsq %r15, %rdi
callq 0x1030
movq 0x2a03(%rip), %rcx      # 0x6200
movq %rax, (%rcx,%r14,8)
movq 0x2960(%rip), %rax      # 0x6168
movl (%rax,%r14,4), %r12d
jmp 0x382c
movslq %r12d, %rdi
shlq $0x2, %rdi
testl %r12d, %r12d
cmovsq %r15, %rdi
callq 0x1030
movq 0x29d8(%rip), %rcx      # 0x6200
movq %rax, (%rcx,%r14,8)
testl %r12d, %r12d
jle 0x384d
movq 0x29c8(%rip), %rax      # 0x6200
movq (%rax,%r14,8), %rdi
movl %r12d, %edx
shlq $0x2, %rdx
movl $0xff, %esi
callq 0x1070
movslq 0x28b4(%rip), %r12      # 0x6108
leaq (,%r12,4), %rbx
testq %r12, %r12
movq %rbx, %rdi
cmovsq %r15, %rdi
callq 0x1030
movq 0x2986(%rip), %rcx      # 0x61f8
movq %rax, (%rcx,%r14,8)
testq %r12, %r12
jle 0x3897
movq 0x2976(%rip), %rax      # 0x61f8
movq (%rax,%r14,8), %rdi
xorl %esi, %esi
movq %rbx, %rdx
callq 0x1070
movl 0x2871(%rip), %r12d     # 0x6108
incq %r14
movslq 0x2877(%rip), %rax      # 0x6118
cmpq %rax, %r14
jl 0x37d4
callq 0x1b93
movq 0x2832(%rip), %rdi      # 0x60e8
testq %rdi, %rdi
je 0x38d5
callq 0x2e70
movq 0x2821(%rip), %rsi      # 0x60e8
leaq 0xa53(%rip), %rdi       # 0x4321
xorl %eax, %eax
callq 0x1040
leaq 0xdb1(%rip), %rdi       # 0x468d
callq 0x1140
xorl %eax, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x27e7(%rip), %rsi      # 0x60e0
leaq 0x80c(%rip), %rdi       # 0x410c
xorl %eax, %eax
callq 0x1040
movl $0x1, %edi
callq 0x1100