// File: ys1998[P]spsim/src/lists.cpp
// Function: FreeList::add(int)
void FreeList::add(int reg){
	if(reg < 0 || reg >= NUM_PHY_REGS)
		error_msg("free_list", std::string("Index ") + std::to_string(reg) + " greater than maximum size (" + std::to_string(NUM_PHY_REGS) + ")");
	if(free[reg]){
		if(LOG_LEVEL >= 1)
			warning_msg("free_list", std::string("Register ") + std::to_string(reg) + " is already free; can't add to free list");
	}else{
		free[reg] = true;	
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x210, %rsp            # imm = 0x210
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x1e8(%rbp)
cmpl $0x0, -0xc(%rbp)
jl 0x12bed
cmpl $0x40, -0xc(%rbp)
jl 0x12e52
leaq -0x31(%rbp), %rdi
movq %rdi, -0x1f0(%rbp)
callq 0x3490
movq -0x1f0(%rbp), %rdx
leaq 0xf645(%rip), %rsi      # 0x22250
leaq -0x30(%rbp), %rdi
callq 0x6020
jmp 0x12c16
leaq -0xe9(%rbp), %rdi
movq %rdi, -0x1f8(%rbp)
callq 0x3490
movq -0x1f8(%rbp), %rdx
leaq 0xf623(%rip), %rsi      # 0x2225a
leaq -0xe8(%rbp), %rdi
callq 0x6020
jmp 0x12c45
movl -0xc(%rbp), %esi
leaq -0x110(%rbp), %rdi
callq 0x10880
jmp 0x12c56
leaq -0xc8(%rbp), %rdi
leaq -0xe8(%rbp), %rsi
leaq -0x110(%rbp), %rdx
callq 0x10650
jmp 0x12c72
leaq 0xf5e8(%rip), %rdx      # 0x22261
leaq -0xa8(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
callq 0x10720
jmp 0x12c8e
leaq -0x130(%rbp), %rdi
movl $0x40, %esi
callq 0x10880
jmp 0x12ca1
leaq -0x88(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
leaq -0x130(%rbp), %rdx
callq 0x10650
jmp 0x12cbd
leaq 0xf3da(%rip), %rdx      # 0x2209e
leaq -0x68(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x10720
jmp 0x12cd6
leaq -0x30(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x163d0
jmp 0x12ce5
leaq -0x68(%rbp), %rdi
callq 0x31e0
leaq -0x88(%rbp), %rdi
callq 0x31e0
leaq -0x130(%rbp), %rdi
callq 0x31e0
leaq -0xa8(%rbp), %rdi
callq 0x31e0
leaq -0xc8(%rbp), %rdi
callq 0x31e0
leaq -0x110(%rbp), %rdi
callq 0x31e0
leaq -0xe8(%rbp), %rdi
callq 0x31e0
leaq -0xe9(%rbp), %rdi
callq 0x3300
leaq -0x30(%rbp), %rdi
callq 0x31e0
leaq -0x31(%rbp), %rdi
callq 0x3300
jmp 0x12e52
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x12e44
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x12e2f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x12e23
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x12e17
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x12e0b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x12dff
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x12df3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x12de7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x31e0
leaq -0x88(%rbp), %rdi
callq 0x31e0
leaq -0x130(%rbp), %rdi
callq 0x31e0
leaq -0xa8(%rbp), %rdi
callq 0x31e0
leaq -0xc8(%rbp), %rdi
callq 0x31e0
leaq -0x110(%rbp), %rdi
callq 0x31e0
leaq -0xe8(%rbp), %rdi
callq 0x31e0
leaq -0xe9(%rbp), %rdi
callq 0x3300
leaq -0x30(%rbp), %rdi
callq 0x31e0
leaq -0x31(%rbp), %rdi
callq 0x3300
jmp 0x13051
movq -0x1e8(%rbp), %rax
movslq -0xc(%rbp), %rcx
testb $0x1, (%rax,%rcx)
je 0x13039
leaq 0x1c42a(%rip), %rax     # 0x2f298
cmpl $0x1, (%rax)
jl 0x13037
leaq -0x151(%rbp), %rdi
movq %rdi, -0x200(%rbp)
callq 0x3490
movq -0x200(%rbp), %rdx
leaq 0xf3b8(%rip), %rsi      # 0x22250
leaq -0x150(%rbp), %rdi
callq 0x6020
jmp 0x12ea6
leaq -0x1b9(%rbp), %rdi
movq %rdi, -0x208(%rbp)
callq 0x3490
movq -0x208(%rbp), %rdx
leaq 0xf3b7(%rip), %rsi      # 0x2227e
leaq -0x1b8(%rbp), %rdi
callq 0x6020
jmp 0x12ed5
movl -0xc(%rbp), %esi
leaq -0x1e0(%rbp), %rdi
callq 0x10880
jmp 0x12ee6
leaq -0x198(%rbp), %rdi
leaq -0x1b8(%rbp), %rsi
leaq -0x1e0(%rbp), %rdx
callq 0x10650
jmp 0x12f02
leaq 0xf37f(%rip), %rdx      # 0x22288
leaq -0x178(%rbp), %rdi
leaq -0x198(%rbp), %rsi
callq 0x10720
jmp 0x12f1e
leaq -0x150(%rbp), %rdi
leaq -0x178(%rbp), %rsi
callq 0x16960
jmp 0x12f33
leaq -0x178(%rbp), %rdi
callq 0x31e0
leaq -0x198(%rbp), %rdi
callq 0x31e0
leaq -0x1e0(%rbp), %rdi
callq 0x31e0
leaq -0x1b8(%rbp), %rdi
callq 0x31e0
leaq -0x1b9(%rbp), %rdi
callq 0x3300
leaq -0x150(%rbp), %rdi
callq 0x31e0
leaq -0x151(%rbp), %rdi
callq 0x3300
jmp 0x13037
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x13029
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x13011
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x13005
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x12ff9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x12fed
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x178(%rbp), %rdi
callq 0x31e0
leaq -0x198(%rbp), %rdi
callq 0x31e0
leaq -0x1e0(%rbp), %rdi
callq 0x31e0
leaq -0x1b8(%rbp), %rdi
callq 0x31e0
leaq -0x1b9(%rbp), %rdi
callq 0x3300
leaq -0x150(%rbp), %rdi
callq 0x31e0
leaq -0x151(%rbp), %rdi
callq 0x3300
jmp 0x13051
jmp 0x13048
movq -0x1e8(%rbp), %rax
movslq -0xc(%rbp), %rcx
movb $0x1, (%rax,%rcx)
addq $0x210, %rsp            # imm = 0x210
popq %rbp
retq
movq -0x40(%rbp), %rdi
callq 0x3480
nopw (%rax,%rax)