// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x50, %rsp
movq $0x0, -0x8(%rbp)
movl 0x12f02(%rip), %eax     # 0x1dd78
andl $-0x15, %eax
movl %eax, 0x12ef9(%rip)     # 0x1dd78
callq 0xb330
movl 0x14fbe(%rip), %eax     # 0x1fe48
movl %eax, -0x18(%rbp)
cmpl $0x0, %eax
je 0xaea3
movq 0x14f2f(%rip), %rdi     # 0x1fdc8
callq 0x54b0
movl %eax, -0x20(%rbp)
jmp 0xaeaa
xorl %eax, %eax
movl %eax, -0x20(%rbp)
jmp 0xaeaa
movl -0x20(%rbp), %eax
movl %eax, -0x1c(%rbp)
movsbl 0x14ef1(%rip), %eax     # 0x1fda8
addl $-0x50, %eax
movl %eax, %ecx
movq %rcx, -0x28(%rbp)
subl $0x1b, %eax
ja 0xb271
movq -0x28(%rbp), %rax
leaq 0x7660(%rip), %rcx      # 0x12534
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl -0x1c(%rbp), %eax
movl %eax, -0x2c(%rbp)
testl %eax, %eax
je 0xaf58
jmp 0xaee9
movl -0x2c(%rbp), %eax
subl $0x1, %eax
je 0xaf7b
jmp 0xaef7
movl -0x2c(%rbp), %eax
subl $0x2, %eax
je 0xaf92
jmp 0xaf05
movl -0x2c(%rbp), %eax
subl $0x4, %eax
je 0xb184
jmp 0xaf13
movl -0x2c(%rbp), %eax
subl $0xa, %eax
je 0xb001
jmp 0xaf21
movl -0x2c(%rbp), %eax
subl $0xb, %eax
je 0xb082
jmp 0xaf2f
movl -0x2c(%rbp), %eax
subl $0xc, %eax
je 0xb103
jmp 0xaf3d
movl -0x2c(%rbp), %eax
subl $0x34, %eax
je 0xafa9
jmp 0xaf47
movl -0x2c(%rbp), %eax
subl $0x68, %eax
je 0xb19a
jmp 0xb25f
cmpl $0x1, -0x18(%rbp)
jle 0xaf76
movq 0x14e6b(%rip), %rdi     # 0x1fdd0
callq 0xd330
movq 0x14e5f(%rip), %rdi     # 0x1fdd0
callq 0xd290
jmp 0xb28e
cmpl $0x1, -0x18(%rbp)
jle 0xaf8d
movq 0x14e48(%rip), %rdi     # 0x1fdd0
callq 0xd290
jmp 0xb28e
cmpl $0x1, -0x18(%rbp)
jle 0xafa4
movq 0x14e31(%rip), %rdi     # 0x1fdd0
callq 0xd330
jmp 0xb28e
cmpl $0x2, -0x18(%rbp)
jle 0xaffc
leaq 0x15142(%rip), %rax     # 0x200f8
cmpl $0x0, (%rax)
je 0xaffc
movq 0x14e16(%rip), %rdi     # 0x1fdd8
callq 0xb3f0
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0xafe2
movq -0x10(%rbp), %rdi
callq 0xca50
callq 0xc9c0
jmp 0xaffa
movq 0xc007(%rip), %rax      # 0x16ff0
movq (%rax), %rdi
leaq 0x7b67(%rip), %rsi      # 0x12b5a
movb $0x0, %al
callq 0x5870
jmp 0xaffc
jmp 0xb28e
cmpl $0x2, -0x18(%rbp)
jge 0xb00c
jmp 0xb25f
movq 0x14dbd(%rip), %rax     # 0x1fdd0
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
leaq 0x7b50(%rip), %rsi      # 0x12b72
callq 0x5660
cmpl $0x0, %eax
jne 0xb041
leaq 0xc6b9(%rip), %rax      # 0x176ec
movl (%rax), %edi
movl $0xa, %esi
callq 0x8130
jmp 0xb07d
leaq 0xc6a4(%rip), %rax      # 0x176ec
movl (%rax), %edi
movq -0x8(%rbp), %rsi
callq 0xce00
cmpl $0x0, %eax
je 0xb076
movq 0xbf91(%rip), %rax      # 0x16ff0
movq (%rax), %rdi
movq -0x8(%rbp), %rdx
leaq 0x7b07(%rip), %rsi      # 0x12b74
movb $0x0, %al
callq 0x5870
jmp 0xb07b
callq 0x8d80
jmp 0xb07d
jmp 0xb28e
cmpl $0x2, -0x18(%rbp)
jge 0xb08d
jmp 0xb25f
movq 0x14d3c(%rip), %rax     # 0x1fdd0
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
leaq 0x7acf(%rip), %rsi      # 0x12b72
callq 0x5660
cmpl $0x0, %eax
jne 0xb0c2
leaq 0xc63c(%rip), %rax      # 0x176f0
movl (%rax), %edi
movl $0xb, %esi
callq 0x8130
jmp 0xb0fe
leaq 0xc627(%rip), %rax      # 0x176f0
movl (%rax), %edi
movq -0x8(%rbp), %rsi
callq 0xce00
cmpl $0x0, %eax
je 0xb0f7
movq 0xbf10(%rip), %rax      # 0x16ff0
movq (%rax), %rdi
movq -0x8(%rbp), %rdx
leaq 0x7aac(%rip), %rsi      # 0x12b9a
movb $0x0, %al
callq 0x5870
jmp 0xb0fc
callq 0x8d80
jmp 0xb0fe
jmp 0xb28e
cmpl $0x2, -0x18(%rbp)
jge 0xb10e
jmp 0xb25f
movq 0x14cbb(%rip), %rax     # 0x1fdd0
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
leaq 0x7a4e(%rip), %rsi      # 0x12b72
callq 0x5660
cmpl $0x0, %eax
jne 0xb143
leaq 0xc5bf(%rip), %rax      # 0x176f4
movl (%rax), %edi
movl $0xc, %esi
callq 0x8130
jmp 0xb17f
leaq 0xc5aa(%rip), %rax      # 0x176f4
movl (%rax), %edi
movq -0x8(%rbp), %rsi
callq 0xce00
cmpl $0x0, %eax
je 0xb178
movq 0xbe8f(%rip), %rax      # 0x16ff0
movq (%rax), %rdi
movq -0x8(%rbp), %rdx
leaq 0x7a51(%rip), %rsi      # 0x12bc0
movb $0x0, %al
callq 0x5870
jmp 0xb17d
callq 0x8d80
jmp 0xb17f
jmp 0xb28e
cmpl $0x3, -0x18(%rbp)
jge 0xb18f
jmp 0xb25f
movq 0x14c42(%rip), %rax     # 0x1fdd8
movq %rax, -0x8(%rbp)
cmpl $0x1, -0x18(%rbp)
jle 0xb1b1
movq 0x14c29(%rip), %rdi     # 0x1fdd0
callq 0x54b0
movl %eax, -0x30(%rbp)
jmp 0xb1bb
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, -0x30(%rbp)
jmp 0xb1bb
movl -0x30(%rbp), %eax
movl %eax, -0x14(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0xb1e7
movq -0x8(%rbp), %rdi
leaq 0x799f(%rip), %rsi      # 0x12b72
callq 0x5660
cmpl $0x0, %eax
jne 0xb1e7
movl -0x14(%rbp), %edi
callq 0x8080
jmp 0xb25d
movl -0x14(%rbp), %edi
movq -0x8(%rbp), %rsi
callq 0xce00
cmpl $0x0, %eax
je 0xb256
cmpl $0x68, -0x1c(%rbp)
jne 0xb209
cmpl $0x1, -0x18(%rbp)
jg 0xb209
jmp 0xb28e
movq 0xbde0(%rip), %rax      # 0x16ff0
movq (%rax), %rax
movq %rax, -0x40(%rbp)
movl -0x14(%rbp), %eax
movl %eax, -0x34(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0xb22e
movq -0x8(%rbp), %rax
movq %rax, -0x48(%rbp)
jmp 0xb23b
leaq 0x79cf(%rip), %rax      # 0x12c04
movq %rax, -0x48(%rbp)
jmp 0xb23b
movl -0x34(%rbp), %edx
movq -0x40(%rbp), %rdi
movq -0x48(%rbp), %rcx
leaq 0x7995(%rip), %rsi      # 0x12be2
movb $0x0, %al
callq 0x5870
jmp 0xb25b
callq 0x8d80
jmp 0xb25d
jmp 0xb28e
jmp 0xb271
movq 0x14b60(%rip), %rdi     # 0x1fdc8
callq 0xd330
jmp 0xb28e
jmp 0xb28e
movq 0xbd78(%rip), %rax      # 0x16ff0
movq (%rax), %rdi
leaq 0x7989(%rip), %rsi      # 0x12c0b
movb $0x0, %al
callq 0x5870
callq 0xb570
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)