// File: /workspace/github_c_makefile_star2_O1/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 0x3728f
movq 0x150(%rbx), %rdx
xorl %edi, %edi
movl $0x158, %esi            # imm = 0x158
callq 0x19430
movq %rax, 0x2a0(%rbx)
testq %rax, %rax
je 0x3742c
movl 0x140(%rbx), %eax
testb $0x1, %al
jne 0x372fa
testb $0x2, %al
jne 0x3730a
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 0x21468(%rip), %rdx     # 0x58732
movl $0x10, %esi
xorl %eax, %eax
callq 0x18e10
movq 0x130(%rbx), %rax
cmpb $0x20, 0x3(%rax)
jne 0x372e7
movb $0x30, 0x3(%rax)
movq 0x130(%rbx), %rax
cmpb $0x20, 0x6(%rax)
jne 0x37318
movb $0x30, 0x6(%rax)
jmp 0x37318
movq %rbx, %rdi
callq 0x37436
incl 0x254(%rbx)
jmp 0x37318
movq %rbx, %rdi
callq 0x37436
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 0x37354
cvtsi2ssl 0x254(%rbx), %xmm0
ucomiss 0x2f8(%rbx), %xmm0
ja 0x37378
testb $0x2, %al
je 0x37410
xorps %xmm0, %xmm0
cvtsi2ssl 0x254(%rbx), %xmm0
movss 0x2f8(%rbx), %xmm1
ucomiss %xmm0, %xmm1
jbe 0x37410
movq 0x170(%rbx), %rax
testq %rax, %rax
je 0x373c1
movq 0x130(%rbx), %r14
movq 0x150(%rbx), %r15
movq %rax, 0x150(%rbx)
movq $0x0, 0x130(%rbx)
movq 0x2b0(%rbx), %rsi
movq %rbx, %rdi
callq 0x198f0
movq %r15, 0x150(%rbx)
movq %r14, 0x130(%rbx)
movl 0x140(%rbx), %eax
testb $0x8, %al
je 0x3742c
movq $0x0, 0x2b0(%rbx)
testb $0x1, %al
jne 0x373ef
testb $0x2, %al
je 0x3740c
movl 0x290(%rbx), %ecx
movl %ecx, 0x254(%rbx)
xorps %xmm0, %xmm0
jmp 0x37404
movl $0x0, 0x254(%rbx)
xorps %xmm0, %xmm0
cvtsi2ssl 0x290(%rbx), %xmm0
movss %xmm0, 0x2f8(%rbx)
testb $0x4, %al
jne 0x3742c
movq 0x32989(%rip), %rax     # 0x69da0
movss 0x4(%rax), %xmm0
addss 0x1cb04(%rip), %xmm0    # 0x53f28
movss %xmm0, 0x200(%rbx)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq