// File: /workspace/github_c_makefile_star2_O2/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 %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
andb $-0x15, 0xbd2f(%rip)    # 0x14800
movq 0xdd68(%rip), %rax      # 0x16840
andl $0x0, 0xddf9(%rip)      # 0x168d8
movq 0xdd6a(%rip), %rcx      # 0x16850
movb $0x0, (%rax,%rcx)
cmpb $0x0, (%rax)
je 0x8b42
xorl %r15d, %r15d
leaq 0xdd3f(%rip), %rcx      # 0x16838
cmpq $0x10, %r15
je 0x8b36
movq %rax, 0x20(%rcx,%r15,8)
incq %r15
incq %rax
movzbl -0x1(%rax), %edx
cmpl $0x3b, %edx
je 0x8b19
testl %edx, %edx
jne 0x8b07
jmp 0x8b1f
movb $0x0, -0x1(%rax)
jmp 0x8af9
movl %r15d, 0xddb2(%rip)     # 0x168d8
movq 0xdd2b(%rip), %rdi      # 0x16858
callq 0x5480
movl %eax, %ebx
jmp 0x8b47
movl %r15d, 0xdd9b(%rip)     # 0x168d8
testl %r15d, %r15d
jne 0x8b26
xorl %r15d, %r15d
xorl %ebx, %ebx
movzbl 0xdcea(%rip), %eax      # 0x16838
leal -0x5e(%rax), %ecx
cmpl $0x2, %ecx
jb 0x8d17
cmpl $0x50, %eax
je 0x8d17
cmpl $0x6b, %eax
je 0x8ba2
cmpl $0x5d, %eax
jne 0x8d39
cmpl $0x3, %ebx
jb 0x8bbc
cmpl $0x4, %ebx
je 0x8cdb
cmpl $0x34, %ebx
je 0x8bcf
cmpl $0x68, %ebx
jne 0x8d39
xorl %r14d, %r14d
cmpl $0x2, %r15d
jge 0x8ce8
pushq $-0x1
popq %rbp
jmp 0x8cf6
movq 0xdcaf(%rip), %rdi      # 0x16858
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x9c25
cmpl $0x2, %r15d
jl 0x8d17
movq 0xdc93(%rip), %rdi      # 0x16860
jmp 0x8ba9
cmpl $0x3, %r15d
jl 0x8d17
leaq 0xdfa8(%rip), %rax      # 0x16b88
cmpl $0x0, (%rax)
je 0x8d17
movq 0xdc78(%rip), %r15      # 0x16868
leaq 0x8(%rsp), %rax
movq %r15, (%rax)
movq %r15, %rdi
callq 0x5350
addq $0x3, %rax
shrq $0x2, %rax
leaq (%rax,%rax,2), %rdi
incq %rdi
callq 0x59fc
movq %rax, %r13
leaq 0x2(%rax), %rbp
movq %rax, 0x10(%rsp)
cmpb $0x0, (%r15)
je 0x8e26
leaq 0x8(%rsp), %r12
movq %r12, %rdi
callq 0x8f47
movzbl %al, %eax
leaq 0x482f(%rip), %rbx      # 0xd470
movb (%rax,%rbx), %r14b
movq %r12, %rdi
callq 0x8f47
movzbl %al, %eax
movb (%rax,%rbx), %r15b
movq %r12, %rdi
callq 0x8f47
movzbl %al, %eax
movb (%rax,%rbx), %bl
movq %r12, %rdi
callq 0x8f47
cmpb $-0x1, %r14b
je 0x8e2c
cmpb $-0x1, %r15b
je 0x8e2c
movzbl %al, %eax
leaq 0x47e8(%rip), %rcx      # 0xd470
movb (%rax,%rcx), %al
shlb $0x2, %r14b
movl %r15d, %ecx
shrb $0x4, %cl
andb $0x3, %cl
orb %r14b, %cl
movb %cl, -0x2(%rbp)
cmpb $-0x1, %bl
je 0x8e31
shlb $0x4, %r15b
movl %ebx, %ecx
shrb $0x2, %cl
andb $0xf, %cl
orb %r15b, %cl
movb %cl, -0x1(%rbp)
cmpb $-0x1, %al
je 0x8e34
shlb $0x6, %bl
orb %bl, %al
addq $0x3, %r13
movb %al, (%rbp)
movq 0x8(%rsp), %r15
addq $0x3, %rbp
jmp 0x8c20
cmpl $0x3, %r15d
jl 0x8d39
movq 0xdb80(%rip), %r14      # 0x16868
movq 0xdb71(%rip), %rdi      # 0x16860
callq 0x5480
movl %eax, %ebp
movl %ebp, %edi
movq %r14, %rsi
callq 0x98d2
testl %eax, %eax
je 0x8d26
cmpl $0x1, %r15d
jg 0x8e5a
cmpl $0x68, %ebx
jne 0x8e5a
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x73e8
movq 0xb2b0(%rip), %r12      # 0x13ff0
movq (%r12), %rcx
leaq 0x4ab5(%rip), %rdi      # 0xd800
pushq $0x14
popq %rsi
pushq $0x1
popq %rbx
movq %rbx, %rdx
callq 0x57d0
movq (%r12), %rdi
movsbl 0xdad4(%rip), %edx      # 0x16838
leaq 0x4aaa(%rip), %rsi      # 0xd815
xorl %eax, %eax
callq 0x5830
pushq $0x4
popq %r15
leaq 0x4aad(%rip), %rbp      # 0xd82a
xorl %r13d, %r13d
cmpq 0xdac9(%rip), %r13      # 0x16850
jae 0x8e90
movq 0xdaac(%rip), %rax      # 0x16840
movzbl (%rax,%r13), %r14d
testl %r14d, %r14d
je 0x8e0c
callq 0x5370
movq (%rax), %rax
testb $0x40, 0x1(%rax,%r14,2)
movq (%r12), %rcx
je 0x8dc2
movl %r14d, %edi
movq %rcx, %rsi
callq 0x54c0
incq %r13
jmp 0x8d80
cmpl $0x1b, %r14d
je 0x8de6
cmpl $0xd, %r14d
je 0x8ddd
cmpl $0xa, %r14d
jne 0x8dfa
leaq 0x4a40(%rip), %rdi      # 0xd81b
jmp 0x8ded
leaq 0x4a3c(%rip), %rdi      # 0xd820
jmp 0x8ded
leaq 0x4a38(%rip), %rdi      # 0xd825
movq %r15, %rsi
movq %rbx, %rdx
callq 0x57d0
jmp 0x8dbd
movq %rcx, %rdi
movq %rbp, %rsi
movl %r14d, %edx
xorl %eax, %eax
callq 0x5830
jmp 0x8dbd
movq (%r12), %rsi
pushq $0xa
popq %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x54c0
addq $-0x2, %rbp
jmp 0x8e34
movq %r13, %rbp
jmp 0x8e34
decq %rbp
movb $0x0, (%rbp)
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x8e9f
callq 0x9687
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x9628
movq 0xb18f(%rip), %rax      # 0x13ff0
movq (%rax), %rdi
testq %r14, %r14
leaq 0x498b(%rip), %rcx      # 0xd7f9
cmovneq %r14, %rcx
leaq 0x495e(%rip), %rsi      # 0xd7d7
movl %ebp, %edx
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x5830
movq (%r12), %rcx
leaq 0x4996(%rip), %rdi      # 0xd831
pushq $0x5
jmp 0x8eb2
movq 0xb14a(%rip), %rax      # 0x13ff0
movq (%rax), %rcx
leaq 0x490f(%rip), %rdi      # 0xd7bf
pushq $0x17
popq %rsi
pushq $0x1
popq %rdx
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x57d0