// File: /workspace/github_c_makefile_star2_O0/jaimecgomezz[P]st/x.c
// Function: xinit
void xinit(int cols, int rows) {
  XGCValues gcvalues;
  Window parent;
  pid_t thispid = getpid();
  // >>>>>>>>>>>>>>>>>>>> swap-mouse-hide-cursor
  // ==================== swap-mouse-hide-cursor
  Cursor cursor;
  XColor xmousefg, xmousebg;
  // ==================== swap-mouse-hide-cursor
  // <<<<<<<<<<<<<<<<<<<< swap-mouse-hide-cursor

  // >>>>>>>>>>>>>>>>>>>> alpha
  // ==================== alpha
  // ==================== alpha
  // <<<<<<<<<<<<<<<<<<<< alpha

  // >>>>>>>>>>>>>>>>>>>> xresources
  // ==================== xresources
  if (!(xw.dpy = XOpenDisplay(NULL)))
    die("can't open display\n");
  // ==================== xresources
  // <<<<<<<<<<<<<<<<<<<< xresources
  xw.scr = XDefaultScreen(xw.dpy);
  // >>>>>>>>>>>>>>>>>>>> alpha
  // ==================== alpha
  xw.vis = XDefaultVisual(xw.dpy, xw.scr);
  // ==================== alpha
  // <<<<<<<<<<<<<<<<<<<< alpha

  /* font */
  if (!FcInit())
    die("could not init fontconfig.\n");

  usedfont = (opt_font == NULL) ? font : opt_font;
  xloadfonts(usedfont, 0);

  // >>>>>>>>>>>>>>>>>>>> font-2
  // ==================== font-2
  // ==================== font-2
  // <<<<<<<<<<<<<<<<<<<< font-2

  /* colors */
  // >>>>>>>>>>>>>>>>>>>> alpha
  // ==================== alpha
  xw.cmap = XDefaultColormap(xw.dpy, xw.scr);
  // ==================== alpha
  // <<<<<<<<<<<<<<<<<<<< alpha
  xloadcols();

  /* adjust fixed window geometry */
  // >>>>>>>>>>>>>>>>>>>> anysize
  // ==================== anysize
  win.w = 2 * borderpx + cols * win.cw;
  win.h = 2 * borderpx + rows * win.ch;
  // ==================== anysize
  // <<<<<<<<<<<<<<<<<<<< anysize
  if (xw.gm & XNegative)
    xw.l += DisplayWidth(xw.dpy, xw.scr) - win.w - 2;
  if (xw.gm & YNegative)
    xw.t += DisplayHeight(xw.dpy, xw.scr) - win.h - 2;

  /* Events */
  xw.attrs.background_pixel = dc.col[defaultbg].pixel;
  xw.attrs.border_pixel = dc.col[defaultbg].pixel;
  xw.attrs.bit_gravity = NorthWestGravity;
  xw.attrs.event_mask = FocusChangeMask | KeyPressMask | KeyReleaseMask |
                        ExposureMask | VisibilityChangeMask |
                        StructureNotifyMask | ButtonMotionMask |
                        ButtonPressMask | ButtonReleaseMask;
  xw.attrs.colormap = xw.cmap;

  // >>>>>>>>>>>>>>>>>>>> alpha
  // ==================== alpha
  if (!(opt_embed && (parent = strtol(opt_embed, NULL, 0))))
    parent = XRootWindow(xw.dpy, xw.scr);
  // ==================== alpha
  // <<<<<<<<<<<<<<<<<<<< alpha
  xw.win = XCreateWindow(
      xw.dpy,
      parent,
      xw.l,
      xw.t,
      win.w,
      win.h,
      0,
      // >>>>>>>>>>>>>>>>>>>> alpha
      // ==================== alpha
      XDefaultDepth(xw.dpy, xw.scr),
      // ==================== alpha
      // <<<<<<<<<<<<<<<<<<<< alpha
      InputOutput,
      xw.vis,
      CWBackPixel | CWBorderPixel | CWBitGravity | CWEventMask | CWColormap,
      &xw.attrs
    );

  memset(&gcvalues, 0, sizeof(gcvalues));
  gcvalues.graphics_exposures = False;
  // >>>>>>>>>>>>>>>>>>>> alpha
  // ==================== alpha
  dc.gc = XCreateGC(xw.dpy, parent, GCGraphicsExposures, &gcvalues);
  xw.buf =
    XCreatePixmap(xw.dpy, xw.win, win.w, win.h, DefaultDepth(xw.dpy, xw.scr));
  // ==================== alpha
  // <<<<<<<<<<<<<<<<<<<< alpha
  XSetForeground(xw.dpy, dc.gc, dc.col[defaultbg].pixel);
  XFillRectangle(xw.dpy, xw.buf, dc.gc, 0, 0, win.w, win.h);

  /* font spec buffer */
  xw.specbuf = xmalloc(cols * sizeof(GlyphFontSpec));

  /* Xft rendering context */
  xw.draw = XftDrawCreate(xw.dpy, xw.buf, xw.vis, xw.cmap);

  /* input methods */
  if (!ximopen(xw.dpy)) {
    XRegisterIMInstantiateCallback(xw.dpy, NULL, NULL, NULL, ximinstantiate,
                                   NULL);
  }

  /* white cursor, black outline */
  // >>>>>>>>>>>>>>>>>>>> hide-cursor
  // ==================== hide-cursor
  cursor = XCreateFontCursor(xw.dpy, mouseshape);
  XDefineCursor(xw.dpy, xw.win, cursor);
  // ==================== hide-cursor
  // <<<<<<<<<<<<<<<<<<<< hide-cursor

  if (XParseColor(xw.dpy, xw.cmap, colorname[mousefg], &xmousefg) == 0) {
    xmousefg.red = 0xffff;
    xmousefg.green = 0xffff;
    xmousefg.blue = 0xffff;
  }

  if (XParseColor(xw.dpy, xw.cmap, colorname[mousebg], &xmousebg) == 0) {
    xmousebg.red = 0x0000;
    xmousebg.green = 0x0000;
    xmousebg.blue = 0x0000;
  }

  // >>>>>>>>>>>>>>>>>>>> hide-cursor
  // ==================== hide-cursor
  XRecolorCursor(xw.dpy, cursor, &xmousefg, &xmousebg);
  // ==================== hide-cursor
  // <<<<<<<<<<<<<<<<<<<< hide-cursor

  xw.xembed = XInternAtom(xw.dpy, "_XEMBED", False);
  xw.wmdeletewin = XInternAtom(xw.dpy, "WM_DELETE_WINDOW", False);
  xw.netwmname = XInternAtom(xw.dpy, "_NET_WM_NAME", False);
  XSetWMProtocols(xw.dpy, xw.win, &xw.wmdeletewin, 1);

  xw.netwmpid = XInternAtom(xw.dpy, "_NET_WM_PID", False);
  XChangeProperty(xw.dpy, xw.win, xw.netwmpid, XA_CARDINAL, 32, PropModeReplace,
                  (uchar *)&thispid, 1);

  win.mode = MODE_NUMLOCK;
  resettitle();
  xhints();
  XMapWindow(xw.dpy, xw.win);
  XSync(xw.dpy, False);

  clock_gettime(CLOCK_MONOTONIC, &xsel.tclick1);
  clock_gettime(CLOCK_MONOTONIC, &xsel.tclick2);
  xsel.primary = NULL;
  xsel.clipboard = NULL;
  xsel.xtarget = XInternAtom(xw.dpy, "UTF8_STRING", 0);
  if (xsel.xtarget == None)
    xsel.xtarget = XA_STRING;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x120, %rsp            # imm = 0x120
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
callq 0x5260
movl %eax, -0x94(%rbp)
xorl %eax, %eax
movl %eax, %edi
callq 0x52b0
movq %rax, 0xd274(%rip)      # 0x1b2a0
cmpq $0x0, %rax
jne 0xe040
leaq 0x400a(%rip), %rdi      # 0x12043
movb $0x0, %al
callq 0x5a70
movq 0xd259(%rip), %rdi      # 0x1b2a0
callq 0x5440
movl %eax, 0xd336(%rip)      # 0x1b388
movq 0xd247(%rip), %rdi      # 0x1b2a0
movl 0xd329(%rip), %esi      # 0x1b388
callq 0x5280
movq %rax, 0xd2a5(%rip)      # 0x1b310
callq 0x58b0
cmpl $0x0, %eax
jne 0xe083
leaq 0x3fdb(%rip), %rdi      # 0x12057
movb $0x0, %al
callq 0x5a70
cmpq $0x0, 0xd355(%rip)      # 0x1b3e0
jne 0xe09d
movq 0x8eac(%rip), %rax      # 0x16f40
movq %rax, -0xc8(%rbp)
jmp 0xe0ab
movq 0xd33c(%rip), %rax      # 0x1b3e0
movq %rax, -0xc8(%rbp)
movq -0xc8(%rbp), %rax
movq %rax, 0xd3a7(%rip)      # 0x1b460
movq 0xd3a0(%rip), %rdi      # 0x1b460
xorps %xmm0, %xmm0
callq 0xedf0
movq 0xd1d1(%rip), %rdi      # 0x1b2a0
movl 0xd2b3(%rip), %esi      # 0x1b388
callq 0x5540
movq %rax, 0xd1c7(%rip)      # 0x1b2a8
callq 0xbdc0
movl 0x8e3c(%rip), %eax      # 0x16f28
shll %eax
movl -0x4(%rbp), %ecx
imull 0xd2bc(%rip), %ecx      # 0x1b3b4
addl %ecx, %eax
movl %eax, 0xd2a8(%rip)      # 0x1b3a8
movl 0x8e22(%rip), %eax      # 0x16f28
shll %eax
movl -0x8(%rbp), %ecx
imull 0xd29e(%rip), %ecx      # 0x1b3b0
addl %ecx, %eax
movl %eax, 0xd292(%rip)      # 0x1b3ac
movl 0xd278(%rip), %eax      # 0x1b398
andl $0x10, %eax
cmpl $0x0, %eax
je 0xe15c
movq 0xd171(%rip), %rax      # 0x1b2a0
movq 0xe8(%rax), %rax
movslq 0xd24b(%rip), %rcx      # 0x1b388
shlq $0x7, %rcx
addq %rcx, %rax
movl 0x18(%rax), %eax
subl 0xd25b(%rip), %eax      # 0x1b3a8
subl $0x2, %eax
addl 0xd23a(%rip), %eax      # 0x1b390
movl %eax, 0xd234(%rip)      # 0x1b390
movl 0xd236(%rip), %eax      # 0x1b398
andl $0x20, %eax
cmpl $0x0, %eax
je 0xe19e
movq 0xd12f(%rip), %rax      # 0x1b2a0
movq 0xe8(%rax), %rax
movslq 0xd209(%rip), %rcx      # 0x1b388
shlq $0x7, %rcx
addq %rcx, %rax
movl 0x1c(%rax), %eax
subl 0xd21d(%rip), %eax      # 0x1b3ac
subl $0x2, %eax
addl 0xd1fc(%rip), %eax      # 0x1b394
movl %eax, 0xd1f6(%rip)      # 0x1b394
movq 0xd003(%rip), %rax      # 0x1b1a8
movl 0xcff1(%rip), %ecx      # 0x1b19c
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq %rax, 0xd164(%rip)      # 0x1b320
movq 0xcfe5(%rip), %rax      # 0x1b1a8
movl 0xcfd3(%rip), %ecx      # 0x1b19c
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq %rax, 0xd156(%rip)      # 0x1b330
movl $0x1, 0xd154(%rip)      # 0x1b338
movq $0x23a00f, 0xd171(%rip) # imm = 0x23A00F
movq 0xd0b2(%rip), %rax      # 0x1b2a8
movq %rax, 0xd17b(%rip)      # 0x1b378
cmpq $0x0, 0xd1fb(%rip)      # 0x1b400
je 0xe226
movq 0xd1f2(%rip), %rdi      # 0x1b400
xorl %eax, %eax
movl %eax, %esi
xorl %edx, %edx
callq 0x5470
movq %rax, -0x90(%rbp)
cmpq $0x0, %rax
jne 0xe23f
movq 0xd073(%rip), %rdi      # 0x1b2a0
movl 0xd155(%rip), %esi      # 0x1b388
callq 0x5290
movq %rax, -0x90(%rbp)
movq 0xd05a(%rip), %rax      # 0x1b2a0
movq %rax, -0xe8(%rbp)
movq -0x90(%rbp), %rax
movq %rax, -0xe0(%rbp)
movl 0xd12f(%rip), %eax      # 0x1b390
movl %eax, -0xd8(%rbp)
movl 0xd127(%rip), %eax      # 0x1b394
movl %eax, -0xd4(%rbp)
movl 0xd12f(%rip), %eax      # 0x1b3a8
movl %eax, -0xd0(%rbp)
movl 0xd127(%rip), %eax      # 0x1b3ac
movl %eax, -0xcc(%rbp)
movq 0xd00e(%rip), %rdi      # 0x1b2a0
movl 0xd0f0(%rip), %esi      # 0x1b388
callq 0x5780
movq -0xe8(%rbp), %rdi
movq -0xe0(%rbp), %rsi
movl -0xd8(%rbp), %edx
movl -0xd4(%rbp), %ecx
movl -0xd0(%rbp), %r8d
movl -0xcc(%rbp), %r9d
movl %eax, %r11d
movq 0xd041(%rip), %r10      # 0x1b310
xorl %eax, %eax
leaq 0xcfc8(%rip), %rax      # 0x1b2a0
addq $0x78, %rax
movl $0x0, (%rsp)
movl %r11d, 0x8(%rsp)
movl $0x1, 0x10(%rsp)
movq %r10, 0x18(%rsp)
movq $0x281a, 0x20(%rsp)     # imm = 0x281A
movq %rax, 0x28(%rsp)
callq 0x5230
movq %rax, 0xcfa1(%rip)      # 0x1b2b0
leaq -0x88(%rbp), %rdi
xorl %esi, %esi
movl $0x80, %edx
callq 0x50a0
movl $0x0, -0x24(%rbp)
movq 0xcf70(%rip), %rdi      # 0x1b2a0
movq -0x90(%rbp), %rsi
movl $0x10000, %edx          # imm = 0x10000
leaq -0x88(%rbp), %rcx
callq 0x5510
movq %rax, 0xcf49(%rip)      # 0x1b298
movq 0xcf4a(%rip), %rdi      # 0x1b2a0
movq 0xcf53(%rip), %rsi      # 0x1b2b0
movl 0xd045(%rip), %edx      # 0x1b3a8
movl 0xd043(%rip), %ecx      # 0x1b3ac
movq 0xcf30(%rip), %rax      # 0x1b2a0
movq 0xe8(%rax), %rax
movslq 0xd00a(%rip), %r8       # 0x1b388
shlq $0x7, %r8
addq %r8, %rax
movl 0x38(%rax), %r8d
callq 0x5830
movq %rax, 0xcf23(%rip)      # 0x1b2b8
movq 0xcf04(%rip), %rdi      # 0x1b2a0
movq 0xcef5(%rip), %rsi      # 0x1b298
movq 0xcdfe(%rip), %rax      # 0x1b1a8
movl 0xcdec(%rip), %ecx      # 0x1b19c
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rdx
callq 0x5380
movq 0xceda(%rip), %rdi      # 0x1b2a0
movq 0xceeb(%rip), %rsi      # 0x1b2b8
movq 0xcec4(%rip), %rdx      # 0x1b298
movl 0xcfcd(%rip), %r9d      # 0x1b3a8
movl 0xcfcb(%rip), %eax      # 0x1b3ac
xorl %r8d, %r8d
movl %r8d, %ecx
movl %eax, (%rsp)
callq 0x5390
movslq -0x4(%rbp), %rdi
shlq $0x4, %rdi
callq 0x5a20
movq %rax, 0xcebd(%rip)      # 0x1b2c0
movq 0xce96(%rip), %rdi      # 0x1b2a0
movq 0xcea7(%rip), %rsi      # 0x1b2b8
movq 0xcef8(%rip), %rdx      # 0x1b310
movq 0xce89(%rip), %rcx      # 0x1b2a8
callq 0x5850
movq %rax, 0xcedd(%rip)      # 0x1b308
movq 0xce6e(%rip), %rdi      # 0x1b2a0
callq 0xf100
cmpl $0x0, %eax
jne 0xe45d
movq 0xce5d(%rip), %rdi      # 0x1b2a0
xorl %eax, %eax
movl %eax, %r9d
leaq 0xe11(%rip), %r8        # 0xf260
movq %r9, %rsi
movq %r9, %rdx
movq %r9, %rcx
callq 0x52f0
movq 0xce3c(%rip), %rdi      # 0x1b2a0
movl 0x8ade(%rip), %esi      # 0x16f48
callq 0x5080
movq %rax, -0xa0(%rbp)
movq 0xce23(%rip), %rdi      # 0x1b2a0
movq 0xce2c(%rip), %rsi      # 0x1b2b0
movq -0xa0(%rbp), %rdx
callq 0x5700
movq 0xce09(%rip), %rdi      # 0x1b2a0
movq 0xce0a(%rip), %rsi      # 0x1b2a8
movl 0x8aa8(%rip), %eax      # 0x16f4c
movl %eax, %ecx
leaq 0x8263(%rip), %rax      # 0x16710
movq (%rax,%rcx,8), %rdx
leaq -0xb0(%rbp), %rcx
callq 0x56b0
cmpl $0x0, %eax
jne 0xe4dd
movw $0xffff, -0xa8(%rbp)    # imm = 0xFFFF
movw $0xffff, -0xa6(%rbp)    # imm = 0xFFFF
movw $0xffff, -0xa4(%rbp)    # imm = 0xFFFF
movq 0xcdbc(%rip), %rdi      # 0x1b2a0
movq 0xcdbd(%rip), %rsi      # 0x1b2a8
movl 0xcf77(%rip), %eax      # 0x1b468
movl %eax, %ecx
leaq 0x8216(%rip), %rax      # 0x16710
movq (%rax,%rcx,8), %rdx
leaq -0xc0(%rbp), %rcx
callq 0x56b0
cmpl $0x0, %eax
jne 0xe52a
movw $0x0, -0xb8(%rbp)
movw $0x0, -0xb6(%rbp)
movw $0x0, -0xb4(%rbp)
movq 0xcd6f(%rip), %rdi      # 0x1b2a0
movq -0xa0(%rbp), %rsi
leaq -0xb0(%rbp), %rdx
leaq -0xc0(%rbp), %rcx
callq 0x52a0
movq 0xcd4e(%rip), %rdi      # 0x1b2a0
leaq 0x3b1a(%rip), %rsi      # 0x12073
xorl %edx, %edx
callq 0x5730
movq %rax, 0xcd61(%rip)      # 0x1b2c8
movq 0xcd32(%rip), %rdi      # 0x1b2a0
leaq 0x3b06(%rip), %rsi      # 0x1207b
xorl %edx, %edx
callq 0x5730
movq %rax, 0xcd4d(%rip)      # 0x1b2d0
movq 0xcd16(%rip), %rdi      # 0x1b2a0
leaq 0x3afb(%rip), %rsi      # 0x1208c
xorl %edx, %edx
callq 0x5730
movq %rax, 0xcd39(%rip)      # 0x1b2d8
movq 0xccfa(%rip), %rdi      # 0x1b2a0
movq 0xcd03(%rip), %rsi      # 0x1b2b0
leaq 0xccec(%rip), %rdx      # 0x1b2a0
addq $0x30, %rdx
movl $0x1, %ecx
callq 0x53f0
movq 0xccd7(%rip), %rdi      # 0x1b2a0
leaq 0x3ac9(%rip), %rsi      # 0x12099
xorl %edx, %edx
callq 0x5730
movq %rax, 0xcd02(%rip)      # 0x1b2e0
movq 0xccbb(%rip), %rdi      # 0x1b2a0
movq 0xccc4(%rip), %rsi      # 0x1b2b0
movq 0xcced(%rip), %rdx      # 0x1b2e0
movl $0x6, %ecx
movl $0x20, %r8d
xorl %r9d, %r9d
leaq -0x94(%rbp), %rax
movq %rax, (%rsp)
movl $0x1, 0x8(%rsp)
callq 0x57a0
movl $0x20000, 0xcd95(%rip)  # imm = 0x20000
callq 0x8170
callq 0xf2b0
movq 0xcc6c(%rip), %rdi      # 0x1b2a0
movq 0xcc75(%rip), %rsi      # 0x1b2b0
callq 0x5490
movq 0xcc59(%rip), %rdi      # 0x1b2a0
xorl %esi, %esi
callq 0x55e0
movl $0x1, %edi
leaq 0xcdb6(%rip), %rsi      # 0x1b410
addq $0x18, %rsi
callq 0x5130
movl $0x1, %edi
leaq 0xcda1(%rip), %rsi      # 0x1b410
addq $0x28, %rsi
callq 0x5130
movq $0x0, 0xcd95(%rip) # 0x1b418
movq $0x0, 0xcd92(%rip) # 0x1b420
movq 0xcc0b(%rip), %rdi      # 0x1b2a0
leaq 0x3a09(%rip), %rsi      # 0x120a5
xorl %edx, %edx
callq 0x5730
movq %rax, 0xcd66(%rip)      # 0x1b410
cmpq $0x0, 0xcd5e(%rip)      # 0x1b410
jne 0xe6bf
movq $0x1f, 0xcd51(%rip) # 0x1b410
addq $0x120, %rsp            # imm = 0x120
popq %rbp
retq
nopl (%rax,%rax)