// File: /workspace/github_cpp_makefile_star2_O1/flastest[P]HeterogeneousParallelDijkstra/./graph_gen.hh
// Function: generate_graph(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int, int)
void generate_graph(std::string file_name, int number_of_nodes, int number_of_edges)
{
	srand(time(0));
	ofstream file_stream;
	file_stream.open (file_name);

	file_stream << "# a graph with "<< number_of_nodes << " nodes and " << number_of_edges << " edges.\n";
	file_stream << "# in general, I saw it was good to have 5 times as many edges as nodes to get a fully connected graph.\n";


	for (int i = 1; i <= number_of_edges; i++)
	{
    int point_a = rand() % number_of_nodes;
    int point_b = (rand() % number_of_nodes);
    //std::cout<<"point_a is "<<point_a<<std::endl;
    if (point_b == point_a)
    {
    //    std::cout<<"point_b is "<<point_b<<std::endl;
        point_b =(point_b + 1) % number_of_nodes;
    //    std::cout<<"point_b is changed to "<<point_b<<std::endl;

    } 
		file_stream << 	to_string(point_a) << " " << to_string(point_b);
		if (i < number_of_edges) file_stream << "\n";
	}

	file_stream.close();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x248, %rsp            # imm = 0x248
movl %edx, %r12d
movl %esi, (%rsp)
movq %rdi, %r14
xorl %edi, %edi
callq 0x3270
movl %eax, %edi
callq 0x3280
leaq 0x48(%rsp), %r15
movq %r15, %rdi
callq 0x3440
movq %r15, %rdi
movq %r14, %rsi
movl $0x10, %edx
callq 0x3150
leaq 0xc92c(%rip), %rsi      # 0x100f4
leaq 0x48(%rsp), %rdi
movl $0xf, %edx
callq 0x3300
leaq 0x48(%rsp), %rdi
movl (%rsp), %esi
callq 0x3480
movq %rax, %r14
leaq 0xc916(%rip), %rsi      # 0x10104
movl $0xb, %edx
movq %rax, %rdi
callq 0x3300
movq %r14, %rdi
movl %r12d, %esi
callq 0x3480
leaq 0xc903(%rip), %rsi      # 0x10110
movl $0x8, %edx
movq %rax, %rdi
callq 0x3300
leaq 0xc8f8(%rip), %rsi      # 0x10119
leaq 0x48(%rsp), %rdi
movl $0x67, %edx
callq 0x3300
testl %r12d, %r12d
jle 0x3a31
movl $0x1, %ebx
movl $0xd1b71759, %ebp       # imm = 0xD1B71759
movl %r12d, 0x4(%rsp)
callq 0x30a0
cltd
movl (%rsp), %r14d
idivl %r14d
movl %edx, %r12d
callq 0x30a0
cltd
idivl %r14d
movl %edx, %r14d
cmpl %r12d, %edx
jne 0x3876
incl %r14d
movl %r14d, %eax
cltd
idivl (%rsp)
movl %edx, %r14d
movl %r12d, %r13d
negl %r13d
cmovsl %r12d, %r13d
movl $0x1, %r15d
cmpl $0xa, %r13d
jb 0x38ce
movl $0x4, %r15d
movl %r13d, %eax
cmpl $0x63, %eax
jbe 0x38c5
cmpl $0x3e7, %eax            # imm = 0x3E7
jbe 0x38cb
cmpl $0x2710, %eax           # imm = 0x2710
jb 0x38ce
movl %eax, %ecx
imulq %rbp, %rcx
shrq $0x2d, %rcx
addl $0x4, %r15d
cmpl $0x1869f, %eax          # imm = 0x1869F
movl %ecx, %eax
ja 0x3895
addl $-0x3, %r15d
jmp 0x38ce
addl $-0x2, %r15d
jmp 0x38ce
decl %r15d
shrl $0x1f, %r12d
leal (%r15,%r12), %esi
leaq 0x38(%rsp), %rax
movq %rax, 0x28(%rsp)
leaq 0x28(%rsp), %rdi
movl $0x2d, %edx
callq 0x3310
movl %r12d, %edi
addq 0x28(%rsp), %rdi
movl %r15d, %esi
movl %r13d, %edx
callq 0x9e77
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
leaq 0x48(%rsp), %rdi
callq 0x3300
movq %rax, %r12
movl $0x1, %edx
movq %rax, %rdi
leaq 0xca00(%rip), %rsi      # 0x10328
callq 0x3300
movl %r14d, %r13d
negl %r13d
cmovsl %r14d, %r13d
movl $0x1, %r15d
cmpl $0xa, %r13d
jb 0x3985
movl $0x4, %r15d
movl %r13d, %eax
cmpl $0x63, %eax
jbe 0x397c
cmpl $0x3e7, %eax            # imm = 0x3E7
jbe 0x3982
cmpl $0x2710, %eax           # imm = 0x2710
jb 0x3985
movl %eax, %ecx
imulq %rbp, %rcx
shrq $0x2d, %rcx
addl $0x4, %r15d
cmpl $0x1869f, %eax          # imm = 0x1869F
movl %ecx, %eax
ja 0x394c
addl $-0x3, %r15d
jmp 0x3985
addl $-0x2, %r15d
jmp 0x3985
decl %r15d
shrl $0x1f, %r14d
leal (%r15,%r14), %esi
leaq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
leaq 0x8(%rsp), %rdi
movl $0x2d, %edx
callq 0x3310
movl %r14d, %edi
addq 0x8(%rsp), %rdi
movl %r15d, %esi
movl %r13d, %edx
callq 0x9e77
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq %r12, %rdi
callq 0x3300
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
movl 0x4(%rsp), %r12d
je 0x39ec
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x32b0
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x3a08
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x32b0
cmpl %r12d, %ebx
jge 0x3a23
movl $0x1, %edx
leaq 0x48(%rsp), %rdi
leaq 0xc761(%rip), %rsi      # 0x1017f
callq 0x3300
leal 0x1(%rbx), %eax
cmpl %r12d, %ebx
movl %eax, %ebx
jne 0x3848
leaq 0x48(%rsp), %rdi
callq 0x3370
movq 0x1357e(%rip), %rax     # 0x16fc0
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq 0x50(%rsp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, 0x48(%rsp,%rcx)
callq 0x3240
leaq 0x140(%rsp), %rdi
callq 0x30f0
addq $0x248, %rsp            # imm = 0x248
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3a83
jmp 0x3a83
movq %rax, %rbx
jmp 0x3aca
jmp 0x3aab
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x3aae
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x32b0
jmp 0x3aae
movq %rax, %rbx
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x3aca
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x32b0
leaq 0x48(%rsp), %rdi
callq 0x33b0
movq %rbx, %rdi
callq 0x34a0