// File: /workspace/github_c_makefile_star2_O3/jebaum[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:
			if (narg > 1) {
				xsettitle(strescseq.args[1]);
				xseticontitle(strescseq.args[1]);
			}
			return;
		case 1:
			if (narg > 1)
				xseticontitle(strescseq.args[1]);
			return;
		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 10:
			if (narg < 2)
				break;

			p = strescseq.args[1];

			if (!strcmp(p, "?"))
				osc_color_response(defaultfg, 10);
			else if (xsetcolorname(defaultfg, p))
				fprintf(stderr, "erresc: invalid foreground color: %s\n", p);
			else
				redraw();
			return;
		case 11:
			if (narg < 2)
				break;

			p = strescseq.args[1];

			if (!strcmp(p, "?"))
				osc_color_response(defaultbg, 11);
			else if (xsetcolorname(defaultbg, p))
				fprintf(stderr, "erresc: invalid background color: %s\n", p);
			else
				redraw();
			return;
		case 12:
			if (narg < 2)
				break;

			p = strescseq.args[1];

			if (!strcmp(p, "?"))
				osc_color_response(defaultcs, 12);
			else if (xsetcolorname(defaultcs, p))
				fprintf(stderr, "erresc: invalid cursor color: %s\n", p);
			else
				redraw();
			return;
		case 4: /* color set */
			if (narg < 3)
				break;
			p = strescseq.args[2];
			/* FALLTHROUGH */
		case 104: /* color reset */
			j = (narg > 1) ? atoi(strescseq.args[1]) : -1;

			if (p && !strcmp(p, "?"))
				osc4_color_response(j);
			else 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 {
				/*
				 * TODO if defaultbg color is changed, borders
				 * are dirty
				 */
				redraw();
			}
			return;
		}
		break;
	case 'k': /* old title set compatibility */
		xsettitle(strescseq.args[0]);
		return;
	case 'P': /* DCS -- Device Control String */
	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, 0x108e9(%rip)   # 0x1a788
