// File: /workspace/github_c_makefile_star2_O0/odknt[P]st/st.c
// Function: execsh
void
execsh(char *cmd, char **args)
{
	char *sh, *prog, *arg;
	const struct passwd *pw;

	errno = 0;
	if ((pw = getpwuid(getuid())) == NULL) {
		if (errno)
			die("getpwuid: %s\n", strerror(errno));
		else
			die("who are you?\n");
	}

	if ((sh = getenv("SHELL")) == NULL)
		sh = (pw->pw_shell[0]) ? pw->pw_shell : cmd;

	if (args) {
		prog = args[0];
		arg = NULL;
	} else if (scroll) {
		prog = scroll;
		arg = utmp ? utmp : sh;
	} else if (utmp) {
		prog = utmp;
		arg = NULL;
	} else {
		prog = sh;
		arg = NULL;
	}
	DEFAULT(args, ((char *[]) {prog, arg, NULL}));

	unsetenv("COLUMNS");
	unsetenv("LINES");
	unsetenv("TERMCAP");
	setenv("LOGNAME", pw->pw_name, 1);
	setenv("USER", pw->pw_name, 1);
	setenv("SHELL", sh, 1);
	setenv("HOME", pw->pw_dir, 1);
	setenv("TERM", termname, 1);

	signal(SIGCHLD, SIG_DFL);
	signal(SIGHUP, SIG_DFL);
	signal(SIGINT, SIG_DFL);
	signal(SIGQUIT, SIG_DFL);
	signal(SIGTERM, SIG_DFL);
	signal(SIGALRM, SIG_DFL);

	execvp(prog, args);
	_exit(1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
callq 0x66e0
movl $0x0, (%rax)
callq 0x6810
movl %eax, %edi
callq 0x6350
movq %rax, -0x30(%rbp)
cmpq $0x0, %rax
jne 0x7e1a
callq 0x66e0
cmpl $0x0, (%rax)
je 0x7e0a
callq 0x66e0
movl (%rax), %edi
callq 0x6570
movq %rax, %rsi
leaq 0xcc04(%rip), %rdi      # 0x14a05
movb $0x0, %al
callq 0x6c20
jmp 0x7e18
leaq 0xcc02(%rip), %rdi      # 0x14a13
movb $0x0, %al
callq 0x6c20
jmp 0x7e1a
leaq 0xcc00(%rip), %rdi      # 0x14a21
callq 0x6690
movq %rax, -0x18(%rbp)
cmpq $0x0, %rax
jne 0x7e5e
movq -0x30(%rbp), %rax
movq 0x28(%rax), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x7e4e
movq -0x30(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x50(%rbp)
jmp 0x7e56
movq -0x8(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x7e7d
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
jmp 0x7f00
leaq 0x1a5bc(%rip), %rax     # 0x22440
cmpq $0x0, (%rax)
je 0x7ec7
leaq 0x1a5af(%rip), %rax     # 0x22440
movq (%rax), %rax
movq %rax, -0x20(%rbp)
leaq 0x1a599(%rip), %rax     # 0x22438
cmpq $0x0, (%rax)
je 0x7eb5
leaq 0x1a58c(%rip), %rax     # 0x22438
movq (%rax), %rax
movq %rax, -0x58(%rbp)
jmp 0x7ebd
movq -0x18(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
movq %rax, -0x28(%rbp)
jmp 0x7efe
leaq 0x1a56a(%rip), %rax     # 0x22438
cmpq $0x0, (%rax)
je 0x7eec
leaq 0x1a55d(%rip), %rax     # 0x22438
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
jmp 0x7efc
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
jmp 0x7efe
jmp 0x7f00
cmpq $0x0, -0x10(%rbp)
je 0x7f11
movq -0x10(%rbp), %rax
movq %rax, -0x60(%rbp)
jmp 0x7f31
movq -0x20(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x40(%rbp)
movq $0x0, -0x38(%rbp)
leaq -0x48(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rax
movq %rax, -0x10(%rbp)
leaq 0xcae7(%rip), %rdi      # 0x14a27
callq 0x68c0
leaq 0xcae3(%rip), %rdi      # 0x14a2f
callq 0x68c0
leaq 0xcadd(%rip), %rdi      # 0x14a35
callq 0x68c0
movq -0x30(%rbp), %rax
movq (%rax), %rsi
leaq 0xcad2(%rip), %rdi      # 0x14a3d
movl $0x1, %edx
callq 0x6680
movq -0x30(%rbp), %rax
movq (%rax), %rsi
leaq 0xcac2(%rip), %rdi      # 0x14a45
movl $0x1, %edx
callq 0x6680
movq -0x18(%rbp), %rsi
leaq 0xca89(%rip), %rdi      # 0x14a21
movl $0x1, %edx
callq 0x6680
movq -0x30(%rbp), %rax
movq 0x20(%rax), %rsi
leaq 0xca99(%rip), %rdi      # 0x14a4a
movl $0x1, %edx
callq 0x6680
leaq 0x117de(%rip), %rax     # 0x197a0
movq (%rax), %rsi
leaq 0xca83(%rip), %rdi      # 0x14a4f
movl $0x1, %edx
callq 0x6680
movl $0x11, %edi
xorl %eax, %eax
movl %eax, %esi
callq 0x6060
movl $0x1, %edi
xorl %eax, %eax
movl %eax, %esi
callq 0x6060
movl $0x2, %edi
xorl %eax, %eax
movl %eax, %esi
callq 0x6060
movl $0x3, %edi
xorl %eax, %eax
movl %eax, %esi
callq 0x6060
movl $0xf, %edi
xorl %eax, %eax
movl %eax, %esi
callq 0x6060
movl $0xe, %edi
xorl %eax, %eax
movl %eax, %esi
callq 0x6060
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x6190
movl $0x1, %edi
callq 0x6280
nopw %cs:(%rax,%rax)