LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/xiaowenhuyuehu[P]remote_access/src/utility/hash_table/hash_table.c
// Function: ht_iterator_lockless
void *ht_iterator_lockless(void *ht, iter_func func, void *usr)
{
    int i = 0;
    ht_t *pt = ht;
    ht_item_t *item = NULL;

    if (!pt || !func) {
        return NULL;
    }

    for (i = 0; i < pt->cnt; i++) {
        item = pt->item + i;

        while (item) {
            if (!item->key || !item->val) {
                item = item->next;
            } else {
                if(0 == func(item->key, item->val, usr))
                    return item->key;
                else
                    item = item->next;
            }
        }
    }

    return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
jne 0x4256
movq %rdi, %r12
cmpl $0x0, (%rdi)
jle 0x4256
movq %rdx, %r14
movq %rsi, %r15
xorl %ebx, %ebx
xorl %r13d, %r13d
movq 0x30(%r12), %rbp
testq %rbp, %rbp
je 0x4248
movq %r13, %rax
shlq $0x5, %rax
addq %rax, %rbp
movq (%rbp), %rdi
testq %rdi, %rdi
je 0x423f
movq 0x8(%rbp), %rsi
testq %rsi, %rsi
je 0x423f
movq %r14, %rdx
callq *%r15
testl %eax, %eax
je 0x425a
movq 0x18(%rbp), %rbp
testq %rbp, %rbp
jne 0x4223
incq %r13
movslq (%r12), %rax
cmpq %rax, %r13
jl 0x420f
jmp 0x425e
xorl %ebx, %ebx
jmp 0x425e
movq (%rbp), %rbx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/xiaowenhuyuehu[P]remote_access/src/utility/hash_table/hash_table.c
// Function: ht_clear_lockless
int ht_clear_lockless(void *ht)
{
    ht_t *pt = ht;
    int i = 0;
    if (!ht) {
        return -1;
    }

    for (i = 0; i < pt->cnt; i++) {
        _ht_del_node(pt->item + i, NULL, 0);
    }

    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x42ae
movq %rdi, %r14
cmpl $0x0, (%rdi)
jle 0x42b5
xorl %ebx, %ebx
xorl %r15d, %r15d
xorl %r12d, %r12d
movq 0x30(%r14), %rdi
addq %r15, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x40cb
incq %r12
movslq (%r14), %rax
addq $0x20, %r15
cmpq %rax, %r12
jl 0x428d
jmp 0x42b7
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
jmp 0x42b7
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/xiaowenhuyuehu[P]remote_access/src/utility/hash_table/hash_table.c
// Function: ht_clear
int ht_clear(void *ht)
{
    int ret = 0;
    ht_lock(ht);
    ret = ht_clear_lockless(ht);
    ht_unlock(ht);

    return ret;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
testq %rdi, %rdi
je 0x42d9
leaq 0x8(%rbx), %rdi
callq 0x2500
movq %rbx, %rdi
callq 0x4270
movl %eax, %ebp
testq %rbx, %rbx
je 0x42f4
addq $0x8, %rbx
movq %rbx, %rdi
callq 0x2560
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/xiaowenhuyuehu[P]remote_access/src/utility/hash_table/hash_table.c
// Function: ht_destroy
int ht_destroy(void *ht)
{
    ht_t *pt = (ht_t *)ht;
    if (!pt) {
        return -1;
    }

    ht_lock(pt);

    ht_clear_lockless(pt);
    free(pt->item);

    ht_unlock(pt);

    pthread_mutex_destroy(&pt->locker);
    free(pt);

    return 0;
}

// Assembly:
testq %rdi, %rdi
je 0x4348
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x8(%rdi), %r14
movq %r14, %rdi
callq 0x2500
movq %rbx, %rdi
callq 0x4270
movq 0x30(%rbx), %rdi
callq 0x2250
movq %r14, %rdi
callq 0x2560
movq %r14, %rdi
callq 0x2530
movq %rbx, %rdi
callq 0x2250
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
retq
nop
// File: /workspace/github_c_makefile_star2_O1/xiaowenhuyuehu[P]remote_access/src/utility/log/simple_log.c
// Function: log_print
void log_print(LOG_LEVEL lvl, cchar *color, cchar *f, int l, cchar *fmt, ...)
{
    if(lvl < g_log_lvl)
        return;

    va_list ap;
    va_start(ap, fmt);

    char *tmp = NULL;
    char buf_date[20] = {0};
    time_t cur_time = time(NULL);

    f = !f ? "\b" : f;

    tmp = strrchr(f, '/');
    if(tmp)
        f = tmp + 1;

    //add color support
    if (color) 
        printf("%s", color);
    
    printf(LOG_FMT,get_timestamp(buf_date, 20, cur_time), g_log_desc[lvl], f, l);

    vprintf(fmt, ap);

    if (color) 
        printf("%s\n", COL_DEF);

    va_end(ap);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
testb %al, %al
je 0x43c6
movaps %xmm0, 0x80(%rsp)
movaps %xmm1, 0x90(%rsp)
movaps %xmm2, 0xa0(%rsp)
movaps %xmm3, 0xb0(%rsp)
movaps %xmm4, 0xc0(%rsp)
movaps %xmm5, 0xd0(%rsp)
movaps %xmm6, 0xe0(%rsp)
movaps %xmm7, 0xf0(%rsp)
movq %r9, 0x78(%rsp)
cmpl %edi, 0x8f6f(%rip)      # 0xd340
ja 0x44f9
movl %ecx, %ebp
movq %rdx, %r15
movq %rsi, %r12
movl %edi, %r14d
movq %r8, 0x8(%rsp)
leaq 0x50(%rsp), %rax
movq %rax, 0x20(%rsp)
leaq 0x140(%rsp), %rax
movq %rax, 0x18(%rsp)
movabsq $0x3000000028, %rax     # imm = 0x3000000028
movq %rax, 0x10(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
movl $0x0, 0x40(%rsp)
xorl %edi, %edi
callq 0x25b0
movq %rax, %r13
testq %r15, %r15
leaq 0x5003(%rip), %rbx      # 0x9434
cmovneq %r15, %rbx
movq %rbx, %rdi
movl $0x2f, %esi
callq 0x22f0
leaq 0x1(%rax), %r15
testq %rax, %rax
cmoveq %rbx, %r15
testq %r12, %r12
je 0x44b5
leaq 0x59d6(%rip), %rdi      # 0x9e2f
movq %r12, %rsi
xorl %eax, %eax
callq 0x2080
leaq 0x30(%rsp), %rbx
movq %rbx, %rdi
movq %r13, %rsi
callq 0x450b
movl %r14d, %eax
leaq 0x8913(%rip), %rcx      # 0xcd90
movq (%rcx,%rax,8), %rdx
leaq 0x4fae(%rip), %rdi      # 0x9436
movq %rbx, %rsi
movq %r15, %rcx
movl %ebp, %r8d
xorl %eax, %eax
callq 0x2080
leaq 0x10(%rsp), %rsi
movq 0x8(%rsp), %rdi
callq 0x2360
leaq 0x4f98(%rip), %rdi      # 0x9446
callq 0x20d0
jmp 0x44f9
leaq 0x30(%rsp), %rbx
movq %rbx, %rdi
movq %r13, %rsi
callq 0x450b
movl %r14d, %eax
leaq 0x88c1(%rip), %rcx      # 0xcd90
movq (%rcx,%rax,8), %rdx
leaq 0x4f5c(%rip), %rdi      # 0x9436
movq %rbx, %rsi
movq %r15, %rcx
movl %ebp, %r8d
xorl %eax, %eax
callq 0x2080
leaq 0x10(%rsp), %rsi
movq 0x8(%rsp), %rdi
callq 0x2360
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/xiaowenhuyuehu[P]remote_access/src/utility/log/simple_log.c
// Function: get_timestamp
static char *get_timestamp(char *buf, int len, time_t cur_time)
{
    struct tm tm_time;

    localtime_r(&cur_time, &tm_time);

    snprintf(buf, len, "%d-%d-%d %d:%d:%d",
             1900 + tm_time.tm_year, 1 + tm_time.tm_mon,
             tm_time.tm_mday, tm_time.tm_hour,
             tm_time.tm_min, tm_time.tm_sec);
    return buf;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
leaq 0x8(%rsp), %rdi
movq %rsi, (%rdi)
leaq 0x10(%rsp), %r14
movq %r14, %rsi
callq 0x24c0
movl $0x76c, %ecx            # imm = 0x76C
addl 0x14(%r14), %ecx
movl 0x10(%r14), %r8d
incl %r8d
movl 0xc(%r14), %r9d
movl 0x8(%r14), %r10d
movl (%r14), %r11d
movl 0x4(%r14), %r14d
subq $0x8, %rsp
leaq 0x4ef7(%rip), %rdx      # 0x944b
movl $0x14, %esi
movq %rbx, %rdi
xorl %eax, %eax
pushq %r11
pushq %r14
pushq %r10
callq 0x20b0
addq $0x20, %rsp
movq %rbx, %rax
addq $0x48, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/xiaowenhuyuehu[P]remote_access/src/utility/sha256/sha256.c
// Function: sha256_hash
void
sha256_hash(unsigned char *buf, const unsigned char *data, size_t size)
{
  sha256_t hash;
  sha256_init(&hash);
  sha256_update(&hash, data, size);
  sha256_final(&hash, buf);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x68, %rsp
movq %rdi, %rbx
movaps 0x4dd9(%rip), %xmm0     # 0x94e0
movq %rsp, %r14
movups %xmm0, (%r14)
movaps 0x4ddb(%rip), %xmm0     # 0x94f0
movups %xmm0, 0x10(%r14)
movq $0x0, 0x20(%r14)
movq %r14, %rdi
callq 0x473d
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4790
addq $0x68, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/xiaowenhuyuehu[P]remote_access/src/utility/sha256/sha256.c
// Function: sha256_update
void
sha256_update(sha256_t *p, const unsigned char *data, size_t size)
{
  uint32_t curBufferPos = (uint32_t)p->count & 0x3F;
  while (size > 0)
  {
    p->buffer[curBufferPos++] = *data++;
    p->count++;
    size--;
    if (curBufferPos == 64)
    {
      curBufferPos = 0;
      sha256_write_byte_block(p);
    }
  }
}

// Assembly:
testq %rdx, %rdx
je 0x478f
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movl 0x20(%rdi), %eax
andl $0x3f, %eax
xorl %r12d, %r12d
movb (%r14,%r12), %cl
movl %eax, %edx
incl %eax
movb %cl, 0x28(%r15,%rdx)
incq 0x20(%r15)
cmpl $0x40, %eax
jne 0x477c
movq %r15, %rdi
callq 0x484c
xorl %eax, %eax
incq %r12
cmpq %r12, %rbx
jne 0x475c
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/xiaowenhuyuehu[P]remote_access/src/utility/sha256/sha256.c
// Function: sha256_final
void
sha256_final(sha256_t *p, unsigned char *digest)
{
  uint64_t lenInBits = (p->count << 3);
  uint32_t curBufferPos = (uint32_t)p->count & 0x3F;
  unsigned i;
  p->buffer[curBufferPos++] = 0x80;
  while (curBufferPos != (64 - 8))
  {
    curBufferPos &= 0x3F;
    if (curBufferPos == 0)
      sha256_write_byte_block(p);
    p->buffer[curBufferPos++] = 0;
  }
  for (i = 0; i < 8; i++)
  {
    p->buffer[curBufferPos++] = (unsigned char)(lenInBits >> 56);
    lenInBits <<= 8;
  }
  sha256_write_byte_block(p);

  for (i = 0; i < 8; i++)
  {
    *digest++ = (unsigned char)(p->state[i] >> 24);
    *digest++ = (unsigned char)(p->state[i] >> 16);
    *digest++ = (unsigned char)(p->state[i] >> 8);
    *digest++ = (unsigned char)(p->state[i]);
  }
  sha256_init(p);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x20(%rdi), %r15
movl %r15d, %r12d
andl $0x3f, %r12d
movb $-0x80, 0x28(%rdi,%r12)
incl %r12d
cmpl $0x38, %r12d
je 0x47ce
andl $0x3f, %r12d
jne 0x47c6
movq %rbx, %rdi
callq 0x484c
movb $0x0, 0x28(%rbx,%r12)
jmp 0x47af
shlq $0x3, %r15
movl $0x60, %eax
movq %r15, %rcx
shrq $0x38, %rcx
movb %cl, (%rbx,%rax)
shlq $0x8, %r15
incq %rax
cmpq $0x68, %rax
jne 0x47d7
movq %rbx, %rdi
callq 0x484c
xorl %eax, %eax
movb 0x3(%rbx,%rax,4), %cl
movb %cl, (%r14,%rax,4)
movb 0x2(%rbx,%rax,4), %cl
movb %cl, 0x1(%r14,%rax,4)
movb 0x1(%rbx,%rax,4), %cl
movb %cl, 0x2(%r14,%rax,4)
movb (%rbx,%rax,4), %cl
movb %cl, 0x3(%r14,%rax,4)
incq %rax
cmpq $0x8, %rax
jne 0x47f8
movaps 0x4cb6(%rip), %xmm0     # 0x94e0
movups %xmm0, (%rbx)
movaps 0x4cbc(%rip), %xmm0     # 0x94f0
movups %xmm0, 0x10(%rbx)
movq $0x0, 0x20(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/xiaowenhuyuehu[P]remote_access/src/core/remote_terminal.c
// Function: timeval_substract
int _timeval_substract (struct timeval * a,
                           struct timeval * b,
                           struct timeval * result)
{
    /* Perform the carry for the later subtraction by updating
     * y. */
    if (a->tv_usec < b->tv_usec) {
        int nsec = (b->tv_usec - a->tv_usec) / 1000000 + 1;
        b->tv_usec -= 1000000 * nsec;
        b->tv_sec += nsec;
    }

    if (a->tv_usec - b->tv_usec > 1000000) {
        int nsec = (a->tv_usec - b->tv_usec) / 1000000;
        b->tv_usec += 1000000 * nsec;
        b->tv_sec -= nsec;
    }

    /* get the result */
    result->tv_sec = a->tv_sec - b->tv_sec;
    result->tv_usec = a->tv_usec - b->tv_usec;

       /* return 1 if result is negative. */
       return a->tv_sec < b->tv_sec;
}

// Assembly:
movq %rdx, %rcx
movq 0x8(%rsi), %r9
movq %r9, %rax
movabsq $0x431bde82d7b634db, %r8 # imm = 0x431BDE82D7B634DB
subq 0x8(%rdi), %rax
jle 0x57a1
imulq %r8
movq %rdx, %rax
shrq $0x12, %rax
shrq $0x3f, %rdx
addl %edx, %eax
incl %eax
imull $0xf4240, %eax, %edx    # imm = 0xF4240
movslq %edx, %rdx
subq %rdx, %r9
movq %r9, 0x8(%rsi)
cltq
addq %rax, (%rsi)
movq 0x8(%rdi), %rax
movq 0x8(%rsi), %r9
subq %r9, %rax
cmpq $0xf4241, %rax          # imm = 0xF4241
jl 0x57da
mulq %r8
shrq $0x12, %rdx
movabsq $0xf424000000000, %rax  # imm = 0xF424000000000
imulq %rdx, %rax
sarq $0x20, %rax
addq %r9, %rax
movq %rax, 0x8(%rsi)
movslq %edx, %rax
subq %rax, (%rsi)
movq (%rdi), %rax
subq (%rsi), %rax
movq %rax, (%rcx)
movq 0x8(%rdi), %rax
subq 0x8(%rsi), %rax
movq %rax, 0x8(%rcx)
movq (%rdi), %rcx
xorl %eax, %eax
cmpq (%rsi), %rcx
setl %al
retq
// File: /workspace/github_c_makefile_star2_O1/xiaowenhuyuehu[P]remote_access/src/core/remote_terminal.c
// Function: send_error_resp
static void _send_error_resp(int code, char *msg, char *msg_id, char *session_id, char *send_buf)
{
    char *tmp_buf = NULL;
    char *buf_hdr = NULL;

    tmp_buf  = sda_gen_payload_msg(code, NULL, msg);
    buf_hdr = sda_gen_msg_header(MSG_RESP_OK , strlen(tmp_buf), msg_id, session_id);
    
    memset(send_buf, 0, DEFAULT_MSG_BUFFER_LEN);
    snprintf(send_buf, DEFAULT_MSG_BUFFER_LEN, "%s%s", buf_hdr, tmp_buf); 
    rd_net_write(&g_network, NULL, send_buf, strlen(send_buf), 0);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %rbx
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, %rdx
xorl %esi, %esi
callq 0x7094
movq %rax, %r14
movq %rax, %rdi
callq 0x2270
xorl %edi, %edi
movl %eax, %esi
movq %r12, %rdx
movq %r15, %rcx
callq 0x6fe8
movq %rax, %r15
movl $0x2000, %edx           # imm = 0x2000
movq %rbx, %rdi
xorl %esi, %esi
callq 0x2090
leaq 0x2cbd(%rip), %rdx      # 0x993e
movl $0x2000, %esi           # imm = 0x2000
movq %rbx, %rdi
movq %r15, %rcx
movq %r14, %r8
xorl %eax, %eax
callq 0x20b0
movq %rbx, %rdi
callq 0x2270
leaq 0x66a3(%rip), %rdi      # 0xd348
xorl %esi, %esi
movq %rbx, %rdx
movl %eax, %ecx
xorl %r8d, %r8d
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x284a
// File: /workspace/github_c_makefile_star2_O1/xiaowenhuyuehu[P]remote_access/src/core/remote_terminal.c
// Function: sig_int_handler
static void _sig_int_handler(int sig)
{
    if (SIGINT == sig) {
        if(g_is_running == 0){
            log_info("force exit !\r\n");
            exit(0); 
        }
        g_is_running = 0; 
        log_info( "Caught signal: %s, exiting..., %d\r\n", strsignal(sig), sig);
    }
}

// Assembly:
pushq %rax
cmpl $0x2, %edi
jne 0x6fb8
cmpb $0x1, 0x6413(%rip)      # 0xd388
je 0x6fba
movb $0x1, 0x640a(%rip)      # 0xd388
movl $0x2, %edi
callq 0x2130
movl $0x2, (%rsp)
leaq 0x26f3(%rip), %rsi      # 0x9689
leaq 0x2699(%rip), %rdx      # 0x9636
leaq 0x2d61(%rip), %r8       # 0x9d05
movl $0x1, %edi
movl $0x21, %ecx
movq %rax, %r9
xorl %eax, %eax
callq 0x4371
popq %rax
retq
leaq 0x26c8(%rip), %rsi      # 0x9689
leaq 0x266e(%rip), %rdx      # 0x9636
leaq 0x2d27(%rip), %r8       # 0x9cf6
movl $0x1, %edi
movl $0x1d, %ecx
xorl %eax, %eax
callq 0x4371
xorl %edi, %edi
callq 0x2100
nop
// File: /workspace/github_c_makefile_star2_O1/xiaowenhuyuehu[P]remote_access/src/core/net_protocol.c
// Function: sda_gen_msg_header
char *sda_gen_msg_header(int msg_type, int payload_len, char *msg_id, char *token)
{
    static char msg[DEFAULT_MSG_HDR_LEN] = {0};

    memset(msg, 0, sizeof(msg));
    snprintf(msg, sizeof(msg) - 1, MSG_HEAD_FMT,
                    msg_type, payload_len, msg_id == NULL ? rand_string_static() : msg_id,
                    time(NULL), token == NULL ? "" : token);

    log_debug("send msg : %s\n", msg);
    return msg;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rcx, %r15
movq %rdx, %r14
movl %esi, %ebx
movl %edi, %ebp
leaq 0x63a0(%rip), %rdi      # 0xd3a0
movl $0x400, %edx            # imm = 0x400
xorl %esi, %esi
callq 0x2090
testq %r14, %r14
jne 0x701b
xorl %eax, %eax
callq 0x3c21
movq %rax, %r14
xorl %edi, %edi
callq 0x25b0
movq %rax, %r10
testq %r15, %r15
leaq 0x2406(%rip), %r11      # 0x9435
cmovneq %r15, %r11
leaq 0x6366(%rip), %r15      # 0xd3a0
leaq 0x2d53(%rip), %rdx      # 0x9d94
movl $0x3ff, %esi            # imm = 0x3FF
movq %r15, %rdi
movl %ebp, %ecx
movl %ebx, %r8d
movq %r14, %r9
xorl %eax, %eax
pushq %r11
pushq %r10
callq 0x20b0
addq $0x10, %rsp
leaq 0x1f9d(%rip), %rsi      # 0x9004
leaq 0x2d79(%rip), %rdx      # 0x9de7
leaq 0x2d8a(%rip), %r8       # 0x9dff
xorl %edi, %edi
movl $0x11, %ecx
movq %r15, %r9
xorl %eax, %eax
callq 0x4371
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/xiaowenhuyuehu[P]remote_access/src/core/net_protocol.c
// Function: sda_gen_handshake_msg
char *sda_gen_handshake_msg(char *pk, char *dn, char *ds)
{
    static char msg[DEFAULT_MSG_HDR_LEN] = {0};
    char ipaddr[256] = {0};

    //FIXME
    //get_dev_ip(ipaddr, sizeof(ipaddr));

    memset(msg,0,sizeof(msg));
    snprintf(msg, sizeof(msg), MSG_HDSK_FMT, 
                    g_uuid, pk, dn, "v2.0", 
                    ipaddr, "", "", calc_sign(g_uuid, dn, pk, ds));

    return msg; 
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x138, %rsp            # imm = 0x138
movq %rdx, %r13
movq %rsi, %r14
movq %rdi, %r15
leaq 0x30(%rsp), %rdi
movl $0x100, %edx            # imm = 0x100
xorl %esi, %esi
callq 0x2090
leaq 0x6a74(%rip), %rdi      # 0xdba0
movl $0x400, %edx            # imm = 0x400
xorl %esi, %esi
callq 0x2090
leaq 0x6e61(%rip), %rbp      # 0xdfa0
movl $0x400, %edx            # imm = 0x400
movq %rbp, %rdi
xorl %esi, %esi
callq 0x2090
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %rbx
movaps %xmm0, (%rbx)
movaps %xmm0, 0x10(%rbx)
leaq 0x723c(%rip), %r12      # 0xe3a0
movl $0x400, %edx            # imm = 0x400
movq %r12, %rdi
xorl %esi, %esi
callq 0x2090
xorl %edi, %edi
callq 0x25b0
movq %rax, %r10
subq $0x8, %rsp
leaq 0x2d68(%rip), %rdx      # 0x9ef0
leaq 0x2d55(%rip), %rcx      # 0x9ee4
movl $0x400, %esi            # imm = 0x400
movq %rbp, %rdi
movq %r14, 0x10(%rsp)
movq %r14, %r8
movq %r15, 0x8(%rsp)
movq %r15, %r9
xorl %eax, %eax
pushq %r10
callq 0x20b0
addq $0x10, %rsp
leaq 0x1e49(%rip), %rsi      # 0x9004
leaq 0x2c25(%rip), %rdx      # 0x9de7
leaq 0x2d56(%rip), %r8       # 0x9f1f
xorl %edi, %edi
movl $0x2c, %ecx
movq %rbp, %r9
xorl %eax, %eax
callq 0x4371
movq %rbp, %rdi
callq 0x2270
movq %rax, %r14
movq %r13, %rdi
callq 0x2270
leaq 0x1(%rax), %r8
movq %rbx, %rdi
movq %rbp, %rsi
movq %r14, %rdx
movq %r13, %rcx
callq 0x4578
leaq 0x2d2b(%rip), %rbx      # 0x9f34
xorl %r14d, %r14d
movq %r12, %rdi
callq 0x2270
leaq (%rax,%r12), %rdi
movzbl 0x10(%rsp,%r14), %edx
movq %rbx, %rsi
xorl %eax, %eax
callq 0x22d0
incq %r14
cmpq $0x20, %r14
jne 0x720c
subq $0x8, %rsp
leaq 0x21f9(%rip), %r10      # 0x9435
leaq 0x2c9c(%rip), %r11      # 0x9edf
leaq 0x6956(%rip), %rbx      # 0xdba0
leaq 0x2be1(%rip), %rdx      # 0x9e32
leaq 0x2c8c(%rip), %rcx      # 0x9ee4
movl $0x400, %esi            # imm = 0x400
movq %rbx, %rdi
movq 0x8(%rsp), %r8
movq 0x10(%rsp), %r9
xorl %eax, %eax
pushq %r12
pushq %r10
pushq %r10
leaq 0x50(%rsp), %r10
pushq %r10
pushq %r11
callq 0x20b0
addq $0x30, %rsp
movq %rbx, %rax
addq $0x138, %rsp            # imm = 0x138
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/xiaowenhuyuehu[P]remote_access/src/core/config_manager.c
// Function: deinit_cfg
void deinit_cfg()
{
	if(g_cfg == NULL)
		return;

	free(g_cfg->cloud_ip);
	free(g_cfg->cloud_port);
	free(g_cfg->cert_path);
	if(g_cfg->pk)
		free(g_cfg->pk);
	if(g_cfg->dn)
		free(g_cfg->dn);
	if(g_cfg->ds)
		free(g_cfg->ds);

    free(g_cfg);
    g_cfg = NULL;
	log_info("deinit cfg ok.");
}

// Assembly:
pushq %rbx
movq 0x6af0(%rip), %rbx      # 0xe7a0
testq %rbx, %rbx
je 0x7d33
movq (%rbx), %rdi
callq 0x2250
movq 0x8(%rbx), %rdi
callq 0x2250
movq 0x10(%rbx), %rdi
callq 0x2250
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x7cdd
callq 0x2250
movq 0x20(%rbx), %rdi
testq %rdi, %rdi
je 0x7ceb
callq 0x2250
movq 0x28(%rbx), %rdi
testq %rdi, %rdi
je 0x7cf9
callq 0x2250
movq %rbx, %rdi
callq 0x2250
movq $0x0, 0x6a94(%rip) # 0xe7a0
leaq 0x1976(%rip), %rsi      # 0x9689
leaq 0x2225(%rip), %rdx      # 0x9f3f
leaq 0x232d(%rip), %r8       # 0xa04e
movl $0x1, %edi
movl $0xdd, %ecx
xorl %eax, %eax
popq %rbx
jmp 0x4371
popq %rbx
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/xiaowenhuyuehu[P]remote_access/src/core/session_mgr.c
// Function: init_session_system
int init_session_system()
{
    if(g_ht != NULL)
        return 0;

    g_ht = ht_init(DEFAULT_SESSION_COUNT * 3);
    if(g_ht == NULL){
        log_error("failed to init session system: %s", strerror(errno)); 
        return -1;
    }
    g_session_count = 0;
    return 0;
}

// Assembly:
pushq %rbx
xorl %ebx, %ebx
cmpq $0x0, 0x6a65(%rip)      # 0xe7a8
jne 0x7da1
movl $0x60, %edi
callq 0x3c98
movq %rax, 0x6a52(%rip)      # 0xe7a8
testq %rax, %rax
je 0x7d67
movl $0x0, 0x6a4b(%rip)      # 0xe7b0
jmp 0x7da1
callq 0x2400
movl (%rax), %edi
callq 0x2330
leaq 0x18b6(%rip), %rsi      # 0x9630
leaq 0x246c(%rip), %rdx      # 0xa1ed
leaq 0x247c(%rip), %r8       # 0xa204
movl $0x3, %edi
movl $0x1b, %ecx
movq %rax, %r9
xorl %eax, %eax
callq 0x4371
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/xiaowenhuyuehu[P]remote_access/src/core/session_mgr.c
// Function: deinit_session_system
void deinit_session_system()
{
    if(g_ht == NULL)
        return;
    ht_destroy(g_ht);
    g_session_count = 0;
    g_ht = NULL;
}

// Assembly:
movq 0x69fc(%rip), %rdi      # 0xe7a8
testq %rdi, %rdi
je 0x7dd0
pushq %rax
callq 0x42fd
movl $0x0, 0x69ef(%rip)      # 0xe7b0
movq $0x0, 0x69dc(%rip) # 0xe7a8
addq $0x8, %rsp
retq
// File: /workspace/github_c_makefile_star2_O1/xiaowenhuyuehu[P]remote_access/src/core/session_mgr.c
// Function: is_session_avalibe
int is_session_avalibe()
{
    if(g_session_count >=  DEFAULT_SESSION_COUNT){
        //clear timeout session 
        return clear_timeout_session();
    }    

    return 1;
}

// Assembly:
movl $0x1, %eax
cmpl $0x20, 0x69d3(%rip)     # 0xe7b0
jl 0x7e3e
pushq %rbx
subq $0x10, %rsp
movl $0x0, 0xc(%rsp)
cmpq $0x0, 0x69b4(%rip)      # 0xe7a8
jne 0x7e1c
leaq 0x1833(%rip), %rsi      # 0x9630
leaq 0x23e9(%rip), %rdx      # 0xa1ed
leaq 0x242c(%rip), %r8       # 0xa237
movl $0x3, %edi
movl $0x3e, %ecx
xorl %eax, %eax
callq 0x4371
movq 0x6985(%rip), %rdi      # 0xe7a8
leaq 0x45b(%rip), %rsi       # 0x8285
leaq 0xc(%rsp), %rbx
movq %rbx, %rdx
callq 0x41e1
movl (%rbx), %eax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/xiaowenhuyuehu[P]remote_access/src/core/session_mgr.c
// Function: get_timestamp_by_session_id
int _get_timestamp_by_session_id(char *session_id)
{
    SESSION_ITEM  *item = NULL; 
    
    if(g_ht == NULL || session_id == NULL){
        log_error("session system is not ready, please retry ");
        return -1;
    }

    item = ht_find(g_ht, session_id, DEFAULT_SESSION_LEN, NULL, NULL);
    if(item == NULL){
        log_error("could not find socketfd for session: %s ", session_id);
        return -1;
    }
    
    return item->last_modify_time;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x67bd(%rip), %rdi      # 0xe7a8
testq %rdi, %rdi
setne %al
testq %rbx, %rbx
setne %cl
testb %al, %cl
jne 0x8023
leaq 0x162e(%rip), %rsi      # 0x9630
leaq 0x21e4(%rip), %rdx      # 0xa1ed
leaq 0x2227(%rip), %r8       # 0xa237
movl $0x3, %edi
movl $0x81, %ecx
xorl %eax, %eax
callq 0x4371
jmp 0x8068
movq %rbx, %rsi
movl $0x40, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x3e27
testq %rax, %rax
je 0x803f
movl 0x8(%rax), %eax
jmp 0x806d
leaq 0x15ea(%rip), %rsi      # 0x9630
leaq 0x21a0(%rip), %rdx      # 0xa1ed
leaq 0x22b2(%rip), %r8       # 0xa306
movl $0x3, %edi
movl $0x87, %ecx
movq %rbx, %r9
xorl %eax, %eax
callq 0x4371
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/xiaowenhuyuehu[P]remote_access/src/core/session_mgr.c
// Function: free_session
void free_session(char *session_id)
{
    if(g_ht == NULL){
        log_error("session system is not ready, please retry ");
        return ;
    }
    if(_get_timestamp_by_session_id(session_id) >= 0){
        ht_del_lockless(g_ht, session_id, DEFAULT_SESSION_LEN);
    
        --g_session_count;
        log_debug("current session count: %d\n", g_session_count);
    }
}

// Assembly:
pushq %rbx
cmpq $0x0, 0x6730(%rip)      # 0xe7a8
je 0x80cf
movq %rdi, %rbx
callq 0x7fe0
testl %eax, %eax
js 0x80f6
movq 0x671b(%rip), %rdi      # 0xe7a8
movq %rbx, %rsi
movl $0x40, %edx
callq 0x40ac
movl 0x670f(%rip), %r9d      # 0xe7b0
decl %r9d
movl %r9d, 0x6705(%rip)      # 0xe7b0
leaq 0xf52(%rip), %rsi       # 0x9004
leaq 0x2134(%rip), %rdx      # 0xa1ed
leaq 0x226f(%rip), %r8       # 0xa32f
xorl %edi, %edi
movl $0x98, %ecx
xorl %eax, %eax
popq %rbx
jmp 0x4371
leaq 0x155a(%rip), %rsi      # 0x9630
leaq 0x2110(%rip), %rdx      # 0xa1ed
leaq 0x2153(%rip), %r8       # 0xa237
movl $0x3, %edi
movl $0x91, %ecx
xorl %eax, %eax
popq %rbx
jmp 0x4371
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/xiaowenhuyuehu[P]remote_access/src/core/session_mgr.c
// Function: get_session_id_by_socketfd
char *get_session_id_by_socketfd(int *socketfd)
{
    char *ret = NULL;

    if(g_ht == NULL){
        log_error("session system is not ready, please retry ");
        return 0;
    }

    ret = ht_iterator_lockless(g_ht, _get_socketfd, socketfd);

    log_debug("get session id: %s by socketfd: %d\n", ret, *socketfd);
    return ret;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movq 0x66a2(%rip), %rdi      # 0xe7a8
testq %rdi, %rdi
je 0x814b
leaq 0x6c(%rip), %rsi        # 0x817e
movq %r14, %rdx
callq 0x41e1
movq %rax, %rbx
movl (%r14), %eax
movl %eax, (%rsp)
leaq 0xeda(%rip), %rsi       # 0x9004
leaq 0x20bc(%rip), %rdx      # 0xa1ed
leaq 0x2212(%rip), %r8       # 0xa34a
xorl %edi, %edi
movl $0xb6, %ecx
movq %rbx, %r9
xorl %eax, %eax
callq 0x4371
jmp 0x8173
leaq 0x14de(%rip), %rsi      # 0x9630
leaq 0x2094(%rip), %rdx      # 0xa1ed
leaq 0x20d7(%rip), %r8       # 0xa237
xorl %ebx, %ebx
movl $0x3, %edi
movl $0xb0, %ecx
xorl %eax, %eax
callq 0x4371
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/xiaowenhuyuehu[P]remote_access/src/core/session_mgr.c
// Function: get_socketfd_by_session_id
int get_socketfd_by_session_id(char *session_id)
{
    SESSION_ITEM  *item = NULL; 
    
    if(g_ht == NULL || session_id == NULL){
        log_error("session system is not ready, please retry ");
        return -1;
    }

    item = ht_find(g_ht, session_id, DEFAULT_SESSION_LEN, NULL, NULL);
    if(item == NULL){
        log_error("could not find socketfd for session: %s ", session_id);
        return -1;
    }
    
    log_debug("get socketfd: %d by session id: %s \n", *item->sockfd, session_id);
    item->last_modify_time = time(NULL);
    return *item->sockfd;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x65ed(%rip), %rdi      # 0xe7a8
testq %rdi, %rdi
setne %al
testq %rbx, %rbx
setne %cl
testb %al, %cl
jne 0x81f6
leaq 0x145e(%rip), %rsi      # 0x9630
leaq 0x2014(%rip), %rdx      # 0xa1ed
leaq 0x2057(%rip), %r8       # 0xa237
movl $0x3, %edi
movl $0xbf, %ecx
xorl %eax, %eax
callq 0x4371
jmp 0x8278
movq %rbx, %rsi
movl $0x40, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x3e27
testq %rax, %rax
je 0x824f
movq %rax, %r14
movq (%rax), %rax
movl (%rax), %r9d
movq %rbx, (%rsp)
leaq 0xde3(%rip), %rsi       # 0x9004
leaq 0x1fc5(%rip), %rdx      # 0xa1ed
leaq 0x213f(%rip), %r8       # 0xa36e
xorl %edi, %edi
movl $0xc9, %ecx
xorl %eax, %eax
callq 0x4371
xorl %edi, %edi
callq 0x25b0
movq %rax, 0x8(%r14)
movq (%r14), %rax
movl (%rax), %eax
jmp 0x827d
leaq 0x13da(%rip), %rsi      # 0x9630
leaq 0x1f90(%rip), %rdx      # 0xa1ed
leaq 0x20a2(%rip), %r8       # 0xa306
movl $0x3, %edi
movl $0xc5, %ecx
movq %rbx, %r9
xorl %eax, %eax
callq 0x4371
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/xiaowenhuyuehu[P]remote_access/src/core/session_mgr.c
// Function: delete_item
static int _delete_item(void *key, void *val, void *usr)
{
    SESSION_ITEM  *item = val; 

    if(item->last_modify_time + DEFAULT_SESSION_TIMEOUT < time(NULL)){
        log_info("delete timeout session:  %s ", (char *)key);
        *(int *)usr += 1; 
        *item->sockfd = -1;
        free_session(key);
    }

    return 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
movl $0x708, %r12d           # imm = 0x708
addq 0x8(%rsi), %r12
xorl %edi, %edi
callq 0x25b0
cmpq %rax, %r12
jge 0x82e9
leaq 0x13d6(%rip), %rsi      # 0x9689
leaq 0x1f33(%rip), %rdx      # 0xa1ed
leaq 0x20d2(%rip), %r8       # 0xa393
movl $0x1, %edi
movl $0x30, %ecx
movq %rbx, %r9
xorl %eax, %eax
callq 0x4371
incl (%r15)
movq (%r14), %rax
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
movq %rbx, %rdi
callq 0x806f
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/983[P]bigint/c_examples.c
// Function: main
int main(){
    char buf[65536];

    /* neat trick to avoid having to write &a, &b, &c everywhere */
    bigint a[1], b[1], c[1];

    /* bigints have to be initialized (same as memset'ed to zero) */
    bigint_init(a);
    bigint_init(b);
    bigint_init(c);

    /* create bigint from string */
    bigint_from_str(a, "123456789");
    bigint_from_str(b, "987654321");

    /* c = a * b */
    /* first parameter is destination parameter */
    bigint_mul(c, a, b);

    /* write and print */
    puts(bigint_write(buf, sizeof(buf), c));

    /* bigints have to be free'd */
    bigint_free(a);
    bigint_free(b);
    bigint_free(c);

    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10060, %rsp          # imm = 0x10060
leaq 0x40(%rsp), %rbx
movq %rbx, %rdi
callq 0x1388
leaq 0x20(%rsp), %r14
movq %r14, %rdi
callq 0x1388
movq %rsp, %r15
movq %r15, %rdi
callq 0x1388
leaq 0x2e00(%rip), %rsi      # 0x4004
movq %rbx, %rdi
callq 0x21b9
leaq 0x2dfb(%rip), %rsi      # 0x400e
movq %r14, %rdi
callq 0x21b9
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x1f5a
leaq 0x60(%rsp), %rdi
movl $0x10000, %esi          # imm = 0x10000
movq %r15, %rdx
callq 0x3196
movq %rax, %rdi
callq 0x1040
movq %rbx, %rdi
callq 0x140d
movq %r14, %rdi
callq 0x140d
movq %r15, %rdi
callq 0x140d
xorl %eax, %eax
addq $0x10060, %rsp          # imm = 0x10060
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_c_makefile_star2_O1/salextpuru[P]speccy-toochain/src/megalz/MegaLZ_depack.c
// Function: put_buffer
ULONG put_buffer(ULONG pos,ULONG size)
{ // writes specified part of buffer to the output file (with wrapping!)
	ULONG size1,size2,success;

	if( (pos+size)<=DBSIZE )
	{ // no wrapping needed
		return (size==fwrite(&dbuf[pos],1,size,file_out))?1:0;
	}
	else
	{ // wrapping
		size1=(DBSIZE-pos);
		size2=size-size1;

		success=  (size1==fwrite(&dbuf[pos],1,size1,file_out))?1:0;
		success&= (size2==fwrite(&dbuf[0],  1,size2,file_out))?1:0;
		return success;
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movl %esi, %ebx
leal (%rbx,%rdi), %eax
cmpl $0x2000, %eax           # imm = 0x2000
ja 0x17ee
movl %ebx, %ebx
movl %edi, %edi
addq 0x380e(%rip), %rdi      # 0x4fe0
leaq 0x38f7(%rip), %rax      # 0x50d0
movq (%rax), %rcx
movl $0x1, %esi
movq %rbx, %rdx
callq 0x1130
cmpq %rbx, %rax
jmp 0x183e
movl $0x2000, %r14d          # imm = 0x2000
subl %edi, %r14d
subl %r14d, %ebx
movl %edi, %edi
leaq 0x38ed(%rip), %r15      # 0x50f0
addq %r15, %rdi
leaq 0x38c3(%rip), %r13      # 0x50d0
movq (%r13), %rcx
movl $0x1, %esi
movq %r14, %rdx
callq 0x1130
movq %rax, %r12
xorq %r14, %r12
movq (%r13), %rcx
movl $0x1, %esi
movq %r15, %rdi
movq %rbx, %rdx
callq 0x1130
xorq %rbx, %rax
orq %r12, %rax
sete %al
movzbl %al, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop
// File: /workspace/github_c_makefile_star2_O1/salextpuru[P]speccy-toochain/src/megalz/MegaLZ_depacker.c
// Function: repeat
void repeat(LONG disp,ULONG len)
{ // repeat len bytes with disp displacement (negative)
  // uses dbpos & dbuf

	ULONG i;

	for(i=0;i<len;i++)
	{
		dbuf[DBMASK&dbpos]=dbuf[DBMASK&(dbpos+disp)];
		dbpos++;
	}
}

// Assembly:
testl %esi, %esi
je 0x1b83
movl 0x559a(%rip), %eax      # 0x70f0
movl $0x1fff, %ecx           # imm = 0x1FFF
leaq 0x358e(%rip), %rdx      # 0x50f0
leal (%rdi,%rax), %r8d
andl %ecx, %r8d
movb (%r8,%rdx), %r8b
movl %eax, %r9d
andl %ecx, %r9d
movb %r8b, (%r9,%rdx)
incl %eax
decl %esi
jne 0x1b62
movl %eax, 0x556d(%rip)      # 0x70f0
retq
// File: /workspace/github_c_makefile_star2_O1/salextpuru[P]speccy-toochain/src/megalz/MegaLZ_depacker.c
// Function: get_bigdisp
LONG get_bigdisp(void)
{ // fetches 'big' displacement (-1..-4352)
  // returns negative displacement or ZERO if failed either get_bits() or get_byte()

	ULONG bits,byte;

	bits=get_bits(1);
#ifdef ERRORS
	if( bits==0xFFFFFFFF ) return 0;
#endif

	if( bits )
	{ // longer displacement
		bits=get_bits(4);
#ifdef ERRORS
		if( bits==0xFFFFFFFF ) return 0;
#endif
		byte=get_byte();
#ifdef ERRORS
		if( byte==0xFFFFFFFF ) return 0;
#endif
		return (LONG)( ((0xFFFFF000|(bits<<8))-0x0100)|byte );
	}
	else
	{ // shorter displacement
		byte=get_byte();
#ifdef ERRORS
		if( byte==0xFFFFFFFF ) return 0;
#endif
		return (LONG)( 0xFFFFFF00|byte );
	}
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl $0x1, %edi
callq 0x1af1
xorl %ebx, %ebx
cmpl $-0x1, %eax
je 0x1bde
testl %eax, %eax
jne 0x1bb3
callq 0x1784
movl %eax, %ecx
orl $0xffffff00, %ecx       # imm = 0xFFFFFF00
xorl %ebx, %ebx
cmpl $-0x1, %eax
cmovnel %ecx, %ebx
jmp 0x1bde
movl $0x4, %edi
callq 0x1af1
cmpl $-0x1, %eax
je 0x1bde
movl %eax, %ebp
callq 0x1784
cmpl $-0x1, %eax
je 0x1bde
orl $-0x10, %ebp
shll $0x8, %ebp
addl $0xffffff00, %ebp       # imm = 0xFFFFFF00
orl %ebp, %eax
movl %eax, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/salextpuru[P]speccy-toochain/src/megalz/MegaLZ_emit.c
// Function: emit_code
ULONG emit_code(struct lzinfo * lz)
{ // emits given lz code to the output stream

	// write bits

	emit_bits(lz->bits,lz->bitsnum);


	// write byte, if any

	if( lz->byte!=0xFFFFFFFF )
	{
		oubuf[ob_freepos++]=(UBYTE)(lz->byte&0x000000FF);
	}


	// flush to disk if needed

	if( ob_freepos>(OUBUFSIZE-8) )
	{
		// write up to current bit position
		if( ob_bitpos!=fwrite( oubuf, 1, ob_bitpos, file_out ) )  return 0;

		// move remaining part of buffer to the beginning
		memcpy( oubuf, &oubuf[ob_bitpos], OUBUFSIZE-ob_bitpos);

		// update pointers
		ob_freepos-=ob_bitpos;
		ob_bitpos=0;
	}

	return 1;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x10(%rdi), %edi
movl 0x14(%rbx), %esi
callq 0x1ccf
movl 0xc(%rbx), %eax
cmpl $-0x1, %eax
je 0x1c51
movl 0x55c6(%rip), %ecx      # 0x7204
leal 0x1(%rcx), %edx
movl %edx, 0x55bd(%rip)      # 0x7204
leaq 0x54b2(%rip), %rdx      # 0x7100
movb %al, (%rcx,%rdx)
movl $0x1, %eax
cmpl $0xf9, 0x55a4(%rip)     # 0x7204
jb 0x1cc7
movl 0x5597(%rip), %r14d     # 0x7200
leaq 0x3460(%rip), %rax      # 0x50d0
movq (%rax), %rcx
leaq 0x5486(%rip), %rbx      # 0x7100
movl $0x1, %esi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x1130
movq %rax, %rcx
xorl %eax, %eax
cmpq %r14, %rcx
jne 0x1cc7
movl 0x5565(%rip), %r14d     # 0x7200
movq %r14, %rsi
addq %rbx, %rsi
movl $0x100, %edx            # imm = 0x100
subl %r14d, %edx
movq %rbx, %rdi
callq 0x1070
subl %r14d, 0x554c(%rip)     # 0x7204
movl $0x0, 0x553e(%rip)      # 0x7200
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/salextpuru[P]speccy-toochain/src/megalz/MegaLZ_emit.c
// Function: emit_bits
void emit_bits(ULONG bits,ULONG bitsnum)
{
	ULONG i,shifter;

	shifter=bits;

	for(i=0;i<bitsnum;i++)
	{
		if( ob_bits==8 )
		{
			ob_bitpos=ob_freepos;
			ob_freepos++;
			ob_bits=0;
		}

		oubuf[ob_bitpos]=(UBYTE)( (oubuf[ob_bitpos]<<1) | (UBYTE)( shifter>>31 ));

		ob_bits++;

		shifter<<=1;
	}
}

// Assembly:
testl %esi, %esi
je 0x1d27
movl 0x5527(%rip), %edx      # 0x7200
movl 0x5525(%rip), %ecx      # 0x7204
movl 0x5522(%rip), %r8d      # 0x7208
leaq 0x5413(%rip), %rax      # 0x7100
cmpl $0x8, %r8d
jne 0x1d06
movl %ecx, 0x5507(%rip)      # 0x7200
movl %ecx, %edx
incl %ecx
movl %ecx, 0x5501(%rip)      # 0x7204
xorl %r8d, %r8d
movl %edx, %r9d
movzbl (%r9,%rax), %r10d
shldl $0x1, %edi, %r10d
movb %r10b, (%r9,%rax)
incl %r8d
addl %edi, %edi
decl %esi
jne 0x1ced
movl %r8d, 0x54e1(%rip)      # 0x7208
retq
// File: /workspace/github_c_makefile_star2_O1/salextpuru[P]speccy-toochain/src/megalz/MegaLZ_emit.c
// Function: emit_finish
ULONG emit_finish(void)
{ // finishes output stream outting (flushes everyth, writes stopping bitcode)

	// write stopping bitcode
	emit_bits(0x60100000,12);

	// fill up last unfinished 'bit'-byte
	while( ob_bits<8 )
	{
		oubuf[ob_bitpos]<<=1;
		ob_bits++;
	}

	// write remaining part of buffer
	if( ob_freepos!=fwrite( oubuf, 1, ob_freepos, file_out ) )  return 0;

	return 1;
}

// Assembly:
movl 0x54d2(%rip), %edi      # 0x7200
movl 0x54d0(%rip), %esi      # 0x7204
movl $0x60100000, %ecx       # imm = 0x60100000
movl $0xc, %edx
movl 0x54c3(%rip), %r9d      # 0x7208
leaq 0x53b4(%rip), %rax      # 0x7100
cmpl $0x8, %r9d
jne 0x1d67
movl %esi, 0x54a8(%rip)      # 0x7200
movl %esi, %edi
incl %esi
movl %esi, 0x54a2(%rip)      # 0x7204
xorl %r8d, %r8d
jmp 0x1d6a
movl %r9d, %r8d
movl %edi, %r9d
movzbl (%r9,%rax), %r10d
shldl $0x1, %ecx, %r10d
movb %r10b, (%r9,%rax)
leal 0x1(%r8), %r9d
addl %ecx, %ecx
decl %edx
jne 0x1d4c
cmpl $0x7, %r9d
ja 0x1da8
movl 0x546f(%rip), %ecx      # 0x7200
movb (%rcx,%rax), %dl
addl $-0x7, %r8d
addb %dl, %dl
incl %r8d
jne 0x1d98
movb %dl, (%rcx,%rax)
movl $0x8, %r9d
pushq %rbx
movl %r9d, 0x5458(%rip)      # 0x7208
movl 0x544e(%rip), %ebx      # 0x7204
leaq 0x3313(%rip), %rax      # 0x50d0
movq (%rax), %rcx
leaq 0x5339(%rip), %rdi      # 0x7100
movl $0x1, %esi
movq %rbx, %rdx
callq 0x1130
xorl %ecx, %ecx
cmpq %rbx, %rax
sete %cl
movl %ecx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/salextpuru[P]speccy-toochain/src/megalz/MegaLZ_hash.c
// Function: make_hash
void make_hash(void)
{ // makes hash for every byte of input file
  // for position i, hash is from bytes at [i-2],[i-1],[i]
  // first and second bytes does not have valid hash values

	UBYTE curr,prev,prev2;
	ULONG i;

	prev=curr=0;

	for(i=0;i<inlen;i++)
	{
		prev2=(UBYTE)((prev>>1)|(prev<<7));
		prev=(UBYTE)((curr>>1)|(curr<<7));
		curr=indata[i];

		hash[i]=(UBYTE)(prev2^prev^curr);
	}
}

// Assembly:
leaq 0x32be(%rip), %rax      # 0x50d8
cmpl $0x0, (%rax)
je 0x1e6e
xorl %ecx, %ecx
leaq 0x32b8(%rip), %rdx      # 0x50e0
xorl %esi, %esi
xorl %edi, %edi
movzbl %dil, %r8d
shrl %r8d
shll $0x7, %edi
orl %r8d, %edi
movzbl %sil, %r8d
movl %r8d, %esi
shrl %esi
shll $0x7, %r8d
orl %esi, %r8d
movq (%rdx), %rsi
movzbl (%rsi,%rcx), %esi
xorl %r8d, %edi
xorl %esi, %edi
movq 0x53b4(%rip), %r9       # 0x7210
movb %dil, (%r9,%rcx)
incq %rcx
movl (%rax), %r9d
movl %r8d, %edi
cmpq %r9, %rcx
jb 0x1e2c
retq
nop
// File: /workspace/github_c_makefile_star2_O1/salextpuru[P]speccy-toochain/src/megalz/MegaLZ_lz.c
// Function: end_lz
void end_lz(void)
{ // ends codes[] array filling by setting stopflag
	codes[codepos].disp=0;
	codes[codepos].length=1;

 if(codepos>=256) printf("end_lz(): overflow!\n");
}

// Assembly:
movl 0x539f(%rip), %eax      # 0x7220
leaq 0x53a8(%rip), %rcx      # 0x7230
movl $0x1, (%rcx,%rax,4)
cmpq $0x100, %rax            # imm = 0x100
jb 0x1ea3
leaq 0x1586(%rip), %rdi      # 0x3424
jmp 0x1120
retq
// File: /workspace/github_c_makefile_star2_O1/salextpuru[P]speccy-toochain/src/megalz/MegaLZ_pack.c
// Function: gen_output
ULONG gen_output(void)
{
	ULONG pos;

	struct lzinfo lz;




	if( !emit_init() )
	{
		printf("gen_output(): emit_init() failed!\n");
		return 0;
	}


	pos=1; // first byte copied to output 'as-is', without LZ coding

	while( pos<inlen )
	{
		// write best code to the output stream
		if( !make_lz_info(indata[pos],&pdata[pos].best,&lz) )
		{
				printf("gen_output(): make_lz_info() failed!\n");
				return 0;
		}

		if( !emit_code(&lz) )
		{
			printf("gen_output(): emit_code() failed!\n");
			return 0;
		}
		pos+=lz.length; // step to the next unpacked byte
	}

	// sanity check
	if( pos>inlen )
	{
		printf("gen_output(): last position is out of input file!\n");
		return 0;
	}





	// just finish all deals
	if( !emit_finish() )
	{
		printf("gen_output(): emit_finish() failed!\n");
		return 0;
	}

	return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
callq 0x1be8
testl %eax, %eax
je 0x26a5
leaq 0x2a9f(%rip), %r15      # 0x50d8
movl (%r15), %eax
movl $0x1, %ebp
cmpl $0x2, %eax
jb 0x2698
leaq 0x2a93(%rip), %r12      # 0x50e0
leaq 0xc(%rsp), %r14
leaq 0xecf(%rip), %rbx       # 0x3528
leaq 0xeed(%rip), %r13       # 0x354d
movq (%r12), %rax
movl %ebp, %esi
movzbl (%rax,%rsi), %edi
shlq $0x3, %rsi
addq 0x4fbb(%rip), %rsi      # 0x7630
movq %r14, %rdx
callq 0x1ec3
testl %eax, %eax
je 0x26ca
movq %r14, %rdi
callq 0x1c1e
testl %eax, %eax
je 0x26c7
addl 0xc(%rsp), %ebp
movl (%r15), %eax
cmpl %eax, %ebp
jb 0x2660
cmpl %eax, %ebp
jbe 0x26ae
leaq 0xe53(%rip), %rbx       # 0x34f6
jmp 0x26ca
leaq 0xe04(%rip), %rbx       # 0x34b0
jmp 0x26ca
callq 0x1d28
movl %eax, %ecx
movl $0x1, %eax
testl %ecx, %ecx
jne 0x26d4
leaq 0xe0d(%rip), %rbx       # 0x34d2
jmp 0x26ca
movq %r13, %rbx
movq %rbx, %rdi
callq 0x1120
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/salextpuru[P]speccy-toochain/src/megalz/MegaLZ_twobyters.c
// Function: free_twobyters
void free_twobyters(void)
{ // free all twobyter-related memory

	struct tb_bunch * tbtmp;

	while( tb_bunches )
	{
		tbtmp=tb_bunches;
		tb_bunches=tb_bunches->next;
		free( tbtmp );
	}
}

// Assembly:
movq 0x4f1a(%rip), %rdi      # 0x7648
testq %rdi, %rdi
je 0x2753
pushq %rax
movq (%rdi), %rax
movq %rax, 0x4f0a(%rip)      # 0x7648
callq 0x10e0
movq 0x4efe(%rip), %rdi      # 0x7648
testq %rdi, %rdi
jne 0x2734
addq $0x8, %rsp
retq
// File: /workspace/github_c_makefile_star2_O1/salextpuru[P]speccy-toochain/src/megalz/MegaLZ_twobyters.c
// Function: add_twobyter
ULONG add_twobyter(UBYTE last,UBYTE curr,ULONG curpos)
{ // adds new twobyter to the array of chains

	struct tb_chain * newtb;
	ULONG index;


	index=(((ULONG)last)<<8)+((ULONG)curr);

	newtb=get_free_twobyter();
	if( !newtb )
	{ // no free elements

		// first try to flush current chain
		cutoff_twobyte_chain(index,curpos);

		newtb=get_free_twobyter();
		if( !newtb )
		{ // nothing free - allocate new bunch
			if( !add_bunch_of_twobyters() )
			{
				return 0;
			}

			newtb=get_free_twobyter();
		}
	}



	newtb->next=tb_entry[index];
	tb_entry[index]=newtb;

	newtb->pos=curpos-1; // points to the first byte of given two bytes

	return 1;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %edx, %ebx
movl %edi, %ebp
shll $0x8, %ebp
movq 0x4edb(%rip), %rax      # 0x7640
testq %rax, %rax
je 0x2776
movq (%rax), %rcx
movq %rcx, 0x4ecc(%rip)      # 0x7640
jmp 0x2778
xorl %eax, %eax
orl %esi, %ebp
testq %rax, %rax
jne 0x27c1
movl %ebp, %edi
movl %ebx, %esi
callq 0x2804
movq 0x4eb1(%rip), %rax      # 0x7640
testq %rax, %rax
je 0x27a0
movq (%rax), %rcx
movq %rcx, 0x4ea2(%rip)      # 0x7640
jmp 0x27a2
xorl %eax, %eax
testq %rax, %rax
jne 0x27c1
callq 0x2874
testl %eax, %eax
je 0x27e6
movq 0x4e89(%rip), %rax      # 0x7640
movq (%rax), %rcx
movq %rcx, 0x4e7f(%rip)      # 0x7640
movl %ebp, %ecx
leaq 0x4e86(%rip), %rdx      # 0x7650
movq (%rdx,%rcx,8), %rsi
movq %rsi, (%rax)
movq %rax, (%rdx,%rcx,8)
decl %ebx
movl %ebx, 0x8(%rax)
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
xorl %eax, %eax
jmp 0x27df
// File: /workspace/github_c_makefile_star2_O1/salextpuru[P]speccy-toochain/src/megalz/MegaLZ_twobyters.c
// Function: add_bunch_of_twobyters
ULONG add_bunch_of_twobyters(void)
{ // adds a bunch of twobyters to the free list

	ULONG i;
	struct tb_bunch * newbunch;

	// alloc new bunch
	newbunch=(struct tb_bunch *)malloc( sizeof(struct tb_bunch) );
	if( newbunch==NULL ) return 0;

	// link every twobyter into one list
	for(i=0;i<(BUNCHSIZE-1);i++)
	{
		newbunch->bunch[i].next=&(newbunch->bunch[i+1]);
	}

	// add this list to the free list
	newbunch->bunch[BUNCHSIZE-1].next=tb_free;
	tb_free=&(newbunch->bunch[0]);

	// add bunch to bunches list
	newbunch->next=tb_bunches;
	tb_bunches=newbunch;

	return 1;
}

// Assembly:
pushq %rax
movl $0x1008, %edi           # imm = 0x1008
callq 0x10f0
testq %rax, %rax
je 0x295e
movq %rax, %rcx
addq $0x8, %rcx
movdqa 0xcd9(%rip), %xmm0      # 0x3570
movl $0x18, %edx
movdqa 0xcdc(%rip), %xmm1      # 0x3580
movdqa 0xce4(%rip), %xmm2      # 0x3590
pshufd $0xf5, %xmm2, %xmm3     # xmm3 = xmm2[1,1,3,3]
pcmpeqd %xmm4, %xmm4
movdqa 0xce3(%rip), %xmm5      # 0x35a0
movdqa %xmm0, %xmm6
pxor %xmm1, %xmm6
movdqa %xmm2, %xmm8
pcmpgtd %xmm6, %xmm8
pshufd $0xf5, %xmm6, %xmm7     # xmm7 = xmm6[1,1,3,3]
pcmpeqd %xmm3, %xmm7
pand %xmm8, %xmm7
movdqa %xmm0, %xmm6
psubq %xmm4, %xmm6
movd %xmm7, %esi
testb $0x1, %sil
je 0x2900
movq %xmm6, %rsi
shlq $0x4, %rsi
addq %rcx, %rsi
movq %rsi, -0x10(%rax,%rdx)
pextrw $0x4, %xmm7, %esi
testb $0x1, %sil
je 0x2920
pshufd $0xee, %xmm6, %xmm6     # xmm6 = xmm6[2,3,2,3]
movq %xmm6, %rsi
shlq $0x4, %rsi
addq %rcx, %rsi
movq %rsi, (%rax,%rdx)
paddq %xmm5, %xmm0
addq $0x20, %rdx
cmpq $0x1018, %rdx           # imm = 0x1018
jne 0x28bd
movq 0x4d08(%rip), %rdx      # 0x7640
movq %rdx, 0xff8(%rax)
movq %rcx, 0x4cfa(%rip)      # 0x7640
movq 0x4cfb(%rip), %rcx      # 0x7648
movq %rcx, (%rax)
movq %rax, 0x4cf1(%rip)      # 0x7648
movl $0x1, %eax
jmp 0x2960
xorl %eax, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O1/Joy-Division[P]tools-zoe/lodepng/lodepng.c
// Function: lodepng_get_raw_size_idat
static size_t lodepng_get_raw_size_idat(unsigned w, unsigned h, const LodePNGColorMode* color)
{
  size_t bpp = lodepng_get_bpp(color);
  /* + 1 for the filter byte, and possibly plus padding bits per line */
  size_t line = ((size_t)(w / 8) * bpp) + 1 + ((w & 7) * bpp + 7) / 8;
  return (size_t)h * line;
}

// Assembly:
movl (%rdx), %r8d
movl 0x4(%rdx), %ecx
xorl %eax, %eax
cmpq $0x6, %r8
ja 0xba77
leaq 0x2f95(%rip), %rax      # 0xea08
movl (%rax,%r8,4), %eax
imull %ecx, %eax
movl %edi, %ecx
shrl $0x3, %ecx
imulq %rax, %rcx
andl $0x7, %edi
imulq %rax, %rdi
addq $0x7, %rdi
shrq $0x3, %rdi
addq %rdi, %rcx
incq %rcx
movl %esi, %eax
imulq %rcx, %rax
retq
// File: /workspace/github_c_makefile_star2_O1/Joy-Division[P]tools-zoe/tex-to_image.c
// Function: generatePalettePairs
void generatePalettePairs( unsigned int numPaletteEntries, unsigned char* palette, paletteEntry *paired, unsigned int bpp ) {
	int i, e = 0;
	if( bpp == palMode4bpp ) {
		for( i = 0; i < numPaletteEntries; i++ ) {
			paired[i].red = palette[e];
			e++;
			paired[i].green = palette[e];
			e++;
			paired[i].blue = palette[e];
			e++;
			if( palette[e] >= 0x7F ) paired[i].alpha = 0xFF;
			else if ( palette[e] == 0 ) paired[i].alpha = 0; 
			else paired[i].alpha = (palette[e] + 1)*2;
			e++;
		}
	}
	else if( bpp == palMode8bpp ) {
		for( i = 0; i < numPaletteEntries; i++ ) {
			e = 4 * swizzle(i);
			paired[i].red = palette[e];
			e++;
			paired[i].green = palette[e];
			e++;
			paired[i].blue = palette[e];
			e++;
			if( palette[e] >= 0x7F ) paired[i].alpha = 0xFF;
			else if ( palette[e] == 0 ) paired[i].alpha = 0; 
			else paired[i].alpha = (palette[e] + 1)*2;
			e++;
		}
	}
		return;
}

// Assembly:
testl %ecx, %ecx
je 0xcbc0
cmpl $0x1, %ecx
jne 0xcc13
testl %edi, %edi
je 0xcc13
movl %edi, %eax
xorl %ecx, %ecx
movl $0x8, %edi
movl $0x10, %r8d
movl %ecx, %r9d
shrl $0x3, %r9d
andl $0x3, %r9d
leal (,%r9,8), %r10d
cmpl $0x2, %r9d
cmovel %edi, %r10d
cmpl $0x1, %r9d
cmovel %r8d, %r10d
movl %ecx, %r9d
andl $0x3fffffe7, %r9d       # imm = 0x3FFFFFE7
orl %r10d, %r9d
movb (%rsi,%r9,4), %r10b
movb %r10b, (%rdx,%rcx,4)
movb 0x1(%rsi,%r9,4), %r10b
movb %r10b, 0x1(%rdx,%rcx,4)
movb 0x2(%rsi,%r9,4), %r10b
movb %r10b, 0x2(%rdx,%rcx,4)
movb 0x3(%rsi,%r9,4), %r9b
movb $-0x1, %r10b
cmpb $0x7e, %r9b
ja 0xcbb1
testb %r9b, %r9b
je 0xcbae
addb %r9b, %r9b
addb $0x2, %r9b
movl %r9d, %r10d
jmp 0xcbb1
xorl %r10d, %r10d
movb %r10b, 0x3(%rdx,%rcx,4)
incq %rcx
cmpq %rcx, %rax
jne 0xcb43
jmp 0xcc13
testl %edi, %edi
je 0xcc13
movl %edi, %eax
xorl %ecx, %ecx
movb (%rsi,%rcx,4), %dil
movb %dil, (%rdx,%rcx,4)
movb 0x1(%rsi,%rcx,4), %dil
movb %dil, 0x1(%rdx,%rcx,4)
movb 0x2(%rsi,%rcx,4), %dil
movb %dil, 0x2(%rdx,%rcx,4)
movb 0x3(%rsi,%rcx,4), %dil
movb $-0x1, %r8b
cmpb $0x7e, %dil
ja 0xcc06
testb %dil, %dil
je 0xcc03
addb %dil, %dil
addb $0x2, %dil
movl %edi, %r8d
jmp 0xcc06
xorl %r8d, %r8d
movb %r8b, 0x3(%rdx,%rcx,4)
incq %rcx
cmpq %rcx, %rax
jne 0xcbc8
retq