// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movl 0x8(%rsi), %edi
decl %edi
callq 0x2c68
movl %eax, %r12d
pushq $-0x1
popq %rdi
callq 0x2c68
cmpl %eax, %r12d
movl %eax, %ecx
cmoval %r12d, %ecx
addq $0xf, %rcx
andq $-0x10, %rcx
movq %rsp, %r15
subq %rcx, %r15
movq %r15, %rsp
leaq 0x10(%rbx), %rcx
movq %rcx, (%rbx)
andq $0x0, 0x8(%rbx)
movb $0x0, 0x10(%rbx)
leal (%rax,%r12,2), %esi
addl $0x6, %esi
movq 0x10(%r14), %rax
movl 0x8(%r14), %ecx
imulq (%rax,%rcx,8), %rsi
movq %rbx, %rdi
callq 0x2290
xorl %r12d, %r12d
movq %r14, -0x30(%rbp)
movl 0x8(%r14), %eax
cmpq %rax, %r12
jae 0x4102
movq 0x10(%r14), %rax
leaq 0x1(%r12), %rcx
movq %rcx, -0x38(%rbp)
movl 0x8(%rax,%r12,8), %ecx
subl (%rax,%r12,8), %ecx
movq %rcx, -0x40(%rbp)
xorl %r14d, %r14d
cmpq %r14, -0x40(%rbp)
je 0x40f5
movq -0x30(%rbp), %rcx
movq 0x10(%rcx), %rax
movq (%rax,%r12,8), %rax
shlq $0x2, %rax
addq 0x20(%rcx), %rax
testq %r14, %r14
je 0x405b
movl (%rax,%r14,4), %r13d
subl -0x4(%rax,%r14,4), %r13d
jmp 0x405e
movl (%rax), %r13d
movq %r15, %rdi
movl %r12d, %esi
callq 0x38c5
movl %eax, %edx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x2050
movq %rbx, %rdi
leaq 0x2165(%rip), %rsi      # 0x61e5
pushq $0x2
popq %rdx
callq 0x2050
movq %r15, %rdi
movl %r13d, %esi
callq 0x38c5
movl %eax, %edx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x2050
movq %rbx, %rdi
leaq 0x1f80(%rip), %rsi      # 0x602a
pushq $0x3
popq %rdx
callq 0x2050
movq -0x30(%rbp), %rcx
movq 0x10(%rcx), %rax
movq (%rax,%r12,8), %rax
shlq $0x2, %rax
addq 0x18(%rcx), %rax
movl (%rax,%r14,4), %esi
movq %r15, %rdi
callq 0x38c5
movl %eax, %edx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x2050
movq %rbx, %rdi
pushq $0x1
popq %rsi
pushq $0xa
popq %rdx
callq 0x21a0
incq %r14
jmp 0x402d
movq -0x38(%rbp), %r12
movq -0x30(%rbp), %r14
jmp 0x4003
movq %rbx, %rax
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4116
movq %rax, %r14
movq %rbx, %rdi
callq 0x20b0
movq %r14, %rdi
callq 0x22c0
nop