	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sony_nc_thermal_mode_set
_sony_nc_thermal_mode_set:              ## @sony_nc_thermal_mode_set
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movl	%edi, %ebx
	testl	%edi, %edi
	je	LBB0_5
## %bb.1:
	movq	_th_handle@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	testw	%bx, (%rax)
	je	LBB0_6
## %bb.2:
	movq	_THM_PROFILE_MAX@GOTPCREL(%rip), %rax
	cmpw	%bx, (%rax)
	jbe	LBB0_6
LBB0_3:
	leaq	-12(%rbp), %rdx
	movl	$290, %edi                      ## imm = 0x122
	movl	$512, %esi                      ## imm = 0x200
	callq	_sony_call_snc_handle
	testq	%rax, %rax
	je	LBB0_8
## %bb.4:
	movq	_EIO@GOTPCREL(%rip), %rcx
	jmp	LBB0_7
LBB0_5:
	movq	_THM_PROFILE_MAX@GOTPCREL(%rip), %rax
	cmpw	$0, (%rax)
	jne	LBB0_3
LBB0_6:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
LBB0_7:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_9:
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
LBB0_8:
	movq	_th_handle@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movw	%bx, 2(%rax)
	xorl	%eax, %eax
	jmp	LBB0_9
	.cfi_endproc
                                        ## -- End function
	.comm	_th_handle,8,3                  ## @th_handle
	.comm	_THM_PROFILE_MAX,2,1            ## @THM_PROFILE_MAX
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_EIO,4,2                        ## @EIO
	.no_dead_strip	_sony_nc_thermal_mode_set
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sony_nc_thermal_mode_set
_sony_nc_thermal_mode_set:              ; @sony_nc_thermal_mode_set
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	cbz	w0, LBB0_3
; %bb.1:
Lloh0:
	adrp	x8, _th_handle@GOTPAGE
Lloh1:
	ldr	x8, [x8, _th_handle@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	ldrh	w8, [x8]
	and	w8, w8, w19
Lloh3:
	adrp	x9, _THM_PROFILE_MAX@GOTPAGE
Lloh4:
	ldr	x9, [x9, _THM_PROFILE_MAX@GOTPAGEOFF]
	ldrh	w9, [x9]
	cmp	w8, #0
	ccmp	w9, w19, #0, ne
	b.hi	LBB0_4
LBB0_2:
Lloh5:
	adrp	x8, _EINVAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_6
LBB0_3:
Lloh7:
	adrp	x8, _THM_PROFILE_MAX@GOTPAGE
Lloh8:
	ldr	x8, [x8, _THM_PROFILE_MAX@GOTPAGEOFF]
	ldrh	w8, [x8]
	cbz	w8, LBB0_2
LBB0_4:
	add	x2, sp, #12
	mov	w0, #290
	mov	w1, #512
	bl	_sony_call_snc_handle
	cbz	x0, LBB0_7
; %bb.5:
Lloh9:
	adrp	x8, _EIO@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
LBB0_6:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_8
LBB0_7:
Lloh11:
	adrp	x8, _th_handle@GOTPAGE
Lloh12:
	ldr	x8, [x8, _th_handle@GOTPAGEOFF]
Lloh13:
	ldr	x8, [x8]
	strh	w19, [x8, #2]
LBB0_8:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_th_handle,8,3                  ; @th_handle
	.comm	_THM_PROFILE_MAX,2,1            ; @THM_PROFILE_MAX
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_EIO,4,2                        ; @EIO
	.no_dead_strip	_sony_nc_thermal_mode_set
.subsections_via_symbols
