// File: /workspace/github_c_makefile_star2_O3/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 0x36a72
movq 0x150(%rbx), %rdx
xorl %edi, %edi
movl $0x158, %esi            # imm = 0x158
callq 0x19430
movq %rax, 0x2a0(%rbx)
testq %rax, %rax
je 0x36c0f
movl 0x140(%rbx), %eax
testb $0x1, %al
jne 0x36add
testb $0x2, %al
jne 0x36aed
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x18df0
movq %r14, %rdi
callq 0x18180
movq 0x130(%rbx), %rdi
movl 0x8(%rax), %ecx
movl (%rax), %r9d
movl 0x4(%rax), %r8d
leaq 0x20e95(%rip), %rdx     # 0x57942
movl $0x10, %esi
xorl %eax, %eax
callq 0x18e10
movq 0x130(%rbx), %rax
cmpb $0x20, 0x3(%rax)
jne 0x36ad1
movb $0x30, 0x3(%rax)
movq 0x130(%rbx), %rax
cmpb $0x20, 0x6(%rax)
jne 0x36afb
movb $0x30, 0x6(%rax)
jmp 0x36afb
movq %rbx, %rdi
callq 0x36c19
incl 0x254(%rbx)
jmp 0x36afb
movq %rbx, %rdi
callq 0x36c19
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 0x36b37
cvtsi2ssl 0x254(%rbx), %xmm0
ucomiss 0x2f8(%rbx), %xmm0
ja 0x36b5b
testb $0x2, %al
je 0x36bf3
xorps %xmm0, %xmm0
cvtsi2ssl 0x254(%rbx), %xmm0
movss 0x2f8(%rbx), %xmm1
ucomiss %xmm0, %xmm1
jbe 0x36bf3
movq 0x170(%rbx), %rcx
testq %rcx, %rcx
je 0x36baa
movq 0x130(%rbx), %r14
movq 0x150(%rbx), %r15
movq %rcx, 0x150(%rbx)
movq $0x0, 0x130(%rbx)
movq 0x2b0(%rbx), %rsi
movq %rbx, %rdi
callq 0x198e0
movq %r15, 0x150(%rbx)
movq %r14, 0x130(%rbx)
movl 0x140(%rbx), %eax
testb $0x8, %al
je 0x36c0f
movq $0x0, 0x2b0(%rbx)
testb $0x1, %al
jne 0x36bd2
testb $0x2, %al
je 0x36bef
movl 0x290(%rbx), %ecx
movl %ecx, 0x254(%rbx)
xorps %xmm0, %xmm0
jmp 0x36be7
movl $0x0, 0x254(%rbx)
xorps %xmm0, %xmm0
cvtsi2ssl 0x290(%rbx), %xmm0
movss %xmm0, 0x2f8(%rbx)
testb $0x4, %al
jne 0x36c0f
movq 0x321a6(%rip), %rax     # 0x68da0
movss 0x4(%rax), %xmm0
addss 0x1c321(%rip), %xmm0    # 0x52f28
movss %xmm0, 0x200(%rbx)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq