// File: /workspace/github_cpp_makefile_star2_O3/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, -0x40(%rbp)
movq %rax, (%rdi)
movq $0x0, 0x8(%rdi)
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 %r13d, %r13d
movq %r15, %rdi
callq 0x2f2c4
testb %al, %al
je 0x2c3c3
leaq -0x50(%rbp), %rbx
movq %r14, %rdi
movq %r15, %rsi
callq 0x28ea8
testb %al, %al
jne 0x2c1cc
leaq 0x137fc(%rip), %rdi     # 0x3f8d0
movq %r15, %rsi
callq 0x28ea8
testb %al, %al
jne 0x2c1cc
movq %r15, %rdi
callq 0x2f2b6
cmpb $-0x1, %al
je 0x2c1cc
cmpl $0x0, 0xc(%r15)
jne 0x2c124
leaq 0x1394e(%rip), %rdi     # 0x3fa50
movq %r15, %rsi
callq 0x28ea8
testb %al, %al
je 0x2c124
movl 0x44(%r14), %eax
cmpl $0x1, %eax
je 0x2c1cc
cmpl $0x2, %eax
je 0x2c4c7
cmpb $0x5c, 0x3a(%r14)
jne 0x2c162
leaq 0x13b8e(%rip), %rdi     # 0x3fcc0
movq %r15, %rsi
callq 0x28ea8
testb %al, %al
je 0x2c162
leaq 0x13b7b(%rip), %rdi     # 0x3fcc0
movq %r15, %rsi
callq 0x28ebc
movb $0x1, %r12b
movq %r15, %rdi
movl %eax, %esi
callq 0x2f374
movb $0x1, %r13b
jmp 0x2c0ba
movq %r15, %rdi
callq 0x2f2b6
cmpb 0x3a(%r14), %al
jne 0x2c1ad
leaq -0x60(%rbp), %rdi
movq %r15, %rsi
callq 0x2548b
movq -0x60(%rbp), %rsi
movq -0x58(%rbp), %rdx
movq -0x30(%rbp), %rdi
callq 0x40d0
movq -0x60(%rbp), %rdi
cmpq %rbx, %rdi
je 0x2c1a2
movq -0x50(%rbp), %rsi
incq %rsi
callq 0x42d0
movb $0x1, %r12b
movb $0x1, %r13b
jmp 0x2c0ba
movq %r15, %rdi
callq 0x2f2dc
movb $0x1, %r12b
movsbl %al, %esi
movq -0x30(%rbp), %rdi
callq 0x4280
movb $0x1, %r13b
jmp 0x2c0ba
movq %r15, %rdi
callq 0x2f2b6
cmpb $-0x1, %al
je 0x2c382
cmpl $0x1, 0x44(%r14)
jne 0x2c201
cmpl $0x0, 0xc(%r15)
jne 0x2c201
leaq 0x1385f(%rip), %rdi     # 0x3fa50
movq %r15, %rsi
callq 0x28ea8
testb %al, %al
jne 0x2c3c3
movq %r14, %rdi
movq %r15, %rsi
callq 0x28ebc
testl %eax, %eax
jns 0x2c3b2
leaq 0x136b5(%rip), %rdi     # 0x3f8d0
movq %r15, %rsi
callq 0x28ebc
movq %r15, %rdi
movl %eax, %esi
callq 0x2f374
movq %r15, %rdi
callq 0x2f2b6
cmpb $0x20, %al
jne 0x2c260
movl 0xc(%r15), %eax
cmpl 0x34(%r14), %eax
jl 0x2c251
movb 0x38(%r14), %al
cmpb $0x1, %al
jne 0x2c264
testb $0x1, %r13b
jne 0x2c264
movq %r15, %rdi
movl $0x1, %esi
callq 0x2f374
jmp 0x2c22d
movb 0x38(%r14), %al
notb %al
orb %r13b, %al
testb $0x1, %al
jne 0x2c27e
movl 0x34(%r14), %eax
movl 0xc(%r15), %ecx
cmpl %ecx, %eax
cmovgl %eax, %ecx
movl %ecx, 0x34(%r14)
leaq 0x1361b(%rip), %rdi     # 0x3f8a0
movq %r15, %rsi
callq 0x28ea8
testb %al, %al
je 0x2c2c8
movq %r15, %rdi
callq 0x2f2b6
cmpb $0x9, %al
jne 0x2c2b2
movl 0xc(%r15), %eax
cmpl 0x34(%r14), %eax
jge 0x2c2b2
cmpl $0x2, 0x48(%r14)
je 0x2c483
cmpb $0x1, 0x39(%r14)
jne 0x2c2c8
movq %r15, %rdi
movl $0x1, %esi
callq 0x2f374
jmp 0x2c27e
leaq 0x13601(%rip), %rdi     # 0x3f8d0
movq %r15, %rsi
callq 0x28ea8
movl %eax, %ebx
movq %r15, %rdi
callq 0x2f2b6
cmpb $0x20, %al
sete %sil
movb 0x3b(%r14), %cl
movl %ecx, %edx
notb %dl
orb -0x34(%rbp), %dl
testb $0x1, %dl
je 0x2c2ff
testb $0x1, %r12b
jne 0x2c30f
jmp 0x2c34e
movl 0xc(%r15), %edx
cmpl 0x34(%r14), %edx
setge %dl
testb %r12b, %dl
je 0x2c34e
testb %bl, %bl
movl %esi, %r12d
leaq 0x4abc(%rip), %rsi      # 0x30dd7
leaq 0x4bcd(%rip), %rdx      # 0x30eef
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 0x45b0
movl %r12d, %esi
movb $0x1, %r12b
movl %esi, %eax
movl %eax, -0x38(%rbp)
movl %ebx, %eax
movl %eax, -0x34(%rbp)
testb %bl, %bl
jne 0x2c0a6
movl 0xc(%r15), %eax
movl %esi, %ecx
movl %ecx, -0x38(%rbp)
movl %ebx, %ecx
movl %ecx, -0x34(%rbp)
cmpl 0x34(%r14), %eax
jge 0x2c0a6
movb $0x1, 0x4c(%r14)
jmp 0x2c3c3
cmpb $0x1, 0x30(%r14)
jne 0x2c3c3
movl $0x30, %edi
callq 0x4140
movq %rax, %rbx
movl 0x8(%r15), %esi
movl 0xc(%r15), %edx
leaq 0x13bcb(%rip), %rcx     # 0x3ff70
movq %rax, %rdi
callq 0x1960e
jmp 0x2c4eb
cmpb $0x1, 0x30(%r14)
jne 0x2c3c3
movq %r15, %rdi
movl %eax, %esi
callq 0x2f374
cmpb $0x1, 0x3c(%r14)
jne 0x2c407
movq -0x30(%rbp), %rbx
movq %rbx, %rdi
movl $0x20, %esi
movq $-0x1, %rdx
callq 0x41f0
movl %eax, %edx
movq 0x8(%rbx), %rcx
cmpq %rcx, %rdx
jae 0x2c407
incl %eax
cmpq %rax, %rcx
jb 0x2c50b
movq -0x30(%rbp), %rcx
movq %rax, 0x8(%rcx)
movq (%rcx), %rcx
movb $0x0, (%rcx,%rax)
cmpl $0x0, 0x40(%r14)
jle 0x2c421
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 0x41f0
movl 0x40(%r14), %ecx
cmpl $-0x1, %ecx
je 0x2c458
testl %ecx, %ecx
jne 0x2c40e
leal 0x1(%rax), %edx
movq -0x30(%rbp), %rcx
movq 0x8(%rcx), %rcx
cmpq %rcx, %rdx
jae 0x2c40e
addl $0x2, %eax
jmp 0x2c469
movl %eax, %edx
movq -0x30(%rbp), %rcx
movq 0x8(%rcx), %rcx
cmpq %rcx, %rdx
jae 0x2c40e
incl %eax
cmpq %rax, %rcx
jb 0x2c523
movq -0x30(%rbp), %rcx
movq %rax, 0x8(%rcx)
movq (%rcx), %rcx
movb $0x0, (%rcx,%rax)
jmp 0x2c40e
movl $0x30, %edi
callq 0x4140
movq %rax, %rbx
movl 0x8(%r15), %esi
movl 0xc(%r15), %edx
leaq 0x13b11(%rip), %rcx     # 0x3ffb0
movq %rax, %rdi
callq 0x1960e
leaq 0xe412(%rip), %rax      # 0x3a8c0
movq %rax, (%rbx)
leaq 0xe1a0(%rip), %rsi      # 0x3a658
leaq -0x12cbd(%rip), %rdx    # 0x19802
movq %rbx, %rdi
callq 0x4510
movl $0x30, %edi
callq 0x4140
movq %rax, %rbx
movl 0x8(%r15), %esi
movl 0xc(%r15), %edx
leaq 0x13a6d(%rip), %rcx     # 0x3ff50
movq %rax, %rdi
callq 0x1960e
leaq 0xe3ce(%rip), %rax      # 0x3a8c0
movq %rax, (%rbx)
leaq 0xe15c(%rip), %rsi      # 0x3a658
leaq -0x12d01(%rip), %rdx    # 0x19802
movq %rbx, %rdi
callq 0x4510
leaq 0x4a88(%rip), %rdi      # 0x30f9a
leaq 0x4a6d(%rip), %rsi      # 0x30f86
movq %rax, %rdx
xorl %eax, %eax
callq 0x4470
leaq 0x4a70(%rip), %rdi      # 0x30f9a
leaq 0x4a55(%rip), %rsi      # 0x30f86
movq %rax, %rdx
xorl %eax, %eax
callq 0x4470
jmp 0x2c580
jmp 0x2c56b
jmp 0x2c580
jmp 0x2c580
jmp 0x2c56b
jmp 0x2c580
jmp 0x2c580
jmp 0x2c580
jmp 0x2c580
jmp 0x2c580
jmp 0x2c580
movq %rax, %r14
movq -0x60(%rbp), %rdi
cmpq %rbx, %rdi
je 0x2c583
movq -0x50(%rbp), %rsi
incq %rsi
callq 0x42d0
jmp 0x2c583
movq %rax, %r14
movq %rbx, %rdi
callq 0x4230
jmp 0x2c583
jmp 0x2c580
jmp 0x2c580
jmp 0x2c580
jmp 0x2c580
movq %rax, %r14
movq -0x30(%rbp), %rax
movq (%rax), %rdi
movq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x2c59e
movq (%rax), %rsi
incq %rsi
callq 0x42d0
movq %r14, %rdi
callq 0x4550
nop