// File: errantlinguist[P]Forecast/src/console_weather/ForecastServiceClient.cpp
// Function: console_weather::ForecastServiceClient::get(char const*)
std::unique_ptr<forecast_io::Forecast> ForecastServiceClient::get(const char* url)
{
    // Create parsers
    std::unique_ptr<forecast_io::factories::ForecastFactory> pForecastFactory(
        new forecast_io::factories::ForecastFactory(measurementUnits));
    std::unique_ptr<forecast_io::factories::FlagsFactory> pFlagsFactory(
        new forecast_io::factories::FlagsFactory(measurementUnits));
    std::unique_ptr<forecast_io::parsers::ParserManager> pParserManager(
        new forecast_io::parsers::ParserManager(pForecastFactory.get(), pFlagsFactory.get()));

    forecast_io::parsers::NotifyingForecastParser& forecastParser =
        pParserManager->getForecastParser();
    json::TokenerParser tokenerParser(forecastParser);
    const CURLcode responseCode =
        curlClient.read(
            url,
            parseJson, &tokenerParser);

    std::unique_ptr<forecast_io::Forecast> result = nullptr;
    if (CURLE_OK == responseCode)
    {
        result = pForecastFactory->create();
    }
    else
    {
		throw responseCode;
    }
    return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movq %rdi, -0x98(%rbp)
movq %rdi, %rax
movq %rax, -0x90(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x88(%rbp)
movl $0x78, %edi
callq 0xa140
movq %rax, %rdi
movq -0x88(%rbp), %rax
movq %rdi, -0x80(%rbp)
movq 0x8(%rax), %rsi
callq 0x45aa0
movq -0x80(%rbp), %rsi
leaq -0x20(%rbp), %rdi
callq 0x38590
movl $0xa0, %edi
callq 0xa140
movq %rax, -0x78(%rbp)
jmp 0x38281
movq -0x78(%rbp), %rdi
movq -0x88(%rbp), %rax
movq 0x8(%rax), %rsi
callq 0x455d0
movq -0x78(%rbp), %rsi
leaq -0x28(%rbp), %rdi
callq 0x385c0
movl $0x348, %edi            # imm = 0x348
callq 0xa140
movq %rax, -0xa0(%rbp)
jmp 0x382b5
leaq -0x20(%rbp), %rdi
callq 0x385f0
movq %rax, -0xb8(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x38620
movq -0xb8(%rbp), %rsi
movq -0xa0(%rbp), %rdi
movq %rax, %rdx
callq 0x63d40
movq -0xa0(%rbp), %rsi
leaq -0x40(%rbp), %rdi
movq %rdi, -0xb0(%rbp)
callq 0x38650
movq -0xb0(%rbp), %rdi
callq 0x38680
movq %rax, %rdi
movq (%rdi), %rax
movq 0x48(%rax), %rax
callq *%rax
movq %rax, -0xa8(%rbp)
jmp 0x3831c
movq -0xa8(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rsi
leaq -0x60(%rbp), %rdi
callq 0x646c0
jmp 0x38336
movq -0x88(%rbp), %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rsi
leaq 0x175(%rip), %rdx       # 0x384c0
leaq -0x60(%rbp), %rcx
movl $0x1e, %r8d
callq 0x3bec0
movl %eax, -0xbc(%rbp)
jmp 0x38362
movq -0x98(%rbp), %rdi
movl -0xbc(%rbp), %eax
movl %eax, -0x64(%rbp)
movb $0x0, -0x65(%rbp)
xorl %eax, %eax
movl %eax, %esi
callq 0x386a0
xorl %eax, %eax
cmpl -0x64(%rbp), %eax
jne 0x38421
leaq -0x20(%rbp), %rdi
callq 0x386e0
movq %rax, %rsi
movq (%rsi), %rax
movq 0x10(%rax), %rax
leaq -0x70(%rbp), %rdi
callq *%rax
jmp 0x383a5
movq -0x98(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x38700
leaq -0x70(%rbp), %rdi
callq 0xded0
jmp 0x38445
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x384aa
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x384a1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x38498
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x3848f
movq -0x98(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
callq 0xded0
jmp 0x3848f
movl $0x4, %edi
callq 0xa2d0
movq %rax, %rdi
movl -0x64(%rbp), %eax
movl %eax, (%rdi)
leaq 0x62b6e(%rip), %rsi     # 0x9afa8
xorl %eax, %eax
movl %eax, %edx
callq 0xa500
jmp 0x384bc
movb $0x1, -0x65(%rbp)
testb $0x1, -0x65(%rbp)
jne 0x3845b
movq -0x98(%rbp), %rdi
callq 0xded0
leaq -0x60(%rbp), %rdi
callq 0x64710
leaq -0x40(%rbp), %rdi
callq 0x38730
leaq -0x28(%rbp), %rdi
callq 0x38790
leaq -0x20(%rbp), %rdi
callq 0x387f0
movq -0x90(%rbp), %rax
addq $0xc0, %rsp
popq %rbp
retq
leaq -0x60(%rbp), %rdi
callq 0x64710
leaq -0x40(%rbp), %rdi
callq 0x38730
leaq -0x28(%rbp), %rdi
callq 0x38790
leaq -0x20(%rbp), %rdi
callq 0x387f0
movq -0x30(%rbp), %rdi
callq 0xa520
nopl (%rax)