	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_kernel_port_remove             ## -- Begin function kernel_port_remove
	.p2align	4, 0x90
_kernel_port_remove:                    ## @kernel_port_remove
	.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
	subq	$152, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	16(%rdi), %r12
	movq	24(%rdi), %r13
	leaq	-184(%rbp), %r14
	movq	%r14, %rdi
	movl	$72, %esi
	callq	_bzero
	movl	(%rbx), %eax
	movl	%eax, -116(%rbp)
	movq	_ctl_fd@GOTPCREL(%rip), %r15
	movl	(%r15), %edi
	movq	_CTL_DISABLE_PORT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdx
	callq	_ioctl
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	callq	_log_warn
	movl	$-1, %ebx
LBB0_21:
	movl	%ebx, %eax
	addq	$152, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	cmpq	$0, 16(%rbx)
	movq	8(%rbx), %r14
	jne	LBB0_4
## %bb.3:
	testq	%r14, %r14
	jne	LBB0_4
## %bb.19:
	movl	(%rbx), %eax
	movl	%eax, -80(%rbp)
	movq	_UINT32_MAX@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -88(%rbp)
	movq	%rax, -96(%rbp)
	movl	(%r15), %edi
	movq	_CTL_LUN_MAP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-112(%rbp), %rdx
	callq	_ioctl
	xorl	%ebx, %ebx
	testl	%eax, %eax
	je	LBB0_21
## %bb.20:
	leaq	L_.str.13(%rip), %rdi
	callq	_log_warn
	jmp	LBB0_21
LBB0_4:
	leaq	-112(%rbp), %rdi
	movl	$72, %esi
	callq	_bzero
	testq	%r14, %r14
	movl	-48(%rbp), %edi
	leaq	L_.str.2(%rip), %rax
	leaq	L_.str.1(%rip), %rsi
	cmoveq	%rax, %rsi
	movl	$4, %edx
	callq	_strlcpy
	movq	_CTL_REQ_REMOVE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -52(%rbp)
	xorl	%edi, %edi
	callq	_nvlist_create
	movq	%rax, %r14
	movq	%rax, -72(%rbp)
	testq	%rax, %rax
	je	LBB0_5
## %bb.6:
	cmpq	$0, 8(%rbx)
	je	LBB0_8
LBB0_7:
	movl	(%rbx), %ecx
	leaq	L_.str.4(%rip), %rsi
	leaq	L_.str.5(%rip), %rdx
	jmp	LBB0_9
LBB0_5:
	leaq	L_.str.3(%rip), %rsi
	movl	$1, %edi
	callq	_log_err
	cmpq	$0, 8(%rbx)
	jne	LBB0_7
LBB0_8:
	movl	(%r13), %edx
	leaq	L_.str.6(%rip), %rsi
	movq	%r14, %rdi
	callq	_nvlist_add_string
	movl	(%r12), %ecx
	leaq	L_.str.7(%rip), %rsi
	leaq	L_.str.8(%rip), %rdx
LBB0_9:
	movq	%r14, %rdi
	callq	_nvlist_add_stringf
	leaq	-56(%rbp), %rsi
	movq	%r14, %rdi
	callq	_nvlist_pack
	movq	%rax, -64(%rbp)
	testq	%rax, %rax
	je	LBB0_10
## %bb.12:
	movl	(%r15), %edi
	movq	_CTL_PORT_REQ@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-112(%rbp), %rdx
	callq	_ioctl
	movl	%eax, %ebx
	movq	-72(%rbp), %rdi
	callq	_nvlist_destroy
	testl	%ebx, %ebx
	je	LBB0_14
## %bb.13:
	leaq	L_.str.10(%rip), %rdi
	jmp	LBB0_11
LBB0_10:
	leaq	L_.str.9(%rip), %rdi
LBB0_11:
	callq	_log_warn
	movl	$1, %ebx
	jmp	LBB0_21
LBB0_14:
	movq	-112(%rbp), %rsi
	movq	_CTL_LUN_ERROR@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rsi
	jne	LBB0_16
## %bb.15:
	movq	-104(%rbp), %rsi
	leaq	L_.str.11(%rip), %rdi
	jmp	LBB0_18
LBB0_16:
	movq	_CTL_LUN_OK@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	cmpq	(%rax), %rsi
	je	LBB0_21
## %bb.17:
	leaq	L_.str.12(%rip), %rdi
LBB0_18:
	callq	_log_warnx
	movl	$1, %ebx
	jmp	LBB0_21
	.cfi_endproc
                                        ## -- End function
	.comm	_ctl_fd,4,2                     ## @ctl_fd
	.comm	_CTL_DISABLE_PORT,4,2           ## @CTL_DISABLE_PORT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"CTL_DISABLE_PORT ioctl failed"

L_.str.1:                               ## @.str.1
	.asciz	"ioctl"

L_.str.2:                               ## @.str.2
	.asciz	"iscsi"

	.comm	_CTL_REQ_REMOVE,4,2             ## @CTL_REQ_REMOVE
L_.str.3:                               ## @.str.3
	.asciz	"nvlist_create"

L_.str.4:                               ## @.str.4
	.asciz	"port_id"

L_.str.5:                               ## @.str.5
	.asciz	"%d"

L_.str.6:                               ## @.str.6
	.asciz	"cfiscsi_target"

L_.str.7:                               ## @.str.7
	.asciz	"cfiscsi_portal_group_tag"

L_.str.8:                               ## @.str.8
	.asciz	"%u"

L_.str.9:                               ## @.str.9
	.asciz	"error packing nvlist"

	.comm	_CTL_PORT_REQ,4,2               ## @CTL_PORT_REQ
L_.str.10:                              ## @.str.10
	.asciz	"error issuing CTL_PORT_REQ ioctl"

	.comm	_CTL_LUN_ERROR,8,3              ## @CTL_LUN_ERROR
L_.str.11:                              ## @.str.11
	.asciz	"error returned from port removal request: %s"

	.comm	_CTL_LUN_OK,8,3                 ## @CTL_LUN_OK
L_.str.12:                              ## @.str.12
	.asciz	"unknown port removal request status %d"

	.comm	_UINT32_MAX,8,3                 ## @UINT32_MAX
	.comm	_CTL_LUN_MAP,4,2                ## @CTL_LUN_MAP
L_.str.13:                              ## @.str.13
	.asciz	"CTL_LUN_MAP ioctl failed"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_kernel_port_remove             ; -- Begin function kernel_port_remove
	.p2align	2
_kernel_port_remove:                    ; @kernel_port_remove
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #208
	.cfi_def_cfa_offset 208
	stp	x24, x23, [sp, #144]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #160]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #176]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #192]            ; 16-byte Folded Spill
	add	x29, sp, #192
	.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, x0
	ldp	x22, x23, [x0, #16]
	add	x0, sp, #72
	mov	w1, #72
	bl	_bzero
	ldr	w8, [x19]
	str	w8, [sp, #140]
Lloh0:
	adrp	x21, _ctl_fd@GOTPAGE
Lloh1:
	ldr	x21, [x21, _ctl_fd@GOTPAGEOFF]
	ldr	w0, [x21]
Lloh2:
	adrp	x8, _CTL_DISABLE_PORT@GOTPAGE
Lloh3:
	ldr	x8, [x8, _CTL_DISABLE_PORT@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	add	x2, sp, #72
	bl	_ioctl
	cbz	w0, LBB0_3
; %bb.1:
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	bl	_log_warn
	mov	w0, #-1
LBB0_2:
	ldp	x29, x30, [sp, #192]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #176]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #160]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #144]            ; 16-byte Folded Reload
	add	sp, sp, #208
	ret
LBB0_3:
	ldp	x20, x8, [x19, #8]
	cbnz	x8, LBB0_8
; %bb.4:
	cbnz	x20, LBB0_8
; %bb.5:
	ldr	w8, [x19]
	str	w8, [sp, #32]
Lloh7:
	adrp	x8, _UINT32_MAX@GOTPAGE
Lloh8:
	ldr	x8, [x8, _UINT32_MAX@GOTPAGEOFF]
Lloh9:
	ldr	x8, [x8]
	stp	x8, x8, [sp, #16]
	ldr	w0, [x21]
Lloh10:
	adrp	x8, _CTL_LUN_MAP@GOTPAGE
Lloh11:
	ldr	x8, [x8, _CTL_LUN_MAP@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
	mov	x2, sp
	bl	_ioctl
	cbz	w0, LBB0_2
; %bb.6:
Lloh13:
	adrp	x0, l_.str.13@PAGE
Lloh14:
	add	x0, x0, l_.str.13@PAGEOFF
	bl	_log_warn
LBB0_7:
	mov	w0, #0
	b	LBB0_2
LBB0_8:
	mov	x0, sp
	mov	w1, #72
	bl	_bzero
	ldr	w0, [sp, #64]
Lloh15:
	adrp	x8, l_.str.1@PAGE
Lloh16:
	add	x8, x8, l_.str.1@PAGEOFF
Lloh17:
	adrp	x9, l_.str.2@PAGE
Lloh18:
	add	x9, x9, l_.str.2@PAGEOFF
	cmp	x20, #0
	csel	x1, x9, x8, eq
	mov	w2, #4
	bl	_strlcpy
Lloh19:
	adrp	x8, _CTL_REQ_REMOVE@GOTPAGE
Lloh20:
	ldr	x8, [x8, _CTL_REQ_REMOVE@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	str	w8, [sp, #60]
	mov	w0, #0
	bl	_nvlist_create
	mov	x20, x0
	str	x0, [sp, #40]
	cbz	x0, LBB0_11
; %bb.9:
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_12
LBB0_10:
	ldr	w3, [x19]
Lloh22:
	adrp	x1, l_.str.4@PAGE
Lloh23:
	add	x1, x1, l_.str.4@PAGEOFF
Lloh24:
	adrp	x2, l_.str.5@PAGE
Lloh25:
	add	x2, x2, l_.str.5@PAGEOFF
	b	LBB0_13
LBB0_11:
Lloh26:
	adrp	x1, l_.str.3@PAGE
Lloh27:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	w0, #1
	bl	_log_err
	ldr	x8, [x19, #8]
	cbnz	x8, LBB0_10
LBB0_12:
	ldr	w2, [x23]
Lloh28:
	adrp	x1, l_.str.6@PAGE
Lloh29:
	add	x1, x1, l_.str.6@PAGEOFF
	mov	x0, x20
	bl	_nvlist_add_string
	ldr	w3, [x22]
Lloh30:
	adrp	x1, l_.str.7@PAGE
Lloh31:
	add	x1, x1, l_.str.7@PAGEOFF
Lloh32:
	adrp	x2, l_.str.8@PAGE
Lloh33:
	add	x2, x2, l_.str.8@PAGEOFF
LBB0_13:
	mov	x0, x20
	bl	_nvlist_add_stringf
	mov	x8, sp
	add	x1, x8, #56
	mov	x0, x20
	bl	_nvlist_pack
	str	x0, [sp, #48]
	cbz	x0, LBB0_16
; %bb.14:
	ldr	w0, [x21]
Lloh34:
	adrp	x8, _CTL_PORT_REQ@GOTPAGE
Lloh35:
	ldr	x8, [x8, _CTL_PORT_REQ@GOTPAGEOFF]
Lloh36:
	ldr	w1, [x8]
	mov	x2, sp
	bl	_ioctl
	mov	x19, x0
	ldr	x0, [sp, #40]
	bl	_nvlist_destroy
	cbz	w19, LBB0_18
; %bb.15:
Lloh37:
	adrp	x0, l_.str.10@PAGE
Lloh38:
	add	x0, x0, l_.str.10@PAGEOFF
	b	LBB0_17
LBB0_16:
Lloh39:
	adrp	x0, l_.str.9@PAGE
Lloh40:
	add	x0, x0, l_.str.9@PAGEOFF
LBB0_17:
	bl	_log_warn
	mov	w0, #1
	b	LBB0_2
LBB0_18:
	ldr	x1, [sp]
Lloh41:
	adrp	x8, _CTL_LUN_ERROR@GOTPAGE
Lloh42:
	ldr	x8, [x8, _CTL_LUN_ERROR@GOTPAGEOFF]
Lloh43:
	ldr	x8, [x8]
	cmp	x1, x8
	b.ne	LBB0_20
; %bb.19:
	ldr	x1, [sp, #8]
Lloh44:
	adrp	x0, l_.str.11@PAGE
Lloh45:
	add	x0, x0, l_.str.11@PAGEOFF
	b	LBB0_22
LBB0_20:
Lloh46:
	adrp	x8, _CTL_LUN_OK@GOTPAGE
Lloh47:
	ldr	x8, [x8, _CTL_LUN_OK@GOTPAGEOFF]
Lloh48:
	ldr	x8, [x8]
	cmp	x1, x8
	b.eq	LBB0_7
; %bb.21:
Lloh49:
	adrp	x0, l_.str.12@PAGE
Lloh50:
	add	x0, x0, l_.str.12@PAGEOFF
LBB0_22:
	bl	_log_warnx
	mov	w0, #1
	b	LBB0_2
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpAdd	Lloh37, Lloh38
	.loh AdrpAdd	Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpAdd	Lloh44, Lloh45
	.loh AdrpLdrGotLdr	Lloh46, Lloh47, Lloh48
	.loh AdrpAdd	Lloh49, Lloh50
	.cfi_endproc
                                        ; -- End function
	.comm	_ctl_fd,4,2                     ; @ctl_fd
	.comm	_CTL_DISABLE_PORT,4,2           ; @CTL_DISABLE_PORT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"CTL_DISABLE_PORT ioctl failed"

l_.str.1:                               ; @.str.1
	.asciz	"ioctl"

l_.str.2:                               ; @.str.2
	.asciz	"iscsi"

	.comm	_CTL_REQ_REMOVE,4,2             ; @CTL_REQ_REMOVE
l_.str.3:                               ; @.str.3
	.asciz	"nvlist_create"

l_.str.4:                               ; @.str.4
	.asciz	"port_id"

l_.str.5:                               ; @.str.5
	.asciz	"%d"

l_.str.6:                               ; @.str.6
	.asciz	"cfiscsi_target"

l_.str.7:                               ; @.str.7
	.asciz	"cfiscsi_portal_group_tag"

l_.str.8:                               ; @.str.8
	.asciz	"%u"

l_.str.9:                               ; @.str.9
	.asciz	"error packing nvlist"

	.comm	_CTL_PORT_REQ,4,2               ; @CTL_PORT_REQ
l_.str.10:                              ; @.str.10
	.asciz	"error issuing CTL_PORT_REQ ioctl"

	.comm	_CTL_LUN_ERROR,8,3              ; @CTL_LUN_ERROR
l_.str.11:                              ; @.str.11
	.asciz	"error returned from port removal request: %s"

	.comm	_CTL_LUN_OK,8,3                 ; @CTL_LUN_OK
l_.str.12:                              ; @.str.12
	.asciz	"unknown port removal request status %d"

	.comm	_UINT32_MAX,8,3                 ; @UINT32_MAX
	.comm	_CTL_LUN_MAP,4,2                ; @CTL_LUN_MAP
l_.str.13:                              ; @.str.13
	.asciz	"CTL_LUN_MAP ioctl failed"

.subsections_via_symbols
