	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function atalk_bind
_atalk_bind:                            ## @atalk_bind
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %ebx
	movq	%rsi, %r14
	movq	(%rdi), %r12
	movq	%r12, %rdi
	callq	_at_sk
	movq	%rax, %r15
	movq	_SOCK_ZAPPED@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movq	%r12, %rdi
	callq	_sock_flag
	cmpl	$32, %ebx
	jne	LBB0_6
## %bb.1:
	testl	%eax, %eax
	je	LBB0_6
## %bb.2:
	movq	(%r14), %rax
	movq	_AF_APPLETALK@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_7
## %bb.3:
	movq	16(%r14), %rbx
	movq	_ATADDR_ANYNET@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_htons
	cmpq	%rax, %rbx
	jne	LBB0_11
## %bb.4:
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_atalk_find_primary
	testq	%rax, %rax
	je	LBB0_19
## %bb.5:
	movq	(%rax), %rcx
	movq	%rcx, 16(%r14)
	movq	%rcx, (%r15)
	movl	8(%rax), %eax
	movl	%eax, 24(%r14)
	jmp	LBB0_13
LBB0_6:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_8
LBB0_7:
	movq	_EAFNOSUPPORT@GOTPCREL(%rip), %rax
LBB0_8:
	xorl	%ebx, %ebx
LBB0_9:
	subl	(%rax), %ebx
LBB0_10:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	movq	16(%r14), %rdi
	movl	24(%r14), %esi
	callq	_atalk_find_interface
	testl	%eax, %eax
	je	LBB0_20
## %bb.12:
	movq	16(%r14), %rax
	movq	%rax, (%r15)
	movl	24(%r14), %eax
LBB0_13:
	movl	%eax, 16(%r15)
	movq	8(%r14), %rax
	movq	_ATADDR_ANYPORT@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_16
## %bb.14:
	movq	%r12, %rdi
	movq	%r14, %rsi
	callq	_atalk_pick_and_bind_port
	testl	%eax, %eax
	jns	LBB0_18
## %bb.15:
	movl	%eax, %ebx
	jmp	LBB0_10
LBB0_16:
	movq	%rax, 8(%r15)
	movq	%r12, %rdi
	movq	%r14, %rsi
	callq	_atalk_find_or_insert_socket
	testq	%rax, %rax
	je	LBB0_18
## %bb.17:
	movq	_EADDRINUSE@GOTPCREL(%rip), %rax
	jmp	LBB0_8
LBB0_18:
	movl	(%r13), %esi
	movq	%r12, %rdi
	callq	_sock_reset_flag
	xorl	%ebx, %ebx
	jmp	LBB0_10
LBB0_19:
	movq	_EADDRNOTAVAIL@GOTPCREL(%rip), %rax
	jmp	LBB0_9
LBB0_20:
	movq	_EADDRNOTAVAIL@GOTPCREL(%rip), %rax
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.comm	_SOCK_ZAPPED,4,2                ## @SOCK_ZAPPED
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_AF_APPLETALK,8,3               ## @AF_APPLETALK
	.comm	_EAFNOSUPPORT,4,2               ## @EAFNOSUPPORT
	.comm	_ATADDR_ANYNET,4,2              ## @ATADDR_ANYNET
	.comm	_EADDRNOTAVAIL,4,2              ## @EADDRNOTAVAIL
	.comm	_ATADDR_ANYPORT,8,3             ## @ATADDR_ANYPORT
	.comm	_EADDRINUSE,4,2                 ## @EADDRINUSE
	.no_dead_strip	_atalk_bind
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function atalk_bind
_atalk_bind:                            ; @atalk_bind
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x22, x2
	mov	x20, x1
	ldr	x19, [x0]
	mov	x0, x19
	bl	_at_sk
	mov	x21, x0
Lloh0:
	adrp	x23, _SOCK_ZAPPED@GOTPAGE
Lloh1:
	ldr	x23, [x23, _SOCK_ZAPPED@GOTPAGEOFF]
	ldr	w1, [x23]
	mov	x0, x19
	bl	_sock_flag
	cmp	w22, #32
	b.ne	LBB0_6
; %bb.1:
	cbz	w0, LBB0_6
; %bb.2:
	ldr	x8, [x20]
Lloh2:
	adrp	x9, _AF_APPLETALK@GOTPAGE
Lloh3:
	ldr	x9, [x9, _AF_APPLETALK@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_7
; %bb.3:
	ldr	x22, [x20, #16]
Lloh5:
	adrp	x8, _ATADDR_ANYNET@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ATADDR_ANYNET@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	bl	_htons
	cmp	x22, x0
	b.ne	LBB0_8
; %bb.4:
	bl	_atalk_find_primary
	cbz	x0, LBB0_12
; %bb.5:
	ldr	x8, [x0]
	str	x8, [x20, #16]
	str	x8, [x21]
	ldr	w8, [x0, #8]
	str	w8, [x20, #24]
	b	LBB0_10
LBB0_6:
Lloh8:
	adrp	x8, _EINVAL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_15
LBB0_7:
Lloh10:
	adrp	x8, _EAFNOSUPPORT@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EAFNOSUPPORT@GOTPAGEOFF]
	b	LBB0_15
LBB0_8:
	ldr	x0, [x20, #16]
	ldr	w1, [x20, #24]
	bl	_atalk_find_interface
	cbz	w0, LBB0_12
; %bb.9:
	ldr	x8, [x20, #16]
	str	x8, [x21]
	ldr	w8, [x20, #24]
LBB0_10:
	str	w8, [x21, #16]
	ldr	x8, [x20, #8]
Lloh12:
	adrp	x9, _ATADDR_ANYPORT@GOTPAGE
Lloh13:
	ldr	x9, [x9, _ATADDR_ANYPORT@GOTPAGEOFF]
Lloh14:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_13
; %bb.11:
	mov	x0, x19
	mov	x1, x20
	bl	_atalk_pick_and_bind_port
	tbz	w0, #31, LBB0_17
	b	LBB0_16
LBB0_12:
Lloh15:
	adrp	x8, _EADDRNOTAVAIL@GOTPAGE
Lloh16:
	ldr	x8, [x8, _EADDRNOTAVAIL@GOTPAGEOFF]
	b	LBB0_15
LBB0_13:
	str	x8, [x21, #8]
	mov	x0, x19
	mov	x1, x20
	bl	_atalk_find_or_insert_socket
	cbz	x0, LBB0_17
; %bb.14:
Lloh17:
	adrp	x8, _EADDRINUSE@GOTPAGE
Lloh18:
	ldr	x8, [x8, _EADDRINUSE@GOTPAGEOFF]
LBB0_15:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_16:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_17:
	ldr	w1, [x23]
	mov	x0, x19
	bl	_sock_reset_flag
	mov	w0, #0
	b	LBB0_16
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_SOCK_ZAPPED,4,2                ; @SOCK_ZAPPED
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_AF_APPLETALK,8,3               ; @AF_APPLETALK
	.comm	_EAFNOSUPPORT,4,2               ; @EAFNOSUPPORT
	.comm	_ATADDR_ANYNET,4,2              ; @ATADDR_ANYNET
	.comm	_EADDRNOTAVAIL,4,2              ; @EADDRNOTAVAIL
	.comm	_ATADDR_ANYPORT,8,3             ; @ATADDR_ANYPORT
	.comm	_EADDRINUSE,4,2                 ; @EADDRINUSE
	.no_dead_strip	_atalk_bind
.subsections_via_symbols
