LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/theck01[P]offbrand_lib/src/classes/obstring.c
// Function: obstring_compare
int8_t obstring_compare(const obj *a, const obj *b){

  uint32_t i;
  const obstring *comp_a = (obstring *)a;
  const obstring *comp_b = (obstring *)b;

  assert(a);
  assert(b);
  assert(ob_has_class(a, "obstring"));
  assert(ob_has_class(b, "obstring"));

  /* compare string contents where both have characters */
  for(i=0; i<comp_a->length && i<comp_b->length; i++){
    if(comp_a->str[i] < comp_b->str[i]) return OB_LESS_THAN;
    else if(comp_b->str[i] < comp_a->str[i]) return OB_GREATER_THAN;
  }

  /* if characters matched check lengths for final equality */
  if(comp_a->length < comp_b->length) return OB_LESS_THAN;
  else if(comp_b->length < comp_a->length) return OB_GREATER_THAN;
  return OB_EQUAL_TO;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x4460
movq %rsi, %rbx
testq %rsi, %rsi
je 0x447f
movq %rdi, %r14
leaq 0x2958(%rip), %rsi      # 0x6d47
callq 0x5304
testb %al, %al
je 0x449e
leaq 0x2944(%rip), %rsi      # 0x6d47
movq %rbx, %rdi
callq 0x5304
testb %al, %al
je 0x44bd
movl 0x10(%r14), %ecx
movl 0x10(%rbx), %edx
testq %rcx, %rcx
je 0x4445
xorl %eax, %eax
cmpq %rax, %rdx
je 0x4445
movq 0x8(%r14), %rsi
movb (%rsi,%rax), %sil
movq 0x8(%rbx), %rdi
movb (%rdi,%rax), %dil
cmpb %dil, %sil
jl 0x4452
jg 0x4456
incq %rax
cmpq %rax, %rcx
jne 0x4421
movb $-0x1, %al
cmpl %edx, %ecx
jb 0x4458
cmpl %ecx, %edx
setb %al
jmp 0x4458
movb $-0x1, %al
jmp 0x4458
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x239a(%rip), %rdi      # 0x6801
leaq 0x24bd(%rip), %rsi      # 0x692b
leaq 0x27c7(%rip), %rcx      # 0x6c3c
movl $0x10c, %edx            # imm = 0x10C
callq 0x10a0
leaq 0x1c88(%rip), %rdi      # 0x610e
leaq 0x249e(%rip), %rsi      # 0x692b
leaq 0x27a8(%rip), %rcx      # 0x6c3c
movl $0x10d, %edx            # imm = 0x10D
callq 0x10a0
leaq 0x27c9(%rip), %rdi      # 0x6c6e
leaq 0x247f(%rip), %rsi      # 0x692b
leaq 0x2789(%rip), %rcx      # 0x6c3c
movl $0x10e, %edx            # imm = 0x10E
callq 0x10a0
leaq 0x27c6(%rip), %rdi      # 0x6c8a
leaq 0x2460(%rip), %rsi      # 0x692b
leaq 0x276a(%rip), %rcx      # 0x6c3c
movl $0x10f, %edx            # imm = 0x10F
callq 0x10a0
// File: /workspace/github_c_makefile_star2_O3/TimeToogo[P]ff-proxy/src/crypto.c
// Function: ff_derived_key_free
void ff_derived_key_free(struct ff_derived_key *key)
{
    if (key == NULL)
    {
        return;
    }

    if (key->key != NULL)
    {
        FREE(key->key);
    }

    FREE(key);
}

// Assembly:
testq %rdi, %rdi
je 0x2ff8
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rdi
testq %rdi, %rdi
je 0x2fea
callq 0x2340
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x2340
retq
// File: /workspace/github_c_makefile_star2_O3/TimeToogo[P]ff-proxy/src/crypto.c
// Function: ff_derive_key_pbkdf2
bool ff_derive_key_pbkdf2(
    struct ff_encryption_config *config,
    uint8_t *salt,
    uint16_t salt_length,
    struct ff_derived_key *out_key)

{
    int res = PKCS5_PBKDF2_HMAC(
        (char *)config->key,
        strlen((char *)config->key),
        salt, salt_length,
        config->pbkdf2_iterations,
        EVP_sha256(),
        out_key->length,
        out_key->key);

    bool success = res == 1;

    if (!success)
    {
        ff_log(FF_ERROR, ERR_error_string(ERR_get_error(), NULL));
        ff_log(FF_ERROR, "Failed to derive key using PBKDF2 algorithm");
    }

    return success;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movl %edx, -0x2c(%rbp)
movq %rsi, %r15
movq %rdi, %r12
movq (%rdi), %r13
movq %r13, %rdi
callq 0x2130
movq %rax, %r14
movl 0x8(%r12), %r12d
callq 0x2470
movzwl 0x8(%rbx), %r10d
movq %r13, %rdi
movl %r14d, %esi
movq %r15, %rdx
movl -0x2c(%rbp), %ecx
movl %r12d, %r8d
movq %rax, %r9
pushq (%rbx)
pushq %r10
callq 0x2460
addq $0x10, %rsp
movl %eax, %ebx
cmpl $0x1, %eax
je 0x3087
callq 0x23b0
movq %rax, %rdi
xorl %esi, %esi
callq 0x20b0
movl $0x4, %edi
movq %rax, %rsi
xorl %eax, %eax
callq 0x3fa4
leaq 0x3661(%rip), %rsi      # 0x66dc
movl $0x4, %edi
xorl %eax, %eax
callq 0x3fa4
cmpl $0x1, %ebx
sete %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/TimeToogo[P]ff-proxy/src/hash_table.c
// Function: ff_hash_table_init
struct ff_hash_table *ff_hash_table_init(uint8_t prefix_bit_length)
{
    assert(prefix_bit_length > 0);

    struct ff_hash_table *hash_table = malloc(sizeof(struct ff_hash_table));

    hash_table->length = 0;
    *(uint8_t *)&hash_table->prefix_bit_length = prefix_bit_length;
    *(uint8_t *)&hash_table->bucket_levels = (int)ceil(hash_table->prefix_bit_length / FF_BUCKET_POOL_BITS);

    hash_table->buckets = ff_hash_table_init_bucket();
    hash_table->linked_list = NULL;
    hash_table->linked_list_last = NULL;

    return hash_table;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
testl %edi, %edi
je 0x3110
movl %edi, %ebx
movl $0x20, %edi
callq 0x23c0
movq %rax, %r14
movl $0x0, 0x4(%rax)
movb %bl, (%rax)
shrb $0x3, %bl
movb %bl, 0x1(%rax)
movl $0x1, %edi
movl $0x800, %esi            # imm = 0x800
callq 0x21f0
movq %rax, 0x8(%r14)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%r14)
movq %r14, %rax
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x35f1(%rip), %rdi      # 0x6708
leaq 0x3600(%rip), %rsi      # 0x671e
leaq 0x360a(%rip), %rcx      # 0x672f
movl $0x14, %edx
callq 0x21e0
// File: /workspace/github_c_makefile_star2_O3/TimeToogo[P]ff-proxy/src/hash_table.c
// Function: ff_hash_table_get_or_create_bucket
union ff_hash_table_bucket *ff_hash_table_get_or_create_bucket(
    struct ff_hash_table *hash_table,
    uint64_t item_id,
    bool should_create,
    union ff_hash_table_bucket **buckets_list)
{
    union ff_hash_table_bucket *buckets = hash_table->buckets;
    uint8_t hash;

    for (uint8_t level = 0; level < hash_table->bucket_levels - 1; level++)
    {
        hash = FF_HASH_GET_FOR_LEVEL(item_id, level);

        if (buckets[hash].buckets == NULL)
        {
            if (!should_create)
            {
                return NULL;
            }

            // Init new layer
            buckets[hash].buckets = ff_hash_table_init_bucket();
        }

        buckets = buckets[hash].buckets;

        if (buckets_list != NULL)
        {
            buckets_list[level] = buckets;
        }
    }

    hash = FF_HASH_GET_FOR_LEVEL(item_id, hash_table->bucket_levels - 1);
    buckets = &buckets[hash];

    return buckets;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %edx, -0x2c(%rbp)
movq %rsi, %r8
movq 0x8(%rdi), %rbx
movzbl 0x1(%rdi), %edx
cmpl $0x2, %edx
jb 0x31f6
movq %rcx, %r9
movl $0x38, %r13d
movb $0x1, %r12b
xorl %r15d, %r15d
movq %r8, -0x48(%rbp)
movq %rcx, -0x40(%rbp)
movq %rdi, -0x38(%rbp)
movq %r8, %rax
movl %r13d, %ecx
shlq %cl, %rax
shrq %cl, %rax
movl %r15d, %ecx
shrq %cl, %rax
movzbl %al, %r14d
movl %r14d, %eax
movq (%rbx,%rax,8), %rax
testq %rax, %rax
jne 0x31cd
cmpb $0x0, -0x2c(%rbp)
je 0x3225
movl $0x1, %edi
movl $0x800, %esi            # imm = 0x800
callq 0x21f0
movq -0x38(%rbp), %rdi
movq -0x40(%rbp), %r9
movq -0x48(%rbp), %r8
movq %rax, (%rbx,%r14,8)
testq %r9, %r9
je 0x31d6
movq %rax, (%r9,%r15)
movzbl %r12b, %ecx
movzbl 0x1(%rdi), %edx
leal -0x1(%rdx), %esi
addq $0x8, %r15
addl $-0x8, %r13d
leal 0x1(%rcx), %r12d
movq %rax, %rbx
cmpl %ecx, %esi
jg 0x3186
jmp 0x31f9
movq %rbx, %rax
shll $0x3, %edx
movl %edx, %ecx
negb %cl
shlq %cl, %r8
shrq %cl, %r8
addb $-0x8, %dl
movl %edx, %ecx
shrq %cl, %r8
movzbl %r8b, %ecx
leaq (%rax,%rcx,8), %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
jmp 0x3216
// File: /workspace/github_c_makefile_star2_O3/TimeToogo[P]ff-proxy/src/hash_table.c
// Function: ff_hash_table_get_item
void *ff_hash_table_get_item(struct ff_hash_table *hash_table, uint64_t item_id)
{
    pthread_mutex_lock(&ff_hash_table_data_mutex);

    union ff_hash_table_bucket *buckets = ff_hash_table_get_or_create_bucket(hash_table, item_id, false, NULL);
    void *ret = NULL;

    if (buckets == NULL || buckets->nodes == NULL)
    {
        ret = NULL;
        goto cleanup;
    }

    struct ff_hash_table_node *node = buckets->nodes;

    do
    {
        if (node->item_id == item_id && node->value != NULL)
        {
            ret = node->value;
            goto cleanup;
        }
    } while ((node = node->next) != NULL);

cleanup:
    pthread_mutex_unlock(&ff_hash_table_data_mutex);
    return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r15
leaq 0x70a8(%rip), %rdi      # 0xa2e8
callq 0x2400
xorl %r14d, %r14d
movq %r15, %rdi
movq %rbx, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x3143
testq %rax, %rax
je 0x327b
movq (%rax), %rax
testq %rax, %rax
je 0x3278
cmpq %rbx, (%rax)
jne 0x3272
movq 0x8(%rax), %r14
testq %r14, %r14
jne 0x327b
movq 0x10(%rax), %rax
jmp 0x325f
xorl %r14d, %r14d
leaq 0x7066(%rip), %rdi      # 0xa2e8
callq 0x2230
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/TimeToogo[P]ff-proxy/src/hash_table.c
// Function: ff_hash_table_put_item
void ff_hash_table_put_item(struct ff_hash_table *hash_table, uint64_t item_id, void *item)
{
    pthread_mutex_lock(&ff_hash_table_data_mutex);

    union ff_hash_table_bucket *buckets = ff_hash_table_get_or_create_bucket(hash_table, item_id, true, NULL);

    // Find last node or matching in chain
    struct ff_hash_table_node *node = buckets->nodes;
    struct ff_hash_table_node *last_node = node;

    while (node != NULL)
    {
        // Item already exists, update in hash table
        if (node->item_id == item_id)
        {
            node->value = item;
            goto cleanup;
        }

        last_node = node;
        node = node->next;
    }

    // Store new item in hash table
    struct ff_hash_table_node *new_node = calloc(1, sizeof(struct ff_hash_table_node));
    new_node->item_id = item_id;
    new_node->value = item;

    if (last_node == NULL)
    {
        buckets->nodes = new_node;
    }
    else
    {
        last_node->next = new_node;
    }

    // Store new item in global linked list
    if (hash_table->linked_list == NULL)
    {
        hash_table->linked_list = new_node;
        hash_table->linked_list_last = new_node;
    }
    else
    {
        new_node->prev_in_list = hash_table->linked_list_last;
        hash_table->linked_list_last->next_in_list = new_node;
        hash_table->linked_list_last = new_node;
    }

    hash_table->length++;

cleanup:
    pthread_mutex_unlock(&ff_hash_table_data_mutex);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x7035(%rip), %rdi      # 0xa2e8
callq 0x2400
xorl %r13d, %r13d
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
xorl %ecx, %ecx
callq 0x3143
movq %rax, %r12
movq (%rax), %rax
testq %rax, %rax
je 0x32e6
movq %rax, %r13
cmpq %r15, (%rax)
je 0x331f
movq 0x10(%r13), %rax
jmp 0x32d3
movl $0x1, %edi
movl $0x28, %esi
callq 0x21f0
movq %r15, (%rax)
leaq 0x10(%r13), %rcx
testq %r13, %r13
cmoveq %r12, %rcx
movq %r14, 0x8(%rax)
movq %rax, (%rcx)
cmpq $0x0, 0x10(%rbx)
je 0x3325
movq 0x18(%rbx), %rcx
movq %rcx, 0x18(%rax)
movq %rax, 0x20(%rcx)
jmp 0x3329
movq %r14, 0x8(%r13)
jmp 0x3330
movq %rax, 0x10(%rbx)
movq %rax, 0x18(%rbx)
incl 0x4(%rbx)
leaq 0x6fb1(%rip), %rdi      # 0xa2e8
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2230
// File: /workspace/github_c_makefile_star2_O3/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 0x3502
testl %edi, %edi
je 0x353d
decb %dil
xorl %r15d, %r15d
movzbl %dil, %r14d
movq (%rbx,%r15,8), %rsi
testq %rsi, %rsi
je 0x34f4
movl %r14d, %edi
callq 0x34c3
incq %r15
cmpq $0x100, %r15            # imm = 0x100
jne 0x34e3
jmp 0x352b
xorl %r14d, %r14d
movq (%rbx,%r14,8), %rdi
testq %rdi, %rdi
je 0x351f
movq 0x10(%rdi), %r15
callq 0x2340
movq %r15, %rdi
testq %r15, %r15
jne 0x350e
incq %r14
cmpq $0x100, %r14            # imm = 0x100
jne 0x3505
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x2340
leaq 0x321d(%rip), %rdi      # 0x6761
leaq 0x31d3(%rip), %rsi      # 0x671e
leaq 0x3221(%rip), %rcx      # 0x6773
movl $0x134, %edx            # imm = 0x134
callq 0x21e0
// File: /workspace/github_c_makefile_star2_O3/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 0x6d7c(%rip), %rdi      # 0xa2e8
callq 0x2400
movl $0x1, %edi
movl $0x18, %esi
callq 0x21f0
movq %rbx, (%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x35a7
movq 0x8(%rdi), %rax
testq %rax, %rax
je 0x35c1
movq 0x20(%rax), %rax
movq %rax, 0x8(%rdi)
jmp 0x35b6
movq (%rdi), %rax
movq 0x10(%rax), %rax
movq %rax, 0x8(%rdi)
movb $0x1, 0x10(%rdi)
testq %rax, %rax
je 0x35c1
movq 0x8(%rax), %rax
jmp 0x35c3
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x3fea
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, 0x62cc(%rip)      # 0xa2d8
ja 0x40b5
movq %rsi, %rbx
movl %edi, %r14d
leaq -0x20(%rbp), %r15
movq %r15, %rdi
callq 0x2290
movq %r15, %rdi
callq 0x2210
leaq 0x2c6e(%rip), %rdx      # 0x6ca1
leaq -0x40(%rbp), %rdi
movl $0x14, %esi
movq %rax, %rcx
callq 0x2250
decl %r14d
cmpl $0x4, %r14d
ja 0x4060
movl %r14d, %eax
leaq 0x2c91(%rip), %rcx      # 0x6ce8
movslq (%rcx,%rax,4), %r14
addq %rcx, %r14
jmp 0x4067
leaq 0x2c6b(%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 0x2c36(%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_O3/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 0x11a4(%rip), %rsi      # 0x527c
movl $0x2, %edi
callq 0x2330
leaq 0x6227(%rip), %rdi      # 0xa310
movl %r14d, %esi
movq %rbx, %rdx
callq 0x261c
xorl %ebx, %ebx
decl %eax
cmpl $0x3, %eax
ja 0x4153
leaq 0x2bf8(%rip), %rcx      # 0x6cfc
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x61fc(%rip), %rdi      # 0xa310
callq 0x4ac4
movl %eax, %ebx
jmp 0x4153
movq 0x5ea4(%rip), %rax      # 0x9fc8
movq (%rax), %rdi
callq 0x2952
jmp 0x4153
movq 0x5eab(%rip), %rax      # 0x9fe0
movq (%rax), %rdi
callq 0x2952
movl $0x1, %ebx
jmp 0x4153
movq 0x5e7d(%rip), %rax      # 0x9fc8
movq (%rax), %rdi
callq 0x299f
leaq 0x2bb2(%rip), %rsi      # 0x6d0c
movl $0x2, %edi
xorl %eax, %eax
callq 0x3fa4
movl %ebx, %eax
popq %rbx
popq %r14
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/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 0x44e4
testb %al, %al
je 0x41e1
movabsq $-0xffffffff, %rax      # imm = 0xFFFFFFFF00000001
movq %rax, (%r14)
movl %ebx, %eax
movq %rax, 0x40(%r14)
movq %rax, 0x48(%r14)
callq 0x4921
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 0x493e
cmpl $0x13, %ebx
ja 0x420d
leaq 0x2b2a(%rip), %rsi      # 0x6d17
movl $0x3, %edi
movl %ebx, %edx
xorl %eax, %eax
callq 0x3fa4
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 0x4248
// File: /workspace/github_c_makefile_star2_O3/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 0x4537
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 0x5d8a(%rip), %r13      # 0xa290
movq (%r13,%r12,8), %r14
movq %r14, %rdi
callq 0x2130
cmpq %r15, %rax
ja 0x4533
movq %r14, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x2150
testl %eax, %eax
je 0x453a
incq %r12
cmpq $0x9, %r12
jne 0x4506
xorl %eax, %eax
jmp 0x453c
xorl %eax, %eax
retq
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x4a34
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpb $0x0, 0x28(%rdi)
je 0x49eb
xorl %r14d, %r14d
movq 0x30(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x48fb
incq %r14
movzbl 0x28(%rbx), %eax
cmpq %rax, %r14
jb 0x49d2
movq 0x30(%rbx), %rdi
callq 0x2340
movq $0x0, 0x30(%rbx)
movq 0x50(%rbx), %r14
testq %r14, %r14
je 0x4a22
movq 0x8(%r14), %rdi
movq 0x10(%r14), %r15
callq 0x2340
movq %r14, %rdi
callq 0x2340
movq %r15, %r14
testq %r15, %r15
jne 0x4a05
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x2340
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x4ab5
movq %rdi, %rbx
movl $0x18, %edi
callq 0x23c0
movq %rax, %r15
movq 0x40(%rbx), %rdi
movw %di, 0x2(%rax)
movw $0x0, (%rax)
movq $0x0, 0x10(%rax)
callq 0x23c0
movq %rax, %r12
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 %r14, %rdi
callq 0x2340
movq %r13, %r14
testq %r13, %r13
jne 0x4a7f
movq %r15, 0x50(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x26cb(%rip), %rsi      # 0x7526
xorl %eax, %eax
callq 0x3fa4
leaq -0x30(%rbp), %rdi
callq 0x2290
movq %rbx, %rdi
callq 0x355c
movq %rax, %r15
movl 0x4(%rbx), %esi
shlq $0x3, %rsi
movl $0x1, %edi
callq 0x21f0
movq %rax, %r14
movq %r15, %rdi
callq 0x358a
testq %rax, %rax
je 0x4f08
movq %rax, %r12
xorl %r13d, %r13d
cmpl $0x0, (%r12)
jne 0x4ec6
movq -0x30(%rbp), %rdi
movq 0x18(%r12), %rsi
callq 0x2170
ucomisd 0x233e(%rip), %xmm0     # 0x71f8
jb 0x4ec6
movl %r13d, %eax
incl %r13d
movq %r12, (%r14,%rax,8)
movq %r15, %rdi
callq 0x358a
movq %rax, %r12
testq %rax, %rax
jne 0x4e9d
movq %r15, %rdi
callq 0x35c5
testl %r13d, %r13d
je 0x4f10
movl %r13d, %r15d
xorl %r12d, %r12d
movq (%r14,%r12,8), %rax
movq 0x20(%rax), %rsi
movq %rbx, %rdi
callq 0x334a
incq %r12
cmpq %r12, %r15
jne 0x4ee9
movl $0x3, %edi
jmp 0x4f18
movq %r15, %rdi
callq 0x35c5
movl $0x1, %edi
xorl %r13d, %r13d
leaq 0x262f(%rip), %rsi      # 0x754e
movl %r13d, %edx
xorl %eax, %eax
callq 0x3fa4
jmp 0x4e45
// File: /workspace/github_c_makefile_star2_O3/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 0x4a35
leaq 0x18(%r13), %rsi
movq %r14, %rdi
callq 0x29dc
leaq 0x236d(%rip), %r12      # 0x74e5
cmpl $0x4, (%r14)
jne 0x51d2
movq %r14, %rdi
callq 0x473e
cmpl $0x7, (%r14)
jne 0x51d2
movq %r14, %rdi
movq %r13, %rsi
callq 0x5214
testb %al, %al
je 0x51bb
movq %r14, %rdi
callq 0x35dc
cmpl $0xa, (%r14)
leaq 0x2355(%rip), %rax      # 0x7503
leaq 0x2330(%rip), %r12      # 0x74e5
cmoveq %rax, %r12
jmp 0x51d2
movq 0x20(%r14), %rdx
leaq 0x22e2(%rip), %rsi      # 0x74a8
movl $0x3, %edi
xorl %eax, %eax
callq 0x3fa4
movq 0x20(%r14), %rdx
movl $0x1, %edi
movq %r12, %rsi
xorl %eax, %eax
callq 0x3fa4
movq 0x20(%r14), %rsi
testq %rsi, %rsi
je 0x51f6
movq %r15, %rdi
callq 0x334a
movq %r14, %rdi
callq 0x49b7
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_O3/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:
movzbl 0x28(%rdi), %ecx
movb $0x1, %al
testq %rcx, %rcx
je 0x527a
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq 0x30(%rdi), %rdx
xorl %r14d, %r14d
movq -0x8(%rdx,%rcx,8), %rsi
cmpl $0x8, (%rsi)
jne 0x524b
cmpw $0x8, 0x4(%rsi)
jne 0x524b
movq 0x8(%rsi), %rsi
movq (%rsi), %r14
bswapq %r14
decq %rcx
jne 0x5230
testq %r14, %r14
je 0x5276
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
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O3/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 0x13ec
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
ja 0x138c
movb 0x21(%rbx), %al
cmpb $0x1, %al
jne 0x1358
jmp 0x1397
movq $0x0, 0x58(%rbx)
movb 0x21(%rbx), %al
cmpb $0x0, 0x21(%rbx)
je 0x13d4
testq %r15, %r15
je 0x13b3
movq 0x10(%rbx), %rdi
movq %r15, %rsi
callq 0x1110
testq %rax, %rax
je 0x13dc
movb 0x21(%rbx), %al
xorl %r12d, %r12d
cmpb $0x1, %al
jne 0x13e5
testq %r14, %r14
je 0x13ce
movq 0x10(%rbx), %rsi
movq %r14, %rdi
callq 0x1050
movb $0x0, 0x60(%rbx)
jmp 0x13e5
movl $0x1, %r12d
jmp 0x13ec
movb 0x21(%rbx), %al
movl $0x3, %r12d
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_O3/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 0x160f
movq %rcx, %r12
movq %rdx, %r13
movq %rsi, %rbp
movq %r8, 0x8(%rsp)
movq %r9, 0x10(%rsp)
leaq 0xaad0(%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 0x15d7
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_O3/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 0x6574(%rip), %rax      # 0x7bd2
leaq 0x66ed(%rip), %rdx      # 0x7d52
cmoveq %rax, %rdx
leaq 0x20(%rsp), %rcx
movl $0x12c, %r8d            # imm = 0x12C
callq 0x12cc
movl %eax, %ebp
testl %eax, %eax
jne 0x16bc
leaq 0x59d0(%rip), %rsi      # 0x7056
leaq 0x20(%rsp), %rdi
callq 0x1110
testq %rax, %rax
je 0x16bc
leaq 0x20(%rsp), %rdi
movq %rsp, %r14
movl $0x20, %esi
movl $0x2c, %edx
movq %r14, %rcx
xorl %r8d, %r8d
callq 0x16cc
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_O3/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 0x1735
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 0x172d
movq %rax, %r14
leaq 0x1(%rax), %r15
movzbl %bpl, %esi
movq %r15, %rdi
callq 0x1080
testq %rax, %rax
je 0x172d
movq %rax, %r12
testq %rbx, %rbx
je 0x1726
notq %r14
movq %r12, %rdx
addq %r14, %rdx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x1040
movq %r12, 0xaeb3(%rip)      # 0xc5e0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
movq 0xaea4(%rip), %rax      # 0xc5e0
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x59ec(%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 0x180a
movq 0x8(%rax), %r15
testq %r15, %r15
je 0x180a
movq 0x10(%rax), %r14
testq %r14, %r14
je 0x180a
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 0x1844
movq %rsp, %rdi
callq 0x1070
movabsq $0xd302c224c4543, %rcx  # imm = 0xD302C224C4543
movq %rcx, 0x30(%rsp,%rax)
movups 0x5839(%rip), %xmm0     # 0x7061
movups %xmm0, (%rsp,%rax)
movups 0x583e(%rip), %xmm0     # 0x7071
movups %xmm0, 0x10(%rsp,%rax)
movups 0x5842(%rip), %xmm0     # 0x7081
movups %xmm0, 0x20(%rsp,%rax)
cmpb $0x0, 0x61(%rbx)
leaq 0x6383(%rip), %rax      # 0x7bd2
leaq 0x64fc(%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_O3/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 0x57ee(%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 0x62f3(%rip), %rax      # 0x7bd2
leaq 0x646c(%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_O3/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 0x6295(%rip), %rax      # 0x7bd2
leaq 0x640e(%rip), %rdx      # 0x7d52
cmoveq %rax, %rdx
leaq 0x10(%rsp), %rcx
movl $0x12c, %r8d            # imm = 0x12C
callq 0x12cc
movl %eax, %ebp
testl %eax, %eax
jne 0x19e9
leaq 0x5733(%rip), %rsi      # 0x709c
leaq 0x10(%rsp), %rdi
callq 0x1110
testq %rax, %rax
je 0x19e9
leaq 0x10(%rsp), %rdi
movl $0x22, %esi
movl $0x22, %edx
movq %rbx, %rcx
xorl %r8d, %r8d
callq 0x16cc
leaq 0x20(%rbx), %rcx
movq %rax, %rdi
movl $0x22, %esi
movl $0x22, %edx
movl $0x2, %r8d
callq 0x16cc
leaq 0x28(%rbx), %rcx
movq %rax, %rdi
movl $0x22, %esi
movl $0x22, %edx
movl $0x2, %r8d
callq 0x16cc
addq $0x48, %rbx
movq %rax, %rdi
movl $0x2c, %esi
movl $0xd, %edx
movq %rbx, %rcx
movl $0x1, %r8d
callq 0x16cc
movl %ebp, %eax
addq $0x98, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x61b7(%rip), %rax      # 0x7bd2
leaq 0x6330(%rip), %rdx      # 0x7d52
cmoveq %rax, %rdx
leaq 0x10(%rsp), %rcx
movl $0x12c, %r8d            # imm = 0x12C
callq 0x12cc
movl %eax, %ebp
testl %eax, %eax
jne 0x1a8e
leaq 0x10(%rsp), %rdi
movl $0xa, %esi
movl $0xd, %edx
movq %rbx, %rcx
xorl %r8d, %r8d
callq 0x16cc
leaq 0x10(%rbx), %rcx
movq %rax, %rdi
movl $0xa, %esi
movl $0xd, %edx
movl $0x1, %r8d
callq 0x16cc
addq $0x20, %rbx
movq %rax, %rdi
movl $0xa, %esi
movl $0xd, %edx
movq %rbx, %rcx
xorl %r8d, %r8d
callq 0x16cc
movl %ebp, %eax
addq $0x58, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x610f(%rip), %rax      # 0x7bd2
leaq 0x6288(%rip), %rdx      # 0x7d52
cmoveq %rax, %rdx
leaq 0x10(%rsp), %rcx
movl $0x12c, %r8d            # imm = 0x12C
callq 0x12cc
movl %eax, %ebp
testq %rbx, %rbx
je 0x1b03
testl %ebp, %ebp
jne 0x1b03
leaq 0x10(%rsp), %rdi
movl $0xa, %esi
movl $0xd, %edx
movq %rbx, %rcx
xorl %r8d, %r8d
callq 0x16cc
movl %ebp, %eax
addq $0x58, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x609a(%rip), %rax      # 0x7bd2
leaq 0x6213(%rip), %rdx      # 0x7d52
cmoveq %rax, %rdx
leaq 0x10(%rsp), %rcx
movl $0x12c, %r8d            # imm = 0x12C
callq 0x12cc
movl %eax, %ebp
testq %rbx, %rbx
je 0x1b78
testl %ebp, %ebp
jne 0x1b78
leaq 0x10(%rsp), %rdi
movl $0xa, %esi
movl $0xd, %edx
movq %rbx, %rcx
xorl %r8d, %r8d
callq 0x16cc
movl %ebp, %eax
addq $0x58, %rsp
popq %rbx
popq %rbp
retq