// File: errantlinguist[P]Forecast/src/console_weather/writers/ForecastConsoleWriter.cpp
// Function: console_weather::writers::ForecastConsoleWriter::write(forecast_io::Forecast const&, std::ostream&)
void ForecastConsoleWriter::write(const forecast_io::Forecast& value, std::ostream& output)
{
	output << "Forecast for location at coordinates ";
	// FIXME: The coordinate values are always zero here
	const math::Coordinate location = value.getLocation();
	output << location << '\n';

	output << headerRowSeparator << '\n';

	// Timezone and offset
	const std::string timezone = value.getTimezone();
	output << "Timezone: \"" << timezone << "\" (Offset: ";
	const short offsetNumericValue = static_cast<const short>(value.getOffset());
	output << offsetNumericValue;
	output << " hrs.)\n";

	// Alerts
	const std::vector<forecast_io::Alert>& alerts = value.getAlerts();
	if (!alerts.empty())
	{
		output << alertsSectionHeader << '\n';
		write(alerts, output);
	}

	// Current forecast data
	output << currentWeatherSectionHeader << '\n';
	const forecast_io::SynchronicDataPoint& currentWeather = value.getCurrentWeather();
	synchronicDataPointWriter.write(currentWeather, output);
	output << '\n';

	// Flags
	output << flagsSectionHeader << '\n';
	flagsWriter.write(value.getFlags(), output);

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xf0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0x18(%rbp), %rdi
leaq 0x2cd72(%rip), %rsi     # 0x673bf
callq 0xa4a0
movq -0x10(%rbp), %rdi
callq 0x3a980
movq %rax, %rsi
leaq -0x30(%rbp), %rdi
movq %rdi, -0x88(%rbp)
callq 0x3a9a0
movq -0x88(%rbp), %rsi
movq -0x18(%rbp), %rdi
callq 0x64e50
movq %rax, -0x80(%rbp)
jmp 0x3a684
movq -0x80(%rbp), %rdi
movl $0xa, %esi
callq 0xa550
jmp 0x3a694
movq -0x90(%rbp), %rsi
movq -0x18(%rbp), %rdi
addq $0x120, %rsi            # imm = 0x120
callq 0xa240
movq %rax, -0x98(%rbp)
jmp 0x3a6b4
movq -0x98(%rbp), %rdi
movl $0xa, %esi
callq 0xa550
jmp 0x3a6c7
movq -0x10(%rbp), %rsi
leaq -0x60(%rbp), %rdi
callq 0x3a9e0
jmp 0x3a6d6
movq -0x18(%rbp), %rdi
leaq 0x2cd04(%rip), %rsi     # 0x673e5
callq 0xa4a0
movq %rax, -0xa0(%rbp)
jmp 0x3a6ef
movq -0xa0(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0xa240
movq %rax, -0xa8(%rbp)
jmp 0x3a708
movq -0xa8(%rbp), %rdi
leaq 0x2ccdb(%rip), %rsi     # 0x673f1
callq 0xa4a0
jmp 0x3a71d
movq -0x10(%rbp), %rdi
callq 0x3aa20
movb %al, -0xa9(%rbp)
jmp 0x3a72e
movb -0xa9(%rbp), %al
movsbl %al, %eax
movw %ax, -0x62(%rbp)
movq -0x18(%rbp), %rdi
movswl -0x62(%rbp), %esi
callq 0xa400
jmp 0x3a74a
movq -0x18(%rbp), %rdi
leaq 0x2cca8(%rip), %rsi     # 0x673fd
callq 0xa4a0
jmp 0x3a75c
movq -0x10(%rbp), %rdi
callq 0x3aa40
movq %rax, -0xb8(%rbp)
jmp 0x3a76e
movq -0xb8(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rdi
callq 0x3aa50
testb $0x1, %al
jne 0x3a7fc
movq -0x90(%rbp), %rsi
movq -0x18(%rbp), %rdi
addq $0xc0, %rsi
callq 0xa240
movq %rax, -0xc0(%rbp)
jmp 0x3a7a6
movq -0xc0(%rbp), %rdi
movl $0xa, %esi
callq 0xa550
jmp 0x3a7b9
movq -0x90(%rbp), %rdi
movq -0x70(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x3aa90
jmp 0x3a7cf
jmp 0x3a7fc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x3a901
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x60(%rbp), %rdi
callq 0xa978
jmp 0x3a901
movq -0x90(%rbp), %rsi
movq -0x18(%rbp), %rdi
addq $0xe0, %rsi
callq 0xa240
movq %rax, -0xc8(%rbp)
jmp 0x3a81c
movq -0xc8(%rbp), %rdi
movl $0xa, %esi
callq 0xa550
jmp 0x3a82f
movq -0x10(%rbp), %rdi
callq 0x3ab20
movq %rax, -0xd0(%rbp)
jmp 0x3a841
movq -0x90(%rbp), %rdi
movq -0xd0(%rbp), %rax
movq %rax, -0x78(%rbp)
addq $0x28, %rdi
movq -0x78(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x3ae60
jmp 0x3a866
movq -0x18(%rbp), %rdi
movl $0xa, %esi
callq 0xa550
jmp 0x3a876
movq -0x90(%rbp), %rsi
movq -0x18(%rbp), %rdi
addq $0x100, %rsi            # imm = 0x100
callq 0xa240
movq %rax, -0xd8(%rbp)
jmp 0x3a896
movq -0xd8(%rbp), %rdi
movl $0xa, %esi
callq 0xa550
jmp 0x3a8a9
movq -0x90(%rbp), %rax
addq $0x20, %rax
movq %rax, -0xe8(%rbp)
movq -0x10(%rbp), %rdi
callq 0x3ab40
movq %rax, -0xe0(%rbp)
jmp 0x3a8cd
movq -0xe0(%rbp), %rsi
movq -0xe8(%rbp), %rdi
movq -0x18(%rbp), %rdx
callq 0x39a40
jmp 0x3a8e6
leaq -0x60(%rbp), %rdi
callq 0xa978
leaq -0x30(%rbp), %rdi
callq 0xe3b0
addq $0xf0, %rsp
popq %rbp
retq
leaq -0x30(%rbp), %rdi
callq 0xe3b0
movq -0x38(%rbp), %rdi
callq 0xa520
nopw %cs:(%rax,%rax)
nopl (%rax)