// File: /workspace/github_c_makefile_star2_O0/Gaurang18[P]Compiler-Project-BITS-Pilani/./TypeChecker.c
// Function: TypeChecker
int TypeChecker(FILE *fp, parsetree head, char *scope){
	int type1, type2;
	int i,error=0;

	switch(head->value){

		case 100:
		{	
			
				type1 = TypeChecker(fp, head->parent->parent->parent->child, scope);
				type2 = TypeChecker(fp, head->right, scope);


				if(type2==-2 || type1==-2) return -2;
				else
					if(type2!=type1) 
					{
						fprintf(fp,"\nERROR 15: Type of left variable %s not equal to type of right expression, line number %d\n", head->parent->parent->parent->child->Lex->tk->value, head->Lex->tk->line);
						//printf("Left type %d Right Type %d\n", type1, type2);
						return -2;
					}
				else return type2;
				
		} break;

		case 106:{ 	
					// if(head->value==4){
     //     				strcpy(scope, "driver");
     //     				break;
     //    			}
					// if(head->parent->value==7)
     //   				 {
     //        			strcpy(scope, head->Lex->tk->value);
     //        			break;
     //    			 }

				if(!checksymbolpresent(head->Lex->tk->value, scope))
					return -2;
				else{

					char type[25] = {'\0'};
					strcpy(type, gettype(head->Lex->tk->value, scope));
					char *token = NULL;
            		token = strtok(gettype(head->Lex->tk->value, scope), "(");
            		if(token!=NULL){
                		token = strtok(NULL, ",");
                		if(token!=NULL)
                		strcpy(type, token);
            			}
            		// printf("%s %s\n", head->Lex->tk->value, type);



            		if(strcmp(type, "INTEGER")==0)
            			return 0;
            		if(strcmp(type, "REAL")==0)
            			return 1;
            		if(strcmp(type, "BOOLEAN")==0)
            			return -1;
            	}
            } break;


            case 107: return 0;

            case 108: return 1;

            case 68:
            case 69: return -1;

            case 82:
            case 83:
            		if(head->value==83 && head->parent->value==30)
            		{
            			return TypeChecker(fp, head->right, scope);
            		}

            		if(head->parent->parent->parent->value==38){
            			//printf("%s %s \n", terms[head->parent->parent->parent->child->right->value], terms[head->parent->right->value]);

            		if((type1 = TypeChecker(fp, head->parent->parent->parent->child->right,scope))==-2)
						return -2;
					if((type2 = TypeChecker(fp, head->parent->right, scope))==-2)
						return -2;
					}

					if(head->parent->parent->parent->value==35){

						//printf("%s %s \n", terms[head->parent->parent->parent->child->value], terms[head->parent->right->value]);
						if((type1 = TypeChecker(fp, head->parent->parent->parent->child,scope))==-2)
						return -2;
						if((type2 = TypeChecker(fp, head->parent->right, scope))==-2)
						return -2;
					}
					
					// printf("%d, %d", type1, type2);

					if(type1!=type2)
					{
						fprintf(fp,"ERROR 16: Types don't match, line number %d\n",head->Lex->tk->line);
						return -2;
					}		
					if(type1==-1)
					{
						fprintf(fp,"ERROR 17: Boolean expressions cannot be added or subtracted, line number %d\n", head->Lex->tk->line);
						return -2;
					}	
					return type1;
					break;

            case 84:
            case 85:
            		// printf("MUL value %d\n",head->parent->parent->parent->value );
            		if(head->parent->parent->parent->value==41){
            			// printf("41 %s %s \n", terms[head->parent->parent->parent->child->right->value], terms[head->parent->right->value]);

            		if((type1 = TypeChecker(fp, head->parent->parent->parent->child->right,scope))==-2)
						return -2;
					if((type2 = TypeChecker(fp, head->parent->right, scope))==-2)
						return -2;
					}

					if(head->parent->parent->parent->value==37){

						//printf("37 %s %s \n", terms[head->parent->parent->parent->child->value], terms[head->parent->right->value]);
						if((type1 = TypeChecker(fp, head->parent->parent->parent->child,scope))==-2)
						return -2;
						if((type2 = TypeChecker(fp, head->parent->right, scope))==-2)
						return -2;
					}
					
					//printf("%d, %d", type1, type2);

					if(type1!=type2)
					{
						fprintf(fp,"ERROR 18: Types don't match, line number %d\n",head->Lex->tk->line);
						return -2;
					}		
					if(type1==-1)
					{
						fprintf(fp,"ERROR 19: Boolean expressions cannot be added or subtracted, line number %d\n", head->Lex->tk->line);
						return -2;
					}	
					return type1;
					break;

			case 86:
			case 87:
			case 88:
			case 89:
			case 90:
			case 91:
					if(head->parent->parent->parent->value==43){
					if((type1 = TypeChecker(fp, head->parent->parent->parent->child,scope))==-2)
						return -2;
					if((type2 = TypeChecker(fp, head->parent->right, scope))==-2)
						return -2;
					}

					if(head->parent->parent->parent->value==49){
					if((type1 = TypeChecker(fp, head->parent->parent->parent->child->right,scope))==-2)
						return -2;
					if((type2 = TypeChecker(fp, head->parent->right, scope))==-2)
						return -2;
					}

					if((type1!=0&&type1!=1)||(type2!=0&&type2!=1))
					{
						fprintf(fp,"ERROR 20: Invalid expression. Relational operations possible only on int and real, line number %d\n", head->Lex->tk->line);
						return -2;
					}
					if(type1!=type2)
					{
						fprintf(fp,"ERROR 21: Types of expressions should be same while comparing, line number %d\n", head->Lex->tk->line);
						return -2;
					}
				return -1;

				break;

			case 73:
			case 74:

					if(head->parent->parent->parent->value==42){
						if((type1 = TypeChecker(fp, head->parent->parent->parent->child,scope))!=-1)
					{
						fprintf(fp,"ERROR 22: Logical operators can only be applied to boolean type, line number %d\n",  head->Lex->tk->line);
						return -2;
					}
					if((type2 = TypeChecker(fp, head->parent->right, scope))!=-1)
					{
						fprintf(fp,"ERROR 23: Logical operators can only be applied to boolean type, line number %d\n",  head->Lex->tk->line);
						return -2;
					}
					}


					if(head->parent->parent->parent->value==48){
					if((type1 = TypeChecker(fp, head->parent->parent->parent->child->right,scope))!=-1)
					{
						fprintf(fp,"ERROR 24: Logical operators can only be applied to boolean type, line number %d\n",  head->Lex->tk->line);
						return -2;
					}
					if((type2 = TypeChecker(fp, head->parent->right, scope))!=-1)
					{
						fprintf(fp,"ERROR 25: Logical operators can only be applied to boolean type, line number %d\n",  head->Lex->tk->line);
						return -2;
					}
				}
				return -1;
				break;

			default: 
			{
				parsetree child = head->child;

				while(child!=NULL && child->value!=109 )
				{	
					if(child->value==24){

					}
					/*else if(child->left->value == 49 ){
						return type1;
					}*/
					//child = child->right;

					else if((type1 = TypeChecker(fp, child,scope))==-2)
						error=1;
					if(type1 == -1 && child->value == 45){
						return -1;
					}
					
					child = child->right;
				}

				if(error==1)
					return -2;

				return type1;
			}

			
				
		 		
	}

	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl $0x0, -0x30(%rbp)
movq -0x18(%rbp), %rax
movl 0x8(%rax), %eax
addl $-0x44, %eax
movl %eax, %ecx
movq %rcx, -0x68(%rbp)
subl $0x28, %eax
ja 0x7ec4
movq -0x68(%rbp), %rax
leaq 0x4af6(%rip), %rcx      # 0xc1a8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rax
movq 0x30(%rax), %rax
movq 0x30(%rax), %rax
movq 0x18(%rax), %rsi
movq -0x20(%rbp), %rdx
callq 0x7670
movl %eax, -0x24(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rsi
movq -0x20(%rbp), %rdx
callq 0x7670
movl %eax, -0x28(%rbp)
cmpl $-0x2, -0x28(%rbp)
je 0x7703
cmpl $-0x2, -0x24(%rbp)
jne 0x770f
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x7f66
movl -0x28(%rbp), %eax
cmpl -0x24(%rbp), %eax
je 0x7760
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rax
movq 0x30(%rax), %rax
movq 0x30(%rax), %rax
movq 0x18(%rax), %rax
movq (%rax), %rax
movq (%rax), %rdx
addq $0x1e, %rdx
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq (%rax), %rax
movl 0x3c(%rax), %ecx
leaq 0x5173(%rip), %rsi      # 0xc8c0
movb $0x0, %al
callq 0x2100
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x7f66
movl -0x28(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x7f66
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq (%rax), %rdi
addq $0x1e, %rdi
movq -0x20(%rbp), %rsi
callq 0x71d0
cmpl $0x0, %eax
jne 0x7793
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x7f66
leaq -0x50(%rbp), %rdi
xorl %esi, %esi
movl $0x19, %edx
callq 0x20c0
leaq -0x50(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq (%rax), %rdi
addq $0x1e, %rdi
movq -0x20(%rbp), %rsi
callq 0x7340
movq -0x70(%rbp), %rdi
movq %rax, %rsi
callq 0x2050
movq $0x0, -0x58(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq (%rax), %rdi
addq $0x1e, %rdi
movq -0x20(%rbp), %rsi
callq 0x7340
movq %rax, %rdi
leaq 0x4ce3(%rip), %rsi      # 0xc4da
callq 0x2160
movq %rax, -0x58(%rbp)
cmpq $0x0, -0x58(%rbp)
je 0x7831
xorl %eax, %eax
movl %eax, %edi
leaq 0x4cb8(%rip), %rsi      # 0xc4ca
callq 0x2160
movq %rax, -0x58(%rbp)
cmpq $0x0, -0x58(%rbp)
je 0x782f
leaq -0x50(%rbp), %rdi
movq -0x58(%rbp), %rsi
callq 0x2050
jmp 0x7831
leaq -0x50(%rbp), %rdi
leaq 0x53cb(%rip), %rsi      # 0xcc07
callq 0x20f0
cmpl $0x0, %eax
jne 0x7852
movl $0x0, -0x4(%rbp)
jmp 0x7f66
leaq -0x50(%rbp), %rdi
leaq 0x53b4(%rip), %rsi      # 0xcc11
callq 0x20f0
cmpl $0x0, %eax
jne 0x7873
movl $0x1, -0x4(%rbp)
jmp 0x7f66
leaq -0x50(%rbp), %rdi
leaq 0x539a(%rip), %rsi      # 0xcc18
callq 0x20f0
cmpl $0x0, %eax
jne 0x7894
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x7f66
jmp 0x7896
jmp 0x7f5f
movl $0x0, -0x4(%rbp)
jmp 0x7f66
movl $0x1, -0x4(%rbp)
jmp 0x7f66
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x7f66
movq -0x18(%rbp), %rax
cmpl $0x53, 0x8(%rax)
jne 0x78f4
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rax
cmpl $0x1e, 0x8(%rax)
jne 0x78f4
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rsi
movq -0x20(%rbp), %rdx
callq 0x7670
movl %eax, -0x4(%rbp)
jmp 0x7f66
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rax
movq 0x30(%rax), %rax
movq 0x30(%rax), %rax
cmpl $0x26, 0x8(%rax)
jne 0x7972
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rax
movq 0x30(%rax), %rax
movq 0x30(%rax), %rax
movq 0x18(%rax), %rax
movq 0x28(%rax), %rsi
movq -0x20(%rbp), %rdx
callq 0x7670
movl %eax, -0x24(%rbp)
cmpl $-0x2, %eax
jne 0x7943
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x7f66
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rax
movq 0x28(%rax), %rsi
movq -0x20(%rbp), %rdx
callq 0x7670
movl %eax, -0x28(%rbp)
cmpl $-0x2, %eax
jne 0x7970
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x7f66
jmp 0x7972
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rax
movq 0x30(%rax), %rax
movq 0x30(%rax), %rax
cmpl $0x23, 0x8(%rax)
jne 0x79ec
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rax
movq 0x30(%rax), %rax
movq 0x30(%rax), %rax
movq 0x18(%rax), %rsi
movq -0x20(%rbp), %rdx
callq 0x7670
movl %eax, -0x24(%rbp)
cmpl $-0x2, %eax
jne 0x79bd
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x7f66
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rax
movq 0x28(%rax), %rsi
movq -0x20(%rbp), %rdx
callq 0x7670
movl %eax, -0x28(%rbp)
cmpl $-0x2, %eax
jne 0x79ea
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x7f66
jmp 0x79ec
movl -0x24(%rbp), %eax
cmpl -0x28(%rbp), %eax
je 0x7a1f
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq (%rax), %rax
movl 0x3c(%rax), %edx
leaq 0x4f0f(%rip), %rsi      # 0xc91b
movb $0x0, %al
callq 0x2100
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x7f66
cmpl $-0x1, -0x24(%rbp)
jne 0x7a50
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq (%rax), %rax
movl 0x3c(%rax), %edx
leaq 0x4f0b(%rip), %rsi      # 0xc948
movb $0x0, %al
callq 0x2100
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x7f66
movl -0x24(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x7f66
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rax
movq 0x30(%rax), %rax
movq 0x30(%rax), %rax
cmpl $0x29, 0x8(%rax)
jne 0x7ad9
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rax
movq 0x30(%rax), %rax
movq 0x30(%rax), %rax
movq 0x18(%rax), %rax
movq 0x28(%rax), %rsi
movq -0x20(%rbp), %rdx
callq 0x7670
movl %eax, -0x24(%rbp)
cmpl $-0x2, %eax
jne 0x7aaa
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x7f66
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rax
movq 0x28(%rax), %rsi
movq -0x20(%rbp), %rdx
callq 0x7670
movl %eax, -0x28(%rbp)
cmpl $-0x2, %eax
jne 0x7ad7
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x7f66
jmp 0x7ad9
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rax
movq 0x30(%rax), %rax
movq 0x30(%rax), %rax
cmpl $0x25, 0x8(%rax)
jne 0x7b53
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rax
movq 0x30(%rax), %rax
movq 0x30(%rax), %rax
movq 0x18(%rax), %rsi
movq -0x20(%rbp), %rdx
callq 0x7670
movl %eax, -0x24(%rbp)
cmpl $-0x2, %eax
jne 0x7b24
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x7f66
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rax
movq 0x28(%rax), %rsi
movq -0x20(%rbp), %rdx
callq 0x7670
movl %eax, -0x28(%rbp)
cmpl $-0x2, %eax
jne 0x7b51
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x7f66
jmp 0x7b53
movl -0x24(%rbp), %eax
cmpl -0x28(%rbp), %eax
je 0x7b86
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq (%rax), %rax
movl 0x3c(%rax), %edx
leaq 0x4e22(%rip), %rsi      # 0xc995
movb $0x0, %al
callq 0x2100
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x7f66
cmpl $-0x1, -0x24(%rbp)
jne 0x7bb7
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq (%rax), %rax
movl 0x3c(%rax), %edx
leaq 0x4e1e(%rip), %rsi      # 0xc9c2
movb $0x0, %al
callq 0x2100
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x7f66
movl -0x24(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x7f66
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rax
movq 0x30(%rax), %rax
movq 0x30(%rax), %rax
cmpl $0x2b, 0x8(%rax)
jne 0x7c3c
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rax
movq 0x30(%rax), %rax
movq 0x30(%rax), %rax
movq 0x18(%rax), %rsi
movq -0x20(%rbp), %rdx
callq 0x7670
movl %eax, -0x24(%rbp)
cmpl $-0x2, %eax
jne 0x7c0d
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x7f66
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rax
movq 0x28(%rax), %rsi
movq -0x20(%rbp), %rdx
callq 0x7670
movl %eax, -0x28(%rbp)
cmpl $-0x2, %eax
jne 0x7c3a
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x7f66
jmp 0x7c3c
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rax
movq 0x30(%rax), %rax
movq 0x30(%rax), %rax
cmpl $0x31, 0x8(%rax)
jne 0x7cba
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rax
movq 0x30(%rax), %rax
movq 0x30(%rax), %rax
movq 0x18(%rax), %rax
movq 0x28(%rax), %rsi
movq -0x20(%rbp), %rdx
callq 0x7670
movl %eax, -0x24(%rbp)
cmpl $-0x2, %eax
jne 0x7c8b
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x7f66
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rax
movq 0x28(%rax), %rsi
movq -0x20(%rbp), %rdx
callq 0x7670
movl %eax, -0x28(%rbp)
cmpl $-0x2, %eax
jne 0x7cb8
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x7f66
jmp 0x7cba
cmpl $0x0, -0x24(%rbp)
je 0x7cc6
cmpl $0x1, -0x24(%rbp)
jne 0x7cd2
cmpl $0x0, -0x28(%rbp)
je 0x7cfd
cmpl $0x1, -0x28(%rbp)
je 0x7cfd
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq (%rax), %rax
movl 0x3c(%rax), %edx
leaq 0x4d25(%rip), %rsi      # 0xca0f
movb $0x0, %al
callq 0x2100
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x7f66
movl -0x24(%rbp), %eax
cmpl -0x28(%rbp), %eax
je 0x7d30
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq (%rax), %rax
movl 0x3c(%rax), %edx
leaq 0x4d55(%rip), %rsi      # 0xca72
movb $0x0, %al
callq 0x2100
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x7f66
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x7f66
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rax
movq 0x30(%rax), %rax
movq 0x30(%rax), %rax
cmpl $0x2a, 0x8(%rax)
jne 0x7df8
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rax
movq 0x30(%rax), %rax
movq 0x30(%rax), %rax
movq 0x18(%rax), %rsi
movq -0x20(%rbp), %rdx
callq 0x7670
movl %eax, -0x24(%rbp)
cmpl $-0x1, %eax
je 0x7daa
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq (%rax), %rax
movl 0x3c(%rax), %edx
leaq 0x4d2a(%rip), %rsi      # 0xcac1
movb $0x0, %al
callq 0x2100
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x7f66
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rax
movq 0x28(%rax), %rsi
movq -0x20(%rbp), %rdx
callq 0x7670
movl %eax, -0x28(%rbp)
cmpl $-0x1, %eax
je 0x7df6
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq (%rax), %rax
movl 0x3c(%rax), %edx
leaq 0x4d2f(%rip), %rsi      # 0xcb12
movb $0x0, %al
callq 0x2100
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x7f66
jmp 0x7df8
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rax
movq 0x30(%rax), %rax
movq 0x30(%rax), %rax
cmpl $0x30, 0x8(%rax)
jne 0x7eb8
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rax
movq 0x30(%rax), %rax
movq 0x30(%rax), %rax
movq 0x18(%rax), %rax
movq 0x28(%rax), %rsi
movq -0x20(%rbp), %rdx
callq 0x7670
movl %eax, -0x24(%rbp)
cmpl $-0x1, %eax
je 0x7e6a
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq (%rax), %rax
movl 0x3c(%rax), %edx
leaq 0x4d0c(%rip), %rsi      # 0xcb63
movb $0x0, %al
callq 0x2100
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x7f66
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rax
movq 0x28(%rax), %rsi
movq -0x20(%rbp), %rdx
callq 0x7670
movl %eax, -0x28(%rbp)
cmpl $-0x1, %eax
je 0x7eb6
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq (%rax), %rax
movl 0x3c(%rax), %edx
leaq 0x4d11(%rip), %rsi      # 0xcbb4
movb $0x0, %al
callq 0x2100
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x7f66
jmp 0x7eb8
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x7f66
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x60(%rbp)
xorl %eax, %eax
cmpq $0x0, -0x60(%rbp)
movb %al, -0x71(%rbp)
je 0x7eea
movq -0x60(%rbp), %rax
cmpl $0x6d, 0x8(%rax)
setne %al
movb %al, -0x71(%rbp)
movb -0x71(%rbp), %al
testb $0x1, %al
jne 0x7ef3
jmp 0x7f48
movq -0x60(%rbp), %rax
cmpl $0x18, 0x8(%rax)
jne 0x7eff
jmp 0x7f21
movq -0x10(%rbp), %rdi
movq -0x60(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x7670
movl %eax, -0x24(%rbp)
cmpl $-0x2, %eax
jne 0x7f1f
movl $0x1, -0x30(%rbp)
jmp 0x7f21
cmpl $-0x1, -0x24(%rbp)
jne 0x7f3a
movq -0x60(%rbp), %rax
cmpl $0x2d, 0x8(%rax)
jne 0x7f3a
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x7f66
movq -0x60(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x60(%rbp)
jmp 0x7ed0
cmpl $0x1, -0x30(%rbp)
jne 0x7f57
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x7f66
movl -0x24(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x7f66
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x80, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)