// File: /workspace/github_c_makefile_star2_O0/kyx0r[P]xkeyboard/xkeyboard.c
// Function: redraw_window
void redraw_window(Window exposed)
{
	int i, j, mod = 0, s;
	GC keygc;
	char *name;

	for (i = 0; i < MAX_KEYS; i++) {
		if (exposed == mykey[i]) {
			break;
		}
	}
	if (i == MAX_KEYS) {
		return;
	}
	s = xk[i].scancode;
	for (j = 0; j < 8; j++) {
		if (modifiermap[j][0] == s)
			break;
		if (modifiermap[j][1] == s)
			break;
		if (modifiermap[j][2] == s)
			break;
		if (modifiermap[j][3] == s)
			break;
	}
	keygc = mygc;
	if (j < 8) {
		if ((keystate & (1<< j)) && modindex[j] == i)
			keygc = mygcled;
	}
	for (mod = 0; mod < 4; mod++) {
		name = scanname[mod][s];
		if (!mod && !name && s == 94) {
			XUnmapWindow(dpy, mykey[i]);
		} else {
			if (!name)
				continue;
			if (islower(*name))
				continue;
			if (!mod && s == 94)
				XMapWindow(dpy, mykey[i]);
			if (name[0] == 'K' && name[1] == 'P')
				name += 3;
			int len = strlen(name);
			int dummy[3];
			XCharStruct schar;
redo:
			XQueryTextExtents(dpy, font_struct->fid, name, len,
					&dummy[0], &dummy[1], &dummy[2], &schar);
			if(schar.width > xk[i].w * sn / sd)
			{
				len--;
				goto redo;
			}
			XDrawString(dpy, mykey[i], keygc,
				8 * sn / sd + 8 * (mod & 2),
				26 * sn / sd - (11 * (mod & 1)) * sn / sd,
				name, len);
			break;
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movl $0x0, -0x14(%rbp)
movl $0x0, -0xc(%rbp)
cmpl $0x69, -0xc(%rbp)
jge 0x3bf4
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rdx
leaq 0x15f81(%rip), %rcx     # 0x19b60
cmpq (%rcx,%rdx,8), %rax
jne 0x3be7
jmp 0x3bf4
jmp 0x3be9
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x3bca
cmpl $0x69, -0xc(%rbp)
jne 0x3bff
jmp 0x3edf
movslq -0xc(%rbp), %rcx
leaq 0x5736(%rip), %rax      # 0x9340
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl (%rax), %eax
movl %eax, -0x18(%rbp)
movl $0x0, -0x10(%rbp)
cmpl $0x8, -0x10(%rbp)
jge 0x3ca2
movslq -0x10(%rbp), %rcx
leaq 0x1a342(%rip), %rax     # 0x1df70
shlq $0x6, %rcx
addq %rcx, %rax
movl (%rax), %eax
cmpl -0x18(%rbp), %eax
jne 0x3c3e
jmp 0x3ca2
movslq -0x10(%rbp), %rcx
leaq 0x1a327(%rip), %rax     # 0x1df70
shlq $0x6, %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
cmpl -0x18(%rbp), %eax
jne 0x3c5a
jmp 0x3ca2
movslq -0x10(%rbp), %rcx
leaq 0x1a30b(%rip), %rax     # 0x1df70
shlq $0x6, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
cmpl -0x18(%rbp), %eax
jne 0x3c76
jmp 0x3ca2
movslq -0x10(%rbp), %rcx
leaq 0x1a2ef(%rip), %rax     # 0x1df70
shlq $0x6, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
cmpl -0x18(%rbp), %eax
jne 0x3c92
jmp 0x3ca2
jmp 0x3c94
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x3c1d
movq 0x15d67(%rip), %rax     # 0x19a10
movq %rax, -0x20(%rbp)
cmpl $0x8, -0x10(%rbp)
jge 0x3cec
movl 0x1628f(%rip), %eax     # 0x19f48
movl -0x10(%rbp), %ecx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
andl %ecx, %eax
cmpl $0x0, %eax
je 0x3cea
movslq -0x10(%rbp), %rcx
leaq 0x1a279(%rip), %rax     # 0x1df50
movl (%rax,%rcx,4), %eax
cmpl -0xc(%rbp), %eax
jne 0x3cea
movq 0x15d3a(%rip), %rax     # 0x19a20
movq %rax, -0x20(%rbp)
jmp 0x3cec
movl $0x0, -0x14(%rbp)
cmpl $0x4, -0x14(%rbp)
jge 0x3edf
movslq -0x14(%rbp), %rcx
leaq 0x16248(%rip), %rax     # 0x19f50
shlq $0xb, %rcx
addq %rcx, %rax
movslq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x28(%rbp)
cmpl $0x0, -0x14(%rbp)
jne 0x3d4e
cmpq $0x0, -0x28(%rbp)
jne 0x3d4e
cmpl $0x5e, -0x18(%rbp)
jne 0x3d4e
movq 0x15ac3(%rip), %rdi     # 0x197f8
movslq -0xc(%rbp), %rcx
leaq 0x15e20(%rip), %rax     # 0x19b60
movq (%rax,%rcx,8), %rsi
callq 0x22a0
jmp 0x3ecf
cmpq $0x0, -0x28(%rbp)
jne 0x3d5a
jmp 0x3ed1
callq 0x23e0
movq (%rax), %rax
movq -0x28(%rbp), %rcx
movsbl (%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x200, %eax            # imm = 0x200
cmpl $0x0, %eax
je 0x3d7f
jmp 0x3ed1
cmpl $0x0, -0x14(%rbp)
jne 0x3da6
cmpl $0x5e, -0x18(%rbp)
jne 0x3da6
movq 0x15a66(%rip), %rdi     # 0x197f8
movslq -0xc(%rbp), %rcx
leaq 0x15dc3(%rip), %rax     # 0x19b60
movq (%rax,%rcx,8), %rsi
callq 0x2340
movq -0x28(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x4b, %eax
jne 0x3dcb
movq -0x28(%rbp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x50, %eax
jne 0x3dcb
movq -0x28(%rbp), %rax
addq $0x3, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
callq 0x20d0
movl %eax, -0x2c(%rbp)
movq 0x15a1a(%rip), %rdi     # 0x197f8
movq 0x15c33(%rip), %rax     # 0x19a18
movq 0x8(%rax), %rsi
movq -0x28(%rbp), %rdx
movl -0x2c(%rbp), %ecx
leaq -0x38(%rbp), %r8
leaq -0x38(%rbp), %r9
addq $0x4, %r9
leaq -0x38(%rbp), %r10
addq $0x8, %r10
leaq -0x44(%rbp), %rax
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x22d0
movswl -0x40(%rbp), %eax
movl %eax, -0x48(%rbp)
movslq -0xc(%rbp), %rcx
leaq 0x5518(%rip), %rax      # 0x9340
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
imull 0x15bf7(%rip), %eax     # 0x19a30
cltd
idivl 0x15bf4(%rip)           # 0x19a34
movl %eax, %ecx
movl -0x48(%rbp), %eax
cmpl %ecx, %eax
jle 0x3e54
movl -0x2c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x3dd7
movq 0x1599d(%rip), %rdi     # 0x197f8
movslq -0xc(%rbp), %rcx
leaq 0x15cfa(%rip), %rax     # 0x19b60
movq (%rax,%rcx,8), %rsi
movq -0x20(%rbp), %rax
movq %rax, -0x50(%rbp)
movl 0x15bb8(%rip), %eax     # 0x19a30
shll $0x3, %eax
cltd
idivl 0x15bb2(%rip)           # 0x19a34
movl %eax, %ecx
movl -0x14(%rbp), %eax
andl $0x2, %eax
shll $0x3, %eax
addl %eax, %ecx
imull $0x1a, 0x15b9a(%rip), %eax # 0x19a30
cltd
idivl 0x15b97(%rip)           # 0x19a34
movl %eax, %r8d
movl -0x14(%rbp), %eax
andl $0x1, %eax
imull $0xb, %eax, %eax
imull 0x15b80(%rip), %eax     # 0x19a30
cltd
idivl 0x15b7d(%rip)           # 0x19a34
movq -0x50(%rbp), %rdx
subl %eax, %r8d
movq -0x28(%rbp), %r9
movl -0x2c(%rbp), %eax
movl %eax, (%rsp)
callq 0x2280
jmp 0x3edf
jmp 0x3ed1
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x3cf3
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)