// File: errantlinguist[P]Forecast/src/forecast_io/parsers/NotifyingFlagParser.cpp
// Function: forecast_io::parsers::NotifyingFlagParser::parseAttribute(forecast_io::parsers::FlagsAttribute const&, json_object* const&)
void NotifyingFlagParser::parseAttribute(const FlagsAttribute& attribute,
		json_object* const & pValue)
{
	switch (attribute)
	{
	case FlagsAttribute::DARKSKY_UNAVAILABLE:
	{
		const bool darkskyUnavailable = bool(json_object_get_boolean(pValue));
		for (listeners::FlagListener* const & pListener : getListeners())
		{
			pListener->notifyDarkskyUnavailable(darkskyUnavailable);
		}
		break;
	}
	case FlagsAttribute::METNO_LICENSE:
	{
		const bool metnoLicense = bool(json_object_get_boolean(pValue));
		for (listeners::FlagListener* const & pListener : getListeners())
		{
			pListener->notifyMetnoLicense(metnoLicense);
		}
		break;
	}
	case FlagsAttribute::SOURCES:
	{
		json::insertJsonStringArrayValues(sources, pValue);
		break;
	}
	case FlagsAttribute::UNITS:
	{
		const std::string unitsStr(json_object_get_string(pValue));
		const math::MeasurementSystem& measurementSystem =
				parseMeasurementSystem(unitsStr);
		for (listeners::FlagListener* const & pListener : getListeners())
		{
			pListener->notifyUnits(measurementSystem);
		}
		break;
	}
	default:
		throw std::logic_error(
				createUndefinedAttributeErrorMessage(FlagsAttribute_NAME,
						attribute));
		break;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x130, %rsp            # imm = 0x130
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x100(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %eax
movq %rax, -0xf8(%rbp)
subq $0x3, %rax
ja 0x57fa9
movq -0xf8(%rbp), %rax
leaq 0x106a5(%rip), %rcx     # 0x6839c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x18(%rbp), %rax
movq (%rax), %rdi
callq 0xa930
movq -0x100(%rbp), %rdi
cmpl $0x0, %eax
setne %al
andb $0x1, %al
movb %al, -0x19(%rbp)
addq $0x10, %rdi
callq 0x58470
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
callq 0x58490
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rdi
callq 0x584c0
movq %rax, -0x38(%rbp)
leaq -0x30(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x584f0
testb $0x1, %al
jne 0x57d58
jmp 0x57d86
leaq -0x30(%rbp), %rdi
callq 0x58520
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq (%rax), %rdi
movb -0x19(%rbp), %cl
movq (%rdi), %rax
andb $0x1, %cl
movzbl %cl, %esi
callq *0x10(%rax)
leaq -0x30(%rbp), %rdi
callq 0x58550
jmp 0x57d45
jmp 0x5805d
movq -0x18(%rbp), %rax
movq (%rax), %rdi
callq 0xa930
movq -0x100(%rbp), %rdi
cmpl $0x0, %eax
setne %al
andb $0x1, %al
movb %al, -0x41(%rbp)
addq $0x10, %rdi
callq 0x58470
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rdi
callq 0x58490
movq %rax, -0x58(%rbp)
movq -0x50(%rbp), %rdi
callq 0x584c0
movq %rax, -0x60(%rbp)
leaq -0x58(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x584f0
testb $0x1, %al
jne 0x57de3
jmp 0x57e11
leaq -0x58(%rbp), %rdi
callq 0x58520
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
movq (%rax), %rdi
movb -0x41(%rbp), %cl
movq (%rdi), %rax
andb $0x1, %cl
movzbl %cl, %esi
callq *0x28(%rax)
leaq -0x58(%rbp), %rdi
callq 0x58550
jmp 0x57dd0
jmp 0x5805d
movq -0x100(%rbp), %rdi
addq $0x78, %rdi
movq -0x18(%rbp), %rsi
callq 0x58780
jmp 0x5805d
movq -0x18(%rbp), %rax
movq (%rax), %rdi
callq 0xa8e0
movq %rax, -0x110(%rbp)
leaq -0x89(%rbp), %rdi
movq %rdi, -0x108(%rbp)
callq 0xa770
movq -0x110(%rbp), %rsi
movq -0x108(%rbp), %rdx
leaq -0x88(%rbp), %rdi
callq 0xdcb0
jmp 0x57e71
leaq -0x89(%rbp), %rdi
callq 0xa960
movq -0x100(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x58080
movq %rax, -0x118(%rbp)
jmp 0x57e99
movq -0x100(%rbp), %rdi
movq -0x118(%rbp), %rax
movq %rax, -0xa8(%rbp)
addq $0x10, %rdi
callq 0x58470
movq %rax, -0x120(%rbp)
jmp 0x57ec0
movq -0x120(%rbp), %rax
movq %rax, -0xb0(%rbp)
movq -0xb0(%rbp), %rdi
callq 0x58490
movq %rax, -0xb8(%rbp)
movq -0xb0(%rbp), %rdi
callq 0x584c0
movq %rax, -0xc0(%rbp)
leaq -0xb8(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x584f0
testb $0x1, %al
jne 0x57f10
jmp 0x57f98
leaq -0xb8(%rbp), %rdi
callq 0x58520
movq %rax, -0xc8(%rbp)
movq -0xc8(%rbp), %rax
movq (%rax), %rdi
movq -0xa8(%rbp), %rax
movq (%rax), %rsi
movq (%rdi), %rax
movq 0x30(%rax), %rax
callq *%rax
jmp 0x57f42
jmp 0x57f44
leaq -0xb8(%rbp), %rdi
callq 0x58550
jmp 0x57ef4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
leaq -0x89(%rbp), %rdi
callq 0xa960
jmp 0x58066
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
leaq -0x88(%rbp), %rdi
callq 0xa978
jmp 0x58066
leaq -0x88(%rbp), %rdi
callq 0xa978
jmp 0x5805d
movb $0x1, -0xe9(%rbp)
movl $0x10, %edi
callq 0xa2d0
movq %rax, -0x128(%rbp)
movq -0x10(%rbp), %rdx
leaq 0x45fc4(%rip), %rsi     # 0x9df90
leaq -0xe8(%rbp), %rdi
callq 0x588a0
jmp 0x57fda
movq -0x128(%rbp), %rdi
leaq -0xe8(%rbp), %rsi
callq 0xa130
jmp 0x57fef
movq -0x128(%rbp), %rdi
movb $0x0, -0xe9(%rbp)
movq 0x44fe4(%rip), %rsi     # 0x9cfe8
movq 0x44fbd(%rip), %rdx     # 0x9cfc8
callq 0xa500
jmp 0x58072
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
jmp 0x58044
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
leaq -0xe8(%rbp), %rdi
callq 0xa978
testb $0x1, -0xe9(%rbp)
jne 0x5804f
jmp 0x5805b
movq -0x128(%rbp), %rdi
callq 0xa6c0
jmp 0x58066
addq $0x130, %rsp            # imm = 0x130
popq %rbp
retq
movq -0x98(%rbp), %rdi
callq 0xa520
nopw %cs:(%rax,%rax)