// File: /workspace/github_c_makefile_star2_O0/sabotage-linux[P]libnl-tiny/genl_ctrl.c
// Function: ctrl_msg_parser
static int ctrl_msg_parser(struct nl_cache_ops *ops, struct genl_cmd *cmd,
			   struct genl_info *info, void *arg)
{
	struct genl_family *family;
	struct nl_parser_param *pp = arg;
	int err;

	family = genl_family_alloc();
	if (family == NULL) {
		err = -NLE_NOMEM;
		goto errout;
	}

	if (info->attrs[CTRL_ATTR_FAMILY_NAME] == NULL) {
		err = -NLE_MISSING_ATTR;
		goto errout;
	}

	if (info->attrs[CTRL_ATTR_FAMILY_ID] == NULL) {
		err = -NLE_MISSING_ATTR;
		goto errout;
	}

	family->ce_msgtype = info->nlh->nlmsg_type;
	genl_family_set_id(family,
			   nla_get_u16(info->attrs[CTRL_ATTR_FAMILY_ID]));
	genl_family_set_name(family,
		     nla_get_string(info->attrs[CTRL_ATTR_FAMILY_NAME]));

	if (info->attrs[CTRL_ATTR_VERSION]) {
		uint32_t version = nla_get_u32(info->attrs[CTRL_ATTR_VERSION]);
		genl_family_set_version(family, version);
	}

	if (info->attrs[CTRL_ATTR_HDRSIZE]) {
		uint32_t hdrsize = nla_get_u32(info->attrs[CTRL_ATTR_HDRSIZE]);
		genl_family_set_hdrsize(family, hdrsize);
	}

	if (info->attrs[CTRL_ATTR_MAXATTR]) {
		uint32_t maxattr = nla_get_u32(info->attrs[CTRL_ATTR_MAXATTR]);
		genl_family_set_maxattr(family, maxattr);
	}

	if (info->attrs[CTRL_ATTR_OPS]) {
		struct nlattr *nla, *nla_ops;
		int remaining;

		nla_ops = info->attrs[CTRL_ATTR_OPS];
		nla_for_each_nested(nla, nla_ops, remaining) {
			struct nlattr *tb[CTRL_ATTR_OP_MAX+1];
			int flags = 0, id;

			err = nla_parse_nested(tb, CTRL_ATTR_OP_MAX, nla,
					       family_op_policy);
			if (err < 0)
				goto errout;

			if (tb[CTRL_ATTR_OP_ID] == NULL) {
				err = -NLE_MISSING_ATTR;
				goto errout;
			}
			
			id = nla_get_u32(tb[CTRL_ATTR_OP_ID]);

			if (tb[CTRL_ATTR_OP_FLAGS])
				flags = nla_get_u32(tb[CTRL_ATTR_OP_FLAGS]);

			err = genl_family_add_op(family, id, flags);
			if (err < 0)
				goto errout;

		}
	}

	if (info->attrs[CTRL_ATTR_MCAST_GROUPS]) {
		struct nlattr *nla, *nla_grps;
		int remaining;

		nla_grps = info->attrs[CTRL_ATTR_MCAST_GROUPS];
		nla_for_each_nested(nla, nla_grps, remaining) {
			struct nlattr *tb[CTRL_ATTR_MCAST_GRP_MAX+1];
			int id;
			const char * name;

			err = nla_parse_nested(tb, CTRL_ATTR_MCAST_GRP_MAX, nla,
					       family_grp_policy);
			if (err < 0)
				goto errout;

			if (tb[CTRL_ATTR_MCAST_GRP_ID] == NULL) {
				err = -NLE_MISSING_ATTR;
				goto errout;
			}
			id = nla_get_u32(tb[CTRL_ATTR_MCAST_GRP_ID]);

			if (tb[CTRL_ATTR_MCAST_GRP_NAME] == NULL) {
				err = -NLE_MISSING_ATTR;
				goto errout;
			}
			name = nla_get_string(tb[CTRL_ATTR_MCAST_GRP_NAME]);

			err = genl_family_add_grp(family, id, name);
			if (err < 0)
				goto errout;
		}

	}

