// File: /workspace/github_c_makefile_star2_O1/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 0x586d(%rip), %r15      # 0x9150
movq 0x86fe(%rip), %r13      # 0xbfe8
leaq 0x589b(%rip), %r12      # 0x918c
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 0x40c5
cmpl $0x68, %eax
jne 0x38f1
movq %r14, %rdi
callq 0x378e
leaq 0x7da(%rip), %rdi       # 0x411e
callq 0x86c0
leaq 0x8a90(%rip), %rdi      # 0xc3e0
xorl %r15d, %r15d
movl $0x3c0, %edx            # imm = 0x3C0
xorl %esi, %esi
callq 0x3090
leaq 0x868(%rip), %rax       # 0x41ce
movq %rax, 0x8b2b(%rip)      # 0xc498
leaq 0xa27(%rip), %rax       # 0x439b
movq %rax, 0x8aed(%rip)      # 0xc468
leaq 0xaab(%rip), %rax       # 0x442d
movq %rax, 0x8a8f(%rip)      # 0xc418
leaq 0xae4(%rip), %rax       # 0x4474
movq %rax, 0x8ae9(%rip)      # 0xc480
leaq 0xead(%rip), %rax       # 0x484b
movq %rax, 0x8ad3(%rip)      # 0xc478
leaq 0xf02(%rip), %rax       # 0x48ae
movq %rax, 0x8abd(%rip)      # 0xc470
leaq 0xf5d(%rip), %rax       # 0x4917
movq %rax, 0x8b27(%rip)      # 0xc4e8
leaq 0x101c(%rip), %rax      # 0x49e4
movq %rax, 0x8ac1(%rip)      # 0xc490
leaq 0x10aa(%rip), %rax      # 0x4a80
movq %rax, 0x8adb(%rip)      # 0xc4b8
leaq 0x10b3(%rip), %rax      # 0x4a97
movq %rax, 0x8a3d(%rip)      # 0xc428
leaq 0x10dd(%rip), %rax      # 0x4acf
movq %rax, 0x8a37(%rip)      # 0xc430
leaq 0x1141(%rip), %rax      # 0x4b41
movq %rax, 0x89f9(%rip)      # 0xc400
leaq 0x2ed5(%rip), %rax      # 0x68e3
movq %rax, 0x8e0b(%rip)      # 0xc820
leaq 0x3008(%rip), %rax      # 0x6a24
movq %rax, 0x8e05(%rip)      # 0xc828
leaq 0x30ad(%rip), %rax      # 0x6ad7
movq %rax, 0x8dff(%rip)      # 0xc830
leaq 0x31e9(%rip), %rax      # 0x6c21
movq %rax, 0x8df9(%rip)      # 0xc838
leaq 0x32a1(%rip), %rax      # 0x6ce7
movq %rax, 0x8df3(%rip)      # 0xc840
leaq 0x3329(%rip), %rax      # 0x6d7d
movq %rax, 0x8ded(%rip)      # 0xc848
leaq 0x338e(%rip), %rax      # 0x6df0
movq %rax, 0x8de7(%rip)      # 0xc850
leaq 0x3401(%rip), %rax      # 0x6e71
movq %rax, 0x8de1(%rip)      # 0xc858
leaq 0x3474(%rip), %rax      # 0x6ef2
movq %rax, 0x8ddb(%rip)      # 0xc860
leaq 0x35bb(%rip), %rax      # 0x7047
movq %rax, 0x8dd5(%rip)      # 0xc868
leaq 0x36b0(%rip), %rax      # 0x714a
movq %rax, 0x8dcf(%rip)      # 0xc870
leaq 0x3711(%rip), %rax      # 0x71b9
movq %rax, 0x8dc9(%rip)      # 0xc878
leaq 0x3790(%rip), %rax      # 0x7246
movq %rax, 0x8dc3(%rip)      # 0xc880
leaq 0x3810(%rip), %rax      # 0x72d4
movq %rax, 0x8dbd(%rip)      # 0xc888
leaq 0x3986(%rip), %rax      # 0x7458
movq %rax, 0x8db7(%rip)      # 0xc890
leaq 0x3a0a(%rip), %rax      # 0x74ea
movq %rax, 0x8db1(%rip)      # 0xc898
leaq 0x3a7d(%rip), %rax      # 0x756b
movq %rax, 0x8dab(%rip)      # 0xc8a0
leaq 0x3b0a(%rip), %rax      # 0x7606
movq %rax, 0x8da5(%rip)      # 0xc8a8
leaq 0x3b94(%rip), %rax      # 0x769e
movq %rax, 0x8d9f(%rip)      # 0xc8b0
leaq 0x3fd7(%rip), %rax      # 0x7aef
movq %rax, 0x8d99(%rip)      # 0xc8b8
leaq 0x401f(%rip), %rax      # 0x7b45
movq %rax, 0x8d93(%rip)      # 0xc8c0
leaq 0x4020(%rip), %rax      # 0x7b54
movq %rax, 0x8d8d(%rip)      # 0xc8c8
leaq 0x402b(%rip), %rax      # 0x7b6d
movq %rax, 0x8d87(%rip)      # 0xc8d0
leaq 0x402e(%rip), %rax      # 0x7b7e
movq %rax, 0x8d81(%rip)      # 0xc8d8
leaq 0x4069(%rip), %rax      # 0x7bc7
movq %rax, 0x8d7b(%rip)      # 0xc8e0
leaq 0x4064(%rip), %rax      # 0x7bd0
movq %rax, 0x8d75(%rip)      # 0xc8e8
leaq 0x405f(%rip), %rax      # 0x7bd9
movq %rax, 0x8d6f(%rip)      # 0xc8f0
leaq 0x408b(%rip), %rax      # 0x7c13
movq %rax, 0x8d69(%rip)      # 0xc8f8
leaq 0x40bc(%rip), %rax      # 0x7c52
movq %rax, 0x8d63(%rip)      # 0xc900
leaq 0x40be(%rip), %rax      # 0x7c62
movq %rax, 0x8d5d(%rip)      # 0xc908
movb $0x5, 0x8bee(%rip)      # 0xc7a0
movabsq $0x3936380097a293, %rax # imm = 0x3936380097A293
movq %rax, 0x8be5(%rip)      # 0xc7a8
movb %r15b, 0x8bd7(%rip)     # 0xc7a1
movabsq $0x97a29300393638, %rax # imm = 0x97A29300393638
movq %rax, 0x8bd5(%rip)      # 0xc7b0
movb %r15b, 0x8bc4(%rip)     # 0xc7a6
movl $0x0, 0x8bb6(%rip)      # 0xc7a2
movabsq $0xa00000004, %rax      # imm = 0xA00000004
movq %rax, 0x8bbb(%rip)      # 0xc7b8
movw $0x1, 0x8bba(%rip)      # 0xc7c0
movb %r15b, 0x8bb5(%rip)     # 0xc7c2
movl $0x1010101, 0x8bac(%rip) # imm = 0x1010101
movabsq $0x400000002, %rax      # imm = 0x400000002
movq %rax, 0x8ba0(%rip)      # 0xc7c8
movl $0x3, 0x8b9e(%rip)      # 0xc7d0
movw $0x40, 0x8b99(%rip)     # 0xc7d4
movb %r15b, 0x8b94(%rip)     # 0xc7d6
leaq 0x8ccb(%rip), %rsi      # 0xc914
xorl %edi, %edi
callq 0x3260
movq %rax, 0x8761(%rip)      # 0xc3b8
movq %rax, %rdi
callq 0x30a0
testl %eax, %eax
jne 0x40ca
movl %eax, %ebp
movq 0x8748(%rip), %rdi      # 0xc3b8
callq 0x3330
movq %rax, %rdi
callq 0x3290
movq %rax, 0x8b54(%rip)      # 0xc7d8
movq $0x0, 0x8b51(%rip) # 0xc7e0
leaq 0xc(%rsp), %rcx
movl $0x180000, (%rcx)       # imm = 0x180000
movq 0x8717(%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 0x40d3
movl $0x1, %edi
movl $0x168, %esi            # imm = 0x168
callq 0x3570
movq %rax, 0x86e7(%rip)      # 0xc3c0
testq %rax, %rax
jne 0x3cec
leaq 0x565a(%rip), %rdi      # 0x933f
xorl %eax, %eax
callq 0x3120
movl %ebp, 0x8(%rsp)
movq 0x86c1(%rip), %rdi      # 0xc3b8
movq 0x86c2(%rip), %rsi      # 0xc3c0
callq 0x3250
movq 0x86b6(%rip), %rdi      # 0xc3c0
movq %rax, %rsi
xorl %edx, %edx
callq 0x3310
movq 0x86a5(%rip), %r15      # 0xc3c0
movq 0x8ab6(%rip), %rax      # 0xc7d8
movl (%rax), %r12d
callq 0x3240
movq %r15, %rdi
movl %r12d, %esi
movl %eax, %edx
callq 0x3650
movq 0x8682(%rip), %rdi      # 0xc3c0
movq 0x8a93(%rip), %rax      # 0xc7d8
movl (%rax), %esi
leaq 0x542d(%rip), %rcx      # 0x917b
movl $0x2, %edx
callq 0x3470
movq 0x8661(%rip), %rdi      # 0xc3c0
xorl %esi, %esi
xorl %edx, %edx
callq 0x35c0
movq 0x8651(%rip), %rdi      # 0xc3c0
xorl %esi, %esi
movl $0xa, %edx
callq 0x3060
leaq 0x10(%rsp), %r15
movq $0x0, (%r15)
movq 0x8632(%rip), %rdi      # 0xc3c0
movl 0x8b80(%rip), %esi      # 0xc914
movl $0x1, %edx
movq %r15, %rcx
callq 0x3050
movq 0x8618(%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)
movl 0x110(%rdi), %eax
movl %eax, 0x1c(%r15)
movl 0x114(%rdi), %eax
movl %eax, 0x20(%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 0x8ace(%rip), %esi      # 0xc914
leaq 0x10(%rsp), %rcx
movl $0x12, %edx
callq 0x3550
movq 0x8564(%rip), %rdi      # 0xc3c0
movq 0x8975(%rip), %rax      # 0xc7d8
movl (%rax), %edx
movl %edx, %esi
callq 0x32c0
movl $0xff7f, %edi           # imm = 0xFF7F
callq 0x8359
movw %ax, 0x896b(%rip)       # 0xc7e8
movl $0xffe5, %edi           # imm = 0xFFE5
callq 0x8359
movw %ax, 0x895c(%rip)       # 0xc7ea
movl $0xff14, %edi           # imm = 0xFF14
callq 0x8359
movw %ax, 0x894d(%rip)       # 0xc7ec
cmpw $0x0, 0x8943(%rip)      # 0xc7ea
jne 0x3eb2
movw $0x2, 0x8938(%rip)      # 0xc7ea
movq 0x84ff(%rip), %rdi      # 0xc3b8
callq 0x3400
leaq 0x7e9b(%rip), %r13      # 0xbd60
xorl %ebp, %ebp
leaq 0x8922(%rip), %r14      # 0xc7f0
movq (%r13), %r15
movq 0x84df(%rip), %r12      # 0xc3b8
movq %r15, %rdi
callq 0x32e0
movzwl %ax, %edx
movq %r12, %rdi
xorl %esi, %esi
movq %r15, %rcx
callq 0x3140
movq 0x84c0(%rip), %rdi      # 0xc3b8
movl %eax, %esi
xorl %edx, %edx
callq 0x3410
testq %rax, %rax
je 0x3f0b
movl 0x8(%rax), %eax
jmp 0x3f10
movl $0x1f, %eax
movl %eax, (%rbp,%r14)
addq $0x4, %rbp
addq $0x8, %r13
cmpq $0x10, %rbp
jne 0x3ece
movq 0x848e(%rip), %rdi      # 0xc3b8
movq 0x80a7(%rip), %rsi      # 0xbfd8
callq 0x31c0
cmpb $0x0, 0x8(%rax)
je 0x3f65
movq %rax, %r15
callq 0x60ed
movzbl 0xa(%r15), %ebp
movq 0x8468(%rip), %rdi      # 0xc3b8
movq 0x8881(%rip), %rax      # 0xc7d8
movl (%rax), %esi
movl $0xf, %edx
callq 0x3180
jmp 0x3f6a
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
leaq 0x846f(%rip), %r14      # 0xc3e0
movl %ebp, 0x8895(%rip)      # 0xc80c
movl 0x883e(%rip), %r15d     # 0xc7bc
movq %r15, %rdi
callq 0x31b0
movq %rax, 0x8873(%rip)      # 0xc800
testq %r15, %r15
je 0x3f9f
movq %rax, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x3090
cmpl $0x0, 0x8(%rsp)
jne 0x40ca
cmpb $0x0, (%rbx)
jne 0x4015
leaq 0x51b5(%rip), %rdi      # 0x916b
callq 0x34b0
testq %rax, %rax
je 0x3fd7
leaq 0x51bf(%rip), %rdx      # 0x9186
leaq 0x51ad(%rip), %r8       # 0x917b
leaq 0x51a9(%rip), %r9       # 0x917e
jmp 0x4003
leaq 0x5198(%rip), %rdi      # 0x9176
callq 0x34b0
leaq 0x5194(%rip), %rcx      # 0x917e
movq %rcx, (%rsp)
leaq 0x518e(%rip), %rdx      # 0x9183
leaq 0x5193(%rip), %r8       # 0x918f
leaq 0x5178(%rip), %r9       # 0x917b
movl $0x100, %esi            # imm = 0x100
movq %rbx, %rdi
movq %rax, %rcx
xorl %eax, %eax
callq 0x30b0
leaq -0x770(%rip), %rsi      # 0x38ac
movl $0x11, %edi
callq 0x3480
callq 0x3640
cmpl $-0x1, %eax
je 0x40ee
testl %eax, %eax
je 0x40f7
callq 0x5a33
movb $0x0, 0x88c8(%rip)      # 0xc910
movl $0x0, 0x835e(%rip)      # 0xc3b0
movq 0x835f(%rip), %rdi      # 0xc3b8
callq 0x3400
movq 0x8353(%rip), %rdi      # 0xc3b8
callq 0x33d0
testq %rax, %rax
je 0x409f
movq %rax, %r15
movzbl (%rax), %eax
cmpl %eax, 0x8791(%rip)      # 0xc80c
jne 0x4082
callq 0x60ed
movzbl (%r15), %eax
andl $0x7f, %eax
movq (%r14,%rax,8), %rax
testq %rax, %rax
je 0x4097
movq %r15, %rdi
callq *%rax
movq %r15, %rdi
callq 0x32d0
cmpb $0x1, 0x886a(%rip)      # 0xc910
jne 0x4052
movq %rbx, %rdi
callq 0x32d0
movl 0x82fa(%rip), %eax      # 0xc3b0
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x3730
leaq 0x5084(%rip), %rsi      # 0x9155
jmp 0x40e2
movq %rax, %rdi
callq 0x32d0
leaq 0x5232(%rip), %rsi      # 0x9314
movl $0x1, %edi
xorl %eax, %eax
callq 0x35d0
movl $0x1, %edi
xorl %esi, %esi
jmp 0x4117
callq 0x30c0
movq %rbx, %rdi
movq %rbx, %rsi
xorl %edx, %edx
xorl %eax, %eax
callq 0x3190
leaq 0x529a(%rip), %rsi      # 0x93ac
movl $0x1, %edi
xorl %eax, %eax
callq 0x3430