// File: /workspace/github_c_makefile_star2_O1/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 0x2542
movl %edi, %ebp
jle 0x238a
movq 0x8(%rbx), %r14
leaq 0xca1(%rip), %rsi       # 0x3004
movq %r14, %rdi
callq 0x2100
testl %eax, %eax
je 0x2562
leaq 0xc8d(%rip), %rsi       # 0x3007
movq %r14, %rdi
callq 0x2100
testl %eax, %eax
je 0x256a
xorl %edi, %edi
xorl %esi, %esi
callq 0x2090
movq %rax, 0x3d3e(%rip)      # 0x60d8
movq %rax, %rdi
callq 0x2030
testl %eax, %eax
jne 0x254a
movq 0x3d27(%rip), %rdi      # 0x60d8
callq 0x20b0
movq %rax, %rdi
callq 0x20a0
movq %rax, 0x3d1b(%rip)      # 0x60e0
addl $-0x2, %ebp
movq 0x8(%rbx), %r14
addq $0x10, %rbx
movl $0x10, %r15d
leaq 0x3503(%rip), %r12      # 0x58e0
movq -0x10(%r15,%r12), %rsi
movq %r14, %rdi
callq 0x2100
testl %eax, %eax
je 0x240e
addq $0x18, %r15
cmpq $0x2e0, %r15            # imm = 0x2E0
jne 0x23dd
leaq 0xc30(%rip), %rsi       # 0x3032
movl $0x1, %edi
xorl %eax, %eax
callq 0x2110
movl -0x4(%r15,%r12), %eax
cmpl $-0x1, %eax
je 0x2430
cmpl %eax, %ebp
jl 0x2556
jle 0x2430
leaq 0xbf6(%rip), %rdi       # 0x301f
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 0x2518
movb $0x21, 0x20(%rsp)
movq 0x3c82(%rip), %rdi      # 0x60d8
leaq 0x10a7(%rip), %rcx      # 0x3504
xorl %esi, %esi
movl $0x10, %edx
callq 0x2050
movq 0x3c68(%rip), %rdi      # 0x60d8
movl %eax, %esi
xorl %edx, %edx
callq 0x20e0
testq %rax, %rax
je 0x2483
movl 0x8(%rax), %eax
jmp 0x2488
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 0x24b7
leaq 0x10(%rsp), %rdi
movl %ebp, %esi
movq %rbx, %rdx
callq *%rax
testb %al, %al
je 0x256f
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 0x3bf4(%rip), %rdi      # 0x60d8
movq 0x3bf5(%rip), %rax      # 0x60e0
movl (%rax), %edx
xorl %esi, %esi
movl $0x100000, %ecx         # imm = 0x100000
callq 0x2080
movq 0x3bd8(%rip), %rdi      # 0x60d8
movl %eax, %esi
callq 0x2120
testq %rax, %rax
jne 0x2538
movq 0x3bc5(%rip), %rdi      # 0x60d8
callq 0x20c0
movq 0x3bb9(%rip), %rdi      # 0x60d8
testq %rdi, %rdi
je 0x2529
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 0x250c
movq %rbx, %rdi
callq 0x2226
leaq 0xb6d(%rip), %rsi       # 0x30be
jmp 0x2402
leaq 0xaad(%rip), %rsi       # 0x300a
jmp 0x2402
movq %rbx, %rdi
callq 0x2203
callq 0x21a5
leaq 0xe05(%rip), %rsi       # 0x337b
jmp 0x2402