// File: /workspace/github_c_makefile_star2_O2/tudurom[P]windowchef/wm.c
// Function: main
int main(int argc, char *argv[])
{
	int opt;
	char *config_path = malloc(MAXLEN * sizeof(char));
	config_path[0] = '\0';
	while ((opt = getopt(argc, argv, "hvc:")) != -1) {
		switch (opt) {
			case 'h':
				usage(argv[0]);
				break;
			case 'c':
				snprintf(config_path, MAXLEN * sizeof(char), "%s", optarg);
				break;
			case 'v':
				version();
				break;
		}
	}
	atexit(cleanup);

	register_event_handlers();
	register_ipc_handlers();
	load_defaults();

	if (setup() < 0)
		errx(EXIT_FAILURE, "error connecting to X");
	/* if not set, get path of the rc file */
	if (config_path[0] == '\0') {
		char *xdg_home = getenv("XDG_CONFIG_HOME");
		if (xdg_home != NULL)
			snprintf(config_path, MAXLEN * sizeof(char), "%s/%s/%s", xdg_home, __NAME__, __CONFIG_NAME__);
		else
			snprintf(config_path, MAXLEN * sizeof(char), "%s/%s/%s/%s", getenv("HOME"), ".config",
					__NAME__, __CONFIG_NAME__);
	}

	signal(SIGCHLD, handle_child);

	/* execute config file */
	load_config(config_path);
	run();

	free(config_path);

	return exit_code;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rsi, %r14
movl %edi, %ebp
movl $0x100, %edi            # imm = 0x100
callq 0x31a0
movq %rax, %r13
movb $0x0, (%rax)
leaq 0x594d(%rip), %r15      # 0x9190
movq 0x879e(%rip), %rbx      # 0xbfe8
leaq 0x597b(%rip), %r12      # 0x91cc
movl %ebp, %edi
movq %r14, %rsi
movq %r15, %rdx
callq 0x3160
cmpl $0x63, %eax
je 0x387b
cmpl $-0x1, %eax
je 0x3892
cmpl $0x76, %eax
je 0x3fdc
cmpl $0x68, %eax
jne 0x3851
jmp 0x4031
movq (%rbx), %rcx
movl $0x100, %esi            # imm = 0x100
movq %r13, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0x30a0
jmp 0x3851
leaq 0x808(%rip), %rdi       # 0x40a1
callq 0x8040
xorl %eax, %eax
leaq 0x8b39(%rip), %rcx      # 0xc3e0
cmpq $0x3c0, %rax            # imm = 0x3C0
je 0x38ba
andq $0x0, (%rax,%rcx)
addq $0x8, %rax
jmp 0x38a7
leaq 0x88d(%rip), %rax       # 0x414e
movq %rax, 0x8bd0(%rip)      # 0xc498
leaq 0xa35(%rip), %rax       # 0x4304
movq %rax, 0x8b92(%rip)      # 0xc468
leaq 0xaa1(%rip), %rax       # 0x437e
movq %rax, 0x8b34(%rip)      # 0xc418
leaq 0xacc(%rip), %rax       # 0x43b7
movq %rax, 0x8b8e(%rip)      # 0xc480
leaq 0xe11(%rip), %rax       # 0x470a
movq %rax, 0x8b78(%rip)      # 0xc478
leaq 0xe2c(%rip), %rax       # 0x4733
movq %rax, 0x8b62(%rip)      # 0xc470
leaq 0xe6f(%rip), %rax       # 0x4784
movq %rax, 0x8bcc(%rip)      # 0xc4e8
leaq 0xeef(%rip), %rax       # 0x4812
movq %rax, 0x8b66(%rip)      # 0xc490
leaq 0xf64(%rip), %rax       # 0x4895
movq %rax, 0x8b80(%rip)      # 0xc4b8
leaq 0xf6d(%rip), %rax       # 0x48ac
movq %rax, 0x8ae2(%rip)      # 0xc428
leaq 0xf7f(%rip), %rax       # 0x48cc
movq %rax, 0x8adc(%rip)      # 0xc430
leaq 0xfd1(%rip), %rax       # 0x492c
movq %rax, 0x8a9e(%rip)      # 0xc400
leaq 0x2c15(%rip), %rax      # 0x657e
movq %rax, 0x8eb0(%rip)      # 0xc820
leaq 0x2d3a(%rip), %rax      # 0x66b1
movq %rax, 0x8eaa(%rip)      # 0xc828
leaq 0x2dd0(%rip), %rax      # 0x6755
movq %rax, 0x8ea4(%rip)      # 0xc830
leaq 0x2ef9(%rip), %rax      # 0x688c
movq %rax, 0x8e9e(%rip)      # 0xc838
leaq 0x2fa7(%rip), %rax      # 0x6948
movq %rax, 0x8e98(%rip)      # 0xc840
leaq 0x2fff(%rip), %rax      # 0x69ae
movq %rax, 0x8e92(%rip)      # 0xc848
leaq 0x302d(%rip), %rax      # 0x69ea
movq %rax, 0x8e8c(%rip)      # 0xc850
leaq 0x3077(%rip), %rax      # 0x6a42
movq %rax, 0x8e86(%rip)      # 0xc858
leaq 0x30c1(%rip), %rax      # 0x6a9a
movq %rax, 0x8e80(%rip)      # 0xc860
leaq 0x31d7(%rip), %rax      # 0x6bbe
movq %rax, 0x8e7a(%rip)      # 0xc868
leaq 0x32bf(%rip), %rax      # 0x6cb4
movq %rax, 0x8e74(%rip)      # 0xc870
leaq 0x3320(%rip), %rax      # 0x6d23
movq %rax, 0x8e6e(%rip)      # 0xc878
leaq 0x33d0(%rip), %rax      # 0x6de1
movq %rax, 0x8e68(%rip)      # 0xc880
leaq 0x348d(%rip), %rax      # 0x6eac
movq %rax, 0x8e62(%rip)      # 0xc888
leaq 0x35cd(%rip), %rax      # 0x6ffa
movq %rax, 0x8e5c(%rip)      # 0xc890
leaq 0x361a(%rip), %rax      # 0x7055
movq %rax, 0x8e56(%rip)      # 0xc898
leaq 0x3662(%rip), %rax      # 0x70ab
movq %rax, 0x8e50(%rip)      # 0xc8a0
leaq 0x36a7(%rip), %rax      # 0x70fe
movq %rax, 0x8e4a(%rip)      # 0xc8a8
leaq 0x3705(%rip), %rax      # 0x716a
movq %rax, 0x8e44(%rip)      # 0xc8b0
leaq 0x3ae0(%rip), %rax      # 0x7553
movq %rax, 0x8e3e(%rip)      # 0xc8b8
leaq 0x3ae8(%rip), %rax      # 0x7569
movq %rax, 0x8e38(%rip)      # 0xc8c0
leaq 0x3ae9(%rip), %rax      # 0x7578
movq %rax, 0x8e32(%rip)      # 0xc8c8
leaq 0x3af4(%rip), %rax      # 0x7591
movq %rax, 0x8e2c(%rip)      # 0xc8d0
leaq 0x3af7(%rip), %rax      # 0x75a2
movq %rax, 0x8e26(%rip)      # 0xc8d8
leaq 0x3b35(%rip), %rax      # 0x75ee
movq %rax, 0x8e20(%rip)      # 0xc8e0
leaq 0x3b30(%rip), %rax      # 0x75f7
movq %rax, 0x8e1a(%rip)      # 0xc8e8
leaq 0x3b2b(%rip), %rax      # 0x7600
movq %rax, 0x8e14(%rip)      # 0xc8f0
leaq 0x3b57(%rip), %rax      # 0x763a
movq %rax, 0x8e0e(%rip)      # 0xc8f8
leaq 0x3b90(%rip), %rax      # 0x7681
movq %rax, 0x8e08(%rip)      # 0xc900
leaq 0x3b92(%rip), %rax      # 0x7691
movq %rax, 0x8e02(%rip)      # 0xc908
movw $0x5, 0x8c91(%rip)      # 0xc7a0
movabsq $0x3936380097a293, %rax # imm = 0x3936380097A293
movq %rax, 0x8c88(%rip)      # 0xc7a8
andl $0x0, 0x8c7b(%rip)      # 0xc7a2
xorl %eax, %eax
movb %al, 0x8c77(%rip)       # 0xc7a6
movaps 0x54da(%rip), %xmm0     # 0x9010
movups %xmm0, 0x8c73(%rip)     # 0xc7b0
movw $0x1, 0x8c7a(%rip)      # 0xc7c0
movb %al, 0x8c76(%rip)       # 0xc7c2
movl $0x1010101, 0x8c6d(%rip) # imm = 0x1010101
movabsq $0x400000002, %rcx      # imm = 0x400000002
movq %rcx, 0x8c61(%rip)      # 0xc7c8
movl $0x3, 0x8c5f(%rip)      # 0xc7d0
movw $0x40, 0x8c5a(%rip)     # 0xc7d4
movb %al, 0x8c56(%rip)       # 0xc7d6
leaq 0x8d8d(%rip), %rsi      # 0xc914
xorl %edi, %edi
callq 0x3250
movq %rax, 0x8823(%rip)      # 0xc3b8
movq %rax, %rdi
callq 0x3090
testl %eax, %eax
jne 0x4053
movq 0x880c(%rip), %rdi      # 0xc3b8
callq 0x3320
movq %rax, %rdi
callq 0x3280
movq %rax, 0x8c18(%rip)      # 0xc7d8
andq $0x0, 0x8c18(%rip)      # 0xc7e0
leaq 0x1c(%rsp), %rcx
movl $0x180000, (%rcx)       # imm = 0x180000
movq 0x87de(%rip), %r14      # 0xc3b8
movl (%rax), %esi
movq %r14, %rdi
movl $0x800, %edx            # imm = 0x800
callq 0x33e0
movq %r14, %rdi
movl %eax, %esi
callq 0x35d0
testq %rax, %rax
jne 0x405c
pushq $0x1
popq %rdi
movl $0x168, %esi            # imm = 0x168
callq 0x3560
movq %rax, 0x87b0(%rip)      # 0xc3c0
testq %rax, %rax
jne 0x3c2a
leaq 0x5763(%rip), %rdi      # 0x937f
xorl %eax, %eax
callq 0x3110
movq 0x8796(%rip), %rax      # 0xc3c0
movq %r13, 0x10(%rsp)
movq 0x8782(%rip), %rdi      # 0xc3b8
movq %rax, %rsi
callq 0x3240
movq 0x877b(%rip), %rdi      # 0xc3c0
movq %rax, %rsi
xorl %edx, %edx
callq 0x3300
movq 0x876a(%rip), %r14      # 0xc3c0
movq 0x8b7b(%rip), %rax      # 0xc7d8
movl (%rax), %ebp
callq 0x3230
movq %r14, %rdi
movl %ebp, %esi
movl %eax, %edx
callq 0x3640
movq 0x8749(%rip), %rdi      # 0xc3c0
movq 0x8b5a(%rip), %rax      # 0xc7d8
movl (%rax), %esi
leaq 0x5534(%rip), %rcx      # 0x91bb
pushq $0x2
popq %rdx
callq 0x3460
movq 0x872a(%rip), %rdi      # 0xc3c0
xorl %esi, %esi
xorl %edx, %edx
callq 0x35b0
movq 0x871a(%rip), %rdi      # 0xc3c0
pushq $0xa
popq %rdx
xorl %esi, %esi
callq 0x3060
leaq 0x20(%rsp), %r14
andq $0x0, (%r14)
movq 0x8700(%rip), %rdi      # 0xc3c0
movl 0x8c4e(%rip), %esi      # 0xc914
pushq $0x1
popq %rdx
movq %r14, %rcx
callq 0x3050
movq 0x86e8(%rip), %rdi      # 0xc3c0
movl 0x20(%rdi), %eax
movl %eax, (%r14)
movl 0x7c(%rdi), %eax
movl %eax, 0x4(%r14)
movl 0x2c(%rdi), %eax
movl %eax, 0x8(%r14)
movl 0x38(%rdi), %eax
movl %eax, 0xc(%r14)
movl 0x40(%rdi), %eax
movl %eax, 0x10(%r14)
movl 0x84(%rdi), %eax
movl %eax, 0x14(%r14)
movl 0x128(%rdi), %eax
movl %eax, 0x18(%r14)
movq 0x110(%rdi), %rax
movq %rax, 0x1c(%r14)
movl 0x6c(%rdi), %eax
movl %eax, 0x24(%r14)
movl 0x74(%rdi), %eax
movl %eax, 0x28(%r14)
movl 0x80(%rdi), %eax
movl %eax, 0x2c(%r14)
movl 0xd4(%rdi), %eax
movl %eax, 0x30(%r14)
movl 0x9c(%rdi), %eax
movl %eax, 0x34(%r14)
movl 0xd8(%rdi), %eax
movl %eax, 0x38(%r14)
movl 0xd0(%rdi), %eax
movl %eax, 0x3c(%r14)
movl 0x48(%rdi), %eax
movl %eax, 0x40(%r14)
movl 0x34(%rdi), %eax
movl %eax, 0x44(%r14)
movl 0x8ba7(%rip), %esi      # 0xc914
pushq $0x12
popq %rdx
leaq 0x20(%rsp), %rcx
callq 0x3540
movq 0x863f(%rip), %rdi      # 0xc3c0
movq 0x8a50(%rip), %rax      # 0xc7d8
movl (%rax), %edx
movl %edx, %esi
callq 0x32b0
movl $0xff7f, %edi           # imm = 0xFF7F
callq 0x7d19
movw %ax, 0x8a46(%rip)       # 0xc7e8
movl $0xffe5, %edi           # imm = 0xFFE5
callq 0x7d19
movw %ax, 0x8a37(%rip)       # 0xc7ea
movl $0xff14, %edi           # imm = 0xFF14
callq 0x7d19
movw %ax, 0x8a28(%rip)       # 0xc7ec
cmpw $0x0, 0x8a1e(%rip)      # 0xc7ea
jne 0x3dd7
movw $0x2, 0x8a13(%rip)      # 0xc7ea
movq 0x85da(%rip), %rdi      # 0xc3b8
callq 0x33f0
leaq 0x7f76(%rip), %r13      # 0xbd60
xorl %ebp, %ebp
pushq $0x1f
popq %r12
leaq 0x89f9(%rip), %rbx      # 0xc7f0
cmpq $0x10, %rbp
je 0x3e49
movq (%r13), %r14
movq 0x85b0(%rip), %r15      # 0xc3b8
movq %r14, %rdi
callq 0x32d0
movzwl %ax, %edx
movq %r15, %rdi
xorl %esi, %esi
movq %r14, %rcx
callq 0x3130
movq 0x8591(%rip), %rdi      # 0xc3b8
movl %eax, %esi
xorl %edx, %edx
callq 0x3400
movl %r12d, %ecx
testq %rax, %rax
je 0x3e3b
movl 0x8(%rax), %ecx
movl %ecx, (%rbp,%rbx)
addq $0x4, %rbp
addq $0x8, %r13
jmp 0x3df7
movq 0x8568(%rip), %rdi      # 0xc3b8
movq 0x8181(%rip), %rsi      # 0xbfd8
callq 0x31b0
cmpb $0x0, 0x8(%rax)
je 0x3e89
movq %rax, %r14
callq 0x5e32
movzbl 0xa(%r14), %ebx
movq 0x8542(%rip), %rdi      # 0xc3b8
movq 0x895b(%rip), %rax      # 0xc7d8
movl (%rax), %esi
pushq $0xf
popq %rdx
callq 0x3170
jmp 0x3e8c
pushq $-0x1
popq %rbx
movq 0x10(%rsp), %r15
movl %ebx, 0x8975(%rip)      # 0xc80c
movl 0x891e(%rip), %r14d     # 0xc7bc
movq %r14, %rdi
callq 0x31a0
movq %rax, 0x8953(%rip)      # 0xc800
xorl %ecx, %ecx
leaq 0x852a(%rip), %rbx      # 0xc3e0
cmpq %rcx, %r14
je 0x3ec4
movb $0x0, (%rax,%rcx)
incq %rcx
jmp 0x3eb6
cmpb $0x0, (%r15)
jne 0x3f30
leaq 0x52da(%rip), %rdi      # 0x91ab
callq 0x34a0
testq %rax, %rax
je 0x3ef2
leaq 0x52e4(%rip), %rdx      # 0x91c6
leaq 0x52d2(%rip), %r8       # 0x91bb
leaq 0x52ce(%rip), %r9       # 0x91be
jmp 0x3f1e
leaq 0x52bd(%rip), %rdi      # 0x91b6
callq 0x34a0
leaq 0x52b9(%rip), %rcx      # 0x91be
movq %rcx, (%rsp)
leaq 0x52b3(%rip), %rdx      # 0x91c3
leaq 0x52b8(%rip), %r8       # 0x91cf
leaq 0x529d(%rip), %r9       # 0x91bb
movl $0x100, %esi            # imm = 0x100
movq %r15, %rdi
movq %rax, %rcx
xorl %eax, %eax
callq 0x30a0
leaq -0x72b(%rip), %rsi      # 0x380c
pushq $0x11
popq %rdi
callq 0x3470
callq 0x3630
cmpl $-0x1, %eax
je 0x4075
testl %eax, %eax
je 0x407c
callq 0x5804
movb $0x0, 0x89af(%rip)      # 0xc910
andl $0x0, 0x8448(%rip)      # 0xc3b0
movq 0x8449(%rip), %rdi      # 0xc3b8
callq 0x33f0
movq 0x843d(%rip), %rdi      # 0xc3b8
callq 0x33c0
testq %rax, %rax
je 0x3fb6
movq %rax, %r14
movzbl (%rax), %eax
cmpl %eax, 0x887b(%rip)      # 0xc80c
jne 0x3f9b
callq 0x5e32
movb (%r14), %al
andb $0x7f, %al
movzbl %al, %eax
movq (%rbx,%rax,8), %rax
testq %rax, %rax
je 0x3fae
movq %r14, %rdi
callq *%rax
movq %r14, %rdi
callq 0x32c0
cmpb $0x1, 0x8953(%rip)      # 0xc910
jne 0x3f68
movq %r15, %rdi
callq 0x32c0
movl 0x83e3(%rip), %eax      # 0xc3b0
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x800d(%rip), %r14      # 0xbff0
movq (%r14), %rdi
leaq 0x520c(%rip), %rsi      # 0x91f9
leaq 0x51c7(%rip), %rdx      # 0x91bb
leaq 0x51fd(%rip), %rcx      # 0x91f8
xorl %eax, %eax
callq 0x3680
movq (%r14), %rcx
leaq 0x51f4(%rip), %rdi      # 0x9200
pushq $0x29
popq %rsi
pushq $0x1
popq %rbx
movq %rbx, %rdx
callq 0x3650
movq (%r14), %rcx
leaq 0x5206(%rip), %rdi      # 0x922a
pushq $0x1f
popq %rsi
movq %rbx, %rdx
callq 0x3650
jmp 0x404c
movq (%r14), %rdx
movq 0x7fb5(%rip), %rax      # 0xbff0
movq (%rax), %rdi
leaq 0x5192(%rip), %rsi      # 0x91d7
xorl %eax, %eax
callq 0x3680
xorl %edi, %edi
callq 0x3140
leaq 0x513b(%rip), %rsi      # 0x9195
jmp 0x406b
movq %rax, %rdi
callq 0x32c0
leaq 0x52e9(%rip), %rsi      # 0x9354
pushq $0x1
popq %rdi
xorl %eax, %eax
callq 0x35c0
pushq $0x1
popq %rdi
xorl %esi, %esi
jmp 0x409a
callq 0x30b0
movq %r15, %rdi
movq %r15, %rsi
xorl %edx, %edx
xorl %eax, %eax
callq 0x3180
leaq 0x5355(%rip), %rsi      # 0x93ec
pushq $0x1
popq %rdi
xorl %eax, %eax
callq 0x3420