	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function s3_wmi_query_block
_s3_wmi_query_block:                    ## @s3_wmi_query_block
	.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	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movl	%esi, %r15d
	movq	%rdi, %rbx
	movq	_ACPI_ALLOCATE_BUFFER@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	$0, -40(%rbp)
	movl	$0, -32(%rbp)
	movq	_s3_wmi_lock@GOTPCREL(%rip), %rdi
	callq	_mutex_lock
	leaq	-48(%rbp), %rdx
	movq	%rbx, %rdi
	movl	%r15d, %esi
	callq	_wmi_query_block
	movq	-48(%rbp), %r15
	testq	%r15, %r15
	je	LBB0_3
## %bb.1:
	movq	(%r15), %rsi
	movq	_ACPI_TYPE_INTEGER@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rsi
	jne	LBB0_2
## %bb.4:
	movl	%esi, (%r14)
	xorl	%ebx, %ebx
	jmp	LBB0_5
LBB0_2:
	movq	_ACPI_TYPE_BUFFER@GOTPCREL(%rip), %rax
	xorl	%edx, %edx
	cmpq	(%rax), %rsi
	cmovel	%esi, %edx
	leaq	L_.str(%rip), %rdi
	callq	_pr_err
LBB0_3:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_5:
	movq	%r15, %rdi
	callq	_kfree
	movq	_s3_wmi_lock@GOTPCREL(%rip), %rdi
	callq	_mutex_unlock
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ACPI_ALLOCATE_BUFFER,4,2       ## @ACPI_ALLOCATE_BUFFER
	.comm	_s3_wmi_lock,4,2                ## @s3_wmi_lock
	.comm	_ACPI_TYPE_INTEGER,8,3          ## @ACPI_TYPE_INTEGER
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"query block returned object type: %d - buffer length:%d\n"

	.comm	_ACPI_TYPE_BUFFER,8,3           ## @ACPI_TYPE_BUFFER
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_s3_wmi_query_block
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function s3_wmi_query_block
_s3_wmi_query_block:                    ; @s3_wmi_query_block
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	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
	mov	x20, x2
	mov	x19, x1
	mov	x21, x0
Lloh0:
	adrp	x8, _ACPI_ALLOCATE_BUFFER@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ACPI_ALLOCATE_BUFFER@GOTPAGEOFF]
Lloh2:
	ldrsw	x8, [x8]
	stp	x8, xzr, [sp, #8]
	str	wzr, [sp, #24]
Lloh3:
	adrp	x0, _s3_wmi_lock@GOTPAGE
Lloh4:
	ldr	x0, [x0, _s3_wmi_lock@GOTPAGEOFF]
	bl	_mutex_lock
	add	x2, sp, #8
	mov	x0, x21
	mov	x1, x19
	bl	_wmi_query_block
	ldr	x19, [sp, #8]
	cbz	x19, LBB0_4
; %bb.1:
	ldr	x1, [x19]
Lloh5:
	adrp	x8, _ACPI_TYPE_INTEGER@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ACPI_TYPE_INTEGER@GOTPAGEOFF]
Lloh7:
	ldr	x8, [x8]
	cmp	x1, x8
	b.ne	LBB0_3
; %bb.2:
	mov	w21, #0
	str	w1, [x20]
	b	LBB0_5
LBB0_3:
Lloh8:
	adrp	x8, _ACPI_TYPE_BUFFER@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ACPI_TYPE_BUFFER@GOTPAGEOFF]
Lloh10:
	ldr	x8, [x8]
	cmp	x1, x8
	csel	w2, w1, wzr, eq
Lloh11:
	adrp	x0, l_.str@PAGE
Lloh12:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_err
LBB0_4:
Lloh13:
	adrp	x8, _EINVAL@GOTPAGE
Lloh14:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_5:
	mov	x0, x19
	bl	_kfree
Lloh16:
	adrp	x0, _s3_wmi_lock@GOTPAGE
Lloh17:
	ldr	x0, [x0, _s3_wmi_lock@GOTPAGEOFF]
	bl	_mutex_unlock
	mov	x0, x21
	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
	add	sp, sp, #80
	ret
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_ACPI_ALLOCATE_BUFFER,4,2       ; @ACPI_ALLOCATE_BUFFER
	.comm	_s3_wmi_lock,4,2                ; @s3_wmi_lock
	.comm	_ACPI_TYPE_INTEGER,8,3          ; @ACPI_TYPE_INTEGER
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"query block returned object type: %d - buffer length:%d\n"

	.comm	_ACPI_TYPE_BUFFER,8,3           ; @ACPI_TYPE_BUFFER
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_s3_wmi_query_block
.subsections_via_symbols
