// File: /workspace/github_c_makefile_star2_O3/jaimecgomezz[P]st/st.c
// Function: strhandle
void strhandle(void) {
  char *p = NULL, *dec;
  int j, narg, par;

  term.esc &= ~(ESC_STR_END | ESC_STR);
  strparse();
  par = (narg = strescseq.narg) ? atoi(strescseq.args[0]) : 0;

  switch (strescseq.type) {
  case ']': /* OSC -- Operating System Command */
    switch (par) {
    case 0:
    case 1:
    case 2:
      if (narg > 1)
        xsettitle(strescseq.args[1]);
      return;
    case 52:
      if (narg > 2 && allowwindowops) {
        dec = base64dec(strescseq.args[2]);
        if (dec) {
          xsetsel(dec);
          xclipcopy();
        } else {
          fprintf(stderr, "erresc: invalid base64\n");
        }
      }
      return;
    case 4: /* color set */
      if (narg < 3)
        break;
      p = strescseq.args[2];
      /* FALLTHROUGH */
    case 104: /* color reset, here p = NULL */
      j = (narg > 1) ? atoi(strescseq.args[1]) : -1;
      if (xsetcolorname(j, p)) {
        if (par == 104 && narg <= 1)
          return; /* color reset without parameter */
        fprintf(stderr, "erresc: invalid color j=%d, p=%s\n", j,
                p ? p : "(null)");
      } else {
        // >>>>>>>>>>>>>>>>>>>> xclearwin
        // ==================== xclearwin
        /*
         * TODO if defaultbg color is changed, borders
         * are dirty
         */
        // ==================== xclearwin
        // <<<<<<<<<<<<<<<<<<<< xclearwin
        redraw();
      }
      return;
    }
    break;
  case 'k': /* old title set compatibility */
    xsettitle(strescseq.args[0]);
    return;
  case 'P': /* DCS -- Device Control String */
  // >>>>>>>>>>>>>>>>>>>> sync
  // ==================== sync
  // ==================== sync
  // <<<<<<<<<<<<<<<<<<<< sync
  case '_': /* APC -- Application Program Command */
  case '^': /* PM -- Privacy Message */
    return;
  }

  fprintf(stderr, "erresc: unknown str ");
  strdump();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
andb $-0x15, 0xc4f3(%rip)    # 0x15800
movq 0xe52c(%rip), %rax      # 0x17840
movl $0x0, 0xe5ba(%rip)      # 0x178d8
movq 0xe52b(%rip), %rcx      # 0x17850
movb $0x0, (%rax,%rcx)
cmpb $0x0, (%rax)
je 0x9377
xorl %r15d, %r15d
leaq 0xe500(%rip), %rcx      # 0x17838
movq %rax, 0x20(%rcx,%r15,8)
incq %r15
incq %rax
movzbl -0x1(%rax), %edx
testl %edx, %edx
je 0x9360
cmpl $0x3b, %edx
jne 0x9340
movb $0x0, -0x1(%rax)
cmpq $0x10, %r15
jne 0x9338
movl $0x10, %r15d
movl %r15d, 0xe571(%rip)     # 0x178d8
movq 0xe4ea(%rip), %rdi      # 0x17858
callq 0x5480
movl %eax, %ebx
jmp 0x937c
xorl %r15d, %r15d
xorl %ebx, %ebx
movzbl 0xe4b5(%rip), %eax      # 0x17838
cmpl $0x5d, %eax
jle 0x93b3
leal -0x5e(%rax), %ecx
cmpl $0x2, %ecx
jb 0x94c6
cmpl $0x6b, %eax
jne 0x94c1
movq 0xe4b4(%rip), %rdi      # 0x17858
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0xa5cd
cmpl $0x50, %eax
je 0x94c6
cmpl $0x5d, %eax
jne 0x94c1
cmpl $0x3, %ebx
jg 0x93e3
jae 0x94c1
cmpl $0x2, %r15d
jl 0x94c6
movq 0xe47f(%rip), %rdi      # 0x17860
jmp 0x93a4
cmpl $0x4, %ebx
je 0x940a
cmpl $0x34, %ebx
je 0x9478
cmpl $0x68, %ebx
jne 0x94c1
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
xorl %r14d, %r14d
cmpl $0x2, %r15d
jge 0x941b
jmp 0x9429
cmpl $0x3, %r15d
jl 0x94c1
movq 0xe44d(%rip), %r14      # 0x17868
movq 0xe43e(%rip), %rdi      # 0x17860
callq 0x5480
movl %eax, %ebp
movl %ebp, %edi
movq %r14, %rsi
callq 0xa264
testl %eax, %eax
je 0x94b2
cmpl $0x1, %r15d
jg 0x9446
cmpl $0x68, %ebx
je 0x94c6
movq 0xbba3(%rip), %rax      # 0x14ff0
movq (%rax), %rdi
testq %r14, %r14
leaq 0x53cf(%rip), %rcx      # 0xe829
cmovneq %r14, %rcx
leaq 0x53a2(%rip), %rsi      # 0xe807
movl %ebp, %edx
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x5830
cmpl $0x3, %r15d
jl 0x94c6
leaq 0xe703(%rip), %rax      # 0x17b88
cmpl $0x0, (%rax)
je 0x94c6
movq 0xe3d7(%rip), %rdi      # 0x17868
callq 0x9561
testq %rax, %rax
je 0x94d1
movq %rax, %rdi
callq 0x9fe6
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x9f84
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x7bb6
callq 0x5c05
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
callq 0x5be9
jmp 0x94c6