	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function xnu_restore_exception_ports
_xnu_restore_exception_ports:           ## @xnu_restore_exception_ports
	.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
	callq	_pid_to_task
	movl	%eax, %r15d
	xorl	%eax, %eax
	testl	%r15d, %r15d
	je	LBB0_8
## %bb.1:
	movq	_ex@GOTPCREL(%rip), %r12
	cmpl	$0, (%r12)
	jle	LBB0_5
## %bb.2:
	xorl	%ebx, %ebx
	movq	_KERN_SUCCESS@GOTPCREL(%rip), %r13
	leaq	L_.str(%rip), %r14
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	32(%r12), %rax
	movl	(%rax,%rbx,4), %esi
	movq	24(%r12), %rax
	movl	(%rax,%rbx,4), %edx
	movq	8(%r12), %rax
	movq	16(%r12), %rcx
	movl	(%rcx,%rbx,4), %ecx
	movl	(%rax,%rbx,4), %r8d
	movl	%r15d, %edi
	callq	_task_set_exception_ports
	cmpq	(%r13), %rax
	jne	LBB0_7
## %bb.3:                               ##   in Loop: Header=BB0_4 Depth=1
	incq	%rbx
	movslq	(%r12), %rax
	cmpq	%rax, %rbx
	jl	LBB0_4
LBB0_5:
	xorl	%eax, %eax
	callq	_mach_task_self
	movl	4(%r12), %esi
	movl	%eax, %edi
	callq	_mach_port_deallocate
	movq	%rax, %rcx
	movq	_KERN_SUCCESS@GOTPCREL(%rip), %rdx
	movl	$1, %eax
	cmpq	(%rdx), %rcx
	je	LBB0_8
## %bb.6:
	leaq	L_.str.1(%rip), %r14
LBB0_7:
	movq	%r14, %rdi
	callq	_eprintf
	xorl	%eax, %eax
LBB0_8:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ex,40,3                        ## @ex
	.comm	_KERN_SUCCESS,8,3               ## @KERN_SUCCESS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"fail to restore exception ports\n"

L_.str.1:                               ## @.str.1
	.asciz	"failed to deallocate exception port\n"

	.no_dead_strip	_xnu_restore_exception_ports
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function xnu_restore_exception_ports
_xnu_restore_exception_ports:           ; @xnu_restore_exception_ports
	.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
	bl	_pid_to_task
	cbz	w0, LBB0_9
; %bb.1:
Lloh0:
	adrp	x22, _ex@GOTPAGE
Lloh1:
	ldr	x22, [x22, _ex@GOTPAGEOFF]
	ldr	w8, [x22]
Lloh2:
	adrp	x21, _KERN_SUCCESS@GOTPAGE
Lloh3:
	ldr	x21, [x21, _KERN_SUCCESS@GOTPAGEOFF]
	cmp	w8, #1
	b.lt	LBB0_5
; %bb.2:
	mov	x19, x0
	mov	x23, #0
Lloh4:
	adrp	x20, l_.str@PAGE
Lloh5:
	add	x20, x20, l_.str@PAGEOFF
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	lsl	x8, x23, #2
	ldp	x10, x9, [x22, #24]
	ldr	w1, [x9, x8]
	ldr	w2, [x10, x8]
	ldp	x10, x9, [x22, #8]
	ldr	w3, [x9, x8]
	ldr	w4, [x10, x8]
	mov	x0, x19
	bl	_task_set_exception_ports
	ldr	x8, [x21]
	cmp	x0, x8
	b.ne	LBB0_8
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	add	x23, x23, #1
	ldrsw	x8, [x22]
	cmp	x23, x8
	b.lt	LBB0_3
LBB0_5:
	bl	_mach_task_self
	ldr	w1, [x22, #4]
	bl	_mach_port_deallocate
	ldr	x8, [x21]
	cmp	x0, x8
	b.ne	LBB0_7
; %bb.6:
	mov	w0, #1
	b	LBB0_9
LBB0_7:
Lloh6:
	adrp	x20, l_.str.1@PAGE
Lloh7:
	add	x20, x20, l_.str.1@PAGEOFF
LBB0_8:
	mov	x0, x20
	bl	_eprintf
	mov	w0, #0
LBB0_9:
	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
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_ex,40,3                        ; @ex
	.comm	_KERN_SUCCESS,8,3               ; @KERN_SUCCESS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"fail to restore exception ports\n"

l_.str.1:                               ; @.str.1
	.asciz	"failed to deallocate exception port\n"

	.no_dead_strip	_xnu_restore_exception_ports
.subsections_via_symbols
