// File: /workspace/github_c_makefile_star2_O1/WereCatf[P]Gonzales/gonzales.c
// Function: printPair
void printPair(int port, int pin, char *strSystem, int port2, int pin2, char *strSystem2)
{
	char *strPrintout;
	int i=0, spacing=9;
	//Print mux
	if(pin==255) strPrintout="SYSTEM";
	else strPrintout=muxToString(port, pin, readMux(port, pin));
	for(i=0; i<=(spacing-strlen(strPrintout));i++) printf(" ");
	if(pin!=255) switch(readMux(port, pin)){
		case 0:
			printf(COLOUR_GREEN);
			break;
		case 1:
			printf(COLOUR_BLUE);
			break;
		default:
			printf(COLOUR_MAGENTA);
			break;
	}
	printf("%s" COLOUR_CLEAR " │ ", strPrintout);
	//Print pull
	if(pin==255) printf(" N/A │ ");
	else switch(readPull(port, pin)){
		case 0:
			printf(" NO  │ ");
			break;
		case 1:
			printf(COLOUR_GREEN " UP  " COLOUR_CLEAR "│ ");
			break;
		case 2:
			printf(COLOUR_GREEN "DOWN " COLOUR_CLEAR "│ ");
			break;
		default:
			printf("UKWN │ ");
			break;
	}
	if(pin==255){
		for(i=0; i<=(spacing-strlen(strSystem));i++) printf("-");
		printf(" %s │**│ ", strSystem);
	}
	else printf(COLOUR_CYAN "P%c%02d" COLOUR_CLEAR " ------ │**│ ", port+'A', pin);
	//Right side
	if(pin2==255){
		printf("%s ", strSystem2);
		for(i=0; i<=(spacing-strlen(strSystem2));i++) printf("-");
	}
	else printf("------ " COLOUR_CYAN "P%c%02d" COLOUR_CLEAR, port2+'A', pin2);
	if(pin2==255) printf(" | N/A ");
	else switch(readPull(port2, pin2)){
		case 0:
			printf(" │  NO ");
			break;
		case 1:
			printf(" │ " COLOUR_GREEN " UP " COLOUR_CLEAR);
			break;
		case 2:
			printf(" │ " COLOUR_GREEN "DOWN" COLOUR_CLEAR);
			break;
		default:
			printf(" │ UKWN");
			break;
	}
	if(pin2==255) printf(" │ SYSTEM");
	else {
		printf(" │ ");
		switch(readMux(port2, pin2)){
			case 0:
				printf(COLOUR_GREEN);
				break;
			case 1:
				printf(COLOUR_BLUE);
				break;
			default:
				printf(COLOUR_MAGENTA);
				break;
		}
		printf("%s" COLOUR_CLEAR, muxToString(port2, pin2, readMux(port2, pin2)));
	}

	printf("\n");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, %r15
movl %r8d, 0xc(%rsp)
movq %rcx, 0x10(%rsp)
movq %rdx, %r12
movl %esi, %ebp
movl %edi, %r13d
cmpl $0xff, %esi
jne 0x2200
leaq 0x1efb(%rip), %r14      # 0x40f9
jmp 0x2222
movl %r13d, %edi
movl %ebp, %esi
callq 0x3304
movl $0xff, %edx
movl %r13d, %edi
andl %edx, %edi
movl %ebp, %esi
andl %edx, %esi
andl %eax, %edx
callq 0x31c8
movq %rax, %r14
movq $-0x1, %rbx
movl $0x20, %edi
callq 0x2030
movq %r14, %rdi
callq 0x2050
movl $0x9, %ecx
subq %rax, %rcx
incq %rbx
cmpq %rbx, %rcx
ja 0x2229
cmpl $0xff, %ebp
jne 0x226d
leaq 0x1dbc(%rip), %rdi      # 0x4016
movq %r14, %rsi
xorl %eax, %eax
callq 0x2070
leaq 0x1db7(%rip), %rdi      # 0x4022
jmp 0x22d9
movl %r13d, %edi
movl %ebp, %esi
callq 0x3304
cmpl $0x1, %eax
leaq 0x1d89(%rip), %rcx      # 0x400a
leaq 0x1d88(%rip), %rdx      # 0x4010
cmoveq %rcx, %rdx
testl %eax, %eax
leaq 0x1d6f(%rip), %rdi      # 0x4004
cmovneq %rdx, %rdi
xorl %eax, %eax
callq 0x2070
leaq 0x1d6f(%rip), %rdi      # 0x4016
movq %r14, %rsi
xorl %eax, %eax
callq 0x2070
movl %r13d, %edi
movl %ebp, %esi
callq 0x3362
cmpb $0x3, %al
jae 0x22d2
movzbl %al, %eax
leaq 0x2753(%rip), %rcx      # 0x4a1c
movslq (%rcx,%rax,4), %rdi
addq %rcx, %rdi
jmp 0x22d9
leaq 0x1d83(%rip), %rdi      # 0x405c
movq 0x10(%rsp), %r14
xorl %eax, %eax
callq 0x2070
cmpl $0xff, %ebp
jne 0x2329
movq $-0x1, %rbx
movl $0x2d, %edi
callq 0x2030
movq %r12, %rdi
callq 0x2050
movl $0x9, %ecx
subq %rax, %rcx
incq %rbx
cmpq %rbx, %rcx
ja 0x22f4
leaq 0x1d49(%rip), %rdi      # 0x4066
movq %r12, %rsi
xorl %eax, %eax
callq 0x2070
jmp 0x2340
addl $0x41, %r13d
leaq 0x1d40(%rip), %rdi      # 0x4074
movl %r13d, %esi
movl %ebp, %edx
xorl %eax, %eax
callq 0x2070
movl 0xc(%rsp), %ebp
cmpl $0xff, %ebp
jne 0x2388
leaq 0x1d43(%rip), %rdi      # 0x4096
movq %r15, %rsi
xorl %eax, %eax
callq 0x2070
movq $-0x1, %rbx
movl $0x2d, %edi
callq 0x2030
movq %r15, %rdi
callq 0x2050
movl $0x9, %ecx
subq %rax, %rcx
incq %rbx
cmpq %rbx, %rcx
ja 0x2364
jmp 0x239c
leal 0x41(%r14), %esi
leaq 0x1d07(%rip), %rdi      # 0x409a
movl %ebp, %edx
xorl %eax, %eax
callq 0x2070
cmpl $0xff, %ebp
jne 0x23b4
leaq 0x1d07(%rip), %rdi      # 0x40b2
xorl %eax, %eax
callq 0x2070
jmp 0x23eb
movl %r14d, %edi
movl %ebp, %esi
callq 0x3362
cmpb $0x2, %al
ja 0x23d5
movzbl %al, %eax
leaq 0x265c(%rip), %rcx      # 0x4a28
movslq (%rcx,%rax,4), %rdi
addq %rcx, %rdi
jmp 0x23dc
leaq 0x1d0e(%rip), %rdi      # 0x40ea
xorl %eax, %eax
callq 0x2070
cmpl $0xff, %ebp
jne 0x23fb
leaq 0x1d02(%rip), %rdi      # 0x40f4
xorl %eax, %eax
callq 0x2070
jmp 0x246d
leaq 0x1c2e(%rip), %rdi      # 0x4030
xorl %eax, %eax
callq 0x2070
movl %r14d, %edi
movl %ebp, %esi
callq 0x3304
cmpl $0x1, %eax
leaq 0x1bed(%rip), %rcx      # 0x400a
leaq 0x1bec(%rip), %rdx      # 0x4010
cmoveq %rcx, %rdx
testl %eax, %eax
leaq 0x1bd3(%rip), %rdi      # 0x4004
cmovneq %rdx, %rdi
xorl %eax, %eax
callq 0x2070
movl %r14d, %edi
movl %ebp, %esi
callq 0x3304
movl $0xff, %edx
andl %edx, %r14d
andl %edx, %ebp
andl %eax, %edx
movl %r14d, %edi
movl %ebp, %esi
callq 0x31c8
leaq 0x1c9d(%rip), %rdi      # 0x4100
movq %rax, %rsi
xorl %eax, %eax
callq 0x2070
movl $0xa, %edi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2030