// File: /workspace/github_c_makefile_star2_O0/QwazyWabbitWOS[P]lmctf60/g_func.c
// Function: SP_func_door_secret
void SP_func_door_secret (edict_t *ent)
{
	vec3_t	forward, right, up;
	float	side;
	float	width;
	float	length;

	ent->moveinfo.sound_start = gi.soundindex  ("doors/dr1_strt.wav");
	ent->moveinfo.sound_middle = gi.soundindex  ("doors/dr1_mid.wav");
	ent->moveinfo.sound_end = gi.soundindex  ("doors/dr1_end.wav");

	ent->movetype = MOVETYPE_PUSH;
	ent->solid = SOLID_BSP;
	gi.setmodel (ent, ent->model);

	ent->blocked = door_secret_blocked;
	ent->use = door_secret_use;

	if (!(ent->targetname) || (ent->spawnflags & SECRET_ALWAYS_SHOOT))
	{
		ent->health = 0;
		ent->takedamage = DAMAGE_YES;
		ent->die = door_secret_die;
	}

	if (!ent->dmg)
		ent->dmg = 2;

	if (!ent->wait)
		ent->wait = 5;

	ent->moveinfo.accel =
	ent->moveinfo.decel =
	ent->moveinfo.speed = 50;

	// calculate positions
	AngleVectors (ent->s.angles, forward, right, up);
	VectorClear (ent->s.angles);
	side = 1.0 - (ent->spawnflags & SECRET_1ST_LEFT);
	if (ent->spawnflags & SECRET_1ST_DOWN)
		width = fabsf(DotProduct(up, ent->size));
	else
		width = fabsf(DotProduct(right, ent->size));
	length = fabsf(DotProduct(forward, ent->size));
	length = fabsf(DotProduct(forward, ent->size));
	if (ent->spawnflags & SECRET_1ST_DOWN)
		VectorMA (ent->s.origin, -1 * width, up, ent->pos1);
	else
		VectorMA (ent->s.origin, side * width, right, ent->pos1);
	VectorMA (ent->pos1, length, forward, ent->pos2);

	if (ent->health)
	{
		ent->takedamage = DAMAGE_YES;
		ent->die = door_killed;
		ent->max_health = ent->health;
	}
	else if (ent->targetname && ent->message)
	{
		gi.soundindex ("misc/talk.wav");
		ent->touch = door_touch;
	}
	
	ent->classname = "func_door";

	gi.linkentity (ent);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
leaq 0x39a93(%rip), %rdi     # 0x72c36
movq 0x49456(%rip), %rax     # 0x82600
callq *0x48(%rax)
movl %eax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x368(%rax)
leaq 0x39a89(%rip), %rdi     # 0x72c49
movq 0x49439(%rip), %rax     # 0x82600
callq *0x48(%rax)
movl %eax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x36c(%rax)
leaq 0x39a7e(%rip), %rdi     # 0x72c5b
movq 0x4941c(%rip), %rax     # 0x82600
callq *0x48(%rax)
movl %eax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x370(%rax)
movq -0x8(%rbp), %rax
movl $0x2, 0x118(%rax)
movq -0x8(%rbp), %rax
movl $0x3, 0x108(%rax)
movq 0x493ea(%rip), %rax     # 0x82600
movq 0x58(%rax), %rax
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rcx
movq 0x120(%rcx), %rsi
callq *%rax
movq -0x8(%rbp), %rax
movq 0x49ad2(%rip), %rcx     # 0x82d08
movq %rcx, 0x218(%rax)
movq -0x8(%rbp), %rax
movq 0x493e8(%rip), %rcx     # 0x82630
movq %rcx, 0x228(%rax)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x158(%rax)
je 0x3926f
movq -0x8(%rbp), %rax
movl 0x140(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x3929d
movq -0x8(%rbp), %rax
movl $0x0, 0x254(%rax)
movq -0x8(%rbp), %rax
movl $0x1, 0x27c(%rax)
movq -0x8(%rbp), %rax
movq 0x492da(%rip), %rcx     # 0x82570
movq %rcx, 0x238(%rax)
movq -0x8(%rbp), %rax
cmpl $0x0, 0x280(%rax)
jne 0x392b8
movq -0x8(%rbp), %rax
movl $0x2, 0x280(%rax)
movq -0x8(%rbp), %rax
movss 0x2f8(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x392e2
jp 0x392e2
movq -0x8(%rbp), %rax
movss 0x36c2e(%rip), %xmm0    # 0x6ff08
movss %xmm0, 0x2f8(%rax)
movq -0x8(%rbp), %rax
movss 0x39866(%rip), %xmm0    # 0x72b54
movss %xmm0, 0x378(%rax)
movq -0x8(%rbp), %rax
movss 0x39852(%rip), %xmm0    # 0x72b54
movss %xmm0, 0x37c(%rax)
movq -0x8(%rbp), %rax
movss 0x3983e(%rip), %xmm0    # 0x72b54
movss %xmm0, 0x374(%rax)
movq -0x8(%rbp), %rdi
addq $0x10, %rdi
leaq -0x14(%rbp), %rsi
leaq -0x20(%rbp), %rdx
leaq -0x2c(%rbp), %rcx
callq 0x183e0
movq -0x8(%rbp), %rax
xorps %xmm0, %xmm0
movss %xmm0, 0x18(%rax)
movq -0x8(%rbp), %rax
xorps %xmm0, %xmm0
movss %xmm0, 0x14(%rax)
movq -0x8(%rbp), %rax
xorps %xmm0, %xmm0
movss %xmm0, 0x10(%rax)
movq -0x8(%rbp), %rax
movl 0x140(%rax), %eax
andl $0x2, %eax
cvtsi2sd %eax, %xmm1
movsd 0x36bcc(%rip), %xmm0    # 0x6ff40
subsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x30(%rbp)
movq -0x8(%rbp), %rax
movl 0x140(%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x393e8
movss -0x2c(%rbp), %xmm1
movq -0x8(%rbp), %rax
movss 0xfc(%rax), %xmm2
movss -0x28(%rbp), %xmm0
movq -0x8(%rbp), %rax
mulss 0x100(%rax), %xmm0
mulss %xmm2, %xmm1
addss %xmm0, %xmm1
movss -0x24(%rbp), %xmm0
movq -0x8(%rbp), %rax
movss 0x104(%rax), %xmm2
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movaps 0x36b53(%rip), %xmm1    # 0x6ff30
pand %xmm1, %xmm0
movss %xmm0, -0x34(%rbp)
jmp 0x3943b
movss -0x20(%rbp), %xmm1
movq -0x8(%rbp), %rax
movss 0xfc(%rax), %xmm2
movss -0x1c(%rbp), %xmm0
movq -0x8(%rbp), %rax
mulss 0x100(%rax), %xmm0
mulss %xmm2, %xmm1
addss %xmm0, %xmm1
movss -0x18(%rbp), %xmm0
movq -0x8(%rbp), %rax
movss 0x104(%rax), %xmm2
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movaps 0x36afe(%rip), %xmm1    # 0x6ff30
pand %xmm1, %xmm0
movss %xmm0, -0x34(%rbp)
movss -0x14(%rbp), %xmm1
movq -0x8(%rbp), %rax
movss 0xfc(%rax), %xmm2
movss -0x10(%rbp), %xmm0
movq -0x8(%rbp), %rax
mulss 0x100(%rax), %xmm0
mulss %xmm2, %xmm1
addss %xmm0, %xmm1
movss -0xc(%rbp), %xmm0
movq -0x8(%rbp), %rax
movss 0x104(%rax), %xmm2
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movaps 0x36aab(%rip), %xmm1    # 0x6ff30
pand %xmm1, %xmm0
movss %xmm0, -0x38(%rbp)
movss -0x14(%rbp), %xmm1
movq -0x8(%rbp), %rax
movss 0xfc(%rax), %xmm2
movss -0x10(%rbp), %xmm0
movq -0x8(%rbp), %rax
mulss 0x100(%rax), %xmm0
mulss %xmm2, %xmm1
addss %xmm0, %xmm1
movss -0xc(%rbp), %xmm0
movq -0x8(%rbp), %rax
movss 0x104(%rax), %xmm2
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movaps 0x36a58(%rip), %xmm1    # 0x6ff30
pand %xmm1, %xmm0
movss %xmm0, -0x38(%rbp)
movq -0x8(%rbp), %rax
movl 0x140(%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x3951e
movq -0x8(%rbp), %rdi
addq $0x4, %rdi
movss 0x39685(%rip), %xmm0    # 0x72b88
mulss -0x34(%rbp), %xmm0
leaq -0x2c(%rbp), %rsi
movq -0x8(%rbp), %rdx
addq $0x1a8, %rdx            # imm = 0x1A8
callq 0x199c0
jmp 0x39544
movq -0x8(%rbp), %rdi
addq $0x4, %rdi
movss -0x30(%rbp), %xmm0
mulss -0x34(%rbp), %xmm0
leaq -0x20(%rbp), %rsi
movq -0x8(%rbp), %rdx
addq $0x1a8, %rdx            # imm = 0x1A8
callq 0x199c0
movq -0x8(%rbp), %rdi
addq $0x1a8, %rdi            # imm = 0x1A8
movss -0x38(%rbp), %xmm0
leaq -0x14(%rbp), %rsi
movq -0x8(%rbp), %rdx
addq $0x1b4, %rdx            # imm = 0x1B4
callq 0x199c0
movq -0x8(%rbp), %rax
cmpl $0x0, 0x254(%rax)
je 0x395ab
movq -0x8(%rbp), %rax
movl $0x1, 0x27c(%rax)
movq -0x8(%rbp), %rax
movq 0x48e4a(%rip), %rcx     # 0x823d8
movq %rcx, 0x238(%rax)
movq -0x8(%rbp), %rax
movl 0x254(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x258(%rax)
jmp 0x395ec
movq -0x8(%rbp), %rax
cmpq $0x0, 0x158(%rax)
je 0x395ea
movq -0x8(%rbp), %rax
cmpq $0x0, 0x130(%rax)
je 0x395ea
leaq 0x3969f(%rip), %rdi     # 0x72c6d
movq 0x4902b(%rip), %rax     # 0x82600
callq *0x48(%rax)
movq -0x8(%rbp), %rax
movq 0x49985(%rip), %rcx     # 0x82f68
movq %rcx, 0x220(%rax)
jmp 0x395ec
movq -0x8(%rbp), %rax
leaq 0x39613(%rip), %rcx     # 0x72c0a
movq %rcx, 0x138(%rax)
movq 0x48ffb(%rip), %rax     # 0x82600
movq 0x90(%rax), %rax
movq -0x8(%rbp), %rdi
callq *%rax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)