// File: /workspace/github_cpp_makefile_star2_O3/jliesch[P]ofxget/pugixml/pugixml.cpp
// Function: pugi::impl::(anonymous namespace)::get_buffer_encoding(pugi::xml_encoding, void const*, unsigned long)
PUGI__FN xml_encoding get_buffer_encoding(xml_encoding encoding, const void* contents, size_t size)
	{
		// replace wchar encoding with utf implementation
		if (encoding == encoding_wchar) return get_wchar_encoding();

		// replace utf16 encoding with utf16 with specific endianness
		if (encoding == encoding_utf16) return is_little_endian() ? encoding_utf16_le : encoding_utf16_be;

		// replace utf32 encoding with utf32 with specific endianness
		if (encoding == encoding_utf32) return is_little_endian() ? encoding_utf32_le : encoding_utf32_be;

		// only do autodetection if no explicit encoding is requested
		if (encoding != encoding_auto) return encoding;

		// try to guess encoding (based on XML specification, Appendix F.1)
		const uint8_t* data = static_cast<const uint8_t*>(contents);

		return guess_buffer_encoding(data, size);
	}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl %edi, %eax
cmpl $0x8, %edi
ja 0x288ce
movl %eax, %ecx
leaq 0x91b3(%rip), %rdi      # 0x31a2c
movslq (%rdi,%rcx,4), %rcx
addq %rdi, %rcx
jmpq *%rcx
movl $0x5, %eax
jmp 0x288ce
movl $0x1, %eax
cmpq $0x4, %rdx
jb 0x288ce
movb (%rsi), %r9b
movb 0x1(%rsi), %r8b
movb 0x2(%rsi), %cl
movb 0x3(%rsi), %dil
movl %r9d, %r10d
orb %r8b, %r10b
sete %r10b
cmpb $-0x2, %cl
sete %r11b
andb %r10b, %r11b
cmpb $-0x1, %dil
sete %bl
testb %bl, %r11b
je 0x288d7
movl $0x6, %eax
jmp 0x288ce
movl $0x2, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movl %r9d, %r11d
notb %r11b
movl %r8d, %ebx
xorb $-0x2, %bl
orb %r11b, %bl
sete %r11b
orb %cl, %bl
orb %dil, %bl
je 0x28882
movl %r9d, %ebp
xorb $-0x2, %bpl
movl %r8d, %r14d
notb %r14b
xorl %ebx, %ebx
orb %bpl, %r14b
sete %bpl
orb %bpl, %r11b
je 0x28916
movb %bpl, %bl
orl $0x2, %ebx
movl %ebx, %eax
jmp 0x288ce
movl %r9d, %r11d
xorb $-0x11, %r11b
movl %r8d, %ebx
xorb $-0x45, %bl
orb %r11b, %bl
movl %ecx, %r11d
xorb $-0x41, %r11b
orb %bl, %r11b
je 0x288ce
testb %cl, %cl
sete %al
andb %al, %r10b
cmpb $0x3c, %dil
sete %r11b
movl $0x6, %eax
testb %r11b, %r10b
jne 0x288ce
movl %r9d, %r10d
xorb $0x3c, %r10b
movl %r10d, %eax
orb %r8b, %al
sete %r11b
orb %cl, %al
orb %dil, %al
movl $0x5, %eax
je 0x288ce
movl %r8d, %eax
xorb $0x3c, %al
xorl %ebx, %ebx
orb %al, %r9b
sete %bpl
orb %cl, %r9b
movl %edi, %r14d
xorb $0x3f, %r14b
movl $0x3, %eax
orb %r9b, %r14b
je 0x288ce
movl %ecx, %eax
xorb $0x3f, %al
movl %r11d, %r9d
orb %bpl, %r9b
movb %bpl, %bl
orl $0x2, %ebx
orb %dil, %al
movl $0x2, %eax
cmovnel %ebx, %eax
testb %r11b, %r11b
cmovel %ebx, %eax
testb %r9b, %r9b
jne 0x288ce
xorl %eax, %eax
movq %rax, (%rsp)
movq %rax, 0x8(%rsp)
xorb $0x3f, %r8b
orb %r8b, %r10b
xorb $0x78, %cl
orb %r10b, %cl
xorb $0x6d, %dil
orb %cl, %dil
jne 0x28aab
movq %rsp, %rax
leaq 0x8(%rsp), %rcx
movq %rsi, %rdi
movq %rdx, %rsi
movq %rax, %rdx
callq 0x28ab5
testb %al, %al
je 0x28aab
movq 0x8(%rsp), %rax
cmpq $0x6, %rax
je 0x28a6c
cmpq $0xa, %rax
jne 0x28aab
movq (%rsp), %rcx
movb (%rcx), %al
andb $-0x21, %al
cmpb $0x49, %al
jne 0x28aab
movb 0x1(%rcx), %al
andb $-0x21, %al
cmpb $0x53, %al
jne 0x28aab
movb 0x2(%rcx), %al
andb $-0x21, %al
cmpb $0x4f, %al
jne 0x28aab
cmpb $0x2d, 0x3(%rcx)
jne 0x28aab
cmpb $0x38, 0x4(%rcx)
jne 0x28aab
cmpb $0x38, 0x5(%rcx)
jne 0x28aab
cmpb $0x35, 0x6(%rcx)
jne 0x28aab
cmpb $0x39, 0x7(%rcx)
jne 0x28aab
cmpb $0x2d, 0x8(%rcx)
jne 0x28aab
movl $0x9, %eax
cmpb $0x31, 0x9(%rcx)
je 0x288ce
jmp 0x28aab
movq (%rsp), %rcx
movb (%rcx), %al
andb $-0x21, %al
cmpb $0x4c, %al
jne 0x28aab
movb 0x1(%rcx), %al
andb $-0x21, %al
cmpb $0x41, %al
jne 0x28aab
movb 0x2(%rcx), %al
andb $-0x21, %al
cmpb $0x54, %al
jne 0x28aab
movb 0x3(%rcx), %al
andb $-0x21, %al
cmpb $0x49, %al
jne 0x28aab
movb 0x4(%rcx), %al
andb $-0x21, %al
cmpb $0x4e, %al
jne 0x28aab
movl $0x9, %eax
cmpb $0x31, 0x5(%rcx)
je 0x288ce
movl $0x1, %eax
jmp 0x288ce