// File: /workspace/github_c_makefile_star2_O3/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 $0x58, %rsp
movq %rsi, %r14
movl %edi, %ebp
movl $0x100, %edi            # imm = 0x100
callq 0x31b0
movq %rax, %rbx
movb $0x0, (%rax)
leaq 0x5895(%rip), %r15      # 0x9178
movq 0x86fe(%rip), %r13      # 0xbfe8
leaq 0x58c3(%rip), %r12      # 0x91b4
movl %ebp, %edi
movq %r14, %rsi
movq %r15, %rdx
callq 0x3170
cmpl $0x62, %eax
jle 0x3920
cmpl $0x63, %eax
jne 0x3927
movq (%r13), %rcx
movl $0x100, %esi            # imm = 0x100
movq %rbx, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0x30b0
jmp 0x38f1
cmpl $-0x1, %eax
jne 0x38f1
jmp 0x393d
cmpl $0x76, %eax
je 0x4094
cmpl $0x68, %eax
jne 0x38f1
movq %r14, %rdi
callq 0x378e
leaq 0x7a9(%rip), %rdi       # 0x40ed
callq 0x86b0
leaq 0x8a90(%rip), %rdi      # 0xc3e0
xorl %r15d, %r15d
movl $0x3c0, %edx            # imm = 0x3C0
xorl %esi, %esi
callq 0x3090
leaq 0x837(%rip), %rax       # 0x419d
movq %rax, 0x8b2b(%rip)      # 0xc498
leaq 0x9f4(%rip), %rax       # 0x4368
movq %rax, 0x8aed(%rip)      # 0xc468
leaq 0xa78(%rip), %rax       # 0x43fa
movq %rax, 0x8a8f(%rip)      # 0xc418
leaq 0xaab(%rip), %rax       # 0x443b
movq %rax, 0x8ae9(%rip)      # 0xc480
leaq 0xe1a(%rip), %rax       # 0x47b8
movq %rax, 0x8ad3(%rip)      # 0xc478
leaq 0xe6a(%rip), %rax       # 0x4816
movq %rax, 0x8abd(%rip)      # 0xc470
leaq 0xebc(%rip), %rax       # 0x4876
movq %rax, 0x8b27(%rip)      # 0xc4e8
leaq 0xf75(%rip), %rax       # 0x493d
movq %rax, 0x8ac1(%rip)      # 0xc490
leaq 0xff8(%rip), %rax       # 0x49ce
movq %rax, 0x8adb(%rip)      # 0xc4b8
leaq 0x1001(%rip), %rax      # 0x49e5
movq %rax, 0x8a3d(%rip)      # 0xc428
leaq 0x1024(%rip), %rax      # 0x4a16
movq %rax, 0x8a37(%rip)      # 0xc430
leaq 0x107c(%rip), %rax      # 0x4a7c
movq %rax, 0x89f9(%rip)      # 0xc400
leaq 0x2e08(%rip), %rax      # 0x6816
movq %rax, 0x8e0b(%rip)      # 0xc820
leaq 0x2f55(%rip), %rax      # 0x6971
movq %rax, 0x8e05(%rip)      # 0xc828
leaq 0x3013(%rip), %rax      # 0x6a3d
movq %rax, 0x8dff(%rip)      # 0xc830
leaq 0x3157(%rip), %rax      # 0x6b8f
movq %rax, 0x8df9(%rip)      # 0xc838
leaq 0x322e(%rip), %rax      # 0x6c74
movq %rax, 0x8df3(%rip)      # 0xc840
leaq 0x32b3(%rip), %rax      # 0x6d07
movq %rax, 0x8ded(%rip)      # 0xc848
leaq 0x3318(%rip), %rax      # 0x6d7a
movq %rax, 0x8de7(%rip)      # 0xc850
leaq 0x338b(%rip), %rax      # 0x6dfb
movq %rax, 0x8de1(%rip)      # 0xc858
leaq 0x33fe(%rip), %rax      # 0x6e7c
movq %rax, 0x8ddb(%rip)      # 0xc860
leaq 0x3545(%rip), %rax      # 0x6fd1
movq %rax, 0x8dd5(%rip)      # 0xc868
leaq 0x363a(%rip), %rax      # 0x70d4
movq %rax, 0x8dcf(%rip)      # 0xc870
leaq 0x369b(%rip), %rax      # 0x7143
movq %rax, 0x8dc9(%rip)      # 0xc878
leaq 0x374b(%rip), %rax      # 0x7201
movq %rax, 0x8dc3(%rip)      # 0xc880
leaq 0x3808(%rip), %rax      # 0x72cc
movq %rax, 0x8dbd(%rip)      # 0xc888
leaq 0x397e(%rip), %rax      # 0x7450
movq %rax, 0x8db7(%rip)      # 0xc890
leaq 0x39f7(%rip), %rax      # 0x74d7
movq %rax, 0x8db1(%rip)      # 0xc898
leaq 0x3a6a(%rip), %rax      # 0x7558
movq %rax, 0x8dab(%rip)      # 0xc8a0
leaq 0x3ad9(%rip), %rax      # 0x75d5
movq %rax, 0x8da5(%rip)      # 0xc8a8
leaq 0x3b63(%rip), %rax      # 0x766d
movq %rax, 0x8d9f(%rip)      # 0xc8b0
leaq 0x3fe8(%rip), %rax      # 0x7b00
movq %rax, 0x8d99(%rip)      # 0xc8b8
leaq 0x402b(%rip), %rax      # 0x7b51
movq %rax, 0x8d93(%rip)      # 0xc8c0
leaq 0x402c(%rip), %rax      # 0x7b60
movq %rax, 0x8d8d(%rip)      # 0xc8c8
leaq 0x4037(%rip), %rax      # 0x7b79
movq %rax, 0x8d87(%rip)      # 0xc8d0
leaq 0x403a(%rip), %rax      # 0x7b8a
movq %rax, 0x8d81(%rip)      # 0xc8d8
leaq 0x4075(%rip), %rax      # 0x7bd3
movq %rax, 0x8d7b(%rip)      # 0xc8e0
leaq 0x4070(%rip), %rax      # 0x7bdc
movq %rax, 0x8d75(%rip)      # 0xc8e8
leaq 0x406b(%rip), %rax      # 0x7be5
movq %rax, 0x8d6f(%rip)      # 0xc8f0
leaq 0x4097(%rip), %rax      # 0x7c1f
movq %rax, 0x8d69(%rip)      # 0xc8f8
leaq 0x40ca(%rip), %rax      # 0x7c60
movq %rax, 0x8d63(%rip)      # 0xc900
leaq 0x40cc(%rip), %rax      # 0x7c70
movq %rax, 0x8d5d(%rip)      # 0xc908
movw $0x5, 0x8bec(%rip)      # 0xc7a0
movabsq $0x3936380097a293, %rax # imm = 0x3936380097A293
movq %rax, 0x8be3(%rip)      # 0xc7a8
movb %r15b, 0x8bda(%rip)     # 0xc7a6
movl $0x0, 0x8bcc(%rip)      # 0xc7a2
movaps 0x5433(%rip), %xmm0     # 0x9010
movups %xmm0, 0x8bcc(%rip)     # 0xc7b0
movw $0x1, 0x8bd3(%rip)      # 0xc7c0
movb %r15b, 0x8bce(%rip)     # 0xc7c2
movl $0x1010101, 0x8bc5(%rip) # imm = 0x1010101
movabsq $0x400000002, %rax      # imm = 0x400000002
movq %rax, 0x8bb9(%rip)      # 0xc7c8
movl $0x3, 0x8bb7(%rip)      # 0xc7d0
movw $0x40, 0x8bb2(%rip)     # 0xc7d4
movb %r15b, 0x8bad(%rip)     # 0xc7d6
leaq 0x8ce4(%rip), %rsi      # 0xc914
xorl %edi, %edi
callq 0x3260
movq %rax, 0x877a(%rip)      # 0xc3b8
movq %rax, %rdi
callq 0x30a0
testl %eax, %eax
jne 0x4099
movq 0x8763(%rip), %rdi      # 0xc3b8
callq 0x3330
movq %rax, %rdi
callq 0x3290
movq %rax, 0x8b6f(%rip)      # 0xc7d8
movq $0x0, 0x8b6c(%rip) # 0xc7e0
leaq 0xc(%rsp), %rcx
movl $0x180000, (%rcx)       # imm = 0x180000
movq 0x8732(%rip), %r15      # 0xc3b8
movl (%rax), %esi
movq %r15, %rdi
movl $0x800, %edx            # imm = 0x800
callq 0x33f0
movq %r15, %rdi
movl %eax, %esi
callq 0x35e0
testq %rax, %rax
jne 0x40a2
movl $0x1, %edi
movl $0x168, %esi            # imm = 0x168
callq 0x3570
movq %rax, 0x8702(%rip)      # 0xc3c0
testq %rax, %rax
jne 0x3cd8
leaq 0x569d(%rip), %rdi      # 0x9367
xorl %eax, %eax
callq 0x3120
movq 0x86e8(%rip), %rax      # 0xc3c0
movq 0x86d9(%rip), %rdi      # 0xc3b8
movq %rax, %rsi
callq 0x3250
movq 0x86d2(%rip), %rdi      # 0xc3c0
movq %rax, %rsi
xorl %edx, %edx
callq 0x3310
movq 0x86c1(%rip), %r15      # 0xc3c0
movq 0x8ad2(%rip), %rax      # 0xc7d8
movl (%rax), %ebp
callq 0x3240
movq %r15, %rdi
movl %ebp, %esi
movl %eax, %edx
callq 0x3650
movq 0x86a0(%rip), %rdi      # 0xc3c0
movq 0x8ab1(%rip), %rax      # 0xc7d8
movl (%rax), %esi
leaq 0x5473(%rip), %rcx      # 0x91a3
movl $0x2, %edx
callq 0x3470
movq 0x867f(%rip), %rdi      # 0xc3c0
xorl %esi, %esi
xorl %edx, %edx
callq 0x35c0
movq 0x866f(%rip), %rdi      # 0xc3c0
xorl %esi, %esi
movl $0xa, %edx
callq 0x3060
leaq 0x10(%rsp), %r15
movq $0x0, (%r15)
movq 0x8650(%rip), %rdi      # 0xc3c0
movl 0x8b9e(%rip), %esi      # 0xc914
movl $0x1, %edx
movq %r15, %rcx
callq 0x3050
movq 0x8636(%rip), %rdi      # 0xc3c0
movl 0x20(%rdi), %eax
movl %eax, (%r15)
movl 0x7c(%rdi), %eax
movl %eax, 0x4(%r15)
movl 0x2c(%rdi), %eax
movl %eax, 0x8(%r15)
movl 0x38(%rdi), %eax
movl %eax, 0xc(%r15)
movl 0x40(%rdi), %eax
movl %eax, 0x10(%r15)
movl 0x84(%rdi), %eax
movl %eax, 0x14(%r15)
movl 0x128(%rdi), %eax
movl %eax, 0x18(%r15)
movq 0x110(%rdi), %rax
movq %rax, 0x1c(%r15)
movl 0x6c(%rdi), %eax
movl %eax, 0x24(%r15)
movl 0x74(%rdi), %eax
movl %eax, 0x28(%r15)
movl 0x80(%rdi), %eax
movl %eax, 0x2c(%r15)
movl 0xd4(%rdi), %eax
movl %eax, 0x30(%r15)
movl 0x9c(%rdi), %eax
movl %eax, 0x34(%r15)
movl 0xd8(%rdi), %eax
movl %eax, 0x38(%r15)
movl 0xd0(%rdi), %eax
movl %eax, 0x3c(%r15)
movl 0x48(%rdi), %eax
movl %eax, 0x40(%r15)
movl 0x34(%rdi), %eax
movl %eax, 0x44(%r15)
movl 0x8af5(%rip), %esi      # 0xc914
leaq 0x10(%rsp), %rcx
movl $0x12, %edx
callq 0x3550
movq 0x858b(%rip), %rdi      # 0xc3c0
movq 0x899c(%rip), %rax      # 0xc7d8
movl (%rax), %edx
movl %edx, %esi
callq 0x32c0
movl $0xff7f, %edi           # imm = 0xFF7F
callq 0x835d
movw %ax, 0x8992(%rip)       # 0xc7e8
movl $0xffe5, %edi           # imm = 0xFFE5
callq 0x835d
movw %ax, 0x8983(%rip)       # 0xc7ea
movl $0xff14, %edi           # imm = 0xFF14
callq 0x835d
movw %ax, 0x8974(%rip)       # 0xc7ec
cmpw $0x0, 0x896a(%rip)      # 0xc7ea
jne 0x3e8b
movw $0x2, 0x895f(%rip)      # 0xc7ea
movq 0x8526(%rip), %rdi      # 0xc3b8
callq 0x3400
leaq 0x7ec2(%rip), %r13      # 0xbd60
xorl %ebp, %ebp
leaq 0x8949(%rip), %r14      # 0xc7f0
movq (%r13), %r15
movq 0x8506(%rip), %r12      # 0xc3b8
movq %r15, %rdi
callq 0x32e0
movzwl %ax, %edx
movq %r12, %rdi
xorl %esi, %esi
movq %r15, %rcx
callq 0x3140
movq 0x84e7(%rip), %rdi      # 0xc3b8
movl %eax, %esi
xorl %edx, %edx
callq 0x3410
testq %rax, %rax
je 0x3ee4
movl 0x8(%rax), %eax
jmp 0x3ee9
movl $0x1f, %eax
movl %eax, (%rbp,%r14)
addq $0x4, %rbp
addq $0x8, %r13
cmpq $0x10, %rbp
jne 0x3ea7
movq 0x84b5(%rip), %rdi      # 0xc3b8
movq 0x80ce(%rip), %rsi      # 0xbfd8
callq 0x31c0
cmpb $0x0, 0x8(%rax)
je 0x3f3e
movq %rax, %r15
callq 0x6040
movzbl 0xa(%r15), %ebp
movq 0x848f(%rip), %rdi      # 0xc3b8
movq 0x88a8(%rip), %rax      # 0xc7d8
movl (%rax), %esi
movl $0xf, %edx
callq 0x3180
jmp 0x3f43
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
leaq 0x8496(%rip), %r14      # 0xc3e0
movl %ebp, 0x88bc(%rip)      # 0xc80c
movl 0x8865(%rip), %r15d     # 0xc7bc
movq %r15, %rdi
callq 0x31b0
movq %rax, 0x889a(%rip)      # 0xc800
testq %r15, %r15
je 0x3f78
movq %rax, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x3090
cmpb $0x0, (%rbx)
jne 0x3fe3
leaq 0x520f(%rip), %rdi      # 0x9193
callq 0x34b0
testq %rax, %rax
je 0x3fa5
leaq 0x5219(%rip), %rdx      # 0x91ae
leaq 0x5207(%rip), %r8       # 0x91a3
leaq 0x5203(%rip), %r9       # 0x91a6
jmp 0x3fd1
leaq 0x51f2(%rip), %rdi      # 0x919e
callq 0x34b0
leaq 0x51ee(%rip), %rcx      # 0x91a6
movq %rcx, (%rsp)
leaq 0x51e8(%rip), %rdx      # 0x91ab
leaq 0x51ed(%rip), %r8       # 0x91b7
leaq 0x51d2(%rip), %r9       # 0x91a3
movl $0x100, %esi            # imm = 0x100
movq %rbx, %rdi
movq %rax, %rcx
xorl %eax, %eax
callq 0x30b0
leaq -0x73e(%rip), %rsi      # 0x38ac
movl $0x11, %edi
callq 0x3480
callq 0x3640
cmpl $-0x1, %eax
je 0x40bd
testl %eax, %eax
je 0x40c6
callq 0x5982
movb $0x0, 0x88fa(%rip)      # 0xc910
movl $0x0, 0x8390(%rip)      # 0xc3b0
movq 0x8391(%rip), %rdi      # 0xc3b8
callq 0x3400
movq 0x8385(%rip), %rdi      # 0xc3b8
callq 0x33d0
testq %rax, %rax
je 0x406e
movq %rax, %r15
movzbl (%rax), %eax
cmpl %eax, 0x87c3(%rip)      # 0xc80c
jne 0x4053
callq 0x6040
movb (%r15), %al
andb $0x7f, %al
movzbl %al, %eax
movq (%r14,%rax,8), %rax
testq %rax, %rax
je 0x4066
movq %r15, %rdi
callq *%rax
movq %r15, %rdi
callq 0x32d0
cmpb $0x1, 0x889b(%rip)      # 0xc910
jne 0x4020
movq %rbx, %rdi
callq 0x32d0
movl 0x832b(%rip), %eax      # 0xc3b0
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x3730
leaq 0x50dd(%rip), %rsi      # 0x917d
jmp 0x40b1
movq %rax, %rdi
callq 0x32d0
leaq 0x528b(%rip), %rsi      # 0x933c
movl $0x1, %edi
xorl %eax, %eax
callq 0x35d0
movl $0x1, %edi
xorl %esi, %esi
jmp 0x40e6
callq 0x30c0
movq %rbx, %rdi
movq %rbx, %rsi
xorl %edx, %edx
xorl %eax, %eax
callq 0x3190
leaq 0x52f3(%rip), %rsi      # 0x93d4
movl $0x1, %edi
xorl %eax, %eax
callq 0x3430