// File: /workspace/github_cpp_makefile_star2_O1/AndrewAlbert[P]Compiler-Theory/SourceCode/codeGenerator.cpp
// Function: codeGenerator::NotOnRegister(int, int)
void codeGenerator::NotOnRegister( int type, int size ){
	if( !ShouldGenerate() ) return;
	string reg;
	comment("Not Operation on Register");
	
	//Ensure size is at least 1 for the loops
	if( size == 0 ) size++;
	
	for( int i = 0; i < size; i++ ){
		reg = popStack('E', type);
		pushStack( reg, 'R', type );
	}
	for( int i = 0; i < size; i++ ){
		reg = popStack('R', type);
		pushStack(reg, 'E', type);
		if( type == TYPE_BOOL ){
			// boolean not
			fprintf( oFile, "   %s = !( %s );\n", reg.c_str(), reg.c_str() );
		}
		else if( type == TYPE_INTEGER ){
			// bitwise not
			fprintf( oFile, "   %s = ~( %s );\n", reg.c_str(), reg.c_str() );
		}
	}
	return;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
cmpb $0x1, 0x330(%rdi)
jne 0x133b6
movl %edx, %r13d
movl %esi, %ebp
movq %rdi, %r14
leaq 0x18(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x98(%rsp), %rbx
movq %rbx, -0x10(%rbx)
leaq 0x7c9a(%rip), %rsi      # 0x1ae27
leaq 0x7cac(%rip), %rdx      # 0x1ae40
leaq 0x88(%rsp), %rdi
callq 0x3c34
movq 0x308(%r14), %rdi
movq 0x88(%rsp), %rdx
leaq 0x7868(%rip), %rsi      # 0x1aa1f
xorl %eax, %eax
callq 0x22a0
movq 0x88(%rsp), %rdi
cmpq %rbx, %rdi
je 0x131db
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x2200
cmpl $0x1, %r13d
adcl $0x0, %r13d
testl %r13d, %r13d
jle 0x13292
leaq 0x38(%rsp), %r15
leaq 0x180(%r14), %rax
movq %rax, (%rsp)
leaq 0x48(%rsp), %r12
movl %r13d, %ebx
movq %r12, %rdi
movq %r14, %rsi
movl $0x45, %edx
movl %ebp, %ecx
callq 0x11b40
leaq 0x8(%rsp), %rdi
movq %r12, %rsi
callq 0x2270
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x1323f
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x2200
movq %r15, 0x28(%rsp)
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
addq %rsi, %rdx
leaq 0x28(%rsp), %rdi
callq 0x3ba4
cmpb $0x1, 0x330(%r14)
jne 0x13273
movq (%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x176d0
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0x1328a
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x2200
decl %ebx
jne 0x13204
testl %r13d, %r13d
jle 0x1339a
leaq 0x78(%rsp), %r15
leaq 0x130(%r14), %rax
movq %rax, (%rsp)
leaq 0x48(%rsp), %r12
leaq 0x68(%rsp), %rbx
movq %r12, %rdi
movq %r14, %rsi
movl $0x52, %edx
movl %ebp, %ecx
callq 0x11b40
leaq 0x8(%rsp), %rdi
movq %r12, %rsi
callq 0x2270
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x132f0
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x2200
movq %r15, 0x68(%rsp)
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
addq %rsi, %rdx
movq %rbx, %rdi
callq 0x3ba4
cmpb $0x1, 0x330(%r14)
jne 0x13338
movq (%rsp), %rdi
movq %rbx, %rsi
callq 0x176d0
cmpl $0x10b, %ebp            # imm = 0x10B
jne 0x13331
incl 0x124(%r14)
jmp 0x13338
incl 0x120(%r14)
movq 0x68(%rsp), %rdi
cmpq %r15, %rdi
je 0x1334f
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x2200
cmpl $0x10a, %ebp            # imm = 0x10A
je 0x13374
cmpl $0x10c, %ebp            # imm = 0x10C
jne 0x13391
movq 0x308(%r14), %rdi
movq 0x8(%rsp), %rcx
leaq 0x7acf(%rip), %rsi      # 0x1ae41
jmp 0x13387
movq 0x308(%r14), %rdi
movq 0x8(%rsp), %rcx
leaq 0x7acc(%rip), %rsi      # 0x1ae53
movq %rcx, %rdx
xorl %eax, %eax
callq 0x22a0
decl %r13d
jne 0x132b5
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x133b6
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2200
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x13400
movq %rax, %rbx
movq 0x68(%rsp), %rdi
cmpq %r15, %rdi
je 0x13403
movq 0x78(%rsp), %rsi
jmp 0x133f0
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0x13403
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x2200
jmp 0x13403
jmp 0x13400
jmp 0x13400
jmp 0x13400
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x1341f
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2200
movq %rbx, %rdi
callq 0x2330
nop