// File: /workspace/github_cpp_makefile_star2_O2/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, -0x40(%rbp)
xorps %xmm0, %xmm0
andq $0x0, 0x38(%rdi)
movups %xmm0, 0x28(%rdi)
andq $0x0, 0x8(%rdi)
leaq -0x270(%rbp), %rdi
pushq $0x8
popq %rdx
callq 0x21e0
leaq 0x4(%r14), %rsi
leaq -0x270(%rbp), %rdi
movq %rsi, -0x38(%rbp)
callq 0x2100
movq -0x38(%rbp), %rax
movslq (%rax), %rbx
pushq $0x18
popq %rcx
movq %rbx, %rax
mulq %rcx
seto %cl
addq $0x8, %rax
pushq $-0x1
popq %rdx
cmovbq %rdx, %rax
testb %cl, %cl
cmovneq %rdx, %rax
movq %rax, %rdi
callq 0x2030
movq %rax, %rcx
movq %rbx, (%rax)
addq $0x8, %rcx
testl %ebx, %ebx
je 0x2aac
imulq $0x18, %rbx, %rax
addq %rcx, %rax
movq %rcx, %rdx
movq %rdx, 0x8(%rdx)
movq %rdx, (%rdx)
andq $0x0, 0x10(%rdx)
addq $0x18, %rdx
cmpq %rax, %rdx
jne 0x2a97
pushq $0x70
popq %rdx
movq %rbx, %rax
mulq %rdx
seto %dl
orq $0x8, %rax
movq %rcx, 0x10(%r14)
testb %dl, %dl
pushq $-0x1
popq %rcx
cmovneq %rcx, %rax
movq %rax, %rdi
callq 0x2030
leaq 0x8(%rax), %r13
movq %rax, -0x30(%rbp)
movq %rbx, (%rax)
testl %ebx, %ebx
je 0x2aff
imulq $-0x70, %rbx, %r15
xorl %r12d, %r12d
movq %r13, %rbx
movq %rbx, %rdi
callq 0x25f0
addq $-0x70, %r12
addq $0x70, %rbx
cmpq %r12, %r15
jne 0x2aea
movq %r13, 0x20(%r14)
movq -0x270(%rbp), %rax
movq -0x18(%rax), %rax
cmpl $0x0, -0x250(%rbp,%rax)
jne 0x2bec
leaq -0x58(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
xorl %r12d, %r12d
leaq -0x3f0(%rbp), %r15
leaq -0x44(%rbp), %rbx
movq -0x38(%rbp), %rax
movslq (%rax), %rax
cmpq %rax, %r12
jge 0x2be3
imulq $0x70, %r12, %r13
movq 0x20(%r14), %rsi
addq %r13, %rsi
leaq -0x270(%rbp), %rdi
callq 0x2100
movq 0x20(%r14), %rcx
leaq (%rcx,%r13), %rsi
addq $0x8, %rsi
movq %rax, %rdi
callq 0x2110
leaq -0x270(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x2050
movq %r15, %rdi
leaq -0x68(%rbp), %rsi
pushq $0x8
popq %rdx
callq 0x2210
movq %r12, -0x30(%rbp)
imulq $0x18, %r12, %r12
movq %r15, %rdi
movq %rbx, %rsi
callq 0x2100
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x2bcf
movq 0x20(%r14), %rax
incl 0x68(%rax,%r13)
movq 0x10(%r14), %rdi
addq %r12, %rdi
movq %rbx, %rsi
callq 0x321e
jmp 0x2b9c
movq %r15, %rdi
callq 0x20d0
movq -0x30(%rbp), %r12
incq %r12
jmp 0x2b3a
leaq -0x68(%rbp), %rdi
callq 0x20c0
leaq -0x270(%rbp), %rdi
movq %r14, %rsi
callq 0x2100
movslq (%r14), %r15
movq %r15, %r12
shlq $0x5, %r12
leaq 0x8(%r12), %rdi
testq %r15, %r15
pushq $-0x1
popq %rax
cmovsq %rax, %rdi
callq 0x2030
movq %r15, (%rax)
movq %rax, -0x30(%rbp)
leaq 0x8(%rax), %rbx
testl %r15d, %r15d
je 0x2c47
negq %r12
xorl %r13d, %r13d
movq %rbx, %r15
movq %r15, %rdi
callq 0x25c0
addq $-0x20, %r13
addq $0x20, %r15
cmpq %r13, %r12
jne 0x2c32
movq %rbx, 0x18(%r14)
xorl %r13d, %r13d
leaq -0x270(%rbp), %rbx
leaq -0x3f0(%rbp), %r15
xorl %r12d, %r12d
movslq (%r14), %rax
cmpq %rax, %r12
jge 0x2ca2
movq %rbx, %rdi
movq %r15, %rsi
callq 0x2110
movq 0x18(%r14), %rdi
addq %r13, %rdi
movsd -0x3f0(%rbp), %xmm0
movl %r12d, %esi
callq 0x25da
movq 0x18(%r14), %rsi
addq %r13, %rsi
movq -0x40(%rbp), %rdi
callq 0x322e
incq %r12
addq $0x20, %r13
jmp 0x2c5f
movq 0x28(%r14), %rdi
movq 0x30(%r14), %rsi
callq 0x325a
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, %r14
jmp 0x2d58
jmp 0x2d2f
jmp 0x2d2a
movq %rax, %r14
testq %r13, %r13
je 0x2d1f
negq %r13
movq -0x30(%rbp), %rbx
addq $-0x18, %rbx
leaq (%rbx,%r13), %rdi
callq 0x25d4
addq $-0x20, %r13
jne 0x2cec
jmp 0x2d1f
movq %rax, %r14
testq %r12, %r12
je 0x2d1f
negq %r12
movq -0x30(%rbp), %rbx
addq $-0x68, %rbx
leaq (%rbx,%r12), %rdi
callq 0x261c
addq $-0x70, %r12
jne 0x2d10
movq -0x30(%rbp), %rdi
callq 0x2190
jmp 0x2d4c
movq %rax, %r14
jmp 0x2d43
movq %rax, %r14
jmp 0x2d4c
movq %rax, %r14
leaq -0x3f0(%rbp), %rdi
callq 0x20d0
leaq -0x68(%rbp), %rdi
callq 0x20c0
leaq -0x270(%rbp), %rdi
callq 0x2060
movq -0x40(%rbp), %rdi
callq 0x3272
movq %r14, %rdi
callq 0x2230
nop