// File: /workspace/github_c_makefile_star2_O2/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 %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
andb $-0x15, 0x104ac(%rip)   # 0x19788
movq 0x124dd(%rip), %rax     # 0x1b7c0
andl $0x0, 0x1256e(%rip)     # 0x1b858
movq 0x124df(%rip), %rcx     # 0x1b7d0
movb $0x0, (%rax,%rcx)
cmpb $0x0, (%rax)
je 0x934d
xorl %r12d, %r12d
leaq 0x124b4(%rip), %rcx     # 0x1b7b8
cmpq $0x10, %r12
je 0x9341
movq %rax, 0x20(%rcx,%r12,8)
incq %r12
incq %rax
movzbl -0x1(%rax), %edx
cmpl $0x3b, %edx
je 0x9324
testl %edx, %edx
jne 0x9312
jmp 0x932a
movb $0x0, -0x1(%rax)
jmp 0x9304
movl %r12d, 0x12527(%rip)    # 0x1b858
movq 0x124a0(%rip), %rdi     # 0x1b7d8
callq 0x54b0
movl %eax, %ebx
jmp 0x9352
movl %r12d, 0x12510(%rip)    # 0x1b858
testl %r12d, %r12d
jne 0x9331
xorl %r12d, %r12d
xorl %ebx, %ebx
movzbl 0x1245f(%rip), %eax     # 0x1b7b8
leal -0x5e(%rax), %ecx
cmpl $0x2, %ecx
jb 0x9792
cmpl $0x50, %eax
je 0x9792
cmpl $0x6b, %eax
je 0x93ae
cmpl $0x5d, %eax
jne 0x967a
cmpl $0xc, %ebx
ja 0x93c8
movl %ebx, %eax
leaq 0x4fc2(%rip), %rcx      # 0xe34c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
cmpl $0x2, %r12d
jl 0x9792
movq 0x1243c(%rip), %rdi     # 0x1b7e0
callq 0xa71f
jmp 0x9513
movq 0x12423(%rip), %rdi     # 0x1b7d8
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xa71f
cmpl $0x34, %ebx
je 0x956e
cmpl $0x68, %ebx
jne 0x967a
xorl %r14d, %r14d
cmpl $0x2, %r12d
jge 0x953e
pushq $-0x1
popq %rbp
leaq 0x555f(%rip), %r15      # 0xe950
jmp 0x9771
cmpl $0x2, %r12d
jl 0x967a
movq 0x123d9(%rip), %rbx     # 0x1b7e0
cmpb $0x3f, (%rbx)
jne 0x9416
cmpb $0x0, 0x1(%rbx)
je 0x97b4
leaq 0xc0d7(%rip), %rax      # 0x154f4
movl (%rax), %edi
movq %rbx, %rsi
callq 0xa346
testl %eax, %eax
je 0x97a1
movq 0xbbba(%rip), %rax      # 0x14ff0
movq (%rax), %rdi
leaq 0x54cc(%rip), %rsi      # 0xe90c
jmp 0x94db
cmpl $0x2, %r12d
jl 0x967a
movq 0x1238a(%rip), %rbx     # 0x1b7e0
cmpb $0x3f, (%rbx)
jne 0x9465
cmpb $0x0, 0x1(%rbx)
je 0x97c1
leaq 0xc080(%rip), %rax      # 0x154ec
movl (%rax), %edi
movq %rbx, %rsi
callq 0xa346
testl %eax, %eax
je 0x97a1
movq 0xbb6b(%rip), %rax      # 0x14ff0
movq (%rax), %rdi
leaq 0x5431(%rip), %rsi      # 0xe8c0
jmp 0x94db
cmpl $0x2, %r12d
jl 0x967a
movq 0x1233e(%rip), %rbx     # 0x1b7e0
cmpb $0x3f, (%rbx)
jne 0x94b1
cmpb $0x0, 0x1(%rbx)
je 0x97ce
leaq 0xc038(%rip), %rax      # 0x154f0
movl (%rax), %edi
movq %rbx, %rsi
callq 0xa346
testl %eax, %eax
je 0x97a1
movq 0xbb1f(%rip), %rax      # 0x14ff0
movq (%rax), %rdi
leaq 0x540b(%rip), %rsi      # 0xe8e6
movq %rbx, %rdx
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x5860
cmpl $0x2, %r12d
jl 0x9792
movq 0x122dc(%rip), %rdi     # 0x1b7e0
jmp 0x93b5
cmpl $0x2, %r12d
jl 0x9792
movq 0x122c6(%rip), %rdi     # 0x1b7e0
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xa6a5
cmpl $0x3, %r12d
jl 0x967a
movq 0x122aa(%rip), %r14     # 0x1b7e8
movq 0x1229b(%rip), %rdi     # 0x1b7e0
callq 0x54b0
movl %eax, %ebp
testq %r14, %r14
je 0x9767
cmpb $0x3f, (%r14)
jne 0x9566
cmpb $0x0, 0x1(%r14)
je 0x97ed
movq %r14, %r15
jmp 0x9771
cmpl $0x3, %r12d
jl 0x9792
leaq 0x12589(%rip), %rax     # 0x1bb08
cmpl $0x0, (%rax)
je 0x9792
movq 0x12259(%rip), %r15     # 0x1b7e8
leaq 0x8(%rsp), %rax
movq %r15, (%rax)
movq %r15, %rdi
callq 0x5370
addq $0x3, %rax
shrq $0x2, %rax
leaq (%rax,%rax,2), %rdi
incq %rdi
callq 0x5a2c
movq %rax, %r13
leaq 0x2(%rax), %rbp
movq %rax, 0x10(%rsp)
cmpb $0x0, (%r15)
je 0x9802
leaq 0x8(%rsp), %r12
movq %r12, %rdi
callq 0x9918
movzbl %al, %eax
leaq 0x4ec0(%rip), %rbx      # 0xe4a0
movb (%rax,%rbx), %r14b
movq %r12, %rdi
callq 0x9918
movzbl %al, %eax
movb (%rax,%rbx), %r15b
movq %r12, %rdi
callq 0x9918
movzbl %al, %eax
movb (%rax,%rbx), %bl
movq %r12, %rdi
callq 0x9918
cmpb $-0x1, %r14b
je 0x9808
cmpb $-0x1, %r15b
je 0x9808
movzbl %al, %eax
leaq 0x4e79(%rip), %rcx      # 0xe4a0
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 0x980d
shlb $0x4, %r15b
movl %ebx, %ecx
shrb $0x2, %cl
andb $0xf, %cl
orb %r15b, %cl
movb %cl, -0x1(%rbp)
cmpb $-0x1, %al
je 0x9810
shlb $0x6, %bl
orb %bl, %al
addq $0x3, %r13
movb %al, (%rbp)
movq 0x8(%rsp), %r15
addq $0x3, %rbp
jmp 0x95bf
movq 0xb96f(%rip), %r12      # 0x14ff0
movq (%r12), %rcx
leaq 0x52cb(%rip), %rdi      # 0xe957
pushq $0x14
popq %rsi
pushq $0x1
popq %rbx
movq %rbx, %rdx
callq 0x5800
movq (%r12), %rdi
movsbl 0x12113(%rip), %edx     # 0x1b7b8
leaq 0x52c0(%rip), %rsi      # 0xe96c
xorl %eax, %eax
callq 0x5860
pushq $0x4
popq %r15
leaq 0x52c3(%rip), %rbp      # 0xe981
xorl %r13d, %r13d
cmpq 0x12108(%rip), %r13     # 0x1b7d0
jae 0x9861
movq 0x120eb(%rip), %rax     # 0x1b7c0
movzbl (%rax,%r13), %r14d
testl %r14d, %r14d
je 0x974d
callq 0x5390
movq (%rax), %rax
testb $0x40, 0x1(%rax,%r14,2)
movq (%r12), %rcx
je 0x9703
movl %r14d, %edi
movq %rcx, %rsi
callq 0x54f0
incq %r13
jmp 0x96c1
cmpl $0x1b, %r14d
je 0x9727
cmpl $0xd, %r14d
je 0x971e
cmpl $0xa, %r14d
jne 0x973b
leaq 0x5256(%rip), %rdi      # 0xe972
jmp 0x972e
leaq 0x5252(%rip), %rdi      # 0xe977
jmp 0x972e
leaq 0x524e(%rip), %rdi      # 0xe97c
movq %r15, %rsi
movq %rbx, %rdx
callq 0x5800
jmp 0x96fe
movq %rcx, %rdi
movq %rbp, %rsi
movl %r14d, %edx
xorl %eax, %eax
callq 0x5860
jmp 0x96fe
movq (%r12), %rsi
pushq $0xa
popq %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x54f0
leaq 0x51e2(%rip), %r15      # 0xe950
xorl %r14d, %r14d
movl %ebp, %edi
movq %r14, %rsi
callq 0xa346
testl %eax, %eax
je 0x97a1
cmpl $0x1, %r12d
jg 0x9836
cmpl $0x68, %ebx
jne 0x9836
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 0x7ab7
leaq 0xbd39(%rip), %rax      # 0x154f4
movl (%rax), %edi
pushq $0xc
jmp 0x97d9
leaq 0xbd24(%rip), %rax      # 0x154ec
movl (%rax), %edi
pushq $0xa
jmp 0x97d9
leaq 0xbd1b(%rip), %rax      # 0x154f0
movl (%rax), %edi
pushq $0xb
popq %rsi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x7373
movl %ebp, %edi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x72e4
addq $-0x2, %rbp
jmp 0x9810
movq %r13, %rbp
jmp 0x9810
decq %rbp
movb $0x0, (%rbp)
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x9870
callq 0xa0bb
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xa05c
movq 0xb7b3(%rip), %rax      # 0x14ff0
movq (%rax), %rdi
leaq 0x50e7(%rip), %rsi      # 0xe92e
movl %ebp, %edx
movq %r15, %rcx
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x5860
movq (%r12), %rcx
leaq 0x511c(%rip), %rdi      # 0xe988
pushq $0x5
jmp 0x9883
movq 0xb779(%rip), %rax      # 0x14ff0
movq (%rax), %rcx
leaq 0x5027(%rip), %rdi      # 0xe8a8
pushq $0x17
popq %rsi
pushq $0x1
popq %rdx
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x5800