// File: /workspace/github_cpp_makefile_star2_O3/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 0x11479(%rip), %rdi     # 0x14320
movl 0x1146b(%rip), %esi     # 0x14318
movq 0x11114(%rip), %r15     # 0x13fc8
movq (%r15), %rdx
callq 0x2200
testq %rax, %rax
je 0x324f
leaq 0xc2b6(%rip), %rbx      # 0xf182
leaq 0xc2de(%rip), %r14      # 0xf1b1
movq 0x1148e(%rip), %r13     # 0x14368
incq %r13
movq %r13, 0x11484(%rip)     # 0x14368
movq 0x11435(%rip), %r12     # 0x14320
movl $0x8, %edx
movq %r12, %rdi
movq %rbx, %rsi
callq 0x2070
testl %eax, %eax
je 0x3059
movl $0xa, %edx
movq %r12, %rdi
movq %r14, %rsi
callq 0x2070
testl %eax, %eax
je 0x324f
movl $0x7, %edx
movq %r12, %rdi
leaq 0xc292(%rip), %rsi      # 0xf1bc
callq 0x2070
testl %eax, %eax
je 0x3071
movl $0x9, %edx
movq %r12, %rdi
leaq 0xc2b3(%rip), %rsi      # 0xf1f9
callq 0x2070
testl %eax, %eax
je 0x30b3
movl $0x5, %edx
movq %r12, %rdi
leaq 0xc2a1(%rip), %rsi      # 0xf203
callq 0x2070
testl %eax, %eax
je 0x30fd
movl $0x8, %edx
movq %r12, %rdi
leaq 0xc2b4(%rip), %rsi      # 0xf232
callq 0x2070
testl %eax, %eax
je 0x312f
movl $0x8, %edx
movq %r12, %rdi
leaq 0xc2c6(%rip), %rsi      # 0xf260
callq 0x2070
testl %eax, %eax
je 0x3183
movl $0xb, %edx
movq %r12, %rdi
leaq 0xc2d9(%rip), %rsi      # 0xf28f
callq 0x2070
testl %eax, %eax
je 0x31ea
movl 0x11286(%rip), %r14d    # 0x14250
testl %r14d, %r14d
je 0x3004
leaq 0x11292(%rip), %rbx     # 0x14268
movq -0x10(%rbx), %rsi
movslq -0x8(%rbx), %rbp
movq %r12, %rdi
movq %rbp, %rdx
callq 0x2070
testl %eax, %eax
jne 0x2ff8
cmpb $0x3d, (%r12,%rbp)
je 0x31d3
movl (%rbx), %r14d
addq $0x18, %rbx
testl %r14d, %r14d
jne 0x2fd6
movq 0x1130d(%rip), %rdx     # 0x14318
movq %r12, %rdi
movl $0x3d, %esi
callq 0x21d0
testq %rax, %rax
je 0x3273
movb $0x0, (%rax)
movq 0x10fcd(%rip), %rax     # 0x13ff8
movq (%rax), %rdi
movq 0x112cb(%rip), %rdx     # 0x14300
movq 0x112e4(%rip), %r8      # 0x14320
leaq 0xc2a1(%rip), %rsi      # 0xf2e4
movq %r13, %rcx
xorl %eax, %eax
callq 0x2240
movq 0x112cc(%rip), %r12     # 0x14320
jmp 0x31da
leaq 0x8(%r12), %rdi
callq 0x2380
cmpl $0x4, %eax
jl 0x3235
jmp 0x325e
leaq 0x7(%r12), %rbp
movl $0x5, %edx
movq %rbp, %rdi
leaq 0xc13f(%rip), %rsi      # 0xf1c4
callq 0x2070
testl %eax, %eax
je 0x3123
movl $0x9, %edx
movq %rbp, %rdi
leaq 0xc129(%rip), %rsi      # 0xf1ca
callq 0x2070
testl %eax, %eax
je 0x3235
jmp 0x3268
movq 0x1125e(%rip), %rdx     # 0x14318
movq %r12, %rdi
movl $0xa, %esi
callq 0x21d0
testq %rax, %rax
je 0x30cf
movb $0x0, (%rax)
movq 0x11232(%rip), %rdi     # 0x14308
testq %rdi, %rdi
je 0x30e0
callq 0x2030
movq 0x11239(%rip), %r12     # 0x14320
leaq 0x9(%r12), %rdi
callq 0x23f0
movq %rax, 0x11210(%rip)     # 0x14308
jmp 0x3235
leaq 0x5(%r12), %rbp
movl $0x5, %edx
movq %rbp, %rdi
leaq 0xc0f8(%rip), %rsi      # 0xf209
callq 0x2070
testl %eax, %eax
je 0x3235
jmp 0x327b
orb $0x1, 0x111e6(%rip)     # 0x14310
jmp 0x3235
movq 0x111e2(%rip), %rdx     # 0x14318
movq %r12, %rdi
movl $0xa, %esi
callq 0x21d0
testq %rax, %rax
je 0x3152
movb $0x0, (%rax)
movq 0x111ce(%rip), %r12     # 0x14320
addq $0x8, %r12
movq %r12, %rdi
leaq 0xc0db(%rip), %rsi      # 0xf23b
leaq 0x111c1(%rip), %rdx     # 0x14328
xorl %eax, %eax
callq 0x22a0
movq 0x111ab(%rip), %r12     # 0x14320
cmpl $0x1, %eax
je 0x3235
jmp 0x3286
movq 0x1118e(%rip), %rdx     # 0x14318
movq %r12, %rdi
movl $0xa, %esi
callq 0x21d0
testq %rax, %rax
je 0x31a6
movb $0x0, (%rax)
movq 0x1117a(%rip), %r12     # 0x14320
addq $0x8, %r12
movq %r12, %rdi
leaq 0xc0b5(%rip), %rsi      # 0xf269
leaq 0x11175(%rip), %rdx     # 0x14330
xorl %eax, %eax
callq 0x22a0
movq 0x11157(%rip), %r12     # 0x14320
cmpl $0x1, %eax
je 0x3235
jmp 0x328e
orl %r14d, 0x1118a(%rip)    # 0x14364
leaq 0xbfa1(%rip), %rbx      # 0xf182
leaq 0xbfc9(%rip), %r14      # 0xf1b1
jmp 0x3235
movq 0x11127(%rip), %rdx     # 0x14318
movq %r12, %rdi
movl $0xa, %esi
callq 0x21d0
testq %rax, %rax
je 0x320d
movb $0x0, (%rax)
movq 0x11113(%rip), %r12     # 0x14320
addq $0xb, %r12
movq %r12, %rdi
leaq 0xc080(%rip), %rsi      # 0xf29b
leaq 0x11126(%rip), %rdx     # 0x14348
xorl %eax, %eax
callq 0x22a0
movq 0x110f0(%rip), %r12     # 0x14320
cmpl $0x1, %eax
jne 0x3296
movl 0x110dd(%rip), %esi     # 0x14318
movq (%r15), %rdx
movq %r12, %rdi
callq 0x2200
testq %rax, %rax
jne 0x2ed3
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r13, %rdi
movl %eax, %esi
callq 0x2821
movq %r13, %rdi
movq %rbp, %rsi
callq 0x27f3
movq %r13, %rdi
callq 0x26f8
movq %r13, %rdi
movq %rbp, %rsi
callq 0x27c5
movq %r12, %rdi
callq 0x278f
movq %r12, %rdi
callq 0x2759
movq %r12, %rdi
callq 0x2723