LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/TimeToogo[P]ff-proxy/src/hash_table.c
// Function: ff_hash_table_free_bucket_level
void ff_hash_table_free_bucket_level(uint8_t bucket_levels, union ff_hash_table_bucket *bucket)
{
    assert(bucket_levels > 0);

    if (bucket_levels > 1)
    {
        for (int i = 0; i < FF_BUCKET_POOL_LENGTH; i++)
        {
            if (bucket[i].buckets != NULL)
            {
                ff_hash_table_free_bucket_level(bucket_levels - 1, bucket[i].buckets);
            }
        }

        FREE(bucket);
    }
    else if (bucket_levels == 1)
    {
        for (int i = 0; i < FF_BUCKET_POOL_LENGTH; i++)
        {
            if (bucket[i].nodes != NULL)
            {
                struct ff_hash_table_node *node = bucket[i].nodes;
                struct ff_hash_table_node *tmp_node = NULL;

                while (node != NULL)
                {
                    tmp_node = node;
                    node = node->next;
                    FREE(tmp_node);
                }
            }
        }

        FREE(bucket);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
cmpl $0x1, %edi
je 0x366a
testl %edi, %edi
je 0x36a5
decb %dil
xorl %r15d, %r15d
movzbl %dil, %r14d
movq (%rbx,%r15,8), %rsi
testq %rsi, %rsi
je 0x365c
movl %r14d, %edi
callq 0x362b
incq %r15
cmpq $0x100, %r15            # imm = 0x100
jne 0x364b
jmp 0x3693
xorl %r14d, %r14d
movq (%rbx,%r14,8), %rdi
testq %rdi, %rdi
je 0x3687
movq 0x10(%rdi), %r15
callq 0x2340
movq %r15, %rdi
testq %r15, %r15
jne 0x3676
incq %r14
cmpq $0x100, %r14            # imm = 0x100
jne 0x366d
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x2340
leaq 0x30b5(%rip), %rdi      # 0x6761
leaq 0x306b(%rip), %rsi      # 0x671e
leaq 0x30b9(%rip), %rcx      # 0x6773
movl $0x134, %edx            # imm = 0x134
callq 0x21e0
// File: /workspace/github_c_makefile_star2_O1/TimeToogo[P]ff-proxy/src/hash_table.c
// Function: ff_hash_table_iterator_init
struct ff_hash_table_iterator *ff_hash_table_iterator_init(struct ff_hash_table *hash_table)
{
    pthread_mutex_lock(&ff_hash_table_data_mutex);

    struct ff_hash_table_iterator *iterator = calloc(1, sizeof(struct ff_hash_table_iterator));
    iterator->hash_table = hash_table;
    iterator->current_node = NULL;
    iterator->started = false;

    return iterator;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x6c14(%rip), %rdi      # 0xa2e8
callq 0x2400
movl $0x1, %edi
movl $0x18, %esi
callq 0x21f0
movq %rbx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/TimeToogo[P]ff-proxy/src/hash_table.c
// Function: ff_hash_table_iterator_next
void *ff_hash_table_iterator_next(struct ff_hash_table_iterator *iterator)
{
    if (!iterator->started)
    {
        iterator->current_node = iterator->hash_table->linked_list;
        iterator->started = true;
    }
    else if (iterator->current_node != NULL)
    {
        iterator->current_node = iterator->current_node->next_in_list;
    }

    return iterator->current_node == NULL ? NULL : iterator->current_node->value;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
cmpb $0x0, 0x10(%rdi)
je 0x371b
movq 0x8(%rdi), %rax
testq %rax, %rax
je 0x372a
movq 0x20(%rax), %rax
movq %rax, 0x8(%rdi)
jmp 0x372a
movq (%rdi), %rax
movq 0x10(%rax), %rax
movq %rax, 0x8(%rdi)
movb $0x1, 0x10(%rdi)
movq 0x8(%rdi), %rax
testq %rax, %rax
je 0x3739
movq 0x8(%rax), %rax
jmp 0x373b
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/TimeToogo[P]ff-proxy/src/logging.c
// Function: ff_log
void ff_log(enum ff_log_type type, char *message, ...)
{
    if (type < ff_log_level)
    {
        return;
    }

    char time_str[20];
    char *prefix;
    char full_message[255];

    time_t now;
    time(&now);
    struct tm *nowinfo = localtime(&now);
    strftime(time_str, sizeof(time_str) / sizeof(time_str[0]), "%Y-%m-%d %H:%I:%S", nowinfo);

    switch (type)
    {
    case FF_DEBUG:
        prefix = "DEBUG";
        break;
    case FF_INFO:
        prefix = "INFO";
        break;
    case FF_WARNING:
        prefix = "WARNING";
        break;
    case FF_ERROR:
        prefix = "ERROR";
        break;
    case FF_FATAL:
        prefix = "FATAL";
        break;
    default:
        prefix = "UNKNOWN";
        break;
    }

    va_list args;
    va_start(args, message);

    vsprintf(full_message, message, args);
    printf("[%s] %s %s\n", time_str, prefix, full_message);

    va_end(args);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x1f8, %rsp            # imm = 0x1F8
testb %al, %al
je 0x4146
movaps %xmm0, -0xe0(%rbp)
movaps %xmm1, -0xd0(%rbp)
movaps %xmm2, -0xc0(%rbp)
movaps %xmm3, -0xb0(%rbp)
movaps %xmm4, -0xa0(%rbp)
movaps %xmm5, -0x90(%rbp)
movaps %xmm6, -0x80(%rbp)
movaps %xmm7, -0x70(%rbp)
movq %rdx, -0x100(%rbp)
movq %rcx, -0xf8(%rbp)
movq %r8, -0xf0(%rbp)
movq %r9, -0xe8(%rbp)
cmpl %edi, 0x6170(%rip)      # 0xa2d8
ja 0x4211
movq %rsi, %rbx
movl %edi, %r14d
leaq -0x20(%rbp), %r15
movq %r15, %rdi
callq 0x2290
movq %r15, %rdi
callq 0x2210
leaq 0x2b12(%rip), %rdx      # 0x6ca1
leaq -0x40(%rbp), %rdi
movl $0x14, %esi
movq %rax, %rcx
callq 0x2250
decl %r14d
cmpl $0x4, %r14d
ja 0x41bc
movl %r14d, %eax
leaq 0x2b35(%rip), %rcx      # 0x6ce8
movslq (%rcx,%rax,4), %r14
addq %rcx, %r14
jmp 0x41c3
leaq 0x2b0f(%rip), %r14      # 0x6cd2
leaq -0x110(%rbp), %rax
leaq -0x60(%rbp), %rdx
movq %rax, 0x10(%rdx)
leaq 0x10(%rbp), %rax
movq %rax, 0x8(%rdx)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rdx)
leaq -0x210(%rbp), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x2140
leaq 0x2ada(%rip), %rdi      # 0x6cda
leaq -0x40(%rbp), %rsi
movq %r14, %rdx
movq %r15, %rcx
xorl %eax, %eax
callq 0x2050
addq $0x1f8, %rsp            # imm = 0x1F8
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/TimeToogo[P]ff-proxy/src/main.c
// Function: main
int main(int argc, char **argv)
{
    signal(SIGINT, ff_sigint_handler);

    enum ff_action action = ff_parse_arguments(&ff_global_config, argc, argv);
    int ret = EXIT_SUCCESS;

    switch (action)
    {
    case FF_ACTION_START_PROXY:
        ret = ff_proxy_start(&ff_global_config);
        break;

    case FF_ACTION_PRINT_VERSION:
        ff_print_version(stdout);
        ret = 0;
        break;

    case FF_ACTION_PRINT_USAGE:
        ff_print_usage(stdout);
        ret = 0;
        break;

    case FF_ACTION_INVALID_ARGS:
        ff_print_usage(stderr);
        ret = EXIT_FAILURE;
        break;
    }

    ff_log(FF_INFO, "Exiting...");
    return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movl %edi, %r14d
leaq 0x1268(%rip), %rsi      # 0x549c
movl $0x2, %edi
callq 0x2330
leaq 0x60cb(%rip), %rdi      # 0xa310
movl %r14d, %esi
movq %rbx, %rdx
callq 0x261c
xorl %ebx, %ebx
decl %eax
cmpl $0x3, %eax
ja 0x42af
leaq 0x2a9c(%rip), %rcx      # 0x6cfc
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x60a0(%rip), %rdi      # 0xa310
callq 0x4d08
movl %eax, %ebx
jmp 0x42af
movq 0x5d48(%rip), %rax      # 0x9fc8
movq (%rax), %rdi
callq 0x2a98
jmp 0x42af
movq 0x5d4f(%rip), %rax      # 0x9fe0
movq (%rax), %rdi
callq 0x2a98
movl $0x1, %ebx
jmp 0x42af
movq 0x5d21(%rip), %rax      # 0x9fc8
movq (%rax), %rdi
callq 0x2ae5
leaq 0x2a56(%rip), %rsi      # 0x6d0c
movl $0x2, %edi
xorl %eax, %eax
callq 0x4100
movl %ebx, %eax
popq %rbx
popq %r14
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/TimeToogo[P]ff-proxy/src/parser.c
// Function: ff_request_parse_first_chunk
void ff_request_parse_first_chunk(struct ff_request *request, uint32_t buff_size, void *buff)
{
    bool is_raw_http = ff_request_is_raw_http(buff_size, buff);

    if (is_raw_http)
    {
        ff_request_parse_raw_http(request, buff_size, buff);
        return;
    }

    if (buff_size < sizeof(struct __raw_ff_request_header))
    {
        ff_log(FF_WARNING, "Packet buffer too small to contain header (%d)", buff_size);
        request->state = FF_REQUEST_STATE_RECEIVING_FAIL;
        return;
    }

    struct __raw_ff_request_header *header = (struct __raw_ff_request_header *)buff;
    request->version = ntohs(header->version);
    request->request_id = ntohll(header->request_id);
    request->payload_length = ntohl(header->total_length);
    ff_request_parse_data_chunk(request, buff_size, buff);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %r15
movl %esi, %ebx
movq %rdi, %r14
movl %esi, %edi
movq %rdx, %rsi
callq 0x4676
testb %al, %al
je 0x433d
movabsq $-0xffffffff, %rax      # imm = 0xFFFFFFFF00000001
movq %rax, (%r14)
movl %ebx, %eax
movq %rax, 0x40(%r14)
movq %rax, 0x48(%r14)
callq 0x4b31
movq %rax, 0x50(%r14)
movw %bx, 0x2(%rax)
movq %rax, %rdi
movl %ebx, %esi
movq %r15, %rdx
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x4b4e
cmpl $0x13, %ebx
ja 0x4369
leaq 0x29ce(%rip), %rsi      # 0x6d17
movl $0x3, %edi
movl %ebx, %edx
xorl %eax, %eax
callq 0x4100
movl $0x2, (%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movzwl (%r15), %eax
rolw $0x8, %ax
movzwl %ax, %eax
movl %eax, 0x4(%r14)
movq 0x2(%r15), %rax
bswapq %rax
movq %rax, 0x20(%r14)
movl 0xa(%r15), %eax
bswapl %eax
movq %rax, 0x40(%r14)
movq %r14, %rdi
movl %ebx, %esi
movq %r15, %rdx
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x43a4
// File: /workspace/github_c_makefile_star2_O1/TimeToogo[P]ff-proxy/src/parser.c
// Function: ff_request_is_raw_http
bool ff_request_is_raw_http(uint32_t buff_size, void *buff)
{
    if (buff_size == 0)
    {
        return false;
    }

    bool is_raw_http = false;

    for (int i = 0; i < (int)(sizeof(HTTP_METHODS) / sizeof(HTTP_METHODS[0])); i++)
    {
        if (buff_size < strlen(HTTP_METHODS[i]))
        {
            break;
        }

        is_raw_http |= strncmp(HTTP_METHODS[i], buff, strlen(HTTP_METHODS[i])) == 0;

        if (is_raw_http)
        {
            break;
        }
    }

    return is_raw_http;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testl %edi, %edi
je 0x46a5
movq %rsi, %rbx
movl %edi, %r12d
leaq 0x5bfb(%rip), %rax      # 0xa290
movq (%rax), %r14
movq %r14, %rdi
callq 0x2130
cmpq %r12, %rax
jbe 0x46ba
xorl %r15d, %r15d
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %r13d, %r13d
movq %r14, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x2150
testl %eax, %eax
sete %r15b
je 0x46a8
cmpq $0x8, %r13
je 0x46a8
leaq 0x5bb0(%rip), %rax      # 0xa290
movq 0x8(%rax,%r13,8), %r14
movq %r14, %rdi
callq 0x2130
incq %r13
cmpq %r12, %rax
jbe 0x46bd
jmp 0x46a8
// File: /workspace/github_c_makefile_star2_O1/TimeToogo[P]ff-proxy/src/parser.c
// Function: ff_request_parse_raw_http
void ff_request_parse_raw_http(struct ff_request *request, uint32_t buff_size, void *buff)
{
    request->version = FF_VERSION_RAW;
    request->state = FF_REQUEST_STATE_RECEIVED;
    request->payload_length = buff_size;
    request->received_length = buff_size;
    request->payload = ff_request_payload_node_alloc();
    request->payload->length = buff_size;
    ff_request_payload_load_buff(request->payload, buff_size, buff);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movl %esi, %r14d
movq %rdi, %r15
movabsq $-0xffffffff, %rax      # imm = 0xFFFFFFFF00000001
movq %rax, (%rdi)
movl %esi, %eax
movq %rax, 0x40(%rdi)
movq %rax, 0x48(%rdi)
callq 0x4b31
movq %rax, 0x50(%r15)
movw %r14w, 0x2(%rax)
movq %rax, %rdi
movl %r14d, %esi
movq %rbx, %rdx
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x4b4e
// File: /workspace/github_c_makefile_star2_O1/TimeToogo[P]ff-proxy/src/request.c
// Function: ff_request_option_node_alloc
struct ff_request_option_node *ff_request_option_node_alloc()
{
    struct ff_request_option_node *option = malloc(sizeof(struct ff_request_option_node));

    option->type = 0;
    option->length = 0;
    option->value = NULL;

    return option;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl $0x10, %edi
callq 0x23c0
movl $0x0, (%rax)
movw $0x0, 0x4(%rax)
movq $0x0, 0x8(%rax)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/TimeToogo[P]ff-proxy/src/request.c
// Function: ff_request_free
void ff_request_free(struct ff_request *request)
{
    if (request == NULL)
        return;

    for (int i = 0; i < request->options_length; i++)
    {
        ff_request_option_node_free(request->options[i]);
    }

    FREE(request->options);

    struct ff_request_payload_node *payload_node = request->payload;
    struct ff_request_payload_node *payload_prev;

    while (payload_node != NULL)
    {
        payload_prev = payload_node;
        payload_node = payload_node->next;
        ff_request_payload_node_free(payload_prev);
    }

    FREE(request);
}

// Assembly:
testq %rdi, %rdi
je 0x4c5f
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpb $0x0, 0x28(%rdi)
je 0x4c0e
xorl %r14d, %r14d
movq 0x30(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x4b03
incq %r14
movzbl 0x28(%rbx), %eax
cmpq %rax, %r14
jb 0x4bf5
movq 0x30(%rbx), %rdi
callq 0x2340
movq $0x0, 0x30(%rbx)
movq 0x50(%rbx), %r14
testq %r14, %r14
je 0x4c4d
movq 0x8(%r14), %rdi
movq 0x10(%r14), %r15
callq 0x2340
movq $0x0, 0x8(%r14)
movq %r14, %rdi
callq 0x2340
movq %r15, %r14
testq %r15, %r15
jne 0x4c28
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x2340
retq
// File: /workspace/github_c_makefile_star2_O1/TimeToogo[P]ff-proxy/src/request.c
// Function: ff_request_vectorise_payload
void ff_request_vectorise_payload(struct ff_request *request)
{
    if (request->payload->next == NULL)
    {
        return;
    }

    struct ff_request_payload_node *payload = ff_request_payload_node_alloc();
    payload->length = request->payload_length;
    payload->offset = 0;
    payload->next = NULL;
    payload->value = malloc(request->payload_length * sizeof(uint8_t));

    struct ff_request_payload_node *node = request->payload;
    struct ff_request_payload_node *tmp_node = NULL;

    do
    {
        memcpy(payload->value + node->offset, node->value, node->length * sizeof(uint8_t));

        tmp_node = node->next;
        ff_request_payload_node_free(node);
        node = tmp_node;
    } while (node != NULL);

    request->payload = payload;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq 0x50(%rdi), %r14
cmpq $0x0, 0x10(%r14)
je 0x4cf7
movq %rdi, %rbx
movl $0x18, %edi
callq 0x23c0
movq %rax, %r15
movl $0x0, (%rax)
leaq 0x8(%rax), %r12
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
movq 0x40(%rbx), %rdi
movw %di, 0x2(%rax)
movw $0x0, (%rax)
movq $0x0, 0x10(%rax)
callq 0x23c0
movq %rax, 0x8(%r15)
movzwl (%r14), %edi
addq (%r12), %rdi
movq 0x8(%r14), %rsi
movzwl 0x2(%r14), %edx
callq 0x2260
movq 0x8(%r14), %rdi
movq 0x10(%r14), %r13
callq 0x2340
movq $0x0, 0x8(%r14)
movq %r14, %rdi
callq 0x2340
movq %r13, %r14
testq %r13, %r13
jne 0x4cb8
movq %r15, 0x50(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/TimeToogo[P]ff-proxy/src/server.c
// Function: ff_proxy_clean_up_old_requests_loop
void ff_proxy_clean_up_old_requests_loop(struct ff_hash_table *requests)
{
    while (1)
    {
        sleep(FF_PROXY_CLEAN_INTERVAL_SECS);

        ff_log(FF_DEBUG, "Cleaning up partially received requests");

        time_t now;
        time(&now);

        struct ff_hash_table_iterator *iterator = ff_hash_table_iterator_init(requests);
        struct ff_request *request = NULL;
        struct ff_request **requests_to_remove = calloc(1, requests->length * sizeof(struct ff_request *));
        uint32_t count = 0;

        while ((request = ff_hash_table_iterator_next(iterator)) != NULL)
        {
            bool has_expired = request->state == FF_REQUEST_STATE_RECEIVING &&
                               difftime(now, request->received_at) >= FF_PROXY_OLD_REQUEST_THRESHOLD_SECS;

            if (has_expired)
            {
                requests_to_remove[count++] = request;
            }
        }

        ff_hash_table_iterator_free(iterator);

        for (uint32_t i = 0; i < count; i++)
        {
            ff_hash_table_remove_item(requests, requests_to_remove[i]->request_id);
        }

        ff_log(count == 0 ? FF_DEBUG : FF_WARNING, "Cleaned up %u expired partial requests", count);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x3c, %edi
callq 0x2220
movl $0x1, %edi
leaq 0x24a8(%rip), %rsi      # 0x7526
xorl %eax, %eax
callq 0x4100
leaq -0x30(%rbp), %rdi
callq 0x2290
movq %rbx, %rdi
callq 0x36c4
movq %rax, %r15
movl 0x4(%rbx), %esi
shlq $0x3, %rsi
movl $0x1, %edi
callq 0x21f0
movq %rax, %r14
movq %r15, %rdi
callq 0x36fe
movl $0x0, %r13d
testq %rax, %rax
je 0x50ff
movq %rax, %r12
xorl %r13d, %r13d
cmpl $0x0, (%r12)
jne 0x50ef
movq -0x30(%rbp), %rdi
movq 0x18(%r12), %rsi
callq 0x2170
ucomisd 0x2115(%rip), %xmm0     # 0x71f8
jb 0x50ef
movl %r13d, %eax
incl %r13d
movq %r12, (%r14,%rax,8)
movq %r15, %rdi
callq 0x36fe
movq %rax, %r12
testq %rax, %rax
jne 0x50c6
movq %r15, %rdi
callq 0x373d
testl %r13d, %r13d
je 0x512a
movl %r13d, %r15d
xorl %r12d, %r12d
movq (%r14,%r12,8), %rax
movq 0x20(%rax), %rsi
movq %rbx, %rdi
callq 0x34aa
incq %r12
cmpq %r12, %r15
jne 0x5112
xorl %eax, %eax
testl %r13d, %r13d
setne %al
leal 0x1(,%rax,2), %edi
leaq 0x240e(%rip), %rsi      # 0x754e
movl %r13d, %edx
xorl %eax, %eax
callq 0x4100
jmp 0x5068
// File: /workspace/github_c_makefile_star2_O1/TimeToogo[P]ff-proxy/src/server.c
// Function: ff_proxy_process_request
void ff_proxy_process_request(struct ff_process_request_args *args)
{
    struct ff_config *config = args->config;
    struct ff_request *request = args->request;
    struct ff_hash_table *requests = args->requests;

    ff_request_vectorise_payload(request);

    ff_decrypt_request(request, &config->encryption);

    if (request->state != FF_REQUEST_STATE_DECRYPTED)
    {
        goto error;
    }

    ff_request_parse_options_from_payload(request);

    if (request->state != FF_REQUEST_STATE_PARSED_OPTIONS)
    {
        goto error;
    }

    if (!ff_proxy_validate_request_timestamp(request, config))
    {
        ff_log(FF_WARNING, "Request received with timestamp outside of acceptable window", request->request_id);
        goto error;
    }

    ff_http_send_request(request);

    if (request->state != FF_REQUEST_STATE_SENT)
    {
        goto error;
    }

    goto done;

error:
    ff_log(FF_DEBUG, "Failed to process request %lu", request->request_id);
    goto cleanup;

done:
    ff_log(FF_DEBUG, "Successfully processed request %lu", request->request_id);
    goto cleanup;

cleanup:
    if (request->request_id != 0)
    {
        ff_hash_table_remove_item(requests, request->request_id);
    }

    ff_request_free(request);
    FREE(args);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %r13
movq 0x8(%rdi), %r14
movq 0x10(%rdi), %r15
movq %r14, %rdi
callq 0x4c60
leaq 0x18(%r13), %rsi
movq %r14, %rdi
callq 0x2b24
leaq 0x2155(%rip), %r12      # 0x74e5
cmpl $0x4, (%r14)
jne 0x53ea
movq %r14, %rdi
callq 0x4945
cmpl $0x7, (%r14)
jne 0x53ea
movq %r14, %rdi
movq %r13, %rsi
callq 0x542c
testb %al, %al
je 0x53d3
movq %r14, %rdi
callq 0x3754
cmpl $0xa, (%r14)
leaq 0x213d(%rip), %rax      # 0x7503
leaq 0x2118(%rip), %r12      # 0x74e5
cmoveq %rax, %r12
jmp 0x53ea
movq 0x20(%r14), %rdx
leaq 0x20ca(%rip), %rsi      # 0x74a8
movl $0x3, %edi
xorl %eax, %eax
callq 0x4100
movq 0x20(%r14), %rdx
movl $0x1, %edi
movq %r12, %rsi
xorl %eax, %eax
callq 0x4100
movq 0x20(%r14), %rsi
testq %rsi, %rsi
je 0x540e
movq %r15, %rdi
callq 0x34aa
movq %r14, %rdi
callq 0x4bd6
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2340
// File: /workspace/github_c_makefile_star2_O1/TimeToogo[P]ff-proxy/src/server.c
// Function: ff_proxy_validate_request_timestamp
bool ff_proxy_validate_request_timestamp(struct ff_request *request, struct ff_config *config)
{
    uint64_t timestamp = 0;
    uint64_t now;
    uint64_t diff;

    // Read options backwards to ensure the encrypted options take precedence
    uint8_t i = request->options_length;
    while (i-- > 0)
    {
        if (request->options[i]->type == FF_REQUEST_OPTION_TYPE_TIMESTAMP && request->options[i]->length == 8)
        {
            memcpy(&timestamp, request->options[i]->value, 8);
            timestamp = ntohll(timestamp);
        }
    }

    if (timestamp == 0)
    {
        return true;
    }

    now = (uint64_t)time(NULL);
    diff = now > timestamp ? now - timestamp : timestamp - now;

    return diff <= config->timestamp_fudge_factor;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movzbl 0x28(%rdi), %eax
testq %rax, %rax
je 0x5468
movq 0x30(%rdi), %rcx
xorl %r14d, %r14d
movq -0x8(%rcx,%rax,8), %rdx
cmpl $0x8, (%rdx)
jne 0x5461
cmpw $0x8, 0x4(%rdx)
jne 0x5461
movq 0x8(%rdx), %rdx
movq (%rdx), %r14
bswapq %r14
decq %rax
jne 0x5446
jmp 0x546b
xorl %r14d, %r14d
testq %r14, %r14
je 0x5493
xorl %edi, %edi
callq 0x2290
movq %r14, %rcx
subq %rax, %rcx
negq %rcx
subq %rax, %r14
cmovbq %rcx, %r14
movzwl 0x10(%rbx), %eax
cmpq %rax, %r14
setbe %al
jmp 0x5495
movb $0x1, %al
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/connycommy[P]atCmdDevice/src/atcmdDev/atCmdDevice.c
// Function: cmInit
cmError_t cmInit(cmData_t *obj){
    cmError_t retValue = CM_FAIL;
	static volatile char buffer_urc[CM_BUFFER_LEN_DEF] = {0};
    if(obj != NULL){
		obj->rxData.bufferAsyncEvent = buffer_urc;
		if( obj->matchResponseFromIsr == NULL){
			obj->matchResponseFromIsr = CM_CMD_GENERAL_RESPONSE_FROM_ISR;
			obj->DataPrivate.atvFormat = 1; 
		}
		if( (obj->tickReadHandler != NULL) && (obj->txHandler != NULL) && (obj->rxData.buffer != NULL))
			retValue = CM_OK;
		
		cmResetAsyncEventObject(obj);
		cmResetObject(obj);
		if(obj->rxData.len <= 0 )
			obj->rxData.len = CM_BUFFER_LEN_DEF;
	}
    return retValue;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
testq %rdi, %rdi
je 0x12c0
movq %rdi, %rbx
leaq 0xaf7d(%rip), %rax      # 0xc1b0
movq %rax, 0x18(%rdi)
cmpq $0x0, 0x68(%rdi)
jne 0x124d
leaq 0x6b0f(%rip), %rax      # 0x7d54
movq %rax, 0x68(%rbx)
movb $0x1, 0x61(%rbx)
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpq $0x0, (%rbx)
je 0x1268
cmpq $0x0, 0x8(%rbx)
je 0x1268
xorl %ebp, %ebp
cmpq $0x1, 0x10(%rbx)
sbbl %ebp, %ebp
leaq 0xaf41(%rip), %rdi      # 0xc1b0
xorl %r14d, %r14d
movl $0x400, %edx            # imm = 0x400
xorl %esi, %esi
callq 0x10a0
movw %r14w, 0x32(%rbx)
movb %r14b, 0x20(%rbx)
movb %r14b, 0x22(%rbx)
movb %r14b, 0x23(%rbx)
movq 0x10(%rbx), %rdi
movq 0x28(%rbx), %rdx
xorl %esi, %esi
callq 0x10a0
movw %r14w, 0x30(%rbx)
movb %r14b, 0x21(%rbx)
movq $0x0, 0x58(%rbx)
cmpq $0x0, 0x28(%rbx)
jne 0x12c5
movq $0x400, 0x28(%rbx)      # imm = 0x400
jmp 0x12c5
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/connycommy[P]atCmdDevice/src/atcmdDev/atCmdDevice.c
// Function: cmSendCmd
cmError_t cmSendCmd(cmData_t *obj, char* payload, char* expectedResponse, char * buffStr, uint32_t mSec){

	cmError_t retValue = CM_FAIL;
	if( API_IDLE == obj->DataPrivate.apiState ){ /*Firstentry bloqueante o no bloqueante*/
		cmResetObject(obj);
		if( NULL != payload ) {
			cmStringTx(obj,payload);
		}
		obj->DataPrivate.apiState = API_RUNING;
		if(obj->DataPrivate.numberRetries++ > CM_MAX_NUM_RETRIES) {
			obj->DataPrivate.numberRetries = 0;
			retValue = CM_ERR_MAX_RETRIES_REACHED; /* misra c 15.5*/
		}

	}
	/*expected is confirmed in to cmWaitForResponse*/
	if( CM_ERR_MAX_RETRIES_REACHED == retValue ){
		/*compliant misra c 15.5*/
	}
	else{
		retValue = cmWaitForResponse(obj, expectedResponse,mSec);
	}
	
	/*para que funcione block or non block*/
    // noveo necesario que devuelva timeout, con invalid response es suficiente
	if( (CM_ERR_INVALID_RESPONSE == retValue) || (CM_OK == retValue) ){ /*misra c 12.1*/
		if( 1 == obj->rxData.ready && (CM_OK == retValue) ){ /*misra c 14.4*/
			if( NULL != buffStr ){  /*misra c 15.6*/
				(void)strcpy(buffStr, (char*)obj->rxData.buffer) ; /*misra c 17.7*/
			}

			obj->DataPrivate.numberRetries = 0;
		}
		obj->DataPrivate.apiState = API_IDLE;  //reset object y envia comando de nuevo
	}
	return retValue;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r8d, %ebp
movq %rcx, %r14
movq %rdx, %r15
movq %rdi, %rbx
cmpl $0x0, 0x5c(%rdi)
jne 0x1358
movq %rsi, %r12
movq 0x10(%rbx), %rdi
movq 0x28(%rbx), %rdx
xorl %r13d, %r13d
xorl %esi, %esi
callq 0x10a0
movw $0x0, 0x30(%rbx)
movb $0x0, 0x21(%rbx)
movq $0x0, 0x58(%rbx)
testq %r12, %r12
je 0x1333
movb (%r12), %al
testb %al, %al
je 0x1333
incq %r12
movsbl %al, %esi
xorl %edi, %edi
callq *0x8(%rbx)
movb (%r12), %al
incq %r12
testb %al, %al
jne 0x1320
movl $0x1, 0x5c(%rbx)
movb 0x60(%rbx), %al
leal 0x1(%rax), %ecx
movzbl %cl, %ecx
movl $0x4, %r12d
cmpb $0x5, %al
cmovael %r13d, %ecx
movb %cl, 0x60(%rbx)
jae 0x13da
cmpl $0x0, 0x58(%rbx)
jne 0x1377
movl $0x0, 0xb248(%rip)      # 0xc5b0
callq *(%rbx)
movl %eax, 0xb240(%rip)      # 0xc5b0
movl $0x1, 0x58(%rbx)
callq *(%rbx)
subl 0xb231(%rip), %eax      # 0xc5b0
cmpl %ebp, %eax
jbe 0x138b
movq $0x0, 0x58(%rbx)
movb 0x21(%rbx), %cl
cmpl %ebp, %eax
ja 0x1397
cmpb $0x1, %cl
jne 0x1358
cmpb $0x0, 0x21(%rbx)
je 0x13bb
testq %r15, %r15
je 0x13c2
movq 0x10(%rbx), %rdi
movq %r15, %rsi
callq 0x1110
xorl %ecx, %ecx
testq %rax, %rax
sete %cl
leal (%rcx,%rcx,2), %eax
jmp 0x13c4
movl $0x2, %eax
jmp 0x13c4
xorl %eax, %eax
xorl %ecx, %ecx
cmpl $0x3, %eax
sete %cl
leal 0x1(,%rcx,2), %r12d
testl %eax, %eax
cmovel %eax, %r12d
cmpl $0x3, %r12d
je 0x13e5
testl %r12d, %r12d
jne 0x140d
movb 0x21(%rbx), %al
testl %r12d, %r12d
jne 0x1406
cmpb $0x1, %al
jne 0x1406
testq %r14, %r14
je 0x1402
movq 0x10(%rbx), %rsi
movq %r14, %rdi
callq 0x1050
movb $0x0, 0x60(%rbx)
movl $0x0, 0x5c(%rbx)
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/connycommy[P]atCmdDevice/src/cellularModem/cellModem.c
// Function: cellModem_Init
cmError_t cellModem_Init(cmData_t *obj,char *inputBuffer,size_t len ,void *GetTickCountMs,void *OutputFunction, char *matchResponseFromIsr){
    if( obj != NULL){
         
        if(responses != NULL){
            obj->rxData.responsesExpected = responses;  /*OK ERROR etc*/
            for (int i=0; i< CM_MAX_NUM_RESPONSES_EXPECTED ; i++){
                obj->rxData.lenResponseExpected[i] =strlen(obj->rxData.responsesExpected[i])-1;  /*len OK len ERROR etc*/
            }
        }
        obj->rxData.buffer = (char*)inputBuffer;
        obj->rxData.len = len;
        obj->tickReadHandler = (cmTickReadHandler_t)GetTickCountMs;
        obj->txHandler = (cmTransmissionHandler_t)OutputFunction;
        obj->matchResponseFromIsr = matchResponseFromIsr;
    }
    return cmInit(obj);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %r14
testq %rdi, %rdi
je 0x162f
movq %rcx, %r12
movq %rdx, %r13
movq %rsi, %rbp
movq %r8, 0x8(%rsp)
movq %r9, 0x10(%rsp)
leaq 0xaab0(%rip), %rbx      # 0xc0a0
movq %rbx, 0x50(%r14)
xorl %r15d, %r15d
movq (%r15,%rbx), %rdi
callq 0x1070
decq %rax
movq %rax, 0x38(%r14,%r15)
addq $0x8, %r15
cmpq $0x18, %r15
jne 0x15f7
movq %rbp, 0x10(%r14)
movq %r13, 0x28(%r14)
movq %r12, (%r14)
movq 0x8(%rsp), %rax
movq %rax, 0x8(%r14)
movq 0x10(%rsp), %rax
movq %rax, 0x68(%r14)
movq %r14, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x121c
// File: /workspace/github_c_makefile_star2_O1/connycommy[P]atCmdDevice/src/cellularModem/cellModem.c
// Function: cellModem_GetSignalQuality
cmError_t cellModem_GetSignalQuality(cmData_t *obj ,uint8_t *rssi ){
    cmError_t retVal = CM_OK;
    char cmd[15]="AT+CSQ\r";
    char bufferRecv[60];
    char RSSI[10] = "\0";
    char *ptr = NULL;

    retVal = cmSendCmd(obj, cmd, (0 == cellModem_GetatvFormat(obj) ) ? CELLMODEM_CMD_GENERAL_RESPONSE_ATV0 :CELLMODEM_CMD_GENERAL_RESPONSE ,bufferRecv ,300);
    if(CM_OK == retVal){
        if( (ptr = strstr(bufferRecv,"+CSQ:")) != NULL ){
            ptr = extractBetween(bufferRecv,' ',',',RSSI,0);
            *rssi = (uint8_t)atoi(RSSI);
        }else{
           // retVal = CM_ERR_INVALID_RESPONSE;
        }
    }
    return retVal;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x60, %rsp
movq %rsi, %rbx
movabsq $0xd5153432b5441, %rax  # imm = 0xD5153432B5441
leaq 0x10(%rsp), %rsi
movq %rax, (%rsi)
xorl %eax, %eax
movq %rax, 0x7(%rsi)
movq %rax, (%rsp)
movw $0x0, 0x8(%rsp)
cmpb $0x0, 0x61(%rdi)
leaq 0x6554(%rip), %rax      # 0x7bd2
leaq 0x66cd(%rip), %rdx      # 0x7d52
cmoveq %rax, %rdx
leaq 0x20(%rsp), %rcx
movl $0x12c, %r8d            # imm = 0x12C
callq 0x12cc
movl %eax, %ebp
testl %eax, %eax
jne 0x16dc
leaq 0x59b0(%rip), %rsi      # 0x7056
leaq 0x20(%rsp), %rdi
callq 0x1110
testq %rax, %rax
je 0x16dc
leaq 0x20(%rsp), %rdi
movq %rsp, %r14
movl $0x20, %esi
movl $0x2c, %edx
movq %r14, %rcx
xorl %r8d, %r8d
callq 0x16ec
movq %r14, %rdi
callq 0x10e0
movb %al, (%rbx)
movl %ebp, %eax
addq $0x60, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/connycommy[P]atCmdDevice/src/cellularModem/cellModem.c
// Function: extractBetween
static char * extractBetween(char *src , char init, char end, char* outPutMatch,int offset ){
    char *pInit, *pEnd;
    static char * ret = NULL;
    
    if(src != NULL){
            if( (pInit = strchr(src+offset,init)) != NULL){
                if( (pEnd = strchr(pInit + 1,end)) != NULL){
                    if( outPutMatch != NULL){
                        strncpy(outPutMatch,pInit + 1 , (size_t)(pEnd -pInit -1) );
                    }
                    ret = pEnd;
                }
            }
    }
    return ret;
}

// Assembly:
testq %rdi, %rdi
je 0x1755
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rcx, %rbx
movl %edx, %ebp
movl %r8d, %eax
addq %rax, %rdi
movzbl %sil, %esi
callq 0x1080
testq %rax, %rax
je 0x174d
movq %rax, %r14
leaq 0x1(%rax), %r15
movzbl %bpl, %esi
movq %r15, %rdi
callq 0x1080
testq %rax, %rax
je 0x174d
movq %rax, %r12
testq %rbx, %rbx
je 0x1746
notq %r14
movq %r12, %rdx
addq %r14, %rdx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x1040
movq %r12, 0xae93(%rip)      # 0xc5e0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
movq 0xae84(%rip), %rax      # 0xc5e0
retq
// File: /workspace/github_c_makefile_star2_O1/connycommy[P]atCmdDevice/src/cellularModem/cellModem.c
// Function: cellModem_SetApn
cmError_t cellModem_SetApn(cmData_t *obj, cellModemConfig_t *config){
    cmError_t retVal;
    char apn[100]="AT+QICSGP=1,1,\""; //TODO:change contextid and connectId as input
    char *ptr = NULL;

      if(config->apn != NULL && config->apnUser != NULL  && config->apnPassw != NULL  ){
        ptr = strcat(apn +15, config->apn );
        ptr = strcat(ptr ,"\",\"" );
        ptr = strcat(ptr ,config->apnUser );
        ptr = strcat(ptr ,"\",\"" );
        ptr = strcat(ptr ,config->apnPassw );
        ptr = strcat(ptr ,"\",3\r" );
      }else{
          strcat(apn,CELLMODEM_CMD_APN_DEFAULT);
      }
    retVal = cmSendCmd(obj,apn , (0 == cellModem_GetatvFormat(obj) ) ? CELLMODEM_CMD_GENERAL_RESPONSE_ATV0 :CELLMODEM_CMD_GENERAL_RESPONSE ,NULL ,500);

    return retVal;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x70, %rsp
movq %rsi, %rax
movq %rdi, %rbx
leaq 0x59cc(%rip), %rsi      # 0x7170
movq %rsp, %rdx
movl $0xc, %ecx
movq %rdx, %rdi
rep  movsq (%rsi), %es:(%rdi)
movl $0x0, 0x60(%rdx)
movq (%rax), %rsi
testq %rsi, %rsi
je 0x182a
movq 0x8(%rax), %r15
testq %r15, %r15
je 0x182a
movq 0x10(%rax), %r14
testq %r14, %r14
je 0x182a
leaq 0xf(%rsp), %r12
movq %r12, %rdi
callq 0x10f0
movq %r12, %rdi
callq 0x1070
movl $0x222c22, %ebp         # imm = 0x222C22
movl %ebp, 0xf(%rsp,%rax)
movq %r12, %rdi
movq %r15, %rsi
callq 0x10f0
movq %r12, %rdi
callq 0x1070
movl %ebp, 0xf(%rsp,%rax)
movq %r12, %rdi
movq %r14, %rsi
callq 0x10f0
movq %r12, %rdi
callq 0x1070
movl $0xd332c22, 0xf(%rsp,%rax) # imm = 0xD332C22
movb $0x0, 0x13(%rsp,%rax)
jmp 0x1864
movq %rsp, %rdi
callq 0x1070
movabsq $0xd302c224c4543, %rcx  # imm = 0xD302C224C4543
movq %rcx, 0x30(%rsp,%rax)
movups 0x5819(%rip), %xmm0     # 0x7061
movups %xmm0, (%rsp,%rax)
movups 0x581e(%rip), %xmm0     # 0x7071
movups %xmm0, 0x10(%rsp,%rax)
movups 0x5822(%rip), %xmm0     # 0x7081
movups %xmm0, 0x20(%rsp,%rax)
cmpb $0x0, 0x61(%rbx)
leaq 0x6363(%rip), %rax      # 0x7bd2
leaq 0x64dc(%rip), %rdx      # 0x7d52
cmoveq %rax, %rdx
movq %rsp, %rsi
movq %rbx, %rdi
xorl %ecx, %ecx
movl $0x1f4, %r8d            # imm = 0x1F4
callq 0x12cc
addq $0x70, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/connycommy[P]atCmdDevice/src/cellularModem/cellModem.c
// Function: cellModem_SetContextProfile
cmError_t cellModem_SetContextProfile(cmData_t *obj, cellModemConfig_t *config){
    cmError_t retVal;
    char cmd[15]="AT+QIACT=";
    char snum[5];
    char *ptr = NULL;
    sprintf(snum,"%d",config->contextId);
    ptr = strcat(cmd + 9 , snum);
    ptr = strcat(ptr, "\r");

    retVal = cmSendCmd(obj,cmd , (0 == cellModem_GetatvFormat(obj) ) ? CELLMODEM_CMD_GENERAL_RESPONSE_ATV0 :CELLMODEM_CMD_GENERAL_RESPONSE ,NULL ,150000);//150sg

    return retVal;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
movabsq $0x54434149512b5441, %rax # imm = 0x54434149512B5441
leaq 0x11(%rsp), %r14
movq %rax, -0x9(%r14)
movq $0x3d54, -0x2(%r14)     # imm = 0x3D54
movl 0x1c(%rsi), %edx
leaq 0x57ce(%rip), %rsi      # 0x7099
leaq 0x1b(%rsp), %r15
movq %r15, %rdi
xorl %eax, %eax
callq 0x1100
movq %r14, %rdi
movq %r15, %rsi
callq 0x10f0
movq %r14, %rdi
callq 0x1070
movw $0xd, 0x11(%rsp,%rax)
cmpb $0x0, 0x61(%rbx)
leaq 0x62d3(%rip), %rax      # 0x7bd2
leaq 0x644c(%rip), %rdx      # 0x7d52
cmoveq %rax, %rdx
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
xorl %ecx, %ecx
movl $0x249f0, %r8d          # imm = 0x249F0
callq 0x12cc
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/connycommy[P]atCmdDevice/src/cellularModem/cellModem.c
// Function: cellModem_GetNetworkInformation
cmError_t cellModem_GetNetworkInformation(cmData_t *obj, netInfo_t *getNetinfo){
    cmError_t retVal;
    char cmd[15]="AT+QNWINFO\r";
    char bufferRecv[128];
    char *ptr;

    retVal = cmSendCmd(obj,cmd , (0 == cellModem_GetatvFormat(obj) ) ? CELLMODEM_CMD_GENERAL_RESPONSE_ATV0 :CELLMODEM_CMD_GENERAL_RESPONSE ,bufferRecv ,300);
    if(CM_OK == retVal){
        //+QNWINFO: "FDD LTE","732101","LTE BAND 7",3075
        //api bufferready , apiclearready
        if( (ptr = strstr(bufferRecv,"+QNWINFO:")) != NULL ){
            ptr = extractBetween(bufferRecv,'"','"',getNetinfo->accessTechnSel,0);
            ptr = extractBetween(ptr,'"','"',getNetinfo->operator,2);
            ptr = extractBetween(ptr,'"','"',getNetinfo->band,2);
            ptr = extractBetween(ptr,',','\r',getNetinfo->channelId,1);
        }else{
            //retVal = CM_ERR_INVALID_RESPONSE;
        }
    }
    return retVal;
}

// Assembly:
pushq %rbp
pushq %rbx
subq $0x98, %rsp
movq %rsi, %rbx
movabsq $0x4e49574e512b5441, %rax # imm = 0x4E49574E512B5441
movq %rsp, %rsi
movq %rax, (%rsi)
movq $0xd4f464e, 0x7(%rsi)   # imm = 0xD4F464E
cmpb $0x0, 0x61(%rdi)
leaq 0x6275(%rip), %rax      # 0x7bd2
leaq 0x63ee(%rip), %rdx      # 0x7d52
cmoveq %rax, %rdx
leaq 0x10(%rsp), %rcx
movl $0x12c, %r8d            # imm = 0x12C
callq 0x12cc
movl %eax, %ebp
testl %eax, %eax
jne 0x1a09
leaq 0x5713(%rip), %rsi      # 0x709c
leaq 0x10(%rsp), %rdi
callq 0x1110
testq %rax, %rax
je 0x1a09
leaq 0x10(%rsp), %rdi
movl $0x22, %esi
movl $0x22, %edx
movq %rbx, %rcx
xorl %r8d, %r8d
callq 0x16ec
leaq 0x20(%rbx), %rcx
movq %rax, %rdi
movl $0x22, %esi
movl $0x22, %edx
movl $0x2, %r8d
callq 0x16ec
leaq 0x28(%rbx), %rcx
movq %rax, %rdi
movl $0x22, %esi
movl $0x22, %edx
movl $0x2, %r8d
callq 0x16ec
addq $0x48, %rbx
movq %rax, %rdi
movl $0x2c, %esi
movl $0xd, %edx
movq %rbx, %rcx
movl $0x1, %r8d
callq 0x16ec
movl %ebp, %eax
addq $0x98, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/connycommy[P]atCmdDevice/src/cellularModem/cellModem.c
// Function: cellModem_GetModuleInformation
cmError_t cellModem_GetModuleInformation(cmData_t *obj, modemInfo_t *getModemInfo){
    cmError_t retVal;
    char cmd[15]="ATI\r";
    char bufferRecv[60];
    char *ptr;
    retVal = cmSendCmd(obj,cmd , (0 == cellModem_GetatvFormat(obj) ) ? CELLMODEM_CMD_GENERAL_RESPONSE_ATV0 :CELLMODEM_CMD_GENERAL_RESPONSE ,bufferRecv ,300);
    if(CM_OK == retVal){
            ptr = extractBetween(bufferRecv,'\n','\r',getModemInfo->manufactorId,0);
            ptr = extractBetween(ptr,'\n','\r',getModemInfo->deviceModel,1);
            ptr = extractBetween(ptr,'\n','\r',getModemInfo->firmwareVersion,0);
 
    }
    return retVal;
}

// Assembly:
pushq %rbp
pushq %rbx
subq $0x58, %rsp
movq %rsi, %rbx
movq %rsp, %rsi
movq $0x0, 0x7(%rsi)
movq $0xd495441, (%rsi)      # imm = 0xD495441
cmpb $0x0, 0x61(%rdi)
leaq 0x6197(%rip), %rax      # 0x7bd2
leaq 0x6310(%rip), %rdx      # 0x7d52
cmoveq %rax, %rdx
leaq 0x10(%rsp), %rcx
movl $0x12c, %r8d            # imm = 0x12C
callq 0x12cc
movl %eax, %ebp
testl %eax, %eax
jne 0x1aae
leaq 0x10(%rsp), %rdi
movl $0xa, %esi
movl $0xd, %edx
movq %rbx, %rcx
xorl %r8d, %r8d
callq 0x16ec
leaq 0x10(%rbx), %rcx
movq %rax, %rdi
movl $0xa, %esi
movl $0xd, %edx
movl $0x1, %r8d
callq 0x16ec
addq $0x20, %rbx
movq %rax, %rdi
movl $0xa, %esi
movl $0xd, %edx
movq %rbx, %rcx
xorl %r8d, %r8d
callq 0x16ec
movl %ebp, %eax
addq $0x58, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/connycommy[P]atCmdDevice/src/cellularModem/cellModem.c
// Function: cellModem_GetImei
cmError_t cellModem_GetImei(cmData_t *obj, char *getImei){
    cmError_t retVal;
    char cmd[15]="AT+GSN\r";
    char bufferRecv[60];

    retVal = cmSendCmd(obj,cmd , (0 == cellModem_GetatvFormat(obj) ) ? CELLMODEM_CMD_GENERAL_RESPONSE_ATV0 :CELLMODEM_CMD_GENERAL_RESPONSE ,bufferRecv ,300);
    if(CM_OK == retVal){
        if(getImei != NULL)
            extractBetween(bufferRecv,'\n','\r',getImei,0);
    }
    return retVal;
}

// Assembly:
pushq %rbp
pushq %rbx
subq $0x58, %rsp
movq %rsi, %rbx
movabsq $0xd4e53472b5441, %rax  # imm = 0xD4E53472B5441
movq %rsp, %rsi
movq %rax, (%rsi)
movq $0x0, 0x7(%rsi)
cmpb $0x0, 0x61(%rdi)
leaq 0x60ef(%rip), %rax      # 0x7bd2
leaq 0x6268(%rip), %rdx      # 0x7d52
cmoveq %rax, %rdx
leaq 0x10(%rsp), %rcx
movl $0x12c, %r8d            # imm = 0x12C
callq 0x12cc
movl %eax, %ebp
testq %rbx, %rbx
je 0x1b23
testl %ebp, %ebp
jne 0x1b23
leaq 0x10(%rsp), %rdi
movl $0xa, %esi
movl $0xd, %edx
movq %rbx, %rcx
xorl %r8d, %r8d
callq 0x16ec
movl %ebp, %eax
addq $0x58, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/connycommy[P]atCmdDevice/src/cellularModem/cellModem.c
// Function: cellModem_GetImsi
cmError_t cellModem_GetImsi(cmData_t *obj,  char *getImsi){
    cmError_t retVal;
    char cmd[15]="AT+CIMI\r";
    char bufferRecv[60];

    retVal = cmSendCmd(obj,cmd , (0 == cellModem_GetatvFormat(obj) ) ? CELLMODEM_CMD_GENERAL_RESPONSE_ATV0 :CELLMODEM_CMD_GENERAL_RESPONSE ,bufferRecv ,300);
    if(CM_OK == retVal){
        if(getImsi != NULL)
            extractBetween(bufferRecv,'\n','\r',getImsi,0);
    }
    return retVal;
}

// Assembly:
pushq %rbp
pushq %rbx
subq $0x58, %rsp
movq %rsi, %rbx
movabsq $0xd494d49432b5441, %rax # imm = 0xD494D49432B5441
movq %rsp, %rsi
movq %rax, (%rsi)
movq $0xd, 0x7(%rsi)
cmpb $0x0, 0x61(%rdi)
leaq 0x607a(%rip), %rax      # 0x7bd2
leaq 0x61f3(%rip), %rdx      # 0x7d52
cmoveq %rax, %rdx
leaq 0x10(%rsp), %rcx
movl $0x12c, %r8d            # imm = 0x12C
callq 0x12cc
movl %eax, %ebp
testq %rbx, %rbx
je 0x1b98
testl %ebp, %ebp
jne 0x1b98
leaq 0x10(%rsp), %rdi
movl $0xa, %esi
movl $0xd, %edx
movq %rbx, %rcx
xorl %r8d, %r8d
callq 0x16ec
movl %ebp, %eax
addq $0x58, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/connycommy[P]atCmdDevice/src/cellularModem/cellModem.c
// Function: cellModem_GetIccid
cmError_t cellModem_GetIccid(cmData_t *obj,  char *getIccid){
    cmError_t retVal;
    char cmd[15]="AT+QCCID\r";
    char bufferRecv[60];
    char *ptr = NULL;

    retVal = cmSendCmd(obj,cmd , (0 == cellModem_GetatvFormat(obj) ) ? CELLMODEM_CMD_GENERAL_RESPONSE_ATV0 :CELLMODEM_CMD_GENERAL_RESPONSE ,bufferRecv ,300);
    if(CM_OK == retVal){
        if( (ptr = strstr(bufferRecv,"+QCCID:")) != NULL ){
            if(getIccid != NULL){
                extractBetween(bufferRecv,' ','\r',getIccid,0);
            }
        
        }
    }
    return retVal;
}

// Assembly:
pushq %rbp
pushq %rbx
subq $0x58, %rsp
movq %rsi, %rbx
movabsq $0x44494343512b5441, %rax # imm = 0x44494343512B5441
movq %rsp, %rsi
movq %rax, (%rsi)
movq $0xd44, 0x7(%rsi)       # imm = 0xD44
cmpb $0x0, 0x61(%rdi)
leaq 0x6005(%rip), %rax      # 0x7bd2
leaq 0x617e(%rip), %rdx      # 0x7d52
cmoveq %rax, %rdx
leaq 0x10(%rsp), %rcx
movl $0x12c, %r8d            # imm = 0x12C
callq 0x12cc
movl %eax, %ebp
testl %eax, %eax
jne 0x1c23
leaq 0x54b1(%rip), %rsi      # 0x70a6
leaq 0x10(%rsp), %rdi
callq 0x1110
testq %rbx, %rbx
je 0x1c23
testq %rax, %rax
je 0x1c23
leaq 0x10(%rsp), %rdi
movl $0x20, %esi
movl $0xd, %edx
movq %rbx, %rcx
xorl %r8d, %r8d
callq 0x16ec
movl %ebp, %eax
addq $0x58, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/connycommy[P]atCmdDevice/src/cellularModem/cellModem.c
// Function: cellModem_SetATE
cmError_t cellModem_SetATE(cmData_t *obj, uint8_t echoEn){
    cmError_t retVal;
    char cmd[8]="ATE";
    cmd[3] = (char)( (0 == echoEn ) ? (char)echoEn +'0' : '1');
    cmd[4]  = '\r';
    retVal = cmSendCmd(obj,cmd , (0 == cellModem_GetatvFormat(obj) ) ? CELLMODEM_CMD_GENERAL_RESPONSE_ATV0 :CELLMODEM_CMD_GENERAL_RESPONSE ,NULL ,300);
    return retVal;
}

// Assembly:
pushq %rax
movq %rsp, %rax
movq $0x455441, (%rax)       # imm = 0x455441
testl %esi, %esi
sete %cl
xorb $0x31, %cl
movb %cl, 0x3(%rax)
movb $0xd, 0x4(%rax)
cmpb $0x0, 0x61(%rdi)
leaq 0x5f81(%rip), %rcx      # 0x7bd2
leaq 0x60fa(%rip), %rdx      # 0x7d52
cmoveq %rcx, %rdx
movq %rax, %rsi
xorl %ecx, %ecx
movl $0x12c, %r8d            # imm = 0x12C
callq 0x12cc
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O1/connycommy[P]atCmdDevice/src/cellularModem/cellModem.c
// Function: cellModem_SetATV
cmError_t cellModem_SetATV(cmData_t *obj, uint8_t value){
    cmError_t retVal = CM_FAIL;
    char cmd[8]="ATV";
    cmd[3] = (char)( (0 == value ) ? (char)value +'0' : '1');
    cmd[4]  = '\r';

    cellModem_SetatvFormat(obj,value);
    cellModem_SetMatchResponseFromIsr(obj, (0 == cellModem_GetatvFormat(obj) )? CELLMODEM_CMD_GENERAL_RESPONSE_ATV0 :CELLMODEM_CMD_GENERAL_RESPONSE ); /*cambia la respuesta esperada de la Isr*/
    retVal = cmSendCmd(obj,cmd , (0 == value )? CELLMODEM_CMD_GENERAL_RESPONSE_ATV0 :CELLMODEM_CMD_GENERAL_RESPONSE  ,NULL ,300);

    return retVal;
}

// Assembly:
pushq %rax
testl %esi, %esi
sete %al
leaq 0x60d7(%rip), %rcx      # 0x7d52
leaq 0x5f50(%rip), %rdx      # 0x7bd2
cmovneq %rcx, %rdx
xorb $0x31, %al
testl %esi, %esi
movq %rsp, %rsi
movq $0x565441, (%rsi)       # imm = 0x565441
movb %al, 0x3(%rsi)
movb $0xd, 0x4(%rsi)
setne 0x61(%rdi)
movq %rdx, 0x68(%rdi)
xorl %ecx, %ecx
movl $0x12c, %r8d            # imm = 0x12C
callq 0x12cc
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O1/connycommy[P]atCmdDevice/src/cellularModem/cellModem.c
// Function: cellModem_GetCREG
cmError_t cellModem_GetCREG(cmData_t *obj, netRegStatus_t *netRegStatus){
    cmError_t retVal;
    char bufferRecv[60];
    char cmd[10]="AT+CREG?\r";
    char *ptr =NULL;
    char  buffer[4] ={0};

    retVal = cmSendCmd(obj,cmd , (0 == cellModem_GetatvFormat(obj) )? CELLMODEM_CMD_GENERAL_RESPONSE_ATV0 :CELLMODEM_CMD_GENERAL_RESPONSE  ,bufferRecv ,300); 
    
    if(CM_OK == retVal){
        if( (ptr = strstr(bufferRecv,"+CREG:")) != NULL ){
            if(netRegStatus != NULL){
                extractBetween(bufferRecv,' ',',',buffer,0);
                netRegStatus->n = (int)atoi(buffer);
                memset(buffer,0,sizeof(buffer));
                extractBetween(bufferRecv,',','\r',buffer,1);
                netRegStatus->stat = (int)atoi(buffer);
            }
        }
    }
    
    return retVal;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x68, %rsp
movq %rsi, %rbx
movabsq $0x3f474552432b5441, %rax # imm = 0x3F474552432B5441
leaq 0x10(%rsp), %rsi
movq %rax, (%rsi)
movw $0xd, 0x8(%rsi)
movl $0x0, 0xc(%rsp)
cmpb $0x0, 0x61(%rdi)
leaq 0x5ed7(%rip), %rax      # 0x7bd2
leaq 0x6050(%rip), %rdx      # 0x7d52
cmoveq %rax, %rdx
leaq 0x20(%rsp), %rcx
movl $0x12c, %r8d            # imm = 0x12C
callq 0x12cc
movl %eax, %ebp
testl %eax, %eax
jne 0x1d90
leaq 0x5395(%rip), %rsi      # 0x70b8
leaq 0x20(%rsp), %rdi
callq 0x1110
testq %rbx, %rbx
je 0x1d90
testq %rax, %rax
je 0x1d90
leaq 0x20(%rsp), %r14
leaq 0xc(%rsp), %r15
movq %r14, %rdi
movl $0x20, %esi
movl $0x2c, %edx
movq %r15, %rcx
xorl %r8d, %r8d
callq 0x16ec
movq %r15, %rdi
callq 0x10e0
movl %eax, (%rbx)
movl $0x0, (%r15)
movq %r14, %rdi
movl $0x2c, %esi
movl $0xd, %edx
movq %r15, %rcx
movl $0x1, %r8d
callq 0x16ec
movq %r15, %rdi
callq 0x10e0
movl %eax, 0x4(%rbx)
movl %ebp, %eax
addq $0x68, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/connycommy[P]atCmdDevice/src/cellularModem/cellModem.c
// Function: cellModem_GetCOPS
cmError_t cellModem_GetCOPS(cmData_t *obj, netOperatorStatus_t *netOperatorStat){
    cmError_t retVal;
    char bufferRecv[60];
    char cmd[10]="AT+COPS?\r";
    char *ptr =NULL;
    char  buffer[4] ={0};

    retVal = cmSendCmd(obj,cmd , (0 == cellModem_GetatvFormat(obj) ) ? CELLMODEM_CMD_GENERAL_RESPONSE_ATV0 :CELLMODEM_CMD_GENERAL_RESPONSE  ,bufferRecv ,180000); //180 sg
    
    if(CM_OK == retVal){
        if( (ptr = strstr(bufferRecv,"+COPS:")) != NULL ){
            if(netOperatorStat != NULL){
                ptr = extractBetween(bufferRecv,' ',',',buffer,0);
                netOperatorStat->mode = (int)atoi(buffer);
                memset(buffer,0,sizeof(buffer));
                
                ptr = extractBetween(ptr,',',',',buffer,0);
                netOperatorStat->format = (int)atoi(buffer);
                
                ptr = extractBetween(ptr,'"','"',netOperatorStat->operator,1);

                memset(buffer,0,sizeof(buffer));
                ptr = extractBetween(ptr,',','\r',buffer,0);
                netOperatorStat->act = (int)atoi(buffer);
            }
        }
    }
    
    return retVal;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x60, %rsp
movq %rsi, %rbx
movabsq $0x3f53504f432b5441, %rax # imm = 0x3F53504F432B5441
leaq 0x10(%rsp), %rsi
movq %rax, (%rsi)
movw $0xd, 0x8(%rsi)
movl $0x0, 0xc(%rsp)
cmpb $0x0, 0x61(%rdi)
leaq 0x5dfb(%rip), %rax      # 0x7bd2
leaq 0x5f74(%rip), %rdx      # 0x7d52
cmoveq %rax, %rdx
leaq 0x20(%rsp), %rcx
movl $0x2bf20, %r8d          # imm = 0x2BF20
callq 0x12cc
movl %eax, %ebp
testl %eax, %eax
jne 0x1eb9
leaq 0x52c6(%rip), %rsi      # 0x70c9
leaq 0x20(%rsp), %rdi
callq 0x1110
testq %rbx, %rbx
je 0x1eb9
testq %rax, %rax
je 0x1eb9
leaq 0x20(%rsp), %rdi
leaq 0xc(%rsp), %r14
xorl %r12d, %r12d
movl $0x20, %esi
movl $0x2c, %edx
movq %r14, %rcx
xorl %r8d, %r8d
callq 0x16ec
movq %rax, %r15
movq %r14, %rdi
callq 0x10e0
movl %eax, (%rbx)
movl %r12d, (%r14)
movq %r15, %rdi
movl $0x2c, %esi
movl $0x2c, %edx
movq %r14, %rcx
xorl %r8d, %r8d
callq 0x16ec
movq %rax, %r15
movq %r14, %rdi
callq 0x10e0
movl %eax, 0x4(%rbx)
leaq 0xc(%rbx), %rcx
movq %r15, %rdi
movl $0x22, %esi
movl $0x22, %edx
movl $0x1, %r8d
callq 0x16ec
movl %r12d, (%r14)
movq %rax, %rdi
movl $0x2c, %esi
movl $0xd, %edx
movq %r14, %rcx
xorl %r8d, %r8d
callq 0x16ec
movq %r14, %rdi
callq 0x10e0
movl %eax, 0x8(%rbx)
movl %ebp, %eax
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq