// File: /workspace/github_c_makefile_star2_O1/jonof[P]jftekwar/jfbuild/src/engine.c
// Function: writev6sect
static int writev6sect(int fil, struct sectortypev6 *sect)
{
	uint32_t tl;
	uint16_t ts;

	ts = B_LITTLE16(sect->wallptr); if (Bwrite(fil, &ts, 2) != 2) return -1;
	ts = B_LITTLE16(sect->wallnum); if (Bwrite(fil, &ts, 2) != 2) return -1;
	ts = B_LITTLE16(sect->ceilingpicnum); if (Bwrite(fil, &ts, 2) != 2) return -1;
	ts = B_LITTLE16(sect->floorpicnum); if (Bwrite(fil, &ts, 2) != 2) return -1;
	ts = B_LITTLE16(sect->ceilingheinum); if (Bwrite(fil, &ts, 2) != 2) return -1;
	ts = B_LITTLE16(sect->floorheinum); if (Bwrite(fil, &ts, 2) != 2) return -1;
	tl = B_LITTLE32(sect->ceilingz); if (Bwrite(fil, &tl, 4) != 4) return -1;
	tl = B_LITTLE32(sect->floorz); if (Bwrite(fil, &tl, 4) != 4) return -1;
	if (Bwrite(fil, &sect->ceilingshade, 1) != 1) return -1;
	if (Bwrite(fil, &sect->floorshade, 1) != 1) return -1;
	if (Bwrite(fil, &sect->ceilingxpanning, 1) != 1) return -1;
	if (Bwrite(fil, &sect->floorxpanning, 1) != 1) return -1;
	if (Bwrite(fil, &sect->ceilingypanning, 1) != 1) return -1;
	if (Bwrite(fil, &sect->floorypanning, 1) != 1) return -1;
	if (Bwrite(fil, &sect->ceilingstat, 1) != 1) return -1;
	if (Bwrite(fil, &sect->floorstat, 1) != 1) return -1;
	if (Bwrite(fil, &sect->ceilingpal, 1) != 1) return -1;
	if (Bwrite(fil, &sect->floorpal, 1) != 1) return -1;
	if (Bwrite(fil, &sect->visibility, 1) != 1) return -1;
	ts = B_LITTLE16(sect->lotag); if (Bwrite(fil, &ts, 2) != 2) return -1;
	ts = B_LITTLE16(sect->hitag); if (Bwrite(fil, &ts, 2) != 2) return -1;
	ts = B_LITTLE16(sect->extra); if (Bwrite(fil, &ts, 2) != 2) return -1;

	return 0;
}

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