// File: /workspace/github_c_makefile_star2_O0/gitluin[P]sara/src/sara.c
// Function: applyrules
void
applyrules(client* c){
	const char* class, * instance;
	int i;
	const rule* r;
	XTextProperty tp;
	XClassHint ch = { NULL, NULL };

	c->isfloat = c->desks = 0;

	XGetWMName(dis, c->win, &tp);
	XGetClassHint(dis, c->win, &ch);
	class = ch.res_class ? ch.res_class : "broken";
	instance = ch.res_name  ? ch.res_name  : "NULL";

	for (i=0;i < TABLENGTH(rules);i++){
		r = &rules[i];

		if ((!r->title || (tp.value && strstr(r->title, (const char*) tp.value)))
		&& (!r->class || strstr(class, r->class))
		&& (!r->instance || strstr(instance, r->instance))){
			c->isfloat = r->isfloat;
			c->isfull = r->isfull;
			c->desks |= r->desks;

			for EACHMON(mhead){
				if (im->num == r->monitor){
					c->mon = im;
					break;
				}
			}
		}
	}

	if (ch.res_class)
		XFree(ch.res_class);
	if (ch.res_name)
		XFree(ch.res_name);

	c->desks = c->desks ? c->desks : c->mon->seldesks;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
leaq -0x58(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x2070
movq -0x8(%rbp), %rax
movl $0x0, 0x1c(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x10(%rax)
movq 0x4f47(%rip), %rdi      # 0xb500
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rsi
leaq -0x48(%rbp), %rdx
callq 0x23b0
movq 0x4f2f(%rip), %rdi      # 0xb500
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rsi
leaq -0x58(%rbp), %rdx
callq 0x2210
cmpq $0x0, -0x50(%rbp)
je 0x65f3
movq -0x50(%rbp), %rax
movq %rax, -0x60(%rbp)
jmp 0x6600
leaq 0x1b81(%rip), %rax      # 0x817b
movq %rax, -0x60(%rbp)
jmp 0x6600
movq -0x60(%rbp), %rax
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x58(%rbp)
je 0x6619
movq -0x58(%rbp), %rax
movq %rax, -0x68(%rbp)
jmp 0x6626
leaq 0x1b62(%rip), %rax      # 0x8182
movq %rax, -0x68(%rbp)
jmp 0x6626
movq -0x68(%rbp), %rax
movq %rax, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movslq -0x1c(%rbp), %rax
cmpq $0x1, %rax
jae 0x6765
movslq -0x1c(%rbp), %rcx
leaq 0x4722(%rip), %rax      # 0xad70
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x668a
cmpq $0x0, -0x48(%rbp)
je 0x6755
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x48(%rbp), %rsi
callq 0x2260
cmpq $0x0, %rax
je 0x6755
movq -0x28(%rbp), %rax
cmpq $0x0, (%rax)
je 0x66ae
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rax
movq (%rax), %rsi
callq 0x2260
cmpq $0x0, %rax
je 0x6755
movq -0x28(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x66d4
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rsi
callq 0x2260
cmpq $0x0, %rax
je 0x6755
movq -0x28(%rbp), %rax
movl 0x1c(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x10(%rax)
movq -0x28(%rbp), %rax
movl 0x20(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x18(%rax)
movq -0x28(%rbp), %rax
movl 0x18(%rax), %ecx
movq -0x8(%rbp), %rax
orl 0x1c(%rax), %ecx
movl %ecx, 0x1c(%rax)
movq 0x4ef8(%rip), %rax      # 0xb600
movq %rax, 0x4e09(%rip)      # 0xb518
cmpq $0x0, 0x4e01(%rip)      # 0xb518
je 0x6753
movq 0x4df8(%rip), %rax      # 0xb518
movl 0x20(%rax), %eax
movq -0x28(%rbp), %rcx
cmpl 0x24(%rcx), %eax
jne 0x673d
movq 0x4de5(%rip), %rcx      # 0xb518
movq -0x8(%rbp), %rax
movq %rcx, 0x30(%rax)
jmp 0x6753
jmp 0x673f
movq 0x4dd2(%rip), %rax      # 0xb518
movq 0x48(%rax), %rax
movq %rax, 0x4dc7(%rip)      # 0xb518
jmp 0x670f
jmp 0x6755
jmp 0x6757
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x6635
cmpq $0x0, -0x50(%rbp)
je 0x6775
movq -0x50(%rbp), %rdi
callq 0x2040
cmpq $0x0, -0x58(%rbp)
je 0x6785
movq -0x58(%rbp), %rdi
callq 0x2040
movq -0x8(%rbp), %rax
cmpl $0x0, 0x1c(%rax)
je 0x679b
movq -0x8(%rbp), %rax
movl 0x1c(%rax), %eax
movl %eax, -0x6c(%rbp)
jmp 0x67a9
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rax
movl 0x24(%rax), %eax
movl %eax, -0x6c(%rbp)
movl -0x6c(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x1c(%rax)
addq $0x70, %rsp
popq %rbp
retq
nopl (%rax)