// File: /workspace/github_c_makefile_star2_O1/wahern[P]cqueues/src/lib/socket.c
// Function: so_bind
int (so_bind)(int fd, sockaddr_arg_t arg, const struct so_options *opts) {
#if SA_UNIX
	if (*sa_family(arg) == AF_UNIX) {
		char *path = strncpy((char [sizeof sockaddr_ref(arg).sun->sun_path + 1]){ 0 }, sockaddr_ref(arg).sun->sun_path, sizeof sockaddr_ref(arg).sun->sun_path);
		_Bool nochmod = 0;
		int error;

		if (opts->sun_unlink && *path)
			(void)unlink(path);

		if (opts->sun_mode) {
			if (0 == fchmod(fd, (opts->sun_mode & 0777)))
				nochmod = 1;
			else if (errno != EINVAL) /* BSDs return EINVAL */
				return errno;
		}

		if (opts->sun_mask) {
			mode_t omask = umask(opts->sun_mask & 0777);
			error = (0 == bind(fd, sockaddr_ref(arg).sa, sa_len(arg)))? 0 : errno;
			umask(omask);
		} else {
			error = (0 == bind(fd, sockaddr_ref(arg).sa, sa_len(arg)))? 0 : errno;
		}

		if (error)
			return error;

		if (opts->sun_mode && !nochmod && *path) {
			if (0 != chmod(path, (opts->sun_mode & 0777)))
				return errno;
		}

		return 0;
	}
#endif

	if (0 != bind(fd, sockaddr_ref(arg).sa, sa_len(arg)))
		return so_soerr();

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rsi, %r14
movl %edi, %ebp
movzwl (%rsi), %eax
cmpl $0xa, %eax
je 0x23555
cmpl $0x2, %eax
je 0x2354e
cmpl $0x1, %eax
jne 0x2355c
movq %rdx, %rbx
xorps %xmm0, %xmm0
movq %rsp, %rdi
movups %xmm0, 0x5d(%rdi)
movaps %xmm0, 0x50(%rdi)
movaps %xmm0, 0x40(%rdi)
movaps %xmm0, 0x30(%rdi)
movaps %xmm0, 0x20(%rdi)
movaps %xmm0, 0x10(%rdi)
movaps %xmm0, (%rdi)
leaq 0x2(%r14), %rsi
movl $0x6c, %edx
callq 0xf680
cmpb $0x1, 0x10(%rbx)
jne 0x2351f
cmpb $0x0, (%rsp)
je 0x2351f
movq %rsp, %rdi
callq 0xf5b0
movl 0x8(%rbx), %esi
testl %esi, %esi
je 0x23549
andl $0x1ff, %esi            # imm = 0x1FF
movl %ebp, %edi
callq 0xf5a0
testl %eax, %eax
je 0x23581
callq 0xf0a0
movl (%rax), %r15d
cmpl $0x16, %r15d
jne 0x23632
xorl %r13d, %r13d
jmp 0x23584
movl $0x10, %edx
jmp 0x2355e
movl $0x1c, %edx
jmp 0x2355e
xorl %edx, %edx
movl %ebp, %edi
movq %r14, %rsi
callq 0xf180
testl %eax, %eax
je 0x23579
callq 0xf0a0
movl (%rax), %r15d
jmp 0x23632
xorl %r15d, %r15d
jmp 0x23632
movb $0x1, %r13b
movl 0xc(%rbx), %edi
testl %edi, %edi
je 0x235b3
andl $0x1ff, %edi            # imm = 0x1FF
callq 0x10810
movl %eax, %r12d
movzwl (%r14), %eax
cmpl $0x1, %eax
je 0x235d4
cmpl $0x2, %eax
je 0x235cd
cmpl $0xa, %eax
jne 0x235db
movl $0x1c, %edx
jmp 0x235dd
movzwl (%r14), %eax
cmpl $0x1, %eax
je 0x23609
cmpl $0x2, %eax
je 0x23602
cmpl $0xa, %eax
jne 0x23610
movl $0x1c, %edx
jmp 0x23612
movl $0x10, %edx
jmp 0x235dd
movl $0x6e, %edx
jmp 0x235dd
xorl %edx, %edx
movl %ebp, %edi
movq %r14, %rsi
callq 0xf180
testl %eax, %eax
je 0x235f5
callq 0xf0a0
movl (%rax), %r15d
jmp 0x235f8
xorl %r15d, %r15d
movl %r12d, %edi
callq 0x10810
jmp 0x2362d
movl $0x10, %edx
jmp 0x23612
movl $0x6e, %edx
jmp 0x23612
xorl %edx, %edx
movl %ebp, %edi
movq %r14, %rsi
callq 0xf180
testl %eax, %eax
je 0x2362a
callq 0xf0a0
movl (%rax), %r15d
jmp 0x2362d
xorl %r15d, %r15d
testl %r15d, %r15d
je 0x23644
movl %r15d, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl 0x8(%rbx), %esi
testl %esi, %esi
sete %al
xorl %r15d, %r15d
orb %al, %r13b
jne 0x23632
cmpb $0x0, (%rsp)
je 0x23632
andl $0x1ff, %esi            # imm = 0x1FF
movq %rsp, %rdi
callq 0xfc00
testl %eax, %eax
jne 0x2356c
jmp 0x23632