// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
leaq 0x10(%rdi), %rax
movq %rax, (%rdi)
andq $0x0, 0x8(%rdi)
movq %rdx, %r14
movq %rsi, %r15
xorl %eax, %eax
movq %rdi, -0x30(%rbp)
movb %al, 0x10(%rdi)
movl $0x0, -0x38(%rbp)
movb %al, 0x4c(%rdx)
movl $0x0, -0x34(%rbp)
xorl %r12d, %r12d
xorl %ebx, %ebx
movq %r15, %rdi
callq 0x21724
testb %al, %al
je 0x1ee94
leaq 0x13d2b(%rip), %r13     # 0x328d0
movq %r14, %rdi
movq %r15, %rsi
callq 0x1beee
testb %al, %al
jne 0x1eca1
movq %r13, %rdi
movq %r15, %rsi
callq 0x1beee
testb %al, %al
jne 0x1eca1
movq %r15, %rdi
callq 0x21716
cmpb $-0x1, %al
je 0x1eca1
cmpl $0x0, 0xc(%r15)
jne 0x1ec0b
leaq 0x13e67(%rip), %rdi     # 0x32a50
movq %r15, %rsi
callq 0x1beee
testb %al, %al
je 0x1ec0b
movl 0x44(%r14), %eax
cmpl $0x1, %eax
je 0x1eca1
cmpl $0x2, %eax
je 0x1ef67
cmpb $0x5c, 0x3a(%r14)
jne 0x1ec48
leaq 0x140a7(%rip), %rdi     # 0x32cc0
movq %r15, %rsi
callq 0x1beee
testb %al, %al
je 0x1ec48
leaq 0x14094(%rip), %rdi     # 0x32cc0
movq %r15, %rsi
callq 0x1befe
movb $0x1, %r12b
movq %r15, %rdi
movl %eax, %esi
callq 0x217c8
movb $0x1, %bl
jmp 0x1eba5
movq %r15, %rdi
callq 0x21716
cmpb 0x3a(%r14), %al
jne 0x1ec83
leaq -0x58(%rbp), %rbx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x189bc
movq -0x30(%rbp), %rdi
movq %rbx, %rsi
callq 0x45b0
movq %rbx, %rdi
callq 0x45d8
movb $0x1, %r12b
movb $0x1, %bl
jmp 0x1eba5
movq %r15, %rdi
callq 0x2173c
movb $0x1, %r12b
movsbl %al, %esi
movq -0x30(%rbp), %rdi
callq 0x4250
movb $0x1, %bl
jmp 0x1eba5
movq %r15, %rdi
callq 0x21716
cmpb $-0x1, %al
je 0x1ee55
cmpl $0x1, 0x44(%r14)
jne 0x1ecd6
cmpl $0x0, 0xc(%r15)
jne 0x1ecd6
leaq 0x13d8a(%rip), %rdi     # 0x32a50
movq %r15, %rsi
callq 0x1beee
testb %al, %al
jne 0x1ee94
movq %r14, %rdi
movq %r15, %rsi
callq 0x1befe
leaq 0x13be8(%rip), %r13     # 0x328d0
testl %eax, %eax
jns 0x1ee83
movq %r13, %rdi
movq %r15, %rsi
callq 0x1befe
movq %r15, %rdi
movl %eax, %esi
callq 0x217c8
movq %r15, %rdi
callq 0x21716
cmpb $0x20, %al
jne 0x1ed35
movl 0xc(%r15), %eax
cmpl 0x34(%r14), %eax
jl 0x1ed28
movb 0x38(%r14), %al
cmpb $0x1, %al
jne 0x1ed39
testb $0x1, %bl
jne 0x1ed39
movq %r15, %rdi
pushq $0x1
popq %rsi
callq 0x217c8
jmp 0x1ed05
movb 0x38(%r14), %al
notb %al
orb %bl, %al
testb $0x1, %al
jne 0x1ed52
movl 0x34(%r14), %eax
movl 0xc(%r15), %ecx
cmpl %ecx, %eax
cmovgl %eax, %ecx
movl %ecx, 0x34(%r14)
leaq 0x13b47(%rip), %rdi     # 0x328a0
movq %r15, %rsi
callq 0x1beee
testb %al, %al
je 0x1ed9a
movq %r15, %rdi
callq 0x21716
cmpb $0x9, %al
jne 0x1ed86
movl 0xc(%r15), %eax
cmpl 0x34(%r14), %eax
jge 0x1ed86
cmpl $0x2, 0x48(%r14)
je 0x1ef2f
cmpb $0x1, 0x39(%r14)
jne 0x1ed9a
movq %r15, %rdi
pushq $0x1
popq %rsi
callq 0x217c8
jmp 0x1ed52
movq %r13, %rdi
movq %r15, %rsi
callq 0x1beee
movl %eax, %r13d
movq %r15, %rdi
callq 0x21716
cmpb $0x20, %al
sete %sil
movb 0x3b(%r14), %cl
movl %ecx, %edx
notb %dl
orb -0x34(%rbp), %dl
testb $0x1, %dl
je 0x1edce
testb $0x1, %r12b
jne 0x1edde
jmp 0x1ee1e
movl 0xc(%r15), %edx
cmpl 0x34(%r14), %edx
setge %dl
testb %r12b, %dl
je 0x1ee1e
testb %r13b, %r13b
movl %esi, %r12d
leaq 0x400b(%rip), %rsi      # 0x22df6
leaq 0x3ef9(%rip), %rdx      # 0x22ceb
cmovneq %rdx, %rsi
testb $0x1, -0x34(%rbp)
cmovneq %rdx, %rsi
testb %cl, %cl
cmoveq %rdx, %rsi
testb $0x1, -0x38(%rbp)
cmovneq %rdx, %rsi
cmpb $0x20, %al
cmoveq %rdx, %rsi
movq -0x30(%rbp), %rdi
callq 0x4580
movl %r12d, %esi
movb $0x1, %r12b
movl %esi, %eax
movl %eax, -0x38(%rbp)
movl %r13d, %eax
movl %eax, -0x34(%rbp)
testb %r13b, %r13b
jne 0x1eb8e
movl 0xc(%r15), %eax
movl %esi, %ecx
movl %ecx, -0x38(%rbp)
movl %r13d, %ecx
movl %ecx, -0x34(%rbp)
cmpl 0x34(%r14), %eax
jge 0x1eb8e
movb $0x1, 0x4c(%r14)
jmp 0x1ee94
cmpb $0x1, 0x30(%r14)
jne 0x1ee94
pushq $0x30
popq %rdi
callq 0x4130
movq %rax, %r14
movl 0x8(%r15), %esi
movl 0xc(%r15), %edx
leaq 0x140fa(%rip), %rcx     # 0x32f70
movq %rax, %rdi
callq 0x18be0
jmp 0x1ef89
cmpb $0x1, 0x30(%r14)
jne 0x1ee94
movq %r15, %rdi
movl %eax, %esi
callq 0x217c8
cmpb $0x1, 0x3c(%r14)
jne 0x1eec6
pushq $0x20
popq %rsi
pushq $-0x1
popq %rdx
movq -0x30(%rbp), %rbx
movq %rbx, %rdi
callq 0x41d0
movl %eax, %ecx
cmpq 0x8(%rbx), %rcx
jae 0x1eec6
incl %eax
pushq $-0x1
popq %rdx
movq -0x30(%rbp), %rdi
movq %rax, %rsi
callq 0x4090
cmpl $0x0, 0x40(%r14)
jle 0x1eee0
movq -0x30(%rbp), %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0xa
popq %rsi
pushq $-0x1
popq %rdx
movq -0x30(%rbp), %rdi
callq 0x41d0
movl 0x40(%r14), %ecx
cmpl $-0x1, %ecx
je 0x1ef0d
testl %ecx, %ecx
jne 0x1eecd
leal 0x1(%rax), %ecx
movq -0x30(%rbp), %rdx
cmpq 0x8(%rdx), %rcx
jae 0x1eecd
pushq $0x2
jmp 0x1ef1b
movl %eax, %ecx
movq -0x30(%rbp), %rdx
cmpq 0x8(%rdx), %rcx
jae 0x1eecd
pushq $0x1
popq %rcx
addl %ecx, %eax
pushq $-0x1
popq %rdx
movq -0x30(%rbp), %rdi
movq %rax, %rsi
callq 0x4090
jmp 0x1eecd
pushq $0x30
popq %rdi
callq 0x4130
movq %rax, %r14
movl 0x8(%r15), %esi
movl 0xc(%r15), %edx
leaq 0x14067(%rip), %rcx     # 0x32fb0
movq %rax, %rdi
callq 0x18be0
leaq 0xe6e8(%rip), %rsi      # 0x2d640
leaq -0xf38d(%rip), %rdx     # 0xfbd2
movq %r14, %rdi
callq 0x44f0
pushq $0x30
popq %rdi
callq 0x4130
movq %rax, %r14
movl 0x8(%r15), %esi
movl 0xc(%r15), %edx
leaq 0x13fcf(%rip), %rcx     # 0x32f50
movq %rax, %rdi
callq 0x18be0
leaq 0xe6b0(%rip), %rsi      # 0x2d640
leaq -0xf3c5(%rip), %rdx     # 0xfbd2
movq %r14, %rdi
callq 0x44f0
jmp 0x1efd8
jmp 0x1efc3
jmp 0x1efd8
jmp 0x1efd8
jmp 0x1efc3
jmp 0x1efd8
jmp 0x1efd8
jmp 0x1efd8
jmp 0x1efd8
jmp 0x1efd8
jmp 0x1efd8
movq %rax, %rbx
leaq -0x58(%rbp), %rdi
callq 0x45d8
jmp 0x1efdb
movq %rax, %rbx
movq %r14, %rdi
callq 0x4210
jmp 0x1efdb
jmp 0x1efd8
jmp 0x1efd8
jmp 0x1efd8
jmp 0x1efd8
movq %rax, %rbx
movq -0x30(%rbp), %rdi
callq 0x45d8
movq %rbx, %rdi
callq 0x4530