// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/jfbuild/src/engine.c
// Function: readv5sect
static int readv5sect(int fil, struct sectortypev5 *sect)
{
	if (kread(fil, &sect->wallptr, 2) != 2) return -1;
	if (kread(fil, &sect->wallnum, 2) != 2) return -1;
	if (kread(fil, &sect->ceilingpicnum, 2) != 2) return -1;
	if (kread(fil, &sect->floorpicnum, 2) != 2) return -1;
	if (kread(fil, &sect->ceilingheinum, 2) != 2) return -1;
	if (kread(fil, &sect->floorheinum, 2) != 2) return -1;
	if (kread(fil, &sect->ceilingz, 4) != 4) return -1;
	if (kread(fil, &sect->floorz, 4) != 4) return -1;
	if (kread(fil, &sect->ceilingshade, 1) != 1) return -1;
	if (kread(fil, &sect->floorshade, 1) != 1) return -1;
	if (kread(fil, &sect->ceilingxpanning, 1) != 1) return -1;
	if (kread(fil, &sect->floorxpanning, 1) != 1) return -1;
	if (kread(fil, &sect->ceilingypanning, 1) != 1) return -1;
	if (kread(fil, &sect->floorypanning, 1) != 1) return -1;
	if (kread(fil, &sect->ceilingstat, 1) != 1) return -1;
	if (kread(fil, &sect->floorstat, 1) != 1) return -1;
	if (kread(fil, &sect->ceilingpal, 1) != 1) return -1;
	if (kread(fil, &sect->floorpal, 1) != 1) return -1;
	if (kread(fil, &sect->visibility, 1) != 1) return -1;
	if (kread(fil, &sect->lotag, 2) != 2) return -1;
	if (kread(fil, &sect->hitag, 2) != 2) return -1;
	if (kread(fil, &sect->extra, 2) != 2) return -1;

	sect->wallptr = B_LITTLE16(sect->wallptr);
	sect->wallnum = B_LITTLE16(sect->wallnum);
	sect->ceilingpicnum = B_LITTLE16(sect->ceilingpicnum);
	sect->floorpicnum = B_LITTLE16(sect->floorpicnum);
	sect->ceilingheinum = B_LITTLE16(sect->ceilingheinum);
	sect->floorheinum = B_LITTLE16(sect->floorheinum);
	sect->ceilingz = B_LITTLE32(sect->ceilingz);
	sect->floorz = B_LITTLE32(sect->floorz);
	sect->lotag = B_LITTLE16(sect->lotag);
	sect->hitag = B_LITTLE16(sect->hitag);
	sect->extra = B_LITTLE16(sect->extra);

	return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movl %edi, %ebp
movl $0x2, %edx
callq 0x20684
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpl $0x2, %eax
jne 0x31329
leaq 0x2(%r14), %rsi
movl %ebp, %edi
movl $0x2, %edx
callq 0x20684
cmpl $0x2, %eax
jne 0x31329
leaq 0x4(%r14), %rsi
movl %ebp, %edi
movl $0x2, %edx
callq 0x20684
cmpl $0x2, %eax
jne 0x31329
leaq 0x6(%r14), %rsi
movl %ebp, %edi
movl $0x2, %edx
callq 0x20684
cmpl $0x2, %eax
jne 0x31329
leaq 0x8(%r14), %rsi
movl %ebp, %edi
movl $0x2, %edx
callq 0x20684
cmpl $0x2, %eax
jne 0x31329
leaq 0xa(%r14), %rsi
movl %ebp, %edi
movl $0x2, %edx
callq 0x20684
cmpl $0x2, %eax
jne 0x31329
leaq 0xc(%r14), %rsi
movl %ebp, %edi
movl $0x4, %edx
callq 0x20684
cmpl $0x4, %eax
jne 0x31329
leaq 0x10(%r14), %rsi
movl %ebp, %edi
movl $0x4, %edx
callq 0x20684
cmpl $0x4, %eax
jne 0x31329
leaq 0x14(%r14), %rsi
movl %ebp, %edi
movl $0x1, %edx
callq 0x20684
cmpl $0x1, %eax
jne 0x31329
leaq 0x15(%r14), %rsi
movl %ebp, %edi
movl $0x1, %edx
callq 0x20684
cmpl $0x1, %eax
jne 0x31329
leaq 0x16(%r14), %rsi
movl %ebp, %edi
movl $0x1, %edx
callq 0x20684
cmpl $0x1, %eax
jne 0x31329
leaq 0x17(%r14), %rsi
movl %ebp, %edi
movl $0x1, %edx
callq 0x20684
cmpl $0x1, %eax
jne 0x31329
leaq 0x18(%r14), %rsi
movl %ebp, %edi
movl $0x1, %edx
callq 0x20684
cmpl $0x1, %eax
jne 0x31329
leaq 0x19(%r14), %rsi
movl %ebp, %edi
movl $0x1, %edx
callq 0x20684
cmpl $0x1, %eax
jne 0x31329
leaq 0x1a(%r14), %rsi
movl %ebp, %edi
movl $0x1, %edx
callq 0x20684
cmpl $0x1, %eax
jne 0x31329
leaq 0x1b(%r14), %rsi
movl %ebp, %edi
movl $0x1, %edx
callq 0x20684
cmpl $0x1, %eax
jne 0x31329
leaq 0x1c(%r14), %rsi
movl %ebp, %edi
movl $0x1, %edx
callq 0x20684
cmpl $0x1, %eax
jne 0x31329
leaq 0x1d(%r14), %rsi
movl %ebp, %edi
movl $0x1, %edx
callq 0x20684
cmpl $0x1, %eax
jne 0x31329
leaq 0x1e(%r14), %rsi
movl %ebp, %edi
movl $0x1, %edx
callq 0x20684
cmpl $0x1, %eax
jne 0x31329
leaq 0x20(%r14), %rsi
movl %ebp, %edi
movl $0x2, %edx
callq 0x20684
cmpl $0x2, %eax
jne 0x31329
leaq 0x22(%r14), %rsi
movl %ebp, %edi
movl $0x2, %edx
callq 0x20684
cmpl $0x2, %eax
jne 0x31329
addq $0x24, %r14
movl %ebp, %edi
movq %r14, %rsi
movl $0x2, %edx
callq 0x20684
xorl %ebx, %ebx
cmpl $0x2, %eax
setne %bl
negl %ebx
movl %ebx, %eax
popq %rbx
popq %r14
popq %rbp
retq