// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x30, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpl $0x1, -0x8(%rbp)
jne 0x229f
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movl $0x1, %esi
callq 0x2470
jmp 0x22f2
cmpl $0x1, -0x8(%rbp)
jle 0x22f0
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
leaq 0x1d50(%rip), %rsi      # 0x4004
callq 0x2110
cmpl $0x0, %eax
jne 0x22ce
movq -0x10(%rbp), %rax
movq (%rax), %rdi
xorl %esi, %esi
callq 0x2470
jmp 0x22ee
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
leaq 0x1d2a(%rip), %rsi      # 0x4007
callq 0x2110
cmpl $0x0, %eax
jne 0x22ec
callq 0x24b0
jmp 0x22ee
jmp 0x22f0
jmp 0x22f2
leaq 0x4297(%rip), %rdi      # 0x6590
callq 0x2520
movl -0x8(%rbp), %eax
subl $0x2, %eax
movl %eax, -0x18(%rbp)
movq -0x10(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x20(%rbp)
movl $0x0, -0x14(%rbp)
xorl %eax, %eax
cmpl $0x1e, -0x14(%rbp)
movb %al, -0x21(%rbp)
jge 0x2350
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movslq -0x14(%rbp), %rcx
leaq 0x3d98(%rip), %rax      # 0x60d0
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rsi
callq 0x2110
cmpl $0x0, %eax
setne %al
movb %al, -0x21(%rbp)
movb -0x21(%rbp), %al
testb $0x1, %al
jne 0x2359
jmp 0x2364
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x231a
cmpl $0x1e, -0x14(%rbp)
jge 0x2431
movslq -0x14(%rbp), %rcx
leaq 0x3d57(%rip), %rax      # 0x60d0
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
cmpl $-0x1, 0xc(%rax)
je 0x23df
movl -0x18(%rbp), %eax
movslq -0x14(%rbp), %rdx
leaq 0x3d3c(%rip), %rcx      # 0x60d0
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
cmpl 0xc(%rcx), %eax
jge 0x23b3
movl $0x1, %edi
leaq 0x1c5e(%rip), %rsi      # 0x400a
movb $0x0, %al
callq 0x2120
movl -0x18(%rbp), %eax
movslq -0x14(%rbp), %rdx
leaq 0x3d0f(%rip), %rcx      # 0x60d0
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
cmpl 0xc(%rcx), %eax
jle 0x23db
leaq 0x1c4b(%rip), %rdi      # 0x401f
movb $0x0, %al
callq 0x2040
jmp 0x23dd
jmp 0x23df
movslq -0x14(%rbp), %rcx
leaq 0x3ce6(%rip), %rax      # 0x60d0
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
cmpl $-0x1, 0xc(%rax)
je 0x2411
movl -0x18(%rbp), %eax
movslq -0x14(%rbp), %rdx
leaq 0x3ccb(%rip), %rcx      # 0x60d0
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
cmpl 0xc(%rcx), %eax
jne 0x242f
movslq -0x14(%rbp), %rax
leaq 0x3cb4(%rip), %rdi      # 0x60d0
imulq $0x18, %rax, %rax
addq %rax, %rdi
movl -0x18(%rbp), %esi
movq -0x20(%rbp), %rdx
callq 0x25a0
jmp 0x2444
movl $0x1, %edi
leaq 0x1bf5(%rip), %rsi      # 0x4032
movb $0x0, %al
callq 0x2120
cmpq $0x0, 0x4144(%rip)      # 0x6590
je 0x245a
movq 0x413b(%rip), %rdi      # 0x6590
callq 0x2140
xorl %eax, %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)