// File: /workspace/github_c_makefile_star2_O2/sachinites[P]CommandParser/testapp.c
// Function: main
int
main(int argc, char **argv){
    
    init_libcli();
    /*Level 0*/

    param_t *show   = libcli_get_show_hook();
    //param_t *debug  = libcli_get_debug_hook();
    param_t *config = libcli_get_config_hook();

    static param_t cmsh;
    init_param(&cmsh, CMD, "cmsh", 0, 0, INVALID, 0, "cmsh hidden commands");
    libcli_register_param(0, &cmsh);

    /*Level 1*/
    static param_t ip;
    init_param(&ip, CMD, "ip", 0, 0, INVALID, 0, "Internet Protocol(IP)");
    libcli_register_param(show, &ip);

    static param_t ipv6;
    init_param(&ipv6, CMD, "ipv6", 0, 0, INVALID, 0, "Internet Protocol(IPV6)");
    libcli_register_param(show, &ipv6);

    static param_t config_router;
    init_param(&config_router, CMD, "router", 0, 0, INVALID, 0, "Configuration Router");
    libcli_register_param(config, &config_router);

    /*Level 2*/
    static param_t config_router_name;
    init_param(&config_router_name, CMD, "name", 0, 0, INVALID, 0, "configure router name");
    libcli_register_param(&config_router, &config_router_name);

    static param_t igmp;
    init_param(&igmp, CMD, "igmp", 0, 0, INVALID, 0, "IGMP Protocol");
    libcli_register_param(&ip, &igmp);
    
    static param_t igmp_config;
    init_param(&igmp_config, CMD, "configuration", show_ip_igmp_groups_handler, 0, INVALID, 0, "IGMP Protocol Configuration");
    libcli_register_param(&igmp, &igmp_config);

    /*Level 3*/
    static param_t config_router_name_name;
    init_param(&config_router_name_name, LEAF, 0, config_router_name_handler, 0,  
                                              STRING, "cons-name", "Name of Console");
    libcli_register_param(&config_router_name, &config_router_name_name);
    
    static param_t show_ip_igmp_groups;
    init_param(&show_ip_igmp_groups, CMD, "groups", show_ip_igmp_groups_handler, 0, INVALID, 0, "Ipv4 Group Address");
    libcli_register_param(&igmp, &show_ip_igmp_groups);

    static param_t show_ip_igmp_groups_vlan;
    init_param(&show_ip_igmp_groups_vlan, CMD, "vlan", 0, 0, INVALID, 0, "vlan");
    libcli_register_param(&show_ip_igmp_groups, &show_ip_igmp_groups_vlan);
    libcli_register_display_callback(&show_ip_igmp_groups_vlan, list_vlans);

    static param_t show_ip_igmp_groups_vlan_vlan;
    init_param(&show_ip_igmp_groups_vlan_vlan, LEAF, 0, show_ip_igmp_groups_handler, user_vlan_validation_callback,
        INT, "vlan-id", "Vlan id(1-4095)");
    libcli_register_param(&show_ip_igmp_groups_vlan, &show_ip_igmp_groups_vlan_vlan);

    /*Level 5*/
    static param_t  show_ip_igmp_groups_group_ip;
    init_param(&show_ip_igmp_groups_group_ip, LEAF, 0, show_ip_igmp_groups_handler, 0, IPV4, 
                "group-ip" ,"Multicast Group Address");
    libcli_register_param(&show_ip_igmp_groups, &show_ip_igmp_groups_group_ip);

    /*level 6*/
    static param_t show_ip_igmp_groups_group_ip_vlan;
    init_param(&show_ip_igmp_groups_group_ip_vlan, CMD, "vlan", 0, 0, INVALID, 0, "Vlan");
    libcli_register_param(&show_ip_igmp_groups_group_ip, &show_ip_igmp_groups_group_ip_vlan);

    /*level 7*/
    static param_t show_ip_igmp_groups_group_ip_vlan_vlan_id;
    init_param(&show_ip_igmp_groups_group_ip_vlan_vlan_id, LEAF, 0, show_ip_igmp_groups_handler, 
                                    user_vlan_validation_callback, INT, "vlan-id" ,"Vlan id(1-4095)");
    libcli_register_param(&show_ip_igmp_groups_group_ip_vlan, &show_ip_igmp_groups_group_ip_vlan_vlan_id);

    /*mtrace command implementation*/
    static param_t mtrace;
    init_param(&mtrace, CMD, "mtrace", 0, 0, INVALID, 0, "mtrace command");
    libcli_register_param(config, &mtrace);

    static param_t source;
    init_param(&source, CMD, "source", 0, 0, INVALID, 0, "source command");
    libcli_register_param(&mtrace, &source);

    static param_t source_ip;
    init_param(&source_ip, LEAF, 0, mtrace_handler, 0, IPV4, "source-ip", "Source Ipv4 address");
    libcli_register_param(&source, &source_ip);
    set_param_cmd_code(&source_ip, MTRACE_SOURCE);

    /*mtrace source <source ip> destination <dest-ip>*/

    static param_t destination;
    init_param(&destination, CMD, "destination", 0, 0, INVALID, 0, "destination command");
    libcli_register_param(&source_ip, &destination);

    static param_t dest_ip;
    init_param(&dest_ip, LEAF, 0, mtrace_handler, 0, IPV4, "destination-ip", "Destination Ipv4 address");
    libcli_register_param(&destination, &dest_ip);
    set_param_cmd_code(&dest_ip, MTRACE_SOURCE_DEST);

    /*mtrace source <source ip> group <group-ip>*/

    static param_t group;
    init_param(&group, CMD, "group", 0, 0, INVALID, 0, "group command");
    libcli_register_param(&source_ip, &group);

    static param_t group_ip;
    init_param(&group_ip, LEAF, 0, mtrace_handler, 0, IPV4, "group-ip", "Multicast Group Ipv4 address");
    libcli_register_param(&group, &group_ip);
    set_param_cmd_code(&group_ip, MTRACE_SOURCE_GROUP);

    /*mtrace source <source ip> destination <dest-ip> group <group_ip>*/

    static param_t group2;
    init_param(&group2, CMD, "group", 0, 0, INVALID, 0, "group command");
    libcli_register_param(&dest_ip, &group2);

    static param_t group_ip2;
    init_param(&group_ip2, LEAF, 0, mtrace_handler, 0, IPV4, "group-ip", "Multicast Group Ipv4 address");
    libcli_register_param(&group2, &group_ip2);
    set_param_cmd_code(&group_ip2, MTRACE_SOURCE_DEST_GROUP);

    support_cmd_negation(config);

    start_shell();
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
xorl %eax, %eax
callq 0x1da6
callq 0x1acc
movq %rax, %rbx
callq 0x1ae4
movq %rax, %r12
movq %rax, (%rsp)
leaq 0x5b1f(%rip), %rax      # 0x7011
leaq 0xac7f(%rip), %r14      # 0xc178
leaq 0x5b0c(%rip), %rdx      # 0x700c
pushq $0x6
popq %rbp
movq %r14, %rdi
xorl %esi, %esi
xorl %ecx, %ecx
xorl %r8d, %r8d
movl %ebp, %r9d
pushq %rax
pushq $0x0
callq 0x26b6
popq %rax
popq %rcx
xorl %edi, %edi
movq %r14, %rsi
callq 0x1b3f
leaq 0x5afb(%rip), %rax      # 0x7026
leaq 0xad3e(%rip), %r14      # 0xc270
leaq 0x5c39(%rip), %rdx      # 0x7172
movq %r14, %rdi
xorl %esi, %esi
xorl %ecx, %ecx
xorl %r8d, %r8d
movl %ebp, %r9d
pushq %rax
pushq $0x0
callq 0x26b6
popq %rax
popq %rcx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1b3f
leaq 0x5adf(%rip), %rax      # 0x7041
leaq 0xadff(%rip), %r15      # 0xc368
leaq 0x5acc(%rip), %rdx      # 0x703c
movq %r15, %rdi
xorl %esi, %esi
xorl %ecx, %ecx
xorl %r8d, %r8d
movl %ebp, %r9d
pushq %rax
pushq $0x0
callq 0x26b6
popq %rax
popq %rcx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x1b3f
leaq 0x5ac7(%rip), %rax      # 0x7060
leaq 0xaec0(%rip), %r15      # 0xc460
leaq 0x5ab2(%rip), %rdx      # 0x7059
movq %r15, %rdi
xorl %esi, %esi
xorl %ecx, %ecx
xorl %r8d, %r8d
movl %ebp, %r9d
pushq %rax
pushq $0x0
callq 0x26b6
popq %rax
popq %rcx
movq %r12, %rdi
movq %r15, %rsi
callq 0x1b3f
leaq 0x5aa5(%rip), %rax      # 0x7075
leaq 0xaf81(%rip), %rbx      # 0xc558
leaq 0x6f0a(%rip), %rdx      # 0x84e8
movq %rbx, %rdi
xorl %esi, %esi
xorl %ecx, %ecx
xorl %r8d, %r8d
movl %ebp, %r9d
pushq %rax
pushq $0x0
callq 0x26b6
popq %rax
popq %rcx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x1b3f
leaq 0x5a89(%rip), %rax      # 0x7090
leaq 0xb042(%rip), %r15      # 0xc650
leaq 0x5a76(%rip), %rdx      # 0x708b
movq %r15, %rdi
xorl %esi, %esi
xorl %ecx, %ecx
xorl %r8d, %r8d
movl %ebp, %r9d
pushq %rax
pushq $0x0
callq 0x26b6
popq %rax
popq %rcx
movq %r14, %rdi
movq %r15, %rsi
callq 0x1b3f
leaq 0x5a6e(%rip), %rax      # 0x70ac
leaq 0xb103(%rip), %r14      # 0xc748
leaq 0x5a52(%rip), %rdx      # 0x709e
leaq -0x2a7(%rip), %r12      # 0x13ac
movq %r14, %rdi
xorl %esi, %esi
movq %r12, %rcx
xorl %r8d, %r8d
movl %ebp, %r9d
pushq %rax
pushq $0x0
callq 0x26b6
popq %rax
popq %rcx
movq %r15, %rdi
movq %r14, %rsi
callq 0x1b3f
leaq 0x5a55(%rip), %rax      # 0x70d2
leaq 0x5a44(%rip), %r10      # 0x70c8
leaq 0xb1b5(%rip), %r14      # 0xc840
leaq -0x203(%rip), %rcx      # 0x148f
pushq $0x1
popq %rsi
movq %r14, %rdi
xorl %edx, %edx
xorl %r8d, %r8d
movl %esi, %r9d
pushq %rax
pushq %r10
callq 0x26b6
popq %rax
popq %rcx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1b3f
leaq 0x5a2d(%rip), %rax      # 0x70e9
leaq 0xb275(%rip), %r13      # 0xc938
leaq 0x5a18(%rip), %rdx      # 0x70e2
movq %r13, %rdi
xorl %esi, %esi
movq %r12, %rcx
xorl %r8d, %r8d
movl %ebp, %r9d
pushq %rax
pushq $0x0
callq 0x26b6
popq %rax
popq %rcx
movq %r15, %rdi
movq %r13, %rsi
callq 0x1b3f
leaq 0x5a08(%rip), %rbx      # 0x70fc
leaq 0xb335(%rip), %r14      # 0xca30
movq %r14, %rdi
xorl %esi, %esi
movq %rbx, %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
movl %ebp, %r9d
pushq %rbx
pushq $0x0
callq 0x26b6
popq %rax
popq %rcx
movq %r13, %rdi
movq %r14, %rsi
callq 0x1b3f
leaq 0x351(%rip), %rsi       # 0x1a78
movq %r14, %rdi
callq 0x1c40
leaq 0x59d3(%rip), %r10      # 0x7109
leaq 0x59c4(%rip), %rax      # 0x7101
leaq 0xb3e4(%rip), %rbp      # 0xcb28
leaq -0x2ab(%rip), %r8       # 0x14a0
movq %rbp, %rdi
pushq $0x1
popq %r15
movl %r15d, %esi
xorl %edx, %edx
movq %r12, %rcx
xorl %r9d, %r9d
pushq %r10
pushq %rax
callq 0x26b6
popq %rax
popq %rcx
movq %r14, %rdi
movq %rbp, %rsi
callq 0x1b3f
leaq 0x59a9(%rip), %rax      # 0x7122
leaq 0x5999(%rip), %r10      # 0x7119
leaq 0xb499(%rip), %r14      # 0xcc20
pushq $0x2
popq %r9
movq %r14, %rdi
movl %r15d, %esi
xorl %edx, %edx
movq %r12, %rcx
xorl %r8d, %r8d
pushq %rax
pushq %r10
callq 0x26b6
popq %rax
popq %rcx
movq %r13, %rdi
movq %r14, %rsi
callq 0x1b3f
leaq 0x5985(%rip), %rax      # 0x713a
leaq 0xb55c(%rip), %r13      # 0xcd18
movq %r13, %rdi
xorl %esi, %esi
movq %rbx, %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
pushq $0x6
popq %rbp
movl %ebp, %r9d
pushq %rax
pushq $0x0
callq 0x26b6
popq %rax
popq %rcx
movq %r14, %rdi
movq %r13, %rsi
callq 0x1b3f
leaq 0xb625(%rip), %rbx      # 0xce10
movq %rbx, %rdi
movl %r15d, %esi
xorl %edx, %edx
movq %r12, %rcx
leaq -0x35d(%rip), %r8       # 0x14a0
xorl %r9d, %r9d
leaq 0x5902(%rip), %rax      # 0x7109
pushq %rax
leaq 0x58f2(%rip), %rax      # 0x7101
pushq %rax
callq 0x26b6
popq %rax
popq %rcx
movq %r13, %rdi
movq %rbx, %rsi
callq 0x1b3f
leaq 0x591d(%rip), %rax      # 0x7146
leaq 0xb6d8(%rip), %r14      # 0xcf08
leaq 0x5908(%rip), %rdx      # 0x713f
movq %r14, %rdi
xorl %esi, %esi
xorl %ecx, %ecx
xorl %r8d, %r8d
movl %ebp, %r9d
pushq %rax
pushq $0x0
callq 0x26b6
popq %rax
popq %rcx
movq (%rsp), %rdi
movq %r14, %rsi
callq 0x1b3f
leaq 0x58fb(%rip), %rax      # 0x715c
leaq 0xb798(%rip), %rbx      # 0xd000
leaq 0x58e6(%rip), %rdx      # 0x7155
movq %rbx, %rdi
xorl %esi, %esi
xorl %ecx, %ecx
xorl %r8d, %r8d
movl %ebp, %r9d
pushq %rax
pushq $0x0
callq 0x26b6
popq %rax
popq %rcx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1b3f
leaq 0x58dd(%rip), %rax      # 0x7175
leaq 0x58cc(%rip), %r10      # 0x716b
leaq 0xb852(%rip), %r13      # 0xd0f8
leaq -0x42b(%rip), %rcx      # 0x1482
movq %r13, %rdi
movl %r15d, %r12d
movl %r15d, %esi
xorl %edx, %edx
xorl %r8d, %r8d
pushq $0x2
popq %r15
movl %r15d, %r9d
pushq %rax
pushq %r10
callq 0x26b6
popq %rax
popq %rcx
movq %rbx, %rdi
movq %r13, %rsi
callq 0x1b3f
movq %r13, %rdi
movl %r12d, %esi
callq 0x28a6
leaq 0x58ac(%rip), %rax      # 0x7195
leaq 0xb900(%rip), %r14      # 0xd1f0
leaq 0x5892(%rip), %rdx      # 0x7189
movq %r14, %rdi
xorl %esi, %esi
xorl %ecx, %ecx
xorl %r8d, %r8d
movl %ebp, %r9d
pushq %rax
pushq $0x0
callq 0x26b6
popq %rax
popq %rcx
movq %r13, %rdi
movq %r14, %rsi
callq 0x1b3f
leaq 0x5898(%rip), %rax      # 0x71b8
leaq 0x5882(%rip), %r10      # 0x71a9
leaq 0xb9ba(%rip), %rbx      # 0xd2e8
movq %rbx, %rdi
movl %r12d, %esi
movl %r12d, %ebp
xorl %edx, %edx
leaq -0x4be(%rip), %rcx      # 0x1482
movq %rcx, %r12
xorl %r8d, %r8d
movl %r15d, %r9d
pushq %rax
pushq %r10
callq 0x26b6
popq %rax
popq %rcx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1b3f
movq %rbx, %rdi
movl %r15d, %esi
callq 0x28a6
leaq 0x5867(%rip), %rax      # 0x71d7
leaq 0xba69(%rip), %r14      # 0xd3e0
leaq 0x5853(%rip), %rdx      # 0x71d1
movq %r14, %rdi
xorl %esi, %esi
xorl %ecx, %ecx
xorl %r8d, %r8d
pushq $0x6
popq %r9
pushq %rax
pushq $0x0
callq 0x26b6
popq %rax
popq %rcx
movq %r13, %rdi
movq %r14, %rsi
callq 0x1b3f
leaq 0x583d(%rip), %rax      # 0x71e5
leaq 0xbb29(%rip), %r13      # 0xd4d8
movq %r13, %rdi
movl %ebp, %esi
xorl %edx, %edx
movq %r12, %rcx
xorl %r8d, %r8d
movl %r15d, %r9d
pushq %rax
movq %rax, %r15
leaq 0x574f(%rip), %rbp      # 0x7119
pushq %rbp
callq 0x26b6
popq %rax
popq %rcx
movq %r14, %rdi
movq %r13, %rsi
callq 0x1b3f
pushq $0x4
popq %rsi
movq %r13, %rdi
callq 0x28a6
leaq 0xbbe1(%rip), %r14      # 0xd5d0
movq %r14, %rdi
xorl %esi, %esi
leaq 0x57d6(%rip), %rdx      # 0x71d1
xorl %ecx, %ecx
xorl %r8d, %r8d
pushq $0x6
popq %r9
leaq 0x57cc(%rip), %rax      # 0x71d7
pushq %rax
pushq $0x0
callq 0x26b6
popq %rax
popq %rcx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1b3f
leaq 0xbca1(%rip), %rbx      # 0xd6c8
movq %rbx, %rdi
pushq $0x1
popq %rsi
xorl %edx, %edx
movq %r12, %rcx
xorl %r8d, %r8d
pushq $0x2
popq %r9
pushq %r15
pushq %rbp
callq 0x26b6
popq %rax
popq %rcx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1b3f
pushq $0x3
popq %rsi
movq %rbx, %rdi
callq 0x28a6
movq (%rsp), %rdi
callq 0x2903
callq 0x2b4f
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq