// File: AndrewAlbert[P]Compiler-Theory/SourceCode/scanner.cpp
// Function: Scanner::ScanOneToken(_IO_FILE*, token_type*)
int Scanner::ScanOneToken(FILE *fPtr, token_type *token){
	char ch, nextch;
	string str = "";
	do{
		ch = getc(fPtr);
		if(debug && (ch == '\n') ) cout << endl;		
	} while(isSpace(ch));
	
	//handle comments or divisor token
	if(ch == '/'){
		str += ch;
		nextch = getc(fPtr);
		if (nextch == '/'){
			while(nextch != '\n'){
				str += nextch;
				nextch = getc(fPtr);
			}
			token->ascii = str;
			line_number++;
			return T_COMMENT;
		}
		else if (nextch == '*'){
			str += nextch;
			int i = 1;
			while (i > 0){
				nextch = getc(fPtr);
				str += nextch;
				if (nextch == '*'){
					nextch = getc(fPtr);
					str += nextch;
					if(nextch == '/') i -= 1;
				}
				else if (nextch == '/'){
					nextch = getc(fPtr);
					str += nextch;
					if(nextch == '*') i += 1;
				}
				else if (nextch == '\n') line_number++;
			}
			token->ascii = str;
			return T_COMMENT;
		}
		else{
			ungetc(nextch, fPtr);
			token->ascii = str;
			return T_DIVIDE;
		}
	}
	//handle integer and float tokens
	else if(isNum(ch)){
		str += ch;
		nextch = getc(fPtr);
		while(isNum(nextch)){
			str += nextch;
			nextch = getc(fPtr);
		}
		if (nextch == '.'){
			str+= nextch;
			nextch = getc(fPtr);
			while(isNum(nextch)){
				str += nextch;
				nextch = getc(fPtr);
			}
			token->val.doubleValue = stod(str);
			token->ascii = str;
			ungetc(nextch, fPtr);
			return TYPE_FLOAT;
		}
		else {
			token->val.intValue = stoi(str);
			token->ascii = str;
			ungetc(nextch, fPtr);
			return TYPE_INTEGER;
		}
	}
	//handle string tokens
	else if (isString(ch)){
		str += ch;
		nextch = getc(fPtr);
		int i = 0;
		while(!isString(nextch)){
			token->val.stringValue[i++] = nextch;
			str += nextch;
			nextch = getc(fPtr);
		}
		str += nextch;
		token->ascii = str;
		return TYPE_STRING;
	}
	//handle char tokens
	else if (isChar(ch)){
		str += ch;
		nextch = getc(fPtr);
		int i = 0;
		while(!isChar(nextch)){
			token->val.stringValue[i++] = nextch;
			str += nextch;
			nextch = getc(fPtr);
		}
		str += nextch;
		token->ascii = str;
		return TYPE_CHAR;
	}
	//handle identifier tokens
	else if (isLetter(ch)){
		int i = 0;
		token->val.stringValue[i++] = toupper(nextch);
		str += toupper(ch);
		nextch = getc(fPtr);
		while(isLetter(nextch) || isNum(nextch) || nextch == '_')
		{
			token->val.stringValue[i++] = toupper(nextch);
			str += toupper(nextch);
			nextch = getc(fPtr);
		}
		ungetc(nextch, fPtr);
		token->ascii = str;
		
		map<string,int>::iterator it;
		it = reserved_table.find(str);
		if (it != reserved_table.end()) return reserved_table.find(str)->second;
		else return TYPE_IDENTIFIER;
	}
	else if (isSingleToken(ch)){
		str += ch;
		token->ascii = str;
		switch(ch){
			case '.': return T_PERIOD;
			case ';': return T_SEMICOLON;
			case '(': return T_LPAREN;
			case ')': return T_RPAREN;
			case '/': return T_DIVIDE;
			case '*': return T_MULTIPLY;
			case '+': return T_ADD;
			case '-': return T_SUBTRACT;
			case ',': return T_COMMA;
			case '[': return T_LBRACKET;
			case ']': return T_RBRACKET;
			case ':':
				ch = getc(fPtr);
				if (ch == '='){
					str += ch;
					token->ascii = str;
					return T_ASSIGNMENT;
				}
				else{
					ungetc(ch, fPtr);
					token->ascii = str;
					return T_UNKNOWN;
				}
			case '>': case '<': case '=':
				ch = getc(fPtr);
				if (ch == '='){
					str+=ch;
					token->ascii = str;
					return T_LOGICAL;
				}
				else{
					ungetc(ch, fPtr);
					if (str == "=") return T_UNKNOWN;
					else return T_LOGICAL;
				}
			case '!':
				ch = getc(fPtr);
				if (ch == '='){
					str += ch;
					token->ascii = str;
					return T_LOGICAL;
				}
				else{
					ungetc(ch,fPtr);
					return T_UNKNOWN;
				}
			case '&': case '|':
				return T_BITWISE;			
			default: return T_UNKNOWN;
		}
	}
	else if (ch == EOF) return T_EOF;
	else{
		str += ch;
		token->ascii = str;
		return T_UNKNOWN;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x120, %rsp            # imm = 0x120
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0xa0(%rbp)
leaq -0x49(%rbp), %rdi
movq %rdi, -0x98(%rbp)
callq 0x3430
movq -0x98(%rbp), %rdx
leaq 0x21681(%rip), %rsi     # 0x26c81
leaq -0x48(%rbp), %rdi
callq 0x62d0
jmp 0x560b
leaq -0x49(%rbp), %rdi
callq 0x32e0
movq -0x18(%rbp), %rdi
callq 0x30e0
movl %eax, -0xa4(%rbp)
jmp 0x5625
movq -0xa0(%rbp), %rax
movl -0xa4(%rbp), %ecx
movb %cl, -0x21(%rbp)
testb $0x1, 0x138(%rax)
je 0x5692
movsbl -0x21(%rbp), %eax
cmpl $0xa, %eax
jne 0x5692
movq 0x2d982(%rip), %rdi     # 0x32fd0
movq 0x2d963(%rip), %rsi     # 0x32fb8
callq 0x32c0
jmp 0x565c
jmp 0x5692
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x49(%rbp), %rdi
callq 0x32e0
jmp 0x6154
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x31a0
jmp 0x6154
jmp 0x5694
movq -0xa0(%rbp), %rdi
movsbl -0x21(%rbp), %esi
callq 0x54d0
testb $0x1, %al
jne 0x5614
movsbl -0x21(%rbp), %eax
cmpl $0x2f, %eax
jne 0x58a6
movsbl -0x21(%rbp), %esi
leaq -0x48(%rbp), %rdi
callq 0x31b0
jmp 0x56c8
movq -0x18(%rbp), %rdi
callq 0x30e0
movl %eax, -0xa8(%rbp)
jmp 0x56d9
movl -0xa8(%rbp), %eax
movb %al, -0x22(%rbp)
movsbl -0x22(%rbp), %eax
cmpl $0x2f, %eax
jne 0x5751
jmp 0x56ed
movsbl -0x22(%rbp), %eax
cmpl $0xa, %eax
je 0x5721
movsbl -0x22(%rbp), %esi
leaq -0x48(%rbp), %rdi
callq 0x31b0
jmp 0x5705
movq -0x18(%rbp), %rdi
callq 0x30e0
movl %eax, -0xac(%rbp)
jmp 0x5716
movl -0xac(%rbp), %eax
movb %al, -0x22(%rbp)
jmp 0x56ed
movq -0x20(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x3050
jmp 0x5730
movq -0xa0(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movl $0x15c, -0x4(%rbp)      # imm = 0x15C
movl $0x1, -0x60(%rbp)
jmp 0x613f
movsbl -0x22(%rbp), %eax
cmpl $0x2a, %eax
jne 0x5875
movsbl -0x22(%rbp), %esi
leaq -0x48(%rbp), %rdi
callq 0x31b0
jmp 0x576d
movl $0x1, -0x64(%rbp)
cmpl $0x0, -0x64(%rbp)
jle 0x5853
movq -0x18(%rbp), %rdi
callq 0x30e0
movl %eax, -0xb0(%rbp)
jmp 0x578f
movl -0xb0(%rbp), %eax
movb %al, -0x22(%rbp)
movsbl -0x22(%rbp), %esi
leaq -0x48(%rbp), %rdi
callq 0x31b0
jmp 0x57a7
movsbl -0x22(%rbp), %eax
cmpl $0x2a, %eax
jne 0x57ed
movq -0x18(%rbp), %rdi
callq 0x30e0
movl %eax, -0xb4(%rbp)
jmp 0x57c1
movl -0xb4(%rbp), %eax
movb %al, -0x22(%rbp)
movsbl -0x22(%rbp), %esi
leaq -0x48(%rbp), %rdi
callq 0x31b0
jmp 0x57d9
movsbl -0x22(%rbp), %eax
cmpl $0x2f, %eax
jne 0x57eb
movl -0x64(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x64(%rbp)
jmp 0x584e
movsbl -0x22(%rbp), %eax
cmpl $0x2f, %eax
jne 0x5833
movq -0x18(%rbp), %rdi
callq 0x30e0
movl %eax, -0xb8(%rbp)
jmp 0x5807
movl -0xb8(%rbp), %eax
movb %al, -0x22(%rbp)
movsbl -0x22(%rbp), %esi
leaq -0x48(%rbp), %rdi
callq 0x31b0
jmp 0x581f
movsbl -0x22(%rbp), %eax
cmpl $0x2a, %eax
jne 0x5831
movl -0x64(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x64(%rbp)
jmp 0x584c
movsbl -0x22(%rbp), %eax
cmpl $0xa, %eax
jne 0x584a
movq -0xa0(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
jmp 0x584c
jmp 0x584e
jmp 0x5774
movq -0x20(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x3050
jmp 0x5862
movl $0x15c, -0x4(%rbp)      # imm = 0x15C
movl $0x1, -0x60(%rbp)
jmp 0x613f
movsbl -0x22(%rbp), %edi
movq -0x18(%rbp), %rsi
callq 0x3080
jmp 0x5884
movq -0x20(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x3050
jmp 0x5893
movl $0x130, -0x4(%rbp)      # imm = 0x130
movl $0x1, -0x60(%rbp)
jmp 0x613f
movq -0xa0(%rbp), %rdi
movsbl -0x21(%rbp), %esi
callq 0x53a0
testb $0x1, %al
jne 0x58bf
jmp 0x5a51
movsbl -0x21(%rbp), %esi
leaq -0x48(%rbp), %rdi
callq 0x31b0
jmp 0x58ce
movq -0x18(%rbp), %rdi
callq 0x30e0
movl %eax, -0xbc(%rbp)
jmp 0x58df
movl -0xbc(%rbp), %eax
movb %al, -0x22(%rbp)
movq -0xa0(%rbp), %rdi
movsbl -0x22(%rbp), %esi
callq 0x53a0
testb $0x1, %al
jne 0x58fe
jmp 0x5929
movsbl -0x22(%rbp), %esi
leaq -0x48(%rbp), %rdi
callq 0x31b0
jmp 0x590d
movq -0x18(%rbp), %rdi
callq 0x30e0
movl %eax, -0xc0(%rbp)
jmp 0x591e
movl -0xc0(%rbp), %eax
movb %al, -0x22(%rbp)
jmp 0x58e8
movsbl -0x22(%rbp), %eax
cmpl $0x2e, %eax
jne 0x59f9
movsbl -0x22(%rbp), %esi
leaq -0x48(%rbp), %rdi
callq 0x31b0
jmp 0x5945
movq -0x18(%rbp), %rdi
callq 0x30e0
movl %eax, -0xc4(%rbp)
jmp 0x5956
movl -0xc4(%rbp), %eax
movb %al, -0x22(%rbp)
movq -0xa0(%rbp), %rdi
movsbl -0x22(%rbp), %esi
callq 0x53a0
testb $0x1, %al
jne 0x5975
jmp 0x59a0
movsbl -0x22(%rbp), %esi
leaq -0x48(%rbp), %rdi
callq 0x31b0
jmp 0x5984
movq -0x18(%rbp), %rdi
callq 0x30e0
movl %eax, -0xc8(%rbp)
jmp 0x5995
movl -0xc8(%rbp), %eax
movb %al, -0x22(%rbp)
jmp 0x595f
xorl %eax, %eax
movl %eax, %esi
leaq -0x48(%rbp), %rdi
callq 0x63d0
movsd %xmm0, -0xd0(%rbp)
jmp 0x59b7
movsd -0xd0(%rbp), %xmm0
movq -0x20(%rbp), %rax
movsd %xmm0, 0x28(%rax)
movq -0x20(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x3050
jmp 0x59d7
movsbl -0x22(%rbp), %edi
movq -0x18(%rbp), %rsi
callq 0x3080
jmp 0x59e6
movl $0x10b, -0x4(%rbp)      # imm = 0x10B
movl $0x1, -0x60(%rbp)
jmp 0x613f
xorl %eax, %eax
movl %eax, %esi
leaq -0x48(%rbp), %rdi
movl $0xa, %edx
callq 0x6410
movl %eax, -0xd4(%rbp)
jmp 0x5a13
movl -0xd4(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x28(%rax)
movq -0x20(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x3050
jmp 0x5a2f
movsbl -0x22(%rbp), %edi
movq -0x18(%rbp), %rsi
callq 0x3080
jmp 0x5a3e
movl $0x10a, -0x4(%rbp)      # imm = 0x10A
movl $0x1, -0x60(%rbp)
jmp 0x613f
movq -0xa0(%rbp), %rdi
movsbl -0x21(%rbp), %esi
callq 0x5420
testb $0x1, %al
jne 0x5a6a
jmp 0x5b24
movsbl -0x21(%rbp), %esi
leaq -0x48(%rbp), %rdi
callq 0x31b0
jmp 0x5a79
movq -0x18(%rbp), %rdi
callq 0x30e0
movl %eax, -0xd8(%rbp)
jmp 0x5a8a
movl -0xd8(%rbp), %eax
movb %al, -0x22(%rbp)
movl $0x0, -0x68(%rbp)
movq -0xa0(%rbp), %rdi
movsbl -0x22(%rbp), %esi
callq 0x5420
xorb $-0x1, %al
testb $0x1, %al
jne 0x5ab2
jmp 0x5af3
movb -0x22(%rbp), %dl
movq -0x20(%rbp), %rax
movslq -0x68(%rbp), %rcx
movl %ecx, %esi
incl %esi
movl %esi, -0x68(%rbp)
movb %dl, 0x28(%rax,%rcx)
movsbl -0x22(%rbp), %esi
leaq -0x48(%rbp), %rdi
callq 0x31b0
jmp 0x5ad7
movq -0x18(%rbp), %rdi
callq 0x30e0
movl %eax, -0xdc(%rbp)
jmp 0x5ae8
movl -0xdc(%rbp), %eax
movb %al, -0x22(%rbp)
jmp 0x5a9a
movsbl -0x22(%rbp), %esi
leaq -0x48(%rbp), %rdi
callq 0x31b0
jmp 0x5b02
movq -0x20(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x3050
jmp 0x5b11
movl $0x10d, -0x4(%rbp)      # imm = 0x10D
movl $0x1, -0x60(%rbp)
jmp 0x613f
movq -0xa0(%rbp), %rdi
movsbl -0x21(%rbp), %esi
callq 0x5450
testb $0x1, %al
jne 0x5b3d
jmp 0x5bf7
movsbl -0x21(%rbp), %esi
leaq -0x48(%rbp), %rdi
callq 0x31b0
jmp 0x5b4c
movq -0x18(%rbp), %rdi
callq 0x30e0
movl %eax, -0xe0(%rbp)
jmp 0x5b5d
movl -0xe0(%rbp), %eax
movb %al, -0x22(%rbp)
movl $0x0, -0x6c(%rbp)
movq -0xa0(%rbp), %rdi
movsbl -0x22(%rbp), %esi
callq 0x5450
xorb $-0x1, %al
testb $0x1, %al
jne 0x5b85
jmp 0x5bc6
movb -0x22(%rbp), %dl
movq -0x20(%rbp), %rax
movslq -0x6c(%rbp), %rcx
movl %ecx, %esi
incl %esi
movl %esi, -0x6c(%rbp)
movb %dl, 0x28(%rax,%rcx)
movsbl -0x22(%rbp), %esi
leaq -0x48(%rbp), %rdi
callq 0x31b0
jmp 0x5baa
movq -0x18(%rbp), %rdi
callq 0x30e0
movl %eax, -0xe4(%rbp)
jmp 0x5bbb
movl -0xe4(%rbp), %eax
movb %al, -0x22(%rbp)
jmp 0x5b6d
movsbl -0x22(%rbp), %esi
leaq -0x48(%rbp), %rdi
callq 0x31b0
jmp 0x5bd5
movq -0x20(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x3050
jmp 0x5be4
movl $0x10e, -0x4(%rbp)      # imm = 0x10E
movl $0x1, -0x60(%rbp)
jmp 0x613f
movq -0xa0(%rbp), %rdi
movsbl -0x21(%rbp), %esi
callq 0x53e0
testb $0x1, %al
jne 0x5c10
jmp 0x5dfd
movl $0x0, -0x70(%rbp)
movsbl -0x22(%rbp), %edi
callq 0x3460
movb %al, %dl
movq -0x20(%rbp), %rax
movslq -0x70(%rbp), %rcx
movl %ecx, %esi
incl %esi
movl %esi, -0x70(%rbp)
movb %dl, 0x28(%rax,%rcx)
movsbl -0x21(%rbp), %edi
callq 0x3460
movsbl %al, %esi
leaq -0x48(%rbp), %rdi
callq 0x31b0
jmp 0x5c4c
movq -0x18(%rbp), %rdi
callq 0x30e0
movl %eax, -0xe8(%rbp)
jmp 0x5c5d
movl -0xe8(%rbp), %eax
movb %al, -0x22(%rbp)
movq -0xa0(%rbp), %rdi
movsbl -0x22(%rbp), %esi
callq 0x53e0
movb %al, %cl
movb $0x1, %al
testb $0x1, %cl
movb %al, -0xe9(%rbp)
jne 0x5cb4
movq -0xa0(%rbp), %rdi
movsbl -0x22(%rbp), %esi
callq 0x53a0
movb %al, %cl
movb $0x1, %al
testb $0x1, %cl
movb %al, -0xe9(%rbp)
jne 0x5cb4
movsbl -0x22(%rbp), %eax
cmpl $0x5f, %eax
sete %al
movb %al, -0xe9(%rbp)
movb -0xe9(%rbp), %al
testb $0x1, %al
jne 0x5cc0
jmp 0x5d14
movsbl -0x22(%rbp), %edi
callq 0x3460
movb %al, %dl
movq -0x20(%rbp), %rax
movslq -0x70(%rbp), %rcx
movl %ecx, %esi
incl %esi
movl %esi, -0x70(%rbp)
movb %dl, 0x28(%rax,%rcx)
movsbl -0x22(%rbp), %edi
callq 0x3460
movsbl %al, %esi
leaq -0x48(%rbp), %rdi
callq 0x31b0
jmp 0x5cf5
movq -0x18(%rbp), %rdi
callq 0x30e0
movl %eax, -0xf0(%rbp)
jmp 0x5d06
movl -0xf0(%rbp), %eax
movb %al, -0x22(%rbp)
jmp 0x5c66
movsbl -0x22(%rbp), %edi
movq -0x18(%rbp), %rsi
callq 0x3080
jmp 0x5d23
movq -0x20(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x3050
jmp 0x5d32
leaq -0x78(%rbp), %rdi
callq 0x6450
movq -0xa0(%rbp), %rdi
addq $0x140, %rdi            # imm = 0x140
leaq -0x48(%rbp), %rsi
callq 0x6470
movq %rax, -0xf8(%rbp)
jmp 0x5d5b
movq -0xa0(%rbp), %rdi
movq -0xf8(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x80(%rbp), %rax
movq %rax, -0x78(%rbp)
addq $0x140, %rdi            # imm = 0x140
callq 0x64d0
movq %rax, -0x88(%rbp)
leaq -0x78(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x64a0
testb $0x1, %al
jne 0x5d9e
jmp 0x5dea
movq -0xa0(%rbp), %rdi
addq $0x140, %rdi            # imm = 0x140
leaq -0x48(%rbp), %rsi
callq 0x6470
movq %rax, -0x100(%rbp)
jmp 0x5dbe
movq -0x100(%rbp), %rax
movq %rax, -0x90(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x6500
movl 0x20(%rax), %eax
movl %eax, -0x4(%rbp)
movl $0x1, -0x60(%rbp)
jmp 0x613f
movl $0x11c, -0x4(%rbp)      # imm = 0x11C
movl $0x1, -0x60(%rbp)
jmp 0x613f
movq -0xa0(%rbp), %rdi
movsbl -0x21(%rbp), %esi
callq 0x5480
testb $0x1, %al
jne 0x5e16
jmp 0x60fa
movsbl -0x21(%rbp), %esi
leaq -0x48(%rbp), %rdi
callq 0x31b0
jmp 0x5e25
movq -0x20(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x3050
jmp 0x5e34
movsbl -0x21(%rbp), %eax
addl $-0x21, %eax
movl %eax, %ecx
movq %rcx, -0x108(%rbp)
subl $0x5b, %eax
ja 0x60ea
movq -0x108(%rbp), %rax
leaq 0x1f319(%rip), %rcx     # 0x25174
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x12b, -0x4(%rbp)      # imm = 0x12B
movl $0x1, -0x60(%rbp)
jmp 0x613f
movl $0x12c, -0x4(%rbp)      # imm = 0x12C
movl $0x1, -0x60(%rbp)
jmp 0x613f
movl $0x12d, -0x4(%rbp)      # imm = 0x12D
movl $0x1, -0x60(%rbp)
jmp 0x613f
movl $0x12e, -0x4(%rbp)      # imm = 0x12E
movl $0x1, -0x60(%rbp)
jmp 0x613f
movl $0x130, -0x4(%rbp)      # imm = 0x130
movl $0x1, -0x60(%rbp)
jmp 0x613f
movl $0x131, -0x4(%rbp)      # imm = 0x131
movl $0x1, -0x60(%rbp)
jmp 0x613f
movl $0x132, -0x4(%rbp)      # imm = 0x132
movl $0x1, -0x60(%rbp)
jmp 0x613f
movl $0x133, -0x4(%rbp)      # imm = 0x133
movl $0x1, -0x60(%rbp)
jmp 0x613f
movl $0x134, -0x4(%rbp)      # imm = 0x134
movl $0x1, -0x60(%rbp)
jmp 0x613f
movl $0x135, -0x4(%rbp)      # imm = 0x135
movl $0x1, -0x60(%rbp)
jmp 0x613f
movl $0x136, -0x4(%rbp)      # imm = 0x136
movl $0x1, -0x60(%rbp)
jmp 0x613f
movq -0x18(%rbp), %rdi
callq 0x30e0
movl %eax, -0x10c(%rbp)
jmp 0x5f46
movl -0x10c(%rbp), %eax
movb %al, -0x21(%rbp)
movsbl -0x21(%rbp), %eax
cmpl $0x3d, %eax
jne 0x5f89
movsbl -0x21(%rbp), %esi
leaq -0x48(%rbp), %rdi
callq 0x31b0
jmp 0x5f67
movq -0x20(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x3050
jmp 0x5f76
movl $0x13a, -0x4(%rbp)      # imm = 0x13A
movl $0x1, -0x60(%rbp)
jmp 0x613f
movsbl -0x21(%rbp), %edi
movq -0x18(%rbp), %rsi
callq 0x3080
jmp 0x5f98
movq -0x20(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x3050
jmp 0x5fa7
movl $0x15e, -0x4(%rbp)      # imm = 0x15E
movl $0x1, -0x60(%rbp)
jmp 0x613f
movq -0x18(%rbp), %rdi
callq 0x30e0
movl %eax, -0x110(%rbp)
jmp 0x5fcb
movl -0x110(%rbp), %eax
movb %al, -0x21(%rbp)
movsbl -0x21(%rbp), %eax
cmpl $0x3d, %eax
jne 0x600e
movsbl -0x21(%rbp), %esi
leaq -0x48(%rbp), %rdi
callq 0x31b0
jmp 0x5fec
movq -0x20(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x3050
jmp 0x5ffb
movl $0x139, -0x4(%rbp)      # imm = 0x139
movl $0x1, -0x60(%rbp)
jmp 0x613f
movsbl -0x21(%rbp), %edi
movq -0x18(%rbp), %rsi
callq 0x3080
jmp 0x601d
leaq 0x1f2f8(%rip), %rsi     # 0x2531c
leaq -0x48(%rbp), %rdi
callq 0x6520
movb %al, -0x111(%rbp)
jmp 0x6035
movb -0x111(%rbp), %al
testb $0x1, %al
jne 0x6041
jmp 0x6054
movl $0x15e, -0x4(%rbp)      # imm = 0x15E
movl $0x1, -0x60(%rbp)
jmp 0x613f
movl $0x139, -0x4(%rbp)      # imm = 0x139
movl $0x1, -0x60(%rbp)
jmp 0x613f
movq -0x18(%rbp), %rdi
callq 0x30e0
movl %eax, -0x118(%rbp)
jmp 0x6078
movl -0x118(%rbp), %eax
movb %al, -0x21(%rbp)
movsbl -0x21(%rbp), %eax
cmpl $0x3d, %eax
jne 0x60bb
movsbl -0x21(%rbp), %esi
leaq -0x48(%rbp), %rdi
callq 0x31b0
jmp 0x6099
movq -0x20(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x3050
jmp 0x60a8
movl $0x139, -0x4(%rbp)      # imm = 0x139
movl $0x1, -0x60(%rbp)
jmp 0x613f
movsbl -0x21(%rbp), %edi
movq -0x18(%rbp), %rsi
callq 0x3080
jmp 0x60ca
movl $0x15e, -0x4(%rbp)      # imm = 0x15E
movl $0x1, -0x60(%rbp)
jmp 0x613f
movl $0x13b, -0x4(%rbp)      # imm = 0x13B
movl $0x1, -0x60(%rbp)
jmp 0x613f
movl $0x15e, -0x4(%rbp)      # imm = 0x15E
movl $0x1, -0x60(%rbp)
jmp 0x613f
movsbl -0x21(%rbp), %eax
cmpl $-0x1, %eax
jne 0x6113
movl $0x15d, -0x4(%rbp)      # imm = 0x15D
movl $0x1, -0x60(%rbp)
jmp 0x613f
movsbl -0x21(%rbp), %esi
leaq -0x48(%rbp), %rdi
callq 0x31b0
jmp 0x6122
movq -0x20(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x3050
jmp 0x6131
movl $0x15e, -0x4(%rbp)      # imm = 0x15E
movl $0x1, -0x60(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x31a0
movl -0x4(%rbp), %eax
addq $0x120, %rsp            # imm = 0x120
popq %rbp
retq
movq -0x58(%rbp), %rdi
callq 0x3420
nopl (%rax)