// File: PrarabdhJoshi[P]DatabaseImplementation/Comparison.cc
// Function: CNF::GrowFromParseTree(AndList*, Schema*, Record&)
void CNF :: GrowFromParseTree (struct AndList *parseTree, Schema *mySchema, 
	Record &literal) {

	CNF &cnf = *this;

	// as kind of a hack, the literal record is built up insiide of a text file,
	// where it will be read in from subsequently
	FILE *outRecFile = fopen ("sdafdsfFFDSDA", "w");

	// also as kind of a hack, the schema for the literal record is built up
	// inside of a text file, where it will also be read from subsequently
	FILE *outSchemaFile = fopen ("hkljdfgkSDFSDF", "w");
	fprintf (outSchemaFile, "BEGIN\ntempSchema\nwherever\n");

	// this tells us the size of the literal record
	int numFieldsInLiteral = 0;

	// now we go through and build the comparison structure
	for (int whichAnd = 0; 1; whichAnd++, parseTree = parseTree->rightAnd) {
		
		// see if we have run off of the end of all of the ANDs
		if (parseTree == NULL) {
			cnf.numAnds = whichAnd;
			break;
		}	

		// we have not, so copy over all of the ORs hanging off of this AND
		struct OrList *myOr = parseTree->left;
		for (int whichOr = 0; 1; whichOr++, myOr = myOr->rightOr) {

			// see if we have run off of the end of the ORs
			if (myOr == NULL) {
				cnf.orLens[whichAnd] = whichOr;
				break;
			}

			// we have not run off the list, so add the current OR in!
			
			// these store the types of the two values that are found
			Type typeLeft;
			Type typeRight;

			// first thing is to deal with the left operand
			// so we check to see if it is an attribute name, and if so,
			// we look it up in the schema
			if (myOr->left->left->code == NAME) {
				
				// see if we can find this attribute in the schema
				if (mySchema->Find (myOr->left->left->value) != -1) {
					cnf.orList[whichAnd][whichOr].operand1 = Left;
					cnf.orList[whichAnd][whichOr].whichAtt1 =
						mySchema->Find (myOr->left->left->value);	
					typeLeft = mySchema->FindType (myOr->left->left->value);

				// it is not there!  So there is an error in the query
                                } else {
					cout << "ERROR: Could not find attribute " <<
						myOr->left->left->value << "\n";
					exit (1);	
				}

			// the next thing is to see if we have a string; if so, add it to the 
			// literal record that stores all of the comparison values
			} else if (myOr->left->left->code == STRING) {

				cnf.orList[whichAnd][whichOr].operand1 = Literal;
				cnf.orList[whichAnd][whichOr].whichAtt1 = numFieldsInLiteral;
				AddLitToFile (numFieldsInLiteral, outRecFile, outSchemaFile, myOr->left->left->value, String);
				typeLeft = String;

			// see if it is an integer
			} else if (myOr->left->left->code == INT) {

				cnf.orList[whichAnd][whichOr].operand1 = Literal;
				cnf.orList[whichAnd][whichOr].whichAtt1 = numFieldsInLiteral;
				AddLitToFile (numFieldsInLiteral, outRecFile, outSchemaFile, myOr->left->left->value, Int);
				typeLeft = Int;

			// see if it is a double
			} else if (myOr->left->left->code == DOUBLE) {

				cnf.orList[whichAnd][whichOr].operand1 = Literal;
				cnf.orList[whichAnd][whichOr].whichAtt1 = numFieldsInLiteral;
				AddLitToFile (numFieldsInLiteral, outRecFile, outSchemaFile, myOr->left->left->value, Double);
				typeLeft = Double;
	
			// catch-all case
			} else {
				cerr << "You gave me some strange type for an operand that I do not recognize!!\n";
				exit (1);
			}

			// now that we have dealt with the left operand, we need to deal with the
			// right operand
			if (myOr->left->right->code == NAME) {
				
				// see if we can find this attribute in the left schema
				if (mySchema->Find (myOr->left->right->value) != -1) {
					cnf.orList[whichAnd][whichOr].operand2 = Left;
					cnf.orList[whichAnd][whichOr].whichAtt2 =
						mySchema->Find (myOr->left->right->value);	
					typeRight = mySchema->FindType (myOr->left->right->value);

				// it is not there!  So there is an error in the query
                                } else {
					cout << "ERROR: Could not find attribute " << myOr->left->right->value << "\n";
					exit (1);	
				}

			// the next thing is to see if we have a string; if so, add it to the 
			// literal record that stores all of the comparison values
			} else if (myOr->left->right->code == STRING) {

				cnf.orList[whichAnd][whichOr].operand2 = Literal;
				cnf.orList[whichAnd][whichOr].whichAtt2 = numFieldsInLiteral;
				AddLitToFile (numFieldsInLiteral, outRecFile, outSchemaFile, myOr->left->right->value, String);
				typeRight = String;

			// see if it is an integer
			} else if (myOr->left->right->code == INT) {

				cnf.orList[whichAnd][whichOr].operand2 = Literal;
				cnf.orList[whichAnd][whichOr].whichAtt2 = numFieldsInLiteral;
				AddLitToFile (numFieldsInLiteral, outRecFile, outSchemaFile, myOr->left->right->value, Int);
				typeRight = Int;

			// see if it is a double
			} else if (myOr->left->right->code == DOUBLE) {

				cnf.orList[whichAnd][whichOr].operand2 = Literal;
				cnf.orList[whichAnd][whichOr].whichAtt2 = numFieldsInLiteral;
				AddLitToFile (numFieldsInLiteral, outRecFile, outSchemaFile, myOr->left->right->value, Double);
				typeRight = Double;
	
			// catch-all case
			} else {
				cerr << "You gave me some strange type for an operand that I do not recognize!!\n";
				exit (1);
			}
			

			// now we check to make sure that there was not a type mismatch
			if (typeLeft != typeRight) {
				cerr << "ERROR! Type mismatch in CNF.  " << myOr->left->left->value << " and "
					<< myOr->left->right->value << " were found to not match.\n";
				exit (1);
			}

			// set up the type info for this comparison
			cnf.orList[whichAnd][whichOr].attType = typeLeft;

			// and finally set up the comparison operator for this comparison
			if (myOr->left->code == LESS_THAN) {
				cnf.orList[whichAnd][whichOr].op = LessThan;	
			} else if (myOr->left->code == GREATER_THAN) {
				cnf.orList[whichAnd][whichOr].op = GreaterThan;	
			} else if (myOr->left->code == EQUALS) {
				cnf.orList[whichAnd][whichOr].op = Equals;
			} else {
				cerr << "BAD: found a comparison op I don't recognize.\n";
				exit (1);
			}
		
		}
	}

	// the very last thing is to set up the literal record; first close the
	// file where its information has been stored
	fclose (outRecFile);
	fprintf (outSchemaFile, "END\n");
	fclose (outSchemaFile);

	// and open up the record file
	outRecFile = fopen ("sdafdsfFFDSDA", "r");

	// read in the record's schema
	Schema outSchema("hkljdfgkSDFSDF", "tempSchema");

	// and get the record
	literal.SuckNextRecord (&outSchema, outRecFile);

	// close the record file
	fclose (outRecFile);

	remove("sdafdsfFFDSDA");
	remove("hkljdfgkSDFSDF");
}

