// File: /workspace/github_c_makefile_star2_O3/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 0x233cf
cmpl $0x2, %eax
je 0x233c8
cmpl $0x1, %eax
jne 0x233d6
movq %rdx, %rbx
leaq 0xb(%rsp), %rdi
movb $0x0, 0x6c(%rdi)
leaq 0x2(%r14), %rsi
movl $0x6c, %edx
callq 0xf680
cmpb $0x1, 0x10(%rbx)
jne 0x23399
cmpb $0x0, 0xb(%rsp)
je 0x23399
leaq 0xb(%rsp), %rdi
callq 0xf5b0
movl 0x8(%rbx), %esi
testl %esi, %esi
je 0x233c3
andl $0x1ff, %esi            # imm = 0x1FF
movl %ebp, %edi
callq 0xf5a0
testl %eax, %eax
je 0x233fb
callq 0xf0a0
movl (%rax), %r15d
cmpl $0x16, %r15d
jne 0x234a7
xorl %r13d, %r13d
jmp 0x233fe
movl $0x10, %edx
jmp 0x233d8
movl $0x1c, %edx
jmp 0x233d8
xorl %edx, %edx
movl %ebp, %edi
movq %r14, %rsi
callq 0xf180
testl %eax, %eax
je 0x233f3
callq 0xf0a0
movl (%rax), %r15d
jmp 0x234a7
xorl %r15d, %r15d
jmp 0x234a7
movb $0x1, %r13b
movl 0xc(%rbx), %edi
testl %edi, %edi
je 0x2342d
andl $0x1ff, %edi            # imm = 0x1FF
callq 0x10810
movl %eax, %r12d
movzwl (%r14), %eax
cmpl $0x1, %eax
je 0x2344e
cmpl $0x2, %eax
je 0x23447
cmpl $0xa, %eax
jne 0x23455
movl $0x1c, %edx
jmp 0x23457
movzwl (%r14), %eax
cmpl $0x1, %eax
je 0x23483
cmpl $0x2, %eax
je 0x2347c
cmpl $0xa, %eax
jne 0x2348a
movl $0x1c, %edx
jmp 0x2348c
movl $0x10, %edx
jmp 0x23457
movl $0x6e, %edx
jmp 0x23457
xorl %edx, %edx
movl %ebp, %edi
movq %r14, %rsi
callq 0xf180
testl %eax, %eax
je 0x2346f
callq 0xf0a0
movl (%rax), %r15d
jmp 0x23472
xorl %r15d, %r15d
movl %r12d, %edi
callq 0x10810
jmp 0x234a2
movl $0x10, %edx
jmp 0x2348c
movl $0x6e, %edx
jmp 0x2348c
xorl %edx, %edx
movl %ebp, %edi
movq %r14, %rsi
callq 0xf180
testl %eax, %eax
je 0x234b9
callq 0xf0a0
movl (%rax), %r15d
testl %r15d, %r15d
je 0x234b9
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 0x234a7
cmpb $0x0, 0xb(%rsp)
je 0x234a7
andl $0x1ff, %esi            # imm = 0x1FF
leaq 0xb(%rsp), %rdi
callq 0xfc00
testl %eax, %eax
jne 0x233e6
jmp 0x234a7