// File: kazzmir[P]xborder/src/main.cpp
// Function: OptionWindow::create(_XDisplay*, unsigned long)
static OptionWindow* create(Display * display, Window xborder_window){
        Atom wm_delete_window = XInternAtom(display, "WM_DELETE_WINDOW", false);
        int screen = DefaultScreen(display);
        int width = (palette_x + 1) * palette_size_block + 5;
        int height = palette_start_y + (palette_y + 1) * palette_size_block;
        Window window = XCreateSimpleWindow(display, RootWindow(display, screen),
                                            1, 1,
                                            width, height,
                                            1, BlackPixel(display, screen), WhitePixel(display, screen));
        XFontStruct * fontInfo = XLoadQueryFont(display, "6x10");
        XGCValues values;
        // values.font = fontInfo->fid;
        values.foreground = BlackPixel(display, screen);
        GC graphics = XCreateGC(display, window, GCForeground, &values);
        XSelectInput(display, window,
                     ExposureMask |
                     KeyPress |
                     KeyRelease |
                     ButtonPressMask |
                     ButtonReleaseMask |
                     Button1MotionMask |
                     StructureNotifyMask);
        XMapWindow(display, window);
        XStoreName(display, window, "XBorder options");
        XSetWMProtocols(display, window, &wm_delete_window, 1);

        return new OptionWindow(display, window, graphics, xborder_window);
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x100, %rsp            # imm = 0x100
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
leaq 0x10b4(%rip), %rsi      # 0x7342
xorl %edx, %edx
callq 0x3230
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movl 0xe0(%rax), %eax
movl %eax, -0x1c(%rbp)
movl $0x140, -0x20(%rbp)     # imm = 0x140
movl $0x91, -0x24(%rbp)
movq -0x8(%rbp), %rdi
movq 0xe8(%rdi), %rax
movslq -0x1c(%rbp), %rdx
shlq $0x7, %rdx
movl -0x20(%rbp), %r8d
movl -0x24(%rbp), %r9d
movq 0x60(%rax,%rdx), %rcx
movq 0x10(%rax,%rdx), %rsi
movq 0x58(%rax,%rdx), %rdx
movq %rsp, %rax
movq %rdx, 0x10(%rax)
movq %rcx, 0x8(%rax)
movl $0x1, (%rax)
movl $0x1, %ecx
movl %ecx, -0xdc(%rbp)
movl %ecx, %edx
callq 0x30e0
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rdi
leaq 0x10c6(%rip), %rsi      # 0x73d6
callq 0x3650
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rax
movq 0xe8(%rax), %rax
movslq -0x1c(%rbp), %rcx
shlq $0x7, %rcx
movq 0x60(%rax,%rcx), %rax
movq %rax, -0xa8(%rbp)
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rsi
movl $0x4, %edx
leaq -0xb8(%rbp), %rcx
callq 0x3170
movq %rax, -0xc0(%rbp)
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rsi
movl $0x2810f, %edx          # imm = 0x2810F
callq 0x31e0
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x33d0
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rsi
leaq 0x1055(%rip), %rdx      # 0x73db
callq 0x3070
movl -0xdc(%rbp), %ecx
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rsi
leaq -0x18(%rbp), %rdx
callq 0x31a0
movl $0x68, %edi
callq 0x3340
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0xd8(%rbp)
movq -0x8(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq -0xc0(%rbp), %rcx
movq -0x10(%rbp), %r8
callq 0x68d0
jmp 0x63d3
movq -0xd8(%rbp), %rax
addq $0x100, %rsp            # imm = 0x100
popq %rbp
retq
movq -0xd8(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc8(%rbp)
movl %eax, -0xcc(%rbp)
movl $0x68, %esi
callq 0x3350
movq -0xc8(%rbp), %rdi
callq 0x3620
nopw %cs:(%rax,%rax)
nopl (%rax)