// File: /workspace/github_c_makefile_star2_O0/shifengbin[P]bishe/parserurl/parserurl.c
// Function: getport
char *getport( char *url)
{
	char *c,*p;
	char *port;
	char *rh;
	if (url == NULL)
		return NULL;
	rh = removehttp(url);

	if ((c = strchr(rh,':'))== NULL)
	{
		free(rh);
		if ( strncmp(url, "https",5) == 0 )
		{
			port = (char *)malloc(4);
			if (port == NULL)
				return NULL;
			sprintf( port , "443");
		}
		else if ((strncmp(url,"http",4) == 0) ||(strncmp(url, "//",2)==0) )
		{
			port = (char *)malloc(3);
			if (port == NULL)
				return NULL;
			sprintf(port, "80");
		}
		else 
		{
			return NULL;
		}
	}
	else
	{
		c++;
		if ( (p = strchr(c,'/')) == NULL)
		{
			port = (char*)malloc(strlen(c)+1);	
			if (port == NULL)	
				return NULL;
			memset(port , 0 , strlen(c)+1);
			memcpy(port , c , strlen(c));
		}
		else
		{
			port = (char*)malloc(p-c+1);
			if ( port == NULL)
				return NULL;
			memset( port , 0 , p-c+1);
			memcpy( port , c , p-c);
		}
	}
	return port;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0xc0f0
movq $0x0, -0x8(%rbp)
jmp 0xc2f4
movq -0x10(%rbp), %rdi
callq 0xbe10
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
movl $0x3a, %esi
callq 0x8100
movq %rax, -0x18(%rbp)
cmpq $0x0, %rax
jne 0xc1f0
movq -0x30(%rbp), %rdi
callq 0x8320
movq -0x10(%rbp), %rdi
leaq 0x96224(%rip), %rsi     # 0xa2351
movl $0x5, %edx
callq 0x8150
cmpl $0x0, %eax
jne 0xc172
movl $0x4, %edi
callq 0x83b0
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0xc15e
movq $0x0, -0x8(%rbp)
jmp 0xc2f4
movq -0x28(%rbp), %rdi
leaq 0x961ee(%rip), %rsi     # 0xa2357
movb $0x0, %al
callq 0x8080
jmp 0xc1eb
movq -0x10(%rbp), %rdi
leaq 0x961de(%rip), %rsi     # 0xa235b
movl $0x4, %edx
callq 0x8150
cmpl $0x0, %eax
je 0xc1a6
movq -0x10(%rbp), %rdi
leaq 0x95f6f(%rip), %rsi     # 0xa2106
movl $0x2, %edx
callq 0x8150
cmpl $0x0, %eax
jne 0xc1dc
movl $0x3, %edi
callq 0x83b0
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0xc1c8
movq $0x0, -0x8(%rbp)
jmp 0xc2f4
movq -0x28(%rbp), %rdi
leaq 0x9ae82(%rip), %rsi     # 0xa7055
movb $0x0, %al
callq 0x8080
jmp 0xc1e9
movq $0x0, -0x8(%rbp)
jmp 0xc2f4
jmp 0xc1eb
jmp 0xc2ec
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
movl $0x2f, %esi
callq 0x8100
movq %rax, -0x20(%rbp)
cmpq $0x0, %rax
jne 0xc28f
movq -0x18(%rbp), %rdi
callq 0x8120
movq %rax, %rdi
addq $0x1, %rdi
callq 0x83b0
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0xc241
movq $0x0, -0x8(%rbp)
jmp 0xc2f4
movq -0x28(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x18(%rbp), %rdi
callq 0x8120
movq -0x48(%rbp), %rdi
movq %rax, %rdx
addq $0x1, %rdx
xorl %esi, %esi
callq 0x8160
movq -0x28(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rdi
callq 0x8120
movq -0x40(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq %rax, %rdx
callq 0x8220
jmp 0xc2ea
movq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rax
subq %rax, %rdi
addq $0x1, %rdi
callq 0x83b0
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0xc2b8
movq $0x0, -0x8(%rbp)
jmp 0xc2f4
movq -0x28(%rbp), %rdi
movq -0x20(%rbp), %rdx
movq -0x18(%rbp), %rax
subq %rax, %rdx
addq $0x1, %rdx
xorl %esi, %esi
callq 0x8160
movq -0x28(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x18(%rbp), %rax
subq %rax, %rdx
callq 0x8220
jmp 0xc2ec
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nop