	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rose_bind
_rose_bind:                             ## @rose_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, %r12d
	movq	%rsi, %r14
	movq	(%rdi), %rbx
	movq	%rbx, %rdi
	callq	_rose_sk
	movq	%rax, %r15
	movq	_SOCK_ZAPPED@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movq	%rbx, %rdi
	callq	_sock_flag
	testl	%eax, %eax
	je	LBB0_1
## %bb.3:
	movl	%r12d, %eax
	andl	$-17, %eax
	cmpl	$8, %eax
	jne	LBB0_1
## %bb.4:
	movq	(%r14), %rax
	movq	_AF_ROSE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_1
## %bb.5:
	movl	8(%r14), %eax
	cmpl	$24, %r12d
	jne	LBB0_7
## %bb.6:
	cmpl	$2, %eax
	jge	LBB0_1
LBB0_7:
	movq	_ROSE_MAX_DIGIS@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jle	LBB0_8
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
LBB0_2:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_23:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	leaq	16(%r14), %rdi
	callq	_rose_dev_get
	testq	%rax, %rax
	je	LBB0_9
## %bb.10:
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	xorl	%eax, %eax
	callq	_current_euid
	movl	%eax, %edi
	callq	_ax25_findbyuid
	testq	%rax, %rax
	je	LBB0_12
## %bb.11:
	movl	(%rax), %ecx
	movl	%ecx, 28(%r15)
	movq	%rax, %rdi
	callq	_ax25_uid_put
	jmp	LBB0_16
LBB0_9:
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	callq	_SOCK_DEBUG
	movq	_EADDRNOTAVAIL@GOTPCREL(%rip), %rcx
	jmp	LBB0_2
LBB0_12:
	movq	_ax25_uid_policy@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_15
## %bb.13:
	movq	_CAP_NET_BIND_SERVICE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_capable
	testl	%eax, %eax
	je	LBB0_14
LBB0_15:
	movl	20(%r14), %eax
	movl	%eax, 28(%r15)
LBB0_16:
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movl	16(%r14), %eax
	movl	%eax, 24(%r15)
	movq	%rcx, 16(%r15)
	movl	8(%r14), %eax
	movl	%eax, (%r15)
	cmpl	$8, %r12d
	jne	LBB0_20
## %bb.17:
	testl	%eax, %eax
	jle	LBB0_22
## %bb.18:
	movq	(%r14), %rax
	movq	8(%r15), %rcx
	xorl	%edx, %edx
	.p2align	4, 0x90
LBB0_19:                                ## =>This Inner Loop Header: Depth=1
	movl	(%rax,%rdx,4), %esi
	movl	%esi, (%rcx,%rdx,4)
	incq	%rdx
	movslq	8(%r14), %rsi
	cmpq	%rsi, %rdx
	jl	LBB0_19
	jmp	LBB0_22
LBB0_20:
	cmpl	$1, %eax
	jne	LBB0_22
## %bb.21:
	movl	12(%r14), %eax
	movq	8(%r15), %rcx
	movl	%eax, (%rcx)
LBB0_22:
	movq	%rbx, %rdi
	callq	_rose_insert_socket
	movl	(%r13), %esi
	movq	%rbx, %rdi
	callq	_sock_reset_flag
	leaq	L_.str.1(%rip), %rsi
	movq	%rbx, %rdi
	callq	_SOCK_DEBUG
	xorl	%eax, %eax
	jmp	LBB0_23
LBB0_14:
	movq	_EACCES@GOTPCREL(%rip), %rcx
	jmp	LBB0_2
	.cfi_endproc
                                        ## -- End function
	.comm	_SOCK_ZAPPED,4,2                ## @SOCK_ZAPPED
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_AF_ROSE,8,3                    ## @AF_ROSE
	.comm	_ROSE_MAX_DIGIS,4,2             ## @ROSE_MAX_DIGIS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ROSE: bind failed: invalid address\n"

	.comm	_EADDRNOTAVAIL,4,2              ## @EADDRNOTAVAIL
	.comm	_ax25_uid_policy,8,3            ## @ax25_uid_policy
	.comm	_CAP_NET_BIND_SERVICE,4,2       ## @CAP_NET_BIND_SERVICE
	.comm	_EACCES,4,2                     ## @EACCES
L_.str.1:                               ## @.str.1
	.asciz	"ROSE: socket is bound\n"

	.no_dead_strip	_rose_bind
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rose_bind
_rose_bind:                             ; @rose_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	_rose_sk
	mov	x21, x0
Lloh0:
	adrp	x24, _SOCK_ZAPPED@GOTPAGE
Lloh1:
	ldr	x24, [x24, _SOCK_ZAPPED@GOTPAGEOFF]
	ldr	w1, [x24]
	mov	x0, x19
	bl	_sock_flag
	cbz	w0, LBB0_6
; %bb.1:
	and	w8, w22, #0xffffffef
	cmp	w8, #8
	b.ne	LBB0_6
; %bb.2:
	ldr	x8, [x20]
Lloh2:
	adrp	x9, _AF_ROSE@GOTPAGE
Lloh3:
	ldr	x9, [x9, _AF_ROSE@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_6
; %bb.3:
	ldr	w8, [x20, #8]
	cmp	w22, #24
	b.ne	LBB0_5
; %bb.4:
	cmp	w8, #2
	b.ge	LBB0_6
LBB0_5:
Lloh5:
	adrp	x9, _ROSE_MAX_DIGIS@GOTPAGE
Lloh6:
	ldr	x9, [x9, _ROSE_MAX_DIGIS@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	cmp	w8, w9
	b.le	LBB0_9
LBB0_6:
Lloh8:
	adrp	x8, _EINVAL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_7:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_8:
	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_9:
	add	x0, x20, #16
	bl	_rose_dev_get
	cbz	x0, LBB0_12
; %bb.10:
	mov	x23, x0
	bl	_current_euid
	bl	_ax25_findbyuid
	cbz	x0, LBB0_13
; %bb.11:
	ldr	w8, [x0]
	str	w8, [x21, #28]
	bl	_ax25_uid_put
	b	LBB0_16
LBB0_12:
Lloh10:
	adrp	x1, l_.str@PAGE
Lloh11:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_SOCK_DEBUG
Lloh12:
	adrp	x8, _EADDRNOTAVAIL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EADDRNOTAVAIL@GOTPAGEOFF]
	b	LBB0_7
LBB0_13:
Lloh14:
	adrp	x8, _ax25_uid_policy@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ax25_uid_policy@GOTPAGEOFF]
Lloh16:
	ldr	x8, [x8]
	cbz	x8, LBB0_15
; %bb.14:
Lloh17:
	adrp	x8, _CAP_NET_BIND_SERVICE@GOTPAGE
Lloh18:
	ldr	x8, [x8, _CAP_NET_BIND_SERVICE@GOTPAGEOFF]
Lloh19:
	ldr	w0, [x8]
	bl	_capable
	cbz	w0, LBB0_23
LBB0_15:
	ldr	w8, [x20, #20]
	str	w8, [x21, #28]
LBB0_16:
	ldr	w8, [x20, #16]
	str	w8, [x21, #24]
	str	x23, [x21, #16]
	ldr	w8, [x20, #8]
	str	w8, [x21]
	cmp	w22, #8
	b.ne	LBB0_20
; %bb.17:
	cmp	w8, #1
	b.lt	LBB0_22
; %bb.18:
	mov	x8, #0
	ldr	x9, [x20]
	ldr	x10, [x21, #8]
LBB0_19:                                ; =>This Inner Loop Header: Depth=1
	lsl	x11, x8, #2
	ldr	w12, [x9, x11]
	str	w12, [x10, x11]
	add	x8, x8, #1
	ldrsw	x11, [x20, #8]
	cmp	x8, x11
	b.lt	LBB0_19
	b	LBB0_22
LBB0_20:
	cmp	w8, #1
	b.ne	LBB0_22
; %bb.21:
	ldr	w8, [x20, #12]
	ldr	x9, [x21, #8]
	str	w8, [x9]
LBB0_22:
	mov	x0, x19
	bl	_rose_insert_socket
	ldr	w1, [x24]
	mov	x0, x19
	bl	_sock_reset_flag
Lloh20:
	adrp	x1, l_.str.1@PAGE
Lloh21:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_SOCK_DEBUG
	mov	w0, #0
	b	LBB0_8
LBB0_23:
Lloh22:
	adrp	x8, _EACCES@GOTPAGE
Lloh23:
	ldr	x8, [x8, _EACCES@GOTPAGEOFF]
	b	LBB0_7
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_SOCK_ZAPPED,4,2                ; @SOCK_ZAPPED
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_AF_ROSE,8,3                    ; @AF_ROSE
	.comm	_ROSE_MAX_DIGIS,4,2             ; @ROSE_MAX_DIGIS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ROSE: bind failed: invalid address\n"

	.comm	_EADDRNOTAVAIL,4,2              ; @EADDRNOTAVAIL
	.comm	_ax25_uid_policy,8,3            ; @ax25_uid_policy
	.comm	_CAP_NET_BIND_SERVICE,4,2       ; @CAP_NET_BIND_SERVICE
	.comm	_EACCES,4,2                     ; @EACCES
l_.str.1:                               ; @.str.1
	.asciz	"ROSE: socket is bound\n"

	.no_dead_strip	_rose_bind
.subsections_via_symbols
