// File: /workspace/github_c_makefile_star2_O0/jfriesse[P]omping/omping.c
// Function: omping_instance_create
static void
omping_instance_create(struct omping_instance *instance, int argc, char *argv[])
{
	uint16_t bind_port;

	bind_port = 0;
	memset(instance, 0, sizeof(struct omping_instance));

	cli_parse(argc, argv, instance);

	rh_list_create(&instance->remote_hosts, &instance->remote_addrs, instance->dup_buf_items,
	    instance->rate_limit_time);

	instance->rh_no_active = rh_list_length(&instance->remote_hosts);

	instance->ucast_socket =
	    sf_create_unicast_socket(AF_CAST_SA(&instance->local_addr.sas), instance->ttl, 1,
	    instance->single_addr, instance->local_ifname, instance->transport_method, 1, 0,
	    instance->sndbuf_size, instance->rcvbuf_size,
	    (instance->op_mode == OMPING_OP_MODE_CLIENT ? &bind_port : NULL));

	if (instance->ucast_socket == -1) {
		err(1, "Can't create/bind unicast socket");
	}

	switch (instance->op_mode) {
	case OMPING_OP_MODE_SERVER:
		instance->mcast_socket = -1;
		rh_list_put_to_finish_state(&instance->remote_hosts, RH_LFS_CLIENT);
		break;
	case OMPING_OP_MODE_SHOW_VERSION:
		rh_list_put_to_finish_state(&instance->remote_hosts, RH_LFS_SERVER);
		break;
	case OMPING_OP_MODE_CLIENT:
		rh_list_put_to_finish_state(&instance->remote_hosts, RH_LFS_SERVER);
	case OMPING_OP_MODE_NORMAL:
		instance->mcast_socket =
		    sf_create_multicast_socket((struct sockaddr *)&instance->mcast_addr.sas,
			AF_CAST_SA(&instance->local_addr.sas), instance->local_ifname,
			instance->ttl, instance->single_addr, instance->transport_method,
			&instance->remote_addrs, 1, 0, instance->sndbuf_size,
			instance->rcvbuf_size,
			(instance->op_mode == OMPING_OP_MODE_CLIENT ? bind_port : 0));

		if (instance->mcast_socket == -1) {
			err(1, "Can't create/bind multicast socket");
		}
		break;
	}

	util_random_init(&instance->local_addr.sas);

	rh_list_gen_cid(&instance->remote_hosts, &instance->local_addr);

	instance->hn_max_len = rh_list_hn_max_len(&instance->remote_hosts);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0xc0, %rsp
movq %rdi, -0x18(%rbp)
movl %esi, -0x1c(%rbp)
movq %rdx, -0x28(%rbp)
movw $0x0, -0x2a(%rbp)
movq -0x18(%rbp), %rdi
xorl %esi, %esi
movl $0x1b0, %edx            # imm = 0x1B0
callq 0x2150
movl -0x1c(%rbp), %edi
movq -0x28(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x44d0
movq -0x18(%rbp), %rdi
addq $0x130, %rdi            # imm = 0x130
movq -0x18(%rbp), %rsi
addq $0x140, %rsi            # imm = 0x140
movq -0x18(%rbp), %rax
movl 0x170(%rax), %edx
movq -0x18(%rbp), %rax
movl 0x184(%rax), %ecx
callq 0x9aa0
movq -0x18(%rbp), %rdi
addq $0x130, %rdi            # imm = 0x130
callq 0x9d40
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x1a4(%rax)
movq -0x18(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x18(%rbp), %rax
movb 0x1aa(%rax), %al
movb %al, -0x45(%rbp)
movq -0x18(%rbp), %rax
movl 0x18c(%rax), %eax
movl %eax, -0x44(%rbp)
movq -0x18(%rbp), %rax
movq 0x158(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x18(%rbp), %rax
movl 0x154(%rax), %eax
movl %eax, -0x38(%rbp)
movq -0x18(%rbp), %rax
movl 0x190(%rax), %eax
movl %eax, -0x34(%rbp)
movq -0x18(%rbp), %rax
movl 0x188(%rax), %eax
movl %eax, -0x30(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x1, 0x150(%rax)
jne 0x7679
leaq -0x2a(%rbp), %rax
movq %rax, -0x58(%rbp)
jmp 0x7681
xorl %eax, %eax
movq %rax, -0x58(%rbp)
jmp 0x7681
movl -0x30(%rbp), %r10d
movl -0x34(%rbp), %r11d
movl -0x38(%rbp), %r9d
movq -0x40(%rbp), %r8
movl -0x44(%rbp), %ecx
movb -0x45(%rbp), %sil
movq -0x50(%rbp), %rdi
movq -0x58(%rbp), %rax
movl $0x1, %edx
xorl %ebx, %ebx
movzbl %sil, %esi
movl $0x1, (%rsp)
movl $0x0, 0x8(%rsp)
movl %r11d, 0x10(%rsp)
movl %r10d, 0x18(%rsp)
movq %rax, 0x20(%rsp)
callq 0xb650
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x198(%rax)
movq -0x18(%rbp), %rax
cmpl $-0x1, 0x198(%rax)
jne 0x76fa
movl $0x1, %edi
leaq 0x7931(%rip), %rsi      # 0xf024
movb $0x0, %al
callq 0x2240
movq -0x18(%rbp), %rax
movl 0x150(%rax), %eax
movq %rax, -0x60(%rbp)
subq $0x3, %rax
ja 0x78aa
movq -0x60(%rbp), %rax
leaq 0x77f7(%rip), %rcx      # 0xef14
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x18(%rbp), %rax
movl $0xffffffff, 0x17c(%rax) # imm = 0xFFFFFFFF
movq -0x18(%rbp), %rdi
addq $0x130, %rdi            # imm = 0x130
xorl %esi, %esi
callq 0x9d80
jmp 0x78aa
movq -0x18(%rbp), %rdi
addq $0x130, %rdi            # imm = 0x130
movl $0x1, %esi
callq 0x9d80
jmp 0x78aa
movq -0x18(%rbp), %rdi
addq $0x130, %rdi            # imm = 0x130
movl $0x1, %esi
callq 0x9d80
movq -0x18(%rbp), %rax
addq $0x98, %rax
movq %rax, -0x98(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0x18(%rbp), %rax
movq 0x158(%rax), %rax
movq %rax, -0x88(%rbp)
movq -0x18(%rbp), %rax
movb 0x1aa(%rax), %al
movb %al, -0x79(%rbp)
movq -0x18(%rbp), %rax
movl 0x18c(%rax), %eax
movl %eax, -0x78(%rbp)
movq -0x18(%rbp), %rax
movl 0x154(%rax), %eax
movl %eax, -0x74(%rbp)
movq -0x18(%rbp), %rax
addq $0x140, %rax            # imm = 0x140
movq %rax, -0x70(%rbp)
movq -0x18(%rbp), %rax
movl 0x190(%rax), %eax
movl %eax, -0x68(%rbp)
movq -0x18(%rbp), %rax
movl 0x188(%rax), %eax
movl %eax, -0x64(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x1, 0x150(%rax)
jne 0x7810
movzwl -0x2a(%rbp), %eax
movl %eax, -0x9c(%rbp)
jmp 0x781a
xorl %eax, %eax
movl %eax, -0x9c(%rbp)
jmp 0x781a
movl -0x64(%rbp), %r10d
movl -0x68(%rbp), %r11d
movq -0x70(%rbp), %rbx
movl -0x74(%rbp), %r9d
movl -0x78(%rbp), %r8d
movb -0x79(%rbp), %cl
movq -0x88(%rbp), %rdx
movq -0x90(%rbp), %rsi
movq -0x98(%rbp), %rdi
movl -0x9c(%rbp), %eax
xorl %r14d, %r14d
movzbl %cl, %ecx
movq %rbx, (%rsp)
movl $0x1, 0x8(%rsp)
movl $0x0, 0x10(%rsp)
movl %r11d, 0x18(%rsp)
movl %r10d, 0x20(%rsp)
movzwl %ax, %eax
movl %eax, 0x28(%rsp)
callq 0xafe0
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x17c(%rax)
movq -0x18(%rbp), %rax
cmpl $-0x1, 0x17c(%rax)
jne 0x78a8
movl $0x1, %edi
leaq 0x77a4(%rip), %rsi      # 0xf045
movb $0x0, %al
callq 0x2240
jmp 0x78aa
movq -0x18(%rbp), %rdi
callq 0xcb60
movq -0x18(%rbp), %rdi
addq $0x130, %rdi            # imm = 0x130
movq -0x18(%rbp), %rsi
callq 0x9c60
movq -0x18(%rbp), %rdi
addq $0x130, %rdi            # imm = 0x130
callq 0x9cb0
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x174(%rax)
addq $0xc0, %rsp
popq %rbx
popq %r14
popq %rbp
retq
nop