// File: /workspace/github_cpp_makefile_star2_O2/fiveseven-lambda[P]michaelis-menten/a.cpp
// Function: main
int main(){
	display = XOpenDisplay(NULL);
	if(display == NULL){
		fputs("error: cannot connect to X server\n", stderr);
		return -1;
	}
	int screen = XDefaultScreen(display);
	Window root = XRootWindow(display, screen);
	width = XDisplayWidth(display, screen);
	height = XDisplayHeight(display, screen);
	unsigned long black = XBlackPixel(display, screen), white = XWhitePixel(display, screen);

	window = XCreateSimpleWindow(display, root, 0, 0, width, height, 1, black, white);

	int depth = XDefaultDepth(display, screen);
	buffer = XCreatePixmap(display, window, width, height, depth);

	XGCValues gcValues;
	gcValues.foreground = black;
	winBlackGC = XCreateGC(display, window, GCForeground, &gcValues);
	bufBlackGC = XCreateGC(display, buffer, GCForeground, &gcValues);
	gcValues.foreground = white;
	winWhiteGC = XCreateGC(display, window, GCForeground, &gcValues);
	bufWhiteGC = XCreateGC(display, buffer, GCForeground, &gcValues);

	constexpr long set_mask = ExposureMask | StructureNotifyMask | KeyPressMask | ButtonPressMask | ButtonReleaseMask | PointerMotionMask;
	constexpr long run_mask = StructureNotifyMask | KeyPressMask;

	XSelectInput(display, window, set_mask);
	XMapWindow(display, window);

set:
	for(;;){
		XEvent event;
		XNextEvent(display, &event);
		switch(event.type){
			case Expose:
				XCopyArea(
					display, buffer, window, winBlackGC,
					event.xexpose.x, event.xexpose.y, event.xexpose.width, event.xexpose.height, event.xexpose.x, event.xexpose.y
				);
				continue;
			case ConfigureNotify:
				width = event.xconfigure.width;
				height = event.xconfigure.height;
				XFreePixmap(display, buffer);
				buffer = XCreatePixmap(display, window, width, height, depth);
				break;
			case DestroyNotify:
				XFreeGC(display, winBlackGC);
				XFreeGC(display, winWhiteGC);
				XFreeGC(display, bufBlackGC);
				XFreeGC(display, bufWhiteGC);
				XFreePixmap(display, buffer);
				XCloseDisplay(display);
				return 0;
			case ButtonPress:
				switch(event.xbutton.button){
					case Button1:
						object::node::find(Vector<short>(event.xbutton.x, event.xbutton.y));
						if(object::node::focused == object::node::nodes.size()){
							object::edge::find(Vector<short>(event.xbutton.x, event.xbutton.y));
							if(object::edge::focused < object::edge::edges.size()){
								object::edge::drawing::from = -1;
								object::edge::drawing::from_edge = object::edge::focused;
								object::edge::drawing::points.push_back(XPoint(event.xbutton.x, event.xbutton.y));
							}
						}else{
							object::edge::drawing::from = object::node::focused;
							object::edge::drawing::points.push_back(XPoint(event.xbutton.x, event.xbutton.y));
						}
						break;
					case Button3:
						object::node::find(Vector<short>(event.xbutton.x, event.xbutton.y));
						if(object::node::focused == object::node::nodes.size()){
							object::node::nodes.push_back(object::node::Node(
								.001,
								Vector<double>(
									static_cast<double>(event.xbutton.x) / width,
									static_cast<double>(event.xbutton.y) / height
								)
							));
							object::node::origin.x = object::node::origin.y = 0;
						}else{
							Arc arc = object::node::nodes[object::node::focused].arc();
							object::node::origin.x = arc.x - event.xbutton.x;
							object::node::origin.y = arc.y - event.xbutton.y;
						}
						object::node::moving = true;
						break;
					case Button4:
						if(object::node::focused < object::node::nodes.size()){
							object::node::nodes[object::node::focused].am += .0001;
						}else if(object::edge::focused < object::edge::edges.size()){
							object::edge::edges[object::edge::focused].k += .0001;
						}
						break;
					case Button5:
						if(object::node::focused < object::node::nodes.size()){
							object::node::nodes[object::node::focused].am -= .0001;
							if(object::node::nodes[object::node::focused].am < 0){
								object::node::nodes[object::node::focused].am = 0;
							}
						}else if(object::edge::focused < object::edge::edges.size()){
							object::edge::edges[object::edge::focused].k -= .0001;
							if(object::edge::edges[object::edge::focused].k < 0){
								object::edge::edges[object::edge::focused].k = 0;
							}
						}
				}
				break;
			case ButtonRelease:
				if(object::node::moving){
					object::node::moving = false;
				}else if(!object::edge::drawing::points.empty()){
					object::node::find(Vector<short>(event.xbutton.x, event.xbutton.y));
					if(object::node::focused == object::node::nodes.size()){
						object::edge::find(Vector<short>(event.xbutton.x, event.xbutton.y));
						if(object::edge::focused < object::edge::edges.size()){
							if(object::edge::drawing::from != -1){
								object::edge::edges[object::edge::focused].from.push_back(object::edge::drawing::from);
							}
						}
					}else{
						if(object::edge::drawing::from == -1){
							object::edge::edges[object::edge::drawing::from_edge].to.push_back(object::node::focused);
						}else if(object::edge::drawing::from != object::node::focused){
							std::size_t i = std::distance(
								object::edge::drawing::len.begin(),
								std::lower_bound(object::edge::drawing::len.begin(), object::edge::drawing::len.end(),
								object::edge::drawing::len.back() / 2)
							);
							Vector<double> line =
								object::node::nodes[object::node::focused].p - object::node::nodes[object::edge::drawing::from].p;
							line *= .2;
							Vector<double> mid(
								static_cast<double>(object::edge::drawing::points[i].x) / width,
								static_cast<double>(object::edge::drawing::points[i].y) / height
							);
							object::edge::focused = object::edge::edges.size();
							object::edge::edges.push_back(
								object::edge::Edge(
									object::edge::drawing::from, object::node::focused, .001, mid, mid - line, mid + line
								)
							);
							object::node::focused = object::node::nodes.size();
						}
					}
					object::edge::drawing::points.clear();
					object::edge::drawing::len.clear();
				}
				break;
			case MotionNotify:
				if(object::node::moving){
					object::node::nodes[object::node::focused].p = Vector<double>(
						static_cast<double>(object::node::origin.x + event.xmotion.x) / width,
						static_cast<double>(object::node::origin.y + event.xmotion.y) / height
					);
				}else if(!object::edge::drawing::points.empty()){
					double x = object::edge::drawing::points.back().x;
					double y = object::edge::drawing::points.back().y;
					object::edge::drawing::points.push_back(XPoint{static_cast<short>(event.xmotion.x), static_cast<short>(event.xmotion.y)});
					double prev = object::edge::drawing::len.empty() ? 0 : object::edge::drawing::len.back();
					object::edge::drawing::len.push_back(prev + hypot(x - event.xmotion.x, y - event.xmotion.y));
				}
				break;
			case KeyPress:
				switch(XLookupKeysym(&event.xkey, 0)){
					case XK_Return:
						XSelectInput(display, window, run_mask);
						goto run;
				}
			default:
				continue;
		}
		object::draw_all();
	}
run:
	for(object::node::Node &i : object::node::nodes) i.am_set = i.am;
	for(;;){
		if(XPending(display)){
			XEvent event;
			XNextEvent(display, &event);
			switch(event.type){
				case DestroyNotify:
					XFreeGC(display, winBlackGC);
					XFreeGC(display, winWhiteGC);
					XFreeGC(display, bufBlackGC);
					XFreeGC(display, bufWhiteGC);
					XFreePixmap(display, buffer);
					return 0;
				case ConfigureNotify:
					width = event.xconfigure.width;
					height = event.xconfigure.height;
					break;
				case KeyPress:
					switch(XLookupKeysym(&event.xkey, 0)){
						case XK_Return:
							for(object::node::Node &i : object::node::nodes) i.am = i.am_set;
							XSelectInput(display, window, set_mask);
							XCopyArea(display, buffer, window, winBlackGC, 0, 0, width, height, 0, 0);
							object::draw_all();
							XFlush(display);
							goto set;
					}
			}
		}else{
			for(object::edge::Edge &i : object::edge::edges){
				double tmp = i.k / object::scale;
				for(std::size_t j : i.from) tmp *= object::node::nodes[j].am * object::scale;
				for(std::size_t j : i.from) object::node::nodes[j].am -= tmp;
				for(std::size_t j : i.to) object::node::nodes[j].am += tmp;
			}
			for(std::size_t i = 0; i < object::node::nodes.size(); ++i){
				printf("%f%c", object::node::nodes[i].am, ",\n"[i == object::node::nodes.size() - 1]);
			}
			object::draw_all();
			XFlush(display);
			usleep(1000);
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1b8, %rsp            # imm = 0x1B8
xorl %edi, %edi
callq 0x21f0
movq %rax, 0x5209(%rip)      # 0x8188
testq %rax, %rax
je 0x3c38
movq %rax, %rdi
callq 0x2120
movl %eax, %ebx
movq 0x51ef(%rip), %rdi      # 0x8188
movl %eax, %esi
callq 0x2250
movq %rax, %r12
movq 0x51de(%rip), %rdi      # 0x8188
movl %ebx, %esi
callq 0x2260
movl %eax, 0x51e9(%rip)      # 0x81a0
movq 0x51ca(%rip), %rdi      # 0x8188
movl %ebx, %esi
callq 0x2040
movl %eax, 0x51d9(%rip)      # 0x81a4
movq 0x51b6(%rip), %rdi      # 0x8188
movl %ebx, %esi
callq 0x2240
movq %rax, %r15
movq 0x51a5(%rip), %rdi      # 0x8188
movl %ebx, %esi
callq 0x21e0
movq %rax, %r14
movq 0x5194(%rip), %rdi      # 0x8188
movl 0x51a5(%rip), %r8d      # 0x81a0
movl 0x51a2(%rip), %r9d      # 0x81a4
subq $0x8, %rsp
movq %r12, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
pushq %rax
pushq %r15
pushq $0x1
callq 0x2090
addq $0x20, %rsp
movq %rax, 0x516e(%rip)      # 0x8190
movq 0x515f(%rip), %rdi      # 0x8188
movl %ebx, %esi
callq 0x2070
movq 0x5151(%rip), %rdi      # 0x8188
movq 0x5152(%rip), %rsi      # 0x8190
movl 0x515c(%rip), %edx      # 0x81a0
movl 0x515a(%rip), %ecx      # 0x81a4
movl %eax, -0x2c(%rbp)
movl %eax, %r8d
callq 0x2050
movq %rax, 0x513c(%rip)      # 0x8198
leaq -0x1e0(%rbp), %r12
movq %r15, 0x10(%r12)
movq 0x5119(%rip), %rdi      # 0x8188
movq 0x511a(%rip), %rsi      # 0x8190
pushq $0x4
popq %r15
movq %r15, %rdx
movq %r12, %rcx
callq 0x20f0
movq %rax, 0x511c(%rip)      # 0x81a8
movq 0x50f5(%rip), %rdi      # 0x8188
movq 0x50fe(%rip), %rsi      # 0x8198
movq %r15, %rdx
movq %r12, %rcx
callq 0x20f0
movq %rax, 0x510c(%rip)      # 0x81b8
movq %r14, 0x10(%r12)
movq 0x50d0(%rip), %rdi      # 0x8188
movq 0x50d1(%rip), %rsi      # 0x8190
movq %r15, %rdx
movq %r12, %rcx
callq 0x20f0
movq %rax, 0x50df(%rip)      # 0x81b0
movq 0x50b0(%rip), %rdi      # 0x8188
movq 0x50b9(%rip), %rsi      # 0x8198
movq %r15, %rdx
movq %r12, %rcx
callq 0x20f0
movq %rax, 0x50cf(%rip)      # 0x81c0
movq 0x5090(%rip), %rdi      # 0x8188
movq 0x5091(%rip), %rsi      # 0x8190
movl $0x2804d, %edx          # imm = 0x2804D
callq 0x2130
movq 0x5078(%rip), %rdi      # 0x8188
movq 0x5079(%rip), %rsi      # 0x8190
callq 0x21b0
leaq -0x160(%rbp), %r14
leaq 0x1f9e(%rip), %rbx      # 0x50c8
leaq 0x1f92(%rip), %r15      # 0x50c3
leaq -0xa0(%rbp), %r12
movq 0x5049(%rip), %rdi      # 0x8188
movq %r14, %rsi
callq 0x2210
movl -0x160(%rbp), %eax
leal -0x2(%rax), %ecx
cmpl $0xa, %ecx
ja 0x3371
leaq 0x1ef0(%rip), %rdx      # 0x5050
movslq (%rdx,%rcx,4), %rax
addq %rdx, %rax
jmpq *%rax
movq %r14, %rdi
xorl %esi, %esi
callq 0x21d0
cmpq $0xff0d, %rax           # imm = 0xFF0D
jne 0x3138
movq 0x5006(%rip), %rdi      # 0x8188
movq 0x5007(%rip), %rsi      # 0x8190
movl $0x20001, %edx          # imm = 0x20001
callq 0x2130
movq 0x502e(%rip), %rax      # 0x81c8
movq 0x502f(%rip), %rcx      # 0x81d0
cmpq %rcx, %rax
je 0x31b5
movsd (%rax), %xmm0
movsd %xmm0, 0x8(%rax)
addq $0x20, %rax
jmp 0x31a1
movq 0x4fcc(%rip), %rdi      # 0x8188
callq 0x2180
testl %eax, %eax
je 0x31f6
movq 0x4fbc(%rip), %rdi      # 0x8188
movq %r14, %rsi
callq 0x2210
movl -0x160(%rbp), %eax
cmpl $0x2, %eax
je 0x3335
cmpl $0x16, %eax
je 0x3318
cmpl $0x11, %eax
jne 0x31b5
jmp 0x3b55
movq 0x4ff3(%rip), %rax      # 0x81f0
movq 0x4ff4(%rip), %rcx      # 0x81f8
cmpq %rcx, %rax
je 0x32a9
movsd 0x30(%rax), %xmm0
movsd 0x4f56(%rip), %xmm1     # 0x8170
divsd %xmm1, %xmm0
movq (%rax), %rdx
movq 0x8(%rax), %rsi
movq 0x4f9c(%rip), %rdi      # 0x81c8
movq %rdx, %r8
cmpq %rsi, %r8
je 0x326a
movq (%r8), %r9
shlq $0x5, %r9
movsd (%rdi,%r9), %xmm2
mulsd %xmm1, %xmm2
mulsd %xmm2, %xmm0
addq $0x8, %r8
jmp 0x322f
movq (%rdx), %r8
shlq $0x5, %r8
movsd (%rdi,%r8), %xmm1
subsd %xmm0, %xmm1
movsd %xmm1, (%rdi,%r8)
addq $0x8, %rdx
cmpq %rsi, %rdx
jne 0x324f
movq 0x18(%rax), %rdx
movq 0x20(%rax), %rsi
movq 0x4f4a(%rip), %rdi      # 0x81c8
cmpq %rsi, %rdx
je 0x32a0
movq (%rdx), %r8
shlq $0x5, %r8
movsd (%rdi,%r8), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, (%rdi,%r8)
addq $0x8, %rdx
jmp 0x327e
addq $0x68, %rax
jmp 0x3204
xorl %r13d, %r13d
xorl %r12d, %r12d
movq 0x4f1a(%rip), %rax      # 0x81d0
movq 0x4f0b(%rip), %rcx      # 0x81c8
subq %rcx, %rax
sarq $0x5, %rax
cmpq %rax, %r12
jae 0x32f1
movsd (%rcx,%r13), %xmm0
decq %rax
xorl %ecx, %ecx
cmpq %rax, %r12
sete %cl
movsbl (%rcx,%rbx), %esi
movq %r15, %rdi
movb $0x1, %al
callq 0x2030
incq %r12
addq $0x20, %r13
jmp 0x32af
callq 0x2a97
movq 0x4e8b(%rip), %rdi      # 0x8188
callq 0x2220
movl $0x3e8, %edi            # imm = 0x3E8
callq 0x2200
leaq -0xa0(%rbp), %r12
jmp 0x31b5
movl -0x128(%rbp), %eax
movl -0x124(%rbp), %ecx
movl %eax, 0x4e76(%rip)      # 0x81a0
movl %ecx, 0x4e74(%rip)      # 0x81a4
jmp 0x31b5
movq %r14, %rdi
xorl %esi, %esi
callq 0x21d0
cmpq $0xff0d, %rax           # imm = 0xFF0D
jne 0x31b5
movq 0x4e76(%rip), %rax      # 0x81c8
movq 0x4e77(%rip), %rcx      # 0x81d0
cmpq %rcx, %rax
je 0x36a5
movsd 0x8(%rax), %xmm0
movsd %xmm0, (%rax)
addq $0x20, %rax
jmp 0x3359
cmpl $0x16, %eax
je 0x351c
cmpl $0x11, %eax
jne 0x3138
jmp 0x3bc8
movq 0x4df9(%rip), %rdi      # 0x8188
movq 0x4e02(%rip), %rsi      # 0x8198
movq 0x4df3(%rip), %rdx      # 0x8190
movq 0x4e04(%rip), %rcx      # 0x81a8
movl -0x138(%rbp), %r8d
movl -0x134(%rbp), %r9d
movl -0x130(%rbp), %eax
movl -0x12c(%rbp), %r10d
pushq %r9
pushq %r8
pushq %r10
pushq %rax
callq 0x20c0
addq $0x20, %rsp
jmp 0x3138
cmpb $0x1, 0x4e0d(%rip)      # 0x81e8
jne 0x3576
movb $0x0, 0x4e00(%rip)      # 0x81e8
jmp 0x3b4b
cmpb $0x1, 0x4df4(%rip)      # 0x81e8
jne 0x363e
movswl 0x4de9(%rip), %eax      # 0x81ea
addl -0x120(%rbp), %eax
cvtsi2sd %eax, %xmm0
cvtsi2sdl 0x4d8d(%rip), %xmm1 # 0x81a0
divsd %xmm1, %xmm0
movswl 0x4dce(%rip), %eax      # 0x81ec
addl -0x11c(%rbp), %eax
cvtsi2sd %eax, %xmm1
cvtsi2sdl 0x4d74(%rip), %xmm2 # 0x81a4
divsd %xmm2, %xmm1
movq 0x4da5(%rip), %rax      # 0x81e0
movq 0x4d86(%rip), %rcx      # 0x81c8
shlq $0x5, %rax
movsd %xmm0, 0x10(%rcx,%rax)
movsd %xmm1, 0x18(%rcx,%rax)
jmp 0x3b4b
movl -0x10c(%rbp), %eax
decl %eax
cmpl $0x4, %eax
ja 0x3b4b
leaq 0x1c0d(%rip), %rcx      # 0x507c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movzwl -0x120(%rbp), %eax
movzwl -0x11c(%rbp), %ecx
movw %ax, -0xa0(%rbp)
movw %cx, -0x9e(%rbp)
movq %r12, %rdi
callq 0x27c4
movq 0x4d3d(%rip), %rax      # 0x81e0
movq 0x4d26(%rip), %rcx      # 0x81d0
subq 0x4d17(%rip), %rcx      # 0x81c8
sarq $0x5, %rcx
cmpq %rcx, %rax
jne 0x3a34
movzwl -0x120(%rbp), %eax
movzwl -0x11c(%rbp), %ecx
movw %ax, -0xa0(%rbp)
movw %cx, -0x9e(%rbp)
movq %r12, %rdi
callq 0x289d
movq 0x4d1f(%rip), %rcx      # 0x8208
movq 0x4d08(%rip), %rax      # 0x81f8
subq 0x4cf9(%rip), %rax      # 0x81f0
cqto
pushq $0x68
popq %rsi
idivq %rsi
cmpq %rax, %rcx
jae 0x3b4b
orq $-0x1, 0x4d00(%rip)     # 0x8210
movq %rcx, 0x4d01(%rip)      # 0x8218
jmp 0x3a3b
movl -0x128(%rbp), %eax
movl -0x124(%rbp), %ecx
movl %eax, 0x4c72(%rip)      # 0x81a0
movl %ecx, 0x4c70(%rip)      # 0x81a4
movq 0x4c4d(%rip), %rdi      # 0x8188
movq 0x4c56(%rip), %rsi      # 0x8198
callq 0x2290
movq 0x4c3a(%rip), %rdi      # 0x8188
movq 0x4c3b(%rip), %rsi      # 0x8190
movl 0x4c45(%rip), %edx      # 0x81a0
movl 0x4c43(%rip), %ecx      # 0x81a4
movl -0x2c(%rbp), %r8d
callq 0x2050
movq %rax, 0x4c27(%rip)      # 0x8198
jmp 0x3b4b
movq 0x4ca3(%rip), %rax      # 0x8220
cmpq 0x4ca4(%rip), %rax      # 0x8228
je 0x3b4b
movzwl -0x120(%rbp), %eax
movzwl -0x11c(%rbp), %ecx
movw %ax, -0xa0(%rbp)
movw %cx, -0x9e(%rbp)
movq %r12, %rdi
callq 0x27c4
movq 0x4c2b(%rip), %rax      # 0x81e0
movq 0x4c14(%rip), %rcx      # 0x81d0
subq 0x4c05(%rip), %rcx      # 0x81c8
sarq $0x5, %rcx
cmpq %rcx, %rax
jne 0x3851
movzwl -0x120(%rbp), %eax
movzwl -0x11c(%rbp), %ecx
movw %ax, -0xa0(%rbp)
movw %cx, -0x9e(%rbp)
movq %r12, %rdi
callq 0x289d
movq 0x4c0d(%rip), %rcx      # 0x8208
movq 0x4bf6(%rip), %rax      # 0x81f8
movq 0x4be7(%rip), %rdi      # 0x81f0
subq %rdi, %rax
cqto
pushq $0x68
popq %rsi
idivq %rsi
cmpq %rax, %rcx
jae 0x3b1d
cmpq $-0x1, 0x4beb(%rip)     # 0x8210
je 0x3b1d
imulq $0x68, %rcx, %rax
addq %rax, %rdi
leaq 0x4bd7(%rip), %rsi      # 0x8210
jmp 0x3b18
movq 0x4be3(%rip), %rax      # 0x8228
cmpq %rax, 0x4bd4(%rip)      # 0x8220
je 0x3b4b
movq %r12, %rsi
movswl -0x4(%rax), %r12d
movswl -0x2(%rax), %r13d
movzwl -0x120(%rbp), %eax
movzwl -0x11c(%rbp), %ecx
movw %ax, -0xa0(%rbp)
movw %cx, -0x9e(%rbp)
leaq 0x4b9e(%rip), %rdi      # 0x8220
callq 0x4312
movq 0x4bb2(%rip), %rax      # 0x8240
cmpq %rax, 0x4ba3(%rip)      # 0x8238
je 0x3997
movsd -0x8(%rax), %xmm0
jmp 0x399a
movq 0x4adc(%rip), %rdi      # 0x8188
movq 0x4add(%rip), %rsi      # 0x8190
movl $0x2804d, %edx          # imm = 0x2804D
callq 0x2130
movq 0x4ac4(%rip), %rdi      # 0x8188
movq 0x4acd(%rip), %rsi      # 0x8198
movq 0x4abe(%rip), %rdx      # 0x8190
movq 0x4acf(%rip), %rcx      # 0x81a8
movl 0x4ac1(%rip), %eax      # 0x81a0
movl 0x4abe(%rip), %r10d     # 0x81a4
xorl %r8d, %r8d
xorl %r9d, %r9d
pushq $0x0
pushq $0x0
pushq %r10
pushq %rax
callq 0x20c0
addq $0x20, %rsp
callq 0x2a97
movq 0x4a80(%rip), %rdi      # 0x8188
callq 0x2220
jmp 0x3138
movq 0x4ac7(%rip), %rax      # 0x81e0
movq 0x4ab0(%rip), %rdx      # 0x81d0
movq 0x4aa1(%rip), %rcx      # 0x81c8
subq %rcx, %rdx
sarq $0x5, %rdx
cmpq %rdx, %rax
jae 0x39ee
shlq $0x5, %rax
movsd (%rcx,%rax), %xmm0
addsd 0x18f8(%rip), %xmm0     # 0x5040
movsd %xmm0, (%rcx,%rax)
jmp 0x3b4b
movzwl -0x120(%rbp), %eax
movzwl -0x11c(%rbp), %ecx
movw %ax, -0xa0(%rbp)
movw %cx, -0x9e(%rbp)
movq %r12, %rdi
callq 0x27c4
movq 0x4a63(%rip), %rax      # 0x81e0
movq 0x4a4c(%rip), %rcx      # 0x81d0
movq 0x4a3d(%rip), %rdi      # 0x81c8
subq %rdi, %rcx
sarq $0x5, %rcx
cmpq %rcx, %rax
jne 0x3a6b
cvtsi2sdl -0x120(%rbp), %xmm0
cvtsi2sdl 0x49f5(%rip), %xmm1 # 0x81a0
divsd %xmm1, %xmm0
cvtsi2sdl -0x11c(%rbp), %xmm1
cvtsi2sdl 0x49e5(%rip), %xmm2 # 0x81a4
divsd %xmm2, %xmm1
movabsq $0x3f50624dd2f1a9fc, %rax # imm = 0x3F50624DD2F1A9FC
movq %rax, -0xa0(%rbp)
movsd %xmm0, -0x90(%rbp)
movsd %xmm1, -0x88(%rbp)
leaq 0x49dd(%rip), %rdi      # 0x81c8
movq %r12, %rsi
callq 0x4462
xorl %eax, %eax
xorl %ecx, %ecx
jmp 0x3a88
movq 0x49dd(%rip), %rax      # 0x81e0
movq 0x49c6(%rip), %rdx      # 0x81d0
movq 0x49b7(%rip), %rcx      # 0x81c8
subq %rcx, %rdx
sarq $0x5, %rdx
cmpq %rdx, %rax
jae 0x3aa2
shlq $0x5, %rax
movsd (%rcx,%rax), %xmm0
addsd 0x1806(%rip), %xmm0     # 0x5038
movsd %xmm0, (%rcx,%rax)
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
jbe 0x3b4b
addq %rax, %rcx
andq $0x0, (%rcx)
jmp 0x3b4b
movq 0x49b8(%rip), %rcx      # 0x8210
cmpq $-0x1, %rcx
je 0x3afa
cmpq %rax, %rcx
je 0x3b1d
movq 0x49c6(%rip), %r13      # 0x8238
movq 0x49c7(%rip), %rsi      # 0x8240
movsd -0x8(%rsi), %xmm0
mulsd 0x179a(%rip), %xmm0     # 0x5020
movsd %xmm0, -0xa0(%rbp)
movq %r13, %rdi
movq %r12, %rdx
callq 0x3f38
subq %r13, %rax
movq 0x493d(%rip), %rcx      # 0x81e0
movq 0x491e(%rip), %rdx      # 0x81c8
movq %rcx, %rsi
shlq $0x5, %rsi
movsd 0x10(%rdx,%rsi), %xmm5
movsd 0x18(%rdx,%rsi), %xmm6
movq 0x494c(%rip), %rsi      # 0x8210
movq %rsi, %rdi
shlq $0x5, %rdi
subsd 0x10(%rdx,%rdi), %xmm5
subsd 0x18(%rdx,%rdi), %xmm6
movsd 0x1749(%rip), %xmm0     # 0x5028
mulsd %xmm0, %xmm5
movq 0x4936(%rip), %rdx      # 0x8220
sarq %rax
movswl (%rdx,%rax), %edi
cvtsi2sd %edi, %xmm1
mulsd %xmm0, %xmm6
cvtsi2sdl 0x489f(%rip), %xmm0 # 0x81a0
movswl 0x2(%rdx,%rax), %eax
cvtsi2sd %eax, %xmm2
cvtsi2sdl 0x4892(%rip), %xmm3 # 0x81a4
divsd %xmm0, %xmm1
movq 0x48db(%rip), %rax      # 0x81f8
subq 0x48cc(%rip), %rax      # 0x81f0
divsd %xmm3, %xmm2
cqto
pushq $0x68
popq %rdi
idivq %rdi
movq %rax, 0x48d1(%rip)      # 0x8208
movapd %xmm1, %xmm3
subsd %xmm5, %xmm3
movapd %xmm2, %xmm4
subsd %xmm6, %xmm4
addsd %xmm1, %xmm5
addsd %xmm2, %xmm6
movq %r12, %rdi
movq %rcx, %rdx
movsd 0x16d3(%rip), %xmm0     # 0x5030
callq 0x3e1c
leaq 0x4887(%rip), %rdi      # 0x81f0
movq %r12, %rsi
callq 0x4730
movq %r12, %rdi
callq 0x3ee8
movq 0x4850(%rip), %rax      # 0x81d0
subq 0x4841(%rip), %rax      # 0x81c8
sarq $0x5, %rax
movq %rax, 0x484e(%rip)      # 0x81e0
jmp 0x3b1d
xorps %xmm0, %xmm0
movsd %xmm0, -0x38(%rbp)
cvtsi2sd %r12d, %xmm0
cvtsi2sd %r13d, %xmm1
cvtsi2sdl -0x120(%rbp), %xmm2
subsd %xmm2, %xmm0
cvtsi2sdl -0x11c(%rbp), %xmm2
subsd %xmm2, %xmm1
callq 0x2080
addsd -0x38(%rbp), %xmm0
movsd %xmm0, -0xa0(%rbp)
leaq 0x485e(%rip), %rdi      # 0x8238
leaq -0xa0(%rbp), %r12
movq %r12, %rsi
callq 0x49a2
jmp 0x3b4b
movq 0x4813(%rip), %rsi      # 0x8208
movq 0x47fc(%rip), %rax      # 0x81f8
movq 0x47ed(%rip), %rcx      # 0x81f0
subq %rcx, %rax
cqto
pushq $0x68
popq %rdi
idivq %rdi
cmpq %rax, %rsi
jae 0x3b4b
imulq $0x68, %rsi, %rax
movsd 0x30(%rcx,%rax), %xmm0
addsd 0x1617(%rip), %xmm0     # 0x5040
movsd %xmm0, 0x30(%rcx,%rax)
jmp 0x3b4b
movq %rax, 0x47d5(%rip)      # 0x8210
movzwl -0x120(%rbp), %eax
movzwl -0x11c(%rbp), %ecx
movw %ax, -0xa0(%rbp)
movw %cx, -0x9e(%rbp)
leaq 0x47c2(%rip), %rdi      # 0x8220
movq %r12, %rsi
callq 0x4312
jmp 0x3b4b
shlq $0x5, %rax
addq %rax, %rdi
callq 0x3d30
movl %eax, %ecx
subl -0x120(%rbp), %ecx
shrl $0x10, %eax
subl -0x11c(%rbp), %eax
movw %ax, 0x475d(%rip)       # 0x81ec
movw %cx, 0x4754(%rip)       # 0x81ea
movb $0x1, 0x474b(%rip)      # 0x81e8
jmp 0x3b4b
movq 0x475f(%rip), %rsi      # 0x8208
movq 0x4748(%rip), %rax      # 0x81f8
movq 0x4739(%rip), %rcx      # 0x81f0
subq %rcx, %rax
cqto
pushq $0x68
popq %rdi
idivq %rdi
cmpq %rax, %rsi
jae 0x3b4b
imulq $0x68, %rsi, %rax
movsd 0x30(%rcx,%rax), %xmm0
addsd 0x155b(%rip), %xmm0     # 0x5038
movsd %xmm0, 0x30(%rcx,%rax)
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
jbe 0x3b4b
addq %rcx, %rax
addq $0x30, %rax
andq $0x0, (%rax)
jmp 0x3b4b
movq 0x46ef(%rip), %rax      # 0x81f0
imulq $0x68, 0x470f(%rip), %rcx # 0x8218
leaq (%rax,%rcx), %rdi
addq $0x18, %rdi
leaq 0x46c8(%rip), %rsi      # 0x81e0
callq 0x3df4
movq 0x46fc(%rip), %rax      # 0x8220
cmpq %rax, 0x46fd(%rip)      # 0x8228
je 0x3b34
movq %rax, 0x46f4(%rip)      # 0x8228
movq 0x46fd(%rip), %rax      # 0x8238
cmpq %rax, 0x46fe(%rip)      # 0x8240
je 0x3b4b
movq %rax, 0x46f5(%rip)      # 0x8240
callq 0x2a97
jmp 0x3138
movq 0x462c(%rip), %rdi      # 0x8188
movq 0x4645(%rip), %rsi      # 0x81a8
callq 0x2110
movq 0x4619(%rip), %rdi      # 0x8188
movq 0x463a(%rip), %rsi      # 0x81b0
callq 0x2110
movq 0x4606(%rip), %rdi      # 0x8188
movq 0x462f(%rip), %rsi      # 0x81b8
callq 0x2110
movq 0x45f3(%rip), %rdi      # 0x8188
movq 0x4624(%rip), %rsi      # 0x81c0
callq 0x2110
movq 0x45e0(%rip), %rdi      # 0x8188
movq 0x45e9(%rip), %rsi      # 0x8198
callq 0x2290
xorl %eax, %eax
addq $0x1b8, %rsp            # imm = 0x1B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x45b9(%rip), %rdi      # 0x8188
movq 0x45d2(%rip), %rsi      # 0x81a8
callq 0x2110
movq 0x45a6(%rip), %rdi      # 0x8188
movq 0x45c7(%rip), %rsi      # 0x81b0
callq 0x2110
movq 0x4593(%rip), %rdi      # 0x8188
movq 0x45bc(%rip), %rsi      # 0x81b8
callq 0x2110
movq 0x4580(%rip), %rdi      # 0x8188
movq 0x45b1(%rip), %rsi      # 0x81c0
callq 0x2110
movq 0x456d(%rip), %rdi      # 0x8188
movq 0x4576(%rip), %rsi      # 0x8198
callq 0x2290
movq 0x455a(%rip), %rdi      # 0x8188
callq 0x22b0
jmp 0x3bb4
movq 0x43a1(%rip), %rax      # 0x7fe0
movq (%rax), %rsi
leaq 0x1457(%rip), %rdi      # 0x50a0
callq 0x21c0
pushq $-0x1
popq %rax
jmp 0x3bb6
movq %rax, %rbx
leaq -0xa0(%rbp), %rdi
callq 0x3ee8
movq %rbx, %rdi
callq 0x2280