// File: aadityanaik[P]LongNums/src/longnums.cpp
// Function: LongNumber::operator/(LongNumber)
LongNumber LongNumber::operator/(LongNumber X) {
	LongNumber quotient;
	if (X == 0) {
		//check if divisor is 0
		throw DivideByZeroException();
	} else if(digits.size() < X.digits.size()){
		return quotient;
	} else {		
		//following division algorithm uses Algorithm D from the Art of Computer Programming
		if(X.digits.size() > 1) {
			LongNumber dividend;
			LongNumber divisor;
			quotient.digits.pop_back();
			//Step 1- Normalize the divisor
			int normalFactor = (BASE) / (*(X.digits.end() - 1) + 1);
			dividend = absolute() * normalFactor;
			if(dividend.digits.size() == digits.size()) {
				dividend.digits.push_back(0);
			}
			divisor = X.absolute() * normalFactor;

			int n = X.digits.size();

			//step 2 and 7- loop
			for(int iter = (digits.size() - X.digits.size()); iter >= 0; iter--) {
				//step 3- approximating quotient
				long int q = (((long int)dividend.digits[iter + n] * BASE) + dividend.digits[iter + n - 1]) / divisor.digits[n-1];
				long int r = (((long int)dividend.digits[iter + n] * BASE) + dividend.digits[iter + n - 1]) % divisor.digits[n-1];
				
				int x = 0;
				bool flag;
				do {
					flag = false;
					if(q == BASE || 
					((long int)(q * divisor.digits[n-2]) > (r * BASE) + dividend.digits[iter + n - 2])) {
						q -= 1;
						r += divisor.digits[n-1];
						flag = true;
					}

					x++;
				} while(r < BASE && flag);

				//step 4- multiply and subtract
				LongNumber part_dividend;
				part_dividend.digits = std::vector<int>(dividend.digits.begin() + iter, dividend.digits.begin() + iter + n + 1);
				part_dividend = part_dividend - (divisor * q);

				if(part_dividend.negative) {
					//step 6- add back
					part_dividend = part_dividend.absolute() + divisor;
					part_dividend.digits.pop_back(); // ignoring carry generated
				}

				for(int i = iter; i < dividend.digits.size(); i++) {
					if(i - iter >= part_dividend.digits.size()) {
						dividend.digits[i] = 0;
					} else {
						dividend.digits[i] = part_dividend.digits[i - iter];
					}
				}
				
				quotient.digits.push_back(q);
			}
		} else {
			long int r = 0;
			for(int i = digits.size() - 1; i >= 0; i--) {
				quotient.digits.push_back((long int)(r * BASE + digits[i]) / X.digits[0]);
				
				r = (long int)(r * BASE + digits[i]) % X.digits[0];
				
			}
		}

		std::reverse(quotient.digits.begin(), quotient.digits.end());

		while(*(quotient.digits.end()-1) == 0 && quotient.digits.size() > 1) {
			quotient.digits.erase(quotient.digits.end()-1);
		}

		if(quotient != 0) {
			quotient.negative = negative ^ X.negative;
		}

		return quotient;
	}
}

