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

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

	return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movl %edi, %ebp
movl $0x2, %edx
callq 0x201c2
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpl $0x2, %eax
jne 0x304da
leaq 0x2(%r14), %rsi
movl %ebp, %edi
movl $0x2, %edx
callq 0x201c2
cmpl $0x2, %eax
jne 0x304da
leaq 0x4(%r14), %rsi
movl %ebp, %edi
movl $0x1, %edx
callq 0x201c2
cmpl $0x1, %eax
jne 0x304da
leaq 0x5(%r14), %rsi
movl %ebp, %edi
movl $0x1, %edx
callq 0x201c2
cmpl $0x1, %eax
jne 0x304da
leaq 0x6(%r14), %rsi
movl %ebp, %edi
movl $0x1, %edx
callq 0x201c2
cmpl $0x1, %eax
jne 0x304da
leaq 0x7(%r14), %rsi
movl %ebp, %edi
movl $0x1, %edx
callq 0x201c2
cmpl $0x1, %eax
jne 0x304da
leaq 0x8(%r14), %rsi
movl %ebp, %edi
movl $0x4, %edx
callq 0x201c2
cmpl $0x4, %eax
jne 0x304da
leaq 0xc(%r14), %rsi
movl %ebp, %edi
movl $0x2, %edx
callq 0x201c2
cmpl $0x2, %eax
jne 0x304da
leaq 0xe(%r14), %rsi
movl %ebp, %edi
movl $0x2, %edx
callq 0x201c2
cmpl $0x2, %eax
jne 0x304da
leaq 0x10(%r14), %rsi
movl %ebp, %edi
movl $0x1, %edx
callq 0x201c2
cmpl $0x1, %eax
jne 0x304da
leaq 0x11(%r14), %rsi
movl %ebp, %edi
movl $0x1, %edx
callq 0x201c2
cmpl $0x1, %eax
jne 0x304da
leaq 0x12(%r14), %rsi
movl %ebp, %edi
movl $0x1, %edx
callq 0x201c2
cmpl $0x1, %eax
jne 0x304da
leaq 0x13(%r14), %rsi
movl %ebp, %edi
movl $0x1, %edx
callq 0x201c2
cmpl $0x1, %eax
jne 0x304da
leaq 0x14(%r14), %rsi
movl %ebp, %edi
movl $0x4, %edx
callq 0x201c2
cmpl $0x4, %eax
jne 0x304da
leaq 0x18(%r14), %rsi
movl %ebp, %edi
movl $0x2, %edx
callq 0x201c2
cmpl $0x2, %eax
jne 0x304da
leaq 0x1a(%r14), %rsi
movl %ebp, %edi
movl $0x2, %edx
callq 0x201c2
cmpl $0x2, %eax
jne 0x304da
addq $0x1c, %r14
movl %ebp, %edi
movq %r14, %rsi
movl $0x4, %edx
callq 0x201c2
xorl %ebx, %ebx
cmpl $0x4, %eax
setne %bl
negl %ebx
movl %ebx, %eax
popq %rbx
popq %r14
popq %rbp
retq