// File: /workspace/github_c_makefile_star2_O1/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, 0xc849(%rip)    # 0x15810
movq 0xe882(%rip), %rcx      # 0x17850
movl $0x0, 0xe910(%rip)      # 0x178e8
movq 0xe881(%rip), %rax      # 0x17860
movb $0x0, (%rcx,%rax)
cmpb $0x0, (%rcx)
je 0x901e
xorl %eax, %eax
leaq 0xe857(%rip), %rdx      # 0x17848
movq %rcx, 0x20(%rdx,%rax,8)
incq %rax
incq %rcx
movzbl -0x1(%rcx), %esi
testl %esi, %esi
je 0x9018
cmpl $0x3b, %esi
jne 0x8ff9
movb $0x0, -0x1(%rcx)
cmpq $0x10, %rax
jne 0x8ff1
movl $0x10, %eax
movl %eax, 0xe8ca(%rip)      # 0x178e8
movl 0xe8c3(%rip), %r15d     # 0x178e8
testl %r15d, %r15d
je 0x903a
movq 0xe837(%rip), %rdi      # 0x17868
callq 0x5480
movl %eax, %ebx
jmp 0x903c
xorl %ebx, %ebx
movzbl 0xe805(%rip), %eax      # 0x17848
cmpl $0x5d, %eax
jle 0x9073
leal -0x5e(%rax), %ecx
cmpl $0x2, %ecx
jb 0x9186
cmpl $0x6b, %eax
jne 0x9181
movq 0xe804(%rip), %rdi      # 0x17868
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0xa2db
cmpl $0x50, %eax
je 0x9186
cmpl $0x5d, %eax
jne 0x9181
cmpl $0x3, %ebx
jg 0x90a3
jae 0x9181
cmpl $0x2, %r15d
jl 0x9186
movq 0xe7cf(%rip), %rdi      # 0x17870
jmp 0x9064
cmpl $0x4, %ebx
je 0x90bf
cmpl $0x34, %ebx
je 0x9138
cmpl $0x68, %ebx
jne 0x9181
xorl %r14d, %r14d
jmp 0x90d0
cmpl $0x3, %r15d
jl 0x9181
movq 0xe7a8(%rip), %r14      # 0x17878
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpl $0x2, %r15d
jl 0x90e9
movq 0xe78e(%rip), %rdi      # 0x17870
callq 0x5480
movl %eax, %ebp
movl %ebp, %edi
movq %r14, %rsi
callq 0x9f72
testl %eax, %eax
je 0x9172
cmpl $0x1, %r15d
jg 0x9106
cmpl $0x68, %ebx
je 0x9186
movq 0xbee3(%rip), %rax      # 0x14ff0
movq (%rax), %rdi
testq %r14, %r14
leaq 0x56e1(%rip), %rcx      # 0xe7fb
cmovneq %r14, %rcx
leaq 0x56b4(%rip), %rsi      # 0xe7d9
movl %ebp, %edx
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x5840
cmpl $0x3, %r15d
jl 0x9186
leaq 0xea53(%rip), %rax      # 0x17b98
cmpl $0x0, (%rax)
je 0x9186
movq 0xe727(%rip), %rdi      # 0x17878
callq 0x9221
testq %rax, %rax
je 0x9191
movq %rax, %rdi
callq 0x9cea
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x9c88
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x79af
callq 0x5c15
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
callq 0x5bf9
jmp 0x9186