LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/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 0x5ea3(%rip), %rdi      # 0x92e8
callq 0x2400
pushq $0x1
popq %rdi
pushq $0x18
popq %rsi
callq 0x21f0
movq %rbx, (%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x347c
movq 0x8(%rdi), %rax
testq %rax, %rax
je 0x3496
movq 0x20(%rax), %rax
movq %rax, 0x8(%rdi)
jmp 0x348b
movq (%rdi), %rax
movq 0x10(%rax), %rax
movq %rax, 0x8(%rdi)
movb $0x1, 0x10(%rdi)
testq %rax, %rax
je 0x3496
movq 0x8(%rax), %rax
jmp 0x3498
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x3dfa
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, 0x54bc(%rip)      # 0x92d8
ja 0x3ec3
movq %rsi, %rbx
movl %edi, %r14d
leaq -0x20(%rbp), %r15
movq %r15, %rdi
callq 0x2290
movq %r15, %rdi
callq 0x2210
leaq 0x1e5e(%rip), %rdx      # 0x5ca1
leaq -0x40(%rbp), %rdi
pushq $0x14
popq %rsi
movq %rax, %rcx
callq 0x2250
decl %r14d
cmpl $0x4, %r14d
ja 0x3e6e
movl %r14d, %eax
leaq 0x1e83(%rip), %rcx      # 0x5ce8
movslq (%rcx,%rax,4), %r14
addq %rcx, %r14
jmp 0x3e75
leaq 0x1e5d(%rip), %r14      # 0x5cd2
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 0x1e28(%rip), %rdi      # 0x5cda
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
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/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 0x1078(%rip), %rsi      # 0x4f60
pushq $0x2
popq %rdi
callq 0x2330
leaq 0x5419(%rip), %rdi      # 0x9310
movl %r14d, %esi
movq %rbx, %rdx
callq 0x25fc
xorl %ebx, %ebx
decl %eax
cmpl $0x3, %eax
ja 0x3f5f
leaq 0x1dea(%rip), %rcx      # 0x5cfc
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x53ee(%rip), %rdi      # 0x9310
callq 0x4824
movl %eax, %ebx
jmp 0x3f5f
movq 0x5096(%rip), %rax      # 0x8fc8
movq (%rax), %rdi
callq 0x290b
jmp 0x3f5f
movq 0x509d(%rip), %rax      # 0x8fe0
movq (%rax), %rdi
callq 0x290b
pushq $0x1
popq %rbx
jmp 0x3f5f
movq 0x5071(%rip), %rax      # 0x8fc8
movq (%rax), %rdi
callq 0x2956
leaq 0x1da6(%rip), %rsi      # 0x5d0c
pushq $0x2
popq %rdi
xorl %eax, %eax
callq 0x3db4
movl %ebx, %eax
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/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, %r14d
movq %rdi, %rbx
movl %esi, %edi
movq %rdx, %rsi
callq 0x42ac
testb %al, %al
je 0x3fc7
movq %rbx, %rdi
movl %r14d, %esi
movq %r15, %rdx
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x4313
cmpl $0x13, %r14d
ja 0x3ff2
leaq 0x1d43(%rip), %rsi      # 0x5d17
pushq $0x3
popq %rdi
movl %r14d, %edx
xorl %eax, %eax
callq 0x3db4
movl $0x2, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movzwl (%r15), %eax
rolw $0x8, %ax
movzwl %ax, %eax
movl %eax, 0x4(%rbx)
movq 0x2(%r15), %rax
bswapq %rax
movq %rax, 0x20(%rbx)
movl 0xa(%r15), %eax
bswapl %eax
movq %rax, 0x40(%rbx)
movq %rbx, %rdi
movl %r14d, %esi
movq %r15, %rdx
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x402d
// File: /workspace/github_c_makefile_star2_O2/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:
testl %edi, %edi
je 0x4310
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %edi, %r15d
xorl %r12d, %r12d
leaq 0x4fc2(%rip), %r13      # 0x9290
cmpq $0x9, %r12
je 0x42ff
movq (%r13,%r12,8), %r14
movq %r14, %rdi
callq 0x2130
cmpq %r15, %rax
ja 0x42ff
movq %r14, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x2150
incq %r12
testl %eax, %eax
jne 0x42ce
movb $0x1, %al
jmp 0x4301
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x46a8
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 0x46c0
// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x10
popq %rdi
callq 0x23c0
andl $0x0, (%rax)
andw $0x0, 0x4(%rax)
andq $0x0, 0x8(%rax)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/TimeToogo[P]ff-proxy/src/request.c
// Function: ff_request_payload_node_alloc
struct ff_request_payload_node *ff_request_payload_node_alloc()
{
    struct ff_request_payload_node *node = malloc(sizeof(struct ff_request_payload_node));

    node->length = 0;
    node->offset = 0;
    node->value = NULL;
    node->next = NULL;

    return node;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq $0x18
popq %rdi
callq 0x23c0
andl $0x0, (%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x479d
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
xorl %r14d, %r14d
movzbl 0x28(%rbx), %eax
movq 0x30(%rbx), %rdi
cmpq %rax, %r14
jae 0x4770
movq (%rdi,%r14,8), %rdi
callq 0x4682
incq %r14
jmp 0x4755
callq 0x2340
andq $0x0, 0x30(%rbx)
movq 0x50(%rbx), %rdi
testq %rdi, %rdi
je 0x4791
movq 0x10(%rdi), %r14
callq 0x46ff
movq %r14, %rdi
jmp 0x477e
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x2340
retq
// File: /workspace/github_c_makefile_star2_O2/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:
movq 0x50(%rdi), %rax
cmpq $0x0, 0x10(%rax)
je 0x4822
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x46a8
movq %rax, %r14
movq 0x40(%rbx), %rdi
movw %di, 0x2(%rax)
andw $0x0, (%rax)
andq $0x0, 0x10(%rax)
callq 0x23c0
movq %rax, %r15
movq %rax, 0x8(%r14)
movq 0x50(%rbx), %r12
movzwl (%r12), %edi
addq %r15, %rdi
movq 0x8(%r12), %rsi
movzwl 0x2(%r12), %edx
callq 0x2260
movq 0x10(%r12), %r13
movq %r12, %rdi
callq 0x46ff
movq %r13, %r12
testq %r13, %r13
jne 0x47e3
movq %r14, 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_O2/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
subq $0x18, %rsp
movq %rdi, %r15
movq %rdi, -0x30(%rbp)
pushq $0x3c
popq %rdi
callq 0x2220
pushq $0x1
popq %rdi
leaq 0x19bb(%rip), %rsi      # 0x6526
xorl %eax, %eax
callq 0x3db4
leaq -0x38(%rbp), %rdi
callq 0x2290
movq %r15, %rdi
callq 0x3435
movq %rax, %r14
movl 0x4(%r15), %esi
shlq $0x3, %rsi
pushq $0x1
popq %rdi
callq 0x21f0
movq %rax, %r13
xorl %r12d, %r12d
movq %r14, %rdi
callq 0x345f
movl %r12d, %ebx
testq %rax, %rax
je 0x4bd5
movq %rax, %r15
cmpl $0x0, (%rax)
jne 0x4b9c
movq -0x38(%rbp), %rdi
movq 0x18(%r15), %rsi
callq 0x2170
ucomisd 0x162f(%rip), %xmm0     # 0x61f8
jb 0x4b9c
incl %r12d
movq %r15, (%r13,%rbx,8)
jmp 0x4b9c
movq %r14, %rdi
callq 0x349a
xorl %r14d, %r14d
movq -0x30(%rbp), %r15
cmpq %r14, %rbx
je 0x4bff
movq (%r13,%r14,8), %rax
movq 0x20(%rax), %rsi
movq %r15, %rdi
callq 0x3231
incq %r14
jmp 0x4be4
xorl %eax, %eax
testl %r12d, %r12d
setne %al
leal 0x1(,%rax,2), %edi
leaq 0x1939(%rip), %rsi      # 0x654e
movl %r12d, %edx
xorl %eax, %eax
callq 0x3db4
jmp 0x4b59
// File: /workspace/github_c_makefile_star2_O2/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 0x479e
leaq 0x18(%r13), %rsi
movq %r14, %rdi
callq 0x2990
leaq 0x1687(%rip), %r12      # 0x64e5
cmpl $0x4, (%r14)
jne 0x4eb6
movq %r14, %rdi
callq 0x44d1
cmpl $0x7, (%r14)
jne 0x4eb6
movq %r14, %rdi
movq %r13, %rsi
callq 0x4ef6
testb %al, %al
je 0x4ea1
movq %r14, %rdi
callq 0x34b0
cmpl $0xa, (%r14)
leaq 0x166f(%rip), %rax      # 0x6503
leaq 0x164a(%rip), %r12      # 0x64e5
cmoveq %rax, %r12
jmp 0x4eb6
movq 0x20(%r14), %rdx
leaq 0x15fc(%rip), %rsi      # 0x64a8
pushq $0x3
popq %rdi
xorl %eax, %eax
callq 0x3db4
movq 0x20(%r14), %rdx
pushq $0x1
popq %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x3db4
movq 0x20(%r14), %rsi
testq %rsi, %rsi
je 0x4ed8
movq %r15, %rdi
callq 0x3231
movq %r14, %rdi
callq 0x4743
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_O2/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
xorl %r14d, %r14d
decq %rax
cmpq $-0x1, %rax
je 0x4f30
movq 0x30(%rdi), %rcx
movq (%rcx,%rax,8), %rcx
cmpl $0x8, (%rcx)
jne 0x4f07
cmpw $0x8, 0x4(%rcx)
jne 0x4f07
movq 0x8(%rcx), %rcx
movq (%rcx), %r14
bswapq %r14
jmp 0x4f07
testq %r14, %r14
je 0x4f58
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 0x4f5a
movb $0x1, %al
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/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 %rbx
pushq %rax
testq %rdi, %rdi
je 0x1298
movq %rdi, %rbx
leaq 0xbf82(%rip), %rax      # 0xd1b0
movq %rax, 0x18(%rdi)
cmpq $0x0, 0x68(%rdi)
jne 0x1248
leaq 0x6af4(%rip), %rax      # 0x7d34
movq %rax, 0x68(%rbx)
movb $0x1, 0x61(%rbx)
pushq $-0x1
popq %rbp
cmpq $0x0, (%rbx)
je 0x1261
cmpq $0x0, 0x8(%rbx)
je 0x1261
xorl %ebp, %ebp
cmpq $0x1, 0x10(%rbx)
sbbl %ebp, %ebp
movq %rbx, %rdi
callq 0x12a4
movq 0x10(%rbx), %rdi
movq 0x28(%rbx), %rdx
xorl %esi, %esi
callq 0x10a0
movw $0x0, 0x30(%rbx)
movb $0x0, 0x21(%rbx)
andq $0x0, 0x58(%rbx)
cmpq $0x0, 0x28(%rbx)
jne 0x129b
movq $0x400, 0x28(%rbx)      # imm = 0x400
jmp 0x129b
pushq $-0x1
popq %rbp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/connycommy[P]atCmdDevice/src/atcmdDev/atCmdDevice.c
// Function: cmResetAsyncEventObject
static void cmResetAsyncEventObject(cmData_t *obj){
	if(obj->rxData.bufferAsyncEvent != NULL)
		(void)memset( (void *) obj->rxData.bufferAsyncEvent, 0, CM_BUFFER_LEN_DEF);

	obj->rxData.indexAsyncEvent = 0;
	obj->rxData.readyAsyncEvent = 0;
	obj->rxData.asyncEvent = 0;
	obj->rxData.countAsyncEvent = 0;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
testq %rdi, %rdi
je 0x12bd
movl $0x400, %edx            # imm = 0x400
xorl %esi, %esi
callq 0x10a0
movw $0x0, 0x32(%rbx)
xorl %eax, %eax
movb %al, 0x20(%rbx)
movb %al, 0x22(%rbx)
movb %al, 0x23(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x1343
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)
andq $0x0, 0x58(%rbx)
testq %r12, %r12
je 0x1321
movq %rbx, %rdi
movq %r12, %rsi
callq 0x13f0
movl $0x1, 0x5c(%rbx)
movb 0x60(%rbx), %al
leal 0x1(%rax), %ecx
movzbl %cl, %ecx
cmpb $0x5, %al
cmovael %r13d, %ecx
movb %cl, 0x60(%rbx)
jb 0x1343
pushq $0x4
jmp 0x13d2
pushq $0x2
popq %r12
pushq $0x1
popq %r13
movl %r12d, %ecx
cmpl $0x2, %ecx
jne 0x1394
cmpl $0x0, 0x58(%rbx)
jne 0x1372
movl $0x0, 0xc24d(%rip)      # 0xd5b0
callq *(%rbx)
movl %eax, 0xc245(%rip)      # 0xd5b0
movl $0x1, 0x58(%rbx)
callq *(%rbx)
subl 0xc236(%rip), %eax      # 0xd5b0
movl %r12d, %ecx
cmpl %ebp, %eax
jbe 0x1389
andq $0x0, 0x58(%rbx)
movl %r13d, %ecx
movb 0x21(%rbx), %al
cmpb $0x1, %al
cmovel %r13d, %ecx
jmp 0x134e
cmpb $0x0, 0x21(%rbx)
je 0x13d0
testq %r15, %r15
je 0x13b0
movq 0x10(%rbx), %rdi
movq %r15, %rsi
callq 0x1110
testq %rax, %rax
je 0x13d5
movb 0x21(%rbx), %al
xorl %ebp, %ebp
cmpb $0x1, %al
jne 0x13db
testq %r14, %r14
je 0x13ca
movq 0x10(%rbx), %rsi
movq %r14, %rdi
callq 0x1050
movb $0x0, 0x60(%rbx)
jmp 0x13db
pushq $0x1
popq %rbp
jmp 0x13df
movb 0x21(%rbx), %al
pushq $0x3
popq %rbp
andl $0x0, 0x5c(%rbx)
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x15d9
movq %rcx, %r12
movq %rdx, %r13
movq %rsi, %rbp
movq %r8, 0x8(%rsp)
movq %r9, 0x10(%rsp)
leaq 0xbb08(%rip), %rbx      # 0xd0a0
movq %rbx, 0x50(%r14)
xorl %r15d, %r15d
cmpq $0x18, %r15
je 0x15bc
movq (%r15,%rbx), %rdi
callq 0x1070
decq %rax
movq %rax, 0x38(%r14,%r15)
addq $0x8, %r15
jmp 0x159f
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_O2/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
movabsq $0xd5153432b5441, %rcx  # imm = 0xD5153432B5441
leaq 0x10(%rsp), %rax
movq %rcx, (%rax)
andq $0x0, 0x7(%rax)
andw $0x0, 0x8(%rsp)
andq $0x0, (%rsp)
movq %rsi, %rbx
cmpb $0x0, 0x61(%rdi)
leaq 0x658b(%rip), %rcx      # 0x7bb2
leaq 0x6704(%rip), %rdx      # 0x7d32
cmoveq %rcx, %rdx
leaq 0x20(%rsp), %rcx
movq %rax, %rsi
movl $0x12c, %r8d            # imm = 0x12C
callq 0x12d0
movl %eax, %ebp
testl %eax, %eax
jne 0x1684
leaq 0x59bc(%rip), %rsi      # 0x700e
leaq 0x20(%rsp), %rdi
callq 0x1110
testq %rax, %rax
je 0x1684
leaq 0x20(%rsp), %rdi
pushq $0x20
popq %rsi
pushq $0x2c
popq %rdx
movq %rsp, %r14
movq %r14, %rcx
xorl %r8d, %r8d
callq 0x1694
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_O2/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 0x16fd
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 0x16f5
movq %rax, %r14
leaq 0x1(%rax), %r15
movzbl %bpl, %esi
movq %r15, %rdi
callq 0x1080
testq %rax, %rax
je 0x16f5
movq %rax, %r12
testq %rbx, %rbx
je 0x16ee
notq %r14
movq %r12, %rdx
addq %r14, %rdx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x1040
movq %r12, 0xbeeb(%rip)      # 0xd5e0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
movq 0xbedc(%rip), %rax      # 0xd5e0
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x59d6(%rip), %rsi      # 0x7120
pushq $0x64
popq %rcx
movq %rsp, %rdi
rep  movsb (%rsi), %es:(%rdi)
movq (%rax), %rsi
testq %rsi, %rsi
je 0x17c3
movq 0x8(%rax), %r15
testq %r15, %r15
je 0x17c3
movq 0x10(%rax), %r14
testq %r14, %r14
je 0x17c3
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 0x17fd
movq %rsp, %rdi
callq 0x1070
movabsq $0xd302c224c4543, %rcx  # imm = 0xD302C224C4543
movq %rcx, 0x30(%rsp,%rax)
movups 0x5838(%rip), %xmm0     # 0x7019
movups %xmm0, (%rsp,%rax)
movups 0x583d(%rip), %xmm0     # 0x7029
movups %xmm0, 0x10(%rsp,%rax)
movups 0x5841(%rip), %xmm0     # 0x7039
movups %xmm0, 0x20(%rsp,%rax)
cmpb $0x0, 0x61(%rbx)
leaq 0x63aa(%rip), %rax      # 0x7bb2
leaq 0x6523(%rip), %rdx      # 0x7d32
cmoveq %rax, %rdx
movq %rsp, %rsi
movq %rbx, %rdi
xorl %ecx, %ecx
movl $0x1f4, %r8d            # imm = 0x1F4
callq 0x12d0
addq $0x70, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x57ed(%rip), %rsi      # 0x7051
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 0x631a(%rip), %rax      # 0x7bb2
leaq 0x6493(%rip), %rdx      # 0x7d32
cmoveq %rax, %rdx
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
xorl %ecx, %ecx
movl $0x249f0, %r8d          # imm = 0x249F0
callq 0x12d0
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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 %r15
pushq %r14
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 0x62b8(%rip), %rax      # 0x7bb2
leaq 0x6431(%rip), %rdx      # 0x7d32
cmoveq %rax, %rdx
leaq 0x10(%rsp), %rcx
movl $0x12c, %r8d            # imm = 0x12C
callq 0x12d0
movl %eax, %ebp
testl %eax, %eax
jne 0x1992
leaq 0x5732(%rip), %rsi      # 0x7054
leaq 0x10(%rsp), %rdi
callq 0x1110
testq %rax, %rax
je 0x1992
leaq 0x10(%rsp), %rdi
pushq $0x22
popq %r14
movl %r14d, %esi
movl %r14d, %edx
movq %rbx, %rcx
xorl %r8d, %r8d
callq 0x1694
leaq 0x20(%rbx), %rcx
pushq $0x2
popq %r15
movq %rax, %rdi
movl %r14d, %esi
movl %r14d, %edx
movl %r15d, %r8d
callq 0x1694
leaq 0x28(%rbx), %rcx
movq %rax, %rdi
movl %r14d, %esi
movl %r14d, %edx
movl %r15d, %r8d
callq 0x1694
addq $0x48, %rbx
pushq $0x2c
popq %rsi
pushq $0xd
popq %rdx
pushq $0x1
popq %r8
movq %rax, %rdi
movq %rbx, %rcx
callq 0x1694
movl %ebp, %eax
addq $0x98, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 %r15
pushq %r14
pushq %rbx
subq $0x58, %rsp
movq %rsi, %rbx
movq %rsp, %rsi
andq $0x0, 0x7(%rsi)
movq $0xd495441, (%rsi)      # imm = 0xD495441
cmpb $0x0, 0x61(%rdi)
leaq 0x61e9(%rip), %rax      # 0x7bb2
leaq 0x6362(%rip), %rdx      # 0x7d32
cmoveq %rax, %rdx
leaq 0x10(%rsp), %rcx
movl $0x12c, %r8d            # imm = 0x12C
callq 0x12d0
movl %eax, %ebp
testl %eax, %eax
jne 0x1a36
leaq 0x10(%rsp), %rdi
pushq $0xa
popq %r14
pushq $0xd
popq %r15
movl %r14d, %esi
movl %r15d, %edx
movq %rbx, %rcx
xorl %r8d, %r8d
callq 0x1694
leaq 0x10(%rbx), %rcx
pushq $0x1
popq %r8
movq %rax, %rdi
movl %r14d, %esi
movl %r15d, %edx
callq 0x1694
addq $0x20, %rbx
movq %rax, %rdi
movl %r14d, %esi
movl %r15d, %edx
movq %rbx, %rcx
xorl %r8d, %r8d
callq 0x1694
movl %ebp, %eax
addq $0x58, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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
movabsq $0xd4e53472b5441, %rcx  # imm = 0xD4E53472B5441
movq %rsp, %rax
movq %rcx, (%rax)
andq $0x0, 0x7(%rax)
movq %rsi, %rbx
cmpb $0x0, 0x61(%rdi)
leaq 0x6146(%rip), %rcx      # 0x7bb2
leaq 0x62bf(%rip), %rdx      # 0x7d32
cmoveq %rcx, %rdx
leaq 0x10(%rsp), %rcx
movq %rax, %rsi
movl $0x12c, %r8d            # imm = 0x12C
callq 0x12d0
movl %eax, %ebp
testq %rbx, %rbx
je 0x1aab
testl %ebp, %ebp
jne 0x1aab
leaq 0x10(%rsp), %rdi
pushq $0xa
popq %rsi
pushq $0xd
popq %rdx
movq %rbx, %rcx
xorl %r8d, %r8d
callq 0x1694
movl %ebp, %eax
addq $0x58, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x60d2(%rip), %rax      # 0x7bb2
leaq 0x624b(%rip), %rdx      # 0x7d32
cmoveq %rax, %rdx
leaq 0x10(%rsp), %rcx
movl $0x12c, %r8d            # imm = 0x12C
callq 0x12d0
movl %eax, %ebp
testq %rbx, %rbx
je 0x1b1c
testl %ebp, %ebp
jne 0x1b1c
leaq 0x10(%rsp), %rdi
pushq $0xa
popq %rsi
pushq $0xd
popq %rdx
movq %rbx, %rcx
xorl %r8d, %r8d
callq 0x1694
movl %ebp, %eax
addq $0x58, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x6061(%rip), %rax      # 0x7bb2
leaq 0x61da(%rip), %rdx      # 0x7d32
cmoveq %rax, %rdx
leaq 0x10(%rsp), %rcx
movl $0x12c, %r8d            # imm = 0x12C
callq 0x12d0
movl %eax, %ebp
testl %eax, %eax
jne 0x1ba3
leaq 0x54e5(%rip), %rsi      # 0x705e
leaq 0x10(%rsp), %rdi
callq 0x1110
testq %rbx, %rbx
je 0x1ba3
testq %rax, %rax
je 0x1ba3
leaq 0x10(%rsp), %rdi
pushq $0x20
popq %rsi
pushq $0xd
popq %rdx
movq %rbx, %rcx
xorl %r8d, %r8d
callq 0x1694
movl %ebp, %eax
addq $0x58, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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
movabsq $0xd00455441, %rcx      # imm = 0xD00455441
movq %rsp, %rax
movq %rcx, (%rax)
testl %esi, %esi
sete %cl
xorb $0x31, %cl
movb %cl, 0x3(%rax)
cmpb $0x0, 0x61(%rdi)
leaq 0x5fdf(%rip), %rcx      # 0x7bb2
leaq 0x6158(%rip), %rdx      # 0x7d32
cmoveq %rcx, %rdx
movq %rax, %rsi
xorl %ecx, %ecx
movl $0x12c, %r8d            # imm = 0x12C
callq 0x12d0
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x6135(%rip), %rcx      # 0x7d32
leaq 0x5fae(%rip), %rdx      # 0x7bb2
cmovneq %rcx, %rdx
xorb $0x31, %al
testl %esi, %esi
movabsq $0xd00565441, %rcx      # imm = 0xD00565441
movq %rsp, %rsi
movq %rcx, (%rsi)
movb %al, 0x3(%rsi)
setne 0x61(%rdi)
movq %rdx, 0x68(%rdi)
xorl %ecx, %ecx
movl $0x12c, %r8d            # imm = 0x12C
callq 0x12d0
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O2/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 %r12
pushq %rbx
subq $0x60, %rsp
movq %rsi, %rbx
movabsq $0x3f474552432b5441, %rax # imm = 0x3F474552432B5441
leaq 0x10(%rsp), %rsi
andl $0x0, 0xc(%rsp)
movq %rax, (%rsi)
movw $0xd, 0x8(%rsi)
cmpb $0x0, 0x61(%rdi)
leaq 0x5f34(%rip), %rax      # 0x7bb2
leaq 0x60ad(%rip), %rdx      # 0x7d32
cmoveq %rax, %rdx
leaq 0x20(%rsp), %rcx
movl $0x12c, %r8d            # imm = 0x12C
callq 0x12d0
movl %eax, %ebp
testl %eax, %eax
jne 0x1d0b
leaq 0x53ca(%rip), %rsi      # 0x7070
leaq 0x20(%rsp), %rdi
callq 0x1110
testq %rbx, %rbx
je 0x1d0b
testq %rax, %rax
je 0x1d0b
leaq 0x20(%rsp), %r14
pushq $0x20
popq %rsi
pushq $0x2c
popq %r15
leaq 0xc(%rsp), %r12
movq %r14, %rdi
movl %r15d, %edx
movq %r12, %rcx
xorl %r8d, %r8d
callq 0x1694
movq %r12, %rdi
callq 0x10e0
movl %eax, (%rbx)
andl $0x0, (%r12)
pushq $0xd
popq %rdx
pushq $0x1
popq %r8
movq %r14, %rdi
movl %r15d, %esi
movq %r12, %rcx
callq 0x1694
movq %r12, %rdi
callq 0x10e0
movl %eax, 0x4(%rbx)
movl %ebp, %eax
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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
andl $0x0, 0xc(%rsp)
movq %rax, (%rsi)
movw $0xd, 0x8(%rsi)
cmpb $0x0, 0x61(%rdi)
leaq 0x5e61(%rip), %rax      # 0x7bb2
leaq 0x5fda(%rip), %rdx      # 0x7d32
cmoveq %rax, %rdx
leaq 0x20(%rsp), %rcx
movl $0x2bf20, %r8d          # imm = 0x2BF20
callq 0x12d0
movl %eax, %ebp
testl %eax, %eax
jne 0x1e23
leaq 0x5304(%rip), %rsi      # 0x7081
leaq 0x20(%rsp), %rdi
callq 0x1110
testq %rbx, %rbx
je 0x1e23
testq %rax, %rax
je 0x1e23
leaq 0x20(%rsp), %rdi
pushq $0x20
popq %rsi
pushq $0x2c
popq %r15
leaq 0xc(%rsp), %r14
movl %r15d, %edx
movq %r14, %rcx
xorl %r8d, %r8d
callq 0x1694
movq %rax, %r12
movq %r14, %rdi
callq 0x10e0
movl %eax, (%rbx)
andl $0x0, (%r14)
movq %r12, %rdi
movl %r15d, %esi
movl %r15d, %edx
movq %r14, %rcx
xorl %r8d, %r8d
callq 0x1694
movq %rax, %r12
movq %r14, %rdi
callq 0x10e0
movl %eax, 0x4(%rbx)
leaq 0xc(%rbx), %rcx
pushq $0x22
popq %rdx
pushq $0x1
popq %r8
movq %r12, %rdi
movl %edx, %esi
callq 0x1694
andl $0x0, (%r14)
pushq $0xd
popq %rdx
movq %rax, %rdi
movl %r15d, %esi
movq %r14, %rcx
xorl %r8d, %r8d
callq 0x1694
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
// File: /workspace/github_c_makefile_star2_O2/connycommy[P]atCmdDevice/src/cellularModem/cellModem.c
// Function: cellModem_GetCPIN
cmError_t cellModem_GetCPIN(cmData_t *obj, char *getCode){
    cmError_t retVal;
    char bufferRecv[60]={0};
    char cmd[10]="AT+CPIN?\r";
    char *ptr = NULL;

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

// Assembly:
pushq %rbp
pushq %rbx
subq $0x58, %rsp
movq %rsi, %rbx
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %rcx
movups %xmm0, 0x2c(%rcx)
movaps %xmm0, 0x20(%rcx)
movaps %xmm0, 0x10(%rcx)
movaps %xmm0, (%rcx)
movabsq $0x3f4e4950432b5441, %rax # imm = 0x3F4E4950432B5441
movq %rsp, %rsi
movq %rax, (%rsi)
movw $0xd, 0x8(%rsi)
cmpb $0x0, 0x61(%rdi)
leaq 0x5d3f(%rip), %rax      # 0x7bb2
leaq 0x5eb8(%rip), %rdx      # 0x7d32
cmoveq %rax, %rdx
movl $0x249f0, %r8d          # imm = 0x249F0
callq 0x12d0
movl %eax, %ebp
testl %eax, %eax
jne 0x1ec0
leaq 0x51fc(%rip), %rsi      # 0x7092
leaq 0x10(%rsp), %rdi
callq 0x1110
testq %rbx, %rbx
je 0x1ec0
testq %rax, %rax
je 0x1ec0
leaq 0x10(%rsp), %rdi
pushq $0x20
popq %rsi
pushq $0xd
popq %rdx
movq %rbx, %rcx
xorl %r8d, %r8d
callq 0x1694
movl %ebp, %eax
addq $0x58, %rsp
popq %rbx
popq %rbp
retq