// File: iZhangHui[P]CppPrimer/CH17_SpecializedLibraryFacilities/examples/bits.cc
// Function: main
int main() 
{
	bitset<32> bitvec(1U); // 32 bits; low-order bit is 1, 
	                       // remaining bits are 0
	bool is_set = bitvec.any();      // true, one bit is set
	bool is_not_set = bitvec.none(); // false, one bit is set
	bool all_set = bitvec.all();     // false, only one bit is set
	size_t onBits = bitvec.count();  // returns 1
	size_t sz = bitvec.size();       // returns 32
	
	bitvec.flip();     // reverses the value of all the bits in bitvec
	bitvec.reset();    // sets all the bits to 0
	bitvec.set();      // sets all the bits to 1
	
	cout << "bitvec: " << bitvec << endl;
	
	sz = bitvec.size();  // returns 32
	
	onBits = bitvec.count();  // returns 1, 
                              // i.e., the number of bits that are on
	
	// assign 1 to even numbered bits
	for (int index = 0; index != 32; index += 2)
		bitvec[index] = 1; 

	// equivalent loop using set operation
	for (int index = 0; index != 32; index += 2)
		bitvec.set(index); 
	
	// bitvec is unchanged
	auto b2 = ~bitvec;  // b2 is a copy of bitvec with every bit flipped

	// assign value of last bit in bitvec to the first bit in b2
	b2[0] = bitvec[bitvec.size() - 1]; 
	bitvec[0] = 0;          // turn off the bit at position 0
	bitvec[31] = bitvec[0]; // give last bit the same value as the first
	bitvec[0].flip();       // flip the value of the bit at position 0
	~bitvec[0];             // equivalent; flips the bit at position 0
	bool b = bitvec[0];     // convert the value of bitvec[0] to bool
	b2[0] = ~bitvec[0];     // first bit in b2 has the opposite value 
                            // of the first bit in bitvec
	
	unsigned i = 0;
	if (bitvec.test(i))
	     // bitvec[i] is on
	        ;
	
	//equivalent test using subscript
	if (bitvec[i])
	     // bitvec[i] is on
	        ;
	
	cout << "bitvec: positions turned on:\n\t";
	for (int index = 0; index != 32; ++index)
		if (bitvec[index])
	    	cout << index << " ";
	cout << endl;
	
	// equivalent; turn off first bit
	bitvec.flip(0);   // reverses the value of the first bit
	bitvec.set(bitvec.size() - 1);  // turns on the last bit
	bitvec.set(0, 0); // turns off the first bit
	bitvec.reset(i);  // turns off the ith bit 
	bitvec.test(0);   // returns false because the first bit is off
	bitvec[0] = 0;
	
	bitvec.flip(0);   // reverses value of first bit
	bitvec[0].flip(); // also reverses the first bit
	
	cout << "new inits" <<endl;
	// bits13 is smaller than the initializer; 
	// high-order bits from the initializer are discarded
	bitset<13> bits13(0xbeef);  // bits are 1111011101111 

	// bits20 is larger than the initializer; 
	// high-order bits in bits20 are set to zero
	bitset<20> bits20(0xbeef);  // bits are 00001011111011101111

	// on machines with 64-bit long long 0ULL is 64 bits of 0, 
	// so ~0ULL is 64 ones, so 0 ... 63 are one, and 64 ... 127 are zero
    // if long long has 32 bits, 0 ... 32 are one, 33 ... 127 are zero
	bitset<128> bits128(~0ULL); 
	cout << "bits13: " << bits13 << endl;
	cout << "bits20: " << bits20 << endl;
	cout << "bits128: " << bits128 << endl;
	cout << "bits20[0] " << bits20[0] << endl;
	cout << "bits20[19] " << bits20[19] << endl;
	
	// bitvec1 is smaller than the initializer
	bitset<32> bitvec1(0xffff);  // bits 0 ... 15 are set to 1; 
	                             // 16 ... 31 are 0
	
	// bitvec2 same size as initializer
	bitset<64> bitvec2(0xffff);  // bits 0 ... 15 are set to 1; 
	                             // 16 ... 63 are 0
	
	// assuming 64-bit long long, bits 0 to 63 initialized from 0xffff
	bitset<128> bitvec3(0xffff); // bits 32 through 127 are zero
	
	cout << "bitvec1: " << bitvec1 << endl;
	cout << "bitvec2: " << bitvec2 << endl;
	cout << "bitvec2[0] " << bitvec2[0] << endl;
	cout << "bitvec2[31] " << bitvec2[31] << endl;
	
	cout << "bitvec3: " << bitvec3 << endl;
	
	
	bitset<32> bitvec4("1100"); // bits 2 and 3 are 1, all others are 0
	
	cout << "strval: " << "1100" << endl;
	cout << "bitvec4: " << bitvec4 << endl;
	
	string str("1111111000000011001101");
	bitset<32> bitvec5(str, 5, 4); // four bits starting at str[5], 1100
	bitset<32> bitvec6(str, str.size()-4); // use last four characters 
	
	cout << "str: " << str << endl;
	cout << "bitvec5: " << bitvec5 << endl;
	
	cout << "str: " << str << endl;
	cout << "bitvec6: " << bitvec6 << endl;
	
	unsigned long ulong = bitvec3.to_ulong();
	cout << "ulong = " << ulong << endl;
	
	bitset<32> bitvec7 = bitvec1 & bitvec4;
	
	cout << "bitvec7: " << bitvec7 << endl;
	
	bitset<32> bitvec8 = bitvec1 | bitvec4;
	
	cout << "bitvec8: " << bitvec8 << endl;
	
	bitset<16> chk("111100110011001100000");
	cout << "chk: " << chk << endl;
	
	bitset<16> bits;
	cin >> bits;  // read up to 16 1 or 0 characters from cin
	cout << "bits: " << bits << endl; // print what we just read

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x480, %rsp            # imm = 0x480
movl $0x0, -0x4(%rbp)
leaq -0x10(%rbp), %rdi
movl $0x1, %esi
callq 0x3380
leaq -0x10(%rbp), %rdi
callq 0x33d0
andb $0x1, %al
movb %al, -0x11(%rbp)
leaq -0x10(%rbp), %rdi
callq 0x33f0
andb $0x1, %al
movb %al, -0x12(%rbp)
leaq -0x10(%rbp), %rdi
callq 0x3410
andb $0x1, %al
movb %al, -0x13(%rbp)
leaq -0x10(%rbp), %rdi
callq 0x3430
movq %rax, -0x20(%rbp)
leaq -0x10(%rbp), %rdi
callq 0x3450
movq %rax, -0x28(%rbp)
leaq -0x10(%rbp), %rdi
callq 0x3460
leaq -0x10(%rbp), %rdi
callq 0x3490
leaq -0x10(%rbp), %rdi
callq 0x34c0
movq 0x6b3a(%rip), %rdi      # 0x8fd0
leaq 0x3b67(%rip), %rsi      # 0x6004
callq 0x2170
movq %rax, %rdi
leaq -0x10(%rbp), %rsi
callq 0x34f0
movq %rax, %rdi
movq 0x6b08(%rip), %rsi      # 0x8fc0
callq 0x2180
leaq -0x10(%rbp), %rdi
callq 0x3450
movq %rax, -0x28(%rbp)
leaq -0x10(%rbp), %rdi
callq 0x3430
movq %rax, -0x20(%rbp)
movl $0x0, -0x2c(%rbp)
cmpl $0x20, -0x2c(%rbp)
je 0x2517
movslq -0x2c(%rbp), %rdx
leaq -0x40(%rbp), %rdi
leaq -0x10(%rbp), %rsi
callq 0x35f0
leaq -0x40(%rbp), %rdi
movl $0x1, %esi
callq 0x3630
leaq -0x40(%rbp), %rdi
callq 0x36a0
movl -0x2c(%rbp), %eax
addl $0x2, %eax
movl %eax, -0x2c(%rbp)
jmp 0x24de
movl $0x0, -0x44(%rbp)
cmpl $0x20, -0x44(%rbp)
je 0x2541
movslq -0x44(%rbp), %rsi
leaq -0x10(%rbp), %rdi
movl $0x1, %edx
callq 0x36b0
movl -0x44(%rbp), %eax
addl $0x2, %eax
movl %eax, -0x44(%rbp)
jmp 0x251e
leaq -0x10(%rbp), %rdi
movq %rdi, -0x248(%rbp)
callq 0x3700
movq -0x248(%rbp), %rdi
movq %rax, -0x50(%rbp)
callq 0x3450
movq -0x248(%rbp), %rsi
movq %rax, %rdx
decq %rdx
leaq -0x60(%rbp), %rdi
callq 0x35f0
xorl %eax, %eax
movl %eax, %edx
leaq -0x70(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x35f0
jmp 0x258a
leaq -0x70(%rbp), %rdi
movq %rdi, -0x278(%rbp)
leaq -0x60(%rbp), %rsi
movq %rsi, -0x270(%rbp)
callq 0x3740
movq -0x278(%rbp), %rdi
callq 0x36a0
movq -0x270(%rbp), %rdi
callq 0x36a0
xorl %eax, %eax
movl %eax, -0x264(%rbp)
movl %eax, %edx
movq %rdx, -0x258(%rbp)
leaq -0x90(%rbp), %rdi
movq %rdi, -0x260(%rbp)
leaq -0x10(%rbp), %rsi
movq %rsi, -0x250(%rbp)
callq 0x35f0
movl -0x264(%rbp), %esi
movq -0x260(%rbp), %rdi
callq 0x3630
movq -0x260(%rbp), %rdi
callq 0x36a0
movq -0x258(%rbp), %rdx
movq -0x250(%rbp), %rsi
leaq -0xa0(%rbp), %rdi
callq 0x35f0
movq -0x250(%rbp), %rsi
leaq -0xb0(%rbp), %rdi
movl $0x1f, %edx
callq 0x35f0
jmp 0x263e
leaq -0xb0(%rbp), %rdi
movq %rdi, -0x2c8(%rbp)
leaq -0xa0(%rbp), %rsi
movq %rsi, -0x2c0(%rbp)
callq 0x3740
movq -0x2c8(%rbp), %rdi
callq 0x36a0
movq -0x2c0(%rbp), %rdi
callq 0x36a0
xorl %eax, %eax
movl %eax, %edx
movq %rdx, -0x288(%rbp)
leaq -0xc0(%rbp), %rdi
movq %rdi, -0x2b8(%rbp)
leaq -0x10(%rbp), %rsi
movq %rsi, -0x298(%rbp)
callq 0x35f0
movq -0x2b8(%rbp), %rdi
callq 0x37d0
movq -0x2b8(%rbp), %rdi
callq 0x36a0
movq -0x298(%rbp), %rsi
movq -0x288(%rbp), %rdx
leaq -0xd0(%rbp), %rdi
movq %rdi, -0x2b0(%rbp)
callq 0x35f0
movq -0x2b0(%rbp), %rdi
callq 0x3810
movq -0x2b0(%rbp), %rdi
callq 0x36a0
movq -0x298(%rbp), %rsi
movq -0x288(%rbp), %rdx
leaq -0xe8(%rbp), %rdi
movq %rdi, -0x2a8(%rbp)
callq 0x35f0
movq -0x2a8(%rbp), %rdi
callq 0x3850
movq -0x2a8(%rbp), %rdi
movb %al, -0x299(%rbp)
callq 0x36a0
movb -0x299(%rbp), %al
movq -0x298(%rbp), %rsi
movq -0x288(%rbp), %rdx
movb %al, -0xd1(%rbp)
leaq -0xf8(%rbp), %rdi
movq %rdi, -0x290(%rbp)
callq 0x35f0
movq -0x290(%rbp), %rdi
callq 0x3810
movq -0x288(%rbp), %rdx
movb %al, -0x279(%rbp)
leaq -0x108(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x35f0
jmp 0x2788
movb -0x279(%rbp), %al
movzbl %al, %esi
andl $0x1, %esi
leaq -0x108(%rbp), %rdi
callq 0x3630
leaq -0x108(%rbp), %rdi
callq 0x36a0
leaq -0xf8(%rbp), %rdi
callq 0x36a0
movl $0x0, -0x10c(%rbp)
movl -0x10c(%rbp), %eax
movl %eax, %esi
leaq -0x10(%rbp), %rdi
callq 0x3890
testb $0x1, %al
jne 0x27d9
jmp 0x282f
jmp 0x282f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x36a0
jmp 0x336f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0x36a0
jmp 0x336f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0xf8(%rbp), %rdi
callq 0x36a0
jmp 0x336f
movl -0x10c(%rbp), %eax
movl %eax, %edx
leaq -0x120(%rbp), %rdi
leaq -0x10(%rbp), %rsi
callq 0x35f0
leaq -0x120(%rbp), %rdi
callq 0x3850
movb %al, -0x2c9(%rbp)
leaq -0x120(%rbp), %rdi
callq 0x36a0
movb -0x2c9(%rbp), %al
testb $0x1, %al
jne 0x2871
jmp 0x2873
jmp 0x2873
movq 0x6756(%rip), %rdi      # 0x8fd0
leaq 0x378c(%rip), %rsi      # 0x600d
callq 0x2170
movl $0x0, -0x124(%rbp)
cmpl $0x20, -0x124(%rbp)
je 0x290e
movslq -0x124(%rbp), %rdx
leaq -0x138(%rbp), %rdi
leaq -0x10(%rbp), %rsi
callq 0x35f0
leaq -0x138(%rbp), %rdi
callq 0x3850
movb %al, -0x2ca(%rbp)
leaq -0x138(%rbp), %rdi
callq 0x36a0
movb -0x2ca(%rbp), %al
testb $0x1, %al
jne 0x28da
jmp 0x28fb
movl -0x124(%rbp), %esi
movq 0x66e9(%rip), %rdi      # 0x8fd0
callq 0x2270
movq %rax, %rdi
leaq 0x3750(%rip), %rsi      # 0x6046
callq 0x2170
jmp 0x28fd
movl -0x124(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x124(%rbp)
jmp 0x2890
movq 0x66bb(%rip), %rdi      # 0x8fd0
movq %rdi, -0x300(%rbp)
movq 0x669d(%rip), %rsi      # 0x8fc0
movq %rsi, -0x308(%rbp)
callq 0x2180
xorl %eax, %eax
movl %eax, -0x33c(%rbp)
movl %eax, %esi
movq %rsi, -0x2f0(%rbp)
leaq -0x10(%rbp), %rdi
movq %rdi, -0x330(%rbp)
callq 0x38d0
movq -0x330(%rbp), %rdi
callq 0x3450
movq -0x330(%rbp), %rdi
movq %rax, %rsi
decq %rsi
movl $0x1, %edx
callq 0x36b0
movl -0x33c(%rbp), %edx
movq -0x330(%rbp), %rdi
movq -0x2f0(%rbp), %rsi
callq 0x36b0
movq -0x330(%rbp), %rdi
movl -0x10c(%rbp), %eax
movl %eax, %esi
callq 0x3910
movq -0x330(%rbp), %rdi
movq -0x2f0(%rbp), %rsi
callq 0x3890
movq -0x330(%rbp), %rsi
movq -0x2f0(%rbp), %rdx
leaq -0x148(%rbp), %rdi
movq %rdi, -0x338(%rbp)
callq 0x35f0
movl -0x33c(%rbp), %esi
movq -0x338(%rbp), %rdi
callq 0x3630
movq -0x338(%rbp), %rdi
callq 0x36a0
movq -0x330(%rbp), %rdi
movq -0x2f0(%rbp), %rsi
callq 0x38d0
movq -0x330(%rbp), %rsi
movq -0x2f0(%rbp), %rdx
leaq -0x158(%rbp), %rdi
movq %rdi, -0x328(%rbp)
callq 0x35f0
movq -0x328(%rbp), %rdi
callq 0x37d0
movq -0x328(%rbp), %rdi
callq 0x36a0
movq -0x300(%rbp), %rdi
leaq 0x35e0(%rip), %rsi      # 0x602c
callq 0x2170
movq -0x308(%rbp), %rsi
movq %rax, %rdi
callq 0x2180
leaq -0x160(%rbp), %rdi
movq %rdi, -0x318(%rbp)
movl $0xbeef, %esi           # imm = 0xBEEF
movq %rsi, -0x320(%rbp)
callq 0x3950
movq -0x320(%rbp), %rsi
leaq -0x168(%rbp), %rdi
movq %rdi, -0x2f8(%rbp)
callq 0x39a0
leaq -0x178(%rbp), %rdi
movq %rdi, -0x310(%rbp)
movq $-0x1, %rsi
callq 0x39f0
movq -0x300(%rbp), %rdi
leaq 0x3575(%rip), %rsi      # 0x6036
callq 0x2170
movq -0x318(%rbp), %rsi
movq %rax, %rdi
callq 0x3a40
movq -0x308(%rbp), %rsi
movq %rax, %rdi
callq 0x2180
movq -0x300(%rbp), %rdi
leaq 0x354d(%rip), %rsi      # 0x603f
callq 0x2170
movq -0x2f8(%rbp), %rsi
movq %rax, %rdi
callq 0x3b40
movq -0x308(%rbp), %rsi
movq %rax, %rdi
callq 0x2180
movq -0x300(%rbp), %rdi
leaq 0x3525(%rip), %rsi      # 0x6048
callq 0x2170
movq -0x310(%rbp), %rsi
movq %rax, %rdi
callq 0x3c40
movq -0x308(%rbp), %rsi
movq %rax, %rdi
callq 0x2180
movq -0x300(%rbp), %rdi
leaq 0x34fe(%rip), %rsi      # 0x6052
callq 0x2170
movq -0x2f8(%rbp), %rsi
movq -0x2f0(%rbp), %rdx
movq %rax, -0x2e0(%rbp)
leaq -0x188(%rbp), %rdi
movq %rdi, -0x2e8(%rbp)
callq 0x3d40
movq -0x2e8(%rbp), %rdi
callq 0x3d80
movq -0x2e0(%rbp), %rdi
movzbl %al, %esi
callq 0x22b0
movq %rax, -0x2d8(%rbp)
jmp 0x2ba5
movq -0x2d8(%rbp), %rdi
movq 0x640d(%rip), %rsi      # 0x8fc0
callq 0x2180
jmp 0x2bba
leaq -0x188(%rbp), %rdi
callq 0x3dc0
movq 0x6403(%rip), %rdi      # 0x8fd0
leaq 0x3489(%rip), %rsi      # 0x605d
callq 0x2170
movq %rax, -0x350(%rbp)
leaq -0x198(%rbp), %rdi
movq %rdi, -0x358(%rbp)
leaq -0x168(%rbp), %rsi
movl $0x13, %edx
callq 0x3d40
movq -0x358(%rbp), %rdi
callq 0x3d80
movq -0x350(%rbp), %rdi
movzbl %al, %esi
callq 0x22b0
movq %rax, -0x348(%rbp)
jmp 0x2c23
movq -0x348(%rbp), %rdi
movq 0x638f(%rip), %rsi      # 0x8fc0
callq 0x2180
jmp 0x2c38
leaq -0x198(%rbp), %rdi
callq 0x3dc0
leaq -0x1a0(%rbp), %rdi
movq %rdi, -0x390(%rbp)
movl $0xffff, %esi           # imm = 0xFFFF
movq %rsi, -0x398(%rbp)
callq 0x3380
movq -0x398(%rbp), %rsi
leaq -0x1a8(%rbp), %rdi
movq %rdi, -0x378(%rbp)
callq 0x3dd0
movq -0x398(%rbp), %rsi
leaq -0x1b8(%rbp), %rdi
callq 0x39f0
movq 0x6339(%rip), %rdi      # 0x8fd0
movq %rdi, -0x380(%rbp)
leaq 0x33c4(%rip), %rsi      # 0x6069
callq 0x2170
movq -0x390(%rbp), %rsi
movq %rax, %rdi
callq 0x34f0
movq %rax, %rdi
movq 0x62fd(%rip), %rsi      # 0x8fc0
movq %rsi, -0x388(%rbp)
callq 0x2180
movq -0x380(%rbp), %rdi
leaq 0x3396(%rip), %rsi      # 0x6073
callq 0x2170
movq -0x378(%rbp), %rsi
movq %rax, %rdi
callq 0x3e20
movq -0x388(%rbp), %rsi
movq %rax, %rdi
callq 0x2180
movq -0x380(%rbp), %rdi
leaq 0x336f(%rip), %rsi      # 0x607d
callq 0x2170
movq -0x378(%rbp), %rsi
movq %rax, -0x368(%rbp)
xorl %eax, %eax
movl %eax, %edx
leaq -0x1c8(%rbp), %rdi
movq %rdi, -0x370(%rbp)
callq 0x3f20
movq -0x370(%rbp), %rdi
callq 0x3f60
movq -0x368(%rbp), %rdi
movzbl %al, %esi
callq 0x22b0
movq %rax, -0x360(%rbp)
jmp 0x2d5c
movq -0x360(%rbp), %rdi
movq 0x6256(%rip), %rsi      # 0x8fc0
callq 0x2180
jmp 0x2d71
leaq -0x1c8(%rbp), %rdi
callq 0x3fa0
movq 0x624c(%rip), %rdi      # 0x8fd0
leaq 0x32fe(%rip), %rsi      # 0x6089
callq 0x2170
movq %rax, -0x3a8(%rbp)
leaq -0x1d8(%rbp), %rdi
movq %rdi, -0x3b0(%rbp)
leaq -0x1a8(%rbp), %rsi
movl $0x1f, %edx
callq 0x3f20
movq -0x3b0(%rbp), %rdi
callq 0x3f60
movq -0x3a8(%rbp), %rdi
movzbl %al, %esi
callq 0x22b0
movq %rax, -0x3a0(%rbp)
jmp 0x2dda
movq -0x3a0(%rbp), %rdi
movq 0x61d8(%rip), %rsi      # 0x8fc0
callq 0x2180
jmp 0x2def
leaq -0x1d8(%rbp), %rdi
callq 0x3fa0
movq 0x61ce(%rip), %rdi      # 0x8fd0
movq %rdi, -0x3d0(%rbp)
leaq 0x3286(%rip), %rsi      # 0x6096
callq 0x2170
movq %rax, %rdi
leaq -0x1b8(%rbp), %rsi
callq 0x3c40
movq %rax, %rdi
movq 0x6192(%rip), %rsi      # 0x8fc0
movq %rsi, -0x3c0(%rbp)
callq 0x2180
leaq 0x325f(%rip), %rsi      # 0x60a0
movq %rsi, -0x3d8(%rbp)
leaq -0x1e0(%rbp), %rdi
movq %rdi, -0x3c8(%rbp)
movq $-0x1, %rdx
movl $0x30, %ecx
movl $0x31, %r8d
callq 0x3fb0
movq -0x3d0(%rbp), %rdi
leaq 0x322a(%rip), %rsi      # 0x60a5
callq 0x2170
movq -0x3d8(%rbp), %rsi
movq %rax, %rdi
callq 0x2170
movq -0x3c0(%rbp), %rsi
movq %rax, %rdi
callq 0x2180
movq -0x3d0(%rbp), %rdi
leaq 0x3202(%rip), %rsi      # 0x60ae
callq 0x2170
movq -0x3c8(%rbp), %rsi
movq %rax, %rdi
callq 0x34f0
movq -0x3c0(%rbp), %rsi
movq %rax, %rdi
callq 0x2180
leaq -0x201(%rbp), %rdi
movq %rdi, -0x3b8(%rbp)
callq 0x22a0
movq -0x3b8(%rbp), %rdx
leaq 0x31c8(%rip), %rsi      # 0x60b8
leaq -0x200(%rbp), %rdi
callq 0x21d0
jmp 0x2efe
leaq -0x201(%rbp), %rdi
callq 0x2190
leaq -0x210(%rbp), %rdi
leaq -0x200(%rbp), %rsi
movl $0x5, %edx
movl $0x4, %ecx
callq 0x4030
jmp 0x2f29
leaq -0x200(%rbp), %rdi
movq %rdi, -0x3e0(%rbp)
callq 0x2110
movq -0x3e0(%rbp), %rsi
movq %rax, %rdx
addq $-0x4, %rdx
leaq -0x218(%rbp), %rdi
callq 0x4090
jmp 0x2f58
movq 0x6071(%rip), %rdi      # 0x8fd0
leaq 0x3169(%rip), %rsi      # 0x60cf
callq 0x2170
movq %rax, -0x3e8(%rbp)
jmp 0x2f74
movq -0x3e8(%rbp), %rdi
leaq -0x200(%rbp), %rsi
callq 0x2150
movq %rax, -0x3f0(%rbp)
jmp 0x2f90
movq -0x3f0(%rbp), %rdi
movq 0x6022(%rip), %rsi      # 0x8fc0
callq 0x2180
jmp 0x2fa5
movq 0x6024(%rip), %rdi      # 0x8fd0
leaq 0x3122(%rip), %rsi      # 0x60d5
callq 0x2170
movq %rax, -0x3f8(%rbp)
jmp 0x2fc1
movq -0x3f8(%rbp), %rdi
leaq -0x210(%rbp), %rsi
callq 0x34f0
movq %rax, -0x400(%rbp)
jmp 0x2fdd
movq -0x400(%rbp), %rdi
movq 0x5fd5(%rip), %rsi      # 0x8fc0
callq 0x2180
jmp 0x2ff2
movq 0x5fd7(%rip), %rdi      # 0x8fd0
leaq 0x30cf(%rip), %rsi      # 0x60cf
callq 0x2170
movq %rax, -0x408(%rbp)
jmp 0x300e
movq -0x408(%rbp), %rdi
leaq -0x200(%rbp), %rsi
callq 0x2150
movq %rax, -0x410(%rbp)
jmp 0x302a
movq -0x410(%rbp), %rdi
movq 0x5f88(%rip), %rsi      # 0x8fc0
callq 0x2180
jmp 0x303f
movq 0x5f8a(%rip), %rdi      # 0x8fd0
leaq 0x3092(%rip), %rsi      # 0x60df
callq 0x2170
movq %rax, -0x418(%rbp)
jmp 0x305b
movq -0x418(%rbp), %rdi
leaq -0x218(%rbp), %rsi
callq 0x34f0
movq %rax, -0x420(%rbp)
jmp 0x3077
movq -0x420(%rbp), %rdi
movq 0x5f3b(%rip), %rsi      # 0x8fc0
callq 0x2180
jmp 0x308c
leaq -0x1b8(%rbp), %rdi
callq 0x40f0
movq %rax, -0x428(%rbp)
jmp 0x30a1
movq -0x428(%rbp), %rax
movq %rax, -0x220(%rbp)
movq 0x5f1a(%rip), %rdi      # 0x8fd0
leaq 0x302c(%rip), %rsi      # 0x60e9
callq 0x2170
movq %rax, -0x430(%rbp)
jmp 0x30cb
movq -0x430(%rbp), %rdi
movq -0x220(%rbp), %rsi
callq 0x2030
movq %rax, -0x438(%rbp)
jmp 0x30e7
movq -0x438(%rbp), %rdi
movq 0x5ecb(%rip), %rsi      # 0x8fc0
callq 0x2180
jmp 0x30fc
leaq -0x1a0(%rbp), %rdi
leaq -0x1e0(%rbp), %rsi
callq 0x4110
movq %rax, -0x228(%rbp)
movq 0x5eb3(%rip), %rdi      # 0x8fd0
leaq 0x2fce(%rip), %rsi      # 0x60f2
callq 0x2170
movq %rax, -0x440(%rbp)
jmp 0x3132
movq -0x440(%rbp), %rdi
leaq -0x228(%rbp), %rsi
callq 0x34f0
movq %rax, -0x448(%rbp)
jmp 0x314e
movq -0x448(%rbp), %rdi
movq 0x5e64(%rip), %rsi      # 0x8fc0
callq 0x2180
jmp 0x3163
leaq -0x1a0(%rbp), %rdi
leaq -0x1e0(%rbp), %rsi
callq 0x4150
movq %rax, -0x230(%rbp)
movq 0x5e4c(%rip), %rdi      # 0x8fd0
leaq 0x2f71(%rip), %rsi      # 0x60fc
callq 0x2170
movq %rax, -0x450(%rbp)
jmp 0x3199
movq -0x450(%rbp), %rdi
leaq -0x230(%rbp), %rsi
callq 0x34f0
movq %rax, -0x458(%rbp)
jmp 0x31b5
movq -0x458(%rbp), %rdi
movq 0x5dfd(%rip), %rsi      # 0x8fc0
callq 0x2180
jmp 0x31ca
leaq 0x2f35(%rip), %rsi      # 0x6106
leaq -0x238(%rbp), %rdi
movq $-0x1, %rdx
movl $0x30, %ecx
movl $0x31, %r8d
callq 0x4190
jmp 0x31f1
movq 0x5dd8(%rip), %rdi      # 0x8fd0
leaq 0x2f1d(%rip), %rsi      # 0x611c
callq 0x2170
movq %rax, -0x460(%rbp)
jmp 0x320d
movq -0x460(%rbp), %rdi
leaq -0x238(%rbp), %rsi
callq 0x4210
movq %rax, -0x468(%rbp)
jmp 0x3229
movq -0x468(%rbp), %rdi
movq 0x5d89(%rip), %rsi      # 0x8fc0
callq 0x2180
jmp 0x323e
leaq -0x240(%rbp), %rdi
movq %rdi, -0x470(%rbp)
callq 0x4310
movq -0x470(%rbp), %rsi
movq 0x5d81(%rip), %rdi      # 0x8fe0
callq 0x4330
jmp 0x3266
movq 0x5d63(%rip), %rdi      # 0x8fd0
leaq 0x2eae(%rip), %rsi      # 0x6122
callq 0x2170
movq %rax, -0x478(%rbp)
jmp 0x3282
movq -0x478(%rbp), %rdi
leaq -0x240(%rbp), %rsi
callq 0x4210
movq %rax, -0x480(%rbp)
jmp 0x329e
movq -0x480(%rbp), %rdi
movq 0x5d14(%rip), %rsi      # 0x8fc0
callq 0x2180
jmp 0x32b3
movl $0x0, -0x4(%rbp)
leaq -0x200(%rbp), %rdi
callq 0x20d0
movl -0x4(%rbp), %eax
addq $0x480, %rsp            # imm = 0x480
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0x188(%rbp), %rdi
callq 0x3dc0
jmp 0x336f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0x198(%rbp), %rdi
callq 0x3dc0
jmp 0x336f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0x1c8(%rbp), %rdi
callq 0x3fa0
jmp 0x336f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0x1d8(%rbp), %rdi
callq 0x3fa0
jmp 0x336f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0x201(%rbp), %rdi
callq 0x2190
jmp 0x336f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0x200(%rbp), %rdi
callq 0x20d0
movq -0x78(%rbp), %rdi
callq 0x2290
nopl (%rax,%rax)