// File: EnderGed[P]fast-random-walk/WeightedGraph.cpp
// Function: WeightedGraph::toString[abi:cxx11]() const
std::string WeightedGraph::toString() const
{
	unsigned const maxDigitsNode = hasDigits(getNumNodes() - 1);
	unsigned const maxDigitsWeight = hasDigits(std::numeric_limits<uint>::max());

	char asString[max(maxDigitsNode, maxDigitsWeight)];

	std::string res;
	res.reserve((maxDigitsNode * 2 + maxDigitsWeight + 6) * getNumTransitions());

	for(uint node = 0; node < numNodes; ++node)
	{
		uint const numTrans = getNumTransitions(node);

		for(uint trans = 0; trans < numTrans; ++trans)
		{
			// Determine weight
			uint const weight = trans ? getWeight(node, trans) - getWeight(node, trans - 1) : getWeight(node, trans);

			// Add source node
			unsigned len = writeInt(asString, node);
			res.append(asString, len);

			// Add " -"
			res.append(" -", 2);

			// Add weight
			len = writeInt(asString, weight);
			res.append(asString, len);

			// Add "-> "
			res.append("-> ", 3);

			// Add destination node
			len = writeInt(asString, getNode(node, trans));
			res.append(asString, len);

			// Add new line symbol
			res.append(1, '\n');
		}
	}

	return res;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x78(%rbp)
movq %rdi, %rax
movq %rax, -0x80(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0x68(%rbp)
callq 0x3a10
movl %eax, %edi
decl %edi
callq 0x39f0
movl %eax, -0x14(%rbp)
callq 0x8fa0
movl %eax, %edi
callq 0x39f0
movl %eax, -0x18(%rbp)
leaq -0x14(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0x8fb0
movq -0x78(%rbp), %rdi
movl (%rax), %eax
movq %rsp, %rcx
movq %rcx, -0x20(%rbp)
movq %rax, %rdx
addq $0xf, %rdx
andq $-0x10, %rdx
movq %rsp, %rcx
subq %rdx, %rcx
movq %rcx, -0x70(%rbp)
movq %rcx, %rsp
movq %rax, -0x28(%rbp)
movb $0x0, -0x29(%rbp)
callq 0x2250
movq -0x68(%rbp), %rdi
movl -0x14(%rbp), %eax
movl -0x18(%rbp), %edx
movl %eax, %ecx
movl %edx, %eax
leal 0x6(%rax,%rcx,2), %eax
movq %rax, -0x60(%rbp)
callq 0x3a20
movq %rax, -0x58(%rbp)
jmp 0x7716
movq -0x78(%rbp), %rdi
movq -0x58(%rbp), %rax
movq -0x60(%rbp), %rsi
imulq %rax, %rsi
callq 0x22a0
jmp 0x772d
movl $0x0, -0x40(%rbp)
movq -0x68(%rbp), %rcx
movl -0x40(%rbp), %eax
cmpl 0x8(%rcx), %eax
jae 0x7915
movq -0x68(%rbp), %rdi
movl -0x40(%rbp), %esi
callq 0x38d0
movl %eax, -0x84(%rbp)
jmp 0x7758
movl -0x84(%rbp), %eax
movl %eax, -0x44(%rbp)
movl $0x0, -0x48(%rbp)
movl -0x48(%rbp), %eax
cmpl -0x44(%rbp), %eax
jae 0x7905
cmpl $0x0, -0x48(%rbp)
je 0x77c0
movq -0x68(%rbp), %rdi
movl -0x40(%rbp), %esi
movl -0x48(%rbp), %edx
callq 0x8ff0
movl %eax, -0x88(%rbp)
jmp 0x7791
movq -0x68(%rbp), %rdi
movl -0x40(%rbp), %esi
movl -0x48(%rbp), %edx
decl %edx
callq 0x8ff0
movl %eax, -0x8c(%rbp)
jmp 0x77aa
movl -0x8c(%rbp), %ecx
movl -0x88(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x90(%rbp)
jmp 0x77e5
movq -0x68(%rbp), %rdi
movl -0x40(%rbp), %esi
movl -0x48(%rbp), %edx
callq 0x8ff0
movl %eax, -0x94(%rbp)
jmp 0x77d7
movl -0x94(%rbp), %eax
movl %eax, -0x90(%rbp)
jmp 0x77e5
movq -0x70(%rbp), %rdi
movl -0x90(%rbp), %eax
movl %eax, -0x4c(%rbp)
movl -0x40(%rbp), %esi
callq 0x6680
movl %eax, -0x98(%rbp)
jmp 0x7802
movq -0x70(%rbp), %rsi
movq -0x78(%rbp), %rdi
movl -0x98(%rbp), %eax
movl %eax, -0x50(%rbp)
movl -0x50(%rbp), %eax
movl %eax, %edx
callq 0x2050
jmp 0x781f
movq -0x78(%rbp), %rdi
leaq 0x4996(%rip), %rsi      # 0xc1c0
movl $0x2, %edx
callq 0x2050
jmp 0x7836
movq -0x70(%rbp), %rdi
movl -0x4c(%rbp), %esi
callq 0x6680
movl %eax, -0x9c(%rbp)
jmp 0x784a
movq -0x70(%rbp), %rsi
movq -0x78(%rbp), %rdi
movl -0x9c(%rbp), %eax
movl %eax, -0x50(%rbp)
movl -0x50(%rbp), %eax
movl %eax, %edx
callq 0x2050
jmp 0x7867
movq -0x78(%rbp), %rdi
leaq 0x47bb(%rip), %rsi      # 0xc02d
movl $0x3, %edx
callq 0x2050
jmp 0x787e
movq -0x68(%rbp), %rdi
movl -0x40(%rbp), %esi
movl -0x48(%rbp), %edx
callq 0x3930
movl %eax, -0xa0(%rbp)
jmp 0x7895
movl -0xa0(%rbp), %esi
movq -0x70(%rbp), %rdi
callq 0x6680
movl %eax, -0xa4(%rbp)
jmp 0x78ac
movq -0x70(%rbp), %rsi
movq -0x78(%rbp), %rdi
movl -0xa4(%rbp), %eax
movl %eax, -0x50(%rbp)
movl -0x50(%rbp), %eax
movl %eax, %edx
callq 0x2050
jmp 0x78c9
movq -0x78(%rbp), %rdi
movl $0x1, %esi
movl $0xa, %edx
callq 0x21c0
jmp 0x78de
jmp 0x78e0
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0x7768
movq -0x78(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
callq 0x2110
jmp 0x7938
jmp 0x7907
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0x7734
movb $0x1, -0x29(%rbp)
testb $0x1, -0x29(%rbp)
jne 0x7928
movq -0x78(%rbp), %rdi
callq 0x2110
movq -0x80(%rbp), %rax
movq -0x20(%rbp), %rcx
movq %rcx, %rsp
movq %rbp, %rsp
popq %rbp
retq
movq -0x38(%rbp), %rdi
callq 0x22d0
nopw %cs:(%rax,%rax)