// File: big-data-lab-team[P]OrpailleCC/./src/mondrian_coarse.hpp
// Function: CoarseMondrianForest<double, funct, KappaMetrics<2, false>, 4, 2, 6000>::extend_block2(int, int, double const*, int)
void extend_block2(int const node_id, int const tree_id, feature_type const* features, int const label){
	//e_lower and e_upper are used to compute probabilities
	feature_type e_lower[feature_count], e_upper[feature_count];
	double probabilities[feature_count];
	Node& node = nodes()[node_id];
	int const parent_id = node.parent;
	double const parent_tau = node.parent >= 0 ? nodes()[node.parent].tau : 0; //The tau value of the parent of the root is 0
	//sum is used as a parameter to pick random numbers following exponential law
	feature_type sum = 0;
	//compute e_lower, e_upper and sum
	for(int i = 0; i < feature_count; ++i){
		e_lower[i] = node.bound_lower[i] - features[i] > 0 ? node.bound_lower[i] - features[i] : 0;
		e_upper[i] = features[i] - node.bound_upper[i] > 0 ? features[i] - node.bound_upper[i] : 0;
		probabilities[i] = e_lower[i] + e_upper[i];
		sum += e_lower[i] + e_upper[i];
	}
	//Pick a random number following an exponential law of parameter *sum* (except if sum is 0)
	double const E = sum == 0 ?  -1 : Utils::rand_exponential<func>(sum);
	bool update_box = false;

	bool pause_expension = false;
	if((tree_management == COBBLE_MANAGEMENT || tree_management == OPTIMISTIC_COBBLE_MANAGEMENT)){
		int const remaining_depth = node_depth(node_id, nullptr);
		int const distance_to_root = unravel(node_id);
		pause_expension = remaining_depth + distance_to_root + 1 > tree_bases()[tree_id].node_count_limit;
	}
	else{
		pause_expension = tree_bases()[tree_id].is_paused(tree_management);
	}

	if(E >= 0 && parent_tau + E < node.tau && node_available >= 2 && !pause_expension){//Introduce a new parent and a new sibling
		Utils::turn_array_into_probability(probabilities, feature_count, sum);
		//sample features with probability proportional to e_lower[i] + e_upper[i]
		int const dimension = Utils::pick_from_distribution<func>(probabilities, feature_count);

		//Select the bound to choose the split from
		double lower_value, upper_value;
		if(features[dimension] > node.bound_upper[dimension]){
			lower_value = node.bound_upper[dimension];
			upper_value = features[dimension];
		}
		else if(features[dimension] < node.bound_lower[dimension]){
			lower_value = features[dimension];
			upper_value = node.bound_lower[dimension];
		}

		//sample the split between [lower_value, upper_value]
		double const split_value = func::rand_uniform()*(upper_value - lower_value) + lower_value;
		int new_parent, new_sibling;
		//insert new node above the current one
		new_parent = available_node();
		nodes()[new_parent].split_dimension = dimension;
		nodes()[new_parent].split_value = split_value;
		nodes()[new_parent].tau = parent_tau + E;
		//insert new leaf, sibbling of the current one
		new_sibling = available_node();
		node_available -= 2;

		//Update the box of the new parent
		for(int i = 0; i < feature_count; ++i){
			nodes()[new_parent].bound_lower[i] = features[i] < node.bound_lower[i] ? features[i] : node.bound_lower[i];
			nodes()[new_parent].bound_upper[i] = features[i] > node.bound_upper[i] ? features[i] : node.bound_upper[i];
		}
		//NOTE Creates counters for the label of the new parent
		//for(int i = 0; i < label_count; ++i)
		//nodes[new_parent].counters[i] = node.counters[i];
		//nodes[new_parent].counters[label] += 1;

		//Creates counters for the label of the new sibling
		for(int i = 0; i < label_count; ++i)
			nodes()[new_sibling].counters[i] = 0;
		//No need to increase the counter for the current label because we will call sample_block soon on new_sibling

		//Make the connections between the new nodes
		nodes()[new_parent].parent = node.parent;
		if(!node.has_parent() && node_id == tree_bases()[tree_id].root)//We introduce a parent to the root
			tree_bases()[tree_id].root = new_parent;
		else{
			Node& parent = nodes()[node.parent];
			if(parent.child_left == node_id)
				parent.child_left = new_parent;
			else
				parent.child_right = new_parent;
		}


		node.parent = new_parent;

		nodes()[new_sibling].parent = new_parent;
		if(features[dimension] == upper_value){ //right
			nodes()[new_parent].child_right = new_sibling;
			nodes()[new_parent].child_left = node_id;
		}
		else{ //left
			nodes()[new_parent].child_left = new_sibling;
			nodes()[new_parent].child_right = node_id;
		}

		sample_block(new_sibling, features, label);
	}
	else if(E < 0 || parent_tau + E > node.tau){ //Otherwise, just update the box
		//update lower bound and upper bound of this node
		for(int i = 0; i < feature_count; ++i){
			if(node.bound_lower[i] > features[i])
				node.bound_lower[i] = features[i];
			if(node.bound_upper[i] < features[i])
				node.bound_upper[i] = features[i];
		}
		//if not leaf, recurse on the node that contains the data point
		if(!node.is_leaf()){
			if(features[node.split_dimension] <= node.split_value)
				extend_block2(node.child_left, tree_id, features, label);
			else if(features[node.split_dimension] > node.split_value)
				extend_block2(node.child_right, tree_id, features, label);
			//NOTE: we don't update the counters of labels here because the counting will be done when prediction is required.
			//We can optimize that.
		}
		else{
			//Update the counter of label
			node.counters[label] += 1;
			node.fading_score += 1; //fading_score is decreased later
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x180, %rsp            # imm = 0x180
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq %rcx, -0x18(%rbp)
movl %r8d, -0x1c(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x100(%rbp)
callq 0x1b00
movslq -0xc(%rbp), %rcx
shlq $0x7, %rcx
addq %rcx, %rax
movq %rax, -0x88(%rbp)
movq -0x88(%rbp), %rax
movl 0x58(%rax), %eax
movl %eax, -0x8c(%rbp)
movq -0x88(%rbp), %rax
cmpl $0x0, 0x58(%rax)
jl 0x46a9
movq -0x100(%rbp), %rdi
callq 0x1b00
movq -0x88(%rbp), %rcx
movslq 0x58(%rcx), %rcx
shlq $0x7, %rcx
addq %rcx, %rax
movsd 0x60(%rax), %xmm0
movsd %xmm0, -0x108(%rbp)
jmp 0x46b6
xorps %xmm0, %xmm0
movsd %xmm0, -0x108(%rbp)
jmp 0x46b6
movsd -0x108(%rbp), %xmm0
movsd %xmm0, -0x98(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0xa0(%rbp)
movl $0x0, -0xa4(%rbp)
cmpl $0x4, -0xa4(%rbp)
jge 0x4847
movq -0x88(%rbp), %rax
movslq -0xa4(%rbp), %rcx
movsd 0x10(%rax,%rcx,8), %xmm0
movq -0x18(%rbp), %rax
movslq -0xa4(%rbp), %rcx
subsd (%rax,%rcx,8), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x4743
movq -0x88(%rbp), %rax
movslq -0xa4(%rbp), %rcx
movsd 0x10(%rax,%rcx,8), %xmm0
movq -0x18(%rbp), %rax
movslq -0xa4(%rbp), %rcx
subsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x110(%rbp)
jmp 0x4750
xorps %xmm0, %xmm0
movsd %xmm0, -0x110(%rbp)
jmp 0x4750
movsd -0x110(%rbp), %xmm0
movslq -0xa4(%rbp), %rax
movsd %xmm0, -0x40(%rbp,%rax,8)
movq -0x18(%rbp), %rax
movslq -0xa4(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x88(%rbp), %rax
movslq -0xa4(%rbp), %rcx
subsd 0x30(%rax,%rcx,8), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x47c0
movq -0x18(%rbp), %rax
movslq -0xa4(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x88(%rbp), %rax
movslq -0xa4(%rbp), %rcx
subsd 0x30(%rax,%rcx,8), %xmm0
movsd %xmm0, -0x118(%rbp)
jmp 0x47cd
xorps %xmm0, %xmm0
movsd %xmm0, -0x118(%rbp)
jmp 0x47cd
movsd -0x118(%rbp), %xmm0
movslq -0xa4(%rbp), %rax
movsd %xmm0, -0x60(%rbp,%rax,8)
movslq -0xa4(%rbp), %rax
movsd -0x40(%rbp,%rax,8), %xmm0
movslq -0xa4(%rbp), %rax
addsd -0x60(%rbp,%rax,8), %xmm0
movslq -0xa4(%rbp), %rax
movsd %xmm0, -0x80(%rbp,%rax,8)
movslq -0xa4(%rbp), %rax
movsd -0x40(%rbp,%rax,8), %xmm0
movslq -0xa4(%rbp), %rax
addsd -0x60(%rbp,%rax,8), %xmm0
addsd -0xa0(%rbp), %xmm0
movsd %xmm0, -0xa0(%rbp)
movl -0xa4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa4(%rbp)
jmp 0x46db
movsd -0xa0(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x486c
jp 0x486c
movsd 0x67c6(%rip), %xmm0     # 0xb028
movsd %xmm0, -0x120(%rbp)
jmp 0x4881
movsd -0xa0(%rbp), %xmm0
callq 0x70e0
movsd %xmm0, -0x120(%rbp)
movq -0x100(%rbp), %rax
movsd -0x120(%rbp), %xmm0
movsd %xmm0, -0xb0(%rbp)
movb $0x0, -0xb1(%rbp)
movb $0x0, -0xb2(%rbp)
cmpl $0x0, (%rax)
je 0x48b7
movq -0x100(%rbp), %rax
cmpl $0x1, (%rax)
jne 0x4929
movq -0x100(%rbp), %rdi
movl -0xc(%rbp), %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x7130
movq -0x100(%rbp), %rdi
movl %eax, -0xb8(%rbp)
movl -0xc(%rbp), %esi
callq 0x7390
movq -0x100(%rbp), %rdi
movl %eax, -0xbc(%rbp)
movl -0xb8(%rbp), %eax
addl -0xbc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x124(%rbp)
callq 0x1a50
movq %rax, %rcx
movl -0x124(%rbp), %eax
movslq -0x10(%rbp), %rdx
imulq $0x38, %rdx, %rdx
addq %rdx, %rcx
cmpl (%rcx), %eax
setg %al
andb $0x1, %al
movb %al, -0xb2(%rbp)
jmp 0x4959
movq -0x100(%rbp), %rdi
callq 0x1a50
movq %rax, %rdi
movq -0x100(%rbp), %rax
movslq -0x10(%rbp), %rcx
imulq $0x38, %rcx, %rcx
addq %rcx, %rdi
movl (%rax), %esi
callq 0x7420
andb $0x1, %al
movb %al, -0xb2(%rbp)
movsd -0xb0(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x4f82
movsd -0x98(%rbp), %xmm1
addsd -0xb0(%rbp), %xmm1
movq -0x88(%rbp), %rax
movsd 0x60(%rax), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x4f82
movq -0x100(%rbp), %rax
cmpl $0x2, 0x17d8(%rax)
jl 0x4f82
testb $0x1, -0xb2(%rbp)
jne 0x4f82
leaq -0x80(%rbp), %rdi
movsd -0xa0(%rbp), %xmm0
movl $0x4, %esi
callq 0x7480
leaq -0x80(%rbp), %rdi
movl $0x4, %esi
callq 0x7540
movl %eax, -0xc0(%rbp)
movq -0x18(%rbp), %rax
movslq -0xc0(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x88(%rbp), %rax
movslq -0xc0(%rbp), %rcx
ucomisd 0x30(%rax,%rcx,8), %xmm0
jbe 0x4a3b
movq -0x88(%rbp), %rax
movslq -0xc0(%rbp), %rcx
movsd 0x30(%rax,%rcx,8), %xmm0
movsd %xmm0, -0xc8(%rbp)
movq -0x18(%rbp), %rax
movslq -0xc0(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0xd0(%rbp)
jmp 0x4a9b
movq -0x18(%rbp), %rax
movslq -0xc0(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm1
movq -0x88(%rbp), %rax
movslq -0xc0(%rbp), %rcx
movsd 0x10(%rax,%rcx,8), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x4a99
movq -0x18(%rbp), %rax
movslq -0xc0(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0xc8(%rbp)
movq -0x88(%rbp), %rax
movslq -0xc0(%rbp), %rcx
movsd 0x10(%rax,%rcx,8), %xmm0
movsd %xmm0, -0xd0(%rbp)
jmp 0x4a9b
callq 0x35a0
movq -0x100(%rbp), %rdi
movsd -0xd0(%rbp), %xmm2
subsd -0xc8(%rbp), %xmm2
movsd -0xc8(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0xd8(%rbp)
callq 0x3860
movq -0x100(%rbp), %rdi
movl %eax, -0xdc(%rbp)
movl -0xc0(%rbp), %eax
movl %eax, -0x13c(%rbp)
callq 0x1b00
movl -0x13c(%rbp), %ecx
movq -0x100(%rbp), %rdi
movslq -0xdc(%rbp), %rdx
shlq $0x7, %rdx
addq %rdx, %rax
movl %ecx, (%rax)
movsd -0xd8(%rbp), %xmm0
movsd %xmm0, -0x138(%rbp)
callq 0x1b00
movsd -0x138(%rbp), %xmm0
movq -0x100(%rbp), %rdi
movslq -0xdc(%rbp), %rcx
shlq $0x7, %rcx
addq %rcx, %rax
movsd %xmm0, 0x8(%rax)
movsd -0x98(%rbp), %xmm0
addsd -0xb0(%rbp), %xmm0
movsd %xmm0, -0x130(%rbp)
callq 0x1b00
movsd -0x130(%rbp), %xmm0
movq -0x100(%rbp), %rdi
movslq -0xdc(%rbp), %rcx
shlq $0x7, %rcx
addq %rcx, %rax
movsd %xmm0, 0x60(%rax)
callq 0x3860
movl %eax, %ecx
movq -0x100(%rbp), %rax
movl %ecx, -0xe0(%rbp)
movl 0x17d8(%rax), %ecx
subl $0x2, %ecx
movl %ecx, 0x17d8(%rax)
movl $0x0, -0xe4(%rbp)
cmpl $0x4, -0xe4(%rbp)
jge 0x4d0d
movq -0x18(%rbp), %rax
movslq -0xe4(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm1
movq -0x88(%rbp), %rax
movslq -0xe4(%rbp), %rcx
movsd 0x10(%rax,%rcx,8), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x4c03
movq -0x18(%rbp), %rax
movslq -0xe4(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x148(%rbp)
jmp 0x4c1f
movq -0x88(%rbp), %rax
movslq -0xe4(%rbp), %rcx
movsd 0x10(%rax,%rcx,8), %xmm0
movsd %xmm0, -0x148(%rbp)
movq -0x100(%rbp), %rdi
movsd -0x148(%rbp), %xmm0
movsd %xmm0, -0x150(%rbp)
callq 0x1b00
movsd -0x150(%rbp), %xmm0
movslq -0xdc(%rbp), %rcx
shlq $0x7, %rcx
addq %rcx, %rax
movslq -0xe4(%rbp), %rcx
movsd %xmm0, 0x10(%rax,%rcx,8)
movq -0x18(%rbp), %rax
movslq -0xe4(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x88(%rbp), %rax
movslq -0xe4(%rbp), %rcx
ucomisd 0x30(%rax,%rcx,8), %xmm0
jbe 0x4c9e
movq -0x18(%rbp), %rax
movslq -0xe4(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x158(%rbp)
jmp 0x4cba
movq -0x88(%rbp), %rax
movslq -0xe4(%rbp), %rcx
movsd 0x30(%rax,%rcx,8), %xmm0
movsd %xmm0, -0x158(%rbp)
movq -0x100(%rbp), %rdi
movsd -0x158(%rbp), %xmm0
movsd %xmm0, -0x160(%rbp)
callq 0x1b00
movsd -0x160(%rbp), %xmm0
movslq -0xdc(%rbp), %rcx
shlq $0x7, %rcx
addq %rcx, %rax
movslq -0xe4(%rbp), %rcx
movsd %xmm0, 0x30(%rax,%rcx,8)
movl -0xe4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xe4(%rbp)
jmp 0x4bb2
movl $0x0, -0xe8(%rbp)
cmpl $0x2, -0xe8(%rbp)
jge 0x4d5a
movq -0x100(%rbp), %rdi
callq 0x1b00
movslq -0xe0(%rbp), %rcx
shlq $0x7, %rcx
addq %rcx, %rax
movslq -0xe8(%rbp), %rcx
movl $0x0, 0x68(%rax,%rcx,4)
movl -0xe8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xe8(%rbp)
jmp 0x4d17
movq -0x100(%rbp), %rdi
movq -0x88(%rbp), %rax
movl 0x58(%rax), %eax
movl %eax, -0x164(%rbp)
callq 0x1b00
movl -0x164(%rbp), %ecx
movslq -0xdc(%rbp), %rdx
shlq $0x7, %rdx
addq %rdx, %rax
movl %ecx, 0x58(%rax)
movq -0x88(%rbp), %rdi
callq 0x75b0
testb $0x1, %al
jne 0x4df9
movq -0x100(%rbp), %rdi
movl -0xc(%rbp), %eax
movl %eax, -0x168(%rbp)
callq 0x1a50
movq %rax, %rcx
movl -0x168(%rbp), %eax
movslq -0x10(%rbp), %rdx
imulq $0x38, %rdx, %rdx
addq %rdx, %rcx
cmpl 0x8(%rcx), %eax
jne 0x4df9
movq -0x100(%rbp), %rdi
movl -0xdc(%rbp), %eax
movl %eax, -0x16c(%rbp)
callq 0x1a50
movl -0x16c(%rbp), %ecx
movslq -0x10(%rbp), %rdx
imulq $0x38, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x8(%rax)
jmp 0x4e51
movq -0x100(%rbp), %rdi
callq 0x1b00
movq -0x88(%rbp), %rcx
movslq 0x58(%rcx), %rcx
shlq $0x7, %rcx
addq %rcx, %rax
movq %rax, -0xf0(%rbp)
movq -0xf0(%rbp), %rax
movl 0x50(%rax), %eax
cmpl -0xc(%rbp), %eax
jne 0x4e3f
movl -0xdc(%rbp), %ecx
movq -0xf0(%rbp), %rax
movl %ecx, 0x50(%rax)
jmp 0x4e4f
movl -0xdc(%rbp), %ecx
movq -0xf0(%rbp), %rax
movl %ecx, 0x54(%rax)
jmp 0x4e51
movq -0x100(%rbp), %rdi
movl -0xdc(%rbp), %ecx
movq -0x88(%rbp), %rax
movl %ecx, 0x58(%rax)
movl -0xdc(%rbp), %eax
movl %eax, -0x170(%rbp)
callq 0x1b00
movl -0x170(%rbp), %ecx
movslq -0xe0(%rbp), %rdx
shlq $0x7, %rdx
addq %rdx, %rax
movl %ecx, 0x58(%rax)
movq -0x18(%rbp), %rax
movslq -0xc0(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
ucomisd -0xd0(%rbp), %xmm0
jne 0x4f09
jp 0x4f09
movq -0x100(%rbp), %rdi
movl -0xe0(%rbp), %eax
movl %eax, -0x178(%rbp)
callq 0x1b00
movl -0x178(%rbp), %ecx
movq -0x100(%rbp), %rdi
movslq -0xdc(%rbp), %rdx
shlq $0x7, %rdx
addq %rdx, %rax
movl %ecx, 0x54(%rax)
movl -0xc(%rbp), %eax
movl %eax, -0x174(%rbp)
callq 0x1b00
movl -0x174(%rbp), %ecx
movslq -0xdc(%rbp), %rdx
shlq $0x7, %rdx
addq %rdx, %rax
movl %ecx, 0x50(%rax)
jmp 0x4f64
movq -0x100(%rbp), %rdi
movl -0xe0(%rbp), %eax
movl %eax, -0x180(%rbp)
callq 0x1b00
movl -0x180(%rbp), %ecx
movq -0x100(%rbp), %rdi
movslq -0xdc(%rbp), %rdx
shlq $0x7, %rdx
addq %rdx, %rax
movl %ecx, 0x50(%rax)
movl -0xc(%rbp), %eax
movl %eax, -0x17c(%rbp)
callq 0x1b00
movl -0x17c(%rbp), %ecx
movslq -0xdc(%rbp), %rdx
shlq $0x7, %rdx
addq %rdx, %rax
movl %ecx, 0x54(%rax)
movq -0x100(%rbp), %rdi
movl -0xe0(%rbp), %esi
movq -0x18(%rbp), %rdx
movl -0x1c(%rbp), %ecx
callq 0x3900
jmp 0x514b
xorps %xmm0, %xmm0
ucomisd -0xb0(%rbp), %xmm0
ja 0x4fb1
movsd -0x98(%rbp), %xmm0
addsd -0xb0(%rbp), %xmm0
movq -0x88(%rbp), %rax
ucomisd 0x60(%rax), %xmm0
jbe 0x5149
movl $0x0, -0xf4(%rbp)
cmpl $0x4, -0xf4(%rbp)
jge 0x5076
movq -0x88(%rbp), %rax
movslq -0xf4(%rbp), %rcx
movsd 0x10(%rax,%rcx,8), %xmm0
movq -0x18(%rbp), %rax
movslq -0xf4(%rbp), %rcx
ucomisd (%rax,%rcx,8), %xmm0
jbe 0x5012
movq -0x18(%rbp), %rax
movslq -0xf4(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x88(%rbp), %rax
movslq -0xf4(%rbp), %rcx
movsd %xmm0, 0x10(%rax,%rcx,8)
movq -0x88(%rbp), %rax
movslq -0xf4(%rbp), %rcx
movsd 0x30(%rax,%rcx,8), %xmm1
movq -0x18(%rbp), %rax
movslq -0xf4(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x5060
movq -0x18(%rbp), %rax
movslq -0xf4(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x88(%rbp), %rax
movslq -0xf4(%rbp), %rcx
movsd %xmm0, 0x30(%rax,%rcx,8)
jmp 0x5062
movl -0xf4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xf4(%rbp)
jmp 0x4fbb
movq -0x88(%rbp), %rdi
callq 0x29e0
testb $0x1, %al
jne 0x5118
movq -0x18(%rbp), %rax
movq -0x88(%rbp), %rcx
movslq (%rcx), %rcx
movsd (%rax,%rcx,8), %xmm1
movq -0x88(%rbp), %rax
movsd 0x8(%rax), %xmm0
ucomisd %xmm1, %xmm0
jb 0x50d2
movq -0x100(%rbp), %rdi
movq -0x88(%rbp), %rax
movl 0x50(%rax), %esi
movl -0x10(%rbp), %edx
movq -0x18(%rbp), %rcx
movl -0x1c(%rbp), %r8d
callq 0x4620
jmp 0x5116
movq -0x18(%rbp), %rax
movq -0x88(%rbp), %rcx
movslq (%rcx), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x88(%rbp), %rax
ucomisd 0x8(%rax), %xmm0
jbe 0x5114
movq -0x100(%rbp), %rdi
movq -0x88(%rbp), %rax
movl 0x54(%rax), %esi
movl -0x10(%rbp), %edx
movq -0x18(%rbp), %rcx
movl -0x1c(%rbp), %r8d
callq 0x4620
jmp 0x5116
jmp 0x5147
movq -0x88(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movl 0x68(%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, 0x68(%rax,%rcx,4)
movq -0x88(%rbp), %rax
movsd 0x5edb(%rip), %xmm0     # 0xb018
addsd 0x78(%rax), %xmm0
movsd %xmm0, 0x78(%rax)
jmp 0x5149
jmp 0x514b
addq $0x180, %rsp            # imm = 0x180
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop