	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_scif_bind                      ## -- Begin function scif_bind
	.p2align	4, 0x90
_scif_bind:                             ## @scif_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	%esi, %ebx
	movq	%rdi, %r14
	movq	_scif_info@GOTPCREL(%rip), %r12
	movl	(%r12), %edi
	movq	_scif_ep_states@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%r14), %rcx
	movl	(%rax,%rcx,4), %ecx
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdx
	movl	%ebx, %r8d
	xorl	%eax, %eax
	callq	_dev_dbg
	testl	%ebx, %ebx
	je	LBB0_4
## %bb.1:
	movq	_SCIF_ADMIN_PORT_END@GOTPCREL(%rip), %rax
	cmpl	%ebx, (%rax)
	jle	LBB0_4
## %bb.2:
	movq	_CAP_SYS_ADMIN@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_capable
	testl	%eax, %eax
	je	LBB0_3
LBB0_4:
	leaq	8(%r14), %r15
	movq	%r15, %rdi
	callq	_spin_lock
	movq	(%r14), %rax
	movq	_SCIFEP_BOUND@GOTPCREL(%rip), %r13
	cmpq	(%r13), %rax
	jne	LBB0_7
LBB0_5:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_6
LBB0_7:
	movq	_SCIFEP_UNBOUND@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_8
## %bb.9:
	testl	%ebx, %ebx
	je	LBB0_11
## %bb.10:
	movl	%ebx, %edi
	callq	_scif_rsrv_port
	cmpl	%ebx, %eax
	jne	LBB0_5
	jmp	LBB0_12
LBB0_8:
	movq	_EISCONN@GOTPCREL(%rip), %rax
LBB0_6:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_13:
	movq	%r15, %rdi
	callq	_spin_unlock
LBB0_14:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movq	_EACCES@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_14
LBB0_11:
	xorl	%eax, %eax
	callq	_scif_get_new_port
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_13
LBB0_12:
	movq	(%r13), %rax
	movq	%rax, (%r14)
	movl	4(%r12), %eax
	movl	%eax, 20(%r14)
	movl	%ebx, 16(%r14)
	movq	_ASYNC_CONN_IDLE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 12(%r14)
	movl	(%r12), %edi
	leaq	L_.str.1(%rip), %rsi
	movl	%ebx, %edx
	xorl	%eax, %eax
	callq	_dev_dbg
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.comm	_scif_info,8,2                  ## @scif_info
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"SCIFAPI bind: ep %p %s requested port number %d\n"

	.comm	_scif_ep_states,8,3             ## @scif_ep_states
	.comm	_SCIF_ADMIN_PORT_END,4,2        ## @SCIF_ADMIN_PORT_END
	.comm	_CAP_SYS_ADMIN,4,2              ## @CAP_SYS_ADMIN
	.comm	_EACCES,4,2                     ## @EACCES
	.comm	_SCIFEP_BOUND,8,3               ## @SCIFEP_BOUND
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_SCIFEP_UNBOUND,8,3             ## @SCIFEP_UNBOUND
	.comm	_EISCONN,4,2                    ## @EISCONN
	.comm	_ASYNC_CONN_IDLE,4,2            ## @ASYNC_CONN_IDLE
L_.str.1:                               ## @.str.1
	.asciz	"SCIFAPI bind: bound to port number %d\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_scif_bind                      ; -- Begin function scif_bind
	.p2align	2
_scif_bind:                             ; @scif_bind
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x22, _scif_info@GOTPAGE
Lloh1:
	ldr	x22, [x22, _scif_info@GOTPAGEOFF]
Lloh2:
	adrp	x8, _scif_ep_states@GOTPAGE
Lloh3:
	ldr	x8, [x8, _scif_ep_states@GOTPAGEOFF]
	ldr	w0, [x22]
Lloh4:
	ldr	x8, [x8]
	ldr	x9, [x20]
	ldr	w8, [x8, x9, lsl #2]
	mov	x9, x1
	stp	x8, x9, [sp, #8]
	str	x20, [sp]
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_dbg
	cbz	w19, LBB0_3
; %bb.1:
Lloh7:
	adrp	x8, _SCIF_ADMIN_PORT_END@GOTPAGE
Lloh8:
	ldr	x8, [x8, _SCIF_ADMIN_PORT_END@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	cmp	w8, w19
	b.le	LBB0_3
; %bb.2:
Lloh10:
	adrp	x8, _CAP_SYS_ADMIN@GOTPAGE
Lloh11:
	ldr	x8, [x8, _CAP_SYS_ADMIN@GOTPAGEOFF]
Lloh12:
	ldr	w0, [x8]
	bl	_capable
	cbz	w0, LBB0_12
LBB0_3:
	add	x21, x20, #8
	mov	x0, x21
	bl	_spin_lock
	ldr	x8, [x20]
Lloh13:
	adrp	x23, _SCIFEP_BOUND@GOTPAGE
Lloh14:
	ldr	x23, [x23, _SCIFEP_BOUND@GOTPAGEOFF]
	ldr	x9, [x23]
	cmp	x8, x9
	b.ne	LBB0_5
LBB0_4:
Lloh15:
	adrp	x8, _EINVAL@GOTPAGE
Lloh16:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_9
LBB0_5:
Lloh17:
	adrp	x9, _SCIFEP_UNBOUND@GOTPAGE
Lloh18:
	ldr	x9, [x9, _SCIFEP_UNBOUND@GOTPAGEOFF]
Lloh19:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_8
; %bb.6:
	cbz	w19, LBB0_13
; %bb.7:
	mov	x0, x19
	bl	_scif_rsrv_port
	cmp	w0, w19
	b.ne	LBB0_4
	b	LBB0_14
LBB0_8:
Lloh20:
	adrp	x8, _EISCONN@GOTPAGE
Lloh21:
	ldr	x8, [x8, _EISCONN@GOTPAGEOFF]
LBB0_9:
	ldr	w8, [x8]
	neg	w19, w8
LBB0_10:
	mov	x0, x21
	bl	_spin_unlock
LBB0_11:
	mov	x0, x19
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_12:
Lloh22:
	adrp	x8, _EACCES@GOTPAGE
Lloh23:
	ldr	x8, [x8, _EACCES@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
	neg	w19, w8
	b	LBB0_11
LBB0_13:
	bl	_scif_get_new_port
	mov	x19, x0
	tbnz	w0, #31, LBB0_10
LBB0_14:
	ldr	x8, [x23]
	str	x8, [x20]
	ldp	w0, w8, [x22]
	str	w8, [x20, #20]
Lloh25:
	adrp	x8, _ASYNC_CONN_IDLE@GOTPAGE
Lloh26:
	ldr	x8, [x8, _ASYNC_CONN_IDLE@GOTPAGEOFF]
Lloh27:
	ldr	w8, [x8]
	stp	w8, w19, [x20, #12]
	str	x19, [sp]
Lloh28:
	adrp	x1, l_.str.1@PAGE
Lloh29:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_dbg
	b	LBB0_10
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_scif_info,8,2                  ; @scif_info
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"SCIFAPI bind: ep %p %s requested port number %d\n"

	.comm	_scif_ep_states,8,3             ; @scif_ep_states
	.comm	_SCIF_ADMIN_PORT_END,4,2        ; @SCIF_ADMIN_PORT_END
	.comm	_CAP_SYS_ADMIN,4,2              ; @CAP_SYS_ADMIN
	.comm	_EACCES,4,2                     ; @EACCES
	.comm	_SCIFEP_BOUND,8,3               ; @SCIFEP_BOUND
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_SCIFEP_UNBOUND,8,3             ; @SCIFEP_UNBOUND
	.comm	_EISCONN,4,2                    ; @EISCONN
	.comm	_ASYNC_CONN_IDLE,4,2            ; @ASYNC_CONN_IDLE
l_.str.1:                               ; @.str.1
	.asciz	"SCIFAPI bind: bound to port number %d\n"

.subsections_via_symbols
