// File: /workspace/github_c_makefile_star2_O0/garbeam[P]st/st.c
// Function: execsh
void
execsh(char *cmd, char **args)
{
	char *sh, *prog;
	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];
	else if (utmp)
		prog = utmp;
	else
		prog = sh;
	DEFAULT(args, ((char *[]) {prog, 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 $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
callq 0x5560
movl $0x0, (%rax)
callq 0x56d0
movl %eax, %edi
callq 0x52b0
movq %rax, -0x28(%rbp)
cmpq $0x0, %rax
jne 0x6a5a
callq 0x5560
cmpl $0x0, (%rax)
je 0x6a4a
callq 0x5560
movl (%rax), %edi
callq 0x5420
movq %rax, %rsi
leaq 0xaf19(%rip), %rdi      # 0x1195a
movb $0x0, %al
callq 0x5a60
jmp 0x6a58
leaq 0xaf17(%rip), %rdi      # 0x11968
movb $0x0, %al
callq 0x5a60
jmp 0x6a5a
leaq 0xaf15(%rip), %rdi      # 0x11976
callq 0x5520
movq %rax, -0x18(%rbp)
cmpq $0x0, %rax
jne 0x6a9e
movq -0x28(%rbp), %rax
movq 0x28(%rax), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x6a8e
movq -0x28(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x40(%rbp)
jmp 0x6a96
movq -0x8(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x6ab2
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
jmp 0x6ad9
leaq 0x1481f(%rip), %rax     # 0x1b2d8
cmpq $0x0, (%rax)
je 0x6acf
leaq 0x14812(%rip), %rax     # 0x1b2d8
movq (%rax), %rax
movq %rax, -0x20(%rbp)
jmp 0x6ad7
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
jmp 0x6ad9
cmpq $0x0, -0x10(%rbp)
je 0x6aea
movq -0x10(%rbp), %rax
movq %rax, -0x48(%rbp)
jmp 0x6b02
movq -0x20(%rbp), %rax
movq %rax, -0x38(%rbp)
movq $0x0, -0x30(%rbp)
leaq -0x38(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x10(%rbp)
leaq 0xae6b(%rip), %rdi      # 0x1197c
callq 0x5760
leaq 0xae67(%rip), %rdi      # 0x11984
callq 0x5760
leaq 0xae61(%rip), %rdi      # 0x1198a
callq 0x5760
movq -0x28(%rbp), %rax
movq (%rax), %rsi
leaq 0xae56(%rip), %rdi      # 0x11992
movl $0x1, %edx
callq 0x5510
movq -0x28(%rbp), %rax
movq (%rax), %rsi
leaq 0xae46(%rip), %rdi      # 0x1199a
movl $0x1, %edx
callq 0x5510
movq -0x18(%rbp), %rsi
leaq 0xae0d(%rip), %rdi      # 0x11976
movl $0x1, %edx
callq 0x5510
movq -0x28(%rbp), %rax
movq 0x20(%rax), %rsi
leaq 0xae1d(%rip), %rdi      # 0x1199f
movl $0x1, %edx
callq 0x5510
leaq 0xfb6d(%rip), %rax      # 0x16700
movq (%rax), %rsi
leaq 0xae07(%rip), %rdi      # 0x119a4
movl $0x1, %edx
callq 0x5510
movl $0x11, %edi
xorl %eax, %eax
movl %eax, %esi
callq 0x5060
movl $0x1, %edi
xorl %eax, %eax
movl %eax, %esi
callq 0x5060
movl $0x2, %edi
xorl %eax, %eax
movl %eax, %esi
callq 0x5060
movl $0x3, %edi
xorl %eax, %eax
movl %eax, %esi
callq 0x5060
movl $0xf, %edi
xorl %eax, %eax
movl %eax, %esi
callq 0x5060
movl $0xe, %edi
xorl %eax, %eax
movl %eax, %esi
callq 0x5060
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x5160
movl $0x1, %edi
callq 0x5210
nopw %cs:(%rax,%rax)