// File: pelrun[P]aft/optionParser.c
// Function: addArgv
void addArgv(int *argc, char ***argv, char *newArg)
{
	int i;
	int sizeH;
	int sizeS = 0;
	char *newArgv;
	char **newArgv2;
	char *ptr;

	for (i=0;i<(*argc);i++)
		sizeS += strlen((*argv)[i])+1;
	sizeH = ((*argc)+2)*sizeof(char*);

	newArgv = (char*)malloc(sizeH+sizeS+strlen(newArg)+1);

	if (*argv != NULL && (*argc != 0))
		memcpy(newArgv+sizeH, (*argv)[0], sizeS);
	memcpy(newArgv+sizeH+sizeS,newArg,strlen(newArg)+1);
	ptr = newArgv+sizeH;
	newArgv2 = (char**)newArgv;
	for (i=0;i<((*argc)+1);i++)
	{
		newArgv2[i]=ptr;
		if (i != (*argc))
			ptr += strlen((*argv)[i])+1;
	}
	newArgv2[(*argc)+1] = NULL;

	if (*argv != NULL && (*argc != 0))
		free(*argv);

	*argv = newArgv2;
	(*argc)++;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl $0x0, -0x24(%rbp)
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl (%rcx), %eax
jge 0xd15d
movq -0x10(%rbp), %rax
movq (%rax), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x4160
movq %rax, %rcx
addq $0x1, %rcx
movslq -0x24(%rbp), %rax
addq %rcx, %rax
movl %eax, -0x24(%rbp)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0xd122
movq -0x8(%rbp), %rax
movl (%rax), %eax
addl $0x2, %eax
cltq
shlq $0x3, %rax
movl %eax, -0x20(%rbp)
movl -0x20(%rbp), %eax
addl -0x24(%rbp), %eax
cltq
movq %rax, -0x48(%rbp)
movq -0x18(%rbp), %rdi
callq 0x4160
movq -0x48(%rbp), %rdi
addq %rax, %rdi
addq $0x1, %rdi
callq 0x44b0
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, (%rax)
je 0xd1c9
movq -0x8(%rbp), %rax
cmpl $0x0, (%rax)
je 0xd1c9
movq -0x30(%rbp), %rdi
movslq -0x20(%rbp), %rax
addq %rax, %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq (%rax), %rsi
movslq -0x24(%rbp), %rdx
callq 0x4260
movq -0x30(%rbp), %rax
movslq -0x20(%rbp), %rcx
addq %rcx, %rax
movslq -0x24(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x58(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x18(%rbp), %rdi
callq 0x4160
movq -0x58(%rbp), %rdi
movq -0x50(%rbp), %rsi
movq %rax, %rdx
addq $0x1, %rdx
callq 0x4260
movq -0x30(%rbp), %rax
movslq -0x20(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x40(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x38(%rbp)
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movq -0x8(%rbp), %rcx
movl (%rcx), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
jge 0xd27a
movq -0x40(%rbp), %rdx
movq -0x38(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x1c(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl (%rcx), %eax
je 0xd26d
movq -0x10(%rbp), %rax
movq (%rax), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x4160
addq $0x1, %rax
addq -0x40(%rbp), %rax
movq %rax, -0x40(%rbp)
jmp 0xd26f
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0xd222
movq -0x38(%rbp), %rax
movq -0x8(%rbp), %rcx
movl (%rcx), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq $0x0, (%rax,%rcx,8)
movq -0x10(%rbp), %rax
cmpq $0x0, (%rax)
je 0xd2b1
movq -0x8(%rbp), %rax
cmpl $0x0, (%rax)
je 0xd2b1
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x4420
movq -0x38(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)