// File: 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
subq $0x4f0, %rsp            # imm = 0x4F0
movq %rsi, -0x400(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x408(%rbp)
addq $0x28, %rdi
movq %rdi, -0x410(%rbp)
callq 0x46f0
movq -0x408(%rbp), %rax
movq -0x400(%rbp), %rsi
movq $0x0, 0x8(%rax)
leaq -0x220(%rbp), %rdi
movl $0x8, %edx
callq 0x2220
jmp 0x370e
movq -0x408(%rbp), %rsi
addq $0x4, %rsi
leaq -0x220(%rbp), %rdi
callq 0x20f0
jmp 0x3727
movq -0x408(%rbp), %rax
movslq 0x4(%rax), %rax
movq %rax, -0x420(%rbp)
movl $0x18, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
addq $0x8, %rdi
movq $-0x1, %rax
cmovbq %rax, %rdi
testb %cl, %cl
cmovneq %rax, %rdi
callq 0x2030
movq %rax, -0x418(%rbp)
jmp 0x376a
movq -0x420(%rbp), %rax
movq -0x418(%rbp), %rcx
movq %rax, (%rcx)
addq $0x8, %rcx
movq %rcx, -0x428(%rbp)
cmpq $0x0, %rax
je 0x37e3
movq -0x428(%rbp), %rax
movq -0x420(%rbp), %rcx
imulq $0x18, %rcx, %rdx
movq %rax, %rcx
addq %rdx, %rcx
movq %rcx, -0x438(%rbp)
movq %rax, -0x430(%rbp)
movq -0x430(%rbp), %rdi
movq %rdi, -0x440(%rbp)
callq 0x4710
movq -0x440(%rbp), %rax
movq -0x438(%rbp), %rcx
addq $0x18, %rax
cmpq %rcx, %rax
movq %rax, -0x430(%rbp)
jne 0x37b2
movq -0x408(%rbp), %rax
movq -0x428(%rbp), %rcx
movq %rcx, 0x10(%rax)
movslq 0x4(%rax), %rax
movq %rax, -0x450(%rbp)
movl $0x70, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
addq $0x8, %rdi
movq $-0x1, %rax
cmovbq %rax, %rdi
testb %cl, %cl
cmovneq %rax, %rdi
callq 0x2030
movq %rax, -0x448(%rbp)
jmp 0x3831
movq -0x450(%rbp), %rax
movq -0x448(%rbp), %rcx
movq %rax, (%rcx)
addq $0x8, %rcx
movq %rcx, -0x458(%rbp)
cmpq $0x0, %rax
je 0x38ac
movq -0x458(%rbp), %rax
movq -0x450(%rbp), %rcx
imulq $0x70, %rcx, %rdx
movq %rax, %rcx
addq %rdx, %rcx
movq %rcx, -0x468(%rbp)
movq %rax, -0x460(%rbp)
movq -0x460(%rbp), %rdi
movq %rdi, -0x470(%rbp)
callq 0x28a0
jmp 0x388e
movq -0x468(%rbp), %rcx
movq -0x470(%rbp), %rax
addq $0x70, %rax
cmpq %rcx, %rax
movq %rax, -0x460(%rbp)
jne 0x3879
movq -0x408(%rbp), %rax
movq -0x458(%rbp), %rcx
movq %rcx, 0x20(%rax)
movq -0x220(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x220(%rbp,%rax), %rdi
callq 0x2260
movb %al, -0x471(%rbp)
jmp 0x38de
movb -0x471(%rbp), %al
testb $0x1, %al
jne 0x38ed
jmp 0x3b25
leaq -0x250(%rbp), %rdi
callq 0x21e0
movl $0x0, -0x14(%rbp)
movq -0x408(%rbp), %rcx
movl -0x14(%rbp), %eax
cmpl 0x4(%rcx), %eax
jge 0x3b06
movq -0x408(%rbp), %rax
movq 0x20(%rax), %rsi
movslq -0x14(%rbp), %rax
imulq $0x70, %rax, %rax
addq %rax, %rsi
leaq -0x220(%rbp), %rdi
callq 0x20f0
movq %rax, -0x480(%rbp)
jmp 0x393e
movq -0x480(%rbp), %rdi
movq -0x408(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x14(%rbp), %rcx
imulq $0x70, %rcx, %rcx
leaq 0x8(%rax,%rcx), %rsi
callq 0x2120
jmp 0x3964
leaq -0x220(%rbp), %rdi
leaq -0x250(%rbp), %rsi
callq 0x2050
jmp 0x3979
leaq -0x3d8(%rbp), %rdi
leaq -0x250(%rbp), %rsi
movl $0x8, %edx
callq 0x2250
jmp 0x3993
jmp 0x3995
leaq -0x3d8(%rbp), %rdi
leaq -0x254(%rbp), %rsi
callq 0x20f0
movq %rax, -0x488(%rbp)
jmp 0x39b1
movq -0x488(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x21b0
movb %al, -0x489(%rbp)
jmp 0x39cf
movb -0x489(%rbp), %al
testb $0x1, %al
jne 0x39de
jmp 0x3aec
movq -0x408(%rbp), %rax
movq 0x20(%rax), %rcx
movslq -0x14(%rbp), %rdx
imulq $0x70, %rdx, %rdx
movl 0x68(%rcx,%rdx), %esi
incl %esi
movl %esi, 0x68(%rcx,%rdx)
movq 0x10(%rax), %rax
movslq -0x14(%rbp), %rcx
leaq (%rcx,%rcx,2), %rcx
leaq (%rax,%rcx,8), %rdi
leaq -0x254(%rbp), %rsi
callq 0x4730
jmp 0x3a19
jmp 0x3995
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x228(%rbp)
movl %eax, -0x22c(%rbp)
jmp 0x3d5f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x228(%rbp)
movl %eax, -0x22c(%rbp)
jmp 0x3d53
movq -0x458(%rbp), %rcx
movq %rax, %rsi
movq -0x470(%rbp), %rax
movq %rsi, -0x228(%rbp)
movl %edx, -0x22c(%rbp)
cmpq %rax, %rcx
movq %rax, -0x498(%rbp)
je 0x3aa7
movq -0x498(%rbp), %rdi
addq $-0x70, %rdi
movq %rdi, -0x4a0(%rbp)
callq 0x28f0
movq -0x458(%rbp), %rcx
movq -0x4a0(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x498(%rbp)
jne 0x3a76
movq -0x448(%rbp), %rdi
callq 0x21c0
jmp 0x3d53
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x228(%rbp)
movl %eax, -0x22c(%rbp)
jmp 0x3b14
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x228(%rbp)
movl %eax, -0x22c(%rbp)
leaq -0x3d8(%rbp), %rdi
callq 0x20c0
jmp 0x3b14
leaq -0x3d8(%rbp), %rdi
callq 0x20c0
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x3900
leaq -0x250(%rbp), %rdi
callq 0x2100
jmp 0x3b25
leaq -0x250(%rbp), %rdi
callq 0x2100
jmp 0x3d53
movq -0x408(%rbp), %rsi
leaq -0x220(%rbp), %rdi
callq 0x20f0
jmp 0x3b3a
movq -0x408(%rbp), %rax
movslq (%rax), %rax
movq %rax, -0x4b0(%rbp)
movl $0x20, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
addq $0x8, %rdi
movq $-0x1, %rax
cmovbq %rax, %rdi
testb %cl, %cl
cmovneq %rax, %rdi
callq 0x2030
movq %rax, -0x4a8(%rbp)
jmp 0x3b7c
movq -0x4b0(%rbp), %rax
movq -0x4a8(%rbp), %rcx
movq %rax, (%rcx)
addq $0x8, %rcx
movq %rcx, -0x4b8(%rbp)
cmpq $0x0, %rax
je 0x3bf7
movq -0x4b8(%rbp), %rax
movq -0x4b0(%rbp), %rdx
shlq $0x5, %rdx
movq %rax, %rcx
addq %rdx, %rcx
movq %rcx, -0x4c8(%rbp)
movq %rax, -0x4c0(%rbp)
movq -0x4c0(%rbp), %rdi
movq %rdi, -0x4d0(%rbp)
callq 0x2820
jmp 0x3bd9
movq -0x4c8(%rbp), %rcx
movq -0x4d0(%rbp), %rax
addq $0x20, %rax
cmpq %rcx, %rax
movq %rax, -0x4c0(%rbp)
jne 0x3bc4
movq -0x408(%rbp), %rax
movq -0x4b8(%rbp), %rcx
movq %rcx, 0x18(%rax)
movl $0x0, -0x14(%rbp)
movq -0x408(%rbp), %rcx
movl -0x14(%rbp), %eax
cmpl (%rcx), %eax
jge 0x3cf8
leaq -0x220(%rbp), %rdi
leaq -0x3e0(%rbp), %rsi
callq 0x2120
jmp 0x3c37
movq -0x408(%rbp), %rax
movq 0x18(%rax), %rdi
movslq -0x14(%rbp), %rax
movl %eax, %esi
shlq $0x5, %rax
addq %rax, %rdi
movsd -0x3e0(%rbp), %xmm0
callq 0x2860
jmp 0x3c5e
movq -0x408(%rbp), %rax
movq %rax, %rdi
addq $0x28, %rdi
movq 0x18(%rax), %rsi
movslq -0x14(%rbp), %rax
shlq $0x5, %rax
addq %rax, %rsi
callq 0x4770
jmp 0x3c82
jmp 0x3c84
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x3c10
movq -0x4b8(%rbp), %rcx
movq %rax, %rsi
movq -0x4d0(%rbp), %rax
movq %rsi, -0x228(%rbp)
movl %edx, -0x22c(%rbp)
cmpq %rax, %rcx
movq %rax, -0x4d8(%rbp)
je 0x3cea
movq -0x4d8(%rbp), %rdi
addq $-0x20, %rdi
movq %rdi, -0x4e0(%rbp)
callq 0x2850
movq -0x4b8(%rbp), %rcx
movq -0x4e0(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x4d8(%rbp)
jne 0x3cb9
movq -0x4a8(%rbp), %rdi
callq 0x21c0
jmp 0x3d53
movq -0x408(%rbp), %rdi
addq $0x28, %rdi
movq %rdi, -0x4e8(%rbp)
callq 0x4820
movq -0x4e8(%rbp), %rdi
movq %rax, -0x3e8(%rbp)
callq 0x4850
movq %rax, -0x3f0(%rbp)
movq -0x3e8(%rbp), %rdi
movq -0x3f0(%rbp), %rsi
callq 0x47e0
jmp 0x3d3e
leaq -0x220(%rbp), %rdi
callq 0x2060
addq $0x4f0, %rsp            # imm = 0x4F0
popq %rbp
retq
leaq -0x220(%rbp), %rdi
callq 0x2060
movq -0x410(%rbp), %rdi
callq 0x4880
movq -0x228(%rbp), %rdi
callq 0x2280
nopw (%rax,%rax)