// Assembly:
subq $0x3e8, %rsp            # imm = 0x3E8
movq %rdx, 0xe0(%rsp)
movq %rdi, 0xe8(%rsp)
movq %rdi, %rax
movq %rax, 0xf0(%rsp)
movq %rdi, 0x3e0(%rsp)
movq %rsi, 0x3d8(%rsp)
movq %rdx, 0x3d0(%rsp)
movq 0x3d8(%rsp), %rax
movq %rax, 0xf8(%rsp)
movb $0x0, 0x3cf(%rsp)
callq 0x2a10
movq $0x0, 0x3a0(%rsp)
leaq 0x3a8(%rsp), %rdi
leaq 0x3a0(%rsp), %rsi
callq 0x30a0
jmp 0x5e6a
movq 0xe0(%rsp), %rdi
leaq 0x3a8(%rsp), %rsi
callq 0x37e0
movb %al, 0xdf(%rsp)
jmp 0x5e88
leaq 0x3a8(%rsp), %rdi
callq 0x2a80
movb 0xdf(%rsp), %al
testb $0x1, %al
jne 0x5ea5
jmp 0x5f25
movl $0x8, %edi
callq 0x20a0
movq %rax, %rdi
movq %rdi, 0xd0(%rsp)
movq $0x0, (%rdi)
callq 0x8360
movq 0xd0(%rsp), %rdi
leaq 0x8e6b(%rip), %rsi      # 0xed40
leaq 0x24b4(%rip), %rdx      # 0x8390
callq 0x2220
jmp 0x6cdc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x398(%rsp)
movl %eax, 0x394(%rsp)
jmp 0x6cc2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x398(%rsp)
movl %eax, 0x394(%rsp)
leaq 0x3a8(%rsp), %rdi
callq 0x2a80
jmp 0x6cc2
movq 0xf8(%rsp), %rdi
callq 0x7fb0
movq 0xe0(%rsp), %rdi
movq %rax, 0xc8(%rsp)
callq 0x7fb0
movq %rax, %rcx
movq 0xc8(%rsp), %rax
cmpq %rcx, %rax
jae 0x5f6f
movb $0x1, 0x3cf(%rsp)
movl $0x1, 0x390(%rsp)
jmp 0x6c9b
movq 0xe0(%rsp), %rdi
callq 0x7fb0
cmpq $0x1, %rax
jbe 0x6983
leaq 0x370(%rsp), %rdi
callq 0x2a10
jmp 0x5f95
leaq 0x350(%rsp), %rdi
callq 0x2a10
jmp 0x5fa4
movq 0xe8(%rsp), %rdi
callq 0x81d0
movq 0xe0(%rsp), %rdi
movl 0x91b9(%rip), %eax      # 0xf178
movl %eax, 0xc4(%rsp)
callq 0x7c00
movq %rax, 0x338(%rsp)
leaq 0x338(%rsp), %rdi
movl $0x1, %esi
callq 0x7e60
movq %rax, 0x340(%rsp)
leaq 0x340(%rsp), %rdi
callq 0x7c30
movq 0xf8(%rsp), %rsi
movq %rax, %rcx
movl 0xc4(%rsp), %eax
movl (%rcx), %ecx
incl %ecx
cltd
idivl %ecx
movl %eax, 0x34c(%rsp)
leaq 0x2f8(%rsp), %rdi
callq 0x3240
jmp 0x6029
movslq 0x34c(%rsp), %rdx
leaq 0x318(%rsp), %rdi
leaq 0x2f8(%rsp), %rsi
callq 0x5bb0
jmp 0x6048
leaq 0x370(%rsp), %rdi
leaq 0x318(%rsp), %rsi
callq 0x81f0
jmp 0x605f
leaq 0x318(%rsp), %rdi
callq 0x2a80
leaq 0x2f8(%rsp), %rdi
callq 0x2a80
leaq 0x370(%rsp), %rdi
callq 0x7fb0
movq 0xf8(%rsp), %rdi
movq %rax, 0xb8(%rsp)
callq 0x7fb0
movq %rax, %rcx
movq 0xb8(%rsp), %rax
cmpq %rcx, %rax
jne 0x614e
movl $0x0, 0x2f4(%rsp)
leaq 0x370(%rsp), %rdi
leaq 0x2f4(%rsp), %rsi
callq 0x76f0
jmp 0x60d1
jmp 0x614e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x398(%rsp)
movl %eax, 0x394(%rsp)
jmp 0x6971
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x398(%rsp)
movl %eax, 0x394(%rsp)
jmp 0x6964
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x398(%rsp)
movl %eax, 0x394(%rsp)
jmp 0x613c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x398(%rsp)
movl %eax, 0x394(%rsp)
leaq 0x318(%rsp), %rdi
callq 0x2a80
leaq 0x2f8(%rsp), %rdi
callq 0x2a80
jmp 0x6964
movq 0xe0(%rsp), %rsi
leaq 0x2b0(%rsp), %rdi
callq 0x3240
jmp 0x6165
movslq 0x34c(%rsp), %rdx
leaq 0x2d0(%rsp), %rdi
leaq 0x2b0(%rsp), %rsi
callq 0x5bb0
jmp 0x6184
leaq 0x350(%rsp), %rdi
leaq 0x2d0(%rsp), %rsi
callq 0x81f0
jmp 0x619b
leaq 0x2d0(%rsp), %rdi
callq 0x2a80
leaq 0x2b0(%rsp), %rdi
callq 0x2a80
movq 0xe0(%rsp), %rdi
callq 0x7fb0
movq 0xf8(%rsp), %rdi
movl %eax, 0x2ac(%rsp)
callq 0x7fb0
movq 0xe0(%rsp), %rdi
movq %rax, 0xb0(%rsp)
callq 0x7fb0
movq %rax, %rcx
movq 0xb0(%rsp), %rax
subq %rcx, %rax
movl %eax, 0x2a8(%rsp)
cmpl $0x0, 0x2a8(%rsp)
jl 0x6945
leaq 0x370(%rsp), %rdi
movl 0x2a8(%rsp), %eax
addl 0x2ac(%rsp), %eax
movslq %eax, %rsi
callq 0x8120
movslq (%rax), %rax
movslq 0x8f42(%rip), %rcx      # 0xf178
imulq %rcx, %rax
movq %rax, 0x90(%rsp)
leaq 0x370(%rsp), %rdi
movl 0x2a8(%rsp), %eax
addl 0x2ac(%rsp), %eax
subl $0x1, %eax
movslq %eax, %rsi
callq 0x8120
movq %rax, %rcx
movq 0x90(%rsp), %rax
movslq (%rcx), %rcx
addq %rcx, %rax
movq %rax, 0x98(%rsp)
leaq 0x350(%rsp), %rdi
movl 0x2ac(%rsp), %eax
subl $0x1, %eax
movslq %eax, %rsi
callq 0x8120
movq %rax, %rcx
movq 0x98(%rsp), %rax
movslq (%rcx), %rcx
cqto
idivq %rcx
movq %rax, 0x2a0(%rsp)
leaq 0x370(%rsp), %rdi
movl 0x2a8(%rsp), %eax
addl 0x2ac(%rsp), %eax
movslq %eax, %rsi
callq 0x8120
movslq (%rax), %rax
movslq 0x8e9f(%rip), %rcx      # 0xf178
imulq %rcx, %rax
movq %rax, 0xa0(%rsp)
leaq 0x370(%rsp), %rdi
movl 0x2a8(%rsp), %eax
addl 0x2ac(%rsp), %eax
subl $0x1, %eax
movslq %eax, %rsi
callq 0x8120
movq %rax, %rcx
movq 0xa0(%rsp), %rax
movslq (%rcx), %rcx
addq %rcx, %rax
movq %rax, 0xa8(%rsp)
leaq 0x350(%rsp), %rdi
movl 0x2ac(%rsp), %eax
subl $0x1, %eax
movslq %eax, %rsi
callq 0x8120
movq %rax, %rcx
movq 0xa8(%rsp), %rax
movslq (%rcx), %rcx
cqto
idivq %rcx
movq %rdx, 0x298(%rsp)
movl $0x0, 0x294(%rsp)
movb $0x0, 0x293(%rsp)
movq 0x2a0(%rsp), %rax
movslq 0x8e02(%rip), %rcx      # 0xf178
cmpq %rcx, %rax
je 0x641b
movq 0x2a0(%rsp), %rax
movq %rax, 0x78(%rsp)
leaq 0x350(%rsp), %rdi
movl 0x2ac(%rsp), %eax
subl $0x2, %eax
movslq %eax, %rsi
callq 0x8120
movq %rax, %rcx
movq 0x78(%rsp), %rax
movslq (%rcx), %rcx
imulq %rcx, %rax
movq %rax, 0x88(%rsp)
movq 0x298(%rsp), %rax
movslq 0x8dac(%rip), %rcx      # 0xf178
imulq %rcx, %rax
movq %rax, 0x80(%rsp)
leaq 0x370(%rsp), %rdi
movl 0x2a8(%rsp), %eax
addl 0x2ac(%rsp), %eax
subl $0x2, %eax
movslq %eax, %rsi
callq 0x8120
movq 0x80(%rsp), %rcx
movq %rax, %rdx
movq 0x88(%rsp), %rax
movslq (%rdx), %rdx
addq %rdx, %rcx
cmpq %rcx, %rax
jle 0x64af
movq 0x2a0(%rsp), %rax
subq $0x1, %rax
movq %rax, 0x2a0(%rsp)
leaq 0x350(%rsp), %rdi
movl 0x2ac(%rsp), %eax
subl $0x1, %eax
movslq %eax, %rsi
callq 0x8120
movslq (%rax), %rax
addq 0x298(%rsp), %rax
movq %rax, 0x298(%rsp)
movb $0x1, 0x293(%rsp)
jmp 0x64af
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x398(%rsp)
movl %eax, 0x394(%rsp)
jmp 0x649d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x398(%rsp)
movl %eax, 0x394(%rsp)
leaq 0x2d0(%rsp), %rdi
callq 0x2a80
leaq 0x2b0(%rsp), %rdi
callq 0x2a80
jmp 0x6964
movl 0x294(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x294(%rsp)
movq 0x298(%rsp), %rcx
movslq 0x8ca9(%rip), %rdx      # 0xf178
xorl %eax, %eax
cmpq %rdx, %rcx
movb %al, 0x77(%rsp)
jge 0x64e5
movb 0x293(%rsp), %al
movb %al, 0x77(%rsp)
movb 0x77(%rsp), %al
testb $0x1, %al
jne 0x635f
leaq 0x270(%rsp), %rdi
callq 0x2a10
jmp 0x6500
leaq 0x370(%rsp), %rdi
movq %rdi, 0x60(%rsp)
callq 0x7b90
movq %rax, 0x248(%rsp)
movslq 0x2a8(%rsp), %rsi
leaq 0x248(%rsp), %rdi
callq 0x8230
movq 0x60(%rsp), %rdi
movq %rax, 0x250(%rsp)
callq 0x7b90
movq %rax, 0x228(%rsp)
movslq 0x2a8(%rsp), %rsi
leaq 0x228(%rsp), %rdi
callq 0x8230
movq %rax, 0x230(%rsp)
movslq 0x2ac(%rsp), %rsi
leaq 0x230(%rsp), %rdi
callq 0x8230
movq %rax, 0x238(%rsp)
leaq 0x238(%rsp), %rdi
movl $0x1, %esi
callq 0x8230
movq %rax, 0x240(%rsp)
leaq 0x227(%rsp), %rdi
movq %rdi, 0x68(%rsp)
callq 0x8270
movq 0x68(%rsp), %rcx
movq 0x250(%rsp), %rsi
movq 0x240(%rsp), %rdx
leaq 0x258(%rsp), %rdi
callq 0x8280
jmp 0x65d3
leaq 0x270(%rsp), %rdi
leaq 0x258(%rsp), %rsi
movq %rsi, 0x58(%rsp)
callq 0x8310
movq 0x58(%rsp), %rdi
callq 0x7720
leaq 0x227(%rsp), %rdi
callq 0x8350
movq 0x2a0(%rsp), %rdx
leaq 0x1e0(%rsp), %rdi
leaq 0x350(%rsp), %rsi
callq 0x5bb0
jmp 0x6623
leaq 0x200(%rsp), %rdi
leaq 0x270(%rsp), %rsi
leaq 0x1e0(%rsp), %rdx
callq 0x3e20
jmp 0x6642
leaq 0x270(%rsp), %rdi
leaq 0x200(%rsp), %rsi
callq 0x81f0
jmp 0x6659
leaq 0x200(%rsp), %rdi
callq 0x2a80
leaq 0x1e0(%rsp), %rdi
callq 0x2a80
testb $0x1, 0x288(%rsp)
je 0x6812
leaq 0x1a0(%rsp), %rdi
leaq 0x270(%rsp), %rsi
callq 0x3240
jmp 0x6698
leaq 0x180(%rsp), %rdi
leaq 0x350(%rsp), %rsi
callq 0x2a90
jmp 0x66af
leaq 0x1c0(%rsp), %rdi
leaq 0x1a0(%rsp), %rsi
leaq 0x180(%rsp), %rdx
callq 0x38c0
jmp 0x66ce
leaq 0x270(%rsp), %rdi
leaq 0x1c0(%rsp), %rsi
callq 0x81f0
jmp 0x66e5
leaq 0x1c0(%rsp), %rdi
callq 0x2a80
leaq 0x180(%rsp), %rdi
callq 0x2a80
leaq 0x1a0(%rsp), %rdi
callq 0x2a80
leaq 0x270(%rsp), %rdi
callq 0x81d0
jmp 0x6812
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x398(%rsp)
movl %eax, 0x394(%rsp)
leaq 0x227(%rsp), %rdi
callq 0x8350
jmp 0x6936
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x398(%rsp)
movl %eax, 0x394(%rsp)
jmp 0x6936
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x398(%rsp)
movl %eax, 0x394(%rsp)
jmp 0x6794
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x398(%rsp)
movl %eax, 0x394(%rsp)
leaq 0x200(%rsp), %rdi
callq 0x2a80
leaq 0x1e0(%rsp), %rdi
callq 0x2a80
jmp 0x6936
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x398(%rsp)
movl %eax, 0x394(%rsp)
jmp 0x6800
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x398(%rsp)
movl %eax, 0x394(%rsp)
jmp 0x67f3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x398(%rsp)
movl %eax, 0x394(%rsp)
leaq 0x1c0(%rsp), %rdi
callq 0x2a80
leaq 0x180(%rsp), %rdi
callq 0x2a80
leaq 0x1a0(%rsp), %rdi
callq 0x2a80
jmp 0x6936
movl 0x2a8(%rsp), %eax
movl %eax, 0x17c(%rsp)
movslq 0x17c(%rsp), %rax
movq %rax, 0x50(%rsp)
leaq 0x370(%rsp), %rdi
callq 0x7fb0
movq %rax, %rcx
movq 0x50(%rsp), %rax
cmpq %rcx, %rax
jae 0x68ee
movl 0x17c(%rsp), %eax
subl 0x2a8(%rsp), %eax
cltq
movq %rax, 0x48(%rsp)
leaq 0x270(%rsp), %rdi
callq 0x7fb0
movq %rax, %rcx
movq 0x48(%rsp), %rax
cmpq %rcx, %rax
jb 0x6897
leaq 0x370(%rsp), %rdi
movslq 0x17c(%rsp), %rsi
callq 0x8120
movl $0x0, (%rax)
jmp 0x68d6
leaq 0x270(%rsp), %rdi
movl 0x17c(%rsp), %eax
subl 0x2a8(%rsp), %eax
movslq %eax, %rsi
callq 0x8120
movl (%rax), %eax
movl %eax, 0x44(%rsp)
leaq 0x370(%rsp), %rdi
movslq 0x17c(%rsp), %rsi
callq 0x8120
movl 0x44(%rsp), %ecx
movl %ecx, (%rax)
jmp 0x68d8
movl 0x17c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x17c(%rsp)
jmp 0x6820
movq 0xe8(%rsp), %rdi
movl 0x2a0(%rsp), %eax
movl %eax, 0x178(%rsp)
leaq 0x178(%rsp), %rsi
callq 0x76f0
jmp 0x6913
leaq 0x270(%rsp), %rdi
callq 0x2a80
movl 0x2a8(%rsp), %eax
addl $-0x1, %eax
movl %eax, 0x2a8(%rsp)
jmp 0x6200
leaq 0x270(%rsp), %rdi
callq 0x2a80
jmp 0x6964
leaq 0x350(%rsp), %rdi
callq 0x2a80
leaq 0x370(%rsp), %rdi
callq 0x2a80
jmp 0x6ab5
leaq 0x350(%rsp), %rdi
callq 0x2a80
leaq 0x370(%rsp), %rdi
callq 0x2a80
jmp 0x6cc2
movq 0xf8(%rsp), %rdi
movq $0x0, 0x170(%rsp)
callq 0x7fb0
subq $0x1, %rax
movl %eax, 0x16c(%rsp)
cmpl $0x0, 0x16c(%rsp)
jl 0x6ab3
movq 0xf8(%rsp), %rdi
movq 0x170(%rsp), %rax
movslq 0x87ac(%rip), %rcx      # 0xf178
imulq %rcx, %rax
movq %rax, 0x30(%rsp)
movslq 0x16c(%rsp), %rsi
callq 0x8120
movq 0xe0(%rsp), %rdi
movq %rax, %rcx
movq 0x30(%rsp), %rax
movslq (%rcx), %rcx
addq %rcx, %rax
movq %rax, 0x38(%rsp)
xorl %eax, %eax
movl %eax, %esi
callq 0x8120
movq 0xe8(%rsp), %rdi
movq %rax, %rcx
movq 0x38(%rsp), %rax
movslq (%rcx), %rcx
cqto
idivq %rcx
movl %eax, 0x168(%rsp)
leaq 0x168(%rsp), %rsi
callq 0x76f0
jmp 0x6a34
movq 0xf8(%rsp), %rdi
movq 0x170(%rsp), %rax
movslq 0x872d(%rip), %rcx      # 0xf178
imulq %rcx, %rax
movq %rax, 0x20(%rsp)
movslq 0x16c(%rsp), %rsi
callq 0x8120
movq 0xe0(%rsp), %rdi
movq %rax, %rcx
movq 0x20(%rsp), %rax
movslq (%rcx), %rcx
addq %rcx, %rax
movq %rax, 0x28(%rsp)
xorl %eax, %eax
movl %eax, %esi
callq 0x8120
movq %rax, %rcx
movq 0x28(%rsp), %rax
movslq (%rcx), %rcx
cqto
idivq %rcx
movq %rdx, 0x170(%rsp)
movl 0x16c(%rsp), %eax
addl $-0x1, %eax
movl %eax, 0x16c(%rsp)
jmp 0x69a7
jmp 0x6ab5
movq 0xe8(%rsp), %rdi
callq 0x7b90
movq 0xe8(%rsp), %rdi
movq %rax, 0x160(%rsp)
callq 0x7c00
movq %rax, 0x158(%rsp)
movq 0x160(%rsp), %rdi
movq 0x158(%rsp), %rsi
callq 0x83a0
jmp 0x6af6
jmp 0x6af8
movq 0xe8(%rsp), %rdi
callq 0x7c00
movq %rax, 0x148(%rsp)
leaq 0x148(%rsp), %rdi
movl $0x1, %esi
callq 0x7e60
movq %rax, 0x150(%rsp)
leaq 0x150(%rsp), %rdi
callq 0x7c30
movq %rax, %rcx
xorl %eax, %eax
cmpl $0x0, (%rcx)
movb %al, 0x1f(%rsp)
jne 0x6b5a
movq 0xe8(%rsp), %rdi
callq 0x7fb0
cmpq $0x1, %rax
seta %al
movb %al, 0x1f(%rsp)
movb 0x1f(%rsp), %al
testb $0x1, %al
jne 0x6b64
jmp 0x6bd6
movq 0xe8(%rsp), %rdi
callq 0x7c00
movq %rax, 0x130(%rsp)
leaq 0x130(%rsp), %rdi
movl $0x1, %esi
callq 0x7e60
movq %rax, 0x138(%rsp)
leaq 0x140(%rsp), %rdi
leaq 0x138(%rsp), %rsi
callq 0x7d20
movq 0xe8(%rsp), %rdi
movq 0x140(%rsp), %rsi
callq 0x7eb0
movq %rax, 0x10(%rsp)
jmp 0x6bc4
movq 0x10(%rsp), %rax
movq %rax, 0x128(%rsp)
jmp 0x6af8
movq $0x0, 0x100(%rsp)
leaq 0x108(%rsp), %rdi
leaq 0x100(%rsp), %rsi
callq 0x30a0
jmp 0x6bf9
movq 0xe8(%rsp), %rdi
leaq 0x108(%rsp), %rsi
callq 0x3890
movb %al, 0xf(%rsp)
jmp 0x6c14
leaq 0x108(%rsp), %rdi
callq 0x2a80
movb 0xf(%rsp), %al
testb $0x1, %al
jne 0x6c2b
jmp 0x6c88
movq 0xe8(%rsp), %rax
movq 0xe0(%rsp), %rdx
movq 0xf8(%rsp), %rcx
movb 0x18(%rcx), %cl
andb $0x1, %cl
movzbl %cl, %ecx
movb 0x18(%rdx), %dl
andb $0x1, %dl
movzbl %dl, %edx
xorl %edx, %ecx
cmpl $0x0, %ecx
setne %cl
andb $0x1, %cl
movb %cl, 0x18(%rax)
jmp 0x6c88
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x398(%rsp)
movl %eax, 0x394(%rsp)
leaq 0x108(%rsp), %rdi
callq 0x2a80
jmp 0x6cc2
movb $0x1, 0x3cf(%rsp)
movl $0x1, 0x390(%rsp)
testb $0x1, 0x3cf(%rsp)
jne 0x6cb2
movq 0xe8(%rsp), %rdi
callq 0x2a80
movq 0xf0(%rsp), %rax
addq $0x3e8, %rsp            # imm = 0x3E8
retq
movq 0xe8(%rsp), %rdi
callq 0x2a80
movq 0x398(%rsp), %rdi
callq 0x2260
nopl (%rax)