// File: /workspace/github_c_makefile_star2_O3/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 0x2539
movl %edi, %ebp
jle 0x2381
movq 0x8(%rbx), %rax
cmpb $0x2d, (%rax)
jne 0x2381
cmpb $0x68, 0x1(%rax)
jne 0x2371
cmpb $0x0, 0x2(%rax)
je 0x2565
cmpb $0x76, 0x1(%rax)
jne 0x2381
cmpb $0x0, 0x2(%rax)
je 0x256d
xorl %edi, %edi
xorl %esi, %esi
callq 0x2090
movq %rax, 0x3d47(%rip)      # 0x60d8
movq %rax, %rdi
callq 0x2030
testl %eax, %eax
jne 0x2541
movq 0x3d30(%rip), %rdi      # 0x60d8
callq 0x20b0
movq %rax, %rdi
callq 0x20a0
movq %rax, 0x3d24(%rip)      # 0x60e0
addl $-0x2, %ebp
movq 0x8(%rbx), %r14
addq $0x10, %rbx
movl $0x10, %r15d
leaq 0x350c(%rip), %r12      # 0x58e0
movq -0x10(%r15,%r12), %rsi
movq %r14, %rdi
callq 0x2100
testl %eax, %eax
je 0x2405
addq $0x18, %r15
cmpq $0x2e0, %r15            # imm = 0x2E0
jne 0x23d4
leaq 0xc33(%rip), %rsi       # 0x302c
movl $0x1, %edi
xorl %eax, %eax
callq 0x2110
movl -0x4(%r15,%r12), %eax
cmpl $-0x1, %eax
je 0x2441
cmpl %eax, %ebp
jl 0x254d
jle 0x242c
leaq 0xbf9(%rip), %rdi       # 0x3019
xorl %eax, %eax
callq 0x2040
movl -0x4(%r15,%r12), %eax
cmpl $-0x1, %eax
sete %cl
cmpl %eax, %ebp
sete %al
orb %cl, %al
cmpb $0x1, %al
jne 0x250f
movb $0x21, 0x20(%rsp)
movq 0x3c8b(%rip), %rdi      # 0x60d8
leaq 0x10aa(%rip), %rcx      # 0x34fe
xorl %esi, %esi
movl $0x10, %edx
callq 0x2050
movq 0x3c71(%rip), %rdi      # 0x60d8
movl %eax, %esi
xorl %edx, %edx
callq 0x20e0
testq %rax, %rax
je 0x247a
movl 0x8(%rax), %eax
jmp 0x247f
movl $0x1f, %eax
movl %eax, 0x28(%rsp)
movb $0x20, 0x21(%rsp)
movl -0x8(%r15,%r12), %eax
movl %eax, 0xc(%rsp)
movq (%r15,%r12), %rax
testq %rax, %rax
je 0x24ae
leaq 0x10(%rsp), %rdi
movl %ebp, %esi
movq %rbx, %rdx
callq *%rax
testb %al, %al
je 0x2559
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 0x3bfd(%rip), %rdi      # 0x60d8
movq 0x3bfe(%rip), %rax      # 0x60e0
movl (%rax), %edx
xorl %esi, %esi
movl $0x100000, %ecx         # imm = 0x100000
callq 0x2080
movq 0x3be1(%rip), %rdi      # 0x60d8
movl %eax, %esi
callq 0x2120
testq %rax, %rax
jne 0x252f
movq 0x3bce(%rip), %rdi      # 0x60d8
callq 0x20c0
movq 0x3bc2(%rip), %rdi      # 0x60d8
testq %rdi, %rdi
je 0x2520
callq 0x2130
xorl %eax, %eax
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rdi
callq 0x2180
jmp 0x2503
movq %rbx, %rdi
callq 0x2226
leaq 0xb70(%rip), %rsi       # 0x30b8
jmp 0x23f9
leaq 0xab0(%rip), %rsi       # 0x3004
jmp 0x23f9
leaq 0xe15(%rip), %rsi       # 0x3375
jmp 0x23f9
movq %rbx, %rdi
callq 0x2203
callq 0x21a5