// File: /workspace/github_c_makefile_star2_O0/WereCatf[P]Gonzales/gonzales.c
// Function: main
int main(int argc, char* argv[])
{
	uint8_t port, pin, value, quiet;

	if(argc <= 1 || strcmp(argv[1], "-h")==0 || strcmp(argv[1], "--help")==0){
		printf("Chippy Gonzales is a tool for directly manipulating the\n");
		printf("GPIO hardware-registers, including pull-ups/-downs, muxes\n");
		printf("and pin-states. This tool is only intended for those who\n");
		printf("know what they are doing and you can very much mess things\n");
		printf("with this.\n\n");
		printf("YOU ASSUME ALL RESPONSIBILITY FOR USE OF THIS TOOL.\n\n");
		printf("The tool accepts the following commands: readPin, readPull, readMux,\n");
		printf("writePin, writePull, writeMux, header1 and header2. All the\n");
		printf("read-commands follow the same format, ie. `gonzales command port pin`\n");
		printf("where port is a number ranging from 0 to 6 or a character from a to g,\n");
		printf("and pin is 0 to 31. Port 0 corresponds to port A, port 1 to port B\n");
		printf("and so on, and if given as a character, the character can be lowercase\n");
		printf("or uppercase. Example: `gonzales readPin d 25` to read pin PD25.\n\n");
		printf("The format for the write-commands is the same, except for the value\n");
		printf("given:\n");
		printf("`writePin [port] [pin] [low/LOW/high/HIGH/0/1]`\n");
		printf("`writeMux [port] [pin] [in/input/INPUT/out/output/OUTPUT/0-6]`\n");
		printf("  -- 0 means INPUT, 1 means OUTPUT and the rest depends on the pin,\n");
		printf("  and the command takes no human-readable input for those.\n");
		printf("`writePull [port] [pin] [up/UP/down/DOWN/disable/DISABLE/0/1/2]`\n");
		printf("  -- 0 means disable, 1 means pull-up, 2 means pull-down.\n\n");
		printf("The commands `header1` and `header2` do not take any parameters.\n");
		return 0;
	}

	quiet=0;
	if(strcmp(argv[1], "-q")==0 || strcmp(argv[1], "--quiet")==0) quiet=1;

	int error=initGpio();
	if(error==1){
		printf("Error opening /dev/mem!\n");
		return 1;
	} else if(error==2){
		printf("Error mmapping memory!\n");
		return 2;
	}

	if(argc < (4+quiet)){
		if(argc > (1+quiet) && strcmp(argv[1+quiet], "header1")==0){
			printf("      Mux  │ Pull │  Function   J13    Function  │ Pull │  Mux\n");
			printf("      ─────┼──────┼──────────────────────────────┼──────┼─────\n");
			printPair(0, 255, "GND", 0, 255, "CHG-IN");
			printPair(0, 255, "5V Out", 0, 255, "GND");
			printPair(0, 255, "3.3V Out", 0, 255, "Tempsense");
			printPair(0, 255, "1.8V Out", 0, 255, "BAT+");
			printPair(1, 16, NULL, 0, 255, "PWR-BTN");
			printPair(1, 15, NULL, 0, 255, "GND");
			printPair(0, 255, "Touch-X1", 0, 255, "Touch-X2");
			printPair(0, 255, "Touch-Y1", 0, 255, "Touch-Y2");
			printPair(3, 2, NULL, 1, 2, NULL);
			printPair(3, 4, NULL, 3, 3, NULL);
			printPair(3, 6, NULL, 3, 5, NULL);
			printPair(3, 10, NULL, 3, 7, NULL);
			printPair(3, 12, NULL, 3, 11, NULL);
			printPair(3, 14, NULL, 3, 13, NULL);
			printPair(3, 18, NULL, 3, 15, NULL);
			printPair(3, 20, NULL, 3, 19, NULL);
			printPair(3, 22, NULL, 3, 21, NULL);
			printPair(3, 24, NULL, 3, 23, NULL);
			printPair(3, 27, NULL, 3, 26, NULL);
			printPair(0, 255, "GND", 3, 25, NULL);
			printf("      ─────┼──────┼──────────────────────────────┼──────┼─────\n");
			printf("      Mux  │ Pull │  Function   J13    Function  │ Pull │  Mux\n");
			return 0;
		} else
		if(argc > (1+quiet) && strcmp(argv[1+quiet], "header2")==0){
			printf("      Mux  │ Pull │  Function   J14    Function  │ Pull │  Mux\n");
			printf("      ─────┼──────┼──────────────────────────────┼──────┼─────\n");
			printPair(0, 255, "GND", 0, 255, "5V-Out");
			printPair(6, 3, NULL, 0, 255, "Hphone-L");
			printPair(6, 4, NULL, 0, 255, "Hp-common");
			printPair(0, 255, "FEL", 0, 255, "Hphone-R");
			printPair(0, 255, "3.3V Out", 0, 255, "Mic-GND");
			printPair(0, 255, "LRADC", 0, 255, "Mic-in");
			printPair(0, 255, "XIO-P0", 0, 255, "XIO-P1");
			printPair(0, 255, "XIO-P2", 0, 255, "XIO-P3");
			printPair(0, 255, "XIO-P4", 0, 255, "XIO-P5");
			printPair(0, 255, "XIO-P6", 0, 255, "XIO-P7");
			printPair(0, 255, "GND", 0, 255, "GND");
			printPair(6, 1, NULL, 1, 3, NULL);
			printPair(1, 18, NULL, 1, 17, NULL);
			printPair(4, 0, NULL, 4, 1, NULL);
			printPair(4, 2, NULL, 4, 3, NULL);
			printPair(4, 4, NULL, 4, 5, NULL);
			printPair(4, 6, NULL, 4, 7, NULL);
			printPair(4, 8, NULL, 4, 9, NULL);
			printPair(4, 10, NULL, 4, 11, NULL);
			printPair(0, 255, "GND", 0, 255, "GND");
			printf("      ─────┼──────┼──────────────────────────────┼──────┼─────\n");
			printf("      Mux  │ Pull │  Function   J14    Function  │ Pull │  Mux\n");
			return 0;
		}
		printf("Too few parameters!\n");
		return 1;
	}

	port = 255;
	if(*argv[2+quiet] >= 'a' && *argv[2+quiet] <= 'g') port = *argv[2+quiet] - 'a';
	if(*argv[2+quiet] >= 'A' && *argv[2+quiet] <= 'G') port = *argv[2+quiet] - 'A';
	if(*argv[2+quiet] >= '0' && *argv[2+quiet] <= '6') port = *argv[2+quiet] - '0';

	pin = atoi(argv[3+quiet]);
	if(port > 6){
		printf("Port must be in the range of 0-6, or a-g!\n");
		return 1;
	}
	if(pin > 31){
		printf("Pin must be in the range of 0 to 31!\n");
		return 1;
	}

	if(strcmp(argv[1+quiet], "readPin")==0){
		printf("Port %c, pin %d: ", port+'A', pin);
		if(readPin(port, pin)) printf("HIGH\n");
		else printf("LOW\n");
	}
	else if(strcmp(argv[1+quiet], "readMux")==0){
		printf("Port %c, pin %d: ", port+'A', pin);
		value=readMux(port, pin);
		printf("%s\n", muxToString(port, pin, value));
	}
	else if(strcmp(argv[1+quiet], "readPull")==0){
		printf("Port %c, pin %d: ", port+'A', pin);
		switch(readPull(port, pin)){
			case 0:
				printf("pull-up/-down disabled.\n");
				break;
			case 1:
				printf("pull-up enabled.\n");
				break;
			case 2:
				printf("pull-down enabled.\n");
				break;
			default:
				printf("unknown status.\n");
				break;
		}
	}
	else if(strcmp(argv[1+quiet], "writePull")==0){
		if(argc < (5+quiet)){
			printf("Too few parameters!\n");
			return 1;
		}
		value = atoi(argv[4+quiet]);
		if(strcmp(argv[4+quiet], "up")==0 || strcmp(argv[4+quiet], "UP")==0) value=1;
		else if(strcmp(argv[4+quiet], "down")==0 || strcmp(argv[4+quiet], "DOWN")==0) value=2;
		else if(strcmp(argv[4+quiet], "disable")==0 || strcmp(argv[4+quiet], "disabled")==0
			|| strcmp(argv[4+quiet], "DISABLE")==0 || strcmp(argv[4+quiet], "DISABLED")==0) value=0;
		if(!quiet){
			printf("New setting for port %c, pin %d: ", port+'A', pin);
			switch(value){
				case 0:
					printf("pull-up/-down disabled.\n");
					break;
				case 1:
					printf("pull-up enabled.\n");
					break;
				case 2:
					printf("pull-down enabled.\n");
					break;
				default:
					printf("unknown status.\n");
					break;
			}
		}
		writePull(port, pin, value);
	}
	else if(strcmp(argv[1+quiet], "writePin")==0){
		if(argc < (5+quiet)){
			printf("Too few parameters!\n");
			return 1;
		}
		value = atoi(argv[4+quiet]);
		if(strcmp(argv[4+quiet], "high")==0 || strcmp(argv[4+quiet], "HIGH")==0) value=1;
		else if(strcmp(argv[4+quiet], "low")==0 || strcmp(argv[4+quiet], "LOW")==0) value=2;
		if(!quiet){
			printf("New setting for port %c, pin %d: ", port+'A', pin);
			switch(value){
				case 0:
					printf("LOW.\n");
					break;
				case 1:
					printf("HIGH.\n");
					break;
				default:
					printf("unknown value given.\n");
					return 1;
					break;
			}
		}
		writePin(port, pin, value);
	}
	else if(strcmp(argv[1+quiet], "writeMux")==0){
		if(argc < (5+quiet)){
			printf("Too few parameters!\n");
			return 1;
		}
		value = atoi(argv[4+quiet]);
		if(strcmp(argv[4+quiet], "input")==0 || strcmp(argv[4+quiet], "INPUT")==0
			|| strcmp(argv[4+quiet], "in")==0 || strcmp(argv[4+quiet], "IN")==0) value=0;
		else if(strcmp(argv[4+quiet], "output")==0 || strcmp(argv[4+quiet], "OUTPUT")==0
				|| strcmp(argv[4+quiet], "out")==0 || strcmp(argv[4+quiet], "OUT")==0) value=1;
		if(!quiet){
			printf("New setting for port %c, pin %d: ", port+'A', pin);
			switch(value){
				case 0:
					printf("INPUT.\n");
					break;
				case 1:
					printf("OUTPUT.\n");
					break;
				default:
					printf("altmux 0x%x.\n", value);
					break;
			}
		}
		writeMux(port, pin, value);
	}
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpl $0x1, -0x8(%rbp)
jle 0x2602
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
leaq 0x1b2e(%rip), %rsi      # 0x4109
callq 0x2070
cmpl $0x0, %eax
je 0x2602
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
leaq 0x1b18(%rip), %rsi      # 0x410c
callq 0x2070
cmpl $0x0, %eax
jne 0x2742
leaq 0x1b0a(%rip), %rdi      # 0x4113
movb $0x0, %al
callq 0x2050
leaq 0x1b35(%rip), %rdi      # 0x414c
movb $0x0, %al
callq 0x2050
leaq 0x1b62(%rip), %rdi      # 0x4187
movb $0x0, %al
callq 0x2050
leaq 0x1b8e(%rip), %rdi      # 0x41c1
movb $0x0, %al
callq 0x2050
leaq 0x1bbc(%rip), %rdi      # 0x41fd
movb $0x0, %al
callq 0x2050
leaq 0x1bbb(%rip), %rdi      # 0x420a
movb $0x0, %al
callq 0x2050
leaq 0x1be3(%rip), %rdi      # 0x4240
movb $0x0, %al
callq 0x2050
leaq 0x1c1b(%rip), %rdi      # 0x4286
movb $0x0, %al
callq 0x2050
leaq 0x1c4a(%rip), %rdi      # 0x42c3
movb $0x0, %al
callq 0x2050
leaq 0x1c83(%rip), %rdi      # 0x430a
movb $0x0, %al
callq 0x2050
leaq 0x1cbd(%rip), %rdi      # 0x4352
movb $0x0, %al
callq 0x2050
leaq 0x1cf3(%rip), %rdi      # 0x4396
movb $0x0, %al
callq 0x2050
leaq 0x1d2d(%rip), %rdi      # 0x43de
movb $0x0, %al
callq 0x2050
leaq 0x1d62(%rip), %rdi      # 0x4421
movb $0x0, %al
callq 0x2050
leaq 0x1d99(%rip), %rdi      # 0x4466
movb $0x0, %al
callq 0x2050
leaq 0x1d93(%rip), %rdi      # 0x446e
movb $0x0, %al
callq 0x2050
leaq 0x1db6(%rip), %rdi      # 0x449f
movb $0x0, %al
callq 0x2050
leaq 0x1de8(%rip), %rdi      # 0x44df
movb $0x0, %al
callq 0x2050
leaq 0x1e1f(%rip), %rdi      # 0x4524
movb $0x0, %al
callq 0x2050
leaq 0x1e4d(%rip), %rdi      # 0x4560
movb $0x0, %al
callq 0x2050
leaq 0x1e81(%rip), %rdi      # 0x45a2
movb $0x0, %al
callq 0x2050
leaq 0x1eaf(%rip), %rdi      # 0x45de
movb $0x0, %al
callq 0x2050
movl $0x0, -0x4(%rbp)
jmp 0x3699
movb $0x0, -0x14(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
leaq 0x1ecb(%rip), %rsi      # 0x4620
callq 0x2070
cmpl $0x0, %eax
je 0x2778
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
leaq 0x1eb5(%rip), %rsi      # 0x4623
callq 0x2070
cmpl $0x0, %eax
jne 0x277c
movb $0x1, -0x14(%rbp)
movb $0x0, %al
callq 0x3850
movl %eax, -0x18(%rbp)
cmpl $0x1, -0x18(%rbp)
jne 0x27a6
leaq 0x1e98(%rip), %rdi      # 0x462b
movb $0x0, %al
callq 0x2050
movl $0x1, -0x4(%rbp)
jmp 0x3699
cmpl $0x2, -0x18(%rbp)
jne 0x27c6
leaq 0x1e91(%rip), %rdi      # 0x4644
movb $0x0, %al
callq 0x2050
movl $0x2, -0x4(%rbp)
jmp 0x3699
jmp 0x27c8
movl -0x8(%rbp), %eax
movzbl -0x14(%rbp), %ecx
addl $0x4, %ecx
cmpl %ecx, %eax
jge 0x2dda
movl -0x8(%rbp), %eax
movzbl -0x14(%rbp), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
jle 0x2ad3
movq -0x10(%rbp), %rax
movzbl -0x14(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x1e57(%rip), %rsi      # 0x465c
callq 0x2070
cmpl $0x0, %eax
jne 0x2ad3
leaq 0x1e4a(%rip), %rdi      # 0x4664
movb $0x0, %al
callq 0x2050
leaq 0x1e84(%rip), %rdi      # 0x46ac
movb $0x0, %al
callq 0x2050
xorl %ecx, %ecx
movl $0xff, %r8d
leaq 0x1ff4(%rip), %rdx      # 0x4832
leaq 0x1f17(%rip), %r9       # 0x475c
movl %ecx, %edi
movl %r8d, %esi
callq 0x21b0
xorl %ecx, %ecx
movl $0xff, %r8d
leaq 0x1f05(%rip), %rdx      # 0x4763
leaq 0x1fcd(%rip), %r9       # 0x4832
movl %ecx, %edi
movl %r8d, %esi
callq 0x21b0
xorl %ecx, %ecx
movl $0xff, %r8d
leaq 0x1eec(%rip), %rdx      # 0x476a
leaq 0x1eee(%rip), %r9       # 0x4773
movl %ecx, %edi
movl %r8d, %esi
callq 0x21b0
xorl %ecx, %ecx
movl $0xff, %r8d
leaq 0x1edf(%rip), %rdx      # 0x477d
leaq 0x1ee1(%rip), %r9       # 0x4786
movl %ecx, %edi
movl %r8d, %esi
callq 0x21b0
movl $0x1, %edi
movl $0x10, %esi
xorl %eax, %eax
movl %eax, %edx
xorl %ecx, %ecx
movl $0xff, %r8d
leaq 0x1ebf(%rip), %r9       # 0x478b
callq 0x21b0
movl $0x1, %edi
movl $0xf, %esi
xorl %eax, %eax
movl %eax, %edx
xorl %ecx, %ecx
movl $0xff, %r8d
leaq 0x1f44(%rip), %r9       # 0x4832
callq 0x21b0
xorl %ecx, %ecx
movl $0xff, %r8d
leaq 0x1e91(%rip), %rdx      # 0x4793
leaq 0x1e93(%rip), %r9       # 0x479c
movl %ecx, %edi
movl %r8d, %esi
callq 0x21b0
xorl %ecx, %ecx
movl $0xff, %r8d
leaq 0x1e83(%rip), %rdx      # 0x47a5
leaq 0x1e85(%rip), %r9       # 0x47ae
movl %ecx, %edi
movl %r8d, %esi
callq 0x21b0
movl $0x3, %edi
movl $0x2, %r8d
xorl %eax, %eax
movl %eax, %r9d
movl $0x1, %ecx
movl %r8d, %esi
movq %r9, %rdx
callq 0x21b0
movl $0x3, %r8d
movl $0x4, %esi
xorl %eax, %eax
movl %eax, %r9d
movl %r8d, %edi
movq %r9, %rdx
movl %r8d, %ecx
callq 0x21b0
movl $0x3, %ecx
movl $0x6, %esi
xorl %eax, %eax
movl %eax, %r9d
movl $0x5, %r8d
movl %ecx, %edi
movq %r9, %rdx
callq 0x21b0
movl $0x3, %ecx
movl $0xa, %esi
xorl %eax, %eax
movl %eax, %r9d
movl $0x7, %r8d
movl %ecx, %edi
movq %r9, %rdx
callq 0x21b0
movl $0x3, %ecx
movl $0xc, %esi
xorl %eax, %eax
movl %eax, %r9d
movl $0xb, %r8d
movl %ecx, %edi
movq %r9, %rdx
callq 0x21b0
movl $0x3, %ecx
movl $0xe, %esi
xorl %eax, %eax
movl %eax, %r9d
movl $0xd, %r8d
movl %ecx, %edi
movq %r9, %rdx
callq 0x21b0
movl $0x3, %ecx
movl $0x12, %esi
xorl %eax, %eax
movl %eax, %r9d
movl $0xf, %r8d
movl %ecx, %edi
movq %r9, %rdx
callq 0x21b0
movl $0x3, %ecx
movl $0x14, %esi
xorl %eax, %eax
movl %eax, %r9d
movl $0x13, %r8d
movl %ecx, %edi
movq %r9, %rdx
callq 0x21b0
movl $0x3, %ecx
movl $0x16, %esi
xorl %eax, %eax
movl %eax, %r9d
movl $0x15, %r8d
movl %ecx, %edi
movq %r9, %rdx
callq 0x21b0
movl $0x3, %ecx
movl $0x18, %esi
xorl %eax, %eax
movl %eax, %r9d
movl $0x17, %r8d
movl %ecx, %edi
movq %r9, %rdx
callq 0x21b0
movl $0x3, %ecx
movl $0x1b, %esi
xorl %eax, %eax
movl %eax, %r9d
movl $0x1a, %r8d
movl %ecx, %edi
movq %r9, %rdx
callq 0x21b0
xorl %edi, %edi
movl $0xff, %esi
leaq 0x1d9c(%rip), %rdx      # 0x4832
movl $0x3, %ecx
movl $0x19, %r8d
xorl %eax, %eax
movl %eax, %r9d
callq 0x21b0
leaq 0x1bfa(%rip), %rdi      # 0x46ac
movb $0x0, %al
callq 0x2050
leaq 0x1ba4(%rip), %rdi      # 0x4664
movb $0x0, %al
callq 0x2050
movl $0x0, -0x4(%rbp)
jmp 0x3699
movl -0x8(%rbp), %eax
movzbl -0x14(%rbp), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
jle 0x2dbe
movq -0x10(%rbp), %rax
movzbl -0x14(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x1cb9(%rip), %rsi      # 0x47b7
callq 0x2070
cmpl $0x0, %eax
jne 0x2dbe
leaq 0x1cac(%rip), %rdi      # 0x47bf
movb $0x0, %al
callq 0x2050
leaq 0x1b8b(%rip), %rdi      # 0x46ac
movb $0x0, %al
callq 0x2050
xorl %ecx, %ecx
movl $0xff, %r8d
leaq 0x1cfb(%rip), %rdx      # 0x4832
leaq 0x1cc9(%rip), %r9       # 0x4807
movl %ecx, %edi
movl %r8d, %esi
callq 0x21b0
movl $0x6, %edi
movl $0x3, %esi
xorl %eax, %eax
movl %eax, %edx
xorl %ecx, %ecx
movl $0xff, %r8d
leaq 0x1ca9(%rip), %r9       # 0x480e
callq 0x21b0
movl $0x6, %edi
movl $0x4, %esi
xorl %eax, %eax
movl %eax, %edx
xorl %ecx, %ecx
movl $0xff, %r8d
leaq 0x1c90(%rip), %r9       # 0x4817
callq 0x21b0
xorl %ecx, %ecx
movl $0xff, %r8d
leaq 0x1c86(%rip), %rdx      # 0x4821
leaq 0x1c83(%rip), %r9       # 0x4825
movl %ecx, %edi
movl %r8d, %esi
callq 0x21b0
xorl %ecx, %ecx
movl $0xff, %r8d
leaq 0x1baf(%rip), %rdx      # 0x476a
leaq 0x1c6c(%rip), %r9       # 0x482e
movl %ecx, %edi
movl %r8d, %esi
callq 0x21b0
xorl %ecx, %ecx
movl $0xff, %r8d
leaq 0x1c5b(%rip), %rdx      # 0x4836
leaq 0x1c5a(%rip), %r9       # 0x483c
movl %ecx, %edi
movl %r8d, %esi
callq 0x21b0
xorl %ecx, %ecx
movl $0xff, %r8d
leaq 0x1c48(%rip), %rdx      # 0x4843
leaq 0x1c48(%rip), %r9       # 0x484a
movl %ecx, %edi
movl %r8d, %esi
callq 0x21b0
xorl %ecx, %ecx
movl $0xff, %r8d
leaq 0x1c36(%rip), %rdx      # 0x4851
leaq 0x1c36(%rip), %r9       # 0x4858
movl %ecx, %edi
movl %r8d, %esi
callq 0x21b0
xorl %ecx, %ecx
movl $0xff, %r8d
leaq 0x1c24(%rip), %rdx      # 0x485f
leaq 0x1c24(%rip), %r9       # 0x4866
movl %ecx, %edi
movl %r8d, %esi
callq 0x21b0
xorl %ecx, %ecx
movl $0xff, %r8d
leaq 0x1c12(%rip), %rdx      # 0x486d
leaq 0x1c12(%rip), %r9       # 0x4874
movl %ecx, %edi
movl %r8d, %esi
callq 0x21b0
xorl %ecx, %ecx
movl $0xff, %r8d
leaq 0x1bb7(%rip), %r9       # 0x4832
movl %ecx, %edi
movl %r8d, %esi
movq %r9, %rdx
callq 0x21b0
movl $0x6, %edi
movl $0x1, %ecx
xorl %eax, %eax
movl %eax, %r9d
movl $0x3, %r8d
movl %ecx, %esi
movq %r9, %rdx
callq 0x21b0
movl $0x1, %ecx
movl $0x12, %esi
xorl %eax, %eax
movl %eax, %r9d
movl $0x11, %r8d
movl %ecx, %edi
movq %r9, %rdx
callq 0x21b0
movl $0x4, %ecx
xorl %esi, %esi
xorl %eax, %eax
movl %eax, %r9d
movl $0x1, %r8d
movl %ecx, %edi
movq %r9, %rdx
callq 0x21b0
movl $0x4, %ecx
movl $0x2, %esi
xorl %eax, %eax
movl %eax, %r9d
movl $0x3, %r8d
movl %ecx, %edi
movq %r9, %rdx
callq 0x21b0
movl $0x4, %ecx
xorl %eax, %eax
movl %eax, %r9d
movl $0x5, %r8d
movl %ecx, %edi
movl %ecx, %esi
movq %r9, %rdx
callq 0x21b0
movl $0x4, %ecx
movl $0x6, %esi
xorl %eax, %eax
movl %eax, %r9d
movl $0x7, %r8d
movl %ecx, %edi
movq %r9, %rdx
callq 0x21b0
movl $0x4, %ecx
movl $0x8, %esi
xorl %eax, %eax
movl %eax, %r9d
movl $0x9, %r8d
movl %ecx, %edi
movq %r9, %rdx
callq 0x21b0
movl $0x4, %ecx
movl $0xa, %esi
xorl %eax, %eax
movl %eax, %r9d
movl $0xb, %r8d
movl %ecx, %edi
movq %r9, %rdx
callq 0x21b0
xorl %ecx, %ecx
movl $0xff, %r8d
leaq 0x1aa9(%rip), %r9       # 0x4832
movl %ecx, %edi
movl %r8d, %esi
movq %r9, %rdx
callq 0x21b0
leaq 0x190f(%rip), %rdi      # 0x46ac
movb $0x0, %al
callq 0x2050
leaq 0x1a14(%rip), %rdi      # 0x47bf
movb $0x0, %al
callq 0x2050
movl $0x0, -0x4(%rbp)
jmp 0x3699
jmp 0x2dc0
leaq 0x1ab4(%rip), %rdi      # 0x487b
movb $0x0, %al
callq 0x2050
movl $0x1, -0x4(%rbp)
jmp 0x3699
movb $-0x1, -0x11(%rbp)
movq -0x10(%rbp), %rax
movzbl -0x14(%rbp), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movsbl (%rax), %eax
cmpl $0x61, %eax
jl 0x2e2d
movq -0x10(%rbp), %rax
movzbl -0x14(%rbp), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movsbl (%rax), %eax
cmpl $0x67, %eax
jg 0x2e2d
movq -0x10(%rbp), %rax
movzbl -0x14(%rbp), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movsbl (%rax), %eax
subl $0x61, %eax
movb %al, -0x11(%rbp)
movq -0x10(%rbp), %rax
movzbl -0x14(%rbp), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movsbl (%rax), %eax
cmpl $0x41, %eax
jl 0x2e7c
movq -0x10(%rbp), %rax
movzbl -0x14(%rbp), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movsbl (%rax), %eax
cmpl $0x47, %eax
jg 0x2e7c
movq -0x10(%rbp), %rax
movzbl -0x14(%rbp), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movsbl (%rax), %eax
subl $0x41, %eax
movb %al, -0x11(%rbp)
movq -0x10(%rbp), %rax
movzbl -0x14(%rbp), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movsbl (%rax), %eax
cmpl $0x30, %eax
jl 0x2ecb
movq -0x10(%rbp), %rax
movzbl -0x14(%rbp), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movsbl (%rax), %eax
cmpl $0x36, %eax
jg 0x2ecb
movq -0x10(%rbp), %rax
movzbl -0x14(%rbp), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movsbl (%rax), %eax
subl $0x30, %eax
movb %al, -0x11(%rbp)
movq -0x10(%rbp), %rax
movzbl -0x14(%rbp), %ecx
addl $0x3, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
callq 0x2090
movb %al, -0x12(%rbp)
movzbl -0x11(%rbp), %eax
cmpl $0x6, %eax
jle 0x2f08
leaq 0x199b(%rip), %rdi      # 0x4890
movb $0x0, %al
callq 0x2050
movl $0x1, -0x4(%rbp)
jmp 0x3699
movzbl -0x12(%rbp), %eax
cmpl $0x1f, %eax
jle 0x2f2b
leaq 0x19a3(%rip), %rdi      # 0x48bb
movb $0x0, %al
callq 0x2050
movl $0x1, -0x4(%rbp)
jmp 0x3699
movq -0x10(%rbp), %rax
movzbl -0x14(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x199d(%rip), %rsi      # 0x48e1
callq 0x2070
cmpl $0x0, %eax
jne 0x2f9c
movzbl -0x11(%rbp), %esi
addl $0x41, %esi
movzbl -0x12(%rbp), %edx
leaq 0x1989(%rip), %rdi      # 0x48e9
movb $0x0, %al
callq 0x2050
movzbl -0x11(%rbp), %edi
movzbl -0x12(%rbp), %esi
callq 0x3bf0
cmpl $0x0, %eax
je 0x2f89
leaq 0x197b(%rip), %rdi      # 0x48fb
movb $0x0, %al
callq 0x2050
jmp 0x2f97
leaq 0x1971(%rip), %rdi      # 0x4901
movb $0x0, %al
callq 0x2050
jmp 0x3692
movq -0x10(%rbp), %rax
movzbl -0x14(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x1951(%rip), %rsi      # 0x4906
callq 0x2070
cmpl $0x0, %eax
jne 0x3013
movzbl -0x11(%rbp), %esi
addl $0x41, %esi
movzbl -0x12(%rbp), %edx
leaq 0x1918(%rip), %rdi      # 0x48e9
movb $0x0, %al
callq 0x2050
movzbl -0x11(%rbp), %edi
movzbl -0x12(%rbp), %esi
callq 0x38f0
movb %al, -0x13(%rbp)
movb -0x11(%rbp), %cl
movb -0x12(%rbp), %al
movzbl %cl, %edi
movzbl %al, %esi
movzbl -0x13(%rbp), %edx
callq 0x36b0
movq %rax, %rsi
leaq 0x1907(%rip), %rdi      # 0x490e
movb $0x0, %al
callq 0x2050
jmp 0x3690
movq -0x10(%rbp), %rax
movzbl -0x14(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x18e6(%rip), %rsi      # 0x4912
callq 0x2070
cmpl $0x0, %eax
jne 0x30c3
movzbl -0x11(%rbp), %esi
addl $0x41, %esi
movzbl -0x12(%rbp), %edx
leaq 0x189d(%rip), %rdi      # 0x48e9
xorl %eax, %eax
callq 0x2050
movzbl -0x11(%rbp), %edi
movzbl -0x12(%rbp), %esi
callq 0x39d0
movzbl %al, %ecx
movl %ecx, -0x1c(%rbp)
testb %al, %al
je 0x3080
jmp 0x306c
movl -0x1c(%rbp), %eax
subl $0x1, %eax
je 0x3090
jmp 0x3076
movl -0x1c(%rbp), %eax
subl $0x2, %eax
je 0x30a0
jmp 0x30b0
leaq 0x1894(%rip), %rdi      # 0x491b
movb $0x0, %al
callq 0x2050
jmp 0x30be
leaq 0x189d(%rip), %rdi      # 0x4934
movb $0x0, %al
callq 0x2050
jmp 0x30be
leaq 0x189f(%rip), %rdi      # 0x4946
movb $0x0, %al
callq 0x2050
jmp 0x30be
leaq 0x18a3(%rip), %rdi      # 0x495a
movb $0x0, %al
callq 0x2050
jmp 0x368e
movq -0x10(%rbp), %rax
movzbl -0x14(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x188f(%rip), %rsi      # 0x496b
callq 0x2070
cmpl $0x0, %eax
jne 0x32f4
movl -0x8(%rbp), %eax
movzbl -0x14(%rbp), %ecx
addl $0x5, %ecx
cmpl %ecx, %eax
jge 0x3112
leaq 0x177c(%rip), %rdi      # 0x487b
movb $0x0, %al
callq 0x2050
movl $0x1, -0x4(%rbp)
jmp 0x3699
movq -0x10(%rbp), %rax
movzbl -0x14(%rbp), %ecx
addl $0x4, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
callq 0x2090
movb %al, -0x13(%rbp)
movq -0x10(%rbp), %rax
movzbl -0x14(%rbp), %ecx
addl $0x4, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x1830(%rip), %rsi      # 0x4975
callq 0x2070
cmpl $0x0, %eax
je 0x3172
movq -0x10(%rbp), %rax
movzbl -0x14(%rbp), %ecx
addl $0x4, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x1810(%rip), %rsi      # 0x4978
callq 0x2070
cmpl $0x0, %eax
jne 0x317b
movb $0x1, -0x13(%rbp)
jmp 0x325e
movq -0x10(%rbp), %rax
movzbl -0x14(%rbp), %ecx
addl $0x4, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x17e7(%rip), %rsi      # 0x497b
callq 0x2070
cmpl $0x0, %eax
je 0x31c1
movq -0x10(%rbp), %rax
movzbl -0x14(%rbp), %ecx
addl $0x4, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x17c9(%rip), %rsi      # 0x4980
callq 0x2070
cmpl $0x0, %eax
jne 0x31ca
movb $0x2, -0x13(%rbp)
jmp 0x325c
movq -0x10(%rbp), %rax
movzbl -0x14(%rbp), %ecx
addl $0x4, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x17a2(%rip), %rsi      # 0x4985
callq 0x2070
cmpl $0x0, %eax
je 0x3256
movq -0x10(%rbp), %rax
movzbl -0x14(%rbp), %ecx
addl $0x4, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x1787(%rip), %rsi      # 0x498d
callq 0x2070
cmpl $0x0, %eax
je 0x3256
movq -0x10(%rbp), %rax
movzbl -0x14(%rbp), %ecx
addl $0x4, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x176d(%rip), %rsi      # 0x4996
callq 0x2070
cmpl $0x0, %eax
je 0x3256
movq -0x10(%rbp), %rax
movzbl -0x14(%rbp), %ecx
addl $0x4, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x1752(%rip), %rsi      # 0x499e
callq 0x2070
cmpl $0x0, %eax
jne 0x325a
movb $0x0, -0x13(%rbp)
jmp 0x325c
jmp 0x325e
cmpb $0x0, -0x14(%rbp)
jne 0x32de
movzbl -0x11(%rbp), %esi
addl $0x41, %esi
movzbl -0x12(%rbp), %edx
leaq 0x1731(%rip), %rdi      # 0x49a7
xorl %eax, %eax
callq 0x2050
movzbl -0x13(%rbp), %eax
movl %eax, -0x20(%rbp)
testl %eax, %eax
je 0x329e
jmp 0x328a
movl -0x20(%rbp), %eax
subl $0x1, %eax
je 0x32ae
jmp 0x3294
movl -0x20(%rbp), %eax
subl $0x2, %eax
je 0x32be
jmp 0x32ce
leaq 0x1676(%rip), %rdi      # 0x491b
movb $0x0, %al
callq 0x2050
jmp 0x32dc
leaq 0x167f(%rip), %rdi      # 0x4934
movb $0x0, %al
callq 0x2050
jmp 0x32dc
leaq 0x1681(%rip), %rdi      # 0x4946
movb $0x0, %al
callq 0x2050
jmp 0x32dc
leaq 0x1685(%rip), %rdi      # 0x495a
movb $0x0, %al
callq 0x2050
jmp 0x32de
movzbl -0x11(%rbp), %edi
movzbl -0x12(%rbp), %esi
movzbl -0x13(%rbp), %edx
callq 0x3a20
jmp 0x368c
movq -0x10(%rbp), %rax
movzbl -0x14(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x16bc(%rip), %rsi      # 0x49c9
callq 0x2070
cmpl $0x0, %eax
jne 0x347d
movl -0x8(%rbp), %eax
movzbl -0x14(%rbp), %ecx
addl $0x5, %ecx
cmpl %ecx, %eax
jge 0x3343
leaq 0x154b(%rip), %rdi      # 0x487b
movb $0x0, %al
callq 0x2050
movl $0x1, -0x4(%rbp)
jmp 0x3699
movq -0x10(%rbp), %rax
movzbl -0x14(%rbp), %ecx
addl $0x4, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
callq 0x2090
movb %al, -0x13(%rbp)
movq -0x10(%rbp), %rax
movzbl -0x14(%rbp), %ecx
addl $0x4, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x165c(%rip), %rsi      # 0x49d2
callq 0x2070
cmpl $0x0, %eax
je 0x33a3
movq -0x10(%rbp), %rax
movzbl -0x14(%rbp), %ecx
addl $0x4, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x163e(%rip), %rsi      # 0x49d7
callq 0x2070
cmpl $0x0, %eax
jne 0x33a9
movb $0x1, -0x13(%rbp)
jmp 0x33f5
movq -0x10(%rbp), %rax
movzbl -0x14(%rbp), %ecx
addl $0x4, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x161a(%rip), %rsi      # 0x49dc
callq 0x2070
cmpl $0x0, %eax
je 0x33ef
movq -0x10(%rbp), %rax
movzbl -0x14(%rbp), %ecx
addl $0x4, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x15fb(%rip), %rsi      # 0x49e0
callq 0x2070
cmpl $0x0, %eax
jne 0x33f3
movb $0x2, -0x13(%rbp)
jmp 0x33f5
cmpb $0x0, -0x14(%rbp)
jne 0x3467
movzbl -0x11(%rbp), %esi
addl $0x41, %esi
movzbl -0x12(%rbp), %edx
leaq 0x159a(%rip), %rdi      # 0x49a7
xorl %eax, %eax
callq 0x2050
movzbl -0x13(%rbp), %eax
movl %eax, -0x24(%rbp)
testl %eax, %eax
je 0x342b
jmp 0x3421
movl -0x24(%rbp), %eax
subl $0x1, %eax
je 0x343b
jmp 0x344b
leaq 0x15b2(%rip), %rdi      # 0x49e4
movb $0x0, %al
callq 0x2050
jmp 0x3465
leaq 0x15a8(%rip), %rdi      # 0x49ea
movb $0x0, %al
callq 0x2050
jmp 0x3465
leaq 0x159f(%rip), %rdi      # 0x49f1
movb $0x0, %al
callq 0x2050
movl $0x1, -0x4(%rbp)
jmp 0x3699
jmp 0x3467
movzbl -0x11(%rbp), %edi
movzbl -0x12(%rbp), %esi
movzbl -0x13(%rbp), %edx
callq 0x3c30
jmp 0x368a
movq -0x10(%rbp), %rax
movzbl -0x14(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x1571(%rip), %rsi      # 0x4a07
callq 0x2070
cmpl $0x0, %eax
jne 0x3688
movl -0x8(%rbp), %eax
movzbl -0x14(%rbp), %ecx
addl $0x5, %ecx
cmpl %ecx, %eax
jge 0x34cc
leaq 0x13c2(%rip), %rdi      # 0x487b
movb $0x0, %al
callq 0x2050
movl $0x1, -0x4(%rbp)
jmp 0x3699
movq -0x10(%rbp), %rax
movzbl -0x14(%rbp), %ecx
addl $0x4, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
callq 0x2090
movb %al, -0x13(%rbp)
movq -0x10(%rbp), %rax
movzbl -0x14(%rbp), %ecx
addl $0x4, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x1511(%rip), %rsi      # 0x4a10
callq 0x2070
cmpl $0x0, %eax
je 0x3572
movq -0x10(%rbp), %rax
movzbl -0x14(%rbp), %ecx
addl $0x4, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x14f4(%rip), %rsi      # 0x4a16
callq 0x2070
cmpl $0x0, %eax
je 0x3572
movq -0x10(%rbp), %rax
movzbl -0x14(%rbp), %ecx
addl $0x4, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x12fb(%rip), %rsi      # 0x4840
callq 0x2070
cmpl $0x0, %eax
je 0x3572
movq -0x10(%rbp), %rax
movzbl -0x14(%rbp), %ecx
addl $0x4, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x11f8(%rip), %rsi      # 0x4760
callq 0x2070
cmpl $0x0, %eax
jne 0x357b
movb $0x0, -0x13(%rbp)
jmp 0x360d
movq -0x10(%rbp), %rax
movzbl -0x14(%rbp), %ecx
addl $0x4, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x1488(%rip), %rsi      # 0x4a1c
callq 0x2070
cmpl $0x0, %eax
je 0x3607
movq -0x10(%rbp), %rax
movzbl -0x14(%rbp), %ecx
addl $0x4, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x146c(%rip), %rsi      # 0x4a23
callq 0x2070
cmpl $0x0, %eax
je 0x3607
movq -0x10(%rbp), %rax
movzbl -0x14(%rbp), %ecx
addl $0x4, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x1450(%rip), %rsi      # 0x4a2a
callq 0x2070
cmpl $0x0, %eax
je 0x3607
movq -0x10(%rbp), %rax
movzbl -0x14(%rbp), %ecx
addl $0x4, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x1431(%rip), %rsi      # 0x4a2e
callq 0x2070
cmpl $0x0, %eax
jne 0x360b
movb $0x1, -0x13(%rbp)
jmp 0x360d
cmpb $0x0, -0x14(%rbp)
jne 0x3677
movzbl -0x11(%rbp), %esi
addl $0x41, %esi
movzbl -0x12(%rbp), %edx
leaq 0x1382(%rip), %rdi      # 0x49a7
xorl %eax, %eax
callq 0x2050
movzbl -0x13(%rbp), %eax
movl %eax, -0x28(%rbp)
testl %eax, %eax
je 0x3643
jmp 0x3639
movl -0x28(%rbp), %eax
subl $0x1, %eax
je 0x3653
jmp 0x3663
leaq 0x13e8(%rip), %rdi      # 0x4a32
movb $0x0, %al
callq 0x2050
jmp 0x3675
leaq 0x13e0(%rip), %rdi      # 0x4a3a
movb $0x0, %al
callq 0x2050
jmp 0x3675
movzbl -0x13(%rbp), %esi
leaq 0x13d5(%rip), %rdi      # 0x4a43
movb $0x0, %al
callq 0x2050
jmp 0x3677
movzbl -0x11(%rbp), %edi
movzbl -0x12(%rbp), %esi
movzbl -0x13(%rbp), %edx
callq 0x3940
jmp 0x368a
jmp 0x368c
jmp 0x368e
jmp 0x3690
jmp 0x3692
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)