// File: iZhangHui[P]CppPrimer/CH17_SpecializedLibraryFacilities/examples/manips.cc
// Function: main
int main()
{
	bool b;
	cout << "default bool values: " << true << " " << false
	     << "\nalpha bool values: " << boolalpha 
		 << true << " " << false << endl;
	
	bool bool_val = get_status();
	cout << boolalpha    // sets the internal state of cout
	     << bool_val
	     << noboolalpha; // resets the internal state to default formatting
	cout << endl;
	
	const int ival = 15, jval = 1024;  // const, so values never change
	
	cout << "default: " << 20 << " " << 1024 << endl;
	cout << "octal: " << oct << 20 << " " << 1024 << endl;
	cout << "hex: " << hex << 20 << " " << 1024 << endl;
	cout << "decimal: " << dec << 20 << " " << 1024 << endl;
	
	
	cout << showbase;    // show the base when printing integral values
	cout << "default: " << 20 << " " << 1024 << endl;
	cout << "in octal: " << oct  << 20 << " " << 1024 << endl;
	cout << "in hex: " << hex  << 20 << " " << 1024 << endl;
	cout << "in decimal: " << dec << 20 << " " << 1024 << endl;
	cout << noshowbase;  // reset the state of the stream
	
	cout << uppercase << showbase << hex
	     << "printed in hexadecimal: " << 20 << " " << 1024 
	     << nouppercase << noshowbase << dec << endl;

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl $0x0, -0x4(%rbp)
movq 0x2dd2(%rip), %rdi      # 0x3fd8
leaq 0xdf7(%rip), %rsi       # 0x2004
callq 0x1050
movq %rax, %rdi
movl $0x1, %esi
callq 0x1090
movq %rax, %rdi
leaq 0xe2f(%rip), %rsi       # 0x2058
callq 0x1050
movq %rax, %rdi
xorl %esi, %esi
callq 0x1090
movq %rax, %rdi
leaq 0xdd8(%rip), %rsi       # 0x201a
callq 0x1050
movq %rax, %rdi
leaq 0x41f(%rip), %rsi       # 0x1670
callq 0x1030
movq %rax, %rdi
movl $0x1, %esi
callq 0x1090
movq %rax, %rdi
leaq 0xdeb(%rip), %rsi       # 0x2058
callq 0x1050
movq %rax, %rdi
xorl %esi, %esi
callq 0x1090
movq %rax, %rdi
movq 0x2d42(%rip), %rsi      # 0x3fc8
callq 0x1060
callq 0x11e0
andb $0x1, %al
movb %al, -0x6(%rbp)
movq 0x2d3c(%rip), %rdi      # 0x3fd8
leaq 0x3cd(%rip), %rsi       # 0x1670
callq 0x1030
movq %rax, %rdi
movb -0x6(%rbp), %al
andb $0x1, %al
movzbl %al, %esi
callq 0x1090
movq %rax, %rdi
leaq 0x3de(%rip), %rsi       # 0x16a0
callq 0x1030
movq 0x2d0a(%rip), %rdi      # 0x3fd8
movq 0x2cf3(%rip), %rsi      # 0x3fc8
callq 0x1060
movl $0xf, -0xc(%rbp)
movl $0x400, -0x10(%rbp)     # imm = 0x400
movq 0x2ce9(%rip), %rdi      # 0x3fd8
leaq 0xd39(%rip), %rsi       # 0x202f
callq 0x1050
movq %rax, %rdi
movl $0x14, %esi
callq 0x1080
movq %rax, %rdi
leaq 0xd46(%rip), %rsi       # 0x2058
callq 0x1050
movq %rax, %rdi
movl $0x400, %esi            # imm = 0x400
callq 0x1080
movq %rax, %rdi
movq 0x2c9a(%rip), %rsi      # 0x3fc8
callq 0x1060
movq 0x2c9e(%rip), %rdi      # 0x3fd8
leaq 0xcfb(%rip), %rsi       # 0x203c
callq 0x1050
movq %rax, %rdi
leaq 0x380(%rip), %rsi       # 0x16d0
callq 0x1030
movq %rax, %rdi
movl $0x14, %esi
callq 0x1080
movq %rax, %rdi
leaq 0xcec(%rip), %rsi       # 0x2058
callq 0x1050
movq %rax, %rdi
movl $0x400, %esi            # imm = 0x400
callq 0x1080
movq %rax, %rdi
movq 0x2c40(%rip), %rsi      # 0x3fc8
callq 0x1060
movq 0x2c44(%rip), %rdi      # 0x3fd8
leaq 0xcac(%rip), %rsi       # 0x2047
callq 0x1050
movq %rax, %rdi
leaq 0x356(%rip), %rsi       # 0x1700
callq 0x1030
movq %rax, %rdi
movl $0x14, %esi
callq 0x1080
movq %rax, %rdi
leaq 0xc92(%rip), %rsi       # 0x2058
callq 0x1050
movq %rax, %rdi
movl $0x400, %esi            # imm = 0x400
callq 0x1080
movq %rax, %rdi
movq 0x2be6(%rip), %rsi      # 0x3fc8
callq 0x1060
movq 0x2bea(%rip), %rdi      # 0x3fd8
leaq 0xc5b(%rip), %rsi       # 0x2050
callq 0x1050
movq %rax, %rdi
leaq 0x32c(%rip), %rsi       # 0x1730
callq 0x1030
movq %rax, %rdi
movl $0x14, %esi
callq 0x1080
movq %rax, %rdi
leaq 0xc38(%rip), %rsi       # 0x2058
callq 0x1050
movq %rax, %rdi
movl $0x400, %esi            # imm = 0x400
callq 0x1080
movq %rax, %rdi
movq 0x2b8c(%rip), %rsi      # 0x3fc8
callq 0x1060
movq 0x2b90(%rip), %rdi      # 0x3fd8
leaq 0x311(%rip), %rsi       # 0x1760
callq 0x1030
movq 0x2b7d(%rip), %rdi      # 0x3fd8
leaq 0xbcd(%rip), %rsi       # 0x202f
callq 0x1050
movq %rax, %rdi
movl $0x14, %esi
callq 0x1080
movq %rax, %rdi
leaq 0xbda(%rip), %rsi       # 0x2058
callq 0x1050
movq %rax, %rdi
movl $0x400, %esi            # imm = 0x400
callq 0x1080
movq %rax, %rdi
movq 0x2b2e(%rip), %rsi      # 0x3fc8
callq 0x1060
movq 0x2b32(%rip), %rdi      # 0x3fd8
leaq 0xb8c(%rip), %rsi       # 0x2039
callq 0x1050
movq %rax, %rdi
leaq 0x214(%rip), %rsi       # 0x16d0
callq 0x1030
movq %rax, %rdi
movl $0x14, %esi
callq 0x1080
movq %rax, %rdi
leaq 0xb80(%rip), %rsi       # 0x2058
callq 0x1050
movq %rax, %rdi
movl $0x400, %esi            # imm = 0x400
callq 0x1080
movq %rax, %rdi
movq 0x2ad4(%rip), %rsi      # 0x3fc8
callq 0x1060
movq 0x2ad8(%rip), %rdi      # 0x3fd8
leaq 0xb3d(%rip), %rsi       # 0x2044
callq 0x1050
movq %rax, %rdi
leaq 0x1ea(%rip), %rsi       # 0x1700
callq 0x1030
movq %rax, %rdi
movl $0x14, %esi
callq 0x1080
movq %rax, %rdi
leaq 0xb26(%rip), %rsi       # 0x2058
callq 0x1050
movq %rax, %rdi
movl $0x400, %esi            # imm = 0x400
callq 0x1080
movq %rax, %rdi
movq 0x2a7a(%rip), %rsi      # 0x3fc8
callq 0x1060
movq 0x2a7e(%rip), %rdi      # 0x3fd8
leaq 0xaec(%rip), %rsi       # 0x204d
callq 0x1050
movq %rax, %rdi
leaq 0x1c0(%rip), %rsi       # 0x1730
callq 0x1030
movq %rax, %rdi
movl $0x14, %esi
callq 0x1080
movq %rax, %rdi
leaq 0xacc(%rip), %rsi       # 0x2058
callq 0x1050
movq %rax, %rdi
movl $0x400, %esi            # imm = 0x400
callq 0x1080
movq %rax, %rdi
movq 0x2a20(%rip), %rsi      # 0x3fc8
callq 0x1060
movq 0x2a24(%rip), %rdi      # 0x3fd8
leaq 0x1d5(%rip), %rsi       # 0x1790
callq 0x1030
movq 0x2a11(%rip), %rdi      # 0x3fd8
leaq 0x1f2(%rip), %rsi       # 0x17c0
callq 0x1030
movq %rax, %rdi
leaq 0x183(%rip), %rsi       # 0x1760
callq 0x1030
movq %rax, %rdi
leaq 0x114(%rip), %rsi       # 0x1700
callq 0x1030
movq %rax, %rdi
leaq 0xa5f(%rip), %rsi       # 0x205a
callq 0x1050
movq %rax, %rdi
movl $0x14, %esi
callq 0x1080
movq %rax, %rdi
leaq 0xa41(%rip), %rsi       # 0x2058
callq 0x1050
movq %rax, %rdi
movl $0x400, %esi            # imm = 0x400
callq 0x1080
movq %rax, %rdi
leaq 0x1bd(%rip), %rsi       # 0x17f0
callq 0x1030
movq %rax, %rdi
leaq 0x14e(%rip), %rsi       # 0x1790
callq 0x1030
movq %rax, %rdi
leaq 0xdf(%rip), %rsi        # 0x1730
callq 0x1030
movq %rax, %rdi
movq 0x2968(%rip), %rsi      # 0x3fc8
callq 0x1060
xorl %eax, %eax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)