movq 0x1291a(%rip), %rax     # 0x1c7c0
movl $0x0, 0x129a8(%rip)     # 0x1c858
movq 0x12919(%rip), %rcx     # 0x1c7d0
movb $0x0, (%rax,%rcx)
cmpb $0x0, (%rax)
je 0x9f09
xorl %r15d, %r15d
leaq 0x128ee(%rip), %rcx     # 0x1c7b8
movq %rax, 0x20(%rcx,%r15,8)
incq %r15
incq %rax
movzbl -0x1(%rax), %edx
testl %edx, %edx
je 0x9ef2
cmpl $0x3b, %edx
jne 0x9ed2
movb $0x0, -0x1(%rax)
cmpq $0x10, %r15
jne 0x9eca
movl $0x10, %r15d
movl %r15d, 0x1295f(%rip)    # 0x1c858
movq 0x128d8(%rip), %rdi     # 0x1c7d8
callq 0x54b0
movl %eax, %ebx
jmp 0x9f0e
xorl %r15d, %r15d
xorl %ebx, %ebx
movzbl 0x128a3(%rip), %eax     # 0x1c7b8
cmpl $0x5d, %eax
jle 0x9f45
leal -0x5e(%rax), %ecx
cmpl $0x2, %ecx
jb 0xa18f
cmpl $0x6b, %eax
jne 0xa162
movq 0x128a2(%rip), %rdi     # 0x1c7d8
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0xb4b0
cmpl $0x50, %eax
je 0xa18f
cmpl $0x5d, %eax
jne 0xa162
cmpl $0xc, %ebx
ja 0x9f89
movl %ebx, %eax
leaq 0x534f(%rip), %rcx      # 0xf2b4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
cmpl $0x2, %r15d
jl 0xa18f
movq 0x12861(%rip), %rdi     # 0x1c7e0
callq 0xb4b0
jmp 0xa0d8
cmpl $0x34, %ebx
je 0xa124
cmpl $0x68, %ebx
jne 0xa162
leaq 0x59de(%rip), %r14      # 0xf980
cmpl $0x2, %r15d
jl 0xa169
movq 0x1282d(%rip), %rdi     # 0x1c7e0
callq 0x54b0
movl %eax, %ebp
jmp 0xa177
cmpl $0x2, %r15d
jl 0xa162
movq 0x12810(%rip), %rbx     # 0x1c7e0
cmpb $0x3f, (%rbx)
jne 0x9fdf
cmpb $0x0, 0x1(%rbx)
je 0xa1a9
leaq 0xc50e(%rip), %rax      # 0x164f4
movl (%rax), %edi
movq %rbx, %rsi
callq 0xb0ba
testl %eax, %eax
je 0xa19a
movq 0xbff1(%rip), %rax      # 0x15ff0
movq (%rax), %rdi
leaq 0x5933(%rip), %rsi      # 0xf93c
jmp 0xa0a4
cmpl $0x2, %r15d
jl 0xa162
movq 0x127c1(%rip), %rbx     # 0x1c7e0
cmpb $0x3f, (%rbx)
jne 0xa02e
cmpb $0x0, 0x1(%rbx)
je 0xa1b9
leaq 0xc4b7(%rip), %rax      # 0x164ec
movl (%rax), %edi
movq %rbx, %rsi
callq 0xb0ba
testl %eax, %eax
je 0xa19a
movq 0xbfa2(%rip), %rax      # 0x15ff0
movq (%rax), %rdi
leaq 0x5898(%rip), %rsi      # 0xf8f0
jmp 0xa0a4
cmpl $0x2, %r15d
jl 0xa162
movq 0x12775(%rip), %rbx     # 0x1c7e0
cmpb $0x3f, (%rbx)
jne 0xa07a
cmpb $0x0, 0x1(%rbx)
je 0xa1c9
leaq 0xc46f(%rip), %rax      # 0x164f0
movl (%rax), %edi
movq %rbx, %rsi
callq 0xb0ba
testl %eax, %eax
je 0xa19a
movq 0xbf56(%rip), %rax      # 0x15ff0
movq (%rax), %rdi
leaq 0x5872(%rip), %rsi      # 0xf916
movq %rbx, %rdx
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x5860
cmpl $0x2, %r15d
jl 0xa18f
movq 0x12717(%rip), %rdi     # 0x1c7e0
jmp 0x9f36
cmpl $0x2, %r15d
jl 0xa18f
movq 0x12701(%rip), %rdi     # 0x1c7e0
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0xb432
cmpl $0x3, %r15d
jl 0xa162
movq 0x126ed(%rip), %r14     # 0x1c7e8
movq 0x126de(%rip), %rdi     # 0x1c7e0
callq 0x54b0
movl %eax, %ebp
testq %r14, %r14
je 0xa170
cmpb $0x3f, (%r14)
jne 0xa11f
cmpb $0x0, 0x1(%r14)
je 0xa1e6
movq %r14, %rsi
jmp 0xa179
cmpl $0x3, %r15d
jl 0xa18f
leaq 0x129d7(%rip), %rax     # 0x1cb08
cmpl $0x0, (%rax)
je 0xa18f
movq 0x126ab(%rip), %rdi     # 0x1c7e8
callq 0xa2b1
testq %rax, %rax
je 0xa21e
movq %rax, %rdi
callq 0xadfa
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0xad98
callq 0x5c93
jmp 0xa18f
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jmp 0xa177
leaq 0x5809(%rip), %r14      # 0xf980
xorl %esi, %esi
movl %ebp, %edi
callq 0xb0ba
testl %eax, %eax
je 0xa19a
cmpl $0x1, %r15d
jg 0xa1f7
cmpl $0x68, %ebx
jne 0xa1f7
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x8592
leaq 0xc344(%rip), %rax      # 0x164f4
movl (%rax), %edi
movl $0xc, %esi
jmp 0xa1d7
leaq 0xc32c(%rip), %rax      # 0x164ec
movl (%rax), %edi
movl $0xa, %esi
jmp 0xa1d7
leaq 0xc320(%rip), %rax      # 0x164f0
movl (%rax), %edi
movl $0xb, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x7cfd
movl %ebp, %edi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x7c6a
movq 0xbdf2(%rip), %rax      # 0x15ff0
movq (%rax), %rdi
leaq 0x5756(%rip), %rsi      # 0xf95e
movl %ebp, %edx
movq %r14, %rcx
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x5860
callq 0x5c77
jmp 0xa18f