// File: mhe[P]raytracerframework_cpp/yaml/scanscalar.cpp
// Function: YAML::ScanScalar[abi:cxx11](YAML::Stream&, YAML::ScanScalarParams&)
std::string ScanScalar(Stream& INPUT, ScanScalarParams& params)
	{
		bool foundNonEmptyLine = false, pastOpeningBreak = false;
		bool emptyLine = false, moreIndented = false;
		std::string scalar;
		params.leadingSpaces = false;

		while(INPUT) {
			// ********************************
			// Phase #1: scan until line ending
			while(!params.end.Matches(INPUT) && !Exp::Break.Matches(INPUT)) {
				if(INPUT.peek() == EOF)
					break;

				// document indicator?
				if(INPUT.column == 0 && Exp::DocIndicator.Matches(INPUT)) {
					if(params.onDocIndicator == BREAK)
						break;
					else if(params.onDocIndicator == THROW)
						throw ParserException(INPUT.line, INPUT.column, ErrorMsg::DOC_IN_SCALAR);
				}

				foundNonEmptyLine = true;
				pastOpeningBreak = true;

				// escaped newline? (only if we're escaping on slash)
				if(params.escape == '\\' && Exp::EscBreak.Matches(INPUT)) {
					int n = Exp::EscBreak.Match(INPUT);
					INPUT.eat(n);
					continue;
				}

				// escape this?
				if(INPUT.peek() == params.escape) {
					scalar += Exp::Escape(INPUT);
					continue;
				}

				// otherwise, just add the damn character
				scalar += INPUT.get();
			}

			// eof? if we're looking to eat something, then we throw
			if(INPUT.peek() == EOF) {
				if(params.eatEnd)
					throw ParserException(INPUT.line, INPUT.column, ErrorMsg::EOF_IN_SCALAR);
				break;
			}

			// doc indicator?
			if(params.onDocIndicator == BREAK && INPUT.column == 0 && Exp::DocIndicator.Matches(INPUT))
				break;

			// are we done via character match?
			int n = params.end.Match(INPUT);
			if(n >= 0) {
				if(params.eatEnd)
					INPUT.eat(n);
				break;
			}

			// ********************************
			// Phase #2: eat line ending
			n = Exp::Break.Match(INPUT);
			INPUT.eat(n);

			// ********************************
			// Phase #3: scan initial spaces

			// first the required indentation
			while(INPUT.peek() == ' ' && (INPUT.column < params.indent || (params.detectIndent && !foundNonEmptyLine)))
				INPUT.eat(1);

			// update indent if we're auto-detecting
			if(params.detectIndent && !foundNonEmptyLine)
				params.indent = std::max(params.indent, INPUT.column);

			// and then the rest of the whitespace
			while(Exp::Blank.Matches(INPUT)) {
				// we check for tabs that masquerade as indentation
				if(INPUT.peek() == '\t'&& INPUT.column < params.indent && params.onTabInIndentation == THROW)
					throw ParserException(INPUT.line, INPUT.column, ErrorMsg::TAB_IN_INDENTATION);

				if(!params.eatLeadingWhitespace)
					break;

				INPUT.eat(1);
			}

			// was this an empty line?
			bool nextEmptyLine = Exp::Break.Matches(INPUT);
			bool nextMoreIndented = (INPUT.peek() == ' ');

			// for block scalars, we always start with a newline, so we should ignore it (not fold or keep)
			bool useNewLine = pastOpeningBreak;
			// and for folded scalars, we don't fold the very last newline to a space
			if(params.fold && !emptyLine && INPUT.column < params.indent)
				useNewLine = false;

			if(useNewLine) {
				if(params.fold && !emptyLine && !nextEmptyLine && !moreIndented && !nextMoreIndented)
					scalar += " ";
				else
					scalar += "\n";
			}

			emptyLine = nextEmptyLine;
			moreIndented = nextMoreIndented;
			pastOpeningBreak = true;

			// are we done via indentation?
			if(!emptyLine && INPUT.column < params.indent) {
				params.leadingSpaces = true;
				break;
			}
		}

		// post-processing
		if(params.trimTrailingSpaces) {
			unsigned pos = scalar.find_last_not_of(' ');
			if(pos < scalar.size())
				scalar.erase(pos + 1);
		}

		if(params.chomp <= 0) {
			unsigned pos = scalar.find_last_not_of('\n');
			if(params.chomp == 0 && pos + 1 < scalar.size())
				scalar.erase(pos + 2);
			else if(params.chomp == -1 && pos < scalar.size())
				scalar.erase(pos + 1);
		}

		return scalar;
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xe0, %rsp
movq %rdi, -0x70(%rbp)
movq %rdi, %rax
movq %rax, -0x68(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movb $0x0, -0x19(%rbp)
movb $0x0, -0x1a(%rbp)
movb $0x0, -0x1b(%rbp)
movb $0x0, -0x1c(%rbp)
movb $0x0, -0x1d(%rbp)
callq 0x55b0
movq -0x18(%rbp), %rax
movb $0x0, 0x4c(%rax)
movq -0x10(%rbp), %rdi
callq 0x4a860
movb %al, -0x71(%rbp)
jmp 0x44b21
movb -0x71(%rbp), %al
testb $0x1, %al
jne 0x44b2d
jmp 0x45164
jmp 0x44b2f
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x3c550
movb %al, -0x72(%rbp)
jmp 0x44b41
movb -0x72(%rbp), %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x73(%rbp)
jne 0x44b6d
jmp 0x44b50
movq -0x10(%rbp), %rsi
leaq 0x27e45(%rip), %rdi     # 0x6c9a0
callq 0x3c550
movb %al, -0x74(%rbp)
jmp 0x44b65
movb -0x74(%rbp), %al
xorb $-0x1, %al
movb %al, -0x73(%rbp)
movb -0x73(%rbp), %al
testb $0x1, %al
jne 0x44b79
jmp 0x44d56
movq -0x10(%rbp), %rdi
callq 0x4a840
movb %al, -0x75(%rbp)
jmp 0x44b87
movb -0x75(%rbp), %al
movsbl %al, %eax
cmpl $-0x1, %eax
jne 0x44ba8
jmp 0x44d56
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x452a3
movq -0x10(%rbp), %rax
cmpl $0x0, 0xc(%rax)
jne 0x44c53
movq -0x10(%rbp), %rsi
leaq 0x27f5f(%rip), %rdi     # 0x6cb20
callq 0x3c550
movb %al, -0x76(%rbp)
jmp 0x44bcb
movb -0x76(%rbp), %al
testb $0x1, %al
jne 0x44bd4
jmp 0x44c53
movq -0x18(%rbp), %rax
cmpl $0x1, 0x44(%rax)
jne 0x44be3
jmp 0x44d56
movq -0x18(%rbp), %rax
cmpl $0x2, 0x44(%rax)
jne 0x44c4f
movl $0x30, %edi
callq 0x51b0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x80(%rbp)
movq -0x10(%rbp), %rax
movl 0x8(%rax), %esi
movl 0xc(%rax), %edx
leaq 0x2840e(%rip), %rcx     # 0x6d020
callq 0x340e0
jmp 0x44c19
movq -0x80(%rbp), %rdi
leaq 0x229dc(%rip), %rsi     # 0x67600
leaq -0x10afb(%rip), %rdx    # 0x34130
callq 0x5690
jmp 0x452b5
movq -0x80(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
callq 0x52c0
jmp 0x452a3
jmp 0x44c51
jmp 0x44c53
movb $0x1, -0x19(%rbp)
movb $0x1, -0x1a(%rbp)
movq -0x18(%rbp), %rax
movsbl 0x3a(%rax), %eax
cmpl $0x5c, %eax
jne 0x44cc0
movq -0x10(%rbp), %rsi
leaq 0x2811d(%rip), %rdi     # 0x6cd90
callq 0x3c550
movb %al, -0x81(%rbp)
jmp 0x44c80
movb -0x81(%rbp), %al
testb $0x1, %al
jne 0x44c8c
jmp 0x44cc0
movq -0x10(%rbp), %rsi
leaq 0x280f9(%rip), %rdi     # 0x6cd90
callq 0x3c580
movl %eax, -0x88(%rbp)
jmp 0x44ca4
movl -0x88(%rbp), %eax
movl %eax, -0x30(%rbp)
movq -0x10(%rbp), %rdi
movl -0x30(%rbp), %esi
callq 0x4a9a0
jmp 0x44cbb
jmp 0x44b2f
movq -0x10(%rbp), %rdi
callq 0x4a840
movb %al, -0x89(%rbp)
jmp 0x44cd1
movb -0x89(%rbp), %al
movsbl %al, %eax
movq -0x18(%rbp), %rcx
movsbl 0x3a(%rcx), %ecx
cmpl %ecx, %eax
jne 0x44d2c
movq -0x10(%rbp), %rsi
leaq -0x50(%rbp), %rdi
callq 0x33930
jmp 0x44cf5
movq -0x70(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x5520
jmp 0x44d04
leaq -0x50(%rbp), %rdi
callq 0x5788
jmp 0x44b2f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x5788
jmp 0x452a3
movq -0x10(%rbp), %rdi
callq 0x4a890
movb %al, -0x8a(%rbp)
jmp 0x44d3d
movq -0x70(%rbp), %rdi
movb -0x8a(%rbp), %al
movsbl %al, %esi
callq 0x5220
jmp 0x44d51
jmp 0x44b2f
movq -0x10(%rbp), %rdi
callq 0x4a840
movb %al, -0x8b(%rbp)
jmp 0x44d67
movb -0x8b(%rbp), %al
movsbl %al, %eax
cmpl $-0x1, %eax
jne 0x44def
movq -0x18(%rbp), %rax
testb $0x1, 0x30(%rax)
je 0x44dea
movl $0x30, %edi
callq 0x51b0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x98(%rbp)
movq -0x10(%rbp), %rax
movl 0x8(%rax), %esi
movl 0xc(%rax), %edx
leaq 0x28299(%rip), %rcx     # 0x6d040
callq 0x340e0
jmp 0x44dae
movq -0x98(%rbp), %rdi
leaq 0x22844(%rip), %rsi     # 0x67600
leaq -0x10c93(%rip), %rdx    # 0x34130
callq 0x5690
jmp 0x452b5
movq -0x98(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
callq 0x52c0
jmp 0x452a3
jmp 0x45164
movq -0x18(%rbp), %rax
cmpl $0x1, 0x44(%rax)
jne 0x44e2c
movq -0x10(%rbp), %rax
cmpl $0x0, 0xc(%rax)
jne 0x44e2c
movq -0x10(%rbp), %rsi
leaq 0x27d12(%rip), %rdi     # 0x6cb20
callq 0x3c550
movb %al, -0x99(%rbp)
jmp 0x44e1b
movb -0x99(%rbp), %al
testb $0x1, %al
jne 0x44e27
jmp 0x44e2c
jmp 0x45164
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x3c580
movl %eax, -0xa0(%rbp)
jmp 0x44e41
movl -0xa0(%rbp), %eax
movl %eax, -0x54(%rbp)
cmpl $0x0, -0x54(%rbp)
jl 0x44e6f
movq -0x18(%rbp), %rax
testb $0x1, 0x30(%rax)
je 0x44e6a
movq -0x10(%rbp), %rdi
movl -0x54(%rbp), %esi
callq 0x4a9a0
jmp 0x44e68
jmp 0x44e6a
jmp 0x45164
movq -0x10(%rbp), %rsi
leaq 0x27b26(%rip), %rdi     # 0x6c9a0
callq 0x3c580
movl %eax, -0xa4(%rbp)
jmp 0x44e87
movl -0xa4(%rbp), %eax
movl %eax, -0x54(%rbp)
movq -0x10(%rbp), %rdi
movl -0x54(%rbp), %esi
callq 0x4a9a0
jmp 0x44e9e
jmp 0x44ea0
movq -0x10(%rbp), %rdi
callq 0x4a840
movb %al, -0xa5(%rbp)
jmp 0x44eb1
movb -0xa5(%rbp), %al
movsbl %al, %ecx
xorl %eax, %eax
cmpl $0x20, %ecx
movb %al, -0xa6(%rbp)
jne 0x44f14
movq -0x10(%rbp), %rax
movl 0xc(%rax), %ecx
movq -0x18(%rbp), %rdx
movb $0x1, %al
cmpl 0x34(%rdx), %ecx
movb %al, -0xa7(%rbp)
jl 0x44f08
movq -0x18(%rbp), %rcx
xorl %eax, %eax
testb $0x1, 0x38(%rcx)
movb %al, -0xa8(%rbp)
je 0x44efc
movb -0x19(%rbp), %al
xorb $-0x1, %al
movb %al, -0xa8(%rbp)
movb -0xa8(%rbp), %al
movb %al, -0xa7(%rbp)
movb -0xa7(%rbp), %al
movb %al, -0xa6(%rbp)
movb -0xa6(%rbp), %al
testb $0x1, %al
jne 0x44f20
jmp 0x44f35
movq -0x10(%rbp), %rdi
movl $0x1, %esi
callq 0x4a9a0
jmp 0x44f30
jmp 0x44ea0
movq -0x18(%rbp), %rax
testb $0x1, 0x38(%rax)
je 0x44f73
testb $0x1, -0x19(%rbp)
jne 0x44f73
movq -0x18(%rbp), %rdi
addq $0x34, %rdi
movq -0x10(%rbp), %rsi
addq $0xc, %rsi
callq 0x452c0
movq %rax, -0xb0(%rbp)
jmp 0x44f63
movq -0xb0(%rbp), %rax
movl (%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x34(%rax)
jmp 0x44f75
movq -0x10(%rbp), %rsi
leaq 0x279f0(%rip), %rdi     # 0x6c970
callq 0x3c550
movb %al, -0xb1(%rbp)
jmp 0x44f8d
movb -0xb1(%rbp), %al
testb $0x1, %al
jne 0x44f9c
jmp 0x45065
movq -0x10(%rbp), %rdi
callq 0x4a840
movb %al, -0xb2(%rbp)
jmp 0x44fad
movb -0xb2(%rbp), %al
movsbl %al, %eax
cmpl $0x9, %eax
jne 0x45044
movq -0x10(%rbp), %rax
movl 0xc(%rax), %eax
movq -0x18(%rbp), %rcx
cmpl 0x34(%rcx), %eax
jge 0x45044
movq -0x18(%rbp), %rax
cmpl $0x2, 0x48(%rax)
jne 0x45044
movl $0x30, %edi
callq 0x51b0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0xc0(%rbp)
movq -0x10(%rbp), %rax
movl 0x8(%rax), %esi
movl 0xc(%rax), %edx
leaq 0x2807f(%rip), %rcx     # 0x6d080
callq 0x340e0
jmp 0x45008
movq -0xc0(%rbp), %rdi
leaq 0x225ea(%rip), %rsi     # 0x67600
leaq -0x10eed(%rip), %rdx    # 0x34130
callq 0x5690
jmp 0x452b5
movq -0xc0(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
callq 0x52c0
jmp 0x452a3
movq -0x18(%rbp), %rax
testb $0x1, 0x39(%rax)
jne 0x45050
jmp 0x45065
movq -0x10(%rbp), %rdi
movl $0x1, %esi
callq 0x4a9a0
jmp 0x45060
jmp 0x44f75
movq -0x10(%rbp), %rsi
leaq 0x27930(%rip), %rdi     # 0x6c9a0
callq 0x3c550
movb %al, -0xc1(%rbp)
jmp 0x4507d
movb -0xc1(%rbp), %al
andb $0x1, %al
movb %al, -0x55(%rbp)
movq -0x10(%rbp), %rdi
callq 0x4a840
movb %al, -0xc2(%rbp)
jmp 0x45099
movb -0xc2(%rbp), %al
movsbl %al, %eax
cmpl $0x20, %eax
sete %al
andb $0x1, %al
movb %al, -0x56(%rbp)
movb -0x1a(%rbp), %al
andb $0x1, %al
movb %al, -0x57(%rbp)
movq -0x18(%rbp), %rax
testb $0x1, 0x3b(%rax)
je 0x450d9
testb $0x1, -0x1b(%rbp)
jne 0x450d9
movq -0x10(%rbp), %rax
movl 0xc(%rax), %eax
movq -0x18(%rbp), %rcx
cmpl 0x34(%rcx), %eax
jge 0x450d9
movb $0x0, -0x57(%rbp)
testb $0x1, -0x57(%rbp)
je 0x4512b
movq -0x18(%rbp), %rax
testb $0x1, 0x3b(%rax)
je 0x45115
testb $0x1, -0x1b(%rbp)
jne 0x45115
testb $0x1, -0x55(%rbp)
jne 0x45115
testb $0x1, -0x1c(%rbp)
jne 0x45115
testb $0x1, -0x56(%rbp)
jne 0x45115
movq -0x70(%rbp), %rdi
leaq 0x6d76(%rip), %rsi      # 0x4be82
callq 0x5370
jmp 0x45113
jmp 0x45129
movq -0x70(%rbp), %rdi
leaq 0x6c57(%rip), %rsi      # 0x4bd77
callq 0x5370
jmp 0x45127
jmp 0x45129
jmp 0x4512b
movb -0x55(%rbp), %al
andb $0x1, %al
movb %al, -0x1b(%rbp)
movb -0x56(%rbp), %al
andb $0x1, %al
movb %al, -0x1c(%rbp)
movb $0x1, -0x1a(%rbp)
testb $0x1, -0x1b(%rbp)
jne 0x4515f
movq -0x10(%rbp), %rax
movl 0xc(%rax), %eax
movq -0x18(%rbp), %rcx
cmpl 0x34(%rcx), %eax
jge 0x4515f
movq -0x18(%rbp), %rax
movb $0x1, 0x4c(%rax)
jmp 0x45164
jmp 0x44b13
movq -0x18(%rbp), %rax
testb $0x1, 0x3c(%rax)
je 0x451c5
movq -0x70(%rbp), %rdi
movl $0x20, %esi
movq $-0x1, %rdx
callq 0x5260
movq -0x70(%rbp), %rdi
movl %eax, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
movq %rax, -0xd0(%rbp)
callq 0x5290
movq %rax, %rcx
movq -0xd0(%rbp), %rax
cmpq %rcx, %rax
jae 0x451c3
movq -0x70(%rbp), %rdi
movl -0x5c(%rbp), %eax
incl %eax
movl %eax, %esi
movq $-0x1, %rdx
callq 0x50f0
jmp 0x451c1
jmp 0x451c3
jmp 0x451c5
movq -0x18(%rbp), %rax
cmpl $0x0, 0x40(%rax)
jg 0x45283
movq -0x70(%rbp), %rdi
movl $0xa, %esi
movq $-0x1, %rdx
callq 0x5260
movl %eax, -0x60(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x0, 0x40(%rax)
jne 0x45238
movq -0x70(%rbp), %rdi
movl -0x60(%rbp), %eax
addl $0x1, %eax
movl %eax, %eax
movq %rax, -0xd8(%rbp)
callq 0x5290
movq %rax, %rcx
movq -0xd8(%rbp), %rax
cmpq %rcx, %rax
jae 0x45238
movq -0x70(%rbp), %rdi
movl -0x60(%rbp), %eax
addl $0x2, %eax
movl %eax, %esi
movq $-0x1, %rdx
callq 0x50f0
jmp 0x45236
jmp 0x45281
movq -0x18(%rbp), %rax
cmpl $-0x1, 0x40(%rax)
jne 0x4527f
movq -0x70(%rbp), %rdi
movl -0x60(%rbp), %eax
movq %rax, -0xe0(%rbp)
callq 0x5290
movq %rax, %rcx
movq -0xe0(%rbp), %rax
cmpq %rcx, %rax
jae 0x4527f
movq -0x70(%rbp), %rdi
movl -0x60(%rbp), %eax
incl %eax
movl %eax, %esi
movq $-0x1, %rdx
callq 0x50f0
jmp 0x4527d
jmp 0x4527f
jmp 0x45281
jmp 0x45283
movb $0x1, -0x1d(%rbp)
testb $0x1, -0x1d(%rbp)
jne 0x45296
movq -0x70(%rbp), %rdi
callq 0x5788
movq -0x68(%rbp), %rax
addq $0xe0, %rsp
popq %rbp
retq
movq -0x70(%rbp), %rdi
callq 0x5788
movq -0x28(%rbp), %rdi
callq 0x56c0
nopw %cs:(%rax,%rax)
nop