// File: /workspace/github_c_makefile_star2_O0/mrdotx[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
				tfulldirt();
			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
				tfulldirt();
			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
				tfulldirt();
			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) {
					xloadcols();
					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
				 */
				tfulldirt();
			}
			return;
		}
		break;
	case 'k': /* old title set compatibility */
		xsettitle(strescseq.args[0]);
		return;
	case 'P': /* DCS -- Device Control String */
		/* https://gitlab.com/gnachman/iterm2/-/wikis/synchronized-updates-spec */
		if (strstr(strescseq.buf, "=1s") == strescseq.buf)
			tsync_begin();  /* BSU */
		else if (strstr(strescseq.buf, "=2s") == strescseq.buf)
			tsync_end();  /* ESU */
		return;
	case '_': /* APC -- Application Program Command */
	case '^': /* PM -- Privacy Message */
		return;
	}

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq $0x0, -0x8(%rbp)
movl 0x121aa(%rip), %eax     # 0x1f2c0
andl $-0x15, %eax
movl %eax, 0x121a1(%rip)     # 0x1f2c0
callq 0xd620
movl 0x143ce(%rip), %eax     # 0x214f8
movl %eax, -0x18(%rbp)
cmpl $0x0, %eax
je 0xd143
movq 0x1433f(%rip), %rdi     # 0x21478
callq 0x64e0
movl %eax, -0x20(%rbp)
jmp 0xd14a
xorl %eax, %eax
movl %eax, -0x20(%rbp)
jmp 0xd14a
movl -0x20(%rbp), %eax
movl %eax, -0x1c(%rbp)
movsbl 0x14301(%rip), %eax     # 0x21458
addl $-0x50, %eax
movl %eax, %ecx
movq %rcx, -0x28(%rbp)
subl $0x1b, %eax
ja 0xd55e
movq -0x28(%rbp), %rax
leaq 0x93c0(%rip), %rcx      # 0x16534
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl -0x1c(%rbp), %eax
movl %eax, -0x2c(%rbp)
testl %eax, %eax
je 0xd1f8
jmp 0xd189
movl -0x2c(%rbp), %eax
subl $0x1, %eax
je 0xd21b
jmp 0xd197
movl -0x2c(%rbp), %eax
subl $0x2, %eax
je 0xd232
jmp 0xd1a5
movl -0x2c(%rbp), %eax
subl $0x4, %eax
je 0xd424
jmp 0xd1b3
movl -0x2c(%rbp), %eax
subl $0xa, %eax
je 0xd2a1
jmp 0xd1c1
movl -0x2c(%rbp), %eax
subl $0xb, %eax
je 0xd322
jmp 0xd1cf
movl -0x2c(%rbp), %eax
subl $0xc, %eax
je 0xd3a3
jmp 0xd1dd
movl -0x2c(%rbp), %eax
subl $0x34, %eax
je 0xd249
jmp 0xd1e7
movl -0x2c(%rbp), %eax
subl $0x68, %eax
je 0xd43a
jmp 0xd504
cmpl $0x1, -0x18(%rbp)
jle 0xd216
movq 0x1427b(%rip), %rdi     # 0x21480
callq 0xf7b0
movq 0x1426f(%rip), %rdi     # 0x21480
callq 0xf700
jmp 0xd57b
cmpl $0x1, -0x18(%rbp)
jle 0xd22d
movq 0x14258(%rip), %rdi     # 0x21480
callq 0xf700
jmp 0xd57b
cmpl $0x1, -0x18(%rbp)
jle 0xd244
movq 0x14241(%rip), %rdi     # 0x21480
callq 0xf7b0
jmp 0xd57b
cmpl $0x2, -0x18(%rbp)
jle 0xd29c
leaq 0x14552(%rip), %rax     # 0x217a8
cmpl $0x0, (%rax)
je 0xd29c
movq 0x14226(%rip), %rdi     # 0x21488
callq 0xd6e0
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0xd282
movq -0x10(%rbp), %rdi
callq 0xee00
callq 0xed70
jmp 0xd29a
movq 0xdd67(%rip), %rax      # 0x1aff0
movq (%rax), %rdi
leaq 0x98c7(%rip), %rsi      # 0x16b5a
movb $0x0, %al
callq 0x68e0
jmp 0xd29c
jmp 0xd57b
cmpl $0x2, -0x18(%rbp)
jge 0xd2ac
jmp 0xd504
movq 0x141cd(%rip), %rax     # 0x21480
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
leaq 0x98b0(%rip), %rsi      # 0x16b72
callq 0x6690
cmpl $0x0, %eax
jne 0xd2e1
leaq 0xe4ed(%rip), %rax      # 0x1b7c0
movl (%rax), %edi
movl $0xa, %esi
callq 0x92e0
jmp 0xd31d
leaq 0xe4d8(%rip), %rax      # 0x1b7c0
movl (%rax), %edi
movq -0x8(%rbp), %rsi
callq 0xf270
cmpl $0x0, %eax
je 0xd316
movq 0xdcf1(%rip), %rax      # 0x1aff0
movq (%rax), %rdi
movq -0x8(%rbp), %rdx
leaq 0x9867(%rip), %rsi      # 0x16b74
movb $0x0, %al
callq 0x68e0
jmp 0xd31b
callq 0x91b0
jmp 0xd31d
jmp 0xd57b
cmpl $0x2, -0x18(%rbp)
jge 0xd32d
jmp 0xd504
movq 0x1414c(%rip), %rax     # 0x21480
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
leaq 0x982f(%rip), %rsi      # 0x16b72
callq 0x6690
cmpl $0x0, %eax
jne 0xd362
leaq 0xe470(%rip), %rax      # 0x1b7c4
movl (%rax), %edi
movl $0xb, %esi
callq 0x92e0
jmp 0xd39e
leaq 0xe45b(%rip), %rax      # 0x1b7c4
movl (%rax), %edi
movq -0x8(%rbp), %rsi
callq 0xf270
cmpl $0x0, %eax
je 0xd397
movq 0xdc70(%rip), %rax      # 0x1aff0
movq (%rax), %rdi
movq -0x8(%rbp), %rdx
leaq 0x980c(%rip), %rsi      # 0x16b9a
movb $0x0, %al
callq 0x68e0
jmp 0xd39c
callq 0x91b0
jmp 0xd39e
jmp 0xd57b
cmpl $0x2, -0x18(%rbp)
jge 0xd3ae
jmp 0xd504
movq 0x140cb(%rip), %rax     # 0x21480
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
leaq 0x97ae(%rip), %rsi      # 0x16b72
callq 0x6690
cmpl $0x0, %eax
jne 0xd3e3
leaq 0xe3f3(%rip), %rax      # 0x1b7c8
movl (%rax), %edi
movl $0xc, %esi
callq 0x92e0
jmp 0xd41f
leaq 0xe3de(%rip), %rax      # 0x1b7c8
movl (%rax), %edi
movq -0x8(%rbp), %rsi
callq 0xf270
cmpl $0x0, %eax
je 0xd418
movq 0xdbef(%rip), %rax      # 0x1aff0
movq (%rax), %rdi
movq -0x8(%rbp), %rdx
leaq 0x97b1(%rip), %rsi      # 0x16bc0
movb $0x0, %al
callq 0x68e0
jmp 0xd41d
callq 0x91b0
jmp 0xd41f
jmp 0xd57b
cmpl $0x3, -0x18(%rbp)
jge 0xd42f
jmp 0xd504
movq 0x14052(%rip), %rax     # 0x21488
movq %rax, -0x8(%rbp)
cmpl $0x1, -0x18(%rbp)
jle 0xd451
movq 0x14039(%rip), %rdi     # 0x21480
callq 0x64e0
movl %eax, -0x30(%rbp)
jmp 0xd45b
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, -0x30(%rbp)
jmp 0xd45b
movl -0x30(%rbp), %eax
movl %eax, -0x14(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0xd487
movq -0x8(%rbp), %rdi
leaq 0x96ff(%rip), %rsi      # 0x16b72
callq 0x6690
cmpl $0x0, %eax
jne 0xd487
movl -0x14(%rbp), %edi
callq 0x9230
jmp 0xd502
movl -0x14(%rbp), %edi
movq -0x8(%rbp), %rsi
callq 0xf270
cmpl $0x0, %eax
je 0xd4fb
cmpl $0x68, -0x1c(%rbp)
jne 0xd4ae
cmpl $0x1, -0x18(%rbp)
jg 0xd4ae
callq 0xeea0
jmp 0xd57b
movq 0xdb3b(%rip), %rax      # 0x1aff0
movq (%rax), %rax
movq %rax, -0x40(%rbp)
movl -0x14(%rbp), %eax
movl %eax, -0x34(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0xd4d3
movq -0x8(%rbp), %rax
movq %rax, -0x48(%rbp)
jmp 0xd4e0
leaq 0x972a(%rip), %rax      # 0x16c04
movq %rax, -0x48(%rbp)
jmp 0xd4e0
movl -0x34(%rbp), %edx
movq -0x40(%rbp), %rdi
movq -0x48(%rbp), %rcx
leaq 0x96f0(%rip), %rsi      # 0x16be2
movb $0x0, %al
callq 0x68e0
jmp 0xd500
callq 0x91b0
jmp 0xd502
jmp 0xd57b
jmp 0xd55e
movq 0x13f6b(%rip), %rdi     # 0x21478
callq 0xf7b0
jmp 0xd57b
movq 0x13f45(%rip), %rdi     # 0x21460
leaq 0x96e9(%rip), %rsi      # 0x16c0b
callq 0x6480
cmpq 0x13f32(%rip), %rax     # 0x21460
jne 0xd537
callq 0xda60
jmp 0xd55a
movq 0x13f22(%rip), %rdi     # 0x21460
leaq 0x96ca(%rip), %rsi      # 0x16c0f
callq 0x6480
cmpq 0x13f0f(%rip), %rax     # 0x21460
jne 0xd558
callq 0xb500
jmp 0xd55a
jmp 0xd57b
jmp 0xd57b
movq 0xda8b(%rip), %rax      # 0x1aff0
movq (%rax), %rdi
leaq 0x96a4(%rip), %rsi      # 0x16c13
movb $0x0, %al
callq 0x68e0
callq 0xd860
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)