	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function thermal_set_mode
_thermal_set_mode:                      ## @thermal_set_mode
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	(%rdi), %r14
	testq	%r14, %r14
	je	LBB0_1
## %bb.2:
	movq	_THERMAL_DEVICE_ENABLED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	$1, %ecx
	cmpl	%esi, %eax
	je	LBB0_4
## %bb.3:
	movq	_THERMAL_DEVICE_DISABLED@GOTPCREL(%rip), %rdx
	xorl	%ecx, %ecx
	cmpl	%esi, (%rdx)
	jne	LBB0_1
LBB0_4:
	xorl	%ebx, %ebx
	cmpl	(%r14), %ecx
	je	LBB0_9
## %bb.5:
	movl	%ecx, (%r14)
	cmpl	%esi, %eax
	jne	LBB0_6
## %bb.7:
	movq	_enabled@GOTPCREL(%rip), %rax
	jmp	LBB0_8
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_9
LBB0_6:
	movq	_disabled@GOTPCREL(%rip), %rax
LBB0_8:
	movl	(%rax), %edi
	callq	_ACPI_DEBUG_PRINT
	movq	%r14, %rdi
	callq	_acpi_thermal_check
LBB0_9:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_THERMAL_DEVICE_ENABLED,4,2     ## @THERMAL_DEVICE_ENABLED
	.comm	_THERMAL_DEVICE_DISABLED,4,2    ## @THERMAL_DEVICE_DISABLED
	.comm	_ACPI_DB_INFO,4,2               ## @ACPI_DB_INFO
	.comm	_enabled,4,2                    ## @enabled
	.comm	_disabled,4,2                   ## @disabled
	.no_dead_strip	_thermal_set_mode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function thermal_set_mode
_thermal_set_mode:                      ; @thermal_set_mode
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	ldr	x19, [x0]
	cbz	x19, LBB0_8
; %bb.1:
Lloh0:
	adrp	x8, _THERMAL_DEVICE_ENABLED@GOTPAGE
Lloh1:
	ldr	x8, [x8, _THERMAL_DEVICE_ENABLED@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w1
	b.ne	LBB0_3
; %bb.2:
	mov	w9, #1
	b	LBB0_5
LBB0_3:
Lloh3:
	adrp	x9, _THERMAL_DEVICE_DISABLED@GOTPAGE
Lloh4:
	ldr	x9, [x9, _THERMAL_DEVICE_DISABLED@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	cmp	w9, w1
	b.ne	LBB0_8
; %bb.4:
	mov	w9, #0
LBB0_5:
	ldr	w10, [x19]
	cmp	w9, w10
	b.eq	LBB0_7
; %bb.6:
Lloh6:
	adrp	x10, _enabled@GOTPAGE
Lloh7:
	ldr	x10, [x10, _enabled@GOTPAGEOFF]
	str	w9, [x19]
Lloh8:
	adrp	x9, _disabled@GOTPAGE
Lloh9:
	ldr	x9, [x9, _disabled@GOTPAGEOFF]
	cmp	w8, w1
	csel	x8, x10, x9, eq
	ldr	w0, [x8]
	bl	_ACPI_DEBUG_PRINT
	mov	x0, x19
	bl	_acpi_thermal_check
LBB0_7:
	mov	w0, #0
	b	LBB0_9
LBB0_8:
Lloh10:
	adrp	x8, _EINVAL@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_9:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_THERMAL_DEVICE_ENABLED,4,2     ; @THERMAL_DEVICE_ENABLED
	.comm	_THERMAL_DEVICE_DISABLED,4,2    ; @THERMAL_DEVICE_DISABLED
	.comm	_ACPI_DB_INFO,4,2               ; @ACPI_DB_INFO
	.comm	_enabled,4,2                    ; @enabled
	.comm	_disabled,4,2                   ; @disabled
	.no_dead_strip	_thermal_set_mode
.subsections_via_symbols
