// File: /workspace/github_cpp_makefile_star2_O2/jvanns[P]verbatim/sub/lmdb/libraries/liblmdb/mdb_load.c
// Function: readhdr
static void readhdr(void)
{
	char *ptr;

	while (fgets(dbuf.mv_data, dbuf.mv_size, stdin) != NULL) {
		lineno++;
		if (!strncmp(dbuf.mv_data, "VERSION=", STRLENOF("VERSION="))) {
			version=atoi((char *)dbuf.mv_data+STRLENOF("VERSION="));
			if (version > 3) {
				fprintf(stderr, "%s: line %" Z "d: unsupported VERSION %d\n",
					prog, lineno, version);
				exit(EXIT_FAILURE);
			}
		} else if (!strncmp(dbuf.mv_data, "HEADER=END", STRLENOF("HEADER=END"))) {
			break;
		} else if (!strncmp(dbuf.mv_data, "format=", STRLENOF("format="))) {
			if (!strncmp((char *)dbuf.mv_data+STRLENOF("FORMAT="), "print", STRLENOF("print")))
				mode |= PRINT;
			else if (strncmp((char *)dbuf.mv_data+STRLENOF("FORMAT="), "bytevalue", STRLENOF("bytevalue"))) {
				fprintf(stderr, "%s: line %" Z "d: unsupported FORMAT %s\n",
					prog, lineno, (char *)dbuf.mv_data+STRLENOF("FORMAT="));
				exit(EXIT_FAILURE);
			}
		} else if (!strncmp(dbuf.mv_data, "database=", STRLENOF("database="))) {
			ptr = memchr(dbuf.mv_data, '\n', dbuf.mv_size);
			if (ptr) *ptr = '\0';
			if (subname) free(subname);
			subname = strdup((char *)dbuf.mv_data+STRLENOF("database="));
		} else if (!strncmp(dbuf.mv_data, "type=", STRLENOF("type="))) {
			if (strncmp((char *)dbuf.mv_data+STRLENOF("type="), "btree", STRLENOF("btree")))  {
				fprintf(stderr, "%s: line %" Z "d: unsupported type %s\n",
					prog, lineno, (char *)dbuf.mv_data+STRLENOF("type="));
				exit(EXIT_FAILURE);
			}
		} else if (!strncmp(dbuf.mv_data, "mapaddr=", STRLENOF("mapaddr="))) {
			int i;
			ptr = memchr(dbuf.mv_data, '\n', dbuf.mv_size);
			if (ptr) *ptr = '\0';
			i = sscanf((char *)dbuf.mv_data+STRLENOF("mapaddr="), "%p", &info.me_mapaddr);
			if (i != 1) {
				fprintf(stderr, "%s: line %" Z "d: invalid mapaddr %s\n",
					prog, lineno, (char *)dbuf.mv_data+STRLENOF("mapaddr="));
				exit(EXIT_FAILURE);
			}
		} else if (!strncmp(dbuf.mv_data, "mapsize=", STRLENOF("mapsize="))) {
			int i;
			ptr = memchr(dbuf.mv_data, '\n', dbuf.mv_size);
			if (ptr) *ptr = '\0';
			i = sscanf((char *)dbuf.mv_data+STRLENOF("mapsize="), "%" Z "u", &info.me_mapsize);
			if (i != 1) {
				fprintf(stderr, "%s: line %" Z "d: invalid mapsize %s\n",
					prog, lineno, (char *)dbuf.mv_data+STRLENOF("mapsize="));
				exit(EXIT_FAILURE);
			}
		} else if (!strncmp(dbuf.mv_data, "maxreaders=", STRLENOF("maxreaders="))) {
			int i;
			ptr = memchr(dbuf.mv_data, '\n', dbuf.mv_size);
			if (ptr) *ptr = '\0';
			i = sscanf((char *)dbuf.mv_data+STRLENOF("maxreaders="), "%u", &info.me_maxreaders);
			if (i != 1) {
				fprintf(stderr, "%s: line %" Z "d: invalid maxreaders %s\n",
					prog, lineno, (char *)dbuf.mv_data+STRLENOF("maxreaders="));
				exit(EXIT_FAILURE);
			}
		} else {
			int i;
			for (i=0; dbflags[i].bit; i++) {
				if (!strncmp(dbuf.mv_data, dbflags[i].name, dbflags[i].len) &&
					((char *)dbuf.mv_data)[dbflags[i].len] == '=') {
					flags |= dbflags[i].bit;
					break;
				}
			}
			if (!dbflags[i].bit) {
				ptr = memchr(dbuf.mv_data, '=', dbuf.mv_size);
				if (!ptr) {
					fprintf(stderr, "%s: line %" Z "d: unexpected format\n",
						prog, lineno);
					exit(EXIT_FAILURE);
				} else {
					*ptr = '\0';
					fprintf(stderr, "%s: line %" Z "d: unrecognized keyword ignored: %s\n",
						prog, lineno, (char *)dbuf.mv_data);
				}
			}
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq 0x1054d(%rip), %rbx     # 0x12fc8
leaq 0xb700(%rip), %r15      # 0xe182
pushq $0x8
popq %r14
pushq $0x9
popq %r12
movq 0x1088f(%rip), %rdi     # 0x13320
movl 0x10881(%rip), %esi     # 0x13318
movq (%rbx), %rdx
callq 0x2200
testq %rax, %rax
je 0x2de5
movq 0x108b9(%rip), %rbp     # 0x13368
incq %rbp
movq %rbp, 0x108af(%rip)     # 0x13368
movq 0x10860(%rip), %r13     # 0x13320
movq %r13, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x2070
testl %eax, %eax
je 0x2be5
movq %r13, %rdi
leaq 0xb6d1(%rip), %rsi      # 0xe1b1
pushq $0xa
popq %rdx
callq 0x2070
testl %eax, %eax
je 0x2de5
movq %r13, %rdi
leaq 0xb6c2(%rip), %rsi      # 0xe1bc
pushq $0x7
popq %rdx
callq 0x2070
testl %eax, %eax
je 0x2bff
movq %r13, %rdi
leaq 0xb6e5(%rip), %rsi      # 0xe1f9
movq %r12, %rdx
callq 0x2070
testl %eax, %eax
je 0x2c3c
movq %r14, %r12
movq %r13, %rdi
leaq 0xb6d2(%rip), %rsi      # 0xe203
pushq $0x5
popq %r14
movq %r14, %rdx
callq 0x2070
testl %eax, %eax
je 0x2c7e
movq %r13, %rdi
leaq 0xb6e3(%rip), %rsi      # 0xe232
movq %r12, %r14
movq %r12, %rdx
callq 0x2070
testl %eax, %eax
je 0x2cb4
movq %r13, %rdi
leaq 0xb6f4(%rip), %rsi      # 0xe260
movq %r14, %rdx
callq 0x2070
testl %eax, %eax
pushq $0x9
popq %r12
je 0x2d03
movq %r13, %rdi
leaq 0xb705(%rip), %rsi      # 0xe28f
pushq $0xb
popq %rdx
callq 0x2070
testl %eax, %eax
jne 0x2d4e
movq 0x10777(%rip), %rdx     # 0x13318
movq %r13, %rdi
pushq $0xa
popq %rsi
callq 0x21d0
testq %rax, %rax
je 0x2bbb
movb $0x0, (%rax)
movq 0x10765(%rip), %r13     # 0x13320
addq $0xb, %r13
movq %r13, %rdi
leaq 0xb6d2(%rip), %rsi      # 0xe29b
leaq 0x10778(%rip), %rdx     # 0x13348
xorl %eax, %eax
callq 0x22a0
cmpl $0x1, %eax
je 0x2a8a
jmp 0x2ee1
addq $0x8, %r13
movq %r13, %rdi
callq 0x2390
cmpl $0x4, %eax
jl 0x2a8a
jmp 0x2df4
addq $0x7, %r13
movq %r13, %rdi
leaq 0xb5b7(%rip), %rsi      # 0xe1c4
pushq $0x5
popq %rdx
callq 0x2070
testl %eax, %eax
je 0x2ca8
movq %r13, %rdi
leaq 0xb5a3(%rip), %rsi      # 0xe1ca
movq %r12, %rdx
callq 0x2070
testl %eax, %eax
je 0x2a8a
jmp 0x2e1b
movq 0x106d5(%rip), %rdx     # 0x13318
movq %r13, %rdi
pushq $0xa
popq %rsi
callq 0x21d0
testq %rax, %rax
je 0x2c56
movb $0x0, (%rax)
movq 0x106ab(%rip), %rdi     # 0x13308
callq 0x2030
movq 0x106b7(%rip), %rdi     # 0x13320
addq $0x9, %rdi
callq 0x2400
movq %rax, 0x1068f(%rip)     # 0x13308
jmp 0x2a8a
addq $0x5, %r13
movq %r13, %rdi
leaq 0xb57d(%rip), %rsi      # 0xe209
movq %r14, %rdx
callq 0x2070
testl %eax, %eax
movq %r12, %r14
pushq $0x9
popq %r12
je 0x2a8a
jmp 0x2e35
orb $0x1, 0x10661(%rip)     # 0x13310
jmp 0x2a8a
movq 0x1065d(%rip), %rdx     # 0x13318
movq %r13, %rdi
pushq $0xa
popq %rsi
callq 0x21d0
testq %rax, %rax
pushq $0x9
popq %r12
je 0x2cd9
movb $0x0, (%rax)
movq 0x10647(%rip), %r13     # 0x13320
addq $0x8, %r13
movq %r13, %rdi
leaq 0xb554(%rip), %rsi      # 0xe23b
leaq 0x1063a(%rip), %rdx     # 0x13328
xorl %eax, %eax
callq 0x22a0
cmpl $0x1, %eax
je 0x2a8a
jmp 0x2e86
movq 0x1060e(%rip), %rdx     # 0x13318
movq %r13, %rdi
pushq $0xa
popq %rsi
callq 0x21d0
testq %rax, %rax
je 0x2d24
movb $0x0, (%rax)
movq 0x105fc(%rip), %r13     # 0x13320
addq $0x8, %r13
movq %r13, %rdi
leaq 0xb537(%rip), %rsi      # 0xe269
leaq 0x105f7(%rip), %rdx     # 0x13330
xorl %eax, %eax
callq 0x22a0
cmpl $0x1, %eax
je 0x2a8a
jmp 0x2eb2
leaq 0x1050b(%rip), %rbx     # 0x13260
movl -0x10(%rbx), %r12d
testl %r12d, %r12d
je 0x2d9c
movq -0x8(%rbx), %rsi
movslq (%rbx), %r15
movq %r13, %rdi
movq %r15, %rdx
callq 0x2070
testl %eax, %eax
jne 0x2d7c
cmpb $0x3d, (%r13,%r15)
je 0x2d82
addq $0x18, %rbx
jmp 0x2d55
orl %r12d, 0x105db(%rip)    # 0x13364
movq 0x10238(%rip), %rbx     # 0x12fc8
leaq 0xb3eb(%rip), %r15      # 0xe182
jmp 0x2a86
movq 0x10575(%rip), %rdx     # 0x13318
movq %r13, %rdi
pushq $0x3d
popq %rsi
callq 0x21d0
testq %rax, %rax
je 0x2e62
movb $0x0, (%rax)
movq 0x10237(%rip), %rax     # 0x12ff8
movq (%rax), %rdi
movq 0x10535(%rip), %rdx     # 0x13300
movq 0x1054e(%rip), %r8      # 0x13320
leaq 0xb50b(%rip), %rsi      # 0xe2e4
movq %rbp, %rcx
xorl %eax, %eax
callq 0x2240
jmp 0x2d89
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x101fd(%rip), %rcx     # 0x12ff8
movq (%rcx), %rdi
movq 0x104fb(%rip), %rdx     # 0x13300
leaq 0xb37f(%rip), %rsi      # 0xe18b
movq %rbp, %rcx
movl %eax, %r8d
xorl %eax, %eax
callq 0x2240
jmp 0x2e5a
movq 0x101d6(%rip), %rax     # 0x12ff8
movq (%rax), %rdi
movq 0x104d4(%rip), %rdx     # 0x13300
leaq 0xb3a1(%rip), %rsi      # 0xe1d4
jmp 0x2e4d
movq 0x101bc(%rip), %rax     # 0x12ff8
movq (%rax), %rdi
movq 0x104ba(%rip), %rdx     # 0x13300
leaq 0xb3c2(%rip), %rsi      # 0xe20f
movq %rbp, %rcx
movq %r13, %r8
xorl %eax, %eax
callq 0x2240
pushq $0x1
popq %rdi
callq 0x23c0
movq 0x1018f(%rip), %rax     # 0x12ff8
movq (%rax), %rdi
movq 0x1048d(%rip), %rdx     # 0x13300
leaq 0xb449(%rip), %rsi      # 0xe2c3
movq %rbp, %rcx
xorl %eax, %eax
callq 0x2240
jmp 0x2e5a
movq 0x1016b(%rip), %rax     # 0x12ff8
movq (%rax), %rdi
movq 0x10469(%rip), %rdx     # 0x13300
movq 0x104ca(%rip), %rcx     # 0x13368
movq 0x1047b(%rip), %r8      # 0x13320
addq $0x8, %r8
leaq 0xb38e(%rip), %rsi      # 0xe23e
jmp 0x2e53
movq 0x1013f(%rip), %rax     # 0x12ff8
movq (%rax), %rdi
movq 0x1043d(%rip), %rdx     # 0x13300
movq 0x1049e(%rip), %rcx     # 0x13368
movq 0x1044f(%rip), %r8      # 0x13320
addq $0x8, %r8
leaq 0xb391(%rip), %rsi      # 0xe26d
jmp 0x2e53
movq 0x10110(%rip), %rax     # 0x12ff8
movq (%rax), %rdi
movq 0x1040e(%rip), %rdx     # 0x13300
movq 0x1046f(%rip), %rcx     # 0x13368
movq 0x10420(%rip), %r8      # 0x13320
addq $0xb, %r8
leaq 0xb393(%rip), %rsi      # 0xe29e
jmp 0x2e53