// File: /workspace/github_c_makefile_star2_O0/ToniWestbrook[P]paladin/kopen.c
// Function: cmd2argv
static char **cmd2argv(const char *cmd)
{
	int i, beg, end, argc;
	char **argv, *str;
	end = strlen(cmd);
	for (i = end - 1; i >= 0; --i)
		if (!isspace(cmd[i])) break;
	end = i + 1;
	for (beg = 0; beg < end; ++beg)
		if (!isspace(cmd[beg])) break;
	if (beg == end) return 0;
	for (i = beg + 1, argc = 0; i < end; ++i)
		if (isspace(cmd[i]) && !isspace(cmd[i-1]))
			++argc;
	argv = (char**)calloc(argc + 2, sizeof(void*));
	argv[0] = str = (char*)calloc(end - beg + 1, 1);
	strncpy(argv[0], cmd + beg, end - beg);
	for (i = argc = 1; i < end - beg; ++i)
		if (isspace(str[i])) str[i] = 0;
		else if (str[i] && str[i-1] == 0) argv[argc++] = &str[i];
	return argv;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x30f0
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jl 0x6efb
callq 0x3310
movq (%rax), %rax
movq -0x10(%rbp), %rcx
movslq -0x14(%rbp), %rdx
movsbl (%rcx,%rdx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x2000, %eax           # imm = 0x2000
cmpl $0x0, %eax
jne 0x6eee
jmp 0x6efb
jmp 0x6ef0
movl -0x14(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x6ec1
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0x6f47
callq 0x3310
movq (%rax), %rax
movq -0x10(%rbp), %rcx
movslq -0x18(%rbp), %rdx
movsbl (%rcx,%rdx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x2000, %eax           # imm = 0x2000
cmpl $0x0, %eax
jne 0x6f3a
jmp 0x6f47
jmp 0x6f3c
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x6f0b
movl -0x18(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jne 0x6f5c
movq $0x0, -0x8(%rbp)
jmp 0x710e
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
movl $0x0, -0x20(%rbp)
movl -0x14(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0x6fd9
callq 0x3310
movq (%rax), %rax
movq -0x10(%rbp), %rcx
movslq -0x14(%rbp), %rdx
movsbl (%rcx,%rdx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x2000, %eax           # imm = 0x2000
cmpl $0x0, %eax
je 0x6fcc
callq 0x3310
movq (%rax), %rax
movq -0x10(%rbp), %rcx
movl -0x14(%rbp), %edx
subl $0x1, %edx
movslq %edx, %rdx
movsbl (%rcx,%rdx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x2000, %eax           # imm = 0x2000
cmpl $0x0, %eax
jne 0x6fcc
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x6fce
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x6f6c
movl -0x20(%rbp), %eax
addl $0x2, %eax
movslq %eax, %rdi
movl $0x8, %esi
leaq 0x306a1(%rip), %rdx     # 0x3768f
movl $0xf6, %ecx
leaq 0x3078d(%rip), %r8      # 0x37787
callq 0x31bf0
movq %rax, -0x28(%rbp)
movl -0x1c(%rbp), %eax
subl -0x18(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rdi
movl $0x1, %esi
leaq 0x30674(%rip), %rdx     # 0x3768f
movl $0xf7, %ecx
leaq 0x30760(%rip), %r8      # 0x37787
callq 0x31bf0
movq %rax, %rcx
movq %rcx, -0x30(%rbp)
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movq -0x28(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rsi
movslq -0x18(%rbp), %rax
addq %rax, %rsi
movl -0x1c(%rbp), %eax
subl -0x18(%rbp), %eax
movslq %eax, %rdx
callq 0x3120
movl $0x1, -0x20(%rbp)
movl $0x1, -0x14(%rbp)
movl -0x14(%rbp), %eax
movl -0x1c(%rbp), %ecx
subl -0x18(%rbp), %ecx
cmpl %ecx, %eax
jge 0x7106
callq 0x3310
movq (%rax), %rax
movq -0x30(%rbp), %rcx
movslq -0x14(%rbp), %rdx
movsbl (%rcx,%rdx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x2000, %eax           # imm = 0x2000
cmpl $0x0, %eax
je 0x70ac
movq -0x30(%rbp), %rax
movslq -0x14(%rbp), %rcx
movb $0x0, (%rax,%rcx)
jmp 0x70f6
movq -0x30(%rbp), %rax
movslq -0x14(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x0, %eax
je 0x70f4
movq -0x30(%rbp), %rax
movl -0x14(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x0, %eax
jne 0x70f4
movq -0x30(%rbp), %rdx
movslq -0x14(%rbp), %rax
addq %rax, %rdx
movq -0x28(%rbp), %rax
movl -0x20(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x20(%rbp)
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
jmp 0x70f6
jmp 0x70f8
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x7068
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)