// File: /workspace/github_c_makefile_star2_O3/emmett1[P]st/st.c
// Function: strhandle
void
strhandle(void)
{
	char *p = NULL;
	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) {
				char *dec;

				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)) {
				fprintf(stderr, "erresc: invalid color %s\n", p);
			} 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 */
		term.mode |= ESC_DCS;
	case '_': /* APC -- Application Program Command */
	case '^': /* PM -- Privacy Message */
		return;
	}

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

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
andb $-0x15, 0xfc74(%rip)    # 0x19638
movl $0x0, 0x11f22(%rip)     # 0x1b8f0
leaq 0x11c93(%rip), %rax     # 0x1b668
movslq 0x11e90(%rip), %rcx     # 0x1b86c
movb $0x0, 0x1(%rcx,%rax)
cmpb $0x0, 0x11c81(%rip)     # 0x1b669
setne %cl
movl 0x11efe(%rip), %r14d    # 0x1b8f0
cmpl $0x10, %r14d
setl %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x9a3f
leaq 0x11c62(%rip), %rcx     # 0x1b669
leal 0x1(%r14), %edx
movl %edx, 0x11edf(%rip)     # 0x1b8f0
movslq %r14d, %rsi
movq %rcx, 0x208(%rax,%rsi,8)
incq %rcx
movzbl -0x1(%rcx), %esi
testl %esi, %esi
je 0x9a42
cmpl $0x3b, %esi
jne 0x9a1c
movb $0x0, -0x1(%rcx)
movl 0x11eb9(%rip), %r14d    # 0x1b8f0
cmpl $0x10, %r14d
jl 0x9a07
jmp 0x9a49
movl %r14d, %edx
movl %edx, %r14d
testl %edx, %edx
je 0x9a57
movq 0x11e20(%rip), %rdi     # 0x1b870
callq 0x5460
jmp 0x9a5c
xorl %r14d, %r14d
xorl %eax, %eax
movzbl 0x11c05(%rip), %ecx     # 0x1b668
cmpl $0x5d, %ecx
jle 0x9a8c
leal -0x5e(%rcx), %eax
cmpl $0x2, %eax
jb 0x9abb
cmpl $0x6b, %ecx
jne 0x9b3f
movq 0x11df0(%rip), %rdi     # 0x1b870
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xad39
cmpl $0x50, %ecx
je 0x9ab4
cmpl $0x5d, %ecx
jne 0x9b3f
cmpl $0x3, %eax
jg 0x9ac3
jae 0x9b3f
cmpl $0x2, %r14d
jl 0x9abb
movq 0x11dc6(%rip), %rdi     # 0x1b878
jmp 0x9a80
orb $-0x80, 0xfb79(%rip)    # 0x19634
addq $0x8, %rsp
popq %rbx
popq %r14
retq
cmpl $0x4, %eax
je 0x9ae1
cmpl $0x34, %eax
je 0x9b14
cmpl $0x68, %eax
jne 0x9b3f
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
xorl %ebx, %ebx
cmpl $0x2, %r14d
jge 0x9aee
jmp 0x9afc
cmpl $0x3, %r14d
jl 0x9b3f
movq 0x11d92(%rip), %rbx     # 0x1b880
movq 0x11d83(%rip), %rdi     # 0x1b878
callq 0x5460
movl %eax, %edi
movq %rbx, %rsi
callq 0xa9cd
testl %eax, %eax
jne 0x9b49
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x80fb
cmpl $0x3, %r14d
jl 0x9abb
movq 0x11d5f(%rip), %rdi     # 0x1b880
callq 0x9bd7
testq %rax, %rax
je 0x9b6b
movq %rax, %rdi
callq 0xa6e2
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xa680
callq 0x5ba6
jmp 0x9abb
movq 0xb4a0(%rip), %rax      # 0x14ff0
movq (%rax), %rdi
leaq 0x4c8d(%rip), %rsi      # 0xe7e7
movq %rbx, %rdx
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x57d0
callq 0x5b8a
jmp 0x9abb