// File: /workspace/github_c_makefile_star2_O2/tudurom[P]windowchef/client.c
// Function: main
int main(int argc, char **argv)
{
	int i;
	int command_argc;
	char **command_argv;

	if (argc == 1) {
		usage(argv[0], EXIT_FAILURE);
	} else if (argc > 1) {
		if (strcmp(argv[1], "-h") == 0)
			usage(argv[0], EXIT_SUCCESS);
		else if (strcmp(argv[1], "-v") == 0)
			version();
	}

	init_xcb(&conn);

	/* argc - program name - command to send */
	command_argc = argc - 2;
	command_argv = argv + 2;

	i = 0;
	while (i < NR_IPC_COMMANDS && strcmp(argv[1], c[i].string_command) != 0)
		i++;

	if (i < NR_IPC_COMMANDS) {
		if (c[i].argc != -1) {
			if (command_argc < c[i].argc)
				errx(EXIT_FAILURE, "not enough arguments");
			else if (command_argc > c[i].argc)
				warnx("too many arguments");
		}
		if (c[i].argc == -1 || command_argc == c[i].argc)
			send_command(&c[i], command_argc, command_argv);

	} else {
		errx(EXIT_FAILURE, "no such command");
	}

	if (conn != NULL)
		xcb_disconnect(conn);

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x40, %rsp
movq %rsi, %rbx
cmpl $0x1, %edi
je 0x247b
movl %edi, %ebp
jle 0x22b1
movq 0x8(%rbx), %rax
cmpb $0x2d, (%rax)
jne 0x22b1
cmpb $0x68, 0x1(%rax)
jne 0x22a1
cmpb $0x0, 0x2(%rax)
je 0x24a1
cmpb $0x76, 0x1(%rax)
jne 0x22b1
cmpb $0x0, 0x2(%rax)
je 0x24ab
xorl %edi, %edi
xorl %esi, %esi
callq 0x2090
movq %rax, 0x3e17(%rip)      # 0x60d8
movq %rax, %rdi
callq 0x2030
testl %eax, %eax
jne 0x2486
movq 0x3e00(%rip), %rdi      # 0x60d8
callq 0x20b0
movq %rax, %rdi
callq 0x20a0
movq %rax, 0x3df4(%rip)      # 0x60e0
addl $-0x2, %ebp
movq 0x8(%rbx), %r14
addq $0x10, %rbx
pushq $-0x10
popq %rcx
leaq 0x35df(%rip), %r15      # 0x58e0
leaq 0x18(%rcx), %r12
cmpq $0x2d8, %r12            # imm = 0x2D8
je 0x246a
movq 0x10(%rcx,%r15), %rsi
movq %r14, %rdi
callq 0x2100
movq %r12, %rcx
testl %eax, %eax
jne 0x2301
movl 0x4(%r12,%r15), %eax
cmpl $-0x1, %eax
je 0x2362
cmpl %eax, %ebp
jl 0x248f
jle 0x234d
leaq 0xcd8(%rip), %rdi       # 0x3019
xorl %eax, %eax
callq 0x2040
movl 0x4(%r12,%r15), %eax
cmpl $-0x1, %eax
sete %cl
cmpl %eax, %ebp
sete %al
orb %cl, %al
cmpb $0x1, %al
jne 0x242c
movb $0x21, 0x20(%rsp)
movq 0x3d6a(%rip), %rdi      # 0x60d8
leaq 0x1189(%rip), %rcx      # 0x34fe
pushq $0x10
popq %rdx
xorl %esi, %esi
callq 0x2050
movq 0x3d52(%rip), %rdi      # 0x60d8
movl %eax, %esi
xorl %edx, %edx
callq 0x20e0
testq %rax, %rax
je 0x2399
movl 0x8(%rax), %eax
jmp 0x239c
pushq $0x1f
popq %rax
movl %eax, 0x28(%rsp)
movb $0x20, 0x21(%rsp)
movl (%r12,%r15), %eax
movl %eax, 0xc(%rsp)
movq 0x8(%r12,%r15), %rax
testq %rax, %rax
je 0x23cb
leaq 0x10(%rsp), %rdi
movl %ebp, %esi
movq %rbx, %rdx
callq *%rax
testb %al, %al
je 0x2498
movl 0x1c(%rsp), %eax
leaq 0x20(%rsp), %r8
movl %eax, 0x1c(%r8)
movl 0xc(%rsp), %eax
movl %eax, 0xc(%r8)
movq 0x10(%rsp), %rax
movq %rax, 0x10(%r8)
movl 0x18(%rsp), %eax
movl %eax, 0x18(%r8)
movq 0x3ce0(%rip), %rdi      # 0x60d8
movq 0x3ce1(%rip), %rax      # 0x60e0
movl (%rax), %edx
xorl %esi, %esi
movl $0x100000, %ecx         # imm = 0x100000
callq 0x2080
movq 0x3cc4(%rip), %rdi      # 0x60d8
movl %eax, %esi
callq 0x2120
testq %rax, %rax
jne 0x244c
movq 0x3cb1(%rip), %rdi      # 0x60d8
callq 0x20c0
movq 0x3ca5(%rip), %rdi      # 0x60d8
testq %rdi, %rdi
je 0x243d
callq 0x2130
xorl %eax, %eax
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0x3b9d(%rip), %rcx      # 0x5ff0
movq (%rcx), %rdi
movzbl 0x1(%rax), %edx
leaq 0x10ae(%rip), %rsi      # 0x350f
xorl %eax, %eax
callq 0x2150
jmp 0x2420
leaq 0xbbb(%rip), %rsi       # 0x302c
pushq $0x1
popq %rdi
xorl %eax, %eax
callq 0x2110
movq (%rbx), %rdi
pushq $0x1
popq %rsi
callq 0x2505
leaq 0xc2b(%rip), %rsi       # 0x30b8
jmp 0x2471
leaq 0xb6e(%rip), %rsi       # 0x3004
jmp 0x2471
leaq 0xed6(%rip), %rsi       # 0x3375
jmp 0x2471
movq (%rbx), %rdi
xorl %esi, %esi
callq 0x2505
movq 0x3b3e(%rip), %r14      # 0x5ff0
movq (%r14), %rdi
leaq 0xba7(%rip), %rsi       # 0x3063
leaq 0xba7(%rip), %rdx       # 0x306a
leaq 0xb98(%rip), %rcx       # 0x3062
xorl %eax, %eax
callq 0x2150
movq (%r14), %rcx
leaq 0xb93(%rip), %rdi       # 0x306e
pushq $0x29
popq %rsi
pushq $0x1
popq %rbx
movq %rbx, %rdx
callq 0x2140
movq (%r14), %rcx
leaq 0xba5(%rip), %rdi       # 0x3098
pushq $0x1f
popq %rsi
movq %rbx, %rdx
callq 0x2140
xorl %edi, %edi
callq 0x2060