// Assembly:
subq $0x88, %rsp
movq %rdi, 0x80(%rsp)
movq %rsi, 0x78(%rsp)
movq %rdx, 0x70(%rsp)
movq %rcx, 0x68(%rsp)
movq 0x80(%rsp), %rax
movq %rax, 0x60(%rsp)
leaq 0x790e(%rip), %rdi      # 0xc0f0
leaq 0x8254(%rip), %rsi      # 0xca3d
callq 0x21a0
movq %rax, 0x58(%rsp)
leaq 0x7904(%rip), %rdi      # 0xc0fe
leaq 0x823c(%rip), %rsi      # 0xca3d
callq 0x21a0
movq %rax, 0x50(%rsp)
movq 0x50(%rsp), %rdi
leaq 0x78f6(%rip), %rsi      # 0xc10d
movb $0x0, %al
callq 0x2210
movl $0x0, 0x4c(%rsp)
movl $0x0, 0x48(%rsp)
movb $0x1, %al
testb $0x1, %al
jne 0x4839
jmp 0x5019
cmpq $0x0, 0x78(%rsp)
jne 0x4855
movl 0x48(%rsp), %ecx
movq 0x60(%rsp), %rax
movl %ecx, 0x25d0(%rax)
jmp 0x5019
movq 0x78(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x40(%rsp)
movl $0x0, 0x3c(%rsp)
movb $0x1, %al
testb $0x1, %al
jne 0x4875
jmp 0x4ff9
cmpq $0x0, 0x40(%rsp)
jne 0x4897
movl 0x3c(%rsp), %edx
movq 0x60(%rsp), %rax
movslq 0x48(%rsp), %rcx
movl %edx, 0x2580(%rax,%rcx,4)
jmp 0x4ff9
movq 0x40(%rsp), %rax
movq (%rax), %rax
movq 0x8(%rax), %rax
cmpl $0x4, (%rax)
jne 0x499d
movq 0x70(%rsp), %rdi
movq 0x40(%rsp), %rax
movq (%rax), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rsi
callq 0x5c20
cmpl $-0x1, %eax
je 0x4954
movq 0x60(%rsp), %rax
movslq 0x48(%rsp), %rcx
imulq $0x1e0, %rcx, %rcx      # imm = 0x1E0
addq %rcx, %rax
movslq 0x3c(%rsp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl $0x0, (%rax)
movq 0x70(%rsp), %rdi
movq 0x40(%rsp), %rax
movq (%rax), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rsi
callq 0x5c20
movl %eax, %ecx
movq 0x60(%rsp), %rax
movslq 0x48(%rsp), %rdx
imulq $0x1e0, %rdx, %rdx      # imm = 0x1E0
addq %rdx, %rax
movslq 0x3c(%rsp), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x4(%rax)
movq 0x70(%rsp), %rdi
movq 0x40(%rsp), %rax
movq (%rax), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rsi
callq 0x5ca0
movl %eax, 0x38(%rsp)
jmp 0x4998
movq 0xb65d(%rip), %rdi      # 0xffb8
leaq 0x77c6(%rip), %rsi      # 0xc128
callq 0x2140
movq %rax, %rdi
movq 0x40(%rsp), %rax
movq (%rax), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rsi
callq 0x2140
movq %rax, %rdi
leaq 0x81ec(%rip), %rsi      # 0xcb75
callq 0x2140
movl $0x1, %edi
callq 0x21c0
jmp 0x4b85
movq 0x40(%rsp), %rax
movq (%rax), %rax
movq 0x8(%rax), %rax
cmpl $0x3, (%rax)
jne 0x4a36
movq 0x60(%rsp), %rax
movslq 0x48(%rsp), %rcx
imulq $0x1e0, %rcx, %rcx      # imm = 0x1E0
addq %rcx, %rax
movslq 0x3c(%rsp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl $0x2, (%rax)
movl 0x4c(%rsp), %ecx
movq 0x60(%rsp), %rax
movslq 0x48(%rsp), %rdx
imulq $0x1e0, %rdx, %rdx      # imm = 0x1E0
addq %rdx, %rax
movslq 0x3c(%rsp), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x4(%rax)
movq 0x58(%rsp), %rsi
movq 0x50(%rsp), %rdx
movq 0x40(%rsp), %rax
movq (%rax), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rcx
leaq 0x4c(%rsp), %rdi
movl $0x2, %r8d
callq 0x3c20
movl $0x2, 0x38(%rsp)
jmp 0x4b83
movq 0x40(%rsp), %rax
movq (%rax), %rax
movq 0x8(%rax), %rax
cmpl $0x2, (%rax)
jne 0x4acc
movq 0x60(%rsp), %rax
movslq 0x48(%rsp), %rcx
imulq $0x1e0, %rcx, %rcx      # imm = 0x1E0
addq %rcx, %rax
movslq 0x3c(%rsp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl $0x2, (%rax)
movl 0x4c(%rsp), %ecx
movq 0x60(%rsp), %rax
movslq 0x48(%rsp), %rdx
imulq $0x1e0, %rdx, %rdx      # imm = 0x1E0
addq %rdx, %rax
movslq 0x3c(%rsp), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x4(%rax)
movq 0x58(%rsp), %rsi
movq 0x50(%rsp), %rdx
movq 0x40(%rsp), %rax
movq (%rax), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rcx
leaq 0x4c(%rsp), %rdi
xorl %r8d, %r8d
callq 0x3c20
movl $0x0, 0x38(%rsp)
jmp 0x4b81
movq 0x40(%rsp), %rax
movq (%rax), %rax
movq 0x8(%rax), %rax
cmpl $0x1, (%rax)
jne 0x4b62
movq 0x60(%rsp), %rax
movslq 0x48(%rsp), %rcx
imulq $0x1e0, %rcx, %rcx      # imm = 0x1E0
addq %rcx, %rax
movslq 0x3c(%rsp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl $0x2, (%rax)
movl 0x4c(%rsp), %ecx
movq 0x60(%rsp), %rax
movslq 0x48(%rsp), %rdx
imulq $0x1e0, %rdx, %rdx      # imm = 0x1E0
addq %rdx, %rax
movslq 0x3c(%rsp), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x4(%rax)
movq 0x58(%rsp), %rsi
movq 0x50(%rsp), %rdx
movq 0x40(%rsp), %rax
movq (%rax), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rcx
leaq 0x4c(%rsp), %rdi
movl $0x1, %r8d
callq 0x3c20
movl $0x1, 0x38(%rsp)
jmp 0x4b7f
movq 0xb47f(%rip), %rdi      # 0xffe8
leaq 0x75d9(%rip), %rsi      # 0xc149
callq 0x2140
movl $0x1, %edi
callq 0x21c0
jmp 0x4b81
jmp 0x4b83
jmp 0x4b85
movq 0x40(%rsp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
cmpl $0x4, (%rax)
jne 0x4c8c
movq 0x70(%rsp), %rdi
movq 0x40(%rsp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rsi
callq 0x5c20
cmpl $-0x1, %eax
je 0x4c43
movq 0x60(%rsp), %rax
movslq 0x48(%rsp), %rcx
imulq $0x1e0, %rcx, %rcx      # imm = 0x1E0
addq %rcx, %rax
movslq 0x3c(%rsp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl $0x0, 0x8(%rax)
movq 0x70(%rsp), %rdi
movq 0x40(%rsp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rsi
callq 0x5c20
movl %eax, %ecx
movq 0x60(%rsp), %rax
movslq 0x48(%rsp), %rdx
imulq $0x1e0, %rdx, %rdx      # imm = 0x1E0
addq %rdx, %rax
movslq 0x3c(%rsp), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0xc(%rax)
movq 0x70(%rsp), %rdi
movq 0x40(%rsp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rsi
callq 0x5ca0
movl %eax, 0x34(%rsp)
jmp 0x4c87
movq 0xb36e(%rip), %rdi      # 0xffb8
leaq 0x74d7(%rip), %rsi      # 0xc128
callq 0x2140
movq %rax, %rdi
movq 0x40(%rsp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rsi
callq 0x2140
movq %rax, %rdi
leaq 0x7efd(%rip), %rsi      # 0xcb75
callq 0x2140
movl $0x1, %edi
callq 0x21c0
jmp 0x4e77
movq 0x40(%rsp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
cmpl $0x3, (%rax)
jne 0x4d26
movq 0x60(%rsp), %rax
movslq 0x48(%rsp), %rcx
imulq $0x1e0, %rcx, %rcx      # imm = 0x1E0
addq %rcx, %rax
movslq 0x3c(%rsp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl $0x2, 0x8(%rax)
movl 0x4c(%rsp), %ecx
movq 0x60(%rsp), %rax
movslq 0x48(%rsp), %rdx
imulq $0x1e0, %rdx, %rdx      # imm = 0x1E0
addq %rdx, %rax
movslq 0x3c(%rsp), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0xc(%rax)
movq 0x58(%rsp), %rsi
movq 0x50(%rsp), %rdx
movq 0x40(%rsp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rcx
leaq 0x4c(%rsp), %rdi
movl $0x2, %r8d
callq 0x3c20
movl $0x2, 0x34(%rsp)
jmp 0x4e75
movq 0x40(%rsp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
cmpl $0x2, (%rax)
jne 0x4dbd
movq 0x60(%rsp), %rax
movslq 0x48(%rsp), %rcx
imulq $0x1e0, %rcx, %rcx      # imm = 0x1E0
addq %rcx, %rax
movslq 0x3c(%rsp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl $0x2, 0x8(%rax)
movl 0x4c(%rsp), %ecx
movq 0x60(%rsp), %rax
movslq 0x48(%rsp), %rdx
imulq $0x1e0, %rdx, %rdx      # imm = 0x1E0
addq %rdx, %rax
movslq 0x3c(%rsp), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0xc(%rax)
movq 0x58(%rsp), %rsi
movq 0x50(%rsp), %rdx
movq 0x40(%rsp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rcx
leaq 0x4c(%rsp), %rdi
xorl %r8d, %r8d
callq 0x3c20
movl $0x0, 0x34(%rsp)
jmp 0x4e73
movq 0x40(%rsp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
cmpl $0x1, (%rax)
jne 0x4e54
movq 0x60(%rsp), %rax
movslq 0x48(%rsp), %rcx
imulq $0x1e0, %rcx, %rcx      # imm = 0x1E0
addq %rcx, %rax
movslq 0x3c(%rsp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl $0x2, 0x8(%rax)
movl 0x4c(%rsp), %ecx
movq 0x60(%rsp), %rax
movslq 0x48(%rsp), %rdx
imulq $0x1e0, %rdx, %rdx      # imm = 0x1E0
addq %rdx, %rax
movslq 0x3c(%rsp), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0xc(%rax)
movq 0x58(%rsp), %rsi
movq 0x50(%rsp), %rdx
movq 0x40(%rsp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rcx
leaq 0x4c(%rsp), %rdi
movl $0x1, %r8d
callq 0x3c20
movl $0x1, 0x34(%rsp)
jmp 0x4e71
movq 0xb18d(%rip), %rdi      # 0xffe8
leaq 0x72e7(%rip), %rsi      # 0xc149
callq 0x2140
movl $0x1, %edi
callq 0x21c0
jmp 0x4e73
jmp 0x4e75
jmp 0x4e77
movl 0x38(%rsp), %eax
cmpl 0x34(%rsp), %eax
je 0x4eec
movq 0xb160(%rip), %rdi      # 0xffe8
leaq 0x7302(%rip), %rsi      # 0xc191
callq 0x2140
movq %rax, %rdi
movq 0x40(%rsp), %rax
movq (%rax), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rsi
callq 0x2140
movq %rax, %rdi
leaq 0x72fa(%rip), %rsi      # 0xc1b0
callq 0x2140
movq %rax, %rdi
movq 0x40(%rsp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rsi
callq 0x2140
movq %rax, %rdi
leaq 0x72d9(%rip), %rsi      # 0xc1b6
callq 0x2140
movl $0x1, %edi
callq 0x21c0
movl 0x38(%rsp), %ecx
movq 0x60(%rsp), %rax
movslq 0x48(%rsp), %rdx
imulq $0x1e0, %rdx, %rdx      # imm = 0x1E0
addq %rdx, %rax
movslq 0x3c(%rsp), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x10(%rax)
movq 0x40(%rsp), %rax
movq (%rax), %rax
cmpl $0x1, (%rax)
jne 0x4f4c
movq 0x60(%rsp), %rax
movslq 0x48(%rsp), %rcx
imulq $0x1e0, %rcx, %rcx      # imm = 0x1E0
addq %rcx, %rax
movslq 0x3c(%rsp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl $0x0, 0x14(%rax)
jmp 0x4fd9
movq 0x40(%rsp), %rax
movq (%rax), %rax
cmpl $0x2, (%rax)
jne 0x4f82
movq 0x60(%rsp), %rax
movslq 0x48(%rsp), %rcx
imulq $0x1e0, %rcx, %rcx      # imm = 0x1E0
addq %rcx, %rax
movslq 0x3c(%rsp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl $0x1, 0x14(%rax)
jmp 0x4fd7
movq 0x40(%rsp), %rax
movq (%rax), %rax
cmpl $0x3, (%rax)
jne 0x4fb8
movq 0x60(%rsp), %rax
movslq 0x48(%rsp), %rcx
imulq $0x1e0, %rcx, %rcx      # imm = 0x1E0
addq %rcx, %rax
movslq 0x3c(%rsp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl $0x2, 0x14(%rax)
jmp 0x4fd5
movq 0xb029(%rip), %rdi      # 0xffe8
leaq 0x720b(%rip), %rsi      # 0xc1d1
callq 0x2140
movl $0x1, %edi
callq 0x21c0
jmp 0x4fd7
jmp 0x4fd9
jmp 0x4fdb
movl 0x3c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x3c(%rsp)
movq 0x40(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x40(%rsp)
jmp 0x486a
jmp 0x4ffb
movl 0x48(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x48(%rsp)
movq 0x78(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x78(%rsp)
jmp 0x482e
movq 0x58(%rsp), %rdi
callq 0x2150
movq 0x50(%rsp), %rdi
leaq 0x71d1(%rip), %rsi      # 0xc200
xorl %eax, %eax
callq 0x2210
movq 0x50(%rsp), %rdi
callq 0x2150
leaq 0x70a9(%rip), %rdi      # 0xc0f0
leaq 0x7a74(%rip), %rsi      # 0xcac2
callq 0x21a0
movq %rax, 0x58(%rsp)
leaq 0x709f(%rip), %rsi      # 0xc0fe
leaq 0x719f(%rip), %rdx      # 0xc205
leaq 0x18(%rsp), %rdi
movq %rdi, (%rsp)
callq 0x5d50
movq (%rsp), %rsi
movq 0x68(%rsp), %rdi
movq 0x58(%rsp), %rdx
callq 0x26d0
jmp 0x5089
movq 0x58(%rsp), %rdi
callq 0x2150
jmp 0x5095
leaq 0x7054(%rip), %rdi      # 0xc0f0
callq 0x22c0
leaq 0x7056(%rip), %rdi      # 0xc0fe
callq 0x22c0
leaq 0x18(%rsp), %rdi
callq 0x6160
addq $0x88, %rsp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x10(%rsp)
movl %eax, 0xc(%rsp)
leaq 0x18(%rsp), %rdi
callq 0x6160
movq 0x10(%rsp), %rdi
callq 0x22b0
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)