// File: /workspace/github_c_makefile_star2_O0/asford[P]tmalign/./TMalign.h
// Function: smooth(int*, int)
void smooth(int *sec, int len)
{
	int i, j;
	//smooth single  --x-- => -----
	for(i=2; i<len-2; i++)
	{
		if(sec[i]==2 || sec[i]==4)
		{
			j=sec[i];
			if(sec[i-2] != j)
			{
				if(sec[i-1] != j)
				{
					if(sec[i+1] != j)
					{
						if(sec[i+2] != j) 
						{
							sec[i]=1;
						}
					}
				}
			}
		}
	}

	//   smooth double 
	//   --xx-- => ------

	for(i=0; i<len-5; i++)
	{
		//helix
		if(sec[i] != 2)
		{
			if(sec[i+1] != 2)
			{
				if(sec[i+2] == 2)
				{
					if(sec[i+3] == 2)
					{
						if(sec[i+4] != 2)
						{
							if(sec[i+5] != 2)
							{
								sec[i+2]=1;
								sec[i+3]=1;
							}
						}
					}
				}
			}
		}

		//beta
		if(sec[i] != 4)
		{
			if(sec[i+1] != 4)
			{
				if(sec[i+2] ==4)
				{
					if(sec[i+3] == 4)
					{
						if(sec[i+4] != 4)
						{
							if(sec[i+5] != 4)
							{
								sec[i+2]=1;
								sec[i+3]=1;
							}
						}
					}
				}
			}
		}
	}

	//smooth connect
	for(i=0; i<len-2; i++)
	{		
		if(sec[i] == 2)
		{
			if(sec[i+1] != 2)
			{
				if(sec[i+2] == 2)
				{
					sec[i+1]=2;
				}
			}
		}
		else if(sec[i] == 4)
		{
			if(sec[i+1] != 4)
			{
				if(sec[i+2] == 4)
				{
					sec[i+1]=4;
				}
			}
		}
	}

}

// Assembly:
movq %rdi, -0x8(%rsp)
movl %esi, -0xc(%rsp)
movl $0x2, -0x10(%rsp)
movl -0x10(%rsp), %eax
movl -0xc(%rsp), %ecx
subl $0x2, %ecx
cmpl %ecx, %eax
jge 0x40ada4
movq -0x8(%rsp), %rax
movslq -0x10(%rsp), %rcx
cmpl $0x2, (%rax,%rcx,4)
je 0x40ad08
movq -0x8(%rsp), %rax
movslq -0x10(%rsp), %rcx
cmpl $0x4, (%rax,%rcx,4)
jne 0x40ad92
movq -0x8(%rsp), %rax
movslq -0x10(%rsp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x14(%rsp)
movq -0x8(%rsp), %rax
movl -0x10(%rsp), %ecx
subl $0x2, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
cmpl -0x14(%rsp), %eax
je 0x40ad90
movq -0x8(%rsp), %rax
movl -0x10(%rsp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
cmpl -0x14(%rsp), %eax
je 0x40ad8e
movq -0x8(%rsp), %rax
movl -0x10(%rsp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
cmpl -0x14(%rsp), %eax
je 0x40ad8c
movq -0x8(%rsp), %rax
movl -0x10(%rsp), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
cmpl -0x14(%rsp), %eax
je 0x40ad8a
movq -0x8(%rsp), %rax
movslq -0x10(%rsp), %rcx
movl $0x1, (%rax,%rcx,4)
jmp 0x40ad8c
jmp 0x40ad8e
jmp 0x40ad90
jmp 0x40ad92
jmp 0x40ad94
movl -0x10(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rsp)
jmp 0x40acd1
movl $0x0, -0x10(%rsp)
movl -0x10(%rsp), %eax
movl -0xc(%rsp), %ecx
subl $0x5, %ecx
cmpl %ecx, %eax
jge 0x40af3f
movq -0x8(%rsp), %rax
movslq -0x10(%rsp), %rcx
cmpl $0x2, (%rax,%rcx,4)
je 0x40ae76
movq -0x8(%rsp), %rax
movl -0x10(%rsp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
cmpl $0x2, (%rax,%rcx,4)
je 0x40ae74
movq -0x8(%rsp), %rax
movl -0x10(%rsp), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
cmpl $0x2, (%rax,%rcx,4)
jne 0x40ae72
movq -0x8(%rsp), %rax
movl -0x10(%rsp), %ecx
addl $0x3, %ecx
movslq %ecx, %rcx
cmpl $0x2, (%rax,%rcx,4)
jne 0x40ae70
movq -0x8(%rsp), %rax
movl -0x10(%rsp), %ecx
addl $0x4, %ecx
movslq %ecx, %rcx
cmpl $0x2, (%rax,%rcx,4)
je 0x40ae6e
movq -0x8(%rsp), %rax
movl -0x10(%rsp), %ecx
addl $0x5, %ecx
movslq %ecx, %rcx
cmpl $0x2, (%rax,%rcx,4)
je 0x40ae6c
movq -0x8(%rsp), %rax
movl -0x10(%rsp), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movl $0x1, (%rax,%rcx,4)
movq -0x8(%rsp), %rax
movl -0x10(%rsp), %ecx
addl $0x3, %ecx
movslq %ecx, %rcx
movl $0x1, (%rax,%rcx,4)
jmp 0x40ae6e
jmp 0x40ae70
jmp 0x40ae72
jmp 0x40ae74
jmp 0x40ae76
movq -0x8(%rsp), %rax
movslq -0x10(%rsp), %rcx
cmpl $0x4, (%rax,%rcx,4)
je 0x40af2d
movq -0x8(%rsp), %rax
movl -0x10(%rsp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
cmpl $0x4, (%rax,%rcx,4)
je 0x40af2b
movq -0x8(%rsp), %rax
movl -0x10(%rsp), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
cmpl $0x4, (%rax,%rcx,4)
jne 0x40af29
movq -0x8(%rsp), %rax
movl -0x10(%rsp), %ecx
addl $0x3, %ecx
movslq %ecx, %rcx
cmpl $0x4, (%rax,%rcx,4)
jne 0x40af27
movq -0x8(%rsp), %rax
movl -0x10(%rsp), %ecx
addl $0x4, %ecx
movslq %ecx, %rcx
cmpl $0x4, (%rax,%rcx,4)
je 0x40af25
movq -0x8(%rsp), %rax
movl -0x10(%rsp), %ecx
addl $0x5, %ecx
movslq %ecx, %rcx
cmpl $0x4, (%rax,%rcx,4)
je 0x40af23
movq -0x8(%rsp), %rax
movl -0x10(%rsp), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movl $0x1, (%rax,%rcx,4)
movq -0x8(%rsp), %rax
movl -0x10(%rsp), %ecx
addl $0x3, %ecx
movslq %ecx, %rcx
movl $0x1, (%rax,%rcx,4)
jmp 0x40af25
jmp 0x40af27
jmp 0x40af29
jmp 0x40af2b
jmp 0x40af2d
jmp 0x40af2f
movl -0x10(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rsp)
jmp 0x40adac
movl $0x0, -0x10(%rsp)
movl -0x10(%rsp), %eax
movl -0xc(%rsp), %ecx
subl $0x2, %ecx
cmpl %ecx, %eax
jge 0x40b016
movq -0x8(%rsp), %rax
movslq -0x10(%rsp), %rcx
cmpl $0x2, (%rax,%rcx,4)
jne 0x40afae
movq -0x8(%rsp), %rax
movl -0x10(%rsp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
cmpl $0x2, (%rax,%rcx,4)
je 0x40afac
movq -0x8(%rsp), %rax
movl -0x10(%rsp), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
cmpl $0x2, (%rax,%rcx,4)
jne 0x40afaa
movq -0x8(%rsp), %rax
movl -0x10(%rsp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movl $0x2, (%rax,%rcx,4)
jmp 0x40afac
jmp 0x40b004
movq -0x8(%rsp), %rax
movslq -0x10(%rsp), %rcx
cmpl $0x4, (%rax,%rcx,4)
jne 0x40b002
movq -0x8(%rsp), %rax
movl -0x10(%rsp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
cmpl $0x4, (%rax,%rcx,4)
je 0x40b000
movq -0x8(%rsp), %rax
movl -0x10(%rsp), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
cmpl $0x4, (%rax,%rcx,4)
jne 0x40affe
movq -0x8(%rsp), %rax
movl -0x10(%rsp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movl $0x4, (%rax,%rcx,4)
jmp 0x40b000
jmp 0x40b002
jmp 0x40b004
jmp 0x40b006
movl -0x10(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rsp)
jmp 0x40af47
retq
nopw (%rax,%rax)