// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
movl $0x2, %edx
callq 0x302b0
cmpl $0x2, %eax
je 0x46b21
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x46e10
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
addq $0x2, %rsi
movl $0x2, %edx
callq 0x302b0
cmpl $0x2, %eax
je 0x46b47
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x46e10
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
addq $0x4, %rsi
movl $0x1, %edx
callq 0x302b0
cmpl $0x1, %eax
je 0x46b6d
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x46e10
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
addq $0x5, %rsi
movl $0x1, %edx
callq 0x302b0
cmpl $0x1, %eax
je 0x46b93
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x46e10
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
addq $0x6, %rsi
movl $0x1, %edx
callq 0x302b0
cmpl $0x1, %eax
je 0x46bb9
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x46e10
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
addq $0x7, %rsi
movl $0x1, %edx
callq 0x302b0
cmpl $0x1, %eax
je 0x46bdf
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x46e10
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
addq $0x8, %rsi
movl $0x4, %edx
callq 0x302b0
cmpl $0x4, %eax
je 0x46c05
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x46e10
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
addq $0xc, %rsi
movl $0x2, %edx
callq 0x302b0
cmpl $0x2, %eax
je 0x46c2b
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x46e10
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
addq $0xe, %rsi
movl $0x2, %edx
callq 0x302b0
cmpl $0x2, %eax
je 0x46c51
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x46e10
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
addq $0x10, %rsi
movl $0x1, %edx
callq 0x302b0
cmpl $0x1, %eax
je 0x46c77
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x46e10
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
addq $0x11, %rsi
movl $0x1, %edx
callq 0x302b0
cmpl $0x1, %eax
je 0x46c9d
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x46e10
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
addq $0x12, %rsi
movl $0x1, %edx
callq 0x302b0
cmpl $0x1, %eax
je 0x46cc3
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x46e10
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
addq $0x13, %rsi
movl $0x1, %edx
callq 0x302b0
cmpl $0x1, %eax
je 0x46ce9
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x46e10
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
addq $0x14, %rsi
movl $0x4, %edx
callq 0x302b0
cmpl $0x4, %eax
je 0x46d0f
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x46e10
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
addq $0x18, %rsi
movl $0x2, %edx
callq 0x302b0
cmpl $0x2, %eax
je 0x46d35
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x46e10
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
addq $0x1a, %rsi
movl $0x2, %edx
callq 0x302b0
cmpl $0x2, %eax
je 0x46d5b
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x46e10
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
addq $0x1c, %rsi
movl $0x4, %edx
callq 0x302b0
cmpl $0x4, %eax
je 0x46d81
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x46e10
movq -0x10(%rbp), %rax
movw (%rax), %cx
movq -0x10(%rbp), %rax
movw %cx, (%rax)
movq -0x10(%rbp), %rax
movw 0x2(%rax), %cx
movq -0x10(%rbp), %rax
movw %cx, 0x2(%rax)
movq -0x10(%rbp), %rax
movl 0x8(%rax), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x10(%rbp), %rax
movw 0xc(%rax), %cx
movq -0x10(%rbp), %rax
movw %cx, 0xc(%rax)
movq -0x10(%rbp), %rax
movw 0xe(%rax), %cx
movq -0x10(%rbp), %rax
movw %cx, 0xe(%rax)
movq -0x10(%rbp), %rax
movl 0x14(%rax), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x14(%rax)
movq -0x10(%rbp), %rax
movw 0x18(%rax), %cx
movq -0x10(%rbp), %rax
movw %cx, 0x18(%rax)
movq -0x10(%rbp), %rax
movw 0x1a(%rax), %cx
movq -0x10(%rbp), %rax
movw %cx, 0x1a(%rax)
movq -0x10(%rbp), %rax
movl 0x1c(%rax), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x1c(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)