LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/ebiggers[P]mysh/mysh_builtin.c
// Function: execute_builtin
static int execute_builtin(const struct builtin *builtin,
			   const struct list_head *cmd_args,
			   const struct list_head *redirs,
			   unsigned cmd_nargs)
{
	struct orig_fds orig;
	const char *argv[cmd_nargs + 1];
	struct string *s;
	unsigned i;
	int status;
	int ret;

	/* Do redirections for the builtin */
	status = do_redirections(redirs, &orig);
	if (status)
		return status;

	/* Prepare argv for the builtin */
	for (i = 0, s = list_entry(cmd_args->next, struct string, list);
	     i < cmd_nargs;
	     i++, s = list_entry(s->list.next, struct string, list))
	{
		argv[i] = s->chars;
	}
	argv[i] = NULL;

	/* Call the built-in function */
	status = builtin->func(cmd_nargs, argv);

	/* Undo redirections for the builtin, unless this was the 'exec' builtin */
	if (builtin->func != builtin_exec) {
		ret = undo_redirections(&orig);
		if (ret) {
			if (status == 0)
				status = ret;
			mysh_error_with_errno("Failed to restore redirections");
		}
	}
	return status;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %ecx, %r14d
movq %rsi, %r15
movq %rdi, %rbx
movq %rsp, -0x30(%rbp)
leal 0x1(%r14), %eax
movq %rsp, %r12
leaq 0xf(,%rax,8), %rax
andq $-0x10, %rax
subq %rax, %r12
movq %r12, %rsp
leaq -0x3c(%rbp), %rsi
movq %rdx, %rdi
callq 0x5dd5
movl %eax, %r13d
testl %eax, %eax
je 0x25fb
movq -0x30(%rbp), %rsp
movl %r13d, %eax
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %r14d, %eax
xorl %ecx, %ecx
cmpq %rcx, %rax
je 0x2615
movq (%r15), %r15
movq -0x18(%r15), %rdx
movq %rdx, (%r12,%rcx,8)
incq %rcx
jmp 0x2600
andq $0x0, (%r12,%rax,8)
movl %r14d, %edi
movq %r12, %rsi
callq *0x8(%rbx)
movl %eax, %r13d
leaq 0x296(%rip), %rax       # 0x28c3
cmpq %rax, 0x8(%rbx)
je 0x25e5
leaq -0x3c(%rbp), %rdi
callq 0x5d88
testl %eax, %eax
je 0x25e5
testl %r13d, %r13d
cmovel %eax, %r13d
leaq 0x4d33(%rip), %rdi      # 0x7381
xorl %eax, %eax
callq 0x5fb7
jmp 0x25e5
// File: /workspace/github_c_makefile_star2_O2/ebiggers[P]mysh/mysh_builtin.c
// Function: set_pwd
int set_pwd()
{
	char *wd = getcwd(NULL, 0);
	int ret;
	if (wd) {
		const char *setenv_argv[] = {"PWD", wd, NULL};
		ret = builtin_setenv(ARRAY_SIZE(setenv_argv) - 1, setenv_argv);
		free(wd);
	} else {
		mysh_error("getcwd()");
		ret = 1;
	}
	return ret;
}

// Assembly:
pushq %rbp
pushq %rbx
subq $0x18, %rsp
xorl %edi, %edi
xorl %esi, %esi
callq 0x21a0
testq %rax, %rax
je 0x2698
movq %rax, %rbx
leaq 0x4a3a(%rip), %rax      # 0x70af
movq %rsp, %rsi
movq %rax, (%rsi)
movq %rbx, 0x8(%rsi)
andq $0x0, 0x10(%rsi)
pushq $0x2
popq %rdi
callq 0x26b2
movl %eax, %ebp
movq %rbx, %rdi
callq 0x2050
jmp 0x26a9
leaq 0x4a14(%rip), %rdi      # 0x70b3
xorl %eax, %eax
callq 0x5ef8
pushq $0x1
popq %rbp
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ebiggers[P]mysh/mysh_builtin.c
// Function: builtin_setenv
static int builtin_setenv(unsigned argc, const char **argv)
{
	int ret;
	if (argc < 2) {
		mysh_error("usage: setenv VARIABLE VALUE");
		ret = 2;
	} else {
		if (setenv(argv[0], argv[1], 1)) {
			mysh_error_with_errno("setenv %s", argv[0]);
			ret = 1;
		} else {
			insert_shell_param(argv[0], argv[1]);
			ret = 0;
		}
	}
	return ret;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
cmpl $0x1, %edi
ja 0x26ce
leaq 0x4cde(%rip), %rdi      # 0x73a0
xorl %eax, %eax
callq 0x5ef8
pushq $0x2
popq %rbx
jmp 0x270a
movq %rsi, %r14
movq (%rsi), %rdi
movq 0x8(%rsi), %rsi
pushq $0x1
popq %rbx
movl %ebx, %edx
callq 0x20d0
movq (%r14), %rsi
testl %eax, %eax
je 0x26f9
leaq 0x4ccd(%rip), %rdi      # 0x73bd
xorl %eax, %eax
callq 0x5fb7
jmp 0x270a
movq 0x8(%r14), %rax
movq %rsi, %rdi
movq %rax, %rsi
callq 0x44bb
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/ebiggers[P]mysh/mysh_builtin.c
// Function: builtin_alias
static int builtin_alias(unsigned argc, const char **argv)
{
	int ret;
	if (argc == 0) {
		ret = print_all_shell_aliases();
	} else {
		ret = 0;
		do {
			ret |= do_alias(*argv++);
		} while (--argc);
	}
	return ret;
}

// Assembly:
testl %edi, %edi
je 0x27be
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %edi, %r13d
pushq $0x3d
popq %rbp
xorl %r14d, %r14d
xorl %r15d, %r15d
movq (%rbx,%r14,8), %r12
movq %r12, %rdi
movl %ebp, %esi
callq 0x2130
testq %rax, %rax
je 0x278d
movq %rax, %rsi
subq %r12, %rsi
incq %rax
movq %r12, %rdi
movq %rax, %rdx
callq 0x44df
xorl %ecx, %ecx
testb %al, %al
jne 0x27a1
leaq 0x4ac6(%rip), %rdi      # 0x725a
movq %r12, %rsi
xorl %eax, %eax
callq 0x5ef8
pushq $0x1
popq %rcx
orl %ecx, %r15d
incq %r14
cmpl %r14d, %r13d
jne 0x2760
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
jmp 0x49f5
// File: /workspace/github_c_makefile_star2_O2/ebiggers[P]mysh/mysh_builtin.c
// Function: builtin_cd
static int builtin_cd(unsigned argc, const char **argv)
{
	int ret = 1;
	const char *dest_dir;

	if (argc) {
		dest_dir = argv[0];
	} else {
		dest_dir = lookup_shell_param("HOME");
		if (!dest_dir) {
			mysh_error("cd: HOME not set");
			goto out;
		}
	}
	if (chdir(dest_dir) != 0)
		mysh_error_with_errno("cd: %s", dest_dir);
	else
		ret = set_pwd();
out:
	return ret;
}

// Assembly:
pushq %rbx
testl %edi, %edi
je 0x27cf
movq (%rsi), %rbx
jmp 0x27e3
leaq 0x4aa1(%rip), %rdi      # 0x7277
callq 0x459d
movq %rax, %rbx
testq %rax, %rax
je 0x2808
movq %rbx, %rdi
callq 0x2110
testl %eax, %eax
je 0x2802
leaq 0x4a97(%rip), %rdi      # 0x728d
movq %rbx, %rsi
xorl %eax, %eax
callq 0x5fb7
jmp 0x2816
popq %rbx
jmp 0x2657
leaq 0x4a6d(%rip), %rdi      # 0x727c
xorl %eax, %eax
callq 0x5ef8
pushq $0x1
popq %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/ebiggers[P]mysh/mysh_builtin.c
// Function: builtin_eval
static int builtin_eval(unsigned argc, const char **argv)
{
	size_t total_len = 0;
	unsigned i;
	char *p;

	if (argc == 0)
		return 0;
	i = 0;
	do {
		total_len += strlen(argv[i]);
	} while (++i != argc);
	total_len += argc - 1;

	char input[total_len + 1];
	p = input;
	i = 0;
	do {
		p = stpcpy(p, argv[i]);
		if (i != argc - 1)
			p = stpcpy(p, " ");
	} while (++i != argc);
	return execute_full_shell_input(input, total_len);
}

// Assembly:
testl %edi, %edi
je 0x28c0
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
movl %edi, %r14d
movl %edi, %r13d
xorl %r12d, %r12d
xorl %r15d, %r15d
movq (%rbx,%r12,8), %rdi
callq 0x2100
addq %rax, %r15
incq %r12
cmpq %r12, %r13
jne 0x2843
movq %rsp, -0x38(%rbp)
decl %r14d
leaq (%r15,%r14), %rax
addq $0x10, %rax
addq %r14, %r15
andq $-0x10, %rax
movq %rsp, %rcx
subq %rax, %rcx
movq %rcx, %rsp
xorl %r12d, %r12d
movq %rcx, -0x30(%rbp)
movq %rcx, %rax
movq (%rbx,%r12,8), %rsi
movq %rax, %rdi
callq 0x20f0
cmpq %r12, %r14
je 0x2899
movw $0x20, (%rax)
incq %rax
incq %r12
cmpq %r12, %r13
jne 0x2880
movq -0x30(%rbp), %rdi
movq %r15, %rsi
callq 0x3180
movq -0x38(%rbp), %rsp
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/ebiggers[P]mysh/mysh_builtin.c
// Function: builtin_export
static int builtin_export(unsigned argc, const char **argv)
{
	int ret = 0;
	unsigned i;
	for (i = 0; i < argc; i++) {
		ret = do_export(argv[i]);
		if (ret)
			break;
	}
	return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movl %edi, %r13d
pushq $0x3d
popq %rbp
xorl %ebx, %ebx
cmpq %rbx, %r13
je 0x295b
movq (%r14,%rbx,8), %r12
movq %r12, %rdi
movl %ebp, %esi
callq 0x2130
movq %rax, %r15
testq %rax, %rax
je 0x2941
movq %r12, %rdi
callq 0x452d
movb $0x0, (%r15)
movq %r12, %rdi
callq 0x4555
testq %r15, %r15
je 0x2952
movb $0x3d, (%r15)
incq %rbx
testl %eax, %eax
je 0x291a
jmp 0x295d
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ebiggers[P]mysh/mysh_builtin.c
// Function: builtin_getenv
static int builtin_getenv(unsigned argc, const char **argv)
{
	int ret = 0;
	if (argc) {
		const char *value = getenv(argv[0]);
		if (value) {
			if (puts(value) == EOF) {
				mysh_error_with_errno("getenv: write error");
				ret = 1;
			}
		} else
			ret = 2;
	} else {
		const char **env_p;
		for (env_p = environ; *env_p; env_p++) {
			if (puts(*env_p) == EOF) {
				mysh_error_with_errno("getenv: write error");
				ret = 1;
				break;
			}
		}
	}
	return ret;
}

// Assembly:
pushq %rbx
testl %edi, %edi
je 0x298f
movq (%rsi), %rdi
callq 0x2030
testq %rax, %rax
je 0x29c1
movq %rax, %rdi
callq 0x2080
cmpl $-0x1, %eax
je 0x29af
xorl %eax, %eax
jmp 0x29c4
movq 0x863a(%rip), %rax      # 0xafd0
movq (%rax), %rbx
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x298b
callq 0x2080
addq $0x8, %rbx
cmpl $-0x1, %eax
jne 0x2999
leaq 0x48f3(%rip), %rdi      # 0x72a9
xorl %eax, %eax
callq 0x5fb7
pushq $0x1
jmp 0x29c3
pushq $0x2
popq %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/ebiggers[P]mysh/mysh_builtin.c
// Function: builtin_help
static int builtin_help(unsigned argc, const char **argv)
{
	size_t i;
	if (argc) {
		for (i = 0; i < NUM_BUILTINS; i++) {
			if (strcmp(builtins[i].name, argv[0]) == 0) {
				print_help(&builtins[i]);
				return 0;
			}
		}
	}
	for (i = 0; i < NUM_BUILTINS; i++)
		print_help(&builtins[i]);
	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
testl %edi, %edi
je 0x2a10
movq (%rsi), %rbx
xorl %ecx, %ecx
leaq 0x7e35(%rip), %r14      # 0xa810
leaq 0x18(%rcx), %r15
cmpq $0x1b0, %r15            # imm = 0x1B0
je 0x2a10
movq (%rcx,%r14), %rdi
movq %rbx, %rsi
callq 0x2230
movq %r15, %rcx
testl %eax, %eax
jne 0x29db
leaq (%r15,%r14), %rdi
addq $-0x18, %rdi
callq 0x2cda
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
xorl %ebx, %ebx
leaq 0x7df7(%rip), %r14      # 0xa810
cmpq $0x198, %rbx            # imm = 0x198
je 0x2a08
leaq (%r14,%rbx), %rdi
callq 0x2cda
addq $0x18, %rbx
jmp 0x2a19
// File: /workspace/github_c_makefile_star2_O2/ebiggers[P]mysh/mysh_builtin.c
// Function: builtin_pwd
static int builtin_pwd(unsigned argc, const char **argv)
{
	char *buf;
	int ret = 1;

	buf = getcwd(NULL, 0);
	if (!buf) {
		mysh_error_with_errno("pwd: can't get current working directory");
		goto out;
	}
	if (puts(buf) == EOF)
		mysh_error_with_errno("pwd: write error");
	else
		ret = 0;
	free(buf);
out:
	return ret;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
xorl %ebx, %ebx
xorl %edi, %edi
xorl %esi, %esi
callq 0x21a0
testq %rax, %rax
je 0x2a70
movq %rax, %r14
movq %rax, %rdi
callq 0x2080
cmpl $-0x1, %eax
jne 0x2a66
leaq 0x4895(%rip), %rdi      # 0x72f1
xorl %eax, %eax
callq 0x5fb7
pushq $0x1
popq %rbx
movq %r14, %rdi
callq 0x2050
jmp 0x2a81
leaq 0x4851(%rip), %rdi      # 0x72c8
xorl %eax, %eax
callq 0x5fb7
pushq $0x1
popq %rbx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/ebiggers[P]mysh/mysh_builtin.c
// Function: builtin_set
static int builtin_set(unsigned argc, const char **argv)
{
	const char *pos_params[argc];
	unsigned pos_params_idx;
	unsigned i;
	int ret;

	if (argc == 0) {
		ret = print_all_shell_variables();
		goto out;
	}
	pos_params_idx = 0;
	for (i = 0; i < argc; i++) {
		switch (argv[i][0]) {
		case '-':
			if (argv[i][1] == '-' && argv[i][2] == '\0') {
				i++;
				goto remaining_params;
			}
			/* Fall through */
		case '+':
			ret = set_or_unset_options_in_string(argv[i] + 1, (argv[i][0] == '-'));
			if (ret)
				goto out;
			break;
		default:
			pos_params[pos_params_idx++] = argv[i];
			break;
		}
	}
remaining_params:
	for (; i < argc; i++)
		pos_params[pos_params_idx++] = argv[i];
	if (pos_params_idx != 0) {
		set_positional_params(pos_params_idx,
				      positional_parameters[0],
				      pos_params);
	}
	ret = 0;
out:
	return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %edi, %r8d
movq %rsp, %rcx
leaq 0xf(,%r8,8), %rax
andq $-0x10, %rax
subq %rax, %rcx
movq %rcx, %rsp
testl %edi, %edi
je 0x2b7a
movq %rcx, -0x38(%rbp)
pushq $-0x1
popq %r14
xorl %ebx, %ebx
movl $0x0, -0x2c(%rbp)
movq %rsi, -0x48(%rbp)
movq %r8, -0x40(%rbp)
cmpq %r8, %rbx
je 0x2b8f
movq (%rsi,%rbx,8), %r15
movzbl (%r15), %eax
cmpl $0x2b, %eax
je 0x2b02
cmpl $0x2d, %eax
jne 0x2b60
cmpb $0x2d, 0x1(%r15)
jne 0x2b02
cmpb $0x0, 0x2(%r15)
je 0x2bda
xorl %r12d, %r12d
cmpb $0x2d, %al
sete %r12b
incq %r15
xorl %r13d, %r13d
movzbl (%r15), %eax
testq %rax, %rax
je 0x2b51
cmpb $0x7e, %al
ja 0x2b35
leaq 0x7e8b(%rip), %rcx      # 0xa9b0
movq (%rcx,%rax,8), %rcx
testq %rcx, %rcx
je 0x2b35
movl %r12d, (%rcx)
xorl %eax, %eax
jmp 0x2b49
movsbl %al, %esi
leaq 0x47c3(%rip), %rdi      # 0x7302
xorl %eax, %eax
callq 0x5ef8
movl %r14d, %eax
orl %eax, %r13d
incq %r15
jmp 0x2b11
testl %r13d, %r13d
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %r8
je 0x2b72
jmp 0x2bc8
movl -0x2c(%rbp), %ecx
movl %ecx, %eax
incl %ecx
movl %ecx, -0x2c(%rbp)
movq -0x38(%rbp), %rcx
movq %r15, (%rcx,%rax,8)
incq %rbx
jmp 0x2ad5
xorl %eax, %eax
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x497e
movq %r8, %rbx
movq -0x38(%rbp), %rdx
movl -0x2c(%rbp), %edi
cmpq %r8, %rbx
jae 0x2baf
movq (%rsi,%rbx,8), %rax
movl %edi, %ecx
incl %edi
movq %rax, (%rdx,%rcx,8)
incq %rbx
jmp 0x2b99
xorl %r13d, %r13d
testl %edi, %edi
je 0x2bc8
leaq 0x893b(%rip), %rax      # 0xb4f8
movq (%rax), %rax
movq (%rax), %rsi
callq 0x4ca0
movl %r13d, %eax
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
incl %ebx
jmp 0x2b92
// File: /workspace/github_c_makefile_star2_O2/ebiggers[P]mysh/mysh_builtin.c
// Function: builtin_shift
static int builtin_shift(unsigned argc, const char **argv)
{
	unsigned amount;
	unsigned i;
	if (argc) {
		int iamount = atoi(argv[0]);
		if (iamount < 0) {
			mysh_error("shift: shift count cannot be negative");
			return 1;
		}
		amount = iamount;
		if (amount > num_positional_parameters) {
			mysh_error("shift: shift count greater than "
				   "number of positional parameters");
			return 1;
		}
	} else {
		if (num_positional_parameters == 0)
			return 0;
		amount = 1;
	}

	for (i = 1; i <= amount; i++)
		free(positional_parameters[i]);
	for (; i <= num_positional_parameters; i++)
		positional_parameters[i - amount] = positional_parameters[i];
	num_positional_parameters -= amount;
	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
testl %edi, %edi
je 0x2c09
movq (%rsi), %rdi
callq 0x2310
testl %eax, %eax
js 0x2c6d
movl %eax, %ebx
leaq 0x88f8(%rip), %rax      # 0xb4f4
cmpl (%rax), %ebx
jbe 0x2c18
leaq 0x473a(%rip), %rdi      # 0x7341
jmp 0x2c74
leaq 0x88e4(%rip), %rax      # 0xb4f4
cmpl $0x0, (%rax)
je 0x2c69
pushq $0x1
popq %rbx
pushq $0x1
popq %r14
leaq 0x88d5(%rip), %r15      # 0xb4f8
cmpl %ebx, %r14d
ja 0x2c3c
movq (%r15), %rax
movl %r14d, %ecx
movq (%rax,%rcx,8), %rdi
callq 0x2050
incl %r14d
jmp 0x2c23
leaq 0x88b1(%rip), %rax      # 0xb4f4
movl (%rax), %ecx
movl %ebx, %edx
negl %edx
cmpl %ecx, %r14d
ja 0x2c65
movq (%r15), %rsi
movl %r14d, %edi
movq (%rsi,%rdi,8), %rdi
leal (%rdx,%r14), %r8d
movq %rdi, (%rsi,%r8,8)
incl %r14d
jmp 0x2c49
subl %ebx, %ecx
movl %ecx, (%rax)
xorl %eax, %eax
jmp 0x2c7e
leaq 0x46a7(%rip), %rdi      # 0x731b
xorl %eax, %eax
callq 0x5ef8
pushq $0x1
popq %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/ebiggers[P]mysh/mysh_lex.c
// Function: free_tok_list
void free_tok_list(struct list_head *tok_list)
{
	struct token *tok, *tmp;
	list_for_each_entry_safe(tok, tmp, tok_list, list) {
		list_del(&tok->list);
		free_token(tok);
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rax
cmpq %rbx, %rax
je 0x2d33
leaq -0x10(%rax), %rdi
movq (%rax), %r14
movq 0x8(%rax), %rax
movq %rax, 0x8(%r14)
movq %r14, (%rax)
callq 0x2cec
movq %r14, %rax
jmp 0x2d12
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/ebiggers[P]mysh/mysh_lex.c
// Function: scan_single_quoted_string
static ssize_t
scan_single_quoted_string(const char *p, size_t *bytes_remaining_p, char *out_buf)
{
	const char *term_quote;
	ssize_t len;

 	term_quote = memchr(p, '\'', *bytes_remaining_p);
	if (!term_quote)
		return LEX_NOT_ENOUGH_INPUT;

	len = term_quote - p;
	if (memchr(p, '\0', len)) {
		mysh_error("illegal null byte in single-quoted string");
		return LEX_ERROR;
	}
	if (out_buf)
		memcpy(out_buf, p, len);
	*bytes_remaining_p -= (len + 1);
	return len;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %r12
movq %rsi, %rbx
movq %rdi, %r13
movq (%rsi), %r15
pushq $0x27
popq %rsi
movq %r15, %rdx
callq 0x2200
testq %rax, %rax
je 0x2feb
movq %rax, %r14
subq %r13, %r14
movq %r13, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x2200
testq %rax, %rax
je 0x2ff4
leaq 0x4405(%rip), %rdi      # 0x73e0
xorl %eax, %eax
callq 0x5ef8
movq $-0x3e8, %r14           # imm = 0xFC18
jmp 0x3016
movq $-0x7d0, %r14           # imm = 0xF830
jmp 0x3016
testq %r12, %r12
je 0x300a
movq %r12, %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x2260
movq (%rbx), %r15
movq %r14, %rax
notq %rax
addq %r15, %rax
movq %rax, (%rbx)
movq %r14, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/ebiggers[P]mysh/mysh_lex.c
// Function: scan_double_quoted_string
static ssize_t
scan_double_quoted_string(const char *p, size_t *bytes_remaining_p, char *out_buf)
{
	bool escape = false;
	ssize_t len = 0;
	size_t bytes_remaining = *bytes_remaining_p;
	char c;

	for (;;) {
		if (!bytes_remaining)
			return LEX_NOT_ENOUGH_INPUT;
		bytes_remaining--;
		c = *p++;
		if (c == '\0') {
			mysh_error("illegal null byte in double-quoted string");
			return LEX_ERROR;
		} else if (c == '\\' && !escape) {
			/* backslash: try to escape the next character */
			escape = true;
		} else if (c == '"' && !escape) {
			/* found terminating double-quote */
			break;
		} else if (c == '\n' && escape) {
			/* Remove escaped newline */
			escape = false;
		} else {
			if (escape && !(shell_char_type(c) & SHELL_DOUBLE_QUOTE_SPECIAL)) {
				/* backslash followed by a character that does
				 * not give backslash a special meaning means
				 * that the backslash has to be output
				 * literally. */
				if (out_buf)
					*out_buf++ = '\\';
				len++;
			}
			/* literal character in the string */
			if (out_buf)
				*out_buf++ = c;
			len++;
			/* clear the escape flag */
			escape = false;
		}
	}
	*bytes_remaining_p = bytes_remaining;
	return len;
}

// Assembly:
pushq %rbx
movq (%rsi), %r10
xorl %eax, %eax
pushq $0x1
popq %rcx
leaq 0x4add(%rip), %r8       # 0x7b10
movq %rcx, %r9
subq %r10, %r9
incq %rdi
xorl %r11d, %r11d
cmpq $0x1, %r9
je 0x30c2
movzbl -0x1(%rdi), %r10d
cmpl $0xa, %r10d
je 0x3060
cmpl $0x5c, %r10d
jne 0x3073
movb $0x1, %bl
testb $0x1, %r11b
je 0x3068
jmp 0x308c
testb $0x1, %r11b
je 0x30a5
xorl %ebx, %ebx
incq %rdi
incq %r9
movl %ebx, %r11d
jmp 0x303f
cmpl $0x22, %r10d
je 0x3086
testl %r10d, %r10d
je 0x30cb
testb $0x1, %r11b
jne 0x308c
jmp 0x30a5
testb $0x1, %r11b
je 0x30e2
testb $0x20, (%r8,%r10)
jne 0x30a5
testq %rdx, %rdx
je 0x30a0
movb $0x5c, (%rdx)
incq %rdx
jmp 0x30a2
xorl %edx, %edx
incq %rax
testq %rdx, %rdx
je 0x30b2
movb %r10b, (%rdx)
incq %rdx
jmp 0x30b4
xorl %edx, %edx
negq %r9
incq %rax
movq %r9, %r10
jmp 0x3033
movq $-0x7d0, %rax           # imm = 0xF830
jmp 0x30e0
leaq 0x4338(%rip), %rdi      # 0x740a
xorl %eax, %eax
callq 0x5ef8
movq $-0x3e8, %rax           # imm = 0xFC18
popq %rbx
retq
negq %r9
movq %r9, (%rsi)
jmp 0x30e0
// File: /workspace/github_c_makefile_star2_O2/ebiggers[P]mysh/mysh_lex.c
// Function: scan_unquoted_string
static ssize_t
scan_unquoted_string(const char *p, size_t *bytes_remaining_p, char *out_buf)
{
	const char *orig_p = p;
	ssize_t len = 0;
	bool escape = false;
	size_t bytes_remaining = *bytes_remaining_p;
	for (;; p++, bytes_remaining--) {
		if (!bytes_remaining)
			return LEX_NOT_ENOUGH_INPUT;
		if (shell_char_type(*p) & SHELL_UNQUOTED_SPECIAL) {
			if (*p == '\0') {
				mysh_error("illegal null byte in unquoted string");
				return LEX_ERROR;
			}
			if (!escape) {
				if (*p == '\\') {
					escape = true;
					continue;
					/* special case to not start a comment
					 * at the # of $# */
				} else if (!(*p == '#' && p != orig_p && *(p - 1) == '$'))
					break;
			} else if (escape && *p == '\n') {
				/* Remove escaped newline */
				escape = false;
				continue;
			}
		}
		if (out_buf)
			*out_buf++ = *p;
		len++;
		escape = false;
	}
	*bytes_remaining_p = bytes_remaining;
	return len;
}

// Assembly:
pushq %rbx
movq (%rsi), %rcx
xorl %r8d, %r8d
leaq 0x4a18(%rip), %r9       # 0x7b10
xorl %eax, %eax
xorl %r10d, %r10d
movq %rcx, %rbx
subq %r8, %rbx
je 0x315f
movzbl (%rdi,%r8), %r11d
testb $0x40, (%r9,%r11)
jne 0x311e
testq %rdx, %rdx
je 0x3131
movb %r11b, (%rdx)
incq %rdx
jmp 0x3133
testb %r11b, %r11b
je 0x3168
testb $0x1, %r10b
je 0x313e
cmpb $0xa, %r11b
jne 0x3111
jmp 0x3136
xorl %edx, %edx
incq %rax
xorl %r10d, %r10d
incq %r8
jmp 0x30fd
movb $0x1, %r10b
cmpl $0x5c, %r11d
je 0x3139
cmpl $0x23, %r11d
jne 0x315a
testq %r8, %r8
je 0x315a
cmpb $0x24, -0x1(%rdi,%r8)
je 0x3111
movq %rbx, (%rsi)
jmp 0x317d
movq $-0x7d0, %rax           # imm = 0xF830
jmp 0x317d
leaq 0x42c5(%rip), %rdi      # 0x7434
xorl %eax, %eax
callq 0x5ef8
movq $-0x3e8, %rax           # imm = 0xFC18
popq %rbx
retq
nop
// File: /workspace/github_c_makefile_star2_O2/ebiggers[P]mysh/mysh_main.c
// Function: execute_full_shell_input
int execute_full_shell_input(const char *input, size_t len)
{
	int ret;
	LIST_HEAD(tok_list);

	/* hack: overwrite null terminator with a newline so that the end of
	 * input is seen as the end of a shell statement */
	((char*)input)[len++] = '\n';
	ret = execute_shell_input(&tok_list, input, &len);
	switch (ret) {
	case LEX_ERROR:
		mysh_last_exit_status = -1;
		break;
	case LEX_NOT_ENOUGH_INPUT:
		mysh_error("unexpected end of input");
		mysh_last_exit_status = -1;
		break;
	default:
		mysh_last_exit_status = ret;
		break;
	}
	return mysh_last_exit_status;
}

// Assembly:
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rax
leaq 0x10(%rsp), %rdi
movq %rdi, (%rdi)
movq %rdi, 0x8(%rdi)
leaq 0x1(%rsi), %rcx
leaq 0x8(%rsp), %rdx
movq %rcx, (%rdx)
movb $0xa, (%rax,%rsi)
movq %rax, %rsi
callq 0x31dd
pushq $-0x1
popq %rbx
cmpl $0xfffffc18, %eax       # imm = 0xFFFFFC18
je 0x31cf
cmpl $0xfffff830, %eax       # imm = 0xFFFFF830
jne 0x31cd
leaq 0x42ac(%rip), %rdi      # 0x7470
xorl %eax, %eax
callq 0x5ef8
jmp 0x31cf
movl %eax, %ebx
movl %ebx, 0x804b(%rip)      # 0xb220
movl %ebx, %eax
addq $0x20, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/ebiggers[P]mysh/mysh_main.c
// Function: execute_shell_input
static int execute_shell_input(struct list_head *cur_tok_list,
			       const char *input,
			       size_t *bytes_remaining_p)
{
	int ret = 0;
	size_t bytes_remaining = *bytes_remaining_p;
	while (bytes_remaining) {
		struct token *tok;
		do {
			size_t bytes_lexed;

			ret = lex_next_token(input, bytes_remaining_p, &tok);
			if (ret)
				return ret;
			bytes_lexed = bytes_remaining - *bytes_remaining_p;
			if (mysh_write_input_to_stderr)
				fwrite(input, 1, bytes_lexed, stderr);
			input += bytes_lexed;
			bytes_remaining -= bytes_lexed;
			list_add_tail(&tok->list, cur_tok_list);
		} while (tok->type != TOK_END_OF_SHELL_STATEMENT);
		ret = execute_tok_list(cur_tok_list);
		if (ret && mysh_exit_on_error)
			return ret;
	}
	return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq (%rdx), %r13
xorl %eax, %eax
movq %rsp, %r12
testq %r13, %r13
je 0x328d
movq %r13, %rbp
movq %r14, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x2d3b
testl %eax, %eax
jne 0x328d
movq (%rbx), %r13
subq %r13, %rbp
cmpl $0x0, 0x8010(%rip)      # 0xb234
jne 0x3256
addq %rbp, %r14
movq (%rsp), %rax
leaq 0x10(%rax), %rcx
movq 0x8(%r15), %rdx
movq %rcx, 0x8(%r15)
movq %r15, 0x10(%rax)
movq %rdx, 0x18(%rax)
movq %rcx, (%rdx)
movq (%rsp), %rax
cmpl $0x400, 0x4(%rax)       # imm = 0x400
movq %r13, %rbp
jne 0x3205
jmp 0x3270
movq 0x7d93(%rip), %rax      # 0xaff0
movq (%rax), %rcx
movq %r14, %rdi
pushq $0x1
popq %rsi
movq %rbp, %rdx
callq 0x2360
jmp 0x3226
movq %r15, %rdi
callq 0x38da
testl %eax, %eax
je 0x31f9
cmpl $0x0, 0x7fa5(%rip)      # 0xb22c
je 0x31f9
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ebiggers[P]mysh/mysh_main.c
// Function: do_source
int do_source(const char *filename, unsigned nargs, const char * const *args)
{
	int in_fd;
	char **pos_params_save;
	unsigned num_pos_params_save;
	int ret;

	in_fd = open(filename, O_RDONLY);
	if (in_fd < 0) {
		mysh_error_with_errno("can't open %s", filename);
		return 1;
	}

	pos_params_save = positional_parameters;
	num_pos_params_save = num_positional_parameters;
	positional_parameters = NULL;
	set_positional_params(nargs, filename, args);
	ret = read_loop(in_fd, false);
	destroy_positional_params();
	positional_parameters = pos_params_save;
	num_positional_parameters = num_pos_params_save;
	return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movl %esi, %ebp
movq %rdi, %rbx
xorl %esi, %esi
xorl %eax, %eax
callq 0x22c0
testl %eax, %eax
js 0x370b
movl %eax, %r15d
leaq 0x7e36(%rip), %rax      # 0xb4f8
movq (%rax), %r13
leaq 0x7e28(%rip), %rcx      # 0xb4f4
movl (%rcx), %r12d
andq $0x0, (%rax)
movl %ebp, %edi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x4ca0
movl %r15d, %edi
xorl %esi, %esi
callq 0x329c
movl %eax, %ebx
xorl %eax, %eax
callq 0x4d10
leaq 0x7dfe(%rip), %rax      # 0xb4f8
movq %r13, (%rax)
leaq 0x7df0(%rip), %rax      # 0xb4f4
movl %r12d, (%rax)
movl %ebx, %eax
jmp 0x371f
leaq 0x3d8d(%rip), %rdi      # 0x749f
movq %rbx, %rsi
xorl %eax, %eax
callq 0x5fb7
pushq $0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ebiggers[P]mysh/mysh_main.c
// Function: execute_tok_list
static int execute_tok_list(struct list_head *tok_list)
{
	struct token *tok, *tmp;
	unsigned ncommands;
	unsigned i;
	int ret;
	struct list_head *cur_list;

	mysh_assert(!list_empty(tok_list) &&
		    (list_entry(tok_list->prev, struct token, list)->type ==
		    TOK_END_OF_SHELL_STATEMENT));
	BUILD_BUG_ON((TOK_CLASS_CMD_BOUNDARY & TOK_END_OF_SHELL_STATEMENT) == 0);

	/* Count the number of commands in the pipeline */
	ncommands = 0;
	list_for_each_entry(tok, tok_list, list)
		if (tok->type & TOK_CLASS_CMD_BOUNDARY)
			ncommands++;

	struct list_head command_tokens[ncommands];

	for (i = 0; i < ncommands; i++)
		INIT_LIST_HEAD(&command_tokens[i]);

	/* Return 0 if the pipeline is empty (e.g. a line of only whitespace, or
	 * only a comment) */
	if (list_is_singular(tok_list)) {
		ret = 0;
		goto out;
	}

	/* Split the tokens into individual lists (pipeline components), around
	 * the '|' signs. */
	cur_list = &command_tokens[0];
	list_for_each_entry_safe(tok, tmp, tok_list, list) {
		if (tok->type & TOK_CLASS_CMD_BOUNDARY) {
			if (list_empty(cur_list)) {
				mysh_error("empty command in pipeline");
				ret = -1;
				goto out;
			}
			cur_list++;
		} else {
			list_move_tail(&tok->list, cur_list);
		}
	}
	/* Execute the pipeline */
	ret = execute_pipeline(command_tokens, ncommands);
out:
	free_tok_list(tok_list);
	for (i = 0; i < ncommands; i++)
		free_tok_list(&command_tokens[i]);
	return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq (%rdi), %rax
cmpq %rdi, %rax
je 0x39e3
movq %rdi, %rbx
movq 0x8(%rdi), %rcx
cmpl $0x400, -0xc(%rcx)      # imm = 0x400
jne 0x39e3
xorl %esi, %esi
movq %rax, %rdx
cmpq %rbx, %rdx
je 0x3923
movb -0xb(%rdx), %dil
andb $0x5, %dil
cmpb $0x1, %dil
sbbl $-0x1, %esi
movq (%rdx), %rdx
jmp 0x390a
movl %esi, %r12d
movq %rsp, %r14
movq %r12, %rdx
shlq $0x4, %rdx
subq %rdx, %r14
movq %r14, %rsp
xorl %edi, %edi
cmpq %rdi, %rdx
je 0x3950
leaq (%r14,%rdi), %r8
movq %r8, (%r14,%rdi)
movq %r8, 0x8(%r14,%rdi)
addq $0x10, %rdi
jmp 0x3938
cmpq %rcx, %rax
je 0x39a0
movq %r14, %rcx
movq %rax, %rdx
cmpq %rbx, %rax
je 0x3993
movq (%rdx), %rax
testb $0x5, -0xb(%rdx)
jne 0x3988
movq 0x8(%rdx), %rdi
movq %rdi, 0x8(%rax)
movq %rax, (%rdi)
movq 0x8(%rcx), %rdi
movq %rdx, 0x8(%rcx)
movq %rcx, (%rdx)
movq %rdi, 0x8(%rdx)
movq %rdx, (%rdi)
jmp 0x3958
cmpq %rcx, (%rcx)
je 0x39cf
addq $0x10, %rcx
jmp 0x3958
movq %r14, %rdi
callq 0x3a02
movl %eax, %r15d
jmp 0x39a3
xorl %r15d, %r15d
movq %rbx, %rdi
callq 0x2d08
subq $0x1, %r12
jb 0x39bf
movq %r14, %rdi
callq 0x2d08
addq $0x10, %r14
jmp 0x39ab
movl %r15d, %eax
leaq -0x20(%rbp), %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x3b8e(%rip), %rdi      # 0x7564
xorl %eax, %eax
callq 0x5ef8
pushq $-0x1
popq %r15
jmp 0x39a3
leaq 0x3ad7(%rip), %rdi      # 0x74c1
leaq 0x3b3e(%rip), %rsi      # 0x752f
leaq 0x3b43(%rip), %rcx      # 0x753b
movl $0x1ee, %edx            # imm = 0x1EE
callq 0x2160
// File: /workspace/github_c_makefile_star2_O2/ebiggers[P]mysh/mysh_main.c
// Function: install_handler
static void install_handler(int sig, void (*handler)(int))
{
	struct sigaction act;
	memset(&act, 0, sizeof(act));
	act.sa_handler = handler;
	sigaddset(&act.sa_mask, sig);
	sigaction(sig, &act, NULL);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x98, %rsp
movq %rdi, %rbx
leaq 0x8(%rsp), %r14
movl $0x90, %edx
movq %r14, %rdi
xorl %esi, %esi
callq 0x2180
movq %rbx, -0x8(%r14)
pushq $0x2
popq %rbx
movq %r14, %rdi
movl %ebx, %esi
callq 0x23a0
movq %rsp, %rsi
movl %ebx, %edi
xorl %edx, %edx
callq 0x20a0
addq $0x98, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/ebiggers[P]mysh/mysh_main.c
// Function: source_myshrc
static void source_myshrc()
{
	/* source $HOME/.myshrc */
	char *home = getenv("HOME");
	if (home) {
		size_t len = strlen(home);
		char filename[len + sizeof("/.myshrc")];
		stpcpy(filename, home);
		strcat(filename, "/.myshrc");
		do_source(filename, 0, NULL);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
leaq 0x2fb9(%rip), %rdi      # 0x7277
callq 0x2030
testq %rax, %rax
je 0x431d
movq %rax, %rbx
movq %rax, %rdi
callq 0x2100
movq %rsp, %r15
movq %rsp, %r14
addq $0x18, %rax
andq $-0x10, %rax
subq %rax, %r14
movq %r14, %rsp
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2070
movq %r14, %rdi
callq 0x2100
movabsq $0x63726873796d2e2f, %rcx # imm = 0x63726873796D2E2F
movq %rcx, (%rax,%r14)
movb $0x0, 0x8(%rax,%r14)
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x3698
movq %r15, %rsp
leaq -0x18(%rbp), %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ebiggers[P]mysh/mysh_param.c
// Function: do_insert_shell_variable
static bool
do_insert_shell_variable(struct param_trie_node *node,
			 const char *name, size_t len, char *value,
			 int value_idx)
{
	while (len--) {
		int slot = trie_get_slot(*name++);
		if (slot < 0)
			return false;
		mysh_assert(slot < ARRAY_SIZE(node->children));
		if (!node->children[slot]) {
			node->children[slot] = xzalloc(sizeof(struct param_trie_node));
			node->children[slot]->parent = node;
			node->children[slot]->parent_child_ptr = &node->children[slot];
			mysh_assert(node->num_children < ARRAY_SIZE(node->children));
			node->num_children++;
		}
		node = node->children[slot];
	}
	free(node->values[value_idx]);
	node->values[value_idx] = value;

	/* If we unset a parameter by inserting NULL, walk up the free and free
	 * any nodes that aren't needed anymore. */
	while (!node_has_values(node) && node->num_children == 0) {
		struct param_trie_node **parent_child_ptr = node->parent_child_ptr;
		struct param_trie_node *parent = node->parent;
		if (parent) {
			free(node);
			*parent_child_ptr = NULL;
			mysh_assert(parent->num_children > 0);
			parent->num_children--;
		} else {
			break;
		}
		node = parent;
	}
	return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebp
movq %rdx, (%rsp)
movq %rsi, %rbx
movq %rdi, %r12
leaq 0x6f54(%rip), %r14      # 0xb2c0
xorl %r13d, %r13d
cmpq %r13, %rbx
je 0x43e2
movsbl (%r12,%r13), %edi
callq 0x4d63
testl %eax, %eax
js 0x4457
cmpl $0x3f, %eax
jae 0x446c
movl %eax, %ecx
movq (%r14,%rcx,8), %rax
testq %rax, %rax
jne 0x43da
leaq (%r14,%rcx,8), %r15
movl $0x220, %edi            # imm = 0x220
callq 0x60df
movq %rax, (%r15)
movq %r14, 0x1f8(%rax)
movq (%r15), %rax
movq %r15, 0x200(%rax)
movq 0x218(%r14), %rax
cmpq $0x3f, %rax
jae 0x4485
incq %rax
movq %rax, 0x218(%r14)
movq (%r15), %rax
incq %r13
movq %rax, %r14
jmp 0x436f
movl %ebp, %r15d
movq 0x208(%r14,%r15,8), %rdi
callq 0x2050
movq (%rsp), %rax
movq %rax, 0x208(%r14,%r15,8)
cmpq $0x0, 0x208(%r14)
jne 0x4457
cmpq $0x0, 0x210(%r14)
jne 0x4457
cmpq $0x0, 0x218(%r14)
jne 0x4457
movq 0x1f8(%r14), %r15
testq %r15, %r15
je 0x4457
movq 0x200(%r14), %r12
movq %r14, %rdi
callq 0x2050
andq $0x0, (%r12)
movq 0x218(%r15), %rax
testq %rax, %rax
je 0x449e
decq %rax
movq %rax, 0x218(%r15)
movq %r15, %r14
jmp 0x43fe
cmpq %r13, %rbx
sete %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x34b5(%rip), %rdi      # 0x7928
leaq 0x345c(%rip), %rsi      # 0x78d6
leaq 0x34c9(%rip), %rcx      # 0x794a
pushq $0x68
jmp 0x44b5
leaq 0x351a(%rip), %rdi      # 0x79a6
leaq 0x3443(%rip), %rsi      # 0x78d6
leaq 0x34b0(%rip), %rcx      # 0x794a
pushq $0x6d
jmp 0x44b5
leaq 0x3531(%rip), %rdi      # 0x79d6
leaq 0x342a(%rip), %rsi      # 0x78d6
leaq 0x3497(%rip), %rcx      # 0x794a
pushq $0x7d
popq %rdx
callq 0x2160
// File: /workspace/github_c_makefile_star2_O2/ebiggers[P]mysh/mysh_param.c
// Function: export_variable
int export_variable(const char *name)
{
	const char *value = lookup_shell_param(name);
	int ret;
	if (value)
		ret = setenv(name, value, 1);
	else
		ret = unsetenv(name);
	if (ret)
		mysh_error_with_errno("can't export variable %s", name);
	return ret;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x459d
testq %rax, %rax
je 0x4575
pushq $0x1
popq %rdx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x20d0
jmp 0x457d
movq %rbx, %rdi
callq 0x22f0
movl %eax, %ebp
testl %eax, %eax
je 0x4594
leaq 0x32ee(%rip), %rdi      # 0x7878
movq %rbx, %rsi
xorl %eax, %eax
callq 0x5fb7
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ebiggers[P]mysh/mysh_param.c
// Function: init_param_map
void init_param_map()
{
	char **env_p;
	extern char **environ;

	init_trie_slot_tabs();
	for (env_p = environ; *env_p != NULL; env_p++)
		make_param_assignment(*env_p);
}

// Assembly:
pushq %rbx
xorl %ecx, %ecx
leaq 0x6f54(%rip), %rax      # 0xb510
cmpq $0x100, %rcx            # imm = 0x100
je 0x45ce
movb $-0x1, (%rcx,%rax)
incq %rcx
jmp 0x45bc
xorl %ecx, %ecx
leaq 0x352a(%rip), %rdx      # 0x7b01
leaq 0x7032(%rip), %rsi      # 0xb610
xorl %edi, %edi
cmpq $0x4, %rcx
je 0x460f
movb (%rdx,%rcx,2), %r8b
movb 0x1(%rdx,%rcx,2), %r9b
cmpb %r9b, %r8b
ja 0x460a
movzbl %r8b, %r10d
movb %dil, (%r10,%rax)
movl %edi, %r10d
movb %r8b, (%r10,%rsi)
incl %edi
incb %r8b
jmp 0x45ef
incq %rcx
jmp 0x45e0
cmpl $0x3f, %edi
jne 0x4633
movq 0x69b5(%rip), %rax      # 0xafd0
movq (%rax), %rbx
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x4631
callq 0x452d
addq $0x8, %rbx
jmp 0x461e
popq %rbx
retq
leaq 0x33ed(%rip), %rdi      # 0x7a27
leaq 0x3295(%rip), %rsi      # 0x78d6
leaq 0x3400(%rip), %rcx      # 0x7a48
pushq $0x40
popq %rdx
callq 0x2160
// File: /workspace/github_c_makefile_star2_O2/ebiggers[P]mysh/mysh_param.c
// Function: free_param_trie
static void free_param_trie(struct param_trie_node *node)
{
	size_t i, j;
	for (i = 0; i < ARRAY_SIZE(node->children); i++) {
		if (node->children[i]) {
			free_param_trie(node->children[i]);


			for (j = 0; j < NUM_VALUES; j++)
				free(node->children[i]->values[j]);
			free(node->children[i]);
			node->children[i] = NULL;
			mysh_assert(node->num_children > 0);
			node->num_children--;
		}
	}
	mysh_assert(node->num_children == 0);

}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
xorl %r14d, %r14d
cmpq $0x3f, %r14
je 0x46bc
movq (%rbx,%r14,8), %rdi
testq %rdi, %rdi
je 0x46b7
callq 0x4659
xorl %r15d, %r15d
movq (%rbx,%r14,8), %rdi
cmpq $0x2, %r15
je 0x4697
movq 0x208(%rdi,%r15,8), %rdi
callq 0x2050
incq %r15
jmp 0x467b
callq 0x2050
andq $0x0, (%rbx,%r14,8)
movq 0x218(%rbx), %rax
testq %rax, %rax
je 0x46cc
decq %rax
movq %rax, 0x218(%rbx)
incq %r14
jmp 0x4664
cmpq $0x0, 0x218(%rbx)
jne 0x46eb
popq %rbx
popq %r14
popq %r15
retq
leaq 0x3390(%rip), %rdi      # 0x7a63
leaq 0x31fc(%rip), %rsi      # 0x78d6
leaq 0x3399(%rip), %rcx      # 0x7a7a
movl $0xcc, %edx
callq 0x2160
leaq 0x33b7(%rip), %rdi      # 0x7aa9
leaq 0x31dd(%rip), %rsi      # 0x78d6
leaq 0x337a(%rip), %rcx      # 0x7a7a
movl $0xd0, %edx
callq 0x2160
// File: /workspace/github_c_makefile_star2_O2/ebiggers[P]mysh/mysh_param.c
// Function: string_matches_param_assignment
bool string_matches_param_assignment(const struct string *s)
{
	size_t i;
	if (!(shell_char_type(s->chars[0]) & SHELL_NORMAL_PARAM_FIRST_CHAR))
		return false;
	for (i = 1; i < s->len; i++)
		if (!(shell_char_type(s->chars[i]) & SHELL_NORMAL_PARAM_CHAR))
			return (s->chars[i] == '=');
	return false;
}

// Assembly:
movq (%rdi), %rax
movzbl (%rax), %edx
leaq 0x33f9(%rip), %rcx      # 0x7b10
testb $0x5, (%rcx,%rdx)
je 0x473e
movq 0x8(%rdi), %rdx
pushq $0x1
popq %rsi
cmpq %rdx, %rsi
jae 0x473e
movzbl (%rax,%rsi), %edi
incq %rsi
testb $0x7, (%rcx,%rdi)
jne 0x4724
cmpb $0x3d, %dil
sete %al
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/ebiggers[P]mysh/mysh_param.c
// Function: do_lookup_shell_variable
static const char *
do_lookup_shell_variable(const char *name, size_t len, int value_idx)
{
	struct param_trie_node *node = &param_trie_root;
	while (len--) {
		int slot = trie_get_slot(*name++);
		if (slot < 0)
			return NULL;
		mysh_assert(slot < ARRAY_SIZE(node->children));
		node = node->children[slot];
		if (!node)
			return NULL;
	}
	return node->values[value_idx];
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %r15
leaq 0x6b61(%rip), %r12      # 0xb2c0
xorl %ebx, %ebx
xorl %r13d, %r13d
cmpq %r13, %r14
je 0x478c
movsbl (%r15,%r13), %edi
callq 0x4d63
testl %eax, %eax
js 0x4796
cmpl $0x3f, %eax
jae 0x47a8
movl %eax, %eax
movq (%r12,%rax,8), %r12
incq %r13
testq %r12, %r12
jne 0x4764
jmp 0x4796
movl %ebp, %eax
movq 0x208(%r12,%rax,8), %rbx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x3179(%rip), %rdi      # 0x7928
leaq 0x3120(%rip), %rsi      # 0x78d6
leaq 0x3304(%rip), %rcx      # 0x7ac1
movl $0x100, %edx            # imm = 0x100
callq 0x2160
// File: /workspace/github_c_makefile_star2_O2/ebiggers[P]mysh/mysh_param.c
// Function: do_print_all_shell_variables
static int do_print_all_shell_variables(struct param_trie_node *node,
					int value_idx, const char *format)
{
	size_t i;
	int ret = 0;

	if (node->values[value_idx]) {
		ret = node_print_variable(node, value_idx, format);
		if (ret)
			goto out;
	}
	for (i = 0; i < ARRAY_SIZE(node->children); i++) {
		if (node->children[i]) {
			ret = do_print_all_shell_variables(node->children[i],
							   value_idx, format);
			if (ret)
				goto out;
		}
	}
out:
	return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %rbx
movl %esi, %ebp
movq %rdi, %r14
movl %esi, %eax
cmpq $0x0, 0x208(%rdi,%rax,8)
je 0x49cd
movq %r14, %rdi
movl %ebp, %esi
movq %rbx, %rdx
callq 0x4d9a
testl %eax, %eax
je 0x49cd
movl %eax, %r15d
movl %r15d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
xorl %r15d, %r15d
xorl %r12d, %r12d
cmpq $0x3f, %r12
je 0x49c1
movq (%r14,%r12,8), %rdi
testq %rdi, %rdi
je 0x49f0
movl %ebp, %esi
movq %rbx, %rdx
callq 0x4990
testl %eax, %eax
jne 0x49be
incq %r12
jmp 0x49d3
// File: /workspace/github_c_makefile_star2_O2/ebiggers[P]mysh/mysh_param.c
// Function: set_positional_params
void set_positional_params(int num_params, const char *param0,
			   const char * const *params)
{
	unsigned i;
	destroy_positional_params();
	num_positional_parameters = num_params;
	positional_parameters = xmalloc((num_positional_parameters + 1) * sizeof(char *));
	positional_parameters[0] = xstrdup(param0);
	for (i = 0; i < num_positional_parameters; i++)
		positional_parameters[i + 1] = xstrdup(params[i]);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movl %edi, %r15d
callq 0x4d10
movl %r15d, 0x683a(%rip)     # 0xb4f4
incl %r15d
shlq $0x3, %r15
movq %r15, %rdi
callq 0x6099
movq %rax, 0x6828(%rip)      # 0xb4f8
movq %r14, %rdi
callq 0x60f6
movq 0x6819(%rip), %rcx      # 0xb4f8
movq %rax, (%rcx)
xorl %r14d, %r14d
movl 0x6809(%rip), %eax      # 0xb4f4
cmpq %rax, %r14
jae 0x4d0a
movq (%rbx,%r14,8), %rdi
callq 0x60f6
movq 0x67f8(%rip), %rcx      # 0xb4f8
movq %rax, 0x8(%rcx,%r14,8)
incq %r14
jmp 0x4ce5
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/ebiggers[P]mysh/mysh_param.c
// Function: destroy_positional_params
void destroy_positional_params()
{
	unsigned i;
	if (positional_parameters) {
		for (i = 0; i <= num_positional_parameters; i++)
			free(positional_parameters[i]);
		free(positional_parameters);
		positional_parameters = NULL;
		if (all_positional_params) {
			free(all_positional_params);
			all_positional_params = NULL;
		}
	}
}

// Assembly:
cmpq $0x0, 0x67e0(%rip)      # 0xb4f8
je 0x4d62
pushq %rbx
xorl %ebx, %ebx
movq 0x67d4(%rip), %rdi      # 0xb4f8
cmpl 0x67ca(%rip), %ebx      # 0xb4f4
ja 0x4d3b
movl %ebx, %eax
movq (%rdi,%rax,8), %rdi
callq 0x2050
incl %ebx
jmp 0x4d1d
callq 0x2050
andq $0x0, 0x67b0(%rip)      # 0xb4f8
movq 0x67b1(%rip), %rdi      # 0xb500
testq %rdi, %rdi
je 0x4d61
callq 0x2050
andq $0x0, 0x679f(%rip)      # 0xb500
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/ebiggers[P]mysh/mysh_param.c
// Function: node_print_variable
static int node_print_variable(struct param_trie_node *node,
			       int value_idx, const char *format)
{
	size_t len;
	size_t i;
	struct param_trie_node *p;
	int ret;

	p = node;
	len = 0;
	while (p != &param_trie_root) {
		p = p->parent;
		len++;
	}
	char name[len + 1];
	name[len] = '\0';

	p = node;
	i = len - 1;
	do {
		name[i] = trie_slot_to_char_tab[p->parent_child_ptr - p->parent->children];
		p = p->parent;
	} while (i-- != 0);

	ret = printf(format, name, node->values[value_idx]);
	if (ret >= 0)
		ret = 0;
	else
		mysh_error_with_errno("write error");
	return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdx, %rcx
xorl %edx, %edx
leaq 0x6513(%rip), %rax      # 0xb2c0
movq %rdi, %r8
cmpq %rax, %r8
je 0x4dc1
movq 0x1f8(%r8), %r8
incq %rdx
jmp 0x4db0
movq %rsp, %rax
leaq 0x10(%rdx), %r8
andq $-0x10, %r8
subq %r8, %rax
movq %rax, %rsp
movb $0x0, (%rdx,%rax)
leaq 0x6833(%rip), %r8       # 0xb610
movq %rdi, %r9
movq 0x200(%r9), %r10
movq 0x1f8(%r9), %r9
subq %r9, %r10
sarq $0x3, %r10
movb (%r10,%r8), %r10b
movb %r10b, -0x1(%rax,%rdx)
decq %rdx
jne 0x4de0
movl %esi, %edx
movq 0x208(%rdi,%rdx,8), %rdx
xorl %ebx, %ebx
movq %rcx, %rdi
movq %rax, %rsi
xorl %eax, %eax
callq 0x2140
testl %eax, %eax
jns 0x4e34
movl %eax, %r14d
leaq 0x24cc(%rip), %rdi      # 0x72f6
xorl %eax, %eax
callq 0x5fb7
movl %r14d, %ebx
movl %ebx, %eax
leaq -0x10(%rbp), %rsp
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/ebiggers[P]mysh/mysh_parse.c
// Function: glue_strings
static int glue_strings(struct list_head *string_list)
{
	struct string *s, *tmp;
	LIST_HEAD(new_list);
	while (!list_empty(string_list)) {
		struct list_head *first = string_list->next;
		int flags;
		/* Glue one string */
		LIST_HEAD(glue_list);
		list_move_tail(first, &glue_list);
		list_for_each_entry_safe(s, tmp, string_list, list) {
			if (s->flags & STRING_FLAG_PRECEDING_WHITESPACE)
				break;
			else
				list_move_tail(&s->list, &glue_list);
		}
		/* Detect variable assignments
		 * TODO: Somehow make it so that unquoted strings where
		 * parameter expansion has occurred on the left side of the
		 * equals sign are not considered variable assignments. */
		s = list_entry(first, struct string, list);
		if (s->flags & STRING_FLAG_UNQUOTED &&
		    string_matches_param_assignment(s))
			flags = STRING_FLAG_VAR_ASSIGNMENT;
		else
			flags = 0;
		s = join_strings(&glue_list);
		s->flags = flags;
		list_add_tail(&s->list, &new_list);
	}
	/* Replace @string_list with the list of glued strings */
	list_splice_tail(&new_list, string_list);
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
leaq 0x18(%rsp), %r15
movq %r15, (%r15)
movq %r15, 0x8(%r15)
leaq 0x8(%rsp), %r14
movq %r15, %rcx
movq (%rbx), %rdi
cmpq %rbx, %rdi
je 0x5963
movq %r14, 0x8(%rsp)
movq %r14, 0x10(%rsp)
movq (%rdi), %rax
movq 0x8(%rdi), %rcx
movq %rcx, 0x8(%rax)
movq %rax, (%rcx)
movq 0x10(%rsp), %rax
movq %rdi, 0x10(%rsp)
movq %r14, (%rdi)
movq %rax, 0x8(%rdi)
movq %rdi, (%rax)
movq (%rbx), %rax
cmpq %rbx, %rax
je 0x5920
testb $0x10, -0x8(%rax)
jne 0x5920
movq (%rax), %rcx
movq 0x8(%rax), %rdx
movq %rdx, 0x8(%rcx)
movq %rcx, (%rdx)
movq 0x10(%rsp), %rdx
movq %rax, 0x10(%rsp)
movq %r14, (%rax)
movq %rdx, 0x8(%rax)
movq %rax, (%rdx)
movq %rcx, %rax
jmp 0x58ee
testb $0x1, -0x8(%rdi)
je 0x5938
addq $-0x18, %rdi
callq 0x470a
movl $0x200, %ebp            # imm = 0x200
testb %al, %al
jne 0x593a
xorl %ebp, %ebp
movq %r14, %rdi
callq 0x61e1
movl %ebp, 0x10(%rax)
leaq 0x18(%rax), %rcx
movq 0x20(%rsp), %rdx
movq %rcx, 0x20(%rsp)
movq %r15, 0x18(%rax)
movq %rdx, 0x20(%rax)
movq %rcx, (%rdx)
jmp 0x58b3
leaq 0x18(%rsp), %rdx
movq (%rdx), %rax
cmpq %rdx, %rax
je 0x5982
movq 0x8(%rbx), %rdx
movq %rdx, 0x8(%rax)
movq %rax, (%rdx)
movq %rbx, (%rcx)
movq %rcx, 0x8(%rbx)
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ebiggers[P]mysh/mysh_parse.c
// Function: do_filename_expansion
static int do_filename_expansion(struct list_head *string_list)
{
	struct string *s, *tmp;
	int ret = 0;

	LIST_HEAD(new_list);
	list_for_each_entry_safe(s, tmp, string_list, list)
		ret |= string_do_filename_expansion(s, &new_list);
	INIT_LIST_HEAD(string_list);
	if (ret)
		free_string_list(&new_list);
	else
		list_splice_tail(&new_list, string_list);
	return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdi, %rbx
leaq 0x8(%rsp), %r13
movq %r13, (%r13)
movq %r13, 0x8(%r13)
movq (%rdi), %r12
leaq 0x20(%rsp), %r14
xorl %ebp, %ebp
movq %rdi, 0x18(%rsp)
cmpq %rbx, %r12
je 0x5ab7
movq (%r12), %r15
movq -0x18(%r12), %rdi
movl $0x1440, %esi           # imm = 0x1440
xorl %edx, %edx
movq %r14, %rcx
callq 0x2330
testl %eax, %eax
je 0x5a20
cmpl $0x3, %eax
je 0x5a03
cmpl $0x1, %eax
je 0x5afc
leaq 0x23e2(%rip), %rdi      # 0x7dd6
xorl %eax, %eax
callq 0x5fb7
pushq $-0x1
popq %rax
jmp 0x5aad
movq 0x10(%rsp), %rax
movq %r12, 0x10(%rsp)
movq %r13, (%r12)
movq %rax, 0x8(%r12)
movq %r12, (%rax)
xorl %eax, %eax
jmp 0x5aad
movl -0x8(%r12), %r14d
addq $-0x18, %r12
cmpq $0x1, 0x20(%rsp)
ja 0x5a46
movq 0x28(%rsp), %rax
movq (%rax), %rdi
movq (%r12), %rsi
callq 0x2230
testl %eax, %eax
je 0x5a4a
orl $0x40, %r14d
movq %r12, %rdi
callq 0x6193
xorl %ebx, %ebx
cmpq 0x20(%rsp), %rbx
jae 0x5a99
movq 0x28(%rsp), %rax
movq (%rax,%rbx,8), %r12
movq %r12, %rdi
callq 0x2100
movq %r12, %rdi
movq %rax, %rsi
callq 0x6152
movl %r14d, 0x10(%rax)
leaq 0x18(%rax), %rcx
movq 0x10(%rsp), %rdx
movq %rcx, 0x10(%rsp)
movq %r13, 0x18(%rax)
movq %rdx, 0x20(%rax)
movq %rcx, (%rdx)
incq %rbx
jmp 0x5a54
leaq 0x20(%rsp), %r14
movq %r14, %rdi
callq 0x2040
xorl %eax, %eax
movq 0x18(%rsp), %rbx
orl %eax, %ebp
movq %r15, %r12
jmp 0x59ba
movq %rbx, (%rbx)
movq %rbx, 0x8(%rbx)
testl %ebp, %ebp
je 0x5ace
leaq 0x8(%rsp), %rdi
callq 0x61ae
jmp 0x5aeb
movq 0x8(%rsp), %rax
cmpq %r13, %rax
je 0x5aeb
movq 0x10(%rsp), %rcx
movq %rbx, 0x8(%rax)
movq %rax, (%rbx)
movq %rbx, (%rcx)
movq %rcx, 0x8(%rbx)
movl %ebp, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x22c5(%rip), %rdi      # 0x7dc8
xorl %eax, %eax
callq 0x5fb7
pushq $0x1
popq %rdi
callq 0x2350