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

	tl = B_LITTLE32(spr->x); if (Bwrite(fil, &tl, 4) != 4) return -1;
	tl = B_LITTLE32(spr->y); if (Bwrite(fil, &tl, 4) != 4) return -1;
	tl = B_LITTLE32(spr->z); if (Bwrite(fil, &tl, 4) != 4) return -1;
	ts = B_LITTLE16(spr->cstat); if (Bwrite(fil, &ts, 2) != 2) return -1;
	if (Bwrite(fil, &spr->shade, 1) != 1) return -1;
	if (Bwrite(fil, &spr->pal, 1) != 1) return -1;
	if (Bwrite(fil, &spr->clipdist, 1) != 1) return -1;
	if (Bwrite(fil, &spr->xrepeat, 1) != 1) return -1;
	if (Bwrite(fil, &spr->yrepeat, 1) != 1) return -1;
	if (Bwrite(fil, &spr->xoffset, 1) != 1) return -1;
	if (Bwrite(fil, &spr->yoffset, 1) != 1) return -1;
	ts = B_LITTLE16(spr->picnum); if (Bwrite(fil, &ts, 2) != 2) return -1;
	ts = B_LITTLE16(spr->ang); if (Bwrite(fil, &ts, 2) != 2) return -1;
	ts = B_LITTLE16(spr->xvel); if (Bwrite(fil, &ts, 2) != 2) return -1;
	ts = B_LITTLE16(spr->yvel); if (Bwrite(fil, &ts, 2) != 2) return -1;
	ts = B_LITTLE16(spr->zvel); if (Bwrite(fil, &ts, 2) != 2) return -1;
	ts = B_LITTLE16(spr->owner); if (Bwrite(fil, &ts, 2) != 2) return -1;
	ts = B_LITTLE16(spr->sectnum); if (Bwrite(fil, &ts, 2) != 2) return -1;
	ts = B_LITTLE16(spr->statnum); if (Bwrite(fil, &ts, 2) != 2) return -1;
	ts = B_LITTLE16(spr->lotag); if (Bwrite(fil, &ts, 2) != 2) return -1;
	ts = B_LITTLE16(spr->hitag); if (Bwrite(fil, &ts, 2) != 2) return -1;
	ts = B_LITTLE16(spr->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
movl (%rsi), %eax
leaq 0xc(%rsp), %rsi
movl %eax, (%rsi)
movl $0x4, %edx
callq 0x6af0
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpq $0x4, %rax
jne 0x3308b
movl 0x4(%r14), %eax
leaq 0xc(%rsp), %rsi
movl %eax, (%rsi)
movl $0x4, %edx
movl %ebp, %edi
callq 0x6af0
cmpq $0x4, %rax
jne 0x3308b
movl 0x8(%r14), %eax
leaq 0xc(%rsp), %rsi
movl %eax, (%rsi)
movl $0x4, %edx
movl %ebp, %edi
callq 0x6af0
cmpq $0x4, %rax
jne 0x3308b
movzwl 0xc(%r14), %eax
leaq 0xa(%rsp), %rsi
movw %ax, (%rsi)
movl $0x2, %edx
movl %ebp, %edi
callq 0x6af0
cmpq $0x2, %rax
jne 0x3308b
leaq 0xe(%r14), %rsi
movl $0x1, %edx
movl %ebp, %edi
callq 0x6af0
cmpq $0x1, %rax
jne 0x3308b
leaq 0xf(%r14), %rsi
movl $0x1, %edx
movl %ebp, %edi
callq 0x6af0
cmpq $0x1, %rax
jne 0x3308b
leaq 0x10(%r14), %rsi
movl $0x1, %edx
movl %ebp, %edi
callq 0x6af0
cmpq $0x1, %rax
jne 0x3308b
leaq 0x11(%r14), %rsi
movl $0x1, %edx
movl %ebp, %edi
callq 0x6af0
cmpq $0x1, %rax
jne 0x3308b
leaq 0x12(%r14), %rsi
movl $0x1, %edx
movl %ebp, %edi
callq 0x6af0
cmpq $0x1, %rax
jne 0x3308b
leaq 0x13(%r14), %rsi
movl $0x1, %edx
movl %ebp, %edi
callq 0x6af0
cmpq $0x1, %rax
jne 0x3308b
leaq 0x14(%r14), %rsi
movl $0x1, %edx
movl %ebp, %edi
callq 0x6af0
cmpq $0x1, %rax
jne 0x3308b
movzwl 0x16(%r14), %eax
leaq 0xa(%rsp), %rsi
movw %ax, (%rsi)
movl $0x2, %edx
movl %ebp, %edi
callq 0x6af0
cmpq $0x2, %rax
jne 0x3308b
movzwl 0x18(%r14), %eax
leaq 0xa(%rsp), %rsi
movw %ax, (%rsi)
movl $0x2, %edx
movl %ebp, %edi
callq 0x6af0
cmpq $0x2, %rax
jne 0x3308b
movzwl 0x1a(%r14), %eax
leaq 0xa(%rsp), %rsi
movw %ax, (%rsi)
movl $0x2, %edx
movl %ebp, %edi
callq 0x6af0
cmpq $0x2, %rax
jne 0x3308b
movzwl 0x1c(%r14), %eax
leaq 0xa(%rsp), %rsi
movw %ax, (%rsi)
movl $0x2, %edx
movl %ebp, %edi
callq 0x6af0
cmpq $0x2, %rax
jne 0x3308b
movzwl 0x1e(%r14), %eax
leaq 0xa(%rsp), %rsi
movw %ax, (%rsi)
movl $0x2, %edx
movl %ebp, %edi
callq 0x6af0
cmpq $0x2, %rax
jne 0x3308b
movzwl 0x20(%r14), %eax
leaq 0xa(%rsp), %rsi
movw %ax, (%rsi)
movl $0x2, %edx
movl %ebp, %edi
callq 0x6af0
cmpq $0x2, %rax
jne 0x3308b
movzwl 0x22(%r14), %eax
leaq 0xa(%rsp), %rsi
movw %ax, (%rsi)
movl $0x2, %edx
movl %ebp, %edi
callq 0x6af0
cmpq $0x2, %rax
jne 0x3308b
movzwl 0x24(%r14), %eax
leaq 0xa(%rsp), %rsi
movw %ax, (%rsi)
movl $0x2, %edx
movl %ebp, %edi
callq 0x6af0
cmpq $0x2, %rax
jne 0x3308b
movzwl 0x26(%r14), %eax
leaq 0xa(%rsp), %rsi
movw %ax, (%rsi)
movl $0x2, %edx
movl %ebp, %edi
callq 0x6af0
cmpq $0x2, %rax
jne 0x3308b
movzwl 0x28(%r14), %eax
leaq 0xa(%rsp), %rsi
movw %ax, (%rsi)
movl $0x2, %edx
movl %ebp, %edi
callq 0x6af0
cmpq $0x2, %rax
jne 0x3308b
movzwl 0x2a(%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