// File: /workspace/github_c_makefile_star2_O0/dropletzhu[P]msuite/pim_sender.c
// Function: make_pim_register_stop
int make_pim_register_stop()
{
	struct ip *iph;
	struct _SPimHdr *pim_header;
	struct _SPimSmUnAlignedRegStopMsg *register_stop;
	char *header = datagram;
	in_addr_t tmp_group, tmp_source;

	if( has_local_source ) {
		iph = (struct ip*)(header);
		iph->ip_hl = 5;
		iph->ip_v = 4;
		iph->ip_tos = 0;
		iph->ip_len = htons(length);
		iph->ip_id = htonl(random());
		iph->ip_off = 0;
		iph->ip_ttl = 255;
		iph->ip_p = IPPROTO_PIM;
		iph->ip_sum = 0;
		iph->ip_src.s_addr = inet_addr (local_source);
		iph->ip_dst.s_addr = inet_addr (rp);

		header += sizeof(struct ip);
	}

	pim_header = (struct _SPimHdr*)(header);
	pim_header->msgtpe = PIMSM_REGISTER_STOP_MSG;
	pim_header->pimver = 2;
	header += sizeof(struct _SPimHdr);

	register_stop = (struct _SPimSmUnAlignedRegStopMsg*)header;
	register_stop->EncGrpAddr.u1AddrFamily = PIMSM_ADDRFMLY_IPV4;
	register_stop->EncGrpAddr.u1EncType = PIMSM_ENCTYPE_IPV4;
	tmp_group = inet_addr(mcast_group);
	memcpy(&(register_stop->EncGrpAddr.u4GrpAddr),&tmp_group,4);
	register_stop->EncUcastAddr.u1AddrFamily = PIMSM_ADDRFMLY_IPV4;
	register_stop->EncUcastAddr.u1EncType = PIMSM_ENCTYPE_IPV4;
	tmp_source = inet_addr(mcast_source);
	memcpy(&(register_stop->EncUcastAddr.u4UcastAddr),&tmp_source,4);

	pim_header->u2Checksum = csum((unsigned short*)pim_header,(sizeof(struct _SPimHdr)+sizeof(struct _SPimSmUnAlignedRegStopMsg))>>1);

	if( has_local_source ) {
		iph->ip_sum = csum((unsigned short*)iph, length>>1);
	}
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
leaq 0x2951(%rip), %rax      # 0x40d0
movq %rax, -0x20(%rbp)
cmpl $0x0, 0x293a(%rip)      # 0x40c4
je 0x1846
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
movb (%rax), %cl
andb $-0x10, %cl
orb $0x5, %cl
movb %cl, (%rax)
movq -0x8(%rbp), %rax
movb (%rax), %cl
andb $0xf, %cl
orb $0x40, %cl
movb %cl, (%rax)
movq -0x8(%rbp), %rax
movb $0x0, 0x1(%rax)
movl 0x28de(%rip), %eax      # 0x40a0
movzwl %ax, %edi
callq 0x1060
movw %ax, %cx
movq -0x8(%rbp), %rax
movw %cx, 0x2(%rax)
callq 0x10c0
movl %eax, %edi
callq 0x1080
movw %ax, %cx
movq -0x8(%rbp), %rax
movw %cx, 0x4(%rax)
movq -0x8(%rbp), %rax
movw $0x0, 0x6(%rax)
movq -0x8(%rbp), %rax
movb $-0x1, 0x8(%rax)
movq -0x8(%rbp), %rax
movb $0x67, 0x9(%rax)
movq -0x8(%rbp), %rax
movw $0x0, 0xa(%rax)
leaq 0x128b9(%rip), %rdi     # 0x140d0
callq 0x10b0
movl %eax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0xc(%rax)
leaq 0x128b4(%rip), %rdi     # 0x140e0
callq 0x10b0
movl %eax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x10(%rax)
movq -0x20(%rbp), %rax
addq $0x14, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movb (%rax), %cl
andb $-0x10, %cl
orb $0x2, %cl
movb %cl, (%rax)
movq -0x10(%rbp), %rax
movb (%rax), %cl
andb $0xf, %cl
orb $0x20, %cl
movb %cl, (%rax)
movq -0x20(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movb $0x1, (%rax)
movq -0x18(%rbp), %rax
movb $0x0, 0x1(%rax)
leaq 0x1286c(%rip), %rdi     # 0x14100
callq 0x10b0
movl %eax, -0x24(%rbp)
movq -0x18(%rbp), %rax
movl -0x24(%rbp), %ecx
movl %ecx, 0x8(%rax)
movq -0x18(%rbp), %rax
movb $0x1, 0x10(%rax)
movq -0x18(%rbp), %rax
movb $0x0, 0x11(%rax)
leaq 0x12833(%rip), %rdi     # 0x140f0
callq 0x10b0
movl %eax, -0x28(%rbp)
movq -0x18(%rbp), %rax
movl -0x28(%rbp), %ecx
movl %ecx, 0x12(%rax)
movq -0x10(%rbp), %rdi
movl $0x12, %esi
callq 0x1220
movw %ax, %cx
movq -0x10(%rbp), %rax
movw %cx, 0x2(%rax)
cmpl $0x0, 0x27d5(%rip)      # 0x40c4
je 0x190d
movq -0x8(%rbp), %rdi
movl 0x27a5(%rip), %esi      # 0x40a0
sarl %esi
callq 0x1220
movw %ax, %cx
movq -0x8(%rbp), %rax
movw %cx, 0xa(%rax)
xorl %eax, %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)