// File: abaheti95[P]HMM-LDA/Models/cpp_hmm_lda/model.cpp
// Function: HMMLDA::spl_draw_class(std::vector<int, std::allocator<int>>&, std::vector<int, std::allocator<int>>&, std::vector<int, std::allocator<int>>&, std::vector<int, std::allocator<int>>&, int, int)
void HMMLDA::spl_draw_class(vector<int> &document, vector<int> &topic_assignment, vector<int> &class_assignment, vector<int> &num_words_in_document_assigned_to_topic, int word_idx, int doc_size) {
	int old_class = class_assignment[word_idx];
	int old_topic = topic_assignment[word_idx];
	int word = document[word_idx];
	if(word == start_word_id || word == end_word_id) 
		return;
	// Get neighboring classes
	int previous = -1;
	if(word_idx > 0)
		previous = class_assignment[word_idx - 1];
	int future = -1;
	if(word_idx < doc_size-1)
		future = class_assignment[word_idx + 1];

	// Remove current word from transition counts
	if(previous != -1)
		num_transitions[previous][old_class]--;
	if(future != -1)
		num_transitions[old_class][future]--;
	if(old_class == 0) {
		// Remove word from topic counts
		num_same_words_assigned_to_topic[word][old_topic]--;
		num_words_assigned_to_topic[old_topic]--;
		num_words_in_document_assigned_to_topic[old_topic]--;
	}
	// Remove the word from class counts
	num_same_words_assigned_to_class[word][old_class]--;
	num_words_assigned_to_class[old_class]--;

	// Build first term of numerator
	vector<double> term_1(num_classes, 0.0);
	if(previous != -1) {
		for(int i = 0; i < num_classes; i++)
			term_1[i] = num_transitions[previous][i];
	}
	//Smoothing
	for(int i = 0; i < num_classes; i++)
		term_1[i] += gamma;

	// Build second term of numerator
	vector<double> term_2(num_classes, 0.0);
	if(future != -1) {
		for(int i = 0; i < num_classes; i++)
			term_2[i] = num_transitions[i][future];
	}
	//Smoothing
	for(int i = 0; i < num_classes; i++)
		term_2[i] += gamma;
	// Adjusting for the itentity value in the numerator term 2
	if(previous != -1 && future != -1 && (previous == future))
		term_2[previous] += 1.0;

	// Calculate numerator
	vector<double> numerator(num_classes, 0.0);
	for(int i = 0; i < num_classes; i++)
		numerator[i] = term_1[i] * term_2[i];

	// Build denominator
	vector<double> denominator(num_words_assigned_to_class.begin(), num_words_assigned_to_class.end());
	if(previous != -1)
		denominator[previous] += 1.0;
	for(int i = 0; i < num_classes; i++)
		denominator[i] += num_classes * gamma;
	
	// Calculate multiplier
	
	// Initialize numerator of multiplier with same word class/topic counts
	vector<double> multiplier_numerator(num_same_words_assigned_to_class[word].begin(), 
		num_same_words_assigned_to_class[word].end());
	multiplier_numerator[0] = num_same_words_assigned_to_topic[word][old_topic];
	
	// Smoothing
	for(int i = 0; i < num_classes; i++) {
		if(i == 0)
			multiplier_numerator[0] += beta;
		else
			multiplier_numerator[i] += delta;
	}

	// Initialize denominator of multiplier with global class/topic counts
	vector<double> multiplier_denominator(num_words_assigned_to_class.begin(), num_words_assigned_to_class.end());
	multiplier_denominator[0] = num_words_assigned_to_topic[old_topic];
	
	// Smoothing
	for(int i = 0; i < num_classes; i++) {
		if(i == 0)
			multiplier_denominator[0] += beta * vocab_size;
		else
			multiplier_denominator[i] += delta * vocab_size;
	}

	// Calculate probability proportions
	vector<double> proportions(num_classes, 0.0);
	for(int i = 0; i < num_classes; i++) {
		proportions[i] = (multiplier_numerator[i] / multiplier_denominator[i]) * numerator[i] / denominator[i];
	}
	// Draw class
	int new_class = categorical(proportions);

	class_assignment[word_idx] = new_class;

	// Restore counts counts
	if(previous != -1) {
		num_transitions[previous][new_class] += 1;
	}
	if(future != -1) {
		num_transitions[new_class][future] += 1;
	}
	if(new_class == 0) {
		// Add word to the topic counts
		num_words_in_document_assigned_to_topic[old_topic] += 1;
		num_same_words_assigned_to_topic[word][old_topic] += 1;
		num_words_assigned_to_topic[old_topic] += 1;
	}
	// Add word to the new class counts
	num_same_words_assigned_to_class[word][new_class] += 1;
	num_words_assigned_to_class[new_class] += 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2d0, %rsp            # imm = 0x2D0
movl 0x10(%rbp), %eax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movl %r9d, -0x2c(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x1b8(%rbp)
movq -0x20(%rbp), %rdi
movslq -0x2c(%rbp), %rsi
callq 0x8f60
movl (%rax), %eax
movl %eax, -0x30(%rbp)
movq -0x18(%rbp), %rdi
movslq -0x2c(%rbp), %rsi
callq 0x8f60
movl (%rax), %eax
movl %eax, -0x34(%rbp)
movq -0x10(%rbp), %rdi
movslq -0x2c(%rbp), %rsi
callq 0x8f60
movq -0x1b8(%rbp), %rcx
movl (%rax), %eax
movl %eax, -0x38(%rbp)
movl -0x38(%rbp), %eax
cmpl 0x8(%rcx), %eax
je 0x73f5
movq -0x1b8(%rbp), %rcx
movl -0x38(%rbp), %eax
cmpl 0xc(%rcx), %eax
jne 0x73fa
jmp 0x8130
movl $0xffffffff, -0x3c(%rbp) # imm = 0xFFFFFFFF
cmpl $0x0, -0x2c(%rbp)
jle 0x741e
movq -0x20(%rbp), %rdi
movl -0x2c(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rsi
callq 0x8f60
movl (%rax), %eax
movl %eax, -0x3c(%rbp)
movl $0xffffffff, -0x40(%rbp) # imm = 0xFFFFFFFF
movl -0x2c(%rbp), %eax
movl 0x10(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x7449
movq -0x20(%rbp), %rdi
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rsi
callq 0x8f60
movl (%rax), %eax
movl %eax, -0x40(%rbp)
cmpl $-0x1, -0x3c(%rbp)
je 0x7479
movq -0x1b8(%rbp), %rdi
addq $0x138, %rdi            # imm = 0x138
movslq -0x3c(%rbp), %rsi
callq 0x8c10
movq %rax, %rdi
movslq -0x30(%rbp), %rsi
callq 0x8f60
movl (%rax), %ecx
addl $-0x1, %ecx
movl %ecx, (%rax)
cmpl $-0x1, -0x40(%rbp)
je 0x74a9
movq -0x1b8(%rbp), %rdi
addq $0x138, %rdi            # imm = 0x138
movslq -0x30(%rbp), %rsi
callq 0x8c10
movq %rax, %rdi
movslq -0x40(%rbp), %rsi
callq 0x8f60
movl (%rax), %ecx
addl $-0x1, %ecx
movl %ecx, (%rax)
cmpl $0x0, -0x30(%rbp)
jne 0x750b
movq -0x1b8(%rbp), %rdi
addq $0x108, %rdi            # imm = 0x108
movslq -0x38(%rbp), %rsi
callq 0x8c10
movq %rax, %rdi
movslq -0x34(%rbp), %rsi
callq 0x8f60
movq -0x1b8(%rbp), %rdi
movl (%rax), %ecx
addl $-0x1, %ecx
movl %ecx, (%rax)
addq $0x150, %rdi            # imm = 0x150
movslq -0x34(%rbp), %rsi
callq 0x8f60
movl (%rax), %ecx
addl $-0x1, %ecx
movl %ecx, (%rax)
movq -0x28(%rbp), %rdi
movslq -0x34(%rbp), %rsi
callq 0x8f60
movl (%rax), %ecx
addl $-0x1, %ecx
movl %ecx, (%rax)
movq -0x1b8(%rbp), %rdi
addq $0x120, %rdi            # imm = 0x120
movslq -0x38(%rbp), %rsi
callq 0x8c10
movq %rax, %rdi
movslq -0x30(%rbp), %rsi
callq 0x8f60
movq -0x1b8(%rbp), %rdi
movl (%rax), %ecx
decl %ecx
movl %ecx, (%rax)
addq $0x168, %rdi            # imm = 0x168
movslq -0x30(%rbp), %rsi
callq 0x8f60
movq %rax, %rcx
movq -0x1b8(%rbp), %rax
movl (%rcx), %edx
decl %edx
movl %edx, (%rcx)
movslq 0x4(%rax), %rax
movq %rax, -0x1c8(%rbp)
movq $0x0, -0x60(%rbp)
leaq -0x61(%rbp), %rdi
movq %rdi, -0x1c0(%rbp)
callq 0x9100
movq -0x1c8(%rbp), %rsi
movq -0x1c0(%rbp), %rcx
leaq -0x58(%rbp), %rdi
leaq -0x60(%rbp), %rdx
callq 0x9120
jmp 0x759b
leaq -0x61(%rbp), %rdi
callq 0x91a0
cmpl $-0x1, -0x3c(%rbp)
je 0x7633
movl $0x0, -0x78(%rbp)
movq -0x1b8(%rbp), %rcx
movl -0x78(%rbp), %eax
cmpl 0x4(%rcx), %eax
jge 0x7631
movq -0x1b8(%rbp), %rdi
addq $0x138, %rdi            # imm = 0x138
movslq -0x3c(%rbp), %rsi
callq 0x8c10
movq %rax, %rdi
movslq -0x78(%rbp), %rsi
callq 0x8f60
cvtsi2sdl (%rax), %xmm0
movsd %xmm0, -0x1d0(%rbp)
movslq -0x78(%rbp), %rsi
leaq -0x58(%rbp), %rdi
callq 0x89a0
movsd -0x1d0(%rbp), %xmm0
movsd %xmm0, (%rax)
movl -0x78(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x78(%rbp)
jmp 0x75b5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0x61(%rbp), %rdi
callq 0x91a0
jmp 0x818a
jmp 0x7633
movl $0x0, -0x7c(%rbp)
movq -0x1b8(%rbp), %rcx
movl -0x7c(%rbp), %eax
cmpl 0x4(%rcx), %eax
jge 0x7685
movq -0x1b8(%rbp), %rax
movsd 0x28(%rax), %xmm0
movsd %xmm0, -0x1d8(%rbp)
movslq -0x7c(%rbp), %rsi
leaq -0x58(%rbp), %rdi
callq 0x89a0
movsd -0x1d8(%rbp), %xmm0
addsd (%rax), %xmm0
movsd %xmm0, (%rax)
movl -0x7c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x7c(%rbp)
jmp 0x763a
movq -0x1b8(%rbp), %rax
movslq 0x4(%rax), %rax
movq %rax, -0x1e8(%rbp)
movq $0x0, -0xa0(%rbp)
leaq -0xa1(%rbp), %rdi
movq %rdi, -0x1e0(%rbp)
callq 0x9100
movq -0x1e8(%rbp), %rsi
movq -0x1e0(%rbp), %rcx
leaq -0x98(%rbp), %rdi
leaq -0xa0(%rbp), %rdx
callq 0x9120
jmp 0x76d8
leaq -0xa1(%rbp), %rdi
callq 0x91a0
cmpl $-0x1, -0x40(%rbp)
je 0x778b
movl $0x0, -0xa8(%rbp)
movq -0x1b8(%rbp), %rcx
movl -0xa8(%rbp), %eax
cmpl 0x4(%rcx), %eax
jge 0x7789
movq -0x1b8(%rbp), %rdi
addq $0x138, %rdi            # imm = 0x138
movslq -0xa8(%rbp), %rsi
callq 0x8c10
movq %rax, %rdi
movslq -0x40(%rbp), %rsi
callq 0x8f60
cvtsi2sdl (%rax), %xmm0
movsd %xmm0, -0x1f0(%rbp)
movslq -0xa8(%rbp), %rsi
leaq -0x98(%rbp), %rdi
callq 0x89a0
movsd -0x1f0(%rbp), %xmm0
movsd %xmm0, (%rax)
movl -0xa8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa8(%rbp)
jmp 0x76f8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0xa1(%rbp), %rdi
callq 0x91a0
jmp 0x8181
jmp 0x778b
movl $0x0, -0xac(%rbp)
movq -0x1b8(%rbp), %rcx
movl -0xac(%rbp), %eax
cmpl 0x4(%rcx), %eax
jge 0x77ef
movq -0x1b8(%rbp), %rax
movsd 0x28(%rax), %xmm0
movsd %xmm0, -0x1f8(%rbp)
movslq -0xac(%rbp), %rsi
leaq -0x98(%rbp), %rdi
callq 0x89a0
movsd -0x1f8(%rbp), %xmm0
addsd (%rax), %xmm0
movsd %xmm0, (%rax)
movl -0xac(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xac(%rbp)
jmp 0x7795
cmpl $-0x1, -0x3c(%rbp)
je 0x7823
cmpl $-0x1, -0x40(%rbp)
je 0x7823
movl -0x3c(%rbp), %eax
cmpl -0x40(%rbp), %eax
jne 0x7823
movslq -0x3c(%rbp), %rsi
leaq -0x98(%rbp), %rdi
callq 0x89a0
movsd 0xa7ed(%rip), %xmm0     # 0x12008
addsd (%rax), %xmm0
movsd %xmm0, (%rax)
movq -0x1b8(%rbp), %rax
movslq 0x4(%rax), %rax
movq %rax, -0x208(%rbp)
movq $0x0, -0xd0(%rbp)
leaq -0xd1(%rbp), %rdi
movq %rdi, -0x200(%rbp)
callq 0x9100
movq -0x208(%rbp), %rsi
movq -0x200(%rbp), %rcx
leaq -0xc8(%rbp), %rdi
leaq -0xd0(%rbp), %rdx
callq 0x9120
jmp 0x7876
leaq -0xd1(%rbp), %rdi
callq 0x91a0
movl $0x0, -0xd8(%rbp)
movq -0x1b8(%rbp), %rcx
movl -0xd8(%rbp), %eax
cmpl 0x4(%rcx), %eax
jge 0x7935
movslq -0xd8(%rbp), %rsi
leaq -0x58(%rbp), %rdi
callq 0x89a0
movsd (%rax), %xmm0
movsd %xmm0, -0x218(%rbp)
movslq -0xd8(%rbp), %rsi
leaq -0x98(%rbp), %rdi
callq 0x89a0
movsd -0x218(%rbp), %xmm0
mulsd (%rax), %xmm0
movsd %xmm0, -0x210(%rbp)
movslq -0xd8(%rbp), %rsi
leaq -0xc8(%rbp), %rdi
callq 0x89a0
movsd -0x210(%rbp), %xmm0
movsd %xmm0, (%rax)
movl -0xd8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xd8(%rbp)
jmp 0x788c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0xd1(%rbp), %rdi
callq 0x91a0
jmp 0x8175
movq -0x1b8(%rbp), %rdi
addq $0x168, %rdi            # imm = 0x168
movq %rdi, -0x228(%rbp)
callq 0x91c0
movq -0x228(%rbp), %rdi
movq %rax, -0xf8(%rbp)
callq 0x91f0
movq %rax, -0x100(%rbp)
leaq -0x101(%rbp), %rdi
movq %rdi, -0x220(%rbp)
callq 0x9100
movq -0x220(%rbp), %rcx
movq -0xf8(%rbp), %rsi
movq -0x100(%rbp), %rdx
leaq -0xf0(%rbp), %rdi
callq 0x9220
jmp 0x799f
leaq -0x101(%rbp), %rdi
callq 0x91a0
cmpl $-0x1, -0x3c(%rbp)
je 0x79f0
movslq -0x3c(%rbp), %rsi
leaq -0xf0(%rbp), %rdi
callq 0x89a0
movsd 0xa63f(%rip), %xmm0     # 0x12008
addsd (%rax), %xmm0
movsd %xmm0, (%rax)
jmp 0x79f0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0x101(%rbp), %rdi
callq 0x91a0
jmp 0x8169
movl $0x0, -0x108(%rbp)
movq -0x1b8(%rbp), %rcx
movl -0x108(%rbp), %eax
cmpl 0x4(%rcx), %eax
jge 0x7a71
movq -0x1b8(%rbp), %rax
cvtsi2sdl 0x4(%rax), %xmm0
movsd %xmm0, -0x238(%rbp)
movsd 0x28(%rax), %xmm0
movsd %xmm0, -0x230(%rbp)
movslq -0x108(%rbp), %rsi
leaq -0xf0(%rbp), %rdi
callq 0x89a0
movsd -0x238(%rbp), %xmm0
movsd -0x230(%rbp), %xmm2
movsd (%rax), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, (%rax)
movl -0x108(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x108(%rbp)
jmp 0x79fa
movq -0x1b8(%rbp), %rdi
addq $0x120, %rdi            # imm = 0x120
movq %rdi, -0x248(%rbp)
movslq -0x38(%rbp), %rsi
callq 0x8c10
movq %rax, %rdi
callq 0x91c0
movq -0x248(%rbp), %rdi
movq %rax, -0x128(%rbp)
movslq -0x38(%rbp), %rsi
callq 0x8c10
movq %rax, %rdi
callq 0x91f0
movq %rax, -0x130(%rbp)
leaq -0x131(%rbp), %rdi
movq %rdi, -0x240(%rbp)
callq 0x9100
movq -0x240(%rbp), %rcx
movq -0x128(%rbp), %rsi
movq -0x130(%rbp), %rdx
leaq -0x120(%rbp), %rdi
callq 0x9220
jmp 0x7af3
leaq -0x131(%rbp), %rdi
callq 0x91a0
movq -0x1b8(%rbp), %rdi
addq $0x108, %rdi            # imm = 0x108
movslq -0x38(%rbp), %rsi
callq 0x8c10
movq %rax, %rdi
movslq -0x34(%rbp), %rsi
callq 0x8f60
cvtsi2sdl (%rax), %xmm0
movsd %xmm0, -0x250(%rbp)
leaq -0x120(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x89a0
movsd -0x250(%rbp), %xmm0
movsd %xmm0, (%rax)
movl $0x0, -0x138(%rbp)
movq -0x1b8(%rbp), %rcx
movl -0x138(%rbp), %eax
cmpl 0x4(%rcx), %eax
jge 0x7c13
cmpl $0x0, -0x138(%rbp)
jne 0x7bc6
movq -0x1b8(%rbp), %rax
movsd 0x20(%rax), %xmm0
movsd %xmm0, -0x258(%rbp)
leaq -0x120(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x89a0
movsd -0x258(%rbp), %xmm0
addsd (%rax), %xmm0
movsd %xmm0, (%rax)
jmp 0x7bfd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0x131(%rbp), %rdi
callq 0x91a0
jmp 0x815d
movq -0x1b8(%rbp), %rax
movsd 0x30(%rax), %xmm0
movsd %xmm0, -0x260(%rbp)
movslq -0x138(%rbp), %rsi
leaq -0x120(%rbp), %rdi
callq 0x89a0
movsd -0x260(%rbp), %xmm0
addsd (%rax), %xmm0
movsd %xmm0, (%rax)
jmp 0x7bff
movl -0x138(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x138(%rbp)
jmp 0x7b54
movq -0x1b8(%rbp), %rdi
addq $0x168, %rdi            # imm = 0x168
movq %rdi, -0x270(%rbp)
callq 0x91c0
movq -0x270(%rbp), %rdi
movq %rax, -0x158(%rbp)
callq 0x91f0
movq %rax, -0x160(%rbp)
leaq -0x161(%rbp), %rdi
movq %rdi, -0x268(%rbp)
callq 0x9100
movq -0x268(%rbp), %rcx
movq -0x158(%rbp), %rsi
movq -0x160(%rbp), %rdx
leaq -0x150(%rbp), %rdi
callq 0x9220
jmp 0x7c7d
leaq -0x161(%rbp), %rdi
callq 0x91a0
movq -0x1b8(%rbp), %rdi
addq $0x150, %rdi            # imm = 0x150
movslq -0x34(%rbp), %rsi
callq 0x8f60
cvtsi2sdl (%rax), %xmm0
movsd %xmm0, -0x278(%rbp)
leaq -0x150(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x89a0
movsd -0x278(%rbp), %xmm0
movsd %xmm0, (%rax)
movl $0x0, -0x168(%rbp)
movq -0x1b8(%rbp), %rcx
movl -0x168(%rbp), %eax
cmpl 0x4(%rcx), %eax
jge 0x7dd1
cmpl $0x0, -0x168(%rbp)
jne 0x7d64
movq -0x1b8(%rbp), %rax
movsd 0x20(%rax), %xmm0
movsd %xmm0, -0x288(%rbp)
cvtsi2sdl 0xa0(%rax), %xmm0
movsd %xmm0, -0x280(%rbp)
leaq -0x150(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x89a0
movsd -0x288(%rbp), %xmm0
movsd -0x280(%rbp), %xmm2
movsd (%rax), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, (%rax)
jmp 0x7dbb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0x161(%rbp), %rdi
callq 0x91a0
jmp 0x8151
movq -0x1b8(%rbp), %rax
movsd 0x30(%rax), %xmm0
movsd %xmm0, -0x298(%rbp)
cvtsi2sdl 0xa0(%rax), %xmm0
movsd %xmm0, -0x290(%rbp)
movslq -0x168(%rbp), %rsi
leaq -0x150(%rbp), %rdi
callq 0x89a0
movsd -0x298(%rbp), %xmm0
movsd -0x290(%rbp), %xmm2
movsd (%rax), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, (%rax)
jmp 0x7dbd
movl -0x168(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x168(%rbp)
jmp 0x7cd2
movq -0x1b8(%rbp), %rax
movslq 0x4(%rax), %rax
movq %rax, -0x2a8(%rbp)
movq $0x0, -0x188(%rbp)
leaq -0x189(%rbp), %rdi
movq %rdi, -0x2a0(%rbp)
callq 0x9100
movq -0x2a8(%rbp), %rsi
movq -0x2a0(%rbp), %rcx
leaq -0x180(%rbp), %rdi
leaq -0x188(%rbp), %rdx
callq 0x9120
jmp 0x7e24
leaq -0x189(%rbp), %rdi
callq 0x91a0
movl $0x0, -0x190(%rbp)
movq -0x1b8(%rbp), %rcx
movl -0x190(%rbp), %eax
cmpl 0x4(%rcx), %eax
jge 0x7f34
movslq -0x190(%rbp), %rsi
leaq -0x120(%rbp), %rdi
callq 0x89a0
movsd (%rax), %xmm0
movsd %xmm0, -0x2c8(%rbp)
movslq -0x190(%rbp), %rsi
leaq -0x150(%rbp), %rdi
callq 0x89a0
movsd -0x2c8(%rbp), %xmm0
divsd (%rax), %xmm0
movsd %xmm0, -0x2c0(%rbp)
movslq -0x190(%rbp), %rsi
leaq -0xc8(%rbp), %rdi
callq 0x89a0
movsd -0x2c0(%rbp), %xmm0
mulsd (%rax), %xmm0
movsd %xmm0, -0x2b8(%rbp)
movslq -0x190(%rbp), %rsi
leaq -0xf0(%rbp), %rdi
callq 0x89a0
movsd -0x2b8(%rbp), %xmm0
divsd (%rax), %xmm0
movsd %xmm0, -0x2b0(%rbp)
movslq -0x190(%rbp), %rsi
leaq -0x180(%rbp), %rdi
callq 0x89a0
movsd -0x2b0(%rbp), %xmm0
movsd %xmm0, (%rax)
movl -0x190(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x190(%rbp)
jmp 0x7e3a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0x189(%rbp), %rdi
callq 0x91a0
jmp 0x8145
leaq -0x1b0(%rbp), %rdi
leaq -0x180(%rbp), %rsi
callq 0x92a0
jmp 0x7f49
leaq -0x1b0(%rbp), %rdi
callq 0x3680
movl %eax, -0x2cc(%rbp)
jmp 0x7f5d
leaq -0x1b0(%rbp), %rdi
callq 0x9390
movl -0x2cc(%rbp), %eax
movl %eax, -0x194(%rbp)
movl -0x194(%rbp), %eax
movl %eax, -0x2d0(%rbp)
movq -0x20(%rbp), %rdi
movslq -0x2c(%rbp), %rsi
callq 0x8f60
movl -0x2d0(%rbp), %ecx
movl %ecx, (%rax)
cmpl $-0x1, -0x3c(%rbp)
je 0x7ff9
movq -0x1b8(%rbp), %rdi
addq $0x138, %rdi            # imm = 0x138
movslq -0x3c(%rbp), %rsi
callq 0x8c10
movq %rax, %rdi
movslq -0x194(%rbp), %rsi
callq 0x8f60
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
jmp 0x7ff9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0x8139
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0x1b0(%rbp), %rdi
callq 0x9390
jmp 0x8139
cmpl $-0x1, -0x40(%rbp)
je 0x802c
movq -0x1b8(%rbp), %rdi
addq $0x138, %rdi            # imm = 0x138
movslq -0x194(%rbp), %rsi
callq 0x8c10
movq %rax, %rdi
movslq -0x40(%rbp), %rsi
callq 0x8f60
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
cmpl $0x0, -0x194(%rbp)
jne 0x8091
movq -0x28(%rbp), %rdi
movslq -0x34(%rbp), %rsi
callq 0x8f60
movq -0x1b8(%rbp), %rdi
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
addq $0x108, %rdi            # imm = 0x108
movslq -0x38(%rbp), %rsi
callq 0x8c10
movq %rax, %rdi
movslq -0x34(%rbp), %rsi
callq 0x8f60
movq -0x1b8(%rbp), %rdi
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
addq $0x150, %rdi            # imm = 0x150
movslq -0x34(%rbp), %rsi
callq 0x8f60
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movq -0x1b8(%rbp), %rdi
addq $0x120, %rdi            # imm = 0x120
movslq -0x38(%rbp), %rsi
callq 0x8c10
movq %rax, %rdi
movslq -0x194(%rbp), %rsi
callq 0x8f60
movq -0x1b8(%rbp), %rdi
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
addq $0x168, %rdi            # imm = 0x168
movslq -0x194(%rbp), %rsi
callq 0x8f60
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
leaq -0x180(%rbp), %rdi
callq 0x9390
leaq -0x150(%rbp), %rdi
callq 0x9390
leaq -0x120(%rbp), %rdi
callq 0x9390
leaq -0xf0(%rbp), %rdi
callq 0x9390
leaq -0xc8(%rbp), %rdi
callq 0x9390
leaq -0x98(%rbp), %rdi
callq 0x9390
leaq -0x58(%rbp), %rdi
callq 0x9390
addq $0x2d0, %rsp            # imm = 0x2D0
popq %rbp
retq
leaq -0x180(%rbp), %rdi
callq 0x9390
leaq -0x150(%rbp), %rdi
callq 0x9390
leaq -0x120(%rbp), %rdi
callq 0x9390
leaq -0xf0(%rbp), %rdi
callq 0x9390
leaq -0xc8(%rbp), %rdi
callq 0x9390
leaq -0x98(%rbp), %rdi
callq 0x9390
leaq -0x58(%rbp), %rdi
callq 0x9390
movq -0x70(%rbp), %rdi
callq 0x3400
nopw %cs:(%rax,%rax)