LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/0x0203[P]schack_poc/./nuklear_xlib.h
// Function: nk_xfont_create
NK_API XFont*
nk_xfont_create(Display *dpy, const char *name)
{
    int n;
    char *def, **missing;
    XFont *font = (XFont*)calloc(1, sizeof(XFont));
    font->set = XCreateFontSet(dpy, name, &missing, &n, &def);
    if(missing) {
        while(n--)
            fprintf(stderr, "missing fontset: %s\n", missing[n]);
        XFreeStringList(missing);
    }
    if(font->set) {
        XFontStruct **xfonts;
        char **font_names;
        XExtentsOfFontSet(font->set);
        n = XFontsOfFontSet(font->set, &xfonts, &font_names);
        while(n--) {
            font->ascent = NK_MAX(font->ascent, (*xfonts)->ascent);
            font->descent = NK_MAX(font->descent,(*xfonts)->descent);
            xfonts++;
        }
    } else {
        if(!(font->xfont = XLoadQueryFont(dpy, name))
        && !(font->xfont = XLoadQueryFont(dpy, "fixed"))) {
            free(font);
            return 0;
        }
        font->ascent = font->xfont->ascent;
        font->descent = font->xfont->descent;
    }
    font->height = font->ascent + font->descent;
    return font;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r15
movq %rdi, %r14
pushq $0x1
popq %rdi
pushq $0x38
popq %rsi
callq 0x3470
movq %rax, %rbx
leaq 0x8(%rsp), %r13
leaq 0x4(%rsp), %rcx
leaq 0x20(%rsp), %r8
movq %r14, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0x32a0
movq %rax, %r12
movq %rax, 0x10(%rbx)
cmpq $0x0, (%r13)
je 0x1ccd3
movq 0x1a356(%rip), %rbp     # 0x36ff0
leaq 0xd365(%rip), %r13      # 0x2a006
movl 0x4(%rsp), %eax
subl $0x1, %eax
movl %eax, 0x4(%rsp)
jb 0x1ccc9
movq (%rbp), %rdi
movq 0x8(%rsp), %rcx
cltq
movq (%rcx,%rax,8), %rdx
movq %r13, %rsi
xorl %eax, %eax
callq 0x3560
jmp 0x1cca1
movq 0x8(%rsp), %rdi
callq 0x3440
testq %r12, %r12
je 0x1cd2c
movq %r12, %rdi
callq 0x30e0
leaq 0x10(%rsp), %r14
leaq 0x18(%rsp), %rdx
movq %r12, %rdi
movq %r14, %rsi
callq 0x3410
movq (%r14), %rsi
addq $0x8, %rsi
xorl %ecx, %ecx
xorl %edx, %edx
subl $0x1, %eax
jb 0x1cd63
movq -0x8(%rsi), %rdi
movl 0x58(%rdi), %r8d
cmpl %r8d, %edx
cmovlel %r8d, %edx
movl %edx, (%rbx)
movl 0x5c(%rdi), %edi
cmpl %edi, %ecx
cmovlel %edi, %ecx
movl %ecx, 0x4(%rbx)
movq %rsi, 0x10(%rsp)
addq $0x8, %rsi
jmp 0x1cd00
movq %r14, %rdi
movq %r15, %rsi
callq 0x3400
movq %rax, 0x18(%rbx)
testq %rax, %rax
jne 0x1cd58
leaq 0xd2d4(%rip), %rsi      # 0x2a01b
movq %r14, %rdi
callq 0x3400
movq %rax, 0x18(%rbx)
testq %rax, %rax
je 0x1cd7a
movl 0x58(%rax), %edx
movl %edx, (%rbx)
movl 0x5c(%rax), %ecx
movl %ecx, 0x4(%rbx)
addl %edx, %ecx
movl %ecx, 0x8(%rbx)
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
callq 0x3200
xorl %ebx, %ebx
jmp 0x1cd68
// File: /workspace/github_c_makefile_star2_O2/0x0203[P]schack_poc/./nuklear_xlib.h
// Function: nk_xfont_del
NK_API void
nk_xfont_del(Display *dpy, XFont *font)
{
    if(!font) return;
    if(font->set)
        XFreeFontSet(dpy, font->set);
    else
        XFreeFont(dpy, font->xfont);
    free(font);
}

// Assembly:
testq %rsi, %rsi
je 0x1cd9f
pushq %rbx
movq %rsi, %rbx
movq 0x10(%rsi), %rsi
testq %rsi, %rsi
je 0x1cda0
callq 0x31e0
jmp 0x1cda9
retq
movq 0x18(%rbx), %rsi
callq 0x3110
movq %rbx, %rdi
popq %rbx
jmp 0x3200
// File: /workspace/github_c_makefile_star2_O2/0x0203[P]schack_poc/./nuklear_xlib.h
// Function: nk_xfont_get_text_width
NK_INTERN float
nk_xfont_get_text_width(nk_handle handle, float height, const char *text, int len)
{
    XFont *font = (XFont*)handle.ptr;
    XRectangle r;
    if(!font || !text)
        return 0;

    if(font->set) {
        XmbTextExtents(font->set, (const char*)text, len, NULL, &r);
        return (float)r.width;
    } else{
        int w = XTextWidth(font->xfont, (const char*)text, len);
        return (float)w;
    }
}

// Assembly:
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
xorps %xmm0, %xmm0
orb %al, %cl
jne 0x1cfee
pushq %rbx
subq $0x10, %rsp
movq 0x10(%rdi), %rax
testq %rax, %rax
je 0x1cfdc
leaq 0x8(%rsp), %rbx
movq %rax, %rdi
xorl %ecx, %ecx
movq %rbx, %r8
callq 0x34a0
movzwl 0x4(%rbx), %eax
jmp 0x1cfe5
movq 0x18(%rdi), %rdi
callq 0x33a0
cvtsi2ss %eax, %xmm0
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/0x0203[P]schack_poc/./nuklear_xlib.h
// Function: nk_xlib_set_font
NK_API void
nk_xlib_set_font(XFont *xfont)
{
    struct nk_user_font *font = &xfont->handle;
    font->userdata = nk_handle_ptr(xfont);
    font->height = (float)xfont->height;
    font->width = nk_xfont_get_text_width;
    nk_style_set_font(&xlib.ctx, font);
}

// Assembly:
movq %rdi, 0x20(%rdi)
cvtsi2ssl 0x8(%rdi), %xmm0
leaq 0x20(%rdi), %rsi
movss %xmm0, 0x28(%rdi)
leaq -0x65(%rip), %rax       # 0x1cfa3
movq %rax, 0x30(%rdi)
leaq 0x1a5fd(%rip), %rdi     # 0x37610
jmp 0x90b2
// File: /workspace/github_c_makefile_star2_O2/0x0203[P]schack_poc/./nuklear_xlib.h
// Function: nk_xlib_push_font
NK_API void
nk_xlib_push_font(XFont *xfont)
{
    struct nk_user_font *font = &xfont->handle;
    font->userdata = nk_handle_ptr(xfont);
    font->height = (float)xfont->height;
    font->width = nk_xfont_get_text_width;
    nk_style_push_font(&xlib.ctx, font);
}

// Assembly:
movq %rdi, 0x20(%rdi)
cvtsi2ssl 0x8(%rdi), %xmm0
leaq 0x20(%rdi), %rsi
movss %xmm0, 0x28(%rdi)
leaq -0x8e(%rip), %rax       # 0x1cfa3
movq %rax, 0x30(%rdi)
leaq 0x1a5d4(%rip), %rdi     # 0x37610
jmp 0x919e
// File: /workspace/github_c_makefile_star2_O2/0x0203[P]schack_poc/./nuklear_xlib.h
// Function: nk_xlib_paste
NK_API void
nk_xlib_paste(nk_handle handle, struct nk_text_edit* edit)
{
    NK_UNUSED(handle);
    /* Paste in X is asynchronous, so can not use a temporary text edit */
    NK_ASSERT(edit != &xlib.ctx.text_edit && "Paste not supported for temporary editors");
    xlib.clipboard_target = edit;
    /* Request the contents of the primary buffer */
    XConvertSelection(xlib.dpy, XA_PRIMARY, XA_STRING, XA_PRIMARY, xlib.root, CurrentTime);
}

// Assembly:
leaq 0x1d000(%rip), %rax     # 0x3a048
cmpq %rax, %rsi
je 0x1d073
movq %rsi, 0x1a594(%rip)     # 0x375e8
movq 0x1e5c5(%rip), %rdi     # 0x3b620
movq 0x1e5c6(%rip), %r8      # 0x3b628
pushq $0x1f
popq %rdx
pushq $0x1
popq %rcx
movq %rcx, %rsi
xorl %r9d, %r9d
jmp 0x3150
pushq %rax
leaq 0xcfcd(%rip), %rdi      # 0x2a048
leaq 0xd011(%rip), %rsi      # 0x2a093
leaq 0xd01b(%rip), %rcx      # 0x2a0a4
movl $0x298, %edx            # imm = 0x298
callq 0x3100
// File: /workspace/github_c_makefile_star2_O2/0x0203[P]schack_poc/./nuklear_xlib.h
// Function: nk_xlib_copy
NK_API void
nk_xlib_copy(nk_handle handle, const char* str, int len)
{
    NK_UNUSED(handle);
    free(xlib.clipboard_data);
    xlib.clipboard_len = 0;
    xlib.clipboard_data = malloc((size_t)len);
    if (xlib.clipboard_data) {
        memcpy(xlib.clipboard_data, str, (size_t)len);
        xlib.clipboard_len = len;
        XSetSelectionOwner(xlib.dpy, XA_PRIMARY, xlib.root, CurrentTime);
        XSetSelectionOwner(xlib.dpy, xlib.xa_clipboard, xlib.root, CurrentTime);
    }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %ebp
movq %rsi, %rbx
movq 0x1a535(%rip), %rdi     # 0x375d8
callq 0x3200
andl $0x0, 0x1a531(%rip)     # 0x375e0
movslq %ebp, %r14
movq %r14, %rdi
callq 0x3170
movq %rax, 0x1a517(%rip)     # 0x375d8
testq %rax, %rax
je 0x1d113
movq %rax, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x3580
movl %r14d, 0x1a505(%rip)    # 0x375e0
movq 0x1e53e(%rip), %rdi     # 0x3b620
movq 0x1e53f(%rip), %rdx     # 0x3b628
pushq $0x1
popq %rsi
xorl %ecx, %ecx
callq 0x33b0
movq 0x1e526(%rip), %rdi     # 0x3b620
movq 0x1a4ef(%rip), %rsi     # 0x375f0
movq 0x1e520(%rip), %rdx     # 0x3b628
xorl %ecx, %ecx
popq %rbx
popq %r14
popq %rbp
jmp 0x33b0
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/0x0203[P]schack_poc/./nuklear_xlib.h
// Function: nk_xlib_shutdown
NK_API void
nk_xlib_shutdown(void)
{
    nk_xsurf_del(xlib.surf);
    nk_free(&xlib.ctx);
    XFreeCursor(xlib.dpy, xlib.cursor);
    nk_memset(&xlib, 0, sizeof(xlib));
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
leaq 0x19b38(%rip), %rbx     # 0x375d8
movq 0x1db69(%rip), %r14     # 0x3b610
movq 0x8(%r14), %rdi
movq 0x20(%r14), %rsi
callq 0x3510
movq (%r14), %rsi
movq 0x8(%r14), %rdi
callq 0x32d0
movq %r14, %rdi
callq 0x3200
leaq 0x19b41(%rip), %rdi     # 0x37610
callq 0x99e5
movq 0x1db45(%rip), %rdi     # 0x3b620
movq 0x1db36(%rip), %rsi     # 0x3b618
callq 0x3060
movl $0x4060, %edx           # imm = 0x4060
movq %rbx, %rdi
xorl %esi, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x3070
// File: /workspace/github_c_makefile_star2_O2/0x0203[P]schack_poc/./nuklear_xlib.h
// Function: nk_xsurf_stroke_line
NK_INTERN void
nk_xsurf_stroke_line(XSurface *surf, short x0, short y0, short x1,
    short y1, unsigned int line_thickness, struct nk_color col)
{
    unsigned long c = nk_color_from_byte(&col.r);
    XSetForeground(surf->dpy, surf->gc, c);
    XSetLineAttributes(surf->dpy, surf->gc, line_thickness, LineSolid, CapButt, JoinMiter);
    XDrawLine(surf->dpy, surf->drawable, surf->gc, (int)x0, (int)y0, (int)x1, (int)y1);
    XSetLineAttributes(surf->dpy, surf->gc, 1, LineSolid, CapButt, JoinMiter);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %r9d, %r13d
movl %r8d, %r12d
movl %ecx, 0x14(%rsp)
movl %edx, %r14d
movl %esi, %r15d
movq %rdi, %rbx
movl 0x50(%rsp), %eax
movl %eax, %ecx
shrl $0x10, %ecx
movzbl %al, %edx
shll $0x10, %edx
andl $0xff00, %eax           # imm = 0xFF00
orl %edx, %eax
movzbl %cl, %edx
orl %eax, %edx
movq (%rdi), %rsi
movq 0x8(%rdi), %rdi
callq 0x3270
movq (%rbx), %rsi
movq 0x8(%rbx), %rdi
pushq $0x1
popq %rbp
movl %r13d, %edx
xorl %ecx, %ecx
movl %ebp, %r8d
xorl %r9d, %r9d
callq 0x3320
movq (%rbx), %rdx
movq 0x8(%rbx), %rdi
movq 0x20(%rbx), %rsi
movl %r12d, (%rsp)
movl %r15d, %ecx
movl %r14d, %r8d
movl 0x14(%rsp), %r9d
callq 0x3230
movq (%rbx), %rsi
movq 0x8(%rbx), %rdi
movl %ebp, %edx
xorl %ecx, %ecx
movl %ebp, %r8d
xorl %r9d, %r9d
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3320
// File: /workspace/github_c_makefile_star2_O2/0x0203[P]schack_poc/main.c
// Function: die
static void
die(const char *fmt, ...)
{
    va_list ap;
    va_start(ap, fmt);
    vfprintf(stderr, fmt, ap);
    va_end(ap);
    fputs("\n", stderr);
    exit(EXIT_FAILURE);
}

// Assembly:
pushq %rbx
subq $0xd0, %rsp
leaq 0x20(%rsp), %rdi
movq %rsi, 0x8(%rdi)
movq %rdx, 0x10(%rdi)
movq %rcx, 0x18(%rdi)
movq %r8, 0x20(%rdi)
movq %r9, 0x28(%rdi)
testb %al, %al
je 0x2101d
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq %rsp, %rdx
movq %rdi, 0x10(%rdx)
leaq 0xe0(%rsp), %rax
movq %rax, 0x8(%rdx)
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rax, (%rdx)
movq 0x15fac(%rip), %rbx     # 0x36ff0
movq (%rbx), %rdi
leaq 0xa4ad(%rip), %rsi      # 0x2b4fb
callq 0x31c0
movq (%rbx), %rsi
leaq 0xc124(%rip), %rdi      # 0x2d181
callq 0x3330
pushq $0x1
popq %rdi
callq 0x30f0
// File: /workspace/github_c_makefile_star2_O2/0x0203[P]schack_poc/main.c
// Function: shuffle_packet
static int shuffle_packet(char *packet, int packet_len, uint8_t **ret, int bph,
			  uint8_t *hop_list, int hops, int start_offset)
{
    int		    len;
    int		    pad;
    int		    i;
    int		    hop_index = 0;

    if (!ret || !packet || !hop_list || !bph || !hops)
	return 0;

    //len = strlen(packet);
    len = (bph * hops);
    len = len * ((packet_len + len - 1 - start_offset) / len);


    (*ret) = malloc(len);
    if (!*ret)
	return 0;

    memset(*ret, 0, len);

    for (i=0; i<len; i++)
    {
	hop_index = (i / bph) % hops;
	(*ret)[i] = (uint8_t)packet[i+start_offset] ^ (uint8_t)hop_list[hop_index];
    }
    return len;
}

// Assembly:
xorl %eax, %eax
testl %r9d, %r9d
je 0x2114c
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebp
testl %ecx, %ecx
je 0x2113e
movq %rdi, %r12
testq %rdi, %rdi
je 0x2113e
movq %rdx, %r15
testq %rdx, %rdx
je 0x2113e
movq %r8, %r14
testq %r8, %r8
je 0x2113e
movl %r9d, %ebx
movl %r9d, %ecx
imull %ebp, %ecx
leal (%rsi,%rcx), %r13d
decl %r13d
movl %r13d, %eax
cltd
idivl %ecx
subl %edx, %r13d
movslq %r13d, %rsi
pushq $0x1
popq %rdi
callq 0x3470
movq %rax, (%r15)
testq %rax, %rax
movl $0x0, %eax
je 0x2113e
xorl %ecx, %ecx
testl %r13d, %r13d
movl $0x0, %esi
cmovgl %r13d, %esi
cmpq %rcx, %rsi
je 0x2113b
movl %ecx, %eax
cltd
idivl %ebp
cltd
idivl %ebx
movslq %edx, %rax
movb (%r14,%rax), %al
xorb (%r12,%rcx), %al
movq (%r15), %rdx
movb %al, (%rdx,%rcx)
incq %rcx
jmp 0x21118
movl %r13d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/kyz[P]amostools/./amoslib.c
// Function: print_string
static int print_string(FILE *out, uint8_t *s, char quote) {
    int len = amos_deek(s);
    char fmt[20];
    snprintf(fmt, sizeof(fmt), "%c%%%d.%ds%c", quote, len, len, quote);
    fprintf(out, fmt, &s[2]);
    return len + 2 + (len & 1 ? 1 : 0);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x30, %rsp
movl %edx, %ecx
movq %rsi, %r14
movq %rdi, %r15
movzbl (%rsi), %ebx
shll $0x8, %ebx
movzbl 0x1(%rsi), %r13d
orl %r13d, %ebx
movl %edx, (%rsp)
leaq 0x16fa(%rip), %rdx      # 0x3277
leaq 0x10(%rsp), %r12
pushq $0x14
popq %rsi
movq %r12, %rdi
movl %ebx, %r8d
movl %ebx, %r9d
xorl %eax, %eax
callq 0x1100
addq $0x2, %r14
movq %r15, %rdi
movq %r12, %rsi
movq %r14, %rdx
xorl %eax, %eax
callq 0x1150
andl $0x1, %r13d
leal (%rbx,%r13), %eax
addl $0x2, %eax
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/kyz[P]amostools/./amoslib.c
// Function: AMOS_free_tokens
void AMOS_free_tokens(struct AMOS_token *table[AMOS_TOKEN_TABLE_SIZE]) {
    int i;
    for (i = 0; i < AMOS_TOKEN_TABLE_SIZE; i++) {
        struct AMOS_token *e, *next;
        for (e = table[i]; e; e = next) {
            next = e->next;
            free(e);
        }
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
xorl %r14d, %r14d
cmpq $0x2069, %r14           # imm = 0x2069
je 0x20e4
movq (%rbx,%r14,8), %rdi
testq %rdi, %rdi
je 0x20df
movq (%rdi), %r15
callq 0x1030
movq %r15, %rdi
jmp 0x20cd
incq %r14
jmp 0x20c0
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/kyz[P]amostools/listamos.c
// Function: read_extension_file
void read_extension_file(char *filename, int slot) {
    uint8_t *buf;
    size_t len;

    if ((buf = read_file(filename, &len))) {
        if (slot == -1) {
            slot = AMOS_find_slot(buf, len);
        }
        if (slot == -1) {
            fprintf(stderr, "%s: can't determine extension slot"
                            " (use -eNN=filename to set slot NN)\n", filename);
        }
        else if (extensions_loaded[slot]) {
            fprintf(stderr, "%s: extension already loaded in slot %d\n", filename, slot);
        }
        else if (AMOS_parse_extension(buf, len, slot, 6, table)) {
            fprintf(stderr, "%s: not an AMOS extension\n", filename);
        }
        else {
            fprintf(stderr, "%s: loaded into slot %d\n", filename, slot);
            extensions_loaded[slot] = 1;
        }
        free(buf);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %esi, %ebp
movq %rdi, %r14
leaq 0x8(%rsp), %rsi
callq 0x12dc
testq %rax, %rax
jne 0x2117
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
cmpl $-0x1, %ebp
jne 0x2146
movq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x1f8c
movl %eax, %ebp
cmpl $-0x1, %eax
jne 0x2146
movq 0x2ebe(%rip), %rax      # 0x4ff8
movq (%rax), %rdi
leaq 0xf42(%rip), %rsi       # 0x3086
jmp 0x21be
movslq %ebp, %r15
leaq 0x168f0(%rip), %r12     # 0x18a40
cmpb $0x0, (%r15,%r12)
jne 0x2198
movq 0x8(%rsp), %rsi
leaq 0x658d(%rip), %r8       # 0x86f0
pushq $0x6
popq %rcx
movq %rbx, %rdi
movl %ebp, %edx
callq 0x1d76
movq 0x2e81(%rip), %rcx      # 0x4ff8
movq (%rcx), %rdi
testl %eax, %eax
jne 0x21b7
leaq 0xf8c(%rip), %rsi       # 0x3111
movq %r14, %rdx
movl %ebp, %ecx
xorl %eax, %eax
callq 0x1150
movb $0x1, (%r15,%r12)
jmp 0x21c8
movq 0x2e59(%rip), %rax      # 0x4ff8
movq (%rax), %rdi
leaq 0xf24(%rip), %rsi       # 0x30cd
movq %r14, %rdx
movl %ebp, %ecx
xorl %eax, %eax
callq 0x1150
jmp 0x21c8
leaq 0xf38(%rip), %rsi       # 0x30f6
movq %r14, %rdx
xorl %eax, %eax
callq 0x1150
movq %rbx, %rdi
callq 0x1030
jmp 0x210a
// File: /workspace/github_c_makefile_star2_O2/kyz[P]amostools/listamos.c
// Function: read_extensions
int read_extensions(int argc, char *argv[]) {
    int i, slot;

    /* look for -e options */
    for (i = 1; i < argc; i++) {
        if (*argv[i] != '-') break; /* end of arg processing */
        if (!strcmp(argv[i], "-e")) {
            read_extension_file(argv[++i], -1);
        }
        else if (sscanf(argv[i], "-e%d=", &slot) == 2) {
            if (slot < 1 || slot > 25) {
                fprintf(stderr, "invalid extension slot %d (must be 1-25)\n", slot);
            }
            else {
                read_extension_file(strchr(argv[i], '=') + 1, slot);
            }
        }
        else if (argv[i][1] == 'c' || argv[i][1] == 'd') {
            i++; /* skip arg */
        }
    }
    return i;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %edi, %r14d
pushq $0x1
popq %rbp
leaq 0xf3a(%rip), %r15       # 0x312a
leaq 0x4(%rsp), %r13
movl %edi, (%rsp)
cmpl %r14d, %ebp
jge 0x22aa
movslq %ebp, %r12
movq (%rbx,%r12,8), %rdi
cmpb $0x2d, (%rdi)
jne 0x22aa
cmpb $0x65, 0x1(%rdi)
jne 0x221d
cmpb $0x0, 0x2(%rdi)
je 0x2277
movq %r15, %rsi
movq %r13, %rdx
xorl %eax, %eax
callq 0x1190
cmpl $0x2, %eax
jne 0x2267
movq %r13, %r14
movq %r15, %r13
movl 0x4(%rsp), %r15d
leal -0x1a(%r15), %eax
cmpl $-0x1a, %eax
jbe 0x228d
movq (%rbx,%r12,8), %rdi
pushq $0x3d
popq %rsi
callq 0x10e0
leaq 0x1(%rax), %rdi
movl %r15d, %esi
callq 0x20ea
movq %r13, %r15
movq %r14, %r13
movl (%rsp), %r14d
jmp 0x2286
movq (%rbx,%r12,8), %rax
movb 0x1(%rax), %al
addb $-0x63, %al
cmpb $0x2, %al
adcl $0x0, %ebp
jmp 0x2286
incl %ebp
movq 0x8(%rbx,%r12,8), %rdi
pushq $-0x1
popq %rsi
callq 0x20ea
incl %ebp
jmp 0x21f8
movq 0x2d64(%rip), %rax      # 0x4ff8
movq (%rax), %rdi
leaq 0xe92(%rip), %rsi       # 0x3130
movl %r15d, %edx
xorl %eax, %eax
callq 0x1150
jmp 0x225b
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/kyz[P]amostools/listamos.c
// Function: read_default_extensions
void read_default_extensions() {
    AMOS_parse_extension(ext00_base, sizeof(ext00_base), 0, -194, table);
    if (!extensions_loaded[1]) {
        AMOS_parse_extension(ext01_music, sizeof(ext01_music), 1, 6, table);
    }
    if (!extensions_loaded[2]) {
        AMOS_parse_extension(ext02_compact, sizeof(ext02_compact), 2, 6, table);
    }
    if (!extensions_loaded[3]) {
        AMOS_parse_extension(ext03_request, sizeof(ext03_request), 3, 6, table);
    }
    if (!extensions_loaded[6]) {
        AMOS_parse_extension(ext06_ioports, sizeof(ext06_ioports), 6, 6, table);
    }
}

// Assembly:
pushq %rax
leaq 0x2c2e(%rip), %rdi      # 0x5150
leaq 0x61c7(%rip), %r8       # 0x86f0
movl $0x2cfe, %esi           # imm = 0x2CFE
xorl %edx, %edx
movl $0xffffff3e, %ecx       # imm = 0xFFFFFF3E
callq 0x1d76
cmpb $0x0, 0x16500(%rip)     # 0x18a41
jne 0x2561
leaq 0x5906(%rip), %rdi      # 0x7e50
leaq 0x619f(%rip), %r8       # 0x86f0
pushq $0x1
popq %rdx
pushq $0x6
popq %rcx
movl $0x3ce, %esi            # imm = 0x3CE
callq 0x1d76
cmpb $0x0, 0x164da(%rip)     # 0x18a42
jne 0x2588
leaq 0x5caf(%rip), %rdi      # 0x8220
leaq 0x6178(%rip), %r8       # 0x86f0
pushq $0x2
popq %rdx
pushq $0x6
popq %rcx
movl $0xa4, %esi
callq 0x1d76
cmpb $0x0, 0x164b4(%rip)     # 0x18a43
jne 0x25ad
leaq 0x5d38(%rip), %rdi      # 0x82d0
leaq 0x6151(%rip), %r8       # 0x86f0
pushq $0x70
popq %rsi
pushq $0x3
popq %rdx
pushq $0x6
popq %rcx
callq 0x1d76
cmpb $0x0, 0x16492(%rip)     # 0x18a46
je 0x25b8
popq %rax
retq
leaq 0x5d81(%rip), %rdi      # 0x8340
leaq 0x612a(%rip), %r8       # 0x86f0
pushq $0x6
popq %rcx
movl $0x394, %esi            # imm = 0x394
movl %ecx, %edx
popq %rax
jmp 0x1d76
// File: /workspace/github_c_makefile_star2_O2/kyz[P]amostools/listamos.c
// Function: main
int main(int argc, char *argv[]) {
    uint8_t *buf;
    size_t len;
    int i;

    if (argc < 2) {
        printf("List AMOS source code as plain text.\n");
        printf("Usage: %s [options] <Filename.AMOS>\n", argv[0]);
        printf("Options:\n"
               "  -e extension     use this extension in its default slot\n"
               "  -eN=extension    use this extension in slot N\n"
               "  -c config        read extension filenames from config\n"
               "  -d dir           ...and extension files are in this dir\n");
        return 0;
    }

    i = read_extensions(argc, argv);
    read_config_extensions(argc, argv);
    read_default_extensions();

    /* list source file(s) */
    for (; i < argc; i++) {
        if ((buf = read_file(argv[i], &len))) {
            if (len >= 34 && amos_leek(buf) == 0x414D4F53) {
                uint32_t srclen = amos_leek(&buf[16]);
                if (srclen > (len - 20)) srclen = len - 20;
                int err = AMOS_print_source(&buf[20], srclen, stdout, table);
                if (err & 4) {
                    fprintf(stderr, "%s: missing extension instruction(s) - "
                            "are the correct extensions loaded?\n", argv[i]);
                }
            }
            else {
                fprintf(stderr, "%s: not an AMOS source file\n", argv[i]);
            }
            free(buf);
        }
    }
        
    AMOS_free_tokens(table);
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
cmpl $0x1, %edi
jg 0x2617
leaq 0xca0(%rip), %rdi       # 0x3290
callq 0x1090
movq (%rbx), %rsi
leaq 0xbe6(%rip), %rdi       # 0x31e5
xorl %eax, %eax
callq 0x10f0
leaq 0xca8(%rip), %rdi       # 0x32b5
callq 0x1090
jmp 0x26ec
movl %edi, %ebp
movq %rbx, %rsi
callq 0x21d5
movl %eax, %r14d
movl %ebp, %edi
movq %rbx, %rsi
callq 0x22bb
callq 0x251a
movslq %r14d, %r13
movl %ebp, %ebp
movq %rsp, %r14
leaq 0xc13(%rip), %r15       # 0x3255
cmpq %rbp, %r13
jge 0x26e0
movq (%rbx,%r13,8), %rdi
movq %r14, %rsi
callq 0x12dc
testq %rax, %rax
je 0x26be
movq %rax, %r12
movq (%rsp), %rsi
movq %r15, %rcx
cmpq $0x22, %rsi
jb 0x26c6
movl (%r12), %eax
bswapl %eax
movq %r15, %rcx
cmpl $0x414d4f53, %eax       # imm = 0x414D4F53
jne 0x26c6
movl 0x10(%r12), %eax
bswapl %eax
addq $-0x14, %rsi
cmpq %rax, %rsi
cmovael %eax, %esi
movq %r12, %rdi
addq $0x14, %rdi
movq 0x293d(%rip), %rax      # 0x4fd8
movq (%rax), %rdx
leaq 0x604b(%rip), %rcx      # 0x86f0
callq 0x1408
leaq 0xb59(%rip), %rcx       # 0x320a
cmpl $0x4, %eax
jae 0x26c6
movq %r12, %rdi
callq 0x1030
incq %r13
jmp 0x2642
movq 0x292b(%rip), %rax      # 0x4ff8
movq (%rax), %rdi
movq (%rbx,%r13,8), %rdx
movq %rcx, %rsi
xorl %eax, %eax
callq 0x1150
jmp 0x26b6
leaq 0x6009(%rip), %rdi      # 0x86f0
callq 0x20b5
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/kyx0r[P]xkeyboard/xkeyboard.c
// Function: handle_error
static int handle_error(Display *d, XErrorEvent *event)
{
	char errortext[96];
	XGetErrorText(dpy, event->error_code, errortext, 96);

	fprintf(stderr, "xkeyboard: %s (%d/%d)\n", errortext,
		event->request_code, event->minor_code);
	return 0;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x68, %rsp
movq %rsi, %rbx
movq 0x14f7e(%rip), %rdi     # 0x177f8
movzbl 0x20(%rsi), %esi
movq %rsp, %r14
pushq $0x60
popq %rcx
movq %r14, %rdx
callq 0x2220
movq 0x4765(%rip), %rax      # 0x6ff8
movq (%rax), %rdi
movzbl 0x21(%rbx), %ecx
movzbl 0x22(%rbx), %r8d
leaq 0x28a6(%rip), %rsi      # 0x514c
movq %r14, %rdx
xorl %eax, %eax
callq 0x2190
xorl %eax, %eax
addq $0x68, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/kyx0r[P]xkeyboard/xkeyboard.c
// Function: create_pixmaps
void create_pixmaps(void)
{
	static int initialized = 0;
	int i;

	if (initialized) {
		for (i = 0; i < NUM_KEYCAPS; i++) {
			XFreePixmap(dpy, mykc[i]);
		}
	}
	else
	{
		for (i = 0; i < NUM_CONSTPGM; i++) {
			if(cpgmlist[i].pgm)
			{
				cpgm[i] = scale_pic(
						&cpgmlist[i], 
						cpgmlist[i].w,
						cpgmlist[i].h, 
						i);
			}
		}
	}
	for (i = 0; i < NUM_KEYCAPS; i++) {
		if(mykclist[i].pgm)
		{
			mykc[i] = scale_pic(
					&mykclist[i], 
					mykclist[i].w,
					mykclist[i].h, 
					i);
		}
	}
	initialized = 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
cmpb $0x0, 0x14e8a(%rip)     # 0x17a38
je 0x2bd5
xorl %ebx, %ebx
leaq 0x14e87(%rip), %r14     # 0x17a40
cmpq $0x68, %rbx
je 0x2c13
movq 0x14c32(%rip), %rdi     # 0x177f8
movq (%rbx,%r14), %rsi
callq 0x2110
addq $0x8, %rbx
jmp 0x2bb9
leaq 0x14b14(%rip), %rbx     # 0x176f0
leaq 0x14ecd(%rip), %r15     # 0x17ab0
xorl %r14d, %r14d
cmpq $0xf, %r14
je 0x2c13
cmpq $0x0, 0x8(%rbx)
je 0x2c06
movl (%rbx), %esi
movl 0x4(%rbx), %edx
movq %rbx, %rdi
movl %r14d, %ecx
callq 0x28ba
movq %rax, (%r15)
incq %r14
addq $0x10, %rbx
addq $0x8, %r15
jmp 0x2be6
leaq 0x14e26(%rip), %r15     # 0x17a40
leaq 0x149ff(%rip), %rbx     # 0x17620
xorl %r14d, %r14d
cmpq $0xd, %r14
je 0x2c51
cmpq $0x0, 0x8(%rbx)
je 0x2c44
movl (%rbx), %esi
movl 0x4(%rbx), %edx
movq %rbx, %rdi
movl %r14d, %ecx
callq 0x28ba
movq %rax, (%r15)
incq %r14
addq $0x10, %rbx
addq $0x8, %r15
jmp 0x2c24
movb $0x1, 0x14de0(%rip)     # 0x17a38
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/kyx0r[P]xkeyboard/xkeyboard.c
// Function: move_constkeys
void move_constkeys()
{
	XMoveWindow(dpy, zoomwin, myhint.width - 45, 16);
	XMoveWindow(dpy, modewin, myhint.width - 85, 16);
	XMoveWindow(dpy, movewin, myhint.width - 125, 16);
	XMoveWindow(dpy, mousewin, myhint.width - 165, 16);
	XMoveWindow(dpy, lbcornerwin, myhint.width - 16, myhint.height - 16);
	XMoveWindow(dpy, closewindow, 0, myhint.height - closewindow_uppgm.height);
}

// Assembly:
pushq %rbx
movq 0x14b92(%rip), %rdi     # 0x177f8
movq 0x14ebb(%rip), %rsi     # 0x17b28
movl 0x14bc5(%rip), %edx     # 0x17838
addl $-0x2d, %edx
pushq $0x10
popq %rbx
movl %ebx, %ecx
callq 0x20f0
movq 0x14b71(%rip), %rdi     # 0x177f8
movq 0x14ea2(%rip), %rsi     # 0x17b30
movl 0x14ba4(%rip), %edx     # 0x17838
addl $-0x55, %edx
movl %ebx, %ecx
callq 0x20f0
movq 0x14b53(%rip), %rdi     # 0x177f8
movq 0x14e8c(%rip), %rsi     # 0x17b38
movl 0x14b86(%rip), %edx     # 0x17838
addl $-0x7d, %edx
movl %ebx, %ecx
callq 0x20f0
movq 0x14b35(%rip), %rdi     # 0x177f8
movq 0x14e76(%rip), %rsi     # 0x17b40
movl $0xffffff5b, %edx       # imm = 0xFFFFFF5B
addl 0x14b63(%rip), %edx     # 0x17838
movl %ebx, %ecx
callq 0x20f0
movq 0x14b15(%rip), %rdi     # 0x177f8
movq 0x14e5e(%rip), %rsi     # 0x17b48
movl 0x14b48(%rip), %edx     # 0x17838
addl $-0x10, %edx
movl 0x14b43(%rip), %ecx     # 0x1783c
addl $-0x10, %ecx
callq 0x20f0
movq 0x14af0(%rip), %rdi     # 0x177f8
movq 0x14e41(%rip), %rsi     # 0x17b50
movl 0x14b27(%rip), %ecx     # 0x1783c
subl 0x11459(%rip), %ecx     # 0x14174
xorl %edx, %edx
popq %rbx
jmp 0x20f0
// File: /workspace/github_c_makefile_star2_O2/kyx0r[P]xkeyboard/xkeyboard.c
// Function: do_control
void do_control(void)
{
	XFontStruct *font;
	zoom &= 3;

	if (zoom == 0) {
		font = XLoadQueryFont(dpy,
			"-*-*-medium-r-*-*-*-100-*-*-*-*-*-*");
		if(!font)
		{
			return;
		}
		ox = 32; oy = 16; sn = 1; sd = 1;
		XFreeFont(dpy, font_struct);
		font_struct = font;
		XSetFont(dpy, mygc, font_struct->fid);
		XSetFont(dpy, mygcled, font_struct->fid);
	} else if (zoom == 1) {
		font = XLoadQueryFont(dpy,
			"-*-*-medium-r-*-*-*-120-*-*-*-*-*-*");
		if(!font)
		{
			return;
		}
		ox = 0; oy = -48; sn = 3; sd = 2;
		XFreeFont(dpy, font_struct);
		font_struct = font;
		XSetFont(dpy, mygc, font_struct->fid);
		XSetFont(dpy, mygcled, font_struct->fid);
	} else if (zoom == 3) {
		font = XLoadQueryFont(dpy,
			"-*-*-medium-r-*-*-*-180-*-*-*-*-*-*");
		if(!font)
		{
			return;
		}
		ox = -48; oy = -64; sn = 2; sd = 1;
		XFreeFont(dpy, font_struct);
		font_struct = font;
		XSetFont(dpy, mygc, font_struct->fid);
		XSetFont(dpy, mygcled, font_struct->fid);
	} else if (zoom == 2) {
		font = XLoadQueryFont(dpy,
			"-*-*-medium-r-*-*-*-120-*-*-*-*-*-*");
		if(!font)
		{
			return;
		}
		ox = -12; oy = -64; sn = 7; sd = 4;
		XFreeFont(dpy, font_struct);
		font_struct = font;
		XSetFont(dpy, mygc, font_struct->fid);
		XSetFont(dpy, mygcled, font_struct->fid);
	}
	resize_keys();
}

// Assembly:
pushq %rbx
movl 0x13e26(%rip), %eax     # 0x177f0
andl $0x3, %eax
movl %eax, 0x13e1d(%rip)     # 0x177f0
movq 0x13e1e(%rip), %rdi     # 0x177f8
leaq 0x1623(%rip), %rcx      # 0x5004
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x1660(%rip), %rsi      # 0x5051
callq 0x2140
testq %rax, %rax
je 0x3ae6
movq %rax, %rbx
pushq $0x1
popq %rax
pushq $0x10
popq %rdx
pushq $0x20
popq %rsi
movl %eax, %ecx
jmp 0x3a79
leaq 0x16c5(%rip), %rsi      # 0x50db
callq 0x2140
testq %rax, %rax
je 0x3ae6
movq %rax, %rbx
pushq $0x4
popq %rcx
pushq $0x7
popq %rax
pushq $-0x40
popq %rdx
pushq $-0xc
jmp 0x3a57
leaq 0x16c4(%rip), %rsi      # 0x50ff
callq 0x2140
testq %rax, %rax
je 0x3ae6
movq %rax, %rbx
pushq $0x1
popq %rcx
pushq $0x2
popq %rax
pushq $-0x40
popq %rdx
pushq $-0x30
popq %rsi
jmp 0x3a79
leaq 0x167a(%rip), %rsi      # 0x50db
callq 0x2140
testq %rax, %rax
je 0x3ae6
movq %rax, %rbx
pushq $0x2
popq %rcx
pushq $0x3
popq %rax
pushq $-0x30
popq %rdx
xorl %esi, %esi
movl %esi, 0x140d9(%rip)     # 0x17b58
movl %edx, 0x140d7(%rip)     # 0x17b5c
movl %eax, 0x13fa5(%rip)     # 0x17a30
movl %ecx, 0x13fa3(%rip)     # 0x17a34
movq 0x13d60(%rip), %rdi     # 0x177f8
movq 0x13f79(%rip), %rsi     # 0x17a18
callq 0x2090
movq %rbx, 0x13f6d(%rip)     # 0x17a18
movq 0x13d46(%rip), %rdi     # 0x177f8
movq 0x13f57(%rip), %rsi     # 0x17a10
movq 0x8(%rbx), %rdx
callq 0x2120
movq 0x13d2f(%rip), %rdi     # 0x177f8
movq 0x13f50(%rip), %rsi     # 0x17a20
movq 0x13f41(%rip), %rax     # 0x17a18
movq 0x8(%rax), %rdx
callq 0x2120
popq %rbx
jmp 0x37d0
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/kyx0r[P]xkeyboard/xkeyboard.c
// Function: show
void show()
{
	if(myhint.y + myhint.height > screenheight)
	{
		myhint.y -= myhint.height-closewindow_uppgm.height;
	}
	XMoveResizeWindow(dpy, mywindow, myhint.x, myhint.y, myhint.width, myhint.height);
	move_constkeys();
}

// Assembly:
movl 0x135bc(%rip), %ecx     # 0x17834
movl 0x135bd(%rip), %r9d     # 0x1783c
leal (%r9,%rcx), %eax
cmpl 0x1357f(%rip), %eax     # 0x17808
jle 0x429a
subl %r9d, %ecx
addl 0xfee0(%rip), %ecx      # 0x14174
movl %ecx, 0x1359a(%rip)     # 0x17834
pushq %rax
movq 0x13556(%rip), %rdi     # 0x177f8
movq 0x136c7(%rip), %rsi     # 0x17970
movl 0x13581(%rip), %edx     # 0x17830
movl 0x13582(%rip), %r8d     # 0x17838
callq 0x2100
popq %rax
jmp 0x2c5e
// File: /workspace/github_c_makefile_star2_O2/kyx0r[P]xkeyboard/xkeyboard.c
// Function: movebutton
void
movebutton(int xpos, int ypos)
{
	int x, y, nx = 0, ny = 0;
	XEvent ev;
	Time lasttime = 0;

	XSetWindowBackgroundPixmap(dpy,
			movewin,
			cpgm[NUM_CONSTPGM - 10]);
	XClearWindow(dpy, movewin);

	if (XGrabPointer(dpy, root, False, MOUSEMASK, GrabModeAsync, GrabModeAsync,
		None, None, CurrentTime) != GrabSuccess)
		return;
	if (!getrootptr(&x, &y))
		return;
	do {
		XMaskEvent(dpy, MOUSEMASK|ExposureMask|SubstructureRedirectMask, &ev);
		switch(ev.type) {
		case ConfigureRequest:
		case Expose:
		case MapRequest:
			break;
		case MotionNotify:
			if ((ev.xmotion.time - lasttime) <= (1000 / 60))
				continue;
			lasttime = ev.xmotion.time;
			nx = ev.xmotion.x;
			ny = ev.xmotion.y;
			XMoveWindow(dpy, mywindow, nx-xpos, ny-ypos);
			break;
		}
	} while (ev.type != ButtonRelease);
	myhint.x = nx-xpos;
	myhint.y = ny-ypos;
	XSetWindowBackgroundPixmap(dpy,
			movewin,
			cpgm[NUM_CONSTPGM - 9]);
	XClearWindow(dpy, movewin);
	do_control(); //redraw the fonts
	XUngrabPointer(dpy, CurrentTime);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
movl %esi, 0x1c(%rsp)
movl %edi, 0x18(%rsp)
movq 0x134da(%rip), %rdi     # 0x177f8
movq 0x13813(%rip), %rsi     # 0x17b38
movq 0x137ac(%rip), %rdx     # 0x17ad8
callq 0x2320
movq 0x134c0(%rip), %rdi     # 0x177f8
movq 0x137f9(%rip), %rsi     # 0x17b38
callq 0x2060
movq 0x134ad(%rip), %rdi     # 0x177f8
movq 0x134be(%rip), %rsi     # 0x17810
xorps %xmm0, %xmm0
movups %xmm0, (%rsp)
andq $0x0, 0x10(%rsp)
pushq $0x4c
popq %rcx
pushq $0x1
popq %r8
xorl %edx, %edx
movl %r8d, %r9d
callq 0x2150
testl %eax, %eax
jne 0x4460
leaq 0x24(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x42c1
testl %eax, %eax
je 0x4460
xorl %r15d, %r15d
leaq 0x28(%rsp), %r14
pushq $0x6
popq %r13
xorl %r12d, %r12d
xorl %ebp, %ebp
movq 0x13451(%rip), %rdi     # 0x177f8
movl $0x10804c, %esi         # imm = 0x10804C
movq %r14, %rdx
callq 0x23d0
movl 0x28(%rsp), %eax
cmpl $0x6, %eax
jne 0x4403
movq 0x60(%rsp), %rbx
movq %rbx, %rcx
subq %rbp, %rcx
movl %r13d, %eax
cmpq $0x11, %rcx
jb 0x4403
movl 0x68(%rsp), %r15d
movl 0x6c(%rsp), %r12d
movq 0x13416(%rip), %rdi     # 0x177f8
movq 0x13587(%rip), %rsi     # 0x17970
movl %r15d, %edx
subl 0x18(%rsp), %edx
movl %r12d, %ecx
subl 0x1c(%rsp), %ecx
callq 0x20f0
movl 0x28(%rsp), %eax
movq %rbx, %rbp
cmpl $0x5, %eax
jne 0x43a0
subl 0x18(%rsp), %r15d
movl %r15d, 0x1341c(%rip)    # 0x17830
subl 0x1c(%rsp), %r12d
movl %r12d, 0x13414(%rip)    # 0x17834
movq 0x133d1(%rip), %rdi     # 0x177f8
movq 0x1370a(%rip), %rsi     # 0x17b38
movq 0x136ab(%rip), %rdx     # 0x17ae0
callq 0x2320
movq 0x133b7(%rip), %rdi     # 0x177f8
movq 0x136f0(%rip), %rsi     # 0x17b38
callq 0x2060
callq 0x39c3
movq 0x1339f(%rip), %rdi     # 0x177f8
xorl %esi, %esi
callq 0x21d0
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/kyx0r[P]xkeyboard/xkeyboard.c
// Function: resize_win
void resize_win()
{
	int x, y, nx, ny = 0; 
	XEvent ev;
	Time lasttime = 0;

	if (XGrabPointer(dpy, root, False, MOUSEMASK, GrabModeAsync, GrabModeAsync,
		None, None, CurrentTime) != GrabSuccess)
	if (!getrootptr(&x, &y))
		return;
	do {
		XMaskEvent(dpy, MOUSEMASK|ExposureMask|SubstructureRedirectMask, &ev);
		switch(ev.type) {
		case ConfigureRequest:
		case Expose:
		case MapRequest:
			break;
		case MotionNotify:
			if ((ev.xmotion.time - lasttime) <= (1000 / 60))
				continue;
			lasttime = ev.xmotion.time;
			nx = ev.xmotion.x;
			ny = ev.xmotion.y;
			myhint.width = nx - myhint.x;
			myhint.height = ny - myhint.y;
			XMoveResizeWindow(dpy, mywindow, myhint.x, myhint.y, myhint.width, myhint.height);
			move_constkeys();
			break;
		}
	} while (ev.type != ButtonRelease);
	do_control(); //redraw the fonts
	XUngrabPointer(dpy, CurrentTime);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0xe8, %rsp
movq 0x13372(%rip), %rdi     # 0x177f8
movq 0x13383(%rip), %rsi     # 0x17810
xorps %xmm0, %xmm0
movups %xmm0, (%rsp)
andq $0x0, 0x10(%rsp)
pushq $0x4c
popq %rcx
pushq $0x1
popq %r8
xorl %edx, %edx
movl %r8d, %r9d
callq 0x2150
testl %eax, %eax
je 0x44c6
leaq 0x24(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x42c1
testl %eax, %eax
je 0x4562
xorl %r14d, %r14d
leaq 0x28(%rsp), %rbx
pushq $0x6
popq %rbp
movq 0x13320(%rip), %rdi     # 0x177f8
movl $0x10804c, %esi         # imm = 0x10804C
movq %rbx, %rdx
callq 0x23d0
movl 0x28(%rsp), %eax
cmpl $0x6, %eax
jne 0x454a
movq 0x60(%rsp), %r15
movq %r15, %rcx
subq %r14, %rcx
movl %ebp, %eax
cmpq $0x11, %rcx
jb 0x454a
movl 0x68(%rsp), %r8d
movl 0x6c(%rsp), %r9d
movl 0x1331f(%rip), %edx     # 0x17830
subl %edx, %r8d
movl %r8d, 0x1331d(%rip)     # 0x17838
movl 0x13313(%rip), %ecx     # 0x17834
subl %ecx, %r9d
movl %r9d, 0x13311(%rip)     # 0x1783c
movq 0x132c6(%rip), %rdi     # 0x177f8
movq 0x13437(%rip), %rsi     # 0x17970
callq 0x2100
callq 0x2c5e
movl 0x28(%rsp), %eax
movq %r15, %r14
cmpl $0x5, %eax
jne 0x44d1
callq 0x39c3
movq 0x1329d(%rip), %rdi     # 0x177f8
xorl %esi, %esi
callq 0x21d0
addq $0xe8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/kyx0r[P]xkeyboard/xkeyboard.c
// Function: reset_keyspos
void reset_keyspos()
{
	int i;
	for (i = 0; i < MAX_KEYS; i++) {
		xk[i].x -= xkeyoffs; 
		xk[i].y -= ykeyoffs;
	}
	for (i = 0; i < NUM_BORDERS; i++) {
		mb[i].x	-= xkeyoffs;
		mb[i].y -= ykeyoffs;	
	}
	xkeyoffs = 0;
	ykeyoffs = 0;
}

// Assembly:
movl 0x17cda(%rip), %eax     # 0x1c250
pushq $0x8
popq %rdx
movl 0x17cd5(%rip), %ecx     # 0x1c254
leaq 0x2dba(%rip), %rsi      # 0x7340
cmpq $0x9e0, %rdx            # imm = 0x9E0
je 0x459c
subl %eax, -0x4(%rdx,%rsi)
subl %ecx, (%rdx,%rsi)
addq $0x18, %rdx
jmp 0x4586
pushq $0x4
popq %rdx
leaq 0x2c6a(%rip), %rsi      # 0x7210
cmpq $0x134, %rdx            # imm = 0x134
je 0x45bc
subl %eax, -0x4(%rdx,%rsi)
subl %ecx, (%rdx,%rsi)
addq $0x10, %rdx
jmp 0x45a6
andl $0x0, 0x17c8d(%rip)     # 0x1c250
andl $0x0, 0x17c8a(%rip)     # 0x1c254
retq
// File: /workspace/github_c_makefile_star2_O2/kyx0r[P]xkeyboard/xkeyboard.c
// Function: wait_btn_press
void wait_btn_press()
{
	XEvent ev;
	if (XGrabPointer(dpy, root, False, MOUSEMASK, GrabModeAsync, GrabModeAsync,
		None, None, CurrentTime) != GrabSuccess)
		return;
	do {
		XMaskEvent(dpy, MOUSEMASK|ExposureMask|SubstructureRedirectMask, &ev);
	} while (ev.type != ButtonPress);
	XUngrabPointer(dpy, CurrentTime);
}

// Assembly:
pushq %rbx
subq $0xe0, %rsp
movq 0x1300a(%rip), %rdi     # 0x177f8
movq 0x1301b(%rip), %rsi     # 0x17810
xorps %xmm0, %xmm0
movups %xmm0, (%rsp)
andq $0x0, 0x10(%rsp)
pushq $0x4c
popq %rcx
pushq $0x1
popq %r8
xorl %edx, %edx
movl %r8d, %r9d
callq 0x2150
testl %eax, %eax
jne 0x4845
leaq 0x20(%rsp), %rbx
movq 0x12fd5(%rip), %rdi     # 0x177f8
movl $0x10804c, %esi         # imm = 0x10804C
movq %rbx, %rdx
callq 0x23d0
cmpl $0x4, 0x20(%rsp)
jne 0x481c
movq 0x12fba(%rip), %rdi     # 0x177f8
xorl %esi, %esi
callq 0x21d0
addq $0xe0, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/kyx0r[P]xkeyboard/xkeyboard.c
// Function: wait_btn_release
void wait_btn_release()
{
	XEvent ev;
	if (XGrabPointer(dpy, root, False, MOUSEMASK, GrabModeAsync, GrabModeAsync,
		None, None, CurrentTime) != GrabSuccess)
		return;
	do {
		XMaskEvent(dpy, MOUSEMASK|ExposureMask|SubstructureRedirectMask, &ev);
	} while (ev.type != ButtonRelease);
	XUngrabPointer(dpy, CurrentTime);
}

// Assembly:
pushq %rbx
subq $0xe0, %rsp
movq 0x12f9b(%rip), %rdi     # 0x177f8
movq 0x12fac(%rip), %rsi     # 0x17810
xorps %xmm0, %xmm0
movups %xmm0, (%rsp)
andq $0x0, 0x10(%rsp)
pushq $0x4c
popq %rcx
pushq $0x1
popq %r8
xorl %edx, %edx
movl %r8d, %r9d
callq 0x2150
testl %eax, %eax
jne 0x48b4
leaq 0x20(%rsp), %rbx
movq 0x12f66(%rip), %rdi     # 0x177f8
movl $0x10804c, %esi         # imm = 0x10804C
movq %rbx, %rdx
callq 0x23d0
cmpl $0x5, 0x20(%rsp)
jne 0x488b
movq 0x12f4b(%rip), %rdi     # 0x177f8
xorl %esi, %esi
callq 0x21d0
addq $0xe0, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/kyx0r[P]xkeyboard/xkeyboard.c
// Function: btn_press
void btn_press(Display *display, int button)
{
	// Create and setting up the event
	XEvent event;
	memset (&event, 0, sizeof (event));
	event.xbutton.button = button;
	event.xbutton.same_screen = True;
	event.xbutton.subwindow = DefaultRootWindow (display);
	while (event.xbutton.subwindow)
	{
		event.xbutton.window = event.xbutton.subwindow;
		XQueryPointer (display, event.xbutton.window,
				&event.xbutton.root, &event.xbutton.subwindow,
				&event.xbutton.x_root, &event.xbutton.y_root,
				&event.xbutton.x, &event.xbutton.y,
				&event.xbutton.state);
	}
	// Press
	if(event.xbutton.window != mousewin)
	{
		if(sendkey)
		{
			event.type = ButtonPress;
			if (XSendEvent (display, PointerWindow, True, ButtonPressMask, &event) == 0)
				fprintf (stderr, "Error to send the event!\n");
			XFlush (display);
		} else {
			XTestFakeButtonEvent(dpy, button, True, CurrentTime);
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movl %esi, %ebp
movq %rdi, %rbx
leaq 0x8(%rsp), %r14
movl $0xc0, %edx
movq %r14, %rdi
xorl %esi, %esi
callq 0x2130
movl %ebp, 0x4(%rsp)
movl %ebp, 0x54(%r14)
movl $0x1, 0x58(%r14)
movq 0xe8(%rbx), %rax
movslq 0xe0(%rbx), %rcx
shlq $0x7, %rcx
movq 0x10(%rax,%rcx), %rsi
leaq 0x38(%rsp), %rax
movq %rsi, (%rax)
leaq 0x50(%rsp), %r12
leaq 0x54(%rsp), %r13
leaq 0x48(%rsp), %rbp
leaq 0x4c(%rsp), %r14
leaq 0x58(%rsp), %r15
testq %rsi, %rsi
je 0x498b
movq %rsi, 0x28(%rsp)
subq $0x8, %rsp
movq %rbx, %rdi
leaq 0x38(%rsp), %rdx
leaq 0x40(%rsp), %rcx
movq %r12, %r8
movq %r13, %r9
pushq %r15
pushq %r14
pushq %rbp
callq 0x21b0
addq $0x20, %rsp
movq 0x38(%rsp), %rsi
jmp 0x4955
movq 0x28(%rsp), %rax
cmpq 0x131a9(%rip), %rax     # 0x17b40
je 0x49e1
cmpl $0x0, 0x178ac(%rip)     # 0x1c24c
je 0x49cc
leaq 0x8(%rsp), %r8
movl $0x4, (%r8)
pushq $0x1
popq %rdx
pushq $0x4
popq %rcx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x2030
testl %eax, %eax
je 0x49f3
movq %rbx, %rdi
callq 0x22f0
jmp 0x49e1
movq 0x12e25(%rip), %rdi     # 0x177f8
pushq $0x1
popq %rdx
movl 0x4(%rsp), %esi
xorl %ecx, %ecx
callq 0x2160
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x25fe(%rip), %rax      # 0x6ff8
movq (%rax), %rcx
leaq 0x71f(%rip), %rdi       # 0x5123
pushq $0x19
popq %rsi
pushq $0x1
popq %rdx
callq 0x2360
jmp 0x49c2
// File: /workspace/github_c_makefile_star2_O2/kyx0r[P]xkeyboard/xkeyboard.c
// Function: btn_release
void btn_release(Display *display, int button)
{
	// Create and setting up the event
	XEvent event;
	memset (&event, 0, sizeof (event));
	event.xbutton.button = button;
	event.xbutton.same_screen = True;
	event.xbutton.subwindow = DefaultRootWindow (display);
	while (event.xbutton.subwindow)
	{
		event.xbutton.window = event.xbutton.subwindow;
		XQueryPointer (display, event.xbutton.window,
				&event.xbutton.root, &event.xbutton.subwindow,
				&event.xbutton.x_root, &event.xbutton.y_root,
				&event.xbutton.x, &event.xbutton.y,
				&event.xbutton.state);
	}
	if(event.xbutton.window != mousewin)
	{
		if(sendkey)
		{
			event.type = ButtonRelease;
			if (XSendEvent (display, PointerWindow, True, ButtonReleaseMask, &event) == 0)
				fprintf (stderr, "Error to send the event!\n");
			XFlush (display);
		} else {
			XTestFakeButtonEvent(dpy, button, False, CurrentTime);
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movl %esi, %ebp
movq %rdi, %rbx
leaq 0x8(%rsp), %r14
movl $0xc0, %edx
movq %r14, %rdi
xorl %esi, %esi
callq 0x2130
movl %ebp, 0x4(%rsp)
movl %ebp, 0x54(%r14)
movl $0x1, 0x58(%r14)
movq 0xe8(%rbx), %rax
movslq 0xe0(%rbx), %rcx
shlq $0x7, %rcx
movq 0x10(%rax,%rcx), %rsi
leaq 0x38(%rsp), %rax
movq %rsi, (%rax)
leaq 0x50(%rsp), %r12
leaq 0x54(%rsp), %r13
leaq 0x48(%rsp), %rbp
leaq 0x4c(%rsp), %r14
leaq 0x58(%rsp), %r15
testq %rsi, %rsi
je 0x4ab9
movq %rsi, 0x28(%rsp)
subq $0x8, %rsp
movq %rbx, %rdi
leaq 0x38(%rsp), %rdx
leaq 0x40(%rsp), %rcx
movq %r12, %r8
movq %r13, %r9
pushq %r15
pushq %r14
pushq %rbp
callq 0x21b0
addq $0x20, %rsp
movq 0x38(%rsp), %rsi
jmp 0x4a83
movq 0x28(%rsp), %rax
cmpq 0x1307b(%rip), %rax     # 0x17b40
je 0x4b0e
cmpl $0x0, 0x1777e(%rip)     # 0x1c24c
je 0x4afa
leaq 0x8(%rsp), %r8
movl $0x5, (%r8)
pushq $0x1
popq %rdx
pushq $0x8
popq %rcx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x2030
testl %eax, %eax
je 0x4b20
movq %rbx, %rdi
callq 0x22f0
jmp 0x4b0e
movq 0x12cf7(%rip), %rdi     # 0x177f8
movl 0x4(%rsp), %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x2160
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x24d1(%rip), %rax      # 0x6ff8
movq (%rax), %rcx
leaq 0x5f2(%rip), %rdi       # 0x5123
pushq $0x19
popq %rsi
pushq $0x1
popq %rdx
callq 0x2360
jmp 0x4af0
// File: /workspace/github_c_makefile_star2_O2/liuhaotian[P]xmppsh/libstrophe/examples/roster.c
// Function: handle_reply
int handle_reply(xmpp_conn_t * const conn,
		 xmpp_stanza_t * const stanza,
		 void * const userdata)
{
    xmpp_stanza_t *query, *item;
    char *type, *name;

    type = xmpp_stanza_get_type(stanza);
    if (strcmp(type, "error") == 0)
	fprintf(stderr, "ERROR: query failed\n");
    else {
	query = xmpp_stanza_get_child_by_name(stanza, "query");
	printf("Roster:\n");
	for (item = xmpp_stanza_get_children(query); item; 
	     item = xmpp_stanza_get_next(item))
	    if ((name = xmpp_stanza_get_attribute(item, "name")))
		printf("\t %s (%s) sub=%s\n", 
		       name,
		       xmpp_stanza_get_attribute(item, "jid"),
		       xmpp_stanza_get_attribute(item, "subscription"));
	    else
		printf("\t %s sub=%s\n",
		       xmpp_stanza_get_attribute(item, "jid"),
		       xmpp_stanza_get_attribute(item, "subscription"));
	printf("END OF LIST\n");
    }

    /* disconnect */
    xmpp_disconnect(conn);

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0xb076
leaq 0xa614(%rip), %rsi      # 0xcaa0
movq %rax, %rdi
callq 0x2270
testl %eax, %eax
je 0x2572
movq %r14, (%rsp)
leaq 0x9b72(%rip), %rsi      # 0xc019
movq %rbx, %rdi
callq 0xb094
movq %rax, %rbx
leaq 0x9bfa(%rip), %rdi      # 0xc0b3
callq 0x22e0
movq %rbx, %rdi
callq 0xb11c
movq %rax, %r12
leaq 0x9e9d(%rip), %r14      # 0xc36d
leaq 0x9b5a(%rip), %r15      # 0xc031
leaq 0x9b57(%rip), %r13      # 0xc035
testq %r12, %r12
je 0x2549
movq %r12, %rdi
movq %r14, %rsi
callq 0xb21c
movq %rax, %rbp
movq %r12, %rdi
movq %r15, %rsi
callq 0xb21c
movq %rax, %rbx
movq %r12, %rdi
movq %r13, %rsi
callq 0xb21c
testq %rbp, %rbp
je 0x2528
leaq 0x9b09(%rip), %rdi      # 0xc01f
movq %rbp, %rsi
movq %rbx, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x2030
jmp 0x253c
leaq 0x9b13(%rip), %rdi      # 0xc042
movq %rbx, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0x2030
movq %r12, %rdi
callq 0xb121
movq %rax, %r12
jmp 0x24de
leaq 0x9b6b(%rip), %rdi      # 0xc0bb
callq 0x22e0
movq (%rsp), %r14
movq %r14, %rdi
callq 0x4696
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xea6f(%rip), %rax      # 0x10fe8
movq (%rax), %rcx
leaq 0x9a81(%rip), %rdi      # 0xc004
pushq $0x14
popq %rsi
pushq $0x1
popq %rdx
callq 0x2300
jmp 0x2559
// File: /workspace/github_c_makefile_star2_O2/liuhaotian[P]xmppsh/libstrophe/examples/roster.c
// Function: conn_handler
void conn_handler(xmpp_conn_t * const conn, const xmpp_conn_event_t status, 
		  const int error, xmpp_stream_error_t * const stream_error,
		  void * const userdata)
{
    xmpp_ctx_t *ctx = (xmpp_ctx_t *)userdata;
    xmpp_stanza_t *iq, *query;

    if (status == XMPP_CONN_CONNECT) {
	fprintf(stderr, "DEBUG: connected\n");
	
	/* create iq stanza for request */
	iq = xmpp_stanza_new(ctx);
	xmpp_stanza_set_name(iq, "iq");
	xmpp_stanza_set_type(iq, "get");
	xmpp_stanza_set_id(iq, "roster1");

	query = xmpp_stanza_new(ctx);
	xmpp_stanza_set_name(query, "query");
	xmpp_stanza_set_ns(query, XMPP_NS_ROSTER);

	xmpp_stanza_add_child(iq, query);

	/* we can release the stanza since it belongs to iq now */
	xmpp_stanza_release(query);

	/* set up reply handler */
	xmpp_id_handler_add(conn, handle_reply, "roster1", ctx);

	/* send out the stanza */
	xmpp_send(conn, iq);

	/* release the stanza */
	xmpp_stanza_release(iq);
    } else {
	fprintf(stderr, "DEBUG: disconnected\n");
	xmpp_stop(ctx);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %r8, %rbx
movq 0xea45(%rip), %rax      # 0x10fe8
movq (%rax), %rcx
testl %esi, %esi
jne 0x266b
movq %rdi, %r14
leaq 0x9a97(%rip), %rdi      # 0xc04f
pushq $0x11
popq %rsi
pushq $0x1
popq %rdx
callq 0x2300
movq %rbx, %rdi
callq 0xa92c
movq %rax, %r15
leaq 0x9a8c(%rip), %rsi      # 0xc061
movq %rax, %rdi
callq 0xadf5
leaq 0x9a80(%rip), %rsi      # 0xc064
movq %r15, %rdi
callq 0xb20d
leaq 0x9a75(%rip), %r12      # 0xc068
movq %r15, %rdi
movq %r12, %rsi
callq 0xb1fe
movq %rbx, %rdi
callq 0xa92c
movq %rax, %r13
leaq 0x9a09(%rip), %rsi      # 0xc019
movq %rax, %rdi
callq 0xadf5
leaq 0x9a51(%rip), %rsi      # 0xc070
movq %r13, %rdi
callq 0xaf4e
movq %r15, %rdi
movq %r13, %rsi
callq 0xaf5d
movq %r13, %rdi
callq 0xaa98
leaq -0x1d5(%rip), %rsi      # 0x246c
movq %r14, %rdi
movq %r12, %rdx
movq %rbx, %rcx
callq 0x590f
movq %r14, %rdi
movq %r15, %rsi
callq 0x48fc
movq %r15, %rdi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0xaa98
leaq 0x9a0f(%rip), %rdi      # 0xc081
pushq $0x14
popq %rsi
pushq $0x1
popq %rdx
callq 0x2300
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x534d