LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/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 0x4d08
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %edi, %r14d
shlq $0x3, %r14
leaq 0xda49(%rip), %r15      # 0x12720
leaq 0x430c(%rip), %rbx      # 0x8fea
xorl %r12d, %r12d
movq (%r12,%r15), %rsi
testq %rsi, %rsi
je 0x4cfd
movq %rbx, %rdi
xorl %eax, %eax
callq 0x10e0
addq $0x8, %r12
cmpq %r12, %r14
jne 0x4ce1
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x4e34
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), %dil
cmpb (%r14), %dil
jne 0x4e18
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 0x4d69
movl %r8d, %edi
addq %r9, %rdi
testl %r10d, %r10d
je 0x4e1d
cmpl %edi, %r8d
jge 0x4dc6
movslq %r12d, %r12
movl %r8d, %r9d
cmpq %rsi, %r12
jle 0x4db8
movq %rsi, %r10
movb (%rcx,%r10), %r11b
movb %r11b, -0x1(%rcx,%r10)
leaq 0x1(%r10), %r11
movq %r11, %r10
cmpq %r12, %r11
jl 0x4da3
decq %r12
incl %r9d
cmpl %r9d, %edi
jne 0x4d9b
movl %r8d, %edi
testl %r13d, %r13d
jle 0x4e26
addl %r13d, %r8d
movslq %r12d, %r12
movslq %r8d, %r8
leaq 0x1(%r12), %r9
movq %rsi, %r10
movslq %r12d, %r11
cmpq %r10, %r11
jl 0x4df8
movq %r9, %r11
movb -0x1(%r15,%r11), %bpl
movb %bpl, (%r15,%r11)
decq %r11
cmpq %r10, %r11
jg 0x4de7
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 0x4ddc
jmp 0x4e26
xorl %r9d, %r9d
jmp 0x4e20
movl %edi, %r8d
subl %r9d, %r8d
movl %r8d, %edi
incl %edi
movl %edi, %r8d
cmpl %r12d, %edi
jl 0x4d4f
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x4f24
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 0x4918(%rip), %rsi      # 0x97c7
movq %r13, (%rsp)
movq %r13, %rdi
callq 0x1200
testq %rax, %rax
je 0x4f19
movq %rax, %r15
leaq 0x48fd(%rip), %r13      # 0x97c7
leaq 0x3b58(%rip), %rbp      # 0x8a29
xorl %r12d, %r12d
movq %r15, %rdi
callq 0x10c0
testl %eax, %eax
je 0x4f07
movq %r15, %rdi
movq %rbx, %rsi
callq 0x1280
testq %rax, %rax
je 0x4f07
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 0x4ed4
movq (%rsp), %rdi
callq 0x1030
jmp 0x4f27
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_O3/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 0x4fe9
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 0x3a1d(%rip), %rsi      # 0x8994
movq %r14, %rdi
callq 0x1200
testq %rax, %rax
je 0x4fd5
movq %rax, %r12
xorl %r13d, %r13d
leaq 0x3a03(%rip), %r15      # 0x8994
movq %r12, %rax
movb (%rax), %cl
leal -0x30(%rcx), %edx
incq %rax
cmpb $0xa, %dl
jb 0x4f94
testb %cl, %cl
je 0x4fb9
xorl %edi, %edi
movq %r15, %rsi
callq 0x1200
movq %rax, %r12
testq %rax, %rax
jne 0x4f91
jmp 0x4fd5
incl %r13d
cmpl %ebx, %r13d
jne 0x4fa5
movq %r14, %rdi
callq 0x1030
movq %r12, %rdi
callq 0x1210
cltq
jmp 0x4fdf
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_O3/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 0x3fe8(%rip), %rsi      # 0x8fee
movl $0x4, %edx
movq %rbx, %rdi
callq 0x1070
testl %eax, %eax
je 0x5035
leaq 0x3fd5(%rip), %rsi      # 0x8ff3
movl $0x5, %edx
movq %rbx, %rdi
callq 0x1070
movl %eax, %ecx
xorl %eax, %eax
negl %ecx
sbbl %eax, %eax
jmp 0x5037
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x3486(%rip), %rsi      # 0x84ca
movl $0x6, %edx
callq 0x1070
testl %eax, %eax
je 0x5070
leaq 0x3481(%rip), %rsi      # 0x84da
movl $0x7, %edx
movq %rbx, %rdi
callq 0x1070
movl %eax, %ecx
xorl %eax, %eax
negl %ecx
sbbl %eax, %eax
jmp 0x5072
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x5118
movl %edx, %ebx
movq (%rsi), %r14
movq %rsi, %rdi
callq 0x439a
cltq
shrq $0x2, %rax
movabsq $0x28f5c28f5c28f5c3, %rcx # imm = 0x28F5C28F5C28F5C3
mulq %rcx
movq %rdx, %r15
shrq $0x2, %r15
decl %r15d
je 0x5107
addq $0x24, %r14
leaq 0xbd41(%rip), %r12      # 0x10e00
leaq 0x333f(%rip), %r13      # 0x8405
leaq 0x43e1(%rip), %rbp      # 0x94ae
movq %r14, %rdi
cmpl $0x1, %ebx
je 0x50f9
callq 0x10c0
movq %r14, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0x1070
testl %eax, %eax
je 0x50f6
movq %rbp, %rdi
callq 0x1080
jmp 0x50fe
movq %r13, %rdi
callq 0x2a2b
addq $0x64, %r14
decl %r15d
jne 0x50cd
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x326b(%rip), %rdi      # 0x838a
leaq 0x3ed3(%rip), %rsi      # 0x8ff9
leaq 0x3ed5(%rip), %rcx      # 0x9002
movl $0x8d, %edx
callq 0x10f0
// File: /workspace/github_c_makefile_star2_O3/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 0x33e1
movq %rax, %rbx
leaq 0x3efb(%rip), %rdi      # 0x9044
movq %rax, %rsi
xorl %eax, %eax
callq 0x10e0
leaq 0x3ef4(%rip), %rdi      # 0x904e
leaq 0xde6f(%rip), %rsi      # 0x12fd0
xorl %eax, %eax
callq 0x1220
movq %rbx, %rdi
callq 0x10c0
movq %rbx, %rdi
movl %eax, %esi
xorl %edx, %edx
callq 0x360d
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x51bc
movq %r15, %rdi
callq 0x1c74
movq %r15, %rdi
callq 0x2faa
movq 0x10(%r15), %rax
testq %rax, %rax
je 0x51ca
movq %r15, %rdi
movq %r14, %rsi
movl %ebx, %edx
callq *%rax
jmp 0x51ca
leaq 0x3e8e(%rip), %rdi      # 0x9051
xorl %eax, %eax
callq 0x10e0
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x51f8
leaq 0x42d9(%rip), %rdi      # 0x94cc
callq 0x1080
movl $0xf, %r13d
leaq 0x3e7e(%rip), %r15      # 0x9083
leaq 0x3e9c(%rip), %r12      # 0x90a8
movq (%rbx,%r13,8), %rdx
testq %rdx, %rdx
je 0x5259
cmpb $0x1, 0x18(%rdx)
je 0x5250
testl $0xfffffffd, (%rdx)     # imm = 0xFFFFFFFD
jne 0x5230
movq 0x8(%rdx), %rsi
addq $0x19, %rdx
movq %r15, %rdi
jmp 0x5249
movq 0x8(%rdx), %rax
movl (%rax), %edi
callq 0x1cea
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 0x520c
cmpq $0x0, 0xe8(%rbx)
je 0x52ba
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 0x477d
leaq 0x4239(%rip), %rdi      # 0x94d4
callq 0x1080
movq %rbx, %rdi
movq %r14, %rsi
callq *0xe8(%rbx)
leaq 0x3901(%rip), %rdi      # 0x8bb4
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_O3/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 0x49f1
movq %rbx, %rdi
xorl %esi, %esi
callq 0x52e6
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x53b2
movq %rdi, %r14
movl (%rdi), %eax
cmpl $0x2, %eax
je 0x53b2
movl %esi, %ebx
cmpl $0x1, %eax
je 0x5327
testl %eax, %eax
jne 0x537b
movl %ebx, %edi
callq 0x4a63
movq 0x8(%r14), %r15
movq %r15, %rdi
callq 0x10c0
movq %r15, %rdi
movl %eax, %esi
jmp 0x5374
movl %ebx, %edi
callq 0x4a63
xorps %xmm0, %xmm0
leaq 0xdc68(%rip), %r15      # 0x12fa0
movaps %xmm0, 0x10(%r15)
movaps %xmm0, (%r15)
movw $0x0, 0x20(%r15)
movq 0x8(%r14), %rdx
addq $0x50, %rdx
leaq 0x4152(%rip), %rsi      # 0x94a9
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 0x4a24
incl %ebx
xorl %r15d, %r15d
movq 0x78(%r14,%r15,8), %rdi
movl %ebx, %esi
callq 0x52e6
incq %r15
cmpq $0xd, %r15
jne 0x5380
cmpq $0x0, 0x10(%r14)
je 0x53b2
movl %ebx, %edi
callq 0x4cbd
movl $0xa, %edi
popq %rbx
popq %r14
popq %r15
jmp 0x1040
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x55c4
cmpl $0x1e, 0xde6f(%rip)     # 0x133e0
jne 0x5578
popq %rbx
popq %r14
popq %rbp
retq
movl %edx, %ebp
movq %rsi, %rbx
leaq 0x3533(%rip), %rdi      # 0x8ab7
leaq 0x2fdf(%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 0xde28(%rip)            # 0x133e0
movq %r14, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x1090
leaq 0x3b44(%rip), %rdi      # 0x910f
leaq 0x3a27(%rip), %rsi      # 0x8ff9
leaq 0x3b61(%rip), %rcx      # 0x913a
movl $0x11e, %edx            # imm = 0x11E
callq 0x10f0
// File: /workspace/github_c_makefile_star2_O3/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 0x1c74
movq %r14, %rdi
callq 0x2faa
movq %rbx, %rdi
callq 0x440a
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x5695
testl %edx, %edx
jne 0x5699
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 0x2c61(%rip), %rdi      # 0x8301
leaq 0x3952(%rip), %rsi      # 0x8ff9
leaq 0x3abe(%rip), %rcx      # 0x916c
movl $0x17a, %edx            # imm = 0x17A
callq 0x10f0
// File: /workspace/github_c_makefile_star2_O3/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 0x3e9f(%rip), %rdi      # 0x9573
callq 0x1080
leaq 0x3eaa(%rip), %rdi      # 0x958a
callq 0x1080
leaq 0x3aba(%rip), %rdi      # 0x91a6
leaq 0x2d1f(%rip), %rsi      # 0x8412
xorl %eax, %eax
callq 0x10e0
leaq 0x3ae4(%rip), %rdi      # 0x91e5
leaq 0x2d17(%rip), %rsi      # 0x841f
xorl %eax, %eax
callq 0x10e0
leaq 0x3b1d(%rip), %rdi      # 0x9233
leaq 0x3b6a(%rip), %rsi      # 0x9287
xorl %eax, %eax
callq 0x10e0
leaq 0x3b5f(%rip), %rdi      # 0x928a
leaq 0x2f1d(%rip), %rsi      # 0x864f
xorl %eax, %eax
callq 0x10e0
leaq 0x3e63(%rip), %rdi      # 0x95a3
callq 0x1080
leaq 0x3b94(%rip), %rdi      # 0x92e0
leaq 0x2ee8(%rip), %rsi      # 0x863b
xorl %eax, %eax
callq 0x10e0
leaq 0x3b99(%rip), %rdi      # 0x92fa
leaq 0x2efb(%rip), %rsi      # 0x8663
xorl %eax, %eax
callq 0x10e0
leaq 0x3ba9(%rip), %rdi      # 0x931f
leaq 0x2ecf(%rip), %rsi      # 0x864c
xorl %eax, %eax
callq 0x10e0
leaq 0x3bc3(%rip), %rdi      # 0x934e
leaq 0x2e60(%rip), %rbx      # 0x85f2
movq %rbx, %rsi
xorl %eax, %eax
callq 0x10e0
leaq 0x3bf8(%rip), %rdi      # 0x939b
movq %rbx, %rsi
xorl %eax, %eax
callq 0x10e0
leaq 0x3e05(%rip), %rdi      # 0x95b9
callq 0x1080
leaq 0x3e2e(%rip), %rdi      # 0x95ee
callq 0x1080
leaq 0x3e5b(%rip), %rdi      # 0x9627
callq 0x1080
leaq 0x3c10(%rip), %rdi      # 0x93e8
xorl %eax, %eax
callq 0x10e0
leaq 0x3c4c(%rip), %rdi      # 0x9432
xorl %eax, %eax
callq 0x10e0
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/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
movups %xmm0, 0x58(%rsp)
movups %xmm0, 0x4c(%rsp)
movups %xmm0, 0x3c(%rsp)
movups %xmm0, 0x2c(%rsp)
movups %xmm0, 0x1c(%rsp)
callq 0x1b84
cmpq %r14, %rax
jne 0x588c
movabsq $0x4952425f574f4853, %rax # imm = 0x4952425F574F4853
leaq 0x4(%rsp), %rsi
movq %rax, 0x24(%rsi)
movw $0x4645, 0x2c(%rsi)     # imm = 0x4645
movl $0x6, (%rsi)
movups 0x3ddb(%rip), %xmm0     # 0x964f
movups %xmm0, 0x4(%rsi)
movl $0x0, 0x14(%rsi)
movq %rbx, %rdi
movl $0x64, %edx
callq 0x477d
xorl %eax, %eax
addq $0x68, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x3dc9(%rip), %rdi      # 0x96a0
leaq 0x2b72(%rip), %rsi      # 0x8450
callq 0x11f0
movq %rax, 0xdb06(%rip)      # 0x133f0
testq %rax, %rax
je 0x594b
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 0x3dee(%rip), %rdi      # 0x9702
movl $0x42, %esi
movl $0x1b0, %edx            # imm = 0x1B0
xorl %eax, %eax
callq 0x11a0
movl %eax, 0xdacd(%rip)      # 0x133f8
cmpl $-0x1, %eax
je 0x596a
movq $0x3, 0xdac5(%rip) # 0x13400
movq $0x0, 0xdac2(%rip) # 0x13408
addq $0x48, %rsp
retq
leaq 0x3d77(%rip), %rdi      # 0x96c9
leaq 0x3d7c(%rip), %rsi      # 0x96d5
leaq 0x3d8c(%rip), %rcx      # 0x96ec
movl $0x30, %edx
callq 0x10f0
callq 0x1050
movl (%rax), %esi
leaq 0x3d9b(%rip), %rdi      # 0x9713
xorl %eax, %eax
callq 0x10e0
movl $0x1, %edi
callq 0x1250
// File: /workspace/github_c_makefile_star2_O3/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 0x6e88
movq %r15, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x6f47
// File: /workspace/github_c_makefile_star2_O3/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 0x439a
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 0x439a
cltq
shrq $0x2, %rax
mulq %r12
movq %rdx, %r12
shrq $0x2, %r12
xorl %ecx, %ecx
decl %r12d
je 0x6dbe
movq $0x0, 0x10(%rsp)
addq $0x24, %r15
leaq 0x188a(%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 0x6d9c
movl $0x5, %edx
movq %r14, %rdi
leaq 0x1878(%rip), %rsi      # 0x85ef
callq 0x1070
testl %eax, %eax
je 0x6da1
movl $0x9, %edx
movq %r14, %rdi
leaq 0x1738(%rip), %rsi      # 0x84c7
callq 0x1070
testl %eax, %eax
cmoveq %r15, %r13
jmp 0x6dae
movq %r15, %rbp
jmp 0x6dae
movq %r15, %rdi
callq 0x1210
movq %rax, 0x10(%rsp)
addq $0x64, %r15
decl %r12d
jne 0x6d50
movq 0x10(%rsp), %rcx
jmp 0x6dc3
xorl %r13d, %r13d
xorl %ebp, %ebp
movl 0xc(%rsp), %eax
cmpl $0xa, %eax
je 0x6dde
cmpl $0x9, %eax
jne 0x6dfb
movzwl %cx, %esi
movq %rbp, %rdi
callq 0x5989
jmp 0x6dfb
leaq 0x16e5(%rip), %rsi      # 0x84ca
movl $0x6, %edx
movq %r13, %rdi
callq 0x1070
testl %eax, %eax
sete 0xc62e(%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_O3/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, 0xc60e(%rip)      # 0x13428
je 0x6e3c
cmpq $0x800, %rdx            # imm = 0x800
jae 0x6e69
movl 0xc5cd(%rip), %edi      # 0x133f8
incq %rdx
xorl %ecx, %ecx
callq 0x1110
cmpl $-0x1, %eax
je 0x6e4b
popq %rbx
retq
leaq 0x228d(%rip), %rdi      # 0x90d0
xorl %eax, %eax
popq %rbx
jmp 0x10e0
movl 0xc5a7(%rip), %ebx      # 0x133f8
callq 0x1050
movl (%rax), %edx
leaq 0x2c51(%rip), %rdi      # 0x9ab0
movl %ebx, %esi
xorl %eax, %eax
popq %rbx
jmp 0x10e0
leaq 0x2bf6(%rip), %rdi      # 0x9a66
leaq 0x285e(%rip), %rsi      # 0x96d5
leaq 0x2c0c(%rip), %rcx      # 0x9a8a
movl $0x227, %edx            # imm = 0x227
callq 0x10f0
// File: /workspace/github_c_makefile_star2_O3/sachinites[P]CommandParser/gluethread/glthread.c
// Function: remove_glthread
void
remove_glthread(glthread_t *curr_glthread){
    
    if(!curr_glthread->left){
        if(curr_glthread->right){
            curr_glthread->right->left = NULL;
            curr_glthread->right = 0;
            return;
        }
        return;
    }
    if(!curr_glthread->right){
        curr_glthread->left->right = NULL;
        curr_glthread->left = NULL;
        return;
    }

    curr_glthread->left->right = curr_glthread->right;
    curr_glthread->right->left = curr_glthread->left;
    curr_glthread->left = 0;
    curr_glthread->right = 0;
}

// Assembly:
movq (%rdi), %rcx
movq 0x8(%rdi), %rax
testq %rcx, %rcx
je 0x6ee1
testq %rax, %rax
je 0x6ef0
movq %rax, 0x8(%rcx)
movq 0x8(%rdi), %rax
movq %rcx, (%rax)
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
retq
testq %rax, %rax
je 0x6ee0
xorl %ecx, %ecx
movq %rcx, (%rax)
movq %rcx, 0x8(%rdi)
retq
xorl %eax, %eax
movq %rax, 0x8(%rcx)
movq %rax, (%rdi)
retq
// File: /workspace/github_c_makefile_star2_O3/sachinites[P]CommandParser/gluethread/glthread.c
// Function: delete_glthread_list
void
delete_glthread_list(glthread_t *glthread_head){

    glthread_t *glthreadptr = NULL;
               
    ITERATE_GLTHREAD_BEGIN(glthread_head, glthreadptr){
        remove_glthread(glthreadptr);
    } ITERATE_GLTHREAD_END(glthread_head, glthreadptr);
}

// Assembly:
movq 0x8(%rdi), %rax
testq %rax, %rax
je 0x6f46
xorl %ecx, %ecx
xorps %xmm0, %xmm0
movq (%rax), %rsi
movq 0x8(%rax), %rdx
testq %rsi, %rsi
je 0x6f2c
testq %rdx, %rdx
je 0x6f3d
movq %rdx, 0x8(%rsi)
movq 0x8(%rax), %rdi
movq %rsi, (%rdi)
movups %xmm0, (%rax)
movq %rdx, %rax
jmp 0x6f08
testq %rdx, %rdx
je 0x6f46
movq %rcx, (%rdx)
movq %rcx, 0x8(%rax)
movq %rdx, %rax
jmp 0x6f08
xorl %ecx, %ecx
movq %rcx, 0x8(%rsi)
movq %rcx, (%rax)
retq
// File: /workspace/github_c_makefile_star2_O3/sachinites[P]CommandParser/gluethread/glthread.c
// Function: glthread_add_last
void
glthread_add_last(glthread_t *glthread_head, glthread_t *new_glthread){

    glthread_t *glthreadptr = NULL,
               *prevglthreadptr = NULL;
    
    ITERATE_GLTHREAD_BEGIN(glthread_head, glthreadptr){
        prevglthreadptr = glthreadptr;
    } ITERATE_GLTHREAD_END(glthread_head, glthreadptr);
  
    if(prevglthreadptr) 
        glthread_add_next(prevglthreadptr, new_glthread); 
    else
        glthread_add_next(glthread_head, new_glthread);
}

// Assembly:
xorl %edx, %edx
movq %rdi, %rax
movq %rdx, %rcx
movq 0x8(%rax), %rax
movq %rax, %rdx
testq %rax, %rax
jne 0x6f4c
testq %rcx, %rcx
je 0x6f6d
movq 0x8(%rcx), %rax
movq %rsi, 0x8(%rcx)
movq %rcx, (%rsi)
jmp 0x6f78
movq 0x8(%rdi), %rax
movq %rsi, 0x8(%rdi)
movq %rdi, (%rsi)
testq %rax, %rax
je 0x6f84
movq %rax, 0x8(%rsi)
movq %rsi, (%rax)
retq
// File: /workspace/github_c_makefile_star2_O3/sachinites[P]CommandParser/gluethread/glthread.c
// Function: glthread_priority_insert
void
glthread_priority_insert(glthread_t *glthread_head, 
                         glthread_t *glthread,
                         int (*comp_fn)(void *, void *),
                         int offset){


    glthread_t *curr = NULL,
               *prev = NULL;

    init_glthread(glthread);

    if(IS_GLTHREAD_LIST_EMPTY(glthread_head)){
        glthread_add_next(glthread_head, glthread);
        return;
    }

    /* Only one node*/
    if(glthread_head->right && !glthread_head->right->right){
        if(comp_fn(GLTHREAD_GET_USER_DATA_FROM_OFFSET(glthread, offset),
            GLTHREAD_GET_USER_DATA_FROM_OFFSET(glthread_head->right, offset)) == -1){
            glthread_add_next(glthread_head, glthread);
        }
        else{
            glthread_add_next(glthread_head->right, glthread);
        }
        return;
    }

    ITERATE_GLTHREAD_BEGIN(glthread_head, curr){

        if(comp_fn(GLTHREAD_GET_USER_DATA_FROM_OFFSET(glthread, offset), 
                GLTHREAD_GET_USER_DATA_FROM_OFFSET(curr, offset)) != -1){
            prev = curr;
            continue;
        }

		if(!prev)
			glthread_add_next(glthread_head, glthread);
		else
			glthread_add_next(prev, glthread);

		return;

    }ITERATE_GLTHREAD_END(glthread_head, curr);

    /*Add in the end*/
    glthread_add_next(prev, glthread);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r15
movq %rsi, %r13
movq %rdi, %r14
xorps %xmm0, %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rdi), %rbx
testq %rbx, %rbx
je 0x7003
cmpq $0x0, 0x8(%rbx)
jne 0x7009
movslq %ecx, %rax
movq %r13, %rdi
subq %rax, %rdi
subq %rax, %rbx
movq %rbx, %rsi
callq *%r15
movq 0x8(%r14), %rcx
cmpl $-0x1, %eax
je 0x7081
movq 0x8(%rcx), %rax
movq %r13, 0x8(%rcx)
movq %rcx, (%r13)
testq %rax, %rax
je 0x7095
movq %rax, 0x8(%r13)
movq %r13, (%rax)
jmp 0x7095
cmpq $0x0, (%r14)
je 0x7060
movq %r14, 0x10(%rsp)
movslq %ecx, %r14
movq %r13, 0x8(%rsp)
subq %r14, %r13
negq %r14
xorl %r12d, %r12d
movq %r12, %rbp
testq %rbx, %rbx
je 0x7042
movq %rbx, %r12
movq 0x8(%rbx), %rbx
leaq (%r12,%r14), %rsi
movq %r13, %rdi
callq *%r15
cmpl $-0x1, %eax
jne 0x701f
testq %rbp, %rbp
je 0x706a
movq 0x8(%rbp), %rax
movq 0x8(%rsp), %rcx
movq %rcx, 0x8(%rbp)
movq %rbp, (%rcx)
testq %rax, %rax
je 0x7095
movq %rax, 0x8(%rcx)
movq %rcx, (%rax)
jmp 0x7095
movq %r13, 0x8(%r14)
movq %r14, (%r13)
jmp 0x7095
movq 0x10(%rsp), %rdx
movq 0x8(%rdx), %rax
movq 0x8(%rsp), %rcx
movq %rcx, 0x8(%rdx)
movq %rdx, (%rcx)
jmp 0x7052
movq %r13, 0x8(%r14)
movq %r14, (%r13)
testq %rcx, %rcx
je 0x7095
movq %rcx, 0x8(%r13)
movq %r13, (%rcx)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/sachinites[P]CommandParser/gluethread/glthread.c
// Function: dequeue_glthread_first
glthread_t *
dequeue_glthread_first(glthread_t *base_glthread){

    glthread_t *temp;
    if(!base_glthread->right)
        return NULL;
    temp = base_glthread->right;
    remove_glthread(temp);
    return temp;
}

// Assembly:
movq 0x8(%rdi), %rax
testq %rax, %rax
je 0x70cf
movq (%rax), %rdx
movq 0x8(%rax), %rcx
testq %rdx, %rdx
je 0x70d0
testq %rcx, %rcx
je 0x70df
movq %rcx, 0x8(%rdx)
movq 0x8(%rax), %rcx
movq %rdx, (%rcx)
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
retq
testq %rcx, %rcx
je 0x70cf
xorl %edx, %edx
movq %rdx, (%rcx)
movq %rdx, 0x8(%rax)
retq
xorl %ecx, %ecx
movq %rcx, 0x8(%rdx)
movq %rcx, (%rax)
retq
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]libcperciva/tests/sock_util/main.c
// Function: main
int
main(int argc, char * argv[])
{

	WARNP_INIT;
	(void)argc; /* UNUSED */

	if (check_ensure_port())
		goto err0;

	/* Success! */
	exit(0);

err0:
	/* Failure! */
	exit(1);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq (%rsi), %rdi
testq %rdi, %rdi
je 0x24d2
callq 0x2910
movl $0x8, %r12d
leaq 0x3881(%rip), %r13      # 0x5d60
movq -0x8(%r12,%r13), %r14
movq (%r12,%r13), %r15
movq %r14, %rdi
callq 0x2818
movq %rax, %rbx
movq %rax, %rdi
movq %r15, %rsi
callq 0x2170
testl %eax, %eax
jne 0x251e
movq %rbx, %rdi
callq 0x2040
addq $0x10, %r12
cmpq $0x98, %r12
jne 0x24df
xorl %edi, %edi
callq 0x2220
leaq 0x1adf(%rip), %rdi      # 0x4004
movq %r14, %rsi
movq %r15, %rdx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x2aaf
callq 0x2080
movl $0x0, (%rax)
movq %rbx, %rdi
callq 0x2040
movl $0x1, %edi
callq 0x2220
nop
// File: /workspace/github_c_makefile_star2_O3/vusec[P]fpvi-scsb/leakers/mo/leak.c
// Function: segfault_handler
static void segfault_handler(int signum) {
    (void)signum;
    unblock_signal(SIGSEGV);
    sigsegvs++;
    longjmp(buf, 1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
callq 0x40161e
incl 0x2fdb(%rip)            # 0x4045e8
leaq 0x2f0c(%rip), %rdi      # 0x404520
movl $0x1, %esi
callq 0x401130
// File: /workspace/github_c_makefile_star2_O3/stefpant[P]TCPserver/webcrawler/functions.c
// Function: save_page
int save_page(char* page,char* dir,char* content){

	if(content[9]!='2' || content[10]!='0' || content[11]!='0') return -1;//wrong file

	char *fname=malloc((strlen(page)+strlen(dir)+2)*sizeof(char));
	strcpy(fname,dir);
	strcat(fname,"/");
	strcat(fname,page);
	char* pagedir = getDir(page,dir);
	DIR* d = opendir(pagedir);
	if(d){//dir exists
		closedir(d);
	}
	else if(errno == ENOENT){//dir doesn't exists
		mkdir(pagedir,0700);
	}
	free(pagedir);
	FILE* fp=fopen(fname,"w");
	if(!fp) {free(fname);free(pagedir);return -1;}//couldn't create file
	int start=skip_header(content);//return a pointer after a header to copy the file

	fprintf(fp,"%s",content+start);

	free(fname);
	fclose(fp);
	return start;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpb $0x32, 0x9(%rdx)
jne 0x2ced
movq %rdx, %r14
cmpb $0x30, 0xa(%rdx)
jne 0x2ced
cmpb $0x30, 0xb(%r14)
jne 0x2ced
movq %rsi, %r12
movq %rdi, %r13
callq 0x20f0
movq %rax, %r15
movq %r12, %rdi
callq 0x20f0
leaq (%r15,%rax), %rdi
addq $0x2, %rdi
callq 0x2220
movq %rax, %r15
movq %rax, %rdi
movq %r12, %rsi
callq 0x2070
movq %r15, %rdi
callq 0x20f0
movw $0x2f, (%r15,%rax)
movq %r15, %rdi
movq %r13, %rsi
callq 0x2310
movq %r13, %rdi
movq %r12, %rsi
callq 0x2b42
movq %rax, %r12
movq %rax, %rdi
callq 0x20e0
testq %rax, %rax
je 0x2c69
movq %rax, %rdi
callq 0x2140
jmp 0x2c80
callq 0x2040
cmpl $0x2, (%rax)
jne 0x2c80
movq %r12, %rdi
movl $0x1c0, %esi            # imm = 0x1C0
callq 0x2080
movq %r12, %rdi
callq 0x2030
leaq 0x2697(%rip), %rsi      # 0x5326
movq %r15, %rdi
callq 0x22d0
testq %rax, %rax
je 0x2cdd
movq %rax, %r13
movl $0x2, %ebx
cmpb $0xa, -0x2(%r14,%rbx)
jne 0x2cb3
cmpb $0xa, (%r14,%rbx)
je 0x2cb8
incq %rbx
jmp 0x2ca4
incl %ebx
movslq %ebx, %rax
addq %rax, %r14
movq %r14, %rdi
movq %r13, %rsi
callq 0x2120
movq %r15, %rdi
callq 0x2030
movq %r13, %rdi
callq 0x20d0
jmp 0x2ced
movq %r15, %rdi
callq 0x2030
movq %r12, %rdi
callq 0x2030
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/stefpant[P]TCPserver/webcrawler/functions.c
// Function: getURL
char* getURL(char* x){
	if(strlen(x)<5) return NULL;
	x[4]='\0';//should be '=' in x[4]
	if(strcmp(x,"href")) return NULL;
	int c=5;
	while(1){
		if('>' == x[c]){x[c]='\0';break;}
		else if('\0' == x[c++]) return NULL;
	}
	char* ret=malloc((strlen(x+5)+1)*sizeof(char));
	strcpy(ret,x+5);
	return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x20f0
cmpq $0x5, %rax
jb 0x2d3b
movb $0x0, 0x4(%rbx)
leaq 0x231e(%rip), %rsi      # 0x503b
movq %rbx, %rdi
callq 0x2180
testl %eax, %eax
jne 0x2d3b
leaq 0x5(%rbx), %rax
movb (%rax), %cl
cmpb $0x3e, %cl
je 0x2d44
incq %rax
testb %cl, %cl
jne 0x2d2d
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movb $0x0, (%rax)
addq $0x5, %rbx
movq %rbx, %rdi
callq 0x20f0
leaq 0x1(%rax), %rdi
callq 0x2220
movq %rax, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x2070
// File: /workspace/github_c_makefile_star2_O3/stefpant[P]TCPserver/webcrawler/functions.c
// Function: search_new_pages
char** search_new_pages(char* text,int start,int* finalcounter){
	char **res=malloc(sizeof(char*));
	int counter=0;
	char* word;
	char* suburl=NULL;
	while(start!=-1){
		word = NULL;
		start = nextWord(text,&word,start);//save word
		if(start<-1) break;
		if(!strcmp(word,"<a")){//maybe a first step to find new url
			free(word);
			word=NULL;
			start = nextWord(text,&word,start);
			if(start<-1) break;
			suburl=getURL(word);
			if(suburl == NULL){free(word);continue;}//not url here :-(
			if(counter++)
				res=realloc(res,(counter+1)*sizeof(char*));
			res[counter-1]=suburl;
			suburl=NULL;
		}
		free(word);
	}
	*finalcounter=counter;
	return res;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, -0x48(%rbp)
movl %esi, %r12d
movq %rdi, %r15
movl $0x8, %edi
callq 0x2220
movq %rax, -0x40(%rbp)
cmpl $-0x1, %r12d
je 0x2e5f
movl $0x0, -0x2c(%rbp)
leaq -0x38(%rbp), %r13
movq $0x0, -0x38(%rbp)
movq %r15, %rdi
movq %r13, %rsi
movl %r12d, %edx
callq 0x2a24
cmpl $-0x1, %eax
jl 0x2e66
movl %eax, %r12d
movq -0x38(%rbp), %rdi
cmpb $0x3c, (%rdi)
jne 0x2e19
cmpb $0x61, 0x1(%rdi)
jne 0x2e19
cmpb $0x0, 0x2(%rdi)
jne 0x2e19
callq 0x2030
movq $0x0, -0x38(%rbp)
movq %r15, %rdi
movq %r13, %rsi
movl %r12d, %edx
callq 0x2a24
cmpl $-0x1, %eax
jl 0x2e66
movl %eax, %r12d
movq -0x38(%rbp), %r14
movq %r14, %rdi
callq 0x2cfe
testq %rax, %rax
jne 0x2e26
movq %r14, %rdi
callq 0x2030
cmpl $-0x1, %r12d
jne 0x2dab
jmp 0x2e66
movq %rax, %rbx
movl -0x2c(%rbp), %eax
movslq %eax, %r14
testl %eax, %eax
je 0x2e46
leaq 0x10(,%r14,8), %rsi
movq -0x40(%rbp), %rdi
callq 0x2240
jmp 0x2e4a
movq -0x40(%rbp), %rax
leal 0x1(%r14), %ecx
movl %ecx, -0x2c(%rbp)
movq %rax, -0x40(%rbp)
movq %rbx, (%rax,%r14,8)
movq -0x38(%rbp), %rdi
jmp 0x2e19
movl $0x0, -0x2c(%rbp)
movq -0x48(%rbp), %rax
movl -0x2c(%rbp), %ecx
movl %ecx, (%rax)
movq -0x40(%rbp), %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/stefpant[P]TCPserver/webcrawler/functions.c
// Function: createDocfile
void createDocfile(char* root,char* name){
	FILE* fp=fopen(name,"w");
	struct dirent *d;
	DIR *dir = opendir(root);
	char* founddir=NULL;
	if(dir == NULL)//gdir not a directory
		return;
	while((d = readdir(dir)) != NULL){
		if(d->d_type != DT_DIR) continue;//d not a directory
		if(!strcmp(d->d_name,".") || !strcmp(d->d_name,"..")) continue;//ignore '.','..'
		founddir = malloc((strlen(root)+strlen(d->d_name)+2)*sizeof(char));
		strcpy(founddir,root);
		strcat(founddir,"/");
		strcat(founddir,d->d_name);
		fprintf(fp,"%s\n",founddir);
		free(founddir);
		founddir=NULL;
	}
	closedir(dir);
	fclose(fp);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rax
movq %rdi, %rbx
leaq 0x2489(%rip), %rsi      # 0x5326
movq %rax, %rdi
callq 0x22d0
movq %rax, %r14
movq %rbx, %rdi
callq 0x20e0
testq %rax, %rax
je 0x2f91
movq %rax, %r15
movq %rax, %rdi
callq 0x2200
testq %rax, %rax
je 0x2f73
movq %rax, %r13
cmpb $0x4, 0x12(%r13)
jne 0x2f5f
cmpb $0x2e, 0x13(%r13)
jne 0x2ef7
cmpb $0x0, 0x14(%r13)
je 0x2f5f
cmpb $0x2e, 0x14(%r13)
jne 0x2ef7
cmpb $0x0, 0x15(%r13)
je 0x2f5f
addq $0x13, %r13
movq %rbx, %rdi
callq 0x20f0
movq %rax, %r12
movq %r13, %rdi
callq 0x20f0
leaq (%r12,%rax), %rdi
addq $0x2, %rdi
callq 0x2220
movq %rax, %r12
movq %rax, %rdi
movq %rbx, %rsi
callq 0x2070
movq %r12, %rdi
callq 0x20f0
movw $0x2f, (%r12,%rax)
movq %r12, %rdi
movq %r13, %rsi
callq 0x2310
movq %r14, %rdi
leaq 0x2290(%rip), %rsi      # 0x51dd
movq %r12, %rdx
xorl %eax, %eax
callq 0x21a0
movq %r12, %rdi
callq 0x2030
movq %r15, %rdi
callq 0x2200
movq %rax, %r13
testq %rax, %rax
jne 0x2ed0
movq %r15, %rdi
callq 0x2140
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x20d0
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/stefpant[P]TCPserver/webcrawler/functions.c
// Function: isIP
int isIP(char *name){//ip4: xxx.xxx.xxx.xxx(maxlen=15)
	if(name==NULL) return 0;
	char c;
	int i=0;
	int dots=0,digs=0;
	while( (c=name[i++]) != '\0' ){
		if(c == '.') dots++;
		else if( (c>='0') && (c<='9')) digs++;
		else return 0;//not ip

		if((dots > 3) || (digs > 12)) return 0;
	}
	if( (dots != 3) || (digs<4) ) return 0;
	return 1;
}

// Assembly:
testq %rdi, %rdi
je 0x2fd6
pushq %rbp
movq %rsp, %rbp
xorl %ecx, %ecx
xorl %edx, %edx
movzbl (%rdi), %eax
cmpl $0x2e, %eax
je 0x2fc3
testl %eax, %eax
je 0x2fd9
addb $-0x30, %al
cmpb $0x9, %al
ja 0x2fec
incl %edx
jmp 0x2fc5
incl %ecx
xorl %eax, %eax
cmpl $0x3, %ecx
jg 0x2fee
incq %rdi
cmpl $0xc, %edx
jle 0x2fad
jmp 0x2fee
xorl %eax, %eax
retq
cmpl $0x3, %ecx
sete %al
cmpl $0x4, %edx
setge %cl
andb %al, %cl
movzbl %cl, %eax
jmp 0x2fee
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/stefpant[P]TCPserver/webcrawler/input_parse.c
// Function: isDirEmpty
int isDirEmpty(char* gdir){
	int n=0;
	struct dirent *d;
	DIR *dir = opendir(gdir);
	if(dir == NULL)//gdir not a directory
		return -1;
	while((d = readdir(dir)) != NULL){
		if(++n > 2) {closedir(dir);return -2;}//not empty gdir
	}
	closedir(dir);
	return 0;//empty dir
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
callq 0x20e0
testq %rax, %rax
je 0x3024
movq %rax, %rbx
movl $0x3, %r14d
movq %rbx, %rdi
callq 0x2200
testq %rax, %rax
je 0x302c
decl %r14d
jne 0x300a
movl $0xfffffffe, %r14d      # imm = 0xFFFFFFFE
jmp 0x302f
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
jmp 0x3037
xorl %r14d, %r14d
movq %rbx, %rdi
callq 0x2140
movl %r14d, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/stefpant[P]TCPserver/webcrawler/webcrawler.c
// Function: checkinPU
int checkinPU(char** url){
	int counter=0;
	int flag=0;
	while(1){
		pthread_mutex_lock(&pumtx);
		if(counter==pucounter) break;//url not found
		if(!strcmp(placedurls[counter++],*url)) flag=1;
		pthread_mutex_unlock(&pumtx);
		if(flag) return 1;//found
	}
	//still mutex locked
	pucounter++;
	placedurls = realloc(placedurls,pucounter*sizeof(char*));
	placedurls[pucounter-1]=*url;
	pthread_mutex_unlock(&pumtx);
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
xorl %r12d, %r12d
leaq 0x3e88(%rip), %r14      # 0x7210
movq %r14, %rdi
callq 0x2390
movl 0x3e72(%rip), %eax      # 0x7208
cmpq %rax, %r12
je 0x33c8
movq 0x3e5e(%rip), %rax      # 0x7200
movq (%rax,%r12,8), %rdi
incq %r12
movq (%rbx), %rsi
callq 0x2180
movl %eax, %r15d
movq %r14, %rdi
callq 0x2210
testl %r15d, %r15d
jne 0x3388
movl $0x1, %eax
jmp 0x340c
cltq
leaq 0x1(%rax), %rcx
movl %ecx, 0x3e34(%rip)      # 0x7208
movq 0x3e25(%rip), %rdi      # 0x7200
leaq 0x8(,%rax,8), %rsi
callq 0x2240
movq %rax, 0x3e11(%rip)      # 0x7200
movq (%rbx), %rcx
movslq 0x3e0f(%rip), %rdx      # 0x7208
movq %rcx, -0x8(%rax,%rdx,8)
leaq 0x3e0b(%rip), %rdi      # 0x7210
callq 0x2210
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq