// File: /workspace/github_cpp_makefile_star2_O1/jvanns[P]verbatim/sub/lmdb/libraries/liblmdb/mdb_load.c
// Function: readline
static int readline(MDB_val *out, MDB_val *buf)
{
	unsigned char *c1, *c2, *end;
	size_t len, l2;
	int c;

	if (!(mode & NOHDR)) {
		c = fgetc(stdin);
		if (c == EOF) {
			Eof = 1;
			return EOF;
		}
		if (c != ' ') {
			lineno++;
			if (fgets(buf->mv_data, buf->mv_size, stdin) == NULL) {
badend:
				Eof = 1;
				badend();
				return EOF;
			}
			if (c == 'D' && !strncmp(buf->mv_data, "ATA=END", STRLENOF("ATA=END")))
				return EOF;
			goto badend;
		}
	}
	if (fgets(buf->mv_data, buf->mv_size, stdin) == NULL) {
		Eof = 1;
		return EOF;
	}
	lineno++;

	c1 = buf->mv_data;
	len = strlen((char *)c1);
	l2 = len;

	/* Is buffer too short? */
	while (c1[len-1] != '\n') {
		buf->mv_data = realloc(buf->mv_data, buf->mv_size*2);
		if (!buf->mv_data) {
			Eof = 1;
			fprintf(stderr, "%s: line %" Z "d: out of memory, line too long\n",
				prog, lineno);
			return EOF;
		}
		c1 = buf->mv_data;
		c1 += l2;
		if (fgets((char *)c1, buf->mv_size+1, stdin) == NULL) {
			Eof = 1;
			badend();
			return EOF;
		}
		buf->mv_size *= 2;
		len = strlen((char *)c1);
		l2 += len;
	}
	c1 = c2 = buf->mv_data;
	len = l2;
	c1[--len] = '\0';
	end = c1 + len;

	if (mode & PRINT) {
		while (c2 < end) {
			if (*c2 == '\\') {
				if (c2[1] == '\\') {
					c1++; c2 += 2;
				} else {
					if (c2+3 > end || !isxdigit(c2[1]) || !isxdigit(c2[2])) {
						Eof = 1;
						badend();
						return EOF;
					}
					*c1++ = unhex(++c2);
					c2 += 2;
				}
			} else {
				c1++; c2++;
			}
		}
	} else {
		/* odd length not allowed */
		if (len & 1) {
			Eof = 1;
			badend();
			return EOF;
		}
		while (c2 < end) {
			if (!isxdigit(*c2) || !isxdigit(c2[1])) {
				Eof = 1;
				badend();
				return EOF;
			}
			*c1++ = unhex(c2);
			c2 += 2;
		}
	}
	c2 = out->mv_data = buf->mv_data;
	out->mv_size = c1 - c2;

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r15
testb $0x2, 0x11056(%rip)     # 0x14310
jne 0x3328
movq 0x10d05(%rip), %r14     # 0x13fc8
movq (%r14), %rdi
callq 0x21a0
cmpl $0x20, %eax
je 0x3328
movl %eax, %ebp
cmpl $-0x1, %eax
je 0x33b0
incq 0x11086(%rip)           # 0x14368
movq 0x8(%rbx), %rdi
movl (%rbx), %esi
movq (%r14), %rdx
callq 0x2200
cmpl $0x44, %ebp
jne 0x331e
testq %rax, %rax
je 0x331e
movq 0x8(%rbx), %rdi
leaq 0xc00f(%rip), %rsi      # 0xf314
movl $0x7, %edx
callq 0x2070
movl %eax, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testl %ecx, %ecx
je 0x3512
callq 0x299b
jmp 0x33b7
movq 0x8(%rbx), %rdi
movl (%rbx), %esi
movq 0x10c93(%rip), %r13     # 0x13fc8
movq (%r13), %rdx
callq 0x2200
testq %rax, %rax
je 0x33b0
movq %r15, (%rsp)
incq 0x1101a(%rip)           # 0x14368
movq 0x8(%rbx), %r12
movq %r12, %rdi
callq 0x2110
movq %rax, %r15
cmpb $0xa, -0x1(%r12,%rax)
je 0x33c1
movq (%rbx), %rsi
movq 0x8(%rbx), %rdi
addq %rsi, %rsi
callq 0x22b0
movq %rax, 0x8(%rbx)
testq %rax, %rax
je 0x352b
movq %rax, %r12
addq %r15, %r12
movl (%rbx), %esi
incl %esi
movq (%r13), %rdx
movq %r12, %rdi
callq 0x2200
testq %rax, %rax
je 0x3535
shlq (%rbx)
movq %r12, %rdi
callq 0x2110
addq %rax, %r15
jmp 0x335d
movb $0x1, 0x10fa9(%rip)     # 0x14360
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x3512
movq 0x8(%rbx), %r12
leaq (%r12,%r15), %r13
decq %r13
decq %r15
movb $0x0, (%r13)
testb $0x1, 0x10f35(%rip)     # 0x14310
jne 0x3463
testb $0x1, %r15b
jne 0x353f
testq %r15, %r15
jle 0x34fe
xorl %r15d, %r15d
callq 0x2460
movq (%rax), %rdi
movzbl (%r12,%r15,2), %edx
testb $0x10, 0x1(%rdi,%rdx,2)
je 0x3521
leaq (%r12,%r15,2), %rcx
movzbl 0x1(%rcx), %esi
testb $0x10, 0x1(%rdi,%rsi,2)
je 0x3521
andl $0x4f, %edx
andl $0x4f, %esi
leal 0xc9(%rsi), %edi
cmpb $0x40, %sil
cmovbl %esi, %edi
movl %edx, %esi
shll $0x4, %esi
leal 0x90(%rsi), %r8d
cmpb $0x40, %dl
cmovbl %esi, %r8d
orl %edi, %r8d
movb %r8b, (%r12,%r15)
incq %r15
addq $0x2, %rcx
cmpq %r13, %rcx
jb 0x33fc
addq %r15, %r12
jmp 0x34fe
testq %r15, %r15
jle 0x34fe
movq %r12, %rbp
leaq 0x1(%rbp), %r15
cmpb $0x5c, (%rbp)
jne 0x34ef
movzbl (%r15), %r14d
cmpq $0x5c, %r14
jne 0x348c
addq $0x2, %rbp
movq %rbp, %r15
jmp 0x34ef
leaq 0x3(%rbp), %r15
cmpq %r13, %r15
ja 0x3549
callq 0x2460
movq (%rax), %rax
testb $0x10, 0x1(%rax,%r14,2)
je 0x3549
movzbl 0x2(%rbp), %ecx
testb $0x10, 0x1(%rax,%rcx,2)
je 0x3549
movl %r14d, %eax
andb $0x4f, %al
andl $0x4f, %r14d
movzbl 0x2(%rbp), %ecx
andl $0x4f, %ecx
leal 0xc9(%rcx), %edx
cmpb $0x40, %cl
cmovbl %ecx, %edx
shll $0x4, %r14d
leal 0x90(%r14), %ecx
cmpb $0x40, %al
cmovbl %r14d, %ecx
orl %edx, %ecx
movb %cl, (%r12)
incq %r12
movq %r15, %rbp
cmpq %r13, %r15
jb 0x346f
movq 0x8(%rbx), %rax
movq (%rsp), %rcx
movq %rax, 0x8(%rcx)
subq %rax, %r12
movq %r12, (%rcx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x296e
jmp 0x33b7
callq 0x28e7
jmp 0x33b7
callq 0x28ba
jmp 0x33b7
callq 0x2941
jmp 0x33b7
callq 0x2914
jmp 0x33b7
nop