// File: /workspace/github_c_makefile_star2_O0/s3lase[P]v6shell/osh.c
// Function: sh_init
static void
sh_init(const char *av0p)
{
	struct passwd *pwu;
	int fd;
	const char *p;

	setmyerrexit(&sh_errexit);
	setmyname(av0p);
	setmypid(getpid());
	sheuid = geteuid();

	/*
	 * Set-ID execution is not supported.
	 */
	if (sheuid != getuid() || getegid() != getgid())
		err(SH_ERR, FMT2S, getmyname(), ERR_SETID);

	/*
	 * Fail if any of the descriptors 0, 1, or 2 is not open,
	 * or if dupfd0 cannot be set up properly.
	 */
	for (fd = 0; fd < 3; fd++)
		if (!fd_type(fd, FD_ISOPEN))
			err(SH_ERR, "%s: %u: %s\n",
			    getmyname(), (unsigned)fd, strerror(errno));
	if ((dupfd0 = dup2(FD0, DUPFD0)) == -1 ||
	    fcntl(dupfd0, F_SETFD, FD_CLOEXEC) == -1)
		err(SH_ERR, "%s: %u: %s\n",
		    getmyname(), DUPFD0, strerror(errno));

	/* Try to get the terminal name for $t. */
	p   = ttyname(dupfd0);
	tty = xstrdup((p != NULL) ? p : "");

	/* Try to get the effective user name for $u. */
	pwu  = getpwuid(sheuid);
	user = xstrdup((pwu != NULL) ? pwu->pw_name : "");

	/*
	 * Set the SIGCHLD signal to its default action.
	 * Correct operation of the shell requires that zombies
	 * be created for its children when they terminate.
	 */
	(void)sasignal(SIGCHLD, SIG_DFL);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
leaq 0x5e2d(%rip), %rdi      # 0x87e0
callq 0x8e50
movq -0x8(%rbp), %rdi
callq 0x8e70
callq 0x2100
movl %eax, %edi
callq 0x8f20
callq 0x21c0
movl %eax, 0xb894(%rip)      # 0xe26c
movl 0xb88e(%rip), %eax      # 0xe26c
movl %eax, -0x24(%rbp)
callq 0x2150
movl %eax, %ecx
movl -0x24(%rbp), %eax
cmpl %ecx, %eax
jne 0x2a05
callq 0x22e0
movl %eax, -0x28(%rbp)
callq 0x22b0
movl %eax, %ecx
movl -0x28(%rbp), %eax
cmpl %ecx, %eax
je 0x2a27
callq 0x8df0
movq %rax, %rdx
movl $0x2, %edi
leaq 0x8d88(%rip), %rsi      # 0xb7a1
leaq 0x8fcf(%rip), %rcx      # 0xb9ef
movb $0x0, %al
callq 0x8af0
movl $0x0, -0x14(%rbp)
cmpl $0x3, -0x14(%rbp)
jge 0x2a8a
movl -0x14(%rbp), %edi
movl $0x1, %esi
callq 0x2b90
testb $0x1, %al
jne 0x2a7d
callq 0x8df0
movq %rax, -0x38(%rbp)
movl -0x14(%rbp), %eax
movl %eax, -0x2c(%rbp)
callq 0x2070
movl (%rax), %edi
callq 0x2380
movq -0x38(%rbp), %rdx
movl -0x2c(%rbp), %ecx
movq %rax, %r8
movl $0x2, %edi
leaq 0x8f91(%rip), %rsi      # 0xba07
movb $0x0, %al
callq 0x8af0
jmp 0x2a7f
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x2a2e
xorl %edi, %edi
movl $0xa, %esi
callq 0x2160
movl %eax, 0x108e0(%rip)     # 0x1337c
cmpl $-0x1, %eax
je 0x2abd
movl 0x108d5(%rip), %edi     # 0x1337c
movl $0x2, %esi
movl $0x1, %edx
movb $0x0, %al
callq 0x20d0
cmpl $-0x1, %eax
jne 0x2af1
callq 0x8df0
movq %rax, -0x40(%rbp)
callq 0x2070
movl (%rax), %edi
callq 0x2380
movq -0x40(%rbp), %rdx
movq %rax, %r8
movl $0x2, %edi
leaq 0x8f22(%rip), %rsi      # 0xba07
movl $0xa, %ecx
movb $0x0, %al
callq 0x8af0
movl 0x10885(%rip), %edi     # 0x1337c
callq 0x2300
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x2b11
movq -0x20(%rbp), %rax
movq %rax, -0x48(%rbp)
jmp 0x2b1e
leaq 0x8c1f(%rip), %rax      # 0xb737
movq %rax, -0x48(%rbp)
jmp 0x2b1e
movq -0x48(%rbp), %rdi
callq 0x50b0
movq %rax, 0xb72a(%rip)      # 0xe258
movl 0xb738(%rip), %edi      # 0xe26c
callq 0x2120
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x2b51
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x50(%rbp)
jmp 0x2b5e
leaq 0x8bdf(%rip), %rax      # 0xb737
movq %rax, -0x50(%rbp)
jmp 0x2b5e
movq -0x50(%rbp), %rdi
callq 0x50b0
movq %rax, 0xb6f2(%rip)      # 0xe260
movl $0x11, %edi
xorl %eax, %eax
movl %eax, %esi
callq 0xac70
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)