// File: Laakeri[P]Triangulator/src/hyper.cpp
// Function: Hyper::SolveAtom::solveFracAtom(Graph const&, long double, long double, long double, std::vector<int, std::allocator<int>> const&)
pair<ld, vector<pair<int, int> > > solveFracAtom(const Graph& G, ld lowerBound, ld okWidth, ld upperBound, const vector<int>& vertMap) {
	assert(lowerBound > -eps);
	assert(okWidth < upperBound + eps);
	
	if (lowerBound > upperBound) return {-1, FAILSOLUTION};
	okWidth = max(okWidth, lowerBound);
	
	auto fill = MCS::MCS_MP(G);
	
	Graph gFill = G;
	gFill.addEdges(fill.F);
	
	ld fillWidth = MCS::getFracHyperTreeWidth(gFill, vertMap);
	assert(fillWidth > lowerBound - eps);
	
	if (fillWidth < okWidth + eps) return {fillWidth, fill.F};
	
	if (fill.F.size() == 0) {
		if (fillWidth < upperBound + eps) return {fillWidth, fill.F};
		else return {-1, FAILSOLUTION};
	}
	
	PMC::initVertMap(vertMap);
	auto fillO = PMC::solve(G, lowerBound, upperBound, PROBLEM_FRACHYPER);
	if (fillO == FAILSOLUTION) return {-1, FAILSOLUTION};
	Graph gFillO = G;
	gFillO.addEdges(fillO);
	ld width = MCS::getFracHyperTreeWidth(gFillO, vertMap);
	assert(width > lowerBound - eps);
	assert(width < upperBound + eps);
	return {width, fillO};
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2b0, %rsp            # imm = 0x2B0
movq %rdi, -0x220(%rbp)
movq %rdi, %rax
movq %rax, -0x218(%rbp)
fldt 0x30(%rbp)
fldt 0x20(%rbp)
fldt 0x10(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
fstpt -0x20(%rbp)
fstpt -0x30(%rbp)
fstpt -0x40(%rbp)
movq %rdx, -0x48(%rbp)
fldt -0x20(%rbp)
fldl 0x3a555(%rip)           # 0x59798
fxch %st(1)
fucompi %st(1), %st
fstp %st(0)
jbe 0x1f24f
jmp 0x1f24d
jmp 0x1f26e
leaq 0x3a5eb(%rip), %rdi     # 0x59841
leaq 0x3a553(%rip), %rsi     # 0x597b0
movl $0x3f, %edx
leaq 0x3a5ea(%rip), %rcx     # 0x59853
callq 0x31a0
fldt -0x30(%rbp)
fldt -0x40(%rbp)
fldl 0x3a526(%rip)           # 0x597a0
faddp %st, %st(1)
fucompi %st(1), %st
fstp %st(0)
jbe 0x1f286
jmp 0x1f284
jmp 0x1f2a5
leaq 0x3a637(%rip), %rdi     # 0x598c4
leaq 0x3a51c(%rip), %rsi     # 0x597b0
movl $0x40, %edx
leaq 0x3a5b3(%rip), %rcx     # 0x59853
callq 0x31a0
fldt -0x20(%rbp)
fldt -0x40(%rbp)
fxch %st(1)
fucompi %st(1), %st
fstp %st(0)
jbe 0x1f2d8
jmp 0x1f2b5
movq -0x220(%rbp), %rdi
movl $0xffffffff, -0x4c(%rbp) # imm = 0xFFFFFFFF
leaq -0x4c(%rbp), %rsi
leaq 0x5b01a(%rip), %rdx     # 0x7a2e8
callq 0x23d00
jmp 0x1f723
leaq -0x30(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x23d40
fldt (%rax)
fstpt -0x30(%rbp)
movq -0x10(%rbp), %rsi
leaq -0x80(%rbp), %rdi
callq 0x28a90
movq -0x10(%rbp), %rsi
leaq -0xd8(%rbp), %rdi
callq 0xb8b0
jmp 0x1f309
leaq -0xd8(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x15db0
jmp 0x1f31b
movq -0x48(%rbp), %rsi
leaq -0xd8(%rbp), %rdi
callq 0x2b3c0
fstpt -0x22c(%rbp)
jmp 0x1f333
fldt -0x22c(%rbp)
fstpt -0x100(%rbp)
fldt -0x100(%rbp)
fldt -0x20(%rbp)
fldl 0x3a44a(%rip)           # 0x59798
faddp %st, %st(1)
fxch %st(1)
fucompi %st(1), %st
fstp %st(0)
jbe 0x1f35c
jmp 0x1f35a
jmp 0x1f3a9
leaq 0x3a57c(%rip), %rdi     # 0x598df
leaq 0x3a446(%rip), %rsi     # 0x597b0
movl $0x4b, %edx
leaq 0x3a4dd(%rip), %rcx     # 0x59853
callq 0x31a0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xe0(%rbp)
movl %eax, -0xe4(%rbp)
jmp 0x1f718
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xe0(%rbp)
movl %eax, -0xe4(%rbp)
jmp 0x1f70c
fldt -0x100(%rbp)
fldt -0x30(%rbp)
fldl 0x3a3e8(%rip)           # 0x597a0
faddp %st, %st(1)
fucompi %st(1), %st
fstp %st(0)
jbe 0x1f3ea
jmp 0x1f3c2
movq -0x220(%rbp), %rdi
leaq -0x100(%rbp), %rsi
leaq -0x80(%rbp), %rdx
callq 0x23d80
jmp 0x1f3db
movl $0x1, -0x104(%rbp)
jmp 0x1f6f5
leaq -0x80(%rbp), %rdi
callq 0x5680
cmpq $0x0, %rax
jne 0x1f46f
fldt -0x100(%rbp)
fldt -0x40(%rbp)
fldl 0x3a398(%rip)           # 0x597a0
faddp %st, %st(1)
fucompi %st(1), %st
fstp %st(0)
jbe 0x1f43a
jmp 0x1f412
movq -0x220(%rbp), %rdi
leaq -0x100(%rbp), %rsi
leaq -0x80(%rbp), %rdx
callq 0x23d80
jmp 0x1f42b
movl $0x1, -0x104(%rbp)
jmp 0x1f6f5
movq -0x220(%rbp), %rdi
movl $0xffffffff, -0x108(%rbp) # imm = 0xFFFFFFFF
leaq 0x5ae96(%rip), %rdx     # 0x7a2e8
leaq -0x108(%rbp), %rsi
callq 0x23d00
jmp 0x1f460
movl $0x1, -0x104(%rbp)
jmp 0x1f6f5
movq -0x48(%rbp), %rsi
leaq -0x120(%rbp), %rdi
callq 0x6490
jmp 0x1f481
leaq -0x120(%rbp), %rdi
callq 0x3a070
jmp 0x1f48f
leaq -0x120(%rbp), %rdi
callq 0x6d30
movq -0x10(%rbp), %rax
movq %rax, -0x238(%rbp)
fldt -0x20(%rbp)
movq %rsp, %rax
fstpt (%rax)
leaq -0x170(%rbp), %rdi
callq 0x3a110
jmp 0x1f4bc
fldt -0x40(%rbp)
movq %rsp, %rax
fstpt (%rax)
leaq -0x1a0(%rbp), %rdi
callq 0x3a110
jmp 0x1f4d2
movq -0x238(%rbp), %rsi
movaps -0x1a0(%rbp), %xmm0
movaps -0x190(%rbp), %xmm1
movaps -0x180(%rbp), %xmm2
movq %rsp, %rax
movaps %xmm2, 0x50(%rax)
movaps %xmm1, 0x40(%rax)
movaps %xmm0, 0x30(%rax)
movaps -0x170(%rbp), %xmm0
movaps -0x160(%rbp), %xmm1
movaps -0x150(%rbp), %xmm2
movaps %xmm2, 0x20(%rax)
movaps %xmm1, 0x10(%rax)
movaps %xmm0, (%rax)
leaq -0x138(%rbp), %rdi
movl $0x6, %edx
callq 0x41440
jmp 0x1f530
leaq 0x5adb1(%rip), %rsi     # 0x7a2e8
leaq -0x138(%rbp), %rdi
callq 0x5600
movb %al, -0x239(%rbp)
jmp 0x1f54b
movb -0x239(%rbp), %al
testb $0x1, %al
jne 0x1f557
jmp 0x1f5c6
movq -0x220(%rbp), %rdi
movl $0xffffffff, -0x1a4(%rbp) # imm = 0xFFFFFFFF
leaq 0x5ad79(%rip), %rdx     # 0x7a2e8
leaq -0x1a4(%rbp), %rsi
callq 0x23d00
jmp 0x1f57d
movl $0x1, -0x104(%rbp)
jmp 0x1f6d9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xe0(%rbp)
movl %eax, -0xe4(%rbp)
leaq -0x120(%rbp), %rdi
callq 0x6d30
jmp 0x1f70c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xe0(%rbp)
movl %eax, -0xe4(%rbp)
jmp 0x1f6e7
movq -0x10(%rbp), %rsi
leaq -0x200(%rbp), %rdi
callq 0xb8b0
jmp 0x1f5d8
leaq -0x200(%rbp), %rdi
leaq -0x138(%rbp), %rsi
callq 0x15db0
jmp 0x1f5ed
movq -0x48(%rbp), %rsi
leaq -0x200(%rbp), %rdi
callq 0x2b3c0
fstpt -0x244(%rbp)
jmp 0x1f605
fldt -0x244(%rbp)
fstpt -0x210(%rbp)
fldt -0x210(%rbp)
fldt -0x20(%rbp)
fldl 0x3a178(%rip)           # 0x59798
faddp %st, %st(1)
fxch %st(1)
fucompi %st(1), %st
fstp %st(0)
jbe 0x1f62e
jmp 0x1f62c
jmp 0x1f66d
leaq 0x3a2c7(%rip), %rdi     # 0x598fc
leaq 0x3a174(%rip), %rsi     # 0x597b0
movl $0x5a, %edx
leaq 0x3a20b(%rip), %rcx     # 0x59853
callq 0x31a0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xe0(%rbp)
movl %eax, -0xe4(%rbp)
leaq -0x200(%rbp), %rdi
callq 0x59e0
jmp 0x1f6e7
fldt -0x210(%rbp)
fldt -0x40(%rbp)
fldl 0x3a124(%rip)           # 0x597a0
faddp %st, %st(1)
fucompi %st(1), %st
fstp %st(0)
jbe 0x1f688
jmp 0x1f686
jmp 0x1f6a7
leaq 0x3a286(%rip), %rdi     # 0x59915
leaq 0x3a11a(%rip), %rsi     # 0x597b0
movl $0x5b, %edx
leaq 0x3a1b1(%rip), %rcx     # 0x59853
callq 0x31a0
movq -0x220(%rbp), %rdi
leaq -0x210(%rbp), %rsi
leaq -0x138(%rbp), %rdx
callq 0x23d80
jmp 0x1f6c3
movl $0x1, -0x104(%rbp)
leaq -0x200(%rbp), %rdi
callq 0x59e0
leaq -0x138(%rbp), %rdi
callq 0x5470
jmp 0x1f6f5
leaq -0x138(%rbp), %rdi
callq 0x5470
jmp 0x1f70c
leaq -0xd8(%rbp), %rdi
callq 0x59e0
leaq -0x80(%rbp), %rdi
callq 0x57e0
jmp 0x1f723
leaq -0xd8(%rbp), %rdi
callq 0x59e0
leaq -0x80(%rbp), %rdi
callq 0x57e0
jmp 0x1f733
movq -0x218(%rbp), %rax
addq $0x2b0, %rsp            # imm = 0x2B0
popq %rbp
retq
movq -0xe0(%rbp), %rdi
callq 0x3480
nop