// File: /workspace/github_cpp_makefile_star2_O2/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 0x1325
andl $0x0, 0x375b(%rip)      # 0x6124
leaq 0x1bf3(%rip), %rdi      # 0x45c3
callq 0x1130
leaq 0x1c21(%rip), %rdi      # 0x45fd
callq 0x1130
andl $0x0, 0x3724(%rip)      # 0x610c
andl $0x0, 0x3721(%rip)      # 0x6110
andl $0x0, 0x372a(%rip)      # 0x6120
movq 0x36db(%rip), %rdi      # 0x60d8
leaq 0x16d5(%rip), %rsi      # 0x40d9
callq 0x10e0
testq %rax, %rax
je 0x32ba
movq %rax, %rbx
leaq 0x20(%rsp), %r14
pushq $0x50
popq %rbp
movq %r14, %rdi
movl %ebp, %esi
movq %rax, %rdx
callq 0x1150
leaq 0x16f7(%rip), %r15      # 0x4128
leaq 0x36d4(%rip), %rdx      # 0x610c
movq %r14, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x10c0
movq %r14, %rdi
movl %ebp, %esi
movq %rbx, %rdx
callq 0x1150
leaq 0x36b7(%rip), %rdx      # 0x6110
movq %r14, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x10c0
movq %r14, %rdi
movl %ebp, %esi
movq %rbx, 0x18(%rsp)
movq %rbx, %rdx
callq 0x1150
pushq $-0x4
popq %rbx
pushq $0x4
popq %r13
xorl %r15d, %r15d
xorl %r12d, %r12d
movl %r13d, %eax
xorl %edx, %edx
movl $0x1e8480, %ecx         # imm = 0x1E8480
divl %ecx
movl %eax, %ebp
movq %r14, %rdi
pushq $0x50
popq %rsi
movq 0x18(%rsp), %rdx
callq 0x1150
testq %rax, %rax
je 0x2b25
movq %r14, %rdi
leaq 0x1670(%rip), %rsi      # 0x4122
leaq 0x14(%rsp), %rdx
leaq 0x10(%rsp), %rcx
leaq 0xc(%rsp), %r8
xorl %eax, %eax
callq 0x10c0
movl 0xc(%rsp), %eax
addl %eax, 0x364e(%rip)      # 0x6120
movl 0x14(%rsp), %edx
cmpl %r15d, %edx
cmovgl %edx, %r15d
movl 0x10(%rsp), %ecx
cmpl %r12d, %ecx
cmovgl %ecx, %r12d
testl %edx, %edx
jle 0x2df1
testl %ecx, %ecx
jle 0x2df1
testl %eax, %eax
jle 0x2df1
imull $0x1e8480, %ebp, %eax   # imm = 0x1E8480
addl %ebx, %eax
jne 0x2b1b
leaq 0x161a(%rip), %rdi      # 0x412b
movl %r13d, %esi
xorl %eax, %eax
callq 0x1040
decl %ebx
incl %r13d
jmp 0x2a85
movl 0x35e1(%rip), %esi      # 0x610c
movl 0x35df(%rip), %edx      # 0x6110
movl 0x35e9(%rip), %ecx      # 0x6120
leaq 0x1624(%rip), %r14      # 0x4162
movq %r14, %rdi
xorl %eax, %eax
callq 0x1040
movl 0x35d2(%rip), %ecx      # 0x6120
movq %r14, %rdi
movl %r15d, %esi
movl %r12d, %edx
xorl %eax, %eax
callq 0x1040
movslq 0x35bb(%rip), %r15      # 0x6120
pushq $0x4
popq %r14
movq %r15, %rdi
movq %r14, %rsi
callq 0x1070
movq %rax, 0x35cd(%rip)      # 0x6148
movq %r15, %rdi
movq %r14, %rsi
callq 0x1070
movq %rax, 0x35c3(%rip)      # 0x6150
movq %r15, %rdi
movq %r14, %rsi
callq 0x1070
movq %rax, 0x35c9(%rip)      # 0x6168
movslq 0x3566(%rip), %rdi      # 0x610c
movq %r14, %rsi
callq 0x1070
movq %rax, 0x35a3(%rip)      # 0x6158
movslq 0x3554(%rip), %rdi      # 0x6110
movq %r14, %rsi
callq 0x1070
movq %rax, 0x3595(%rip)      # 0x6160
movq 0x18(%rsp), %rbx
movq %rbx, %rdi
callq 0x1050
leaq 0x20(%rsp), %r14
pushq $0x50
popq %rbp
movq %r14, %rdi
movl %ebp, %esi
movq %rbx, %rdx
callq 0x1150
movq %r14, %rdi
movl %ebp, %esi
movq %rbx, %rdx
callq 0x1150
movq %r14, %rdi
movl %ebp, %esi
movq %rbx, %rdx
callq 0x1150
pushq $0x3
popq %r15
leaq 0xc(%rsp), %r12
movl $0x1e8480, %r13d        # imm = 0x1E8480
xorl %ebp, %ebp
movq %r14, %rdi
pushq $0x50
popq %rsi
movq %rbx, %rdx
callq 0x1150
testq %rax, %rax
je 0x2cdc
movq %r14, %rdi
leaq 0x14e9(%rip), %rsi      # 0x4122
leaq 0x14(%rsp), %rdx
leaq 0x10(%rsp), %rcx
movq %r12, %r8
xorl %eax, %eax
callq 0x10c0
movl 0xc(%rsp), %eax
movq 0x3500(%rip), %rcx      # 0x6158
movslq 0x14(%rsp), %rdx
addl %eax, -0x4(%rcx,%rdx,4)
movl 0xc(%rsp), %eax
movq 0x34f4(%rip), %rcx      # 0x6160
movslq 0x10(%rsp), %rdx
addl %eax, -0x4(%rcx,%rdx,4)
movslq %ebp, %rbp
leaq (,%rbp,4), %rax
movq 0x34c1(%rip), %rdx      # 0x6148
addq %rax, %rdx
addq 0x34bf(%rip), %rax      # 0x6150
xorl %ecx, %ecx
cmpl 0xc(%rsp), %ecx
jge 0x2cb0
movl 0x14(%rsp), %esi
decl %esi
movl %esi, (%rdx,%rcx,4)
movl 0x10(%rsp), %esi
decl %esi
movl %esi, (%rax,%rcx,4)
incq %rcx
jmp 0x2c93
incl %r15d
movl %r15d, %eax
xorl %edx, %edx
divl %r13d
addq %rcx, %rbp
testl %edx, %edx
jne 0x2c18
leaq 0x14ce(%rip), %rdi      # 0x419b
movl %r15d, %esi
xorl %eax, %eax
callq 0x1040
jmp 0x2c18
movq %rbx, %rdi
callq 0x10d0
movl 0x3426(%rip), %eax      # 0x6110
movl 0x3434(%rip), %esi      # 0x6124
movq 0x3469(%rip), %rcx      # 0x6160
xorl %edx, %edx
testl %eax, %eax
cmovlel %edx, %eax
cmpq %rdx, %rax
je 0x2d17
movl (%rcx,%rdx,4), %edi
cmpl %esi, %edi
jle 0x2d12
movl %edi, 0x3414(%rip)      # 0x6124
movl %edi, %esi
incq %rdx
jmp 0x2cfe
leaq 0x14b6(%rip), %rdi      # 0x41d4
xorl %eax, %eax
callq 0x1040
leaq 0x1909(%rip), %rdi      # 0x4635
callq 0x1130
movl 0x33d9(%rip), %esi      # 0x6110
leaq 0x14a8(%rip), %rdi      # 0x41e6
xorl %eax, %eax
callq 0x1040
movl 0x33c1(%rip), %esi      # 0x610c
leaq 0x14b2(%rip), %rdi      # 0x4204
xorl %eax, %eax
callq 0x1040
movl 0x33a1(%rip), %esi      # 0x6100
leaq 0x14bc(%rip), %rdi      # 0x4222
xorl %eax, %eax
callq 0x1040
movl 0x3391(%rip), %esi      # 0x6104
leaq 0x14c6(%rip), %rdi      # 0x4240
xorl %eax, %eax
callq 0x1040
movsd 0x33f7(%rip), %xmm0     # 0x6180
leaq 0x14ce(%rip), %rdi      # 0x425e
movb $0x1, %al
callq 0x1040
movsd 0x33e9(%rip), %xmm0     # 0x6188
leaq 0x14d9(%rip), %rdi      # 0x427f
movb $0x1, %al
callq 0x1040
movl 0x3355(%rip), %esi      # 0x6108
leaq 0x14e6(%rip), %rdi      # 0x42a0
xorl %eax, %eax
callq 0x1040
movl 0x3359(%rip), %esi      # 0x6120
leaq 0x14f0(%rip), %rdi      # 0x42be
xorl %eax, %eax
callq 0x1040
movq 0x3304(%rip), %rsi      # 0x60e0
testq %rsi, %rsi
je 0x2e07
leaq 0x14f4(%rip), %rdi      # 0x42dc
xorl %eax, %eax
callq 0x1040
jmp 0x2e13
leaq 0x1819(%rip), %rdi      # 0x4611
xorl %eax, %eax
callq 0x1040
pushq $-0x1
popq %rax
jmp 0x32ab
leaq 0x1832(%rip), %rdi      # 0x4640
callq 0x1130
movslq 0x32e6(%rip), %r14      # 0x6100
leaq (,%r14,4), %rdi
testq %r14, %r14
pushq $-0x1
popq %r13
cmovsq %r13, %rdi
callq 0x1030
movq %rax, 0x32ef(%rip)      # 0x6128
leaq 0x8(%rsp), %rbx
andl $0x0, (%rbx)
movq %rax, %rdi
movl %r14d, %esi
movq %rbx, %rdx
callq 0x32d7
movslq 0x32aa(%rip), %r14      # 0x6100
leaq (,%r14,8), %rdi
testq %r14, %r14
cmovsq %r13, %rdi
callq 0x1030
movq %rax, 0x3337(%rip)      # 0x61a8
leaq 0x3308(%rip), %rdx      # 0x6180
movq %rax, %rdi
movl %r14d, %esi
callq 0x375c
movslq 0x3286(%rip), %rax      # 0x6110
leaq (,%rax,8), %rdi
testq %rax, %rax
cmovsq %r13, %rdi
callq 0x1030
movq %rax, 0x332b(%rip)      # 0x61d0
movslq 0x3260(%rip), %r14      # 0x610c
leaq (,%r14,4), %rdi
testq %r14, %r14
cmovsq %r13, %rdi
callq 0x1030
movq %rax, 0x32a9(%rip)      # 0x6170
andl $0x0, (%rbx)
leaq 0x8(%rsp), %r15
movq %rax, %rdi
movl %r14d, %esi
movq %r15, %rdx
callq 0x32d7
movslq 0x322c(%rip), %r14      # 0x6110
leaq (,%r14,4), %rdi
testq %r14, %r14
cmovsq %r13, %rdi
callq 0x1030
movq %rax, 0x3279(%rip)      # 0x6178
andl $0x0, (%r15)
leaq 0x8(%rsp), %rdx
movq %rax, %rdi
movl %r14d, %esi
callq 0x32d7
movslq 0x31e6(%rip), %rax      # 0x6100
leaq (,%rax,4), %r14
testq %rax, %rax
cmovsq %r13, %r14
leaq (,%rax,8), %r15
cmovsq %r13, %r15
movq %r14, %rdi
callq 0x1030
movq %rax, 0x31ec(%rip)      # 0x6130
movq %r15, %rdi
callq 0x1030
movq %rax, 0x3265(%rip)      # 0x61b8
movq %r14, %rdi
callq 0x1030
movq %rax, 0x31d6(%rip)      # 0x6138
movq %r15, %rdi
callq 0x1030
movq %rax, 0x324f(%rip)      # 0x61c0
movq %r14, %rdi
callq 0x1030
movq %rax, 0x31c0(%rip)      # 0x6140
movq %r15, %rdi
callq 0x1030
movq %rax, 0x3239(%rip)      # 0x61c8
movslq 0x318e(%rip), %rax      # 0x6124
leaq (,%rax,8), %r12
testq %rax, %rax
cmovsq %r13, %r12
movq %r12, %rdi
callq 0x1030
movq %rax, 0x3134(%rip)      # 0x60e8
movq %r12, %rdi
callq 0x1030
movq %rax, 0x312d(%rip)      # 0x60f0
movq %r12, %rdi
callq 0x1030
movq %rax, 0x3126(%rip)      # 0x60f8
movq %r15, %rdi
callq 0x1030
movq %rax, 0x31cf(%rip)      # 0x61b0
movq %r14, %rdi
callq 0x1030
movq %rax, 0x3218(%rip)      # 0x6208
movslq 0x3115(%rip), %r12      # 0x610c
leaq (,%r12,8), %r14
testq %r12, %r12
cmovsq %r13, %r14
movq %r14, %rdi
callq 0x1030
movq %rax, 0x3233(%rip)      # 0x6248
movq %r14, %rdi
callq 0x1030
movq %rax, 0x31dc(%rip)      # 0x6200
xorl %r15d, %r15d
movslq %r12d, %rax
cmpq %rax, %r15
jge 0x3150
movq 0x311e(%rip), %rax      # 0x6158
movslq (%rax,%r15,4), %rax
movl 0x30bc(%rip), %ebp      # 0x6100
cmpl %ebp, %eax
jge 0x30b5
movq %rax, %rdi
shlq $0x3, %rdi
testl %eax, %eax
cmovsq %r13, %rdi
callq 0x1030
movq 0x31e7(%rip), %rcx      # 0x6248
movq %rax, (%rcx,%r15,8)
movq 0x30ec(%rip), %rax      # 0x6158
movslq (%rax,%r15,4), %rax
leaq (,%rax,4), %rdi
testq %rax, %rax
cmovsq %r13, %rdi
callq 0x1030
movq 0x3175(%rip), %rcx      # 0x6200
movq %rax, (%rcx,%r15,8)
movq 0x30c2(%rip), %rax      # 0x6158
movq 0x31ab(%rip), %rcx      # 0x6248
xorl %edx, %edx
movslq (%rax,%r15,4), %rsi
cmpq %rsi, %rdx
jge 0x3115
movq (%rcx,%r15,8), %rsi
orl $-0x1, (%rsi,%rdx,8)
incq %rdx
jmp 0x309f
movslq %ebp, %r14
leaq (,%r14,8), %rdi
shlq $0x2, %r14
testl %ebp, %ebp
cmovsq %r13, %rdi
cmovsq %r13, %r14
callq 0x1030
movq 0x316e(%rip), %rcx      # 0x6248
movq %rax, (%rcx,%r15,8)
movq %r14, %rdi
callq 0x1030
movq 0x3113(%rip), %rcx      # 0x6200
movq %rax, (%rcx,%r15,8)
movq 0x3150(%rip), %rax      # 0x6248
xorl %ecx, %ecx
movslq %ebp, %rdx
cmpq %rdx, %rcx
jge 0x3127
movq (%rax,%r15,8), %rdx
orl $-0x1, (%rdx,%rcx,8)
incq %rcx
movl 0x2fed(%rip), %ebp      # 0x6100
jmp 0x30fa
movq 0x30e4(%rip), %rax      # 0x6200
movq (%rax,%r15,8), %rdi
andl $0x0, 0x8(%rsp)
jmp 0x3139
movq 0x30d2(%rip), %rax      # 0x6200
movq (%rax,%r15,8), %rdi
andl $0x0, 0x8(%rsp)
movl %ebp, %esi
movq %rbx, %rdx
callq 0x32d7
incq %r15
movl 0x2fc1(%rip), %r12d     # 0x610c
jmp 0x3027
movslq 0x2fb9(%rip), %r14      # 0x6110
leaq (,%r14,8), %rbx
testq %r14, %r14
cmovsq %r13, %rbx
movq %rbx, %rdi
callq 0x1030
movq %rax, 0x3083(%rip)      # 0x61f8
movq %rbx, %rdi
callq 0x1030
movq %rax, 0x306c(%rip)      # 0x61f0
xorl %r15d, %r15d
leaq 0x8(%rsp), %rbx
movslq %r14d, %rax
cmpq %rax, %r15
jge 0x3272
movq 0x2fc1(%rip), %rax      # 0x6160
movslq (%rax,%r15,4), %rax
movslq 0x2f56(%rip), %r14      # 0x6100
cmpl %r14d, %eax
jge 0x31e9
movq %rax, %rdi
shlq $0x2, %rdi
testl %eax, %eax
cmovsq %r13, %rdi
callq 0x1030
movq 0x3030(%rip), %rcx      # 0x61f8
movq %rax, (%rcx,%r15,8)
movq 0x3025(%rip), %rax      # 0x61f8
movq (%rax,%r15,8), %rdi
movq 0x2f82(%rip), %rax      # 0x6160
movl (%rax,%r15,4), %esi
orl $-0x1, 0x8(%rsp)
jmp 0x321a
movq %r14, %rdi
shlq $0x2, %rdi
testl %r14d, %r14d
cmovsq %r13, %rdi
callq 0x1030
movq 0x2ff5(%rip), %rcx      # 0x61f8
movq %rax, (%rcx,%r15,8)
movq 0x2fea(%rip), %rax      # 0x61f8
movq (%rax,%r15,8), %rdi
orl $-0x1, 0x8(%rsp)
movl %r14d, %esi
movq %rbx, %rdx
callq 0x32d7
movslq 0x2ed7(%rip), %r14      # 0x6100
leaq (,%r14,4), %rdi
testq %r14, %r14
cmovsq %r13, %rdi
callq 0x1030
movq 0x2fac(%rip), %rcx      # 0x61f0
movq %rax, (%rcx,%r15,8)
movq 0x2fa1(%rip), %rax      # 0x61f0
movq (%rax,%r15,8), %rdi
andl $0x0, 0x8(%rsp)
movl %r14d, %esi
movq %rbx, %rdx
callq 0x32d7
incq %r15
movl 0x2ea3(%rip), %r14d     # 0x6110
jmp 0x318c
callq 0x1989
movq 0x2e62(%rip), %rdi      # 0x60e0
testq %rdi, %rdi
je 0x329d
callq 0x2920
movq 0x2e51(%rip), %rsi      # 0x60e0
leaq 0x105b(%rip), %rdi      # 0x42f1
xorl %eax, %eax
callq 0x1040
leaq 0x13b9(%rip), %rdi      # 0x465d
callq 0x1130
xorl %eax, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x2e17(%rip), %rsi      # 0x60d8
leaq 0xe14(%rip), %rdi       # 0x40dc
xorl %eax, %eax
callq 0x1040
pushq $0x1
popq %rdi
callq 0x10f0