	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function intel_th_remove
_intel_th_remove:                       ## @intel_th_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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r13
	movl	8(%rdi), %edi
	callq	_to_intel_th_driver
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	%r13, %rdi
	callq	_to_intel_th_device
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_to_intel_th_hub
	movq	%rax, %r12
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movq	(%rbx), %rax
	movq	_INTEL_TH_SWITCH@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_11
## %bb.1:
	movq	%r12, %rdi
	callq	_to_intel_th
	movq	%rax, %rbx
	movq	_intel_th_child_remove@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r13, %rdi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	callq	_device_for_each_child
	testl	%eax, %eax
	jne	LBB0_17
## %bb.2:
	movl	(%rbx), %eax
	testl	%eax, %eax
	jle	LBB0_11
## %bb.3:
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	movl	$-1, %r15d
	xorl	%r12d, %r12d
	movq	_INTEL_TH_OUTPUT@GOTPCREL(%rip), %r14
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_4 Depth=1
	cmpl	$-1, %r15d
	cmovel	%r12d, %r15d
	callq	_intel_th_device_remove
	movq	8(%rbx), %rax
	movq	$0, (%rax,%r12,8)
	movl	(%rbx), %eax
LBB0_8:                                 ##   in Loop: Header=BB0_4 Depth=1
	incq	%r12
	movslq	%eax, %rcx
	cmpq	%rcx, %r12
	jge	LBB0_9
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%rbx), %rcx
	movq	(%rcx,%r12,8), %rdi
	movq	(%rdi), %rdx
	cmpq	(%r14), %rdx
	je	LBB0_7
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	testl	%r15d, %r15d
	js	LBB0_8
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	%r15d, %edx
	movq	%rdi, (%rcx,%rdx,8)
	movq	8(%rbx), %rcx
	movq	$0, (%rcx,%r12,8)
	incl	%r15d
	jmp	LBB0_8
LBB0_9:
	testl	%r15d, %r15d
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	js	LBB0_11
## %bb.10:
	movl	%r15d, (%rbx)
LBB0_11:
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	movq	16(%rbx), %rsi
	testq	%rsi, %rsi
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	je	LBB0_13
## %bb.12:
	movq	%r14, %rdi
	addq	$16, %rdi
	callq	_sysfs_remove_group
LBB0_13:
	movq	%r13, %rdi
	callq	_pm_runtime_get_sync
	movq	%r14, %rdi
	callq	*8(%rbx)
	movq	%r14, %rdi
	callq	_intel_th_output_assigned
	testq	%rax, %rax
	je	LBB0_16
## %bb.14:
	movq	(%r13), %rax
	movl	(%rax), %edi
	callq	_to_intel_th_driver
	cmpq	$0, 8(%r12)
	je	LBB0_16
## %bb.15:
	movq	%r12, %rdi
	movq	%r14, %rsi
	callq	*(%rax)
LBB0_16:
	movq	%r13, %rdi
	callq	_pm_runtime_disable
	movq	%r13, %rdi
	callq	_pm_runtime_set_active
	movq	%r13, %rdi
	callq	_pm_runtime_enable
	xorl	%eax, %eax
LBB0_17:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_INTEL_TH_SWITCH,8,3            ## @INTEL_TH_SWITCH
	.comm	_intel_th_child_remove,4,2      ## @intel_th_child_remove
	.comm	_INTEL_TH_OUTPUT,8,3            ## @INTEL_TH_OUTPUT
	.no_dead_strip	_intel_th_remove
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function intel_th_remove
_intel_th_remove:                       ; @intel_th_remove
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x0
	ldr	w0, [x0, #8]
	bl	_to_intel_th_driver
	mov	x22, x0
	mov	x0, x19
	bl	_to_intel_th_device
	mov	x20, x0
	bl	_to_intel_th_hub
	mov	x21, x0
	ldr	x8, [x20]
Lloh0:
	adrp	x9, _INTEL_TH_SWITCH@GOTPAGE
Lloh1:
	ldr	x9, [x9, _INTEL_TH_SWITCH@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_11
; %bb.1:
	mov	x0, x21
	bl	_to_intel_th
	mov	x23, x0
Lloh3:
	adrp	x8, _intel_th_child_remove@GOTPAGE
Lloh4:
	ldr	x8, [x8, _intel_th_child_remove@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	mov	x0, x19
	mov	x1, x20
	bl	_device_for_each_child
	cbnz	w0, LBB0_17
; %bb.2:
	ldr	w8, [x23]
	cmp	w8, #1
	b.lt	LBB0_11
; %bb.3:
	mov	x25, #0
	mov	w24, #-1
Lloh6:
	adrp	x26, _INTEL_TH_OUTPUT@GOTPAGE
Lloh7:
	ldr	x26, [x26, _INTEL_TH_OUTPUT@GOTPAGEOFF]
	b	LBB0_6
LBB0_4:                                 ;   in Loop: Header=BB0_6 Depth=1
	cmn	w24, #1
	csel	w24, w25, w24, eq
	bl	_intel_th_device_remove
	ldr	x8, [x23, #8]
	str	xzr, [x8, x25, lsl #3]
	ldr	w8, [x23]
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	add	x25, x25, #1
	cmp	x25, w8, sxtw
	b.ge	LBB0_9
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x9, [x23, #8]
	ldr	x0, [x9, x25, lsl #3]
	ldr	x10, [x0]
	ldr	x11, [x26]
	cmp	x10, x11
	b.eq	LBB0_4
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	tbnz	w24, #31, LBB0_5
; %bb.8:                                ;   in Loop: Header=BB0_6 Depth=1
	str	x0, [x9, w24, uxtw #3]
	ldr	x9, [x23, #8]
	str	xzr, [x9, x25, lsl #3]
	add	w24, w24, #1
	b	LBB0_5
LBB0_9:
	tbnz	w24, #31, LBB0_11
; %bb.10:
	str	w24, [x23]
LBB0_11:
	ldr	x1, [x22, #16]
	cbz	x1, LBB0_13
; %bb.12:
	add	x0, x20, #16
	bl	_sysfs_remove_group
LBB0_13:
	mov	x0, x19
	bl	_pm_runtime_get_sync
	ldr	x8, [x22, #8]
	mov	x0, x20
	blr	x8
	mov	x0, x20
	bl	_intel_th_output_assigned
	cbz	x0, LBB0_16
; %bb.14:
	ldr	x8, [x19]
	ldr	w0, [x8]
	bl	_to_intel_th_driver
	ldr	x8, [x21, #8]
	cbz	x8, LBB0_16
; %bb.15:
	ldr	x8, [x0]
	mov	x0, x21
	mov	x1, x20
	blr	x8
LBB0_16:
	mov	x0, x19
	bl	_pm_runtime_disable
	mov	x0, x19
	bl	_pm_runtime_set_active
	mov	x0, x19
	bl	_pm_runtime_enable
	mov	w0, #0
LBB0_17:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_INTEL_TH_SWITCH,8,3            ; @INTEL_TH_SWITCH
	.comm	_intel_th_child_remove,4,2      ; @intel_th_child_remove
	.comm	_INTEL_TH_OUTPUT,8,3            ; @INTEL_TH_OUTPUT
	.no_dead_strip	_intel_th_remove
.subsections_via_symbols