	err = pp->pp_cb((struct nl_object *) family, pp);
errout:
	genl_family_put(family);
	return err;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x30(%rbp)
callq 0x3630
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x84ef
movl $0xfffffffb, -0x34(%rbp) # imm = 0xFFFFFFFB
jmp 0x8830
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
cmpq $0x0, 0x10(%rax)
jne 0x850a
movl $0xfffffff2, -0x34(%rbp) # imm = 0xFFFFFFF2
jmp 0x8830
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
cmpq $0x0, 0x8(%rax)
jne 0x8525
movl $0xfffffff2, -0x34(%rbp) # imm = 0xFFFFFFF2
jmp 0x8830
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movzwl 0x4(%rax), %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x28(%rax)
movq -0x28(%rbp), %rax
movq %rax, -0xd0(%rbp)
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
movq 0x8(%rax), %rdi
callq 0x8880
movq -0xd0(%rbp), %rdi
movzwl %ax, %esi
callq 0x8850
movq -0x28(%rbp), %rax
movq %rax, -0xc8(%rbp)
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
movq 0x10(%rax), %rdi
callq 0x88f0
movq -0xc8(%rbp), %rdi
movq %rax, %rsi
callq 0x88a0
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
cmpq $0x0, 0x18(%rax)
je 0x85c0
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
movq 0x18(%rax), %rdi
callq 0x8910
movl %eax, -0x38(%rbp)
movq -0x28(%rbp), %rdi
movl -0x38(%rbp), %eax
movzbl %al, %esi
callq 0x8930
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
cmpq $0x0, 0x20(%rax)
je 0x85ef
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
movq 0x20(%rax), %rdi
callq 0x8910
movl %eax, -0x3c(%rbp)
movq -0x28(%rbp), %rdi
movl -0x3c(%rbp), %esi
callq 0x8960
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
cmpq $0x0, 0x28(%rax)
je 0x861e
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
movq 0x28(%rax), %rdi
callq 0x8910
movl %eax, -0x40(%rbp)
movq -0x28(%rbp), %rdi
movl -0x40(%rbp), %esi
callq 0x8990
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
cmpq $0x0, 0x30(%rax)
je 0x8706
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
movq 0x30(%rax), %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rdi
callq 0x89c0
movq %rax, -0x48(%rbp)
movq -0x50(%rbp), %rdi
callq 0x89e0
movl %eax, -0x54(%rbp)
movq -0x48(%rbp), %rdi
movl -0x54(%rbp), %esi
callq 0x3360
cmpl $0x0, %eax
je 0x8704
movl $0x0, -0x74(%rbp)
leaq -0x70(%rbp), %rdi
movq -0x48(%rbp), %rdx
movl $0x2, %esi
leaq 0x6046(%rip), %rcx      # 0xe6d0
callq 0x8a00
movl %eax, -0x34(%rbp)
cmpl $0x0, -0x34(%rbp)
jge 0x869d
jmp 0x8830
cmpq $0x0, -0x68(%rbp)
jne 0x86b0
movl $0xfffffff2, -0x34(%rbp) # imm = 0xFFFFFFF2
jmp 0x8830
movq -0x68(%rbp), %rdi
callq 0x8910
movl %eax, -0x78(%rbp)
cmpq $0x0, -0x60(%rbp)
je 0x86cf
movq -0x60(%rbp), %rdi
callq 0x8910
movl %eax, -0x74(%rbp)
movq -0x28(%rbp), %rdi
movl -0x78(%rbp), %esi
movl -0x74(%rbp), %edx
callq 0x3230
movl %eax, -0x34(%rbp)
cmpl $0x0, -0x34(%rbp)
jge 0x86ec
jmp 0x8830
jmp 0x86ee
movq -0x48(%rbp), %rdi
leaq -0x54(%rbp), %rsi
callq 0x3540
movq %rax, -0x48(%rbp)
jmp 0x865a
jmp 0x8706
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
cmpq $0x0, 0x38(%rax)
je 0x881c
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
movq 0x38(%rax), %rax
movq %rax, -0x88(%rbp)
movq -0x88(%rbp), %rdi
callq 0x89c0
movq %rax, -0x80(%rbp)
movq -0x88(%rbp), %rdi
callq 0x89e0
movl %eax, -0x8c(%rbp)
movq -0x80(%rbp), %rdi
movl -0x8c(%rbp), %esi
callq 0x3360
cmpl $0x0, %eax
je 0x881a
leaq -0xb0(%rbp), %rdi
movq -0x80(%rbp), %rdx
movl $0x2, %esi
leaq 0x5f73(%rip), %rcx      # 0xe6f0
callq 0x8a00
movl %eax, -0x34(%rbp)
cmpl $0x0, -0x34(%rbp)
jge 0x8790
jmp 0x8830
cmpq $0x0, -0xa0(%rbp)
jne 0x87a6
movl $0xfffffff2, -0x34(%rbp) # imm = 0xFFFFFFF2
jmp 0x8830
movq -0xa0(%rbp), %rdi
callq 0x8910
movl %eax, -0xb4(%rbp)
cmpq $0x0, -0xa8(%rbp)
jne 0x87cb
movl $0xfffffff2, -0x34(%rbp) # imm = 0xFFFFFFF2
jmp 0x8830
movq -0xa8(%rbp), %rdi
callq 0x88f0
movq %rax, -0xc0(%rbp)
movq -0x28(%rbp), %rdi
movl -0xb4(%rbp), %esi
movq -0xc0(%rbp), %rdx
callq 0x33c0
movl %eax, -0x34(%rbp)
cmpl $0x0, -0x34(%rbp)
jge 0x87ff
jmp 0x8830
jmp 0x8801
movq -0x80(%rbp), %rdi
leaq -0x8c(%rbp), %rsi
callq 0x3540
movq %rax, -0x80(%rbp)
jmp 0x874e
jmp 0x881c
movq -0x30(%rbp), %rax
movq (%rax), %rax
movq -0x28(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq *%rax
movl %eax, -0x34(%rbp)
movq -0x28(%rbp), %rdi
callq 0x3120
movl -0x34(%rbp), %eax
addq $0xd0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)