// File: /workspace/github_c_makefile_star2_O0/sachinites[P]CommandParser/cmd_hier.c
// Function: build_mode_console_name
void
build_mode_console_name(param_t *dst_param){

    assert(dst_param);
    assert(dst_param != &root);/*This fn should not be called for root*/

    int i = MAX_CMD_TREE_DEPTH -1;
    size_t token_cnt = 0;
    
    char** tokens = NULL;
    char *append_string = NULL;

    static char cmd_names[MAX_CMD_TREE_DEPTH][LEAF_VALUE_HOLDER_SIZE];
    char *admin_set_console_name = NULL;

    tokens = tokenizer(console_name, '>', &token_cnt);
    admin_set_console_name = tokens[0];
    sprintf(console_name, "%s> ", admin_set_console_name);
    
    do{
        assert(i != -1); 
        if(IS_PARAM_CMD(dst_param))
            append_string = GET_CMD_NAME(dst_param);
        else
            append_string = GET_LEAF_VALUE_PTR(dst_param);

        strncpy(cmd_names[i], append_string, strlen(append_string));
        i--;
        dst_param = dst_param->parent;
    }while(dst_param != &root);

    for(i = i+1; i < MAX_CMD_TREE_DEPTH -1; i++){
        strcat(console_name, cmd_names[i]);
        strcat(console_name, "-");
    }

    strcat(console_name, cmd_names[i]);
    memset(cmd_names, 0, MAX_CMD_TREE_DEPTH * LEAF_VALUE_HOLDER_SIZE);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x3865
jmp 0x3884
leaq 0x70e8(%rip), %rdi      # 0xa954
leaq 0x6a97(%rip), %rsi      # 0xa30a
movl $0x2cf, %edx            # imm = 0x2CF
leaq 0x70df(%rip), %rcx      # 0xa95e
callq 0x10c0
leaq 0xd1fd(%rip), %rax      # 0x10a88
cmpq %rax, -0x8(%rbp)
je 0x3893
jmp 0x38b2
leaq 0x70ec(%rip), %rdi      # 0xa986
leaq 0x6a69(%rip), %rsi      # 0xa30a
movl $0x2d0, %edx            # imm = 0x2D0
leaq 0x70b1(%rip), %rcx      # 0xa95e
callq 0x10c0
movl $0xf, -0xc(%rbp)
movq $0x0, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
leaq 0xf500(%rip), %rdi      # 0x12de0
movl $0x3e, %esi
leaq -0x18(%rbp), %rdx
callq 0x6270
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdx
leaq 0xf4d8(%rip), %rdi      # 0x12de0
leaq 0x708a(%rip), %rsi      # 0xa999
movb $0x0, %al
callq 0x1200
cmpl $-0x1, -0xc(%rbp)
je 0x391e
jmp 0x393d
leaq 0x7079(%rip), %rdi      # 0xa99e
leaq 0x69de(%rip), %rsi      # 0xa30a
movl $0x2e0, %edx            # imm = 0x2E0
leaq 0x7026(%rip), %rcx      # 0xa95e
callq 0x10c0
movq -0x8(%rbp), %rax
cmpl $0x0, (%rax)
jne 0x3954
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
jmp 0x3964
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
addq $0x4, %rax
movq %rax, -0x28(%rbp)
movslq -0xc(%rbp), %rcx
leaq 0xf071(%rip), %rax      # 0x129e0
shlq $0x6, %rcx
addq %rcx, %rax
movq %rax, -0x40(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x28(%rbp), %rdi
callq 0x1090
movq -0x40(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq %rax, %rdx
callq 0x1050
movl -0xc(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq 0xe0(%rax), %rax
movq %rax, -0x8(%rbp)
leaq 0xd0ce(%rip), %rax      # 0x10a88
cmpq %rax, -0x8(%rbp)
jne 0x3916
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
cmpl $0xf, -0xc(%rbp)
jge 0x3a0f
movslq -0xc(%rbp), %rax
leaq 0xf002(%rip), %rsi      # 0x129e0
shlq $0x6, %rax
addq %rax, %rsi
leaq 0xf3f4(%rip), %rdi      # 0x12de0
callq 0x11f0
leaq 0xf3e8(%rip), %rdi      # 0x12de0
leaq 0x6fa7(%rip), %rsi      # 0xa9a6
callq 0x11f0
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x39cd
movslq -0xc(%rbp), %rax
leaq 0xefc6(%rip), %rsi      # 0x129e0
shlq $0x6, %rax
addq %rax, %rsi
leaq 0xf3b8(%rip), %rdi      # 0x12de0
callq 0x11f0
leaq 0xefac(%rip), %rdi      # 0x129e0
xorl %esi, %esi
movl $0x400, %edx            # imm = 0x400
callq 0x10d0
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)