// File: /workspace/github_cpp_makefile_star2_O2/iZhangHui[P]CppPrimer/CH17_SpecializedLibraryFacilities/examples/setw.cc
// Function: main
int main()
{
	int i = -16;
	double d = 3.14159;
	
	// pad the first column to use a minimum of 12 positions in the output
	cout << "i: " << setw(12) << i << "next col" << '\n'
	     << "d: " << setw(12) << d << "next col" << '\n';
	
	// pad the first column and left-justify all columns
	cout << left 
	     << "i: " << setw(12) << i << "next col" << '\n'
	     << "d: " << setw(12) << d << "next col" << '\n'
	     << right;           // restore normal justification
	
	// pad the first column and right-justify all columns
	cout << right
	     << "i: " << setw(12) << i << "next col" << '\n'
	     << "d: " << setw(12) << d << "next col" << '\n';
	
	// pad the first column but put the padding internal to the field
	cout << internal
	     << "i: " << setw(12) << i << "next col" << '\n'
	     << "d: " << setw(12) << d << "next col" << '\n';
	
	// pad the first column, using # as the pad character
	cout << setfill('#')
	     << "i: " << setw(12) << i << "next col" << '\n'
	     << "d: " << setw(12) << d << "next col" << '\n'
	     << setfill(' ');   // restore the normal pad character

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq 0x2de7(%rip), %r15      # 0x3fd8
leaq 0xe18(%rip), %rsi       # 0x2010
movq %r15, %rdi
callq 0x1040
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
pushq $0xc
popq %r12
movq %r12, 0x10(%rax,%rcx)
pushq $-0x10
popq %rsi
movq %rax, %rdi
callq 0x1090
leaq 0xdf2(%rip), %r14       # 0x2014
movq %rax, %rdi
movq %r14, %rsi
callq 0x1040
pushq $0xa
popq %rbx
movq %rax, %rdi
movl %ebx, %esi
callq 0x1050
leaq 0xddc(%rip), %rsi       # 0x201d
movq %rax, %rdi
callq 0x1040
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq %r12, 0x10(%rax,%rcx)
movsd 0xdab(%rip), %xmm0      # 0x2008
movq %rax, %rdi
callq 0x1080
movq %rax, %rdi
movq %r14, %rsi
callq 0x1040
movq %rax, %rdi
movl %ebx, %esi
callq 0x1050
movq (%r15), %rax
movq -0x18(%rax), %rax
movl $0xffffff4f, %r13d      # imm = 0xFFFFFF4F
movl 0x18(%r15,%rax), %ecx
andl %r13d, %ecx
orl $0x20, %ecx
movl %ecx, 0x18(%r15,%rax)
movq %r15, %rdi
leaq 0xd6f(%rip), %rsi       # 0x2010
callq 0x1040
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq %r12, 0x10(%rax,%rcx)
movq %rax, %rdi
pushq $-0x10
popq %rsi
callq 0x1090
movq %rax, %rdi
movq %r14, %rsi
callq 0x1040
movq %rax, %rdi
movl %ebx, %esi
callq 0x1050
movq %rax, %rdi
leaq 0xd41(%rip), %rsi       # 0x201d
callq 0x1040
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq %r12, 0x10(%rax,%rcx)
movq %rax, %rdi
movsd 0xd10(%rip), %xmm0      # 0x2008
callq 0x1080
movq %rax, %rdi
movq %r14, %rsi
callq 0x1040
movq %rax, %rdi
movl %ebx, %esi
callq 0x1050
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movl 0x18(%rax,%rcx), %edx
andl %r13d, %edx
movl $0x80, %esi
orl %esi, %edx
movl %edx, 0x18(%rax,%rcx)
movq (%r15), %rax
movq -0x18(%rax), %rax
movl 0x18(%r15,%rax), %ecx
andl %r13d, %ecx
orl %esi, %ecx
movl %ecx, 0x18(%r15,%rax)
movq %r15, %rdi
leaq 0xcc5(%rip), %rsi       # 0x2010
callq 0x1040
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq %r12, 0x10(%rax,%rcx)
movq %rax, %rdi
pushq $-0x10
popq %rsi
callq 0x1090
movq %rax, %rdi
movq %r14, %rsi
callq 0x1040
movq %rax, %rdi
movl %ebx, %esi
callq 0x1050
movq %rax, %rdi
leaq 0xc97(%rip), %rsi       # 0x201d
callq 0x1040
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq %r12, 0x10(%rax,%rcx)
movq %rax, %rdi
movsd 0xc66(%rip), %xmm0      # 0x2008
callq 0x1080
movq %rax, %rdi
movq %r14, %rsi
callq 0x1040
movq %rax, %rdi
movl %ebx, %esi
movl %ebx, %r14d
callq 0x1050
movq (%r15), %rax
movq -0x18(%rax), %rax
andl 0x18(%r15,%rax), %r13d
orl $0x10, %r13d
movl %r13d, 0x18(%r15,%rax)
movq %r15, %rdi
leaq 0xc32(%rip), %r13       # 0x2010
movq %r13, %rsi
callq 0x1040
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq %r12, 0x10(%rax,%rcx)
movq %rax, %rdi
pushq $-0x10
popq %rsi
callq 0x1090
movq %rax, %rdi
leaq 0xc0d(%rip), %rbx       # 0x2014
movq %rbx, %rsi
callq 0x1040
movq %rax, %rdi
movl %r14d, %esi
callq 0x1050
movq %rax, %rdi
leaq 0xbf9(%rip), %rsi       # 0x201d
callq 0x1040
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq %r12, 0x10(%rax,%rcx)
movq %rax, %rdi
movsd 0xbc8(%rip), %xmm0      # 0x2008
callq 0x1080
movq %rax, %rdi
movq %rbx, %rsi
callq 0x1040
movq %rax, %rdi
movl %r14d, %esi
callq 0x1050
pushq $0x23
popq %rsi
movq %r15, %rdi
callq 0x1070
movq %rax, %rdi
movq %r13, %rsi
callq 0x1040
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq %r12, 0x10(%rax,%rcx)
movq %rax, %rdi
pushq $-0x10
popq %rsi
callq 0x1090
movq %rax, %rdi
movq %rbx, %rsi
callq 0x1040
movq %rax, %rdi
movl %r14d, %esi
callq 0x1050
movq %rax, %rdi
leaq 0xb75(%rip), %rsi       # 0x201d
callq 0x1040
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq %r12, 0x10(%rax,%rcx)
movq %rax, %rdi
movsd 0xb44(%rip), %xmm0      # 0x2008
callq 0x1080
movq %rax, %rdi
movq %rbx, %rsi
callq 0x1040
movq %rax, %rdi
movl %r14d, %esi
callq 0x1050
pushq $0x20
popq %rsi
movq %rax, %rdi
callq 0x1070
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq