	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function es2_cport_allocate
_es2_cport_allocate:                    ## @es2_cport_allocate
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r15
	movl	%esi, %r14d
	movq	%rdi, %rbx
	callq	_hd_to_es2
	movl	%r14d, %ecx
	andl	$-2, %ecx
	cmpl	$128, %ecx
	jne	LBB0_2
## %bb.1:
	addq	$4, %rbx
	leaq	L_.str(%rip), %rsi
	xorl	%r15d, %r15d
	movq	%rbx, %rdi
	movl	%r14d, %edx
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_6
LBB0_2:
	movq	_GB_CONNECTION_FLAG_OFFLOADED@GOTPCREL(%rip), %rcx
	testq	%r15, (%rcx)
	je	LBB0_9
## %bb.3:
	movq	_GB_CONNECTION_FLAG_CDSI1@GOTPCREL(%rip), %rcx
	testq	%r15, (%rcx)
	je	LBB0_9
## %bb.4:
	cmpl	$0, (%rax)
	je	LBB0_15
## %bb.5:
	addq	$4, %rbx
	leaq	L_.str.1(%rip), %rsi
	xorl	%r15d, %r15d
	movq	%rbx, %rdi
	xorl	%eax, %eax
	callq	_dev_err
LBB0_6:
	movq	_EBUSY@GOTPCREL(%rip), %rax
LBB0_7:
	subl	(%rax), %r15d
LBB0_8:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	movl	(%rbx), %edx
	testl	%r14d, %r14d
	js	LBB0_12
## %bb.10:
	cmpl	%r14d, %edx
	jle	LBB0_14
## %bb.11:
	leal	1(%r14), %edx
	jmp	LBB0_13
LBB0_12:
	xorl	%r14d, %r14d
LBB0_13:
	addq	$8, %rbx
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%rbx, %rdi
	movl	%r14d, %esi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ida_simple_get                 ## TAILCALL
LBB0_14:
	addq	$4, %rbx
	leaq	L_.str(%rip), %rsi
	xorl	%r15d, %r15d
	movq	%rbx, %rdi
	movl	%r14d, %edx
	xorl	%eax, %eax
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_15:
	movl	$1, (%rax)
	movl	$128, %r15d
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"cport %d not available\n"

	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_GB_CONNECTION_FLAG_OFFLOADED,8,3 ## @GB_CONNECTION_FLAG_OFFLOADED
	.comm	_GB_CONNECTION_FLAG_CDSI1,8,3   ## @GB_CONNECTION_FLAG_CDSI1
L_.str.1:                               ## @.str.1
	.asciz	"CDSI1 already in use\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.no_dead_strip	_es2_cport_allocate
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function es2_cport_allocate
_es2_cport_allocate:                    ; @es2_cport_allocate
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x21, x2
	mov	x20, x1
	mov	x19, x0
	bl	_hd_to_es2
	and	w8, w20, #0xfffffffe
	cmp	w8, #128
	b.ne	LBB0_2
; %bb.1:
	add	x0, x19, #4
	str	x20, [sp]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_6
LBB0_2:
Lloh2:
	adrp	x8, _GB_CONNECTION_FLAG_OFFLOADED@GOTPAGE
Lloh3:
	ldr	x8, [x8, _GB_CONNECTION_FLAG_OFFLOADED@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	tst	x8, x21
	b.eq	LBB0_9
; %bb.3:
Lloh5:
	adrp	x8, _GB_CONNECTION_FLAG_CDSI1@GOTPAGE
Lloh6:
	ldr	x8, [x8, _GB_CONNECTION_FLAG_CDSI1@GOTPAGEOFF]
Lloh7:
	ldr	x8, [x8]
	tst	x8, x21
	b.eq	LBB0_9
; %bb.4:
	ldr	w8, [x0]
	cbz	w8, LBB0_15
; %bb.5:
	add	x0, x19, #4
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_6:
	bl	_dev_err
Lloh10:
	adrp	x8, _EBUSY@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EBUSY@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
	add	sp, sp, #64
	ret
LBB0_9:
	ldr	w2, [x19]
	tbnz	w20, #31, LBB0_12
; %bb.10:
	cmp	w2, w20
	b.le	LBB0_14
; %bb.11:
	add	w2, w20, #1
	b	LBB0_13
LBB0_12:
	mov	w20, #0
LBB0_13:
Lloh12:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
	add	x0, x19, #8
Lloh14:
	ldr	w3, [x8]
	mov	x1, x20
	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
	add	sp, sp, #64
	b	_ida_simple_get
LBB0_14:
	add	x0, x19, #4
                                        ; kill: def $w20 killed $w20 killed $x20 def $x20
	str	x20, [sp]
Lloh15:
	adrp	x1, l_.str@PAGE
Lloh16:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
Lloh17:
	adrp	x8, _EINVAL@GOTPAGE
Lloh18:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_7
LBB0_15:
	mov	w8, #1
	str	w8, [x0]
	mov	w0, #128
	b	LBB0_8
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpAdd	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"cport %d not available\n"

	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_GB_CONNECTION_FLAG_OFFLOADED,8,3 ; @GB_CONNECTION_FLAG_OFFLOADED
	.comm	_GB_CONNECTION_FLAG_CDSI1,8,3   ; @GB_CONNECTION_FLAG_CDSI1
l_.str.1:                               ; @.str.1
	.asciz	"CDSI1 already in use\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.no_dead_strip	_es2_cport_allocate
.subsections_via_symbols
