// File: /workspace/github_cpp_makefile_star2_O3/suyunu[P]Discrete-Event-Simulation/RandQueuing.cpp
// Function: RandQueuing::RandQueuing(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
RandQueuing::RandQueuing(string fname){
	int i, j;
	
	currentTime = 0;
	
	ifstream fin (fname);
	
	fin >> N_unit;
	
	adj = new list<int>[N_unit];
	units = new Unit[N_unit];
	
	if (fin.good()){
		string str;
		for(i = 0 ; i < N_unit ; i++){
			int d;
			fin >> units[i].no >> units[i].procTime;;
			getline(fin, str);
			istringstream ss(str);
			while(ss >> d){
				units[i].edges++;
				adj[i].push_back(d);
			}
		}
	}
	
	fin >> N_job;
	jobs = new Job[N_job];
	
	for(i = 0 ; i < N_job ; i++){
		double enter_time;
		fin >> enter_time;
		jobs[i].initialize(i, enter_time);
		order.push_back(jobs[i]);
	}
	
	make_heap(order.begin(), order.end(), greater1());

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x3c8, %rsp            # imm = 0x3C8
movq %rdi, %r14
leaq 0x28(%rdi), %rax
movq %rax, -0x48(%rbp)
xorps %xmm0, %xmm0
movups %xmm0, 0x28(%rdi)
xorl %eax, %eax
movq %rax, 0x38(%rdi)
movq %rax, 0x8(%rdi)
leaq -0x270(%rbp), %rdi
movl $0x8, %edx
callq 0x2200
leaq 0x4(%r14), %rsi
leaq -0x270(%rbp), %rdi
movq %rsi, -0x38(%rbp)
callq 0x20e0
movq -0x38(%rbp), %rax
movslq (%rax), %rbx
movl $0x18, %ecx
movq %rbx, %rax
mulq %rcx
seto %cl
addq $0x8, %rax
movq $-0x1, %rdi
cmovbq %rdi, %rax
testb %cl, %cl
cmoveq %rax, %rdi
callq 0x2030
movq %rax, %rcx
movq %rbx, (%rax)
addq $0x8, %rcx
testl %ebx, %ebx
je 0x2ab5
leaq (%rbx,%rbx,2), %rax
leaq (%rcx,%rax,8), %rax
movq %rcx, %rdx
movq %rdx, 0x8(%rdx)
movq %rdx, (%rdx)
movq $0x0, 0x10(%rdx)
addq $0x18, %rdx
cmpq %rax, %rdx
jne 0x2a9d
movl $0x70, %edx
movq %rbx, %rax
mulq %rdx
seto %dl
orq $0x8, %rax
movq %rcx, 0x10(%r14)
movq $-0x1, %rdi
testb %dl, %dl
cmoveq %rax, %rdi
callq 0x2030
leaq 0x8(%rax), %r13
movq %rax, -0x30(%rbp)
movq %rbx, (%rax)
testl %ebx, %ebx
je 0x2b0b
imulq $-0x70, %rbx, %r15
xorl %r12d, %r12d
movq %r13, %rbx
movq %rbx, %rdi
callq 0x26c8
addq $-0x70, %r12
addq $0x70, %rbx
cmpq %r12, %r15
jne 0x2af6
movq %r13, 0x20(%r14)
movq -0x270(%rbp), %rax
movq -0x18(%rax), %rax
cmpl $0x0, -0x250(%rbp,%rax)
je 0x2c11
leaq -0x270(%rbp), %rdi
movq %r14, %rsi
callq 0x20e0
movslq (%r14), %rbx
movq %rbx, %r12
shlq $0x5, %r12
leaq 0x8(%r12), %rax
testq %rbx, %rbx
movq $-0x1, %rdi
cmovnsq %rax, %rdi
callq 0x2030
movq %rbx, (%rax)
leaq 0x8(%rax), %r15
testl %ebx, %ebx
je 0x2d50
movq %rax, -0x30(%rbp)
negq %r12
xorl %r13d, %r13d
movq %r15, %rbx
movq %rbx, %rdi
callq 0x268c
addq $-0x20, %r13
addq $0x20, %rbx
cmpq %r13, %r12
jne 0x2b75
cmpl $0x0, (%r14)
movq %r15, 0x18(%r14)
jle 0x2d54
xorl %r13d, %r13d
leaq -0x270(%rbp), %rbx
leaq -0x3f0(%rbp), %r15
xorl %r12d, %r12d
movq %rbx, %rdi
movq %r15, %rsi
callq 0x20f0
movq 0x18(%r14), %rdi
addq %r13, %rdi
movsd -0x3f0(%rbp), %xmm0
movl %r12d, %esi
callq 0x26ac
movq 0x18(%r14), %rdx
addq %r13, %rdx
movq 0x30(%r14), %rsi
cmpq 0x38(%r14), %rsi
je 0x2bf4
movups (%rdx), %xmm0
movups 0x10(%rdx), %xmm1
movups %xmm1, 0x10(%rsi)
movups %xmm0, (%rsi)
addq $0x20, 0x30(%r14)
jmp 0x2bfd
movq -0x48(%rbp), %rdi
callq 0x36e8
incq %r12
movslq (%r14), %rax
addq $0x20, %r13
cmpq %rax, %r12
jl 0x2bac
jmp 0x2d54
leaq -0x58(%rbp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movq -0x38(%rbp), %rax
cmpl $0x0, (%rax)
jle 0x2b28
xorl %r15d, %r15d
leaq -0x68(%rbp), %r12
leaq -0x3f0(%rbp), %r13
imulq $0x70, %r15, %rbx
movq 0x20(%r14), %rsi
addq %rbx, %rsi
leaq -0x270(%rbp), %rdi
callq 0x20e0
movq 0x20(%r14), %rcx
leaq (%rcx,%rbx), %rsi
addq $0x8, %rsi
movq %rax, %rdi
callq 0x20f0
movq -0x270(%rbp), %rax
movq -0x18(%rax), %rdi
leaq -0x270(%rbp), %rax
addq %rax, %rdi
movl $0xa, %esi
callq 0x2170
movsbl %al, %edx
leaq -0x270(%rbp), %rdi
movq %r12, %rsi
callq 0x2260
movq %r13, %rdi
movq %r12, %rsi
movl $0x8, %edx
callq 0x2230
movq %r15, -0x30(%rbp)
leaq (%r15,%r15,2), %r15
movq %r13, %rdi
leaq -0x3c(%rbp), %rsi
callq 0x20e0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x2cff
movq 0x20(%r14), %rax
incl 0x68(%rax,%rbx)
movq 0x10(%r14), %r12
movl $0x18, %edi
callq 0x2180
leaq (%r12,%r15,8), %r12
movl -0x3c(%rbp), %ecx
movl %ecx, 0x10(%rax)
movq %rax, %rdi
movq %r12, %rsi
callq 0x2050
incq 0x10(%r12)
jmp 0x2cb3
movq %r13, %rdi
movq 0x42cf(%rip), %rsi      # 0x6fd8
callq 0x21b0
leaq -0x378(%rbp), %rdi
callq 0x2090
movq -0x30(%rbp), %r15
incq %r15
movq -0x38(%rbp), %rax
movslq (%rax), %rax
cmpq %rax, %r15
leaq -0x68(%rbp), %r12
jl 0x2c3f
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x2b28
callq 0x2150
jmp 0x2b28
movq %r15, 0x18(%r14)
movq 0x28(%r14), %rdi
movq 0x30(%r14), %rsi
leaq -0x3f0(%rbp), %rdx
callq 0x386e
leaq -0x270(%rbp), %rdi
callq 0x2060
addq $0x3c8, %rsp            # imm = 0x3C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x2e2d
jmp 0x2de3
jmp 0x2de8
movq %rax, %rbx
testq %r13, %r13
je 0x2dd8
negq %r13
movq -0x30(%rbp), %r14
addq $-0x18, %r14
leaq (%r14,%r13), %rdi
callq 0x26a6
addq $-0x20, %r13
jne 0x2da5
jmp 0x2dd8
movq %rax, %rbx
testq %r12, %r12
je 0x2dd8
negq %r12
movq -0x30(%rbp), %r14
addq $-0x68, %r14
leaq (%r14,%r12), %rdi
callq 0x270e
addq $-0x70, %r12
jne 0x2dc9
movq -0x30(%rbp), %rdi
callq 0x21a0
jmp 0x2e21
movq %rax, %rbx
jmp 0x2e21
movq %rax, %rbx
jmp 0x2e0f
movq %rax, %rbx
movq 0x41e1(%rip), %rsi      # 0x6fd8
leaq -0x3f0(%rbp), %rdi
callq 0x21b0
leaq -0x378(%rbp), %rdi
callq 0x2090
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x2e21
callq 0x2150
leaq -0x270(%rbp), %rdi
callq 0x2060
movq -0x48(%rbp), %rdi
callq 0x357a
movq %rbx, %rdi
callq 0x2250