// File: /workspace/github_c_makefile_star2_O0/howerj[P]eweb/eweb.c
// Function: eweb_get_form_values
static int eweb_get_form_values(eweb_os_t *w, eweb_os_hit_args_t *args, char *body) {
	assert(w);
	assert(args);
	assert(body);
	long t = 0, alloc = FORM_VALUE_BLOCK;
	char *saveptr = NULL;
	char *token = eweb_strtok(body, "&", &saveptr);

	args->form_values = eweb_calloc_or_die(w, sizeof(eweb_form_value_t), alloc);
	if (!(args->form_values))
		goto fail;

	while (token) {
		const size_t token_length = strlen(token) + 1;
		char *tmp = eweb_malloc_or_die(w, token_length);
		if (!tmp)
			goto fail;
		memcpy(tmp, token, token_length);
		if (eweb_url_decode(w, tmp) != EWEB_OK) {
			w->log(w, EWEB_ERROR, "url decode failed");
			eweb_free(w, tmp);
			goto fail;
		}

		size_t i = 0;
		const size_t tlen = strlen(tmp);
		for (i = 0; i < tlen; i++)
			if (tmp[i] == '=')
				break;

		if (i < tlen) {
			if (alloc <= t) {
				const long newsize = alloc + FORM_VALUE_BLOCK;
				void *fv = eweb_realloc_or_die(w, args->form_values, newsize * sizeof(eweb_form_value_t));
				if (!fv) {
					eweb_free(w, tmp);
					goto fail;
				}
				args->form_values = fv;
				memset(args->form_values + alloc, 0, FORM_VALUE_BLOCK * sizeof(eweb_form_value_t));
				alloc = newsize;
			}

			if (!(args->form_values[t].data = eweb_malloc_or_die(w, strlen(tmp) + 1))) {
				eweb_free(w, tmp);
				goto fail;
			}
			memcpy(args->form_values[t].data, tmp, tlen + 1);
			args->form_values[t].name = args->form_values[t].data;
			args->form_values[t].value = args->form_values[t].data + 1 + i;
			args->form_values[t++].data[i] = 0;
		}

		token = eweb_strtok(NULL, "&", &saveptr);
		eweb_free(w, tmp);
	}
	args->form_value_counter = t;
	return EWEB_OK;
fail:
	eweb_clear_form_values(w, args);
	return EWEB_ERROR;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x47f0
jmp 0x480f
leaq 0x2d3e(%rip), %rdi      # 0x7535
leaq 0x314a(%rip), %rsi      # 0x7948
movl $0x33, %edx
leaq 0x3aba(%rip), %rcx      # 0x82c4
callq 0x2100
cmpq $0x0, -0x18(%rbp)
je 0x4818
jmp 0x4837
leaq 0x31da(%rip), %rdi      # 0x79f9
leaq 0x3122(%rip), %rsi      # 0x7948
movl $0x34, %edx
leaq 0x3a92(%rip), %rcx      # 0x82c4
callq 0x2100
cmpq $0x0, -0x20(%rbp)
je 0x4840
jmp 0x485f
leaq 0x3ac1(%rip), %rdi      # 0x8308
leaq 0x30fa(%rip), %rsi      # 0x7948
movl $0x35, %edx
leaq 0x3a6a(%rip), %rcx      # 0x82c4
callq 0x2100
movq $0x0, -0x28(%rbp)
movq $0xa, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x20(%rbp), %rdi
leaq 0x3a8b(%rip), %rsi      # 0x830d
leaq -0x38(%rbp), %rdx
callq 0x5710
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rdx
movl $0x18, %esi
callq 0x4df0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x18(%rbp), %rax
cmpq $0x0, 0x20(%rax)
jne 0x48bc
jmp 0x4b4b
jmp 0x48be
cmpq $0x0, -0x40(%rbp)
je 0x4b36
movq -0x40(%rbp), %rdi
callq 0x20b0
addq $0x1, %rax
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rdi
movq -0x48(%rbp), %rsi
callq 0x45b0
movq %rax, -0x50(%rbp)
cmpq $0x0, -0x50(%rbp)
jne 0x48f7
jmp 0x4b4b
movq -0x50(%rbp), %rdi
movq -0x40(%rbp), %rsi
movq -0x48(%rbp), %rdx
callq 0x21d0
movq -0x10(%rbp), %rdi
movq -0x50(%rbp), %rsi
callq 0x4f00
cmpl $0x0, %eax
je 0x4948
movq -0x10(%rbp), %rax
movq 0x50(%rax), %rcx
movq -0x10(%rbp), %rdi
movl $0x1, %esi
leaq 0x39dd(%rip), %rdx      # 0x830f
movb $0x0, %al
callq *%rcx
movq -0x10(%rbp), %rdi
movq -0x50(%rbp), %rsi
callq 0x5130
jmp 0x4b4b
movq $0x0, -0x58(%rbp)
movq -0x50(%rbp), %rdi
callq 0x20b0
movq %rax, -0x60(%rbp)
movq $0x0, -0x58(%rbp)
movq -0x58(%rbp), %rax
cmpq -0x60(%rbp), %rax
jae 0x4992
movq -0x50(%rbp), %rax
movq -0x58(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x3d, %eax
jne 0x4982
jmp 0x4992
jmp 0x4984
movq -0x58(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x58(%rbp)
jmp 0x4965
movq -0x58(%rbp), %rax
cmpq -0x60(%rbp), %rax
jae 0x4b0c
movq -0x30(%rbp), %rax
cmpq -0x28(%rbp), %rax
jg 0x4a19
movq -0x30(%rbp), %rax
addq $0xa, %rax
movq %rax, -0x68(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rsi
imulq $0x18, -0x68(%rbp), %rdx
callq 0x5290
movq %rax, -0x70(%rbp)
cmpq $0x0, -0x70(%rbp)
jne 0x49e9
movq -0x10(%rbp), %rdi
movq -0x50(%rbp), %rsi
callq 0x5130
jmp 0x4b4b
movq -0x70(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rdi
imulq $0x18, -0x30(%rbp), %rax
addq %rax, %rdi
xorl %esi, %esi
movl $0xf0, %edx
callq 0x2130
movq -0x68(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x50(%rbp), %rdi
callq 0x20b0
movq -0x78(%rbp), %rdi
movq %rax, %rsi
addq $0x1, %rsi
callq 0x45b0
movq -0x18(%rbp), %rcx
movq 0x20(%rcx), %rcx
imulq $0x18, -0x28(%rbp), %rdx
addq %rdx, %rcx
movq %rax, 0x10(%rcx)
cmpq $0x0, %rax
jne 0x4a66
movq -0x10(%rbp), %rdi
movq -0x50(%rbp), %rsi
callq 0x5130
jmp 0x4b4b
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
imulq $0x18, -0x28(%rbp), %rcx
addq %rcx, %rax
movq 0x10(%rax), %rdi
movq -0x50(%rbp), %rsi
movq -0x60(%rbp), %rdx
addq $0x1, %rdx
callq 0x21d0
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
imulq $0x18, -0x28(%rbp), %rcx
addq %rcx, %rax
movq 0x10(%rax), %rcx
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
imulq $0x18, -0x28(%rbp), %rdx
addq %rdx, %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
imulq $0x18, -0x28(%rbp), %rcx
addq %rcx, %rax
movq 0x10(%rax), %rcx
addq $0x1, %rcx
addq -0x58(%rbp), %rcx
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
imulq $0x18, -0x28(%rbp), %rdx
addq %rdx, %rax
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x28(%rbp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, -0x28(%rbp)
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movq -0x58(%rbp), %rcx
movb $0x0, (%rax,%rcx)
xorl %eax, %eax
movl %eax, %edi
leaq 0x37f6(%rip), %rsi      # 0x830d
leaq -0x38(%rbp), %rdx
callq 0x5710
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rdi
movq -0x50(%rbp), %rsi
callq 0x5130
jmp 0x48be
movq -0x28(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x30(%rax)
movl $0x0, -0x4(%rbp)
jmp 0x4b5f
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x5640
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x80, %rsp
popq %rbp
retq
nopl (%rax,%rax)