LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/sachinites[P]CommandParser/serialize.c
// Function: serialize_buffer_skip
void
serialize_buffer_skip(ser_buff_t *b, int size){
	int available_size = b->size - b->next;

	if(available_size >= size){
		b->next += size;
		return;
	}

	while(available_size < size){
		b->size = b->size * 2;
		available_size = b->size - b->next;
	}	

	b->b = realloc(b->b, b->size);	
	b->next += size;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
movl 0x8(%rdi), %ecx
movl 0xc(%rdi), %eax
subl %eax, %ecx
cmpl %esi, %ecx
jge 0x451f
movl 0x8(%rbx), %ecx
addl %ecx, %ecx
movl %ecx, %edx
subl %eax, %edx
cmpl %ebp, %edx
jl 0x4501
movl %ecx, 0x8(%rbx)
movq (%rbx), %rdi
movslq %ecx, %rsi
callq 0x11d0
movq %rax, (%rbx)
movl 0xc(%rbx), %eax
addl %ebp, %eax
movl %eax, 0xc(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/sachinites[P]CommandParser/serialize.c
// Function: serialize_int
void serialize_int(ser_buff_t *b, int data){
    if (b == NULL) assert(0);
    ser_buff_t *buff = (ser_buff_t *)(b);
    int available_size = buff->size - buff->next;
    char isResize = 0;

    while(available_size < sizeof(int)){
        buff->size = buff->size * 2;
        available_size = buff->size - buff->next;
        isResize = 1;
    }

    if(isResize == 0){
        memcpy((char *)buff->b + buff->next, &data, sizeof(int));
        buff->next += sizeof(int);
        return;
    }

    // resize of the buffer
    buff->b = realloc(buff->b, buff->size); 
    memcpy((char *)buff->b + buff->next, &data, sizeof(int));
    buff->next += sizeof(int);
    return;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x45e0
movl %esi, %ebp
movq %rdi, %rbx
movl 0x8(%rdi), %ecx
movslq 0xc(%rdi), %rax
subl %eax, %ecx
cmpl $0x3, %ecx
ja 0x45ca
movl 0x8(%rbx), %ecx
addl %ecx, %ecx
movl %ecx, %edx
subl %eax, %edx
cmpl $0x4, %edx
jb 0x45a5
movl %ecx, 0x8(%rbx)
movq (%rbx), %rdi
movslq %ecx, %rsi
callq 0x11d0
movq %rax, (%rbx)
movslq 0xc(%rbx), %rcx
movl %ebp, (%rax,%rcx)
jmp 0x45d3
movq (%rbx), %rcx
movl %ebp, (%rcx,%rax)
movl 0xc(%rbx), %ecx
addl $0x4, %ecx
movl %ecx, 0xc(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
leaq 0x3d1a(%rip), %rdi      # 0x8301
leaq 0x473c(%rip), %rsi      # 0x8d2a
leaq 0x47ac(%rip), %rcx      # 0x8da1
movl $0x5b, %edx
callq 0x10f0
// File: /workspace/github_c_makefile_star2_O1/sachinites[P]CommandParser/serialize.c
// Function: serialize_int8
void serialize_int8(ser_buff_t *b, char data){
    if (b == NULL) assert(0);
    ser_buff_t *buff = (ser_buff_t *)(b);
    int available_size = buff->size - buff->next;
    char isResize = 0;

    while(available_size < sizeof(char)){
        buff->size = buff->size * 2;
        available_size = buff->size - buff->next;
        isResize = 1;
    }

    if(isResize == 0){
        memcpy((char *)buff->b + buff->next, &data, sizeof(char));
        buff->next += sizeof(char);
        return;
    }

    // resize of the buffer
    buff->b = realloc(buff->b, buff->size); 
    memcpy((char *)buff->b + buff->next, &data, sizeof(char));
    buff->next += sizeof(char);
    return;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x464f
movl %esi, %ebp
movq %rdi, %rbx
movslq 0xc(%rdi), %rax
cmpl %eax, 0x8(%rdi)
jne 0x4639
movl 0x8(%rbx), %ecx
addl %ecx, %ecx
cmpl %eax, %ecx
je 0x4618
movl %ecx, 0x8(%rbx)
movq (%rbx), %rdi
movslq %ecx, %rsi
callq 0x11d0
movq %rax, (%rbx)
movslq 0xc(%rbx), %rcx
movb %bpl, (%rax,%rcx)
jmp 0x4643
movq (%rbx), %rcx
movb %bpl, (%rcx,%rax)
movl 0xc(%rbx), %ecx
incl %ecx
movl %ecx, 0xc(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
leaq 0x3cab(%rip), %rdi      # 0x8301
leaq 0x46cd(%rip), %rsi      # 0x8d2a
leaq 0x4763(%rip), %rcx      # 0x8dc7
movl $0x75, %edx
callq 0x10f0
// File: /workspace/github_c_makefile_star2_O1/sachinites[P]CommandParser/serialize.c
// Function: serialize_uint32
void serialize_uint32(ser_buff_t *b, unsigned int data){
    if (b == NULL) assert(0);
    ser_buff_t *buff = (ser_buff_t *)(b);
    int available_size = buff->size - buff->next;
    char isResize = 0;

    while(available_size < sizeof(unsigned int)){
        buff->size = buff->size * 2;
        available_size = buff->size - buff->next;
        isResize = 1;
    }

    if(isResize == 0){
        memcpy((char *)buff->b + buff->next, &data, sizeof(unsigned int));
        buff->next += sizeof(unsigned int);
        return;
    }

    // resize of the buffer
    buff->b = realloc(buff->b, buff->size); 
    memcpy((char *)buff->b + buff->next, &data, sizeof(unsigned int));
    buff->next += sizeof(unsigned int);
    return;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x47ae
movl %esi, %ebp
movq %rdi, %rbx
movl 0x8(%rdi), %ecx
movslq 0xc(%rdi), %rax
subl %eax, %ecx
cmpl $0x3, %ecx
ja 0x4798
movl 0x8(%rbx), %ecx
addl %ecx, %ecx
movl %ecx, %edx
subl %eax, %edx
cmpl $0x4, %edx
jb 0x4773
movl %ecx, 0x8(%rbx)
movq (%rbx), %rdi
movslq %ecx, %rsi
callq 0x11d0
movq %rax, (%rbx)
movslq 0xc(%rbx), %rcx
movl %ebp, (%rax,%rcx)
jmp 0x47a1
movq (%rbx), %rcx
movl %ebp, (%rcx,%rax)
movl 0xc(%rbx), %ecx
addl $0x4, %ecx
movl %ecx, 0xc(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
leaq 0x3b4c(%rip), %rdi      # 0x8301
leaq 0x456e(%rip), %rsi      # 0x8d2a
leaq 0x467d(%rip), %rcx      # 0x8e40
movl $0xc1, %edx
callq 0x10f0
// File: /workspace/github_c_makefile_star2_O1/sachinites[P]CommandParser/serialize.c
// Function: serialize_float
void serialize_float(ser_buff_t *b, float data){
    if (b == NULL) assert(0);
    ser_buff_t *buff = (ser_buff_t *)(b);
    int available_size = buff->size - buff->next;
    char isResize = 0;

    while(available_size < sizeof(float)){
        buff->size = buff->size * 2;
        available_size = buff->size - buff->next;
        isResize = 1;
    }

    if(isResize == 0){
        memcpy((char *)buff->b + buff->next, &data, sizeof(float));
        buff->next += sizeof(float);
        return;
    }

    // resize of the buffer
    buff->b = realloc(buff->b, buff->size); 
    memcpy((char *)buff->b + buff->next, &data, sizeof(float));
    buff->next += sizeof(float);
    return;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
testq %rdi, %rdi
je 0x4835
movq %rdi, %rbx
movl 0x8(%rdi), %ecx
movslq 0xc(%rdi), %rax
subl %eax, %ecx
cmpl $0x3, %ecx
ja 0x481e
movss %xmm0, 0xc(%rsp)
movl 0x8(%rbx), %ecx
addl %ecx, %ecx
movl %ecx, %edx
subl %eax, %edx
cmpl $0x4, %edx
jb 0x47f1
movl %ecx, 0x8(%rbx)
movq (%rbx), %rdi
movslq %ecx, %rsi
callq 0x11d0
movq %rax, (%rbx)
movslq 0xc(%rbx), %rcx
movss 0xc(%rsp), %xmm0
movss %xmm0, (%rax,%rcx)
jmp 0x4829
movq (%rbx), %rcx
movss %xmm0, (%rcx,%rax)
movl 0xc(%rbx), %ecx
addl $0x4, %ecx
movl %ecx, 0xc(%rbx)
addq $0x10, %rsp
popq %rbx
retq
leaq 0x3ac5(%rip), %rdi      # 0x8301
leaq 0x44e7(%rip), %rsi      # 0x8d2a
leaq 0x4628(%rip), %rcx      # 0x8e72
movl $0xdc, %edx
callq 0x10f0
// File: /workspace/github_c_makefile_star2_O1/sachinites[P]CommandParser/serialize.c
// Function: serialize_double
void serialize_double(ser_buff_t *b, double data){
    if (b == NULL) assert(0);
    ser_buff_t *buff = (ser_buff_t *)(b);
    int available_size = buff->size - buff->next;
    char isResize = 0;

    while(available_size < sizeof(double)){
        buff->size = buff->size * 2;
        available_size = buff->size - buff->next;
        isResize = 1;
    }

    if(isResize == 0){
        memcpy((char *)buff->b + buff->next, &data, sizeof(double));
        buff->next += sizeof(double);
        return;
    }

    // resize of the buffer
    buff->b = realloc(buff->b, buff->size); 
    memcpy((char *)buff->b + buff->next, &data, sizeof(double));
    buff->next += sizeof(double);
    return;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
testq %rdi, %rdi
je 0x48bc
movq %rdi, %rbx
movl 0x8(%rdi), %ecx
movslq 0xc(%rdi), %rax
subl %eax, %ecx
cmpl $0x7, %ecx
ja 0x48a5
movsd %xmm0, 0x8(%rsp)
movl 0x8(%rbx), %ecx
addl %ecx, %ecx
movl %ecx, %edx
subl %eax, %edx
cmpl $0x8, %edx
jb 0x4878
movl %ecx, 0x8(%rbx)
movq (%rbx), %rdi
movslq %ecx, %rsi
callq 0x11d0
movq %rax, (%rbx)
movslq 0xc(%rbx), %rcx
movsd 0x8(%rsp), %xmm0
movsd %xmm0, (%rax,%rcx)
jmp 0x48b0
movq (%rbx), %rcx
movsd %xmm0, (%rcx,%rax)
movl 0xc(%rbx), %ecx
addl $0x8, %ecx
movl %ecx, 0xc(%rbx)
addq $0x10, %rsp
popq %rbx
retq
leaq 0x3a3e(%rip), %rdi      # 0x8301
leaq 0x4460(%rip), %rsi      # 0x8d2a
leaq 0x45cb(%rip), %rcx      # 0x8e9c
movl $0xf7, %edx
callq 0x10f0
// File: /workspace/github_c_makefile_star2_O1/sachinites[P]CommandParser/serialize.c
// Function: serialize_string
void serialize_string(ser_buff_t *b, char *data, int nbytes){
    if (b == NULL) assert(0);
    ser_buff_t *buff = (ser_buff_t *)(b);
    int available_size = buff->size - buff->next;
    char isResize = 0;

    while(available_size < nbytes){
        buff->size = buff->size * 2;
        available_size = buff->size - buff->next;
        isResize = 1;
    }

    if(isResize == 0){
        memcpy((char *)buff->b + buff->next, data, nbytes);
        buff->next += nbytes;
        return;
    }

    // resize of the buffer
    buff->b = realloc(buff->b, buff->size); 
    memcpy((char *)buff->b + buff->next, data, nbytes);
    buff->next += nbytes;
    return;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x4959
movl %edx, %ebx
movq %rsi, %r15
movq %rdi, %r14
movl 0x8(%rdi), %eax
movslq 0xc(%rdi), %rdi
subl %edi, %eax
cmpl %edx, %eax
jge 0x4934
movl 0x8(%r14), %eax
addl %eax, %eax
movl %eax, %ecx
subl %edi, %ecx
cmpl %ebx, %ecx
jl 0x4901
movl %eax, 0x8(%r14)
movq (%r14), %rdi
movslq %eax, %rsi
callq 0x11d0
movq %rax, (%r14)
movslq 0xc(%r14), %r12
movq %r12, %rdi
addq %rax, %rdi
movslq %ebx, %rdx
movq %r15, %rsi
callq 0x1190
jmp 0x4946
addq (%r14), %rdi
movslq %ebx, %rdx
movq %r15, %rsi
callq 0x1190
movl 0xc(%r14), %r12d
addl %ebx, %r12d
movl %r12d, 0xc(%r14)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x39a1(%rip), %rdi      # 0x8301
leaq 0x43c3(%rip), %rsi      # 0x8d2a
leaq 0x455a(%rip), %rcx      # 0x8ec8
movl $0x110, %edx            # imm = 0x110
callq 0x10f0
// File: /workspace/github_c_makefile_star2_O1/sachinites[P]CommandParser/serialize.c
// Function: truncate_serialize_buffer
void truncate_serialize_buffer(ser_buff_t **b){
	ser_buff_t *clone = NULL;

	if((*b)->next == (*b)->size){
		return;
	}
	init_serialized_buffer_of_defined_size(&clone, (*b)->next);
	memcpy(clone->b, (*b)->b, (*b)->next);
	clone->next = clone->size;
	free_serialize_buffer(*b);
	*b = clone;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq (%rdi), %r14
movl 0xc(%r14), %ebp
cmpl 0x8(%r14), %ebp
je 0x49eb
movq %rdi, %rbx
movslq %ebp, %r15
movl $0x1, %edi
movl $0x18, %esi
callq 0x1140
movq %rax, %r12
movl $0x1, %edi
movq %r15, %rsi
callq 0x1140
movq %rax, (%r12)
movl %ebp, 0x8(%r12)
movq $0x0, 0xc(%r12)
movq (%r14), %rsi
movslq 0xc(%r14), %rdx
movq %rax, %rdi
callq 0x1190
movl %ebp, 0xc(%r12)
movq (%r14), %rdi
callq 0x1030
movq %r14, %rdi
callq 0x1030
movq %r12, (%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/sachinites[P]CommandParser/serialize.c
// Function: print_buffer_details
void print_buffer_details(ser_buff_t *b, const char *fn, int lineno){
#if 1
    printf("%s():%d : starting address = %p\n", fn, lineno, b);
    printf("size = %d\n", b->size);
    printf("next = %d\n", b->next);
#endif
    return;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0x44fa(%rip), %rdi      # 0x8ef9
movq %rbx, %rcx
xorl %eax, %eax
callq 0x10e0
movl 0x8(%rbx), %esi
leaq 0x4507(%rip), %rdi      # 0x8f1a
xorl %eax, %eax
callq 0x10e0
movl 0xc(%rbx), %esi
leaq 0x4501(%rip), %rdi      # 0x8f25
xorl %eax, %eax
popq %rbx
jmp 0x10e0
// File: /workspace/github_c_makefile_star2_O1/sachinites[P]CommandParser/serialize.c
// Function: de_serialize_string
void 
de_serialize_string(char *dest, ser_buff_t *b, int size){
	if(!b || !b->b) assert(0);
	if(!size) assert(0);;
	if((b->size - b->next)< size) assert(0);	 
	memcpy(dest, b->b + b->next, size);
	b->next += size;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rsi, %rsi
je 0x4a6b
movq %rsi, %r14
movq (%rsi), %rsi
testq %rsi, %rsi
je 0x4a6b
movl %edx, %ebx
testl %edx, %edx
je 0x4a8a
movl 0x8(%r14), %ecx
movslq 0xc(%r14), %rax
subl %eax, %ecx
cmpl %ebx, %ecx
jl 0x4aa9
addq %rax, %rsi
movslq %ebx, %rdx
callq 0x1190
addl %ebx, 0xc(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x388f(%rip), %rdi      # 0x8301
leaq 0x42b1(%rip), %rsi      # 0x8d2a
leaq 0x44b0(%rip), %rcx      # 0x8f30
movl $0x143, %edx            # imm = 0x143
callq 0x10f0
leaq 0x3870(%rip), %rdi      # 0x8301
leaq 0x4292(%rip), %rsi      # 0x8d2a
leaq 0x4491(%rip), %rcx      # 0x8f30
movl $0x144, %edx            # imm = 0x144
callq 0x10f0
leaq 0x3851(%rip), %rdi      # 0x8301
leaq 0x4273(%rip), %rsi      # 0x8d2a
leaq 0x4472(%rip), %rcx      # 0x8f30
movl $0x145, %edx            # imm = 0x145
callq 0x10f0
// File: /workspace/github_c_makefile_star2_O1/sachinites[P]CommandParser/serialize.c
// Function: copy_in_serialized_buffer_by_offset
void copy_in_serialized_buffer_by_offset(ser_buff_t *b, int size, char *value, int offset){
	if((b->size - b->next) < size){
		printf("%s(): Error : Insufficient buffer space\n", __FUNCTION__);
		return;
	}
	
	if(offset > b->size){
		printf("%s(): Error : Attemt to write outside buffer boundaries\n", __FUNCTION__);
		return;
	}
	
	memcpy(b->b + offset, value, size);
}

// Assembly:
movl 0x8(%rdi), %eax
movl %eax, %r8d
subl 0xc(%rdi), %r8d
cmpl %esi, %r8d
jge 0x4ae0
leaq 0x4486(%rip), %rdi      # 0x8f64
jmp 0x4aeb
cmpl %ecx, %eax
jge 0x4af9
leaq 0x44c6(%rip), %rdi      # 0x8fb1
leaq 0x449b(%rip), %rsi      # 0x8f8d
xorl %eax, %eax
jmp 0x10e0
movslq %ecx, %rax
addq (%rdi), %rax
movslq %esi, %rcx
movq %rax, %rdi
movq %rdx, %rsi
movq %rcx, %rdx
jmp 0x1190
// File: /workspace/github_c_makefile_star2_O1/sachinites[P]CommandParser/string_util.c
// Function: tokenizer
char** tokenizer(char* _a_str, const char a_delim, size_t *token_cnt){
   
    char *token = NULL;
    int i = 0;
    char delim[2];
    memset(a_str, 0, CONS_INPUT_BUFFER_SIZE);
    strncpy(a_str, _a_str, strlen(_a_str));
    a_str[strlen(_a_str)] = '\0';

    string_space_trim(a_str);

    if(strlen(a_str) < 1){
        *token_cnt = 0;
        return NULL;
    }

    delim[0] = a_delim;
    delim[1] = '\0';

    token = strtok(a_str, delim);
    if(token){
        untokenize(i);
        strncpy(tokens[i], token, strlen(token));
        i++;
    }
    else{
        *token_cnt = 0;
        return NULL;
    }
    
    /* walk through other tokens */
    while( token != NULL ) 
    {
        token = strtok(NULL, delim);
        if(token){
            untokenize(i);
            strncpy(tokens[i], token, strlen(token));
            i++;
            if(i == MAX_CMD_TREE_DEPTH + 1){
                //printf("Warning : Max token limit (= %d) support exceeded\n", MAX_CMD_TREE_DEPTH);
                re_init_tokens(MAX_CMD_TREE_DEPTH);
                *token_cnt = 0;
                return &tokens[0];
            }
        }
    } 
    *token_cnt = i;
    return &tokens[0];
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movl %esi, %ebp
movq %rdi, %r14
leaq 0xdb95(%rip), %r15      # 0x127a0
xorl %r12d, %r12d
movl $0x800, %edx            # imm = 0x800
movq %r15, %rdi
xorl %esi, %esi
callq 0x1100
movq %r14, %rdi
callq 0x10c0
movq %r15, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x1060
movq %r14, %rdi
callq 0x10c0
movb $0x0, (%rax,%r15)
movq %r15, %rdi
callq 0x4d5c
cmpb $0x0, 0xdb51(%rip)      # 0x127a0
je 0x4d1b
leaq 0x6(%rsp), %rsi
movb %bpl, (%rsi)
movb $0x0, 0x1(%rsi)
leaq 0xdb38(%rip), %rdi      # 0x127a0
callq 0x1200
testq %rax, %rax
je 0x4d18
movq %rax, %r14
movq 0xdaa0(%rip), %rax      # 0x12720
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%rax)
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
movq 0xda87(%rip), %r15      # 0x12720
movq %r14, %rdi
callq 0x10c0
movq %r15, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x1060
movl $0x1, %ebp
leaq 0x6(%rsp), %r15
leaq 0xda60(%rip), %r14      # 0x12720
xorl %edi, %edi
movq %r15, %rsi
callq 0x1200
movq %rax, %r12
testq %rax, %rax
je 0x4d0e
movl %ebp, %eax
movq (%r14,%rax,8), %rax
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%rax)
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
movslq %ebp, %rbp
movq (%r14,%rbp,8), %r13
movq %r12, %rdi
callq 0x10c0
movq %r13, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0x1060
incl %ebp
cmpl $0x11, %ebp
je 0x4d33
testq %r12, %r12
jne 0x4cc0
movslq %ebp, %r12
jmp 0x4d1e
xorl %r12d, %r12d
xorl %r14d, %r14d
movq %r12, (%rbx)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %r12d, %r12d
xorps %xmm0, %xmm0
xorl %eax, %eax
movq (%rax,%r14), %rcx
movups %xmm0, 0x30(%rcx)
movups %xmm0, 0x20(%rcx)
movups %xmm0, 0x10(%rcx)
movups %xmm0, (%rcx)
addq $0x8, %rax
cmpq $0x80, %rax
jne 0x4d3b
jmp 0x4d1e
// File: /workspace/github_c_makefile_star2_O1/sachinites[P]CommandParser/string_util.c
// Function: string_space_trim
void
string_space_trim(char *string){

    if(!string)
        return;

    char* ptr = string;
    int len = strlen(ptr);

    if(!len){
        return;
    }

    if(!isspace(ptr[0]) && !isspace(ptr[len-1])){
        return;
    }

    while(len-1 > 0 && isspace(ptr[len-1])){
        ptr[--len] = 0;
    }

    while(*ptr && isspace(*ptr)){
        ++ptr, --len;
    }

    memmove(string, ptr, len + 1);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x4d9b
movq %rdi, %rbx
callq 0x10c0
movq %rax, %r14
testl %r14d, %r14d
je 0x4d9b
callq 0x1290
movq (%rax), %rcx
movsbq (%rbx), %rdx
testb $0x20, 0x1(%rcx,%rdx,2)
jne 0x4da3
leal -0x1(%r14), %edx
movslq %edx, %rdx
movsbq (%rbx,%rdx), %rdx
testb $0x20, 0x1(%rcx,%rdx,2)
jne 0x4da3
addq $0x8, %rsp
popq %rbx
popq %r14
retq
cmpl $0x2, %r14d
jl 0x4dd9
andl $0x7fffffff, %r14d      # imm = 0x7FFFFFFF
movq (%rax), %rcx
movsbq -0x1(%rbx,%r14), %rdx
testb $0x20, 0x1(%rcx,%rdx,2)
je 0x4dd9
movb $0x0, -0x1(%rbx,%r14)
leaq -0x1(%r14), %rcx
cmpq $0x2, %r14
movq %rcx, %r14
jg 0x4db0
movl $0x1, %r14d
movb (%rbx), %cl
testb %cl, %cl
je 0x4dff
movq (%rax), %rax
movq %rbx, %rsi
movsbq %cl, %rcx
testb $0x20, 0x1(%rax,%rcx,2)
je 0x4e02
decl %r14d
movb 0x1(%rsi), %cl
incq %rsi
testb %cl, %cl
jne 0x4de5
jmp 0x4e02
movq %rbx, %rsi
incl %r14d
movslq %r14d, %rdx
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x11e0
// File: /workspace/github_c_makefile_star2_O1/sachinites[P]CommandParser/string_util.c
// Function: print_tokens
void
print_tokens(unsigned int index){
    
    unsigned int i = 0;
    for ( ; i < index; i++)
    {
        if(tokens[i] == NULL)
            break;

        printf("%s ", tokens[i]);
    }
}

// Assembly:
testl %edi, %edi
je 0x4e4f
pushq %r15
pushq %r14
pushq %rbx
movl %edi, %ebx
leaq 0xd8f7(%rip), %r15      # 0x12720
leaq 0x41fa(%rip), %r14      # 0x902a
movq (%r15), %rsi
testq %rsi, %rsi
je 0x4e4a
movq %r14, %rdi
xorl %eax, %eax
callq 0x10e0
addq $0x8, %r15
decl %ebx
jne 0x4e30
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/sachinites[P]CommandParser/string_util.c
// Function: replaceSubstring
void replaceSubstring(char string[], char sub[], char new_str[])
{
    int stringLen, subLen, newLen;
    int i = 0, j, k;
    int flag = 0, start, end;
    stringLen = strlen(string);
    subLen = strlen(sub);
    newLen = strlen(new_str);

    for (i = 0; i < stringLen; i++)
    {
        flag = 0;
        start = i;
        for (j = 0; string[i] == sub[j]; j++, i++)
            if (j == subLen - 1)
                flag = 1;
        end = i;
        if (flag == 0)
            i -= j;
        else
        {
            for (j = start; j < end; j++)
            {
                for (k = start; k < stringLen; k++)
                    string[k] = string[k + 1];
                stringLen--;
                i--;
            }

            for (j = start; j < start + newLen; j++)
            {
                for (k = stringLen; k >= j; k--)
                    string[k + 1] = string[k];
                string[j] = new_str[j - start];
                stringLen++;
                i++;
            }
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
callq 0x10c0
movq %rax, %r12
movq %rbx, %rdi
callq 0x10c0
testl %r12d, %r12d
jle 0x4f7c
movq %rax, %r13
movq %r14, %rdi
callq 0x10c0
decl %eax
leaq 0x1(%r15), %rcx
xorl %r8d, %r8d
movl $0x1, %edx
movslq %r8d, %rsi
movb (%r15,%rsi), %r11b
movb $0x1, %r10b
movl $0x0, %r9d
movl %r8d, %edi
cmpb (%r14), %r11b
jne 0x4edb
leaq (%rcx,%rsi), %rdi
xorl %r9d, %r9d
xorl %r10d, %r10d
movq %r9, %r11
cmpq %r9, %rax
cmovel %edx, %r10d
movb (%rdi,%r9), %bpl
incq %r9
cmpb 0x1(%r14,%r11), %bpl
je 0x4eb8
leal (%r8,%r9), %edi
testl %r10d, %r10d
sete %r10b
testb %r10b, %r10b
je 0x4ee8
subl %r9d, %edi
jmp 0x4f6e
cmpl %edi, %r8d
jge 0x4f1e
movslq %r12d, %r12
movl %r8d, %r9d
cmpq %rsi, %r12
jle 0x4f10
movq %rsi, %r10
movb (%rcx,%r10), %r11b
movb %r11b, -0x1(%rcx,%r10)
leaq 0x1(%r10), %r11
movq %r11, %r10
cmpq %r12, %r11
jl 0x4efb
decq %r12
incl %r9d
cmpl %edi, %r9d
jne 0x4ef3
movl %r8d, %edi
testl %r13d, %r13d
jle 0x4f6e
addl %r13d, %r8d
movslq %r12d, %r12
movslq %r8d, %r8
leaq 0x1(%r12), %r9
movq %rsi, %r10
movslq %r12d, %r11
cmpq %r10, %r11
jl 0x4f50
movq %r9, %r11
movb -0x1(%r15,%r11), %bpl
movb %bpl, (%r15,%r11)
decq %r11
cmpq %r10, %r11
jg 0x4f3f
movq %r10, %r11
subq %rsi, %r11
movb (%rbx,%r11), %r11b
movb %r11b, (%r15,%r10)
incq %r12
incl %edi
incq %r10
incq %r9
cmpq %r8, %r10
jl 0x4f34
incl %edi
movl %edi, %r8d
cmpl %r12d, %edi
jl 0x4e96
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/sachinites[P]CommandParser/string_util.c
// Function: grep
int
grep (char string[], int string_size, char pattern[]) {

    int rc = 0;
    char *token;

    if (!string_size) return 0;
    
    char *temp_buff = (char *)calloc(1, string_size);
    
    memcpy(temp_buff, string, string_size);
    memset (string, 0, string_size);

    token = strtok(temp_buff, "\n");

    while (token) {

        if (pattern_match(token, strlen(token), pattern)) {

            rc += sprintf(string + rc, "%s\n", token);
        }
        token = strtok(NULL, "\n");
    }
    free(temp_buff);
    return rc;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testl %esi, %esi
je 0x506c
movq %rdx, %rbx
movq %rdi, %r14
movslq %esi, %r15
movl $0x1, %edi
movq %r15, %rsi
callq 0x1140
movq %rax, %r13
movq %rax, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x1190
xorl %r12d, %r12d
movq %r14, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x1100
leaq 0x4810(%rip), %rsi      # 0x9807
movq %r13, (%rsp)
movq %r13, %rdi
callq 0x1200
testq %rax, %rax
je 0x5061
movq %rax, %r15
leaq 0x47f5(%rip), %r13      # 0x9807
leaq 0x3a4a(%rip), %rbp      # 0x8a63
xorl %r12d, %r12d
movq %r15, %rdi
callq 0x10c0
testl %eax, %eax
je 0x504f
movq %r15, %rdi
movq %rbx, %rsi
callq 0x1280
testq %rax, %rax
je 0x504f
movslq %r12d, %r12
leaq (%r14,%r12), %rdi
movq %rbp, %rsi
movq %r15, %rdx
xorl %eax, %eax
callq 0x1240
addl %eax, %r12d
xorl %edi, %edi
movq %r13, %rsi
callq 0x1200
movq %rax, %r15
testq %rax, %rax
jne 0x501c
movq (%rsp), %rdi
callq 0x1030
jmp 0x506f
xorl %r12d, %r12d
movl %r12d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/sachinites[P]CommandParser/string_util.c
// Function: string_fetch_integer
uint64_t
string_fetch_integer(char *string, int string_size, int index) {

    int count = 0;
    char *token;

    if (!string_size) return 0;

    char *temp_buff = (char *)calloc(1, string_size);
    memcpy(temp_buff, string, string_size);
    
    token = strtok(temp_buff, " ");

    while (token) {

        if (!is_number(token)) {
            token = strtok(NULL, " ");
            continue;
        }

        count++;
        if (index == count) {
            free(temp_buff);
            return atoi(token);
        }
        
        token = strtok(NULL, " ");
    }
    free(temp_buff);
    return 0;
}

// Assembly:
testl %esi, %esi
je 0x5131
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movl %edx, %ebx
movq %rdi, %r15
movslq %esi, %r12
movl $0x1, %edi
movq %r12, %rsi
callq 0x1140
movq %rax, %r14
movq %rax, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x1190
leaq 0x38d5(%rip), %rsi      # 0x8994
movq %r14, %rdi
callq 0x1200
testq %rax, %rax
je 0x511d
movq %rax, %r12
xorl %r13d, %r13d
leaq 0x38bb(%rip), %r15      # 0x8994
movq %r12, %rax
movb (%rax), %cl
leal -0x30(%rcx), %edx
incq %rax
cmpb $0xa, %dl
jb 0x50dc
testb %cl, %cl
je 0x5101
xorl %edi, %edi
movq %r15, %rsi
callq 0x1200
movq %rax, %r12
testq %rax, %rax
jne 0x50d9
jmp 0x511d
incl %r13d
cmpl %ebx, %r13d
jne 0x50ed
movq %r14, %rdi
callq 0x1030
movq %r12, %rdi
callq 0x1210
cltq
jmp 0x5127
movq %r14, %rdi
callq 0x1030
xorl %eax, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/sachinites[P]CommandParser/clistd.c
// Function: boolean_validation_handler
CLI_VAL_RC
boolean_validation_handler(leaf_t *leaf, char *value_passed){

    if((strncmp(value_passed, "true", strlen("true")) == 0) || 
            (strncmp(value_passed, "false", strlen("false")) ==0))
        return VALIDATION_SUCCESS;

    return VALIDATION_FAILED;
}

// Assembly:
pushq %rbx
movq %rsi, %rbx
leaq 0x3ee0(%rip), %rsi      # 0x902e
movl $0x4, %edx
movq %rbx, %rdi
callq 0x1070
testl %eax, %eax
je 0x517d
leaq 0x3ecd(%rip), %rsi      # 0x9033
movl $0x5, %edx
movq %rbx, %rdi
callq 0x1070
movl %eax, %ecx
xorl %eax, %eax
negl %ecx
sbbl %eax, %eax
jmp 0x517f
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/sachinites[P]CommandParser/clistd.c
// Function: enable_disable_validation_handler
int
enable_disable_validation_handler(char *value_passed){

     if((strncmp(value_passed, "enable", strlen("enable")) == 0) || 
            (strncmp(value_passed, "disable", strlen("disable")) ==0))
        return VALIDATION_SUCCESS;

    return VALIDATION_FAILED;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0x333e(%rip), %rsi      # 0x84ca
movl $0x6, %edx
callq 0x1070
testl %eax, %eax
je 0x51b8
leaq 0x3339(%rip), %rsi      # 0x84da
movl $0x7, %edx
movq %rbx, %rdi
callq 0x1070
movl %eax, %ecx
xorl %eax, %eax
negl %ecx
sbbl %eax, %eax
jmp 0x51ba
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/sachinites[P]CommandParser/clistd.c
// Function: config_console_name_handler
int
config_console_name_handler(param_t *param, ser_buff_t *b, op_mode enable_or_disable){

    tlv_struct_t *tlv = NULL;

    TLV_LOOP_BEGIN(b, tlv){
        if(enable_or_disable == CONFIG_ENABLE)
            set_device_name(tlv->value);
        else{
            if(strncmp(tlv->value, console_name, strlen(tlv->value)) == 0)
                set_device_name(DEFAULT_DEVICE_NAME);
            else
                printf("Error : Incorrect device name\n");
        }
    }TLV_LOOP_END;
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rsi, %rsi
je 0x5260
movl %edx, %ebx
movq (%rsi), %r14
movq %rsi, %rdi
callq 0x44e6
cltq
shrq $0x2, %rax
movabsq $0x28f5c28f5c28f5c3, %rcx # imm = 0x28F5C28F5C28F5C3
mulq %rcx
movq %rdx, %r15
shrq $0x2, %r15
decl %r15d
je 0x524f
addq $0x24, %r14
leaq 0xbbf9(%rip), %r12      # 0x10e00
leaq 0x31f7(%rip), %r13      # 0x8405
leaq 0x42d6(%rip), %rbp      # 0x94eb
movq %r14, %rdi
cmpl $0x1, %ebx
je 0x5241
callq 0x10c0
movq %r14, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0x1070
testl %eax, %eax
je 0x523e
movq %rbp, %rdi
callq 0x1080
jmp 0x5246
movq %r13, %rdi
callq 0x2a45
addq $0x64, %r14
decl %r15d
jne 0x5215
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x3123(%rip), %rdi      # 0x838a
leaq 0x3dcb(%rip), %rsi      # 0x9039
leaq 0x3dcd(%rip), %rcx      # 0x9042
movl $0x8d, %edx
callq 0x10f0
// File: /workspace/github_c_makefile_star2_O1/sachinites[P]CommandParser/clistd.c
// Function: repeat_last_command
int
repeat_last_command(param_t *param, ser_buff_t *b, op_mode enable_or_disable){
    static char new_line_consume[2];
    char *last_cmd = get_last_command();
    printf("prev : %s", last_cmd);
    scanf("%c", new_line_consume);;
    parse_input_cmd(last_cmd, strlen(last_cmd), NULL);
    return 0;
}

// Assembly:
pushq %rbx
xorl %eax, %eax
callq 0x3421
movq %rax, %rbx
leaq 0x3df3(%rip), %rdi      # 0x9084
movq %rax, %rsi
xorl %eax, %eax
callq 0x10e0
leaq 0x3dec(%rip), %rdi      # 0x908e
leaq 0xdd27(%rip), %rsi      # 0x12fd0
xorl %eax, %eax
callq 0x1220
movq %rbx, %rdi
callq 0x10c0
movq %rbx, %rdi
movl %eax, %esi
xorl %edx, %edx
callq 0x3673
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/sachinites[P]CommandParser/clistd.c
// Function: mode_enter_callback
int
mode_enter_callback(param_t *param, ser_buff_t *b, op_mode enable_or_disable){
 
    if(param == libcli_get_root()){
        printf(ANSI_COLOR_YELLOW "Info : Mode not supported at root level\n" ANSI_COLOR_RESET);
        return 0;   
    }
    set_cmd_tree_cursor(param);
    build_mode_console_name(param);
    
    if(IS_APPLICATION_CALLBACK_HANDLER_REGISTERED(param))
        INVOKE_APPLICATION_CALLBACK_HANDLER(param, b, enable_or_disable);

    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
callq 0x1b3c
cmpq %r15, %rax
je 0x5304
movq %r15, %rdi
callq 0x1c87
movq %r15, %rdi
callq 0x2fc4
movq 0x10(%r15), %rax
testq %rax, %rax
je 0x5312
movq %r15, %rdi
movq %r14, %rsi
movl %ebx, %edx
callq *%rax
jmp 0x5312
leaq 0x3d86(%rip), %rdi      # 0x9091
xorl %eax, %eax
callq 0x10e0
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/sachinites[P]CommandParser/clistd.c
// Function: display_sub_options_callback
int
display_sub_options_callback(param_t *param, ser_buff_t *b, op_mode enable_or_disable){
    
    int i = 0;
    tlv_struct_t dummy;

    if(IS_APPLICATION_CALLBACK_HANDLER_REGISTERED(param))
        printf("<Enter>\n");

    for(i = CHILDREN_START_INDEX; i <= CHILDREN_END_INDEX; i++){
        if(param->options[i]){

            if(IS_PARAM_HIDDEN(param->options[i]))
                continue;

            if(IS_PARAM_CMD(param->options[i]) || IS_PARAM_NO_CMD(param->options[i])){
                printf(ANSI_COLOR_MAGENTA "nxt cmd  -> %-31s   |   %s\n" ANSI_COLOR_RESET, GET_CMD_NAME(param->options[i]), GET_PARAM_HELP_STRING(param->options[i]));
                continue;
            }
            printf(ANSI_COLOR_CYAN "nxt leaf -> %-32s  |   %s\n" ANSI_COLOR_RESET, GET_LEAF_TYPE_STR(param->options[i]), GET_PARAM_HELP_STRING(param->options[i]));
            continue;
        }
        break;
    }

    /*Means param is a leaf*/
    if(param->disp_callback){

        /*Add a dummy TLV to compensate for the cmd code TLV*/
        memset(&dummy, 0, sizeof(tlv_struct_t));
        collect_tlv(b, &dummy);
        printf(ANSI_COLOR_YELLOW "possible values :\n");
        param->disp_callback(param, b);
        printf(ANSI_COLOR_RESET);
    }
    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x70, %rsp
movq %rsi, %r14
movq %rdi, %rbx
cmpq $0x0, 0x10(%rdi)
je 0x5340
leaq 0x41ce(%rip), %rdi      # 0x9509
callq 0x1080
movl $0xf, %r13d
leaq 0x3d76(%rip), %r15      # 0x90c3
leaq 0x3d94(%rip), %r12      # 0x90e8
movq (%rbx,%r13,8), %rdx
testq %rdx, %rdx
je 0x53a1
cmpb $0x1, 0x18(%rdx)
je 0x5398
testl $0xfffffffd, (%rdx)     # imm = 0xFFFFFFFD
jne 0x5378
movq 0x8(%rdx), %rsi
addq $0x19, %rdx
movq %r15, %rdi
jmp 0x5391
movq 0x8(%rdx), %rax
movl (%rax), %edi
callq 0x1cfd
movq (%rbx,%r13,8), %rdx
addq $0x19, %rdx
movq %r12, %rdi
movq %rax, %rsi
xorl %eax, %eax
callq 0x10e0
incq %r13
cmpq $0x1c, %r13
jne 0x5354
cmpq $0x0, 0xe8(%rbx)
je 0x5402
xorps %xmm0, %xmm0
movq %rsp, %rsi
movaps %xmm0, 0x50(%rsi)
movaps %xmm0, 0x40(%rsi)
movaps %xmm0, 0x30(%rsi)
movaps %xmm0, 0x20(%rsi)
movaps %xmm0, 0x10(%rsi)
movaps %xmm0, (%rsi)
movl $0x0, 0x60(%rsi)
movq %r14, %rdi
movl $0x64, %edx
callq 0x48db
leaq 0x412e(%rip), %rdi      # 0x9511
callq 0x1080
movq %rbx, %rdi
movq %r14, %rsi
callq *0xe8(%rbx)
leaq 0x37f6(%rip), %rdi      # 0x8bf1
xorl %eax, %eax
callq 0x10e0
xorl %eax, %eax
addq $0x70, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/sachinites[P]CommandParser/clistd.c
// Function: display_cmd_expansion_callback
int
display_cmd_expansion_callback(param_t *param, ser_buff_t *b, op_mode enable_or_disable){

    re_init_tokens(MAX_CMD_TREE_DEPTH);
    unsigned int index = 0;

    dump_all_commands(param, index);
    return 0;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl $0x10, %edi
callq 0x4b51
movq %rbx, %rdi
xorl %esi, %esi
callq 0x542e
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/sachinites[P]CommandParser/clistd.c
// Function: dump_all_commands
static void
dump_all_commands(param_t *root, unsigned int index){

        if(!root)
            return;

        if(IS_PARAM_NO_CMD(root))
            return;

        if(IS_PARAM_CMD(root)){
            untokenize(index);
            tokenize(GET_CMD_NAME(root), strlen(GET_CMD_NAME(root)), index);
        }
        else if(IS_PARAM_LEAF(root)){
            untokenize(index);
            memset(temp, 0, sizeof(temp));
            sprintf(temp, "<%s>", GET_LEAF_ID(root));
            tokenize(temp, strlen(GET_LEAF_ID(root)) + 2, index);
        }

        unsigned int i = CHILDREN_START_INDEX;

        for( ; i <= CHILDREN_END_INDEX; i++)
            dump_all_commands(root->options[i], index+1);
        
        if(IS_APPLICATION_CALLBACK_HANDLER_REGISTERED(root)){
            print_tokens(index + 1);
            printf("\n");
        }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
testq %rdi, %rdi
je 0x54fa
movq %rdi, %r14
movl (%rdi), %eax
cmpl $0x2, %eax
je 0x54fa
movl %esi, %ebx
cmpl $0x1, %eax
je 0x546f
testl %eax, %eax
jne 0x54c3
movl %ebx, %edi
callq 0x4bc3
movq 0x8(%r14), %r15
movq %r15, %rdi
callq 0x10c0
movq %r15, %rdi
movl %eax, %esi
jmp 0x54bc
movl %ebx, %edi
callq 0x4bc3
xorps %xmm0, %xmm0
leaq 0xdb20(%rip), %r15      # 0x12fa0
movaps %xmm0, 0x10(%r15)
movaps %xmm0, (%r15)
movw $0x0, 0x20(%r15)
movq 0x8(%r14), %rdx
addq $0x50, %rdx
leaq 0x4047(%rip), %rsi      # 0x94e6
movq %r15, %rdi
xorl %eax, %eax
callq 0x1240
movq 0x8(%r14), %rdi
addq $0x50, %rdi
callq 0x10c0
leal 0x2(%rax), %esi
movq %r15, %rdi
movl %ebx, %edx
callq 0x4b84
incl %ebx
xorl %r15d, %r15d
movq 0x78(%r14,%r15,8), %rdi
movl %ebx, %esi
callq 0x542e
incq %r15
cmpq $0xd, %r15
jne 0x54c8
cmpq $0x0, 0x10(%r14)
je 0x54fa
movl %ebx, %edi
callq 0x4e17
movl $0xa, %edi
popq %rbx
popq %r14
popq %r15
jmp 0x1040
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/sachinites[P]CommandParser/clistd.c
// Function: record_command
void
record_command(char *hist_file, char *cons_input_buffer, unsigned int cmd_len){

    assert(hist_file || cons_input_buffer || !cmd_len);
    
    static unsigned int cmd_counter = 0;
    
    if(cmd_counter == MAX_SAVED_CMDS){
        return;
    }
    FILE *f = fopen(CMD_HIST_RECORD_FILE, "a");
    fwrite(cons_input_buffer, cmd_len, 1, f);
    fwrite("\n", 1, 1, f);
    cmd_counter++;
    fclose(f);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
orq %rsi, %rdi
setne %al
testl %edx, %edx
sete %cl
orb %al, %cl
je 0x570c
cmpl $0x1e, 0xdd27(%rip)     # 0x133e0
jne 0x56c0
popq %rbx
popq %r14
popq %rbp
retq
movl %edx, %ebp
movq %rsi, %rbx
leaq 0x3428(%rip), %rdi      # 0x8af4
leaq 0x2e97(%rip), %rsi      # 0x856a
callq 0x11f0
movq %rax, %r14
movl %ebp, %esi
movl $0x1, %edx
movq %rbx, %rdi
movq %rax, %rcx
callq 0x1260
movl $0xa, %edi
movq %r14, %rsi
callq 0x1120
incl 0xdce0(%rip)            # 0x133e0
movq %r14, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x1090
leaq 0x3a3c(%rip), %rdi      # 0x914f
leaq 0x391f(%rip), %rsi      # 0x9039
leaq 0x3a59(%rip), %rcx      # 0x917a
movl $0x11e, %edx            # imm = 0x11E
callq 0x10f0
// File: /workspace/github_c_makefile_star2_O1/sachinites[P]CommandParser/clistd.c
// Function: config_mode_enter_handler
int
config_mode_enter_handler(param_t *param, ser_buff_t *b, op_mode enable_or_disable){

    set_cmd_tree_cursor(param);
    build_mode_console_name(param);
    mark_checkpoint_serialize_buffer(b);
    return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
callq 0x1c87
movq %r14, %rdi
callq 0x2fc4
movq %rbx, %rdi
callq 0x4557
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/sachinites[P]CommandParser/clistd.c
// Function: supportsave_handler
int
supportsave_handler(param_t *param, ser_buff_t *b, op_mode enable_or_disable){

    switch(enable_or_disable){
        case CONFIG_ENABLE:
            //signal(SIGTERM, terminate_signal_handler);/*When process is killed*/
            //signal(SIGSEGV, terminate_signal_handler);/*When process access illegal memory*/
            //signal(SIGABRT, terminate_signal_handler);/*when process abort itself*/
            break;
        case CONFIG_DISABLE:
            signal(SIGTERM, SIG_DFL);/*When process is killed*/
            signal(SIGSEGV, SIG_DFL);/*When process access illegal memory*/
            signal(SIGABRT, SIG_DFL);/*when process abort itself*/
            break;
        default:
            assert(0);
    }
    return 0;
}

// Assembly:
pushq %rax
cmpl $0x1, %edx
je 0x57dd
testl %edx, %edx
jne 0x57e1
movl $0xf, %edi
xorl %esi, %esi
callq 0x1160
movl $0xb, %edi
xorl %esi, %esi
callq 0x1160
movl $0x6, %edi
xorl %esi, %esi
callq 0x1160
xorl %eax, %eax
popq %rcx
retq
leaq 0x2b19(%rip), %rdi      # 0x8301
leaq 0x384a(%rip), %rsi      # 0x9039
leaq 0x39b6(%rip), %rcx      # 0x91ac
movl $0x17a, %edx            # imm = 0x17A
callq 0x10f0
// File: /workspace/github_c_makefile_star2_O1/sachinites[P]CommandParser/clistd.c
// Function: show_help_handler
int
show_help_handler(param_t *param, ser_buff_t *b, op_mode enable_or_disable){

    printf("Welcome to Help Wizard\n");
    printf("========================\n");
    printf("1. Use '%s' Character after the command to enter command mode\n", MODE_CHARACTER);
    printf("2. Use '%s' Character after the command to see possible follow up suboptions\n", SUBOPTIONS_CHARACTER);
    printf("3. Use '%s' from within the config branch to directly trigger operational commands\n", DO);
    printf("4. Use '%s' Character after the command to see possible complete command completions\n", CMD_EXPANSION_CHARACTER);
    printf("5. Built-in commands:\n");
    printf("    a. %s - clear screen\n", CLEAR_SCR_STRING);
    printf("    b. %s - jump to top of cmd tree\n", GOTO_TOP_STRING);
    printf("    c. %s - jump one level up of command tree\n", GOTO_ONE_LVL_UP_STRING);
    printf("    d. config [%s] console name <console name> - set/unset new console name\n", NEGATE_CHARACTER);
    printf("    e. config [%s] supportsave enable - enable/disable supportsave facility\n", NEGATE_CHARACTER);
    printf("    f. debug show cmdtree - Show entire command tree\n");
    printf("    g. show history - show history of commands triggered\n");
    printf("    h. repeat - repeat the last command\n");
	printf(ANSI_COLOR_YELLOW "                      Author : Abhishek Sagar, Juniper Networks\n" ANSI_COLOR_RESET);
	printf(ANSI_COLOR_YELLOW "                      Visit : www.csepracticals.com for more courses and projects\n" ANSI_COLOR_RESET);
    return 0;
}

// Assembly:
pushq %rbx
leaq 0x3d94(%rip), %rdi      # 0x95b0
callq 0x1080
leaq 0x3d9f(%rip), %rdi      # 0x95c7
callq 0x1080
leaq 0x39b2(%rip), %rdi      # 0x91e6
leaq 0x2bd7(%rip), %rsi      # 0x8412
xorl %eax, %eax
callq 0x10e0
leaq 0x39dc(%rip), %rdi      # 0x9225
leaq 0x2bcf(%rip), %rsi      # 0x841f
xorl %eax, %eax
callq 0x10e0
leaq 0x3a15(%rip), %rdi      # 0x9273
leaq 0x3228(%rip), %rsi      # 0x8a8d
xorl %eax, %eax
callq 0x10e0
leaq 0x3a54(%rip), %rdi      # 0x92c7
leaq 0x2dd5(%rip), %rsi      # 0x864f
xorl %eax, %eax
callq 0x10e0
leaq 0x3d58(%rip), %rdi      # 0x95e0
callq 0x1080
leaq 0x3a89(%rip), %rdi      # 0x931d
leaq 0x2da0(%rip), %rsi      # 0x863b
xorl %eax, %eax
callq 0x10e0
leaq 0x3a8e(%rip), %rdi      # 0x9337
leaq 0x2db3(%rip), %rsi      # 0x8663
xorl %eax, %eax
callq 0x10e0
leaq 0x3a9e(%rip), %rdi      # 0x935c
leaq 0x2d87(%rip), %rsi      # 0x864c
xorl %eax, %eax
callq 0x10e0
leaq 0x3ab8(%rip), %rdi      # 0x938b
leaq 0x2d18(%rip), %rbx      # 0x85f2
movq %rbx, %rsi
xorl %eax, %eax
callq 0x10e0
leaq 0x3aed(%rip), %rdi      # 0x93d8
movq %rbx, %rsi
xorl %eax, %eax
callq 0x10e0
leaq 0x3cfa(%rip), %rdi      # 0x95f6
callq 0x1080
leaq 0x3d23(%rip), %rdi      # 0x962b
callq 0x1080
leaq 0x3d50(%rip), %rdi      # 0x9664
callq 0x1080
leaq 0x3b05(%rip), %rdi      # 0x9425
xorl %eax, %eax
callq 0x10e0
leaq 0x3b41(%rip), %rdi      # 0x946f
xorl %eax, %eax
callq 0x10e0
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/sachinites[P]CommandParser/clistd.c
// Function: show_extension_param_handler
int
show_extension_param_handler(param_t *param, ser_buff_t *b, op_mode enable_or_disable){

    tlv_struct_t tlv;
    memset(&tlv, 0, sizeof(tlv_struct_t));

    if(param == libcli_get_show_brief_extension_param()){
        put_value_in_tlv((&tlv), SHOW_EXTENSION_PARAM_BRIEF);
        tlv.leaf_type = INVALID;
        strncpy(tlv.leaf_id, SHOW_EXTENSION_PARAM, strlen("SHOW_EXTENSION_PARAM"));
        collect_tlv(b, &tlv);
    }
    return 0;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x68, %rsp
movq %rsi, %rbx
movq %rdi, %r14
xorps %xmm0, %xmm0
movaps %xmm0, 0x50(%rsp)
movaps %xmm0, 0x40(%rsp)
movaps %xmm0, 0x30(%rsp)
movaps %xmm0, 0x20(%rsp)
movaps %xmm0, 0x10(%rsp)
movaps %xmm0, (%rsp)
movl $0x0, 0x60(%rsp)
callq 0x1b84
cmpq %r14, %rax
jne 0x59de
movabsq $0x4952425f574f4853, %rax # imm = 0x4952425F574F4853
movq %rsp, %rsi
movq %rax, 0x24(%rsi)
movw $0x4645, 0x2c(%rsi)     # imm = 0x4645
movl $0x6, (%rsi)
movups 0x3cc6(%rip), %xmm0     # 0x968c
movups %xmm0, 0x4(%rsi)
movl $0x0, 0x14(%rsi)
movq %rbx, %rdi
movl $0x64, %edx
callq 0x48db
xorl %eax, %eax
addq $0x68, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/sachinites[P]CommandParser/ut/utinfra/ut_parser.c
// Function: ut_parser_init
void
ut_parser_init ( ) {

    struct mq_attr attr;

    ut_log_file = fopen("CommandParser/ut/utinfra/ut_log_file.txt", "w");
    assert(ut_log_file);

    attr.mq_flags = 0;
    attr.mq_maxmsg = MAX_MESSAGES;
    attr.mq_msgsize = MAX_MSG_SIZE;
    attr.mq_curmsgs = 0;

    if ((UT_PARSER_MSG_Q_FD = mq_open("/ut_parser_msg_q",
                                      O_RDWR | O_CREAT,
                                      QUEUE_PERMISSIONS, &attr)) == -1) {

        printf("UT Parser mq_open failed, errno = %d\n", errno);
        exit(1);
    }

    mq_wait_time.tv_sec = 3;
    mq_wait_time.tv_nsec = 0;
}

// Assembly:
subq $0x48, %rsp
leaq 0x3cb9(%rip), %rdi      # 0x96e0
leaq 0x2a22(%rip), %rsi      # 0x8450
callq 0x11f0
movq %rax, 0xd9b6(%rip)      # 0x133f0
testq %rax, %rax
je 0x5a9b
xorl %eax, %eax
leaq 0x8(%rsp), %rcx
movq %rax, (%rcx)
movq $0x1, 0x8(%rcx)
movq $0x800, 0x10(%rcx)      # imm = 0x800
movq %rax, 0x18(%rcx)
leaq 0x3cde(%rip), %rdi      # 0x9742
movl $0x42, %esi
movl $0x1b0, %edx            # imm = 0x1B0
xorl %eax, %eax
callq 0x11a0
movl %eax, 0xd97d(%rip)      # 0x133f8
cmpl $-0x1, %eax
je 0x5aba
movq $0x3, 0xd975(%rip) # 0x13400
movq $0x0, 0xd972(%rip) # 0x13408
addq $0x48, %rsp
retq
leaq 0x3c67(%rip), %rdi      # 0x9709
leaq 0x3c6c(%rip), %rsi      # 0x9715
leaq 0x3c7c(%rip), %rcx      # 0x972c
movl $0x30, %edx
callq 0x10f0
callq 0x1050
movl (%rax), %esi
leaq 0x3c8b(%rip), %rdi      # 0x9753
xorl %eax, %eax
callq 0x10e0
movl $0x1, %edi
callq 0x1250
// File: /workspace/github_c_makefile_star2_O1/sachinites[P]CommandParser/ut/utinfra/ut_parser.c
// Function: tc_append_result
static void
tc_append_result(glthread_t *head, uint16_t step_no, bool pass, bool match) {

    tc_result_t *res = (tc_result_t *)calloc(1, sizeof(tc_result_t));
    res->step_no = step_no;
    res->pass = pass;
    res->pattern_match = match;
    init_glthread(&res->glue);
    glthread_add_last(head, &res->glue);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %ecx, %ebx
movl %edx, %ebp
movl %esi, %r14d
movq %rdi, %r15
movl $0x1, %edi
movl $0x18, %esi
callq 0x1140
movw %r14w, (%rax)
movb %bpl, 0x2(%rax)
movb %bl, 0x3(%rax)
leaq 0x8(%rax), %rbx
movq %rbx, %rdi
callq 0x6fc0
movq %r15, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x7053
// File: /workspace/github_c_makefile_star2_O1/sachinites[P]CommandParser/ut/utinfra/ut_parser.c
// Function: ut_test_handler
int
ut_test_handler (param_t *param, 
                            ser_buff_t *tlv_buf, 
                            op_mode enable_or_disable) {

    tlv_struct_t *tlv = NULL;
    char *ut_file_name = NULL;
    char *ut_enable_flag = NULL;
    int tc_no = 0;
    int cmdcode = EXTRACT_CMD_CODE(tlv_buf);

    TLV_LOOP_BEGIN(tlv_buf, tlv){

        if (strncmp(tlv->leaf_id, "ut-file-name", strlen("ut-file-name")) == 0)
            ut_file_name =  tlv->value;
        else if (strncmp(tlv->leaf_id, "tc-no", strlen("tc-no")) == 0)
            tc_no = atoi(tlv->value);
        else if (strncmp(tlv->leaf_id, "ut-enable", strlen("ut-enable")) == 0)
            ut_enable_flag = tlv->value;
    } TLV_LOOP_END;

    switch(cmdcode) {
        case  CMDCODE_RUN_UT_TC:
            run_test_case (ut_file_name, tc_no);
            break;
        case CMDCODE_DEBUG_UT:
            set_ut_debug_flag(ut_enable_flag);
            break;
        default : ;
    }
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
movq (%rsi), %r14
movq %rsi, %rdi
callq 0x44e6
cltq
shrq $0x2, %rax
movabsq $0x28f5c28f5c28f5c3, %r12 # imm = 0x28F5C28F5C28F5C3
mulq %r12
shrq $0x2, %rdx
imulq $0x64, %rdx, %rax
leaq (%r14,%rax), %rdi
addq $-0x40, %rdi
callq 0x1210
movl %eax, 0xc(%rsp)
movq (%rbx), %r15
movq %rbx, %rdi
callq 0x44e6
cltq
shrq $0x2, %rax
mulq %r12
movq %rdx, %r12
shrq $0x2, %r12
xorl %ecx, %ecx
decl %r12d
je 0x6ef5
movq $0x0, 0x10(%rsp)
addq $0x24, %r15
leaq 0x1753(%rip), %rbx      # 0x85d5
xorl %ebp, %ebp
xorl %r13d, %r13d
leaq -0x20(%r15), %r14
movl $0xc, %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1070
testl %eax, %eax
je 0x6ed3
movl $0x5, %edx
movq %r14, %rdi
leaq 0x1741(%rip), %rsi      # 0x85ef
callq 0x1070
testl %eax, %eax
je 0x6ed8
movl $0x9, %edx
movq %r14, %rdi
leaq 0x1601(%rip), %rsi      # 0x84c7
callq 0x1070
testl %eax, %eax
cmoveq %r15, %r13
jmp 0x6ee5
movq %r15, %rbp
jmp 0x6ee5
movq %r15, %rdi
callq 0x1210
movq %rax, 0x10(%rsp)
addq $0x64, %r15
decl %r12d
jne 0x6e87
movq 0x10(%rsp), %rcx
jmp 0x6efa
xorl %r13d, %r13d
xorl %ebp, %ebp
movl 0xc(%rsp), %eax
cmpl $0xa, %eax
je 0x6f15
cmpl $0x9, %eax
jne 0x6f32
movzwl %cx, %esi
movq %rbp, %rdi
callq 0x5ad9
jmp 0x6f32
leaq 0x15ae(%rip), %rsi      # 0x84ca
movl $0x6, %edx
movq %r13, %rdi
callq 0x1070
testl %eax, %eax
sete 0xc4f7(%rip)            # 0x13429
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/sachinites[P]CommandParser/ut/utinfra/ut_parser.c
// Function: cli_out
void
cli_out(unsigned char *buff, size_t buff_size) {

    if (!TC_RUNNING) {
        printf("%s", buff);
    }
    else {
        assert(buff_size < UT_PARSER_BUFF_MAX_SIZE);
         if (mq_send(UT_PARSER_MSG_Q_FD, (char *)buff , (buff_size + 1), 0) == -1 ) {
            printf ("mq_send failed on FD %d, errno = %d\n", UT_PARSER_MSG_Q_FD, errno);
         }
    }
}

// Assembly:
pushq %rbx
movq %rsi, %rdx
movq %rdi, %rsi
cmpb $0x0, 0xc4d7(%rip)      # 0x13428
je 0x6f73
cmpq $0x800, %rdx            # imm = 0x800
jae 0x6fa0
movl 0xc496(%rip), %edi      # 0x133f8
incq %rdx
xorl %ecx, %ecx
callq 0x1110
cmpl $-0x1, %eax
je 0x6f82
popq %rbx
retq
leaq 0x2196(%rip), %rdi      # 0x9110
xorl %eax, %eax
popq %rbx
jmp 0x10e0
movl 0xc470(%rip), %ebx      # 0x133f8
callq 0x1050
movl (%rax), %edx
leaq 0x2b5a(%rip), %rdi      # 0x9af0
movl %ebx, %esi
xorl %eax, %eax
popq %rbx
jmp 0x10e0
leaq 0x2aff(%rip), %rdi      # 0x9aa6
leaq 0x2767(%rip), %rsi      # 0x9715
leaq 0x2b15(%rip), %rcx      # 0x9aca
movl $0x227, %edx            # imm = 0x227
callq 0x10f0
nop