// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/g_misc.c
// Function: func_clock_think
void func_clock_think (edict_t *self)
{
	if (!self->enemy)
	{
		self->enemy = G_Find (NULL, FOFS(targetname), self->target);
		if (!self->enemy)
			return;
	}

	if (self->spawnflags & 1)
	{
		func_clock_format_countdown (self);
		self->health++;
	}
	else if (self->spawnflags & 2)
	{
		func_clock_format_countdown (self);
		self->health--;
	}
	else
	{
		struct tm	*ltime;
		time_t		gmtime;

		time(&gmtime);
		ltime = localtime(&gmtime);
		Com_sprintf (self->message, CLOCK_MESSAGE_SIZE, "%2i:%2i:%2i", ltime->tm_hour, ltime->tm_min, ltime->tm_sec);
		if (self->message[3] == ' ')
			self->message[3] = '0';
		if (self->message[6] == ' ')
			self->message[6] = '0';
	}

	self->enemy->message = self->message;
	self->enemy->use (self->enemy, self, self);

	if (((self->spawnflags & 1) && (self->health > self->wait)) ||
		((self->spawnflags & 2) && (self->health < self->wait)))
	{
		if (self->pathtarget)
		{
			char *savetarget;
			char *savemessage;

			savetarget = self->target;
			savemessage = self->message;
			self->target = self->pathtarget;
			self->message = NULL;
			G_UseTargets (self, self->activator);
			self->target = savetarget;
			self->message = savemessage;
		}

		if (!(self->spawnflags & 8))
			return;

		func_clock_reset (self);

		if (self->spawnflags & 4)
			return;
	}

	self->nextthink = level.time + 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
cmpq $0x0, 0x2a0(%rdi)
jne 0x33ce7
movq 0x150(%rbx), %rdx
xorl %edi, %edi
movl $0x158, %esi            # imm = 0x158
callq 0x195e0
movq %rax, 0x2a0(%rbx)
testq %rax, %rax
je 0x33e40
movl 0x140(%rbx), %eax
testb $0x1, %al
jne 0x33d50
testb $0x2, %al
jne 0x33d60
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x18f10
movq %r14, %rdi
callq 0x181a0
movq 0x130(%rbx), %rdi
movl 0x8(%rax), %ecx
movl (%rax), %r9d
movl 0x4(%rax), %r8d
leaq 0x1fc00(%rip), %rdx     # 0x53922
pushq $0x10
popq %rsi
xorl %eax, %eax
callq 0x18f30
movq 0x130(%rbx), %rax
cmpb $0x20, 0x3(%rax)
jne 0x33d44
movb $0x30, 0x3(%rax)
movq 0x130(%rbx), %rax
cmpb $0x20, 0x6(%rax)
jne 0x33d6e
movb $0x30, 0x6(%rax)
jmp 0x33d6e
movq %rbx, %rdi
callq 0x33e4a
incl 0x254(%rbx)
jmp 0x33d6e
movq %rbx, %rdi
callq 0x33e4a
decl 0x254(%rbx)
movq 0x130(%rbx), %rax
movq 0x2a0(%rbx), %rdi
movq %rax, 0x130(%rdi)
movq %rbx, %rsi
movq %rbx, %rdx
callq *0x228(%rdi)
movl 0x140(%rbx), %eax
testb $0x1, %al
je 0x33daa
cvtsi2ssl 0x254(%rbx), %xmm0
ucomiss 0x2f8(%rbx), %xmm0
ja 0x33dc3
testb $0x2, %al
je 0x33e24
cvtsi2ssl 0x254(%rbx), %xmm0
movss 0x2f8(%rbx), %xmm1
ucomiss %xmm0, %xmm1
jbe 0x33e24
movq 0x170(%rbx), %rcx
testq %rcx, %rcx
je 0x33e0f
movq 0x130(%rbx), %r14
movq 0x150(%rbx), %r15
movq %rcx, 0x150(%rbx)
andq $0x0, 0x130(%rbx)
movq 0x2b0(%rbx), %rsi
movq %rbx, %rdi
callq 0x19ac0
movq %r15, 0x150(%rbx)
movq %r14, 0x130(%rbx)
movl 0x140(%rbx), %eax
testb $0x8, %al
je 0x33e40
movq %rbx, %rdi
callq 0x33f31
testb $0x4, 0x140(%rbx)
jne 0x33e40
movq 0x32f75(%rip), %rax     # 0x66da0
movss 0x4(%rax), %xmm0
addss 0x1b0f0(%rip), %xmm0    # 0x4ef28
movss %xmm0, 0x200(%rbx)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq