// File: /workspace/github_cpp_makefile_star2_O1/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
movq %rdx, %r14
movq %rsi, %r15
leaq 0x10(%rdi), %rax
movq %rax, -0x60(%rbp)
movq %rax, (%rdi)
movq $0x0, 0x8(%rdi)
xorl %eax, %eax
movq %rdi, -0x30(%rbp)
movb %al, 0x10(%rdi)
movb %al, 0x4c(%rdx)
leaq 0x1327f(%rip), %r12     # 0x408e0
movl $0x0, -0x38(%rbp)
movl $0x0, -0x34(%rbp)
xorl %r13d, %r13d
xorl %ebx, %ebx
movq %r15, %rdi
callq 0x308ec
testb %al, %al
je 0x2d979
movq %r14, %rdi
movq %r15, %rsi
callq 0x2a482
testb %al, %al
jne 0x2d793
movq %r12, %rdi
movq %r15, %rsi
callq 0x2a482
testb %al, %al
jne 0x2d793
movq %r15, %rdi
callq 0x308de
cmpb $-0x1, %al
je 0x2d793
cmpl $0x0, 0xc(%r15)
jne 0x2d6ea
leaq 0x13398(%rip), %rdi     # 0x40a60
movq %r15, %rsi
callq 0x2a482
testb %al, %al
je 0x2d6ea
movl 0x44(%r14), %eax
cmpl $0x1, %eax
je 0x2d793
cmpl $0x2, %eax
je 0x2da83
cmpb $0x5c, 0x3a(%r14)
jne 0x2d727
leaq 0x135d8(%rip), %rdi     # 0x40cd0
movq %r15, %rsi
callq 0x2a482
testb %al, %al
je 0x2d727
leaq 0x135c5(%rip), %rdi     # 0x40cd0
movq %r15, %rsi
callq 0x2a496
movb $0x1, %r13b
movq %r15, %rdi
movl %eax, %esi
callq 0x3099c
movb $0x1, %bl
jmp 0x2d684
movq %r15, %rdi
callq 0x308de
cmpb 0x3a(%r14), %al
jne 0x2d775
leaq -0x58(%rbp), %rdi
movq %r15, %rsi
callq 0x269f9
movq -0x58(%rbp), %rsi
movq -0x50(%rbp), %rdx
movq -0x30(%rbp), %rdi
callq 0x50d0
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
je 0x2d76b
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x52e0
movb $0x1, %r13b
movb $0x1, %bl
jmp 0x2d684
movq %r15, %rdi
callq 0x30904
movb $0x1, %r13b
movsbl %al, %esi
movq -0x30(%rbp), %rdi
callq 0x5290
movb $0x1, %bl
jmp 0x2d684
movq %r15, %rdi
callq 0x308de
cmpb $-0x1, %al
je 0x2d96e
cmpl $0x1, 0x44(%r14)
jne 0x2d7c8
cmpl $0x0, 0xc(%r15)
jne 0x2d7c8
leaq 0x132a8(%rip), %rdi     # 0x40a60
movq %r15, %rsi
callq 0x2a482
testb %al, %al
jne 0x2d979
movq %r14, %rdi
movq %r15, %rsi
callq 0x2a496
testl %eax, %eax
js 0x2d7ef
cmpb $0x1, 0x30(%r14)
jne 0x2d7e8
movq %r15, %rdi
movl %eax, %esi
callq 0x3099c
xorl %eax, %eax
jmp 0x2d964
movq %r12, %rdi
movq %r15, %rsi
callq 0x2a496
movq %r15, %rdi
movl %eax, %esi
callq 0x3099c
movq %r15, %rdi
callq 0x308de
cmpb $0x20, %al
jne 0x2d835
movl 0xc(%r15), %eax
cmpl 0x34(%r14), %eax
jl 0x2d826
cmpb $0x1, 0x38(%r14)
jne 0x2d835
testb $0x1, %bl
jne 0x2d835
movq %r15, %rdi
movl $0x1, %esi
callq 0x3099c
jmp 0x2d804
cmpb $0x1, 0x38(%r14)
jne 0x2d852
testb $0x1, %bl
jne 0x2d852
movl 0x34(%r14), %eax
movl 0xc(%r15), %ecx
cmpl %ecx, %eax
cmovgl %eax, %ecx
movl %ecx, 0x34(%r14)
leaq 0x13057(%rip), %rdi     # 0x408b0
movq %r15, %rsi
callq 0x2a482
testb %al, %al
je 0x2d89c
movq %r15, %rdi
callq 0x308de
cmpb $0x9, %al
jne 0x2d886
movl 0xc(%r15), %eax
cmpl 0x34(%r14), %eax
jge 0x2d886
cmpl $0x2, 0x48(%r14)
je 0x2da3e
cmpb $0x1, 0x39(%r14)
jne 0x2d89c
movq %r15, %rdi
movl $0x1, %esi
callq 0x3099c
jmp 0x2d852
movq %r12, %rdi
movq %r15, %rsi
callq 0x2a482
movl %eax, %r12d
movq %r15, %rdi
callq 0x308de
cmpb $0x20, %al
sete %sil
movb 0x3b(%r14), %cl
cmpb $0x1, %cl
jne 0x2d8dc
testb $0x1, -0x34(%rbp)
jne 0x2d8dc
movl 0xc(%r15), %edx
cmpl 0x34(%r14), %edx
movzbl %r13b, %r13d
movl $0x0, %edx
cmovll %edx, %r13d
testb $0x1, %r13b
je 0x2d923
testb $0x1, -0x38(%rbp)
movl %esi, %r13d
leaq 0x44df(%rip), %rsi      # 0x31dcf
leaq 0x45f0(%rip), %rdx      # 0x31ee7
cmovneq %rdx, %rsi
cmpb $0x20, %al
cmoveq %rdx, %rsi
testb $0x1, -0x34(%rbp)
cmovneq %rdx, %rsi
testb $0x1, %r12b
cmovneq %rdx, %rsi
testb %cl, %cl
cmoveq %rdx, %rsi
movq -0x30(%rbp), %rdi
callq 0x55c0
movl %r13d, %esi
movb $0x1, %al
testb %r12b, %r12b
je 0x2d93a
movl %esi, %ecx
movl %ecx, -0x38(%rbp)
movl %r12d, %ecx
movl %ecx, -0x34(%rbp)
movb $0x1, %r13b
jmp 0x2d95d
movl 0xc(%r15), %eax
movb $0x1, %r13b
cmpl 0x34(%r14), %eax
jge 0x2d950
movb $0x1, 0x4c(%r14)
xorl %eax, %eax
jmp 0x2d952
movb $0x1, %al
movl %esi, %ecx
movl %ecx, -0x38(%rbp)
movl %r12d, %ecx
movl %ecx, -0x34(%rbp)
leaq 0x12f7c(%rip), %r12     # 0x408e0
testb %al, %al
jne 0x2d674
jmp 0x2d979
cmpb $0x1, 0x30(%r14)
je 0x2dac8
cmpb $0x1, 0x3c(%r14)
jne 0x2d9bd
movq -0x30(%rbp), %rbx
movq %rbx, %rdi
movl $0x20, %esi
movq $-0x1, %rdx
callq 0x51f0
movl %eax, %edx
movq 0x8(%rbx), %rcx
cmpq %rcx, %rdx
jae 0x2d9bd
incl %eax
cmpq %rax, %rcx
jb 0x2daee
movq -0x30(%rbp), %rcx
movq %rax, 0x8(%rcx)
movq (%rcx), %rcx
movb $0x0, (%rcx,%rax)
cmpl $0x0, 0x40(%r14)
jle 0x2d9d7
movq -0x30(%rbp), %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq -0x30(%rbp), %rdi
movl $0xa, %esi
movq $-0x1, %rdx
callq 0x51f0
movl 0x40(%r14), %edx
cmpl $-0x1, %edx
je 0x2da13
testl %edx, %edx
jne 0x2d9c4
leal 0x1(%rax), %esi
movq -0x30(%rbp), %rcx
movq 0x8(%rcx), %rcx
cmpq %rcx, %rsi
jae 0x2da0e
addl $0x2, %eax
jmp 0x2da24
cmpl $-0x1, %edx
jne 0x2d9c4
movl %eax, %edx
movq -0x30(%rbp), %rcx
movq 0x8(%rcx), %rcx
cmpq %rcx, %rdx
jae 0x2d9c4
incl %eax
cmpq %rax, %rcx
jb 0x2db06
movq -0x30(%rbp), %rcx
movq %rax, 0x8(%rcx)
movq (%rcx), %rcx
movb $0x0, (%rcx,%rax)
jmp 0x2d9c4
movl $0x30, %edi
callq 0x5140
movq %rax, %r12
movl 0x8(%r15), %esi
movl 0xc(%r15), %edx
leaq 0x13566(%rip), %rcx     # 0x40fc0
movq %rax, %rdi
callq 0x1a648
leaq 0xde57(%rip), %rax      # 0x3b8c0
movq %rax, (%r12)
leaq 0xdbe4(%rip), %rsi      # 0x3b658
leaq -0x13247(%rip), %rdx    # 0x1a834
movq %r12, %rdi
callq 0x5520
movl $0x30, %edi
callq 0x5140
movq %rax, %r12
movl 0x8(%r15), %esi
movl 0xc(%r15), %edx
leaq 0x134c1(%rip), %rcx     # 0x40f60
movq %rax, %rdi
callq 0x1a648
leaq 0xde12(%rip), %rax      # 0x3b8c0
movq %rax, (%r12)
leaq 0xdb9f(%rip), %rsi      # 0x3b658
leaq -0x1328c(%rip), %rdx    # 0x1a834
movq %r12, %rdi
callq 0x5520
movl $0x30, %edi
callq 0x5140
movq %rax, %r12
movl 0x8(%r15), %esi
movl 0xc(%r15), %edx
leaq 0x1349c(%rip), %rcx     # 0x40f80
movq %rax, %rdi
callq 0x1a648
jmp 0x2daa7
leaq 0x449d(%rip), %rdi      # 0x31f92
leaq 0x4482(%rip), %rsi      # 0x31f7e
movq %rax, %rdx
xorl %eax, %eax
callq 0x5480
leaq 0x4485(%rip), %rdi      # 0x31f92
leaq 0x446a(%rip), %rsi      # 0x31f7e
movq %rax, %rdx
xorl %eax, %eax
callq 0x5480
jmp 0x2db67
jmp 0x2db30
jmp 0x2db67
jmp 0x2db67
jmp 0x2db67
jmp 0x2db67
jmp 0x2db30
jmp 0x2db67
jmp 0x2db67
movq %rax, %r14
movq %r12, %rdi
callq 0x5230
jmp 0x2db6a
jmp 0x2db67
jmp 0x2db67
movq %rax, %r14
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
je 0x2db6a
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x52e0
jmp 0x2db6a
jmp 0x2db67
jmp 0x2db67
jmp 0x2db67
jmp 0x2db67
movq %rax, %r14
movq -0x30(%rbp), %rax
movq (%rax), %rdi
movq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x2db85
movq (%rax), %rsi
incq %rsi
callq 0x52e0
movq %r14, %rdi
callq 0x5560
nopl (%rax)