	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ni_upload_sw_state
_ni_upload_sw_state:                    ## @ni_upload_sw_state
	.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	%rsi, -56(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r12
	callq	_rv770_get_pi
	movq	%rax, %r14
	movl	(%rax), %r15d
	movq	_NISLANDS_SMC_STATETABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_driverState@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_offsetof
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movq	_NISLANDS_MAX_SMC_PERFORMANCE_LEVELS_PER_SWSTATE@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	shll	$2, %ebx
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%ebx, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r13
	movl	%r15d, -44(%rbp)                ## 4-byte Spill
	movq	%r12, %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movq	%rax, %rdx
	callq	_ni_convert_power_state_to_smc
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_4
## %bb.3:
	movl	-48(%rbp), %esi                 ## 4-byte Reload
	addl	-44(%rbp), %esi                 ## 4-byte Folded Reload
	movl	4(%r14), %r8d
	movq	%r12, %rdi
	movq	%r13, %rdx
	movl	%ebx, %ecx
	callq	_rv770_copy_bytes_to_smc
	movl	%eax, %r15d
LBB0_4:
	movq	%r13, %rdi
	callq	_kfree
	jmp	LBB0_5
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
LBB0_5:
	movl	%r15d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_NISLANDS_SMC_STATETABLE,4,2    ## @NISLANDS_SMC_STATETABLE
	.comm	_driverState,4,2                ## @driverState
	.comm	_NISLANDS_MAX_SMC_PERFORMANCE_LEVELS_PER_SWSTATE,4,2 ## @NISLANDS_MAX_SMC_PERFORMANCE_LEVELS_PER_SWSTATE
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_ni_upload_sw_state
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ni_upload_sw_state
_ni_upload_sw_state:                    ; @ni_upload_sw_state
	.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	x22, x1
	mov	x19, x0
	bl	_rv770_get_pi
	mov	x20, x0
	ldr	w25, [x0]
Lloh0:
	adrp	x8, _NISLANDS_SMC_STATETABLE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _NISLANDS_SMC_STATETABLE@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
Lloh3:
	adrp	x8, _driverState@GOTPAGE
Lloh4:
	ldr	x8, [x8, _driverState@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	bl	_offsetof
	mov	x24, x0
Lloh6:
	adrp	x8, _NISLANDS_MAX_SMC_PERFORMANCE_LEVELS_PER_SWSTATE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _NISLANDS_MAX_SMC_PERFORMANCE_LEVELS_PER_SWSTATE@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	lsl	w23, w8, #2
Lloh9:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	x0, x23
	bl	_kzalloc
	cbz	x0, LBB0_4
; %bb.1:
	mov	x21, x0
	mov	x0, x19
	mov	x1, x22
	mov	x2, x21
	bl	_ni_convert_power_state_to_smc
	mov	x22, x0
	cbnz	w0, LBB0_3
; %bb.2:
	add	w1, w24, w25
	ldr	w4, [x20, #4]
	mov	x0, x19
	mov	x2, x21
	mov	x3, x23
	bl	_rv770_copy_bytes_to_smc
	mov	x22, x0
LBB0_3:
	mov	x0, x21
	bl	_kfree
	b	LBB0_5
LBB0_4:
Lloh12:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w22, w8
LBB0_5:
	mov	x0, x22
	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	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_NISLANDS_SMC_STATETABLE,4,2    ; @NISLANDS_SMC_STATETABLE
	.comm	_driverState,4,2                ; @driverState
	.comm	_NISLANDS_MAX_SMC_PERFORMANCE_LEVELS_PER_SWSTATE,4,2 ; @NISLANDS_MAX_SMC_PERFORMANCE_LEVELS_PER_SWSTATE
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_ni_upload_sw_state
.subsections_via_symbols
