	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dcdbas_check_wsmt
_dcdbas_check_wsmt:                     ## @dcdbas_check_wsmt
	.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
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	$0, -24(%rbp)
	movq	_ACPI_SIG_WSMT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	xorl	%ebx, %ebx
	leaq	-24(%rbp), %rdx
	xorl	%esi, %esi
	callq	_acpi_get_table
	movq	-24(%rbp), %rax
	testq	%rax, %rax
	je	LBB0_14
## %bb.1:
	movl	(%rax), %eax
	movq	_ACPI_WSMT_FIXED_COMM_BUFFERS@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_14
## %bb.2:
	movq	_ACPI_WSMT_COMM_BUFFER_NESTED_PTR_PROTECTION@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_14
## %bb.3:
	movl	$983040, %edi                   ## imm = 0xF0000
	callq	___va
	movq	%rax, %rbx
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movl	$1048560, %edi                  ## imm = 0xFFFF0
	callq	___va
	cmpq	%rax, %rbx
	jae	LBB0_5
## %bb.8:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	%rbx, %rdi
	callq	_check_eps_table
	testq	%rax, %rax
	jne	LBB0_9
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=1
	addq	$64, %rbx
	jmp	LBB0_4
LBB0_5:
	movq	_dcdbas_pdev@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	leaq	L_.str(%rip), %rsi
	callq	_dev_dbg
	movq	_ENODEV@GOTPCREL(%rip), %rax
LBB0_6:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_14:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_9:
	movq	%rax, %r14
	movq	8(%rax), %rdi
	addq	$8, %rdi
	callq	_upper_32_bits
	testq	%rax, %rax
	je	LBB0_11
## %bb.10:
	movq	_dcdbas_pdev@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_warn
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_6
LBB0_11:
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	imull	(%r14), %eax
	movq	_MAX_SMI_DATA_BUF_SIZE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ebx
	addl	$8, %ebx
	cmpl	%ebx, %eax
	cmovll	%eax, %ebx
	movq	8(%r14), %rdi
	movq	_MEMREMAP_WB@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%ebx, %esi
	callq	_memremap
	movq	_eps_buffer@GOTPCREL(%rip), %rcx
	movq	%rax, (%rcx)
	testq	%rax, %rax
	je	LBB0_12
## %bb.13:
	movq	8(%r14), %rcx
	addq	$8, %rcx
	movq	_smi_data_buf_phys_addr@GOTPCREL(%rip), %rdx
	movq	%rcx, (%rdx)
	addq	$8, %rax
	movq	_smi_data_buf@GOTPCREL(%rip), %rcx
	movq	%rax, (%rcx)
	addl	$-8, %ebx
	movq	_smi_data_buf_size@GOTPCREL(%rip), %rax
	movl	%ebx, (%rax)
	movq	_max_smi_data_buf_size@GOTPCREL(%rip), %rax
	movl	%ebx, (%rax)
	movq	_wsmt_enabled@GOTPCREL(%rip), %rax
	movl	$1, (%rax)
	movq	_dcdbas_pdev@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	leaq	L_.str.3(%rip), %rsi
	callq	_dev_info
	movl	$1, %ebx
	jmp	LBB0_14
LBB0_12:
	movq	_dcdbas_pdev@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	leaq	L_.str.2(%rip), %rsi
	callq	_dev_warn
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
	.comm	_ACPI_SIG_WSMT,4,2              ## @ACPI_SIG_WSMT
	.comm	_ACPI_WSMT_FIXED_COMM_BUFFERS,4,2 ## @ACPI_WSMT_FIXED_COMM_BUFFERS
	.comm	_ACPI_WSMT_COMM_BUFFER_NESTED_PTR_PROTECTION,4,2 ## @ACPI_WSMT_COMM_BUFFER_NESTED_PTR_PROTECTION
	.comm	_dcdbas_pdev,8,3                ## @dcdbas_pdev
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"found WSMT, but no EPS found\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
L_.str.1:                               ## @.str.1
	.asciz	"found WSMT, but EPS buffer address is above 4GB\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.comm	_MAX_SMI_DATA_BUF_SIZE,4,2      ## @MAX_SMI_DATA_BUF_SIZE
	.comm	_MEMREMAP_WB,4,2                ## @MEMREMAP_WB
	.comm	_eps_buffer,8,3                 ## @eps_buffer
L_.str.2:                               ## @.str.2
	.asciz	"found WSMT, but failed to map EPS buffer\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_smi_data_buf_phys_addr,8,3     ## @smi_data_buf_phys_addr
	.comm	_smi_data_buf,8,3               ## @smi_data_buf
	.comm	_smi_data_buf_size,4,2          ## @smi_data_buf_size
	.comm	_max_smi_data_buf_size,4,2      ## @max_smi_data_buf_size
	.comm	_wsmt_enabled,4,2               ## @wsmt_enabled
L_.str.3:                               ## @.str.3
	.asciz	"WSMT found, using firmware-provided SMI buffer.\n"

	.no_dead_strip	_dcdbas_check_wsmt
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dcdbas_check_wsmt
_dcdbas_check_wsmt:                     ; @dcdbas_check_wsmt
	.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
	str	xzr, [sp, #8]
Lloh0:
	adrp	x8, _ACPI_SIG_WSMT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ACPI_SIG_WSMT@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	add	x2, sp, #8
	mov	w1, #0
	bl	_acpi_get_table
	ldr	x8, [sp, #8]
	cbz	x8, LBB0_7
; %bb.1:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _ACPI_WSMT_FIXED_COMM_BUFFERS@GOTPAGE
Lloh4:
	ldr	x9, [x9, _ACPI_WSMT_FIXED_COMM_BUFFERS@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_7
; %bb.2:
Lloh6:
	adrp	x9, _ACPI_WSMT_COMM_BUFFER_NESTED_PTR_PROTECTION@GOTPAGE
Lloh7:
	ldr	x9, [x9, _ACPI_WSMT_COMM_BUFFER_NESTED_PTR_PROTECTION@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_7
; %bb.3:
	mov	w0, #983040
	bl	___va
	mov	x20, x0
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	mov	w0, #1048560
	bl	___va
	cmp	x20, x0
	b.hs	LBB0_8
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x20
	bl	_check_eps_table
	cbnz	x0, LBB0_11
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	add	x20, x20, #64
	b	LBB0_4
LBB0_7:
	mov	w19, #0
	b	LBB0_10
LBB0_8:
Lloh9:
	adrp	x8, _dcdbas_pdev@GOTPAGE
Lloh10:
	ldr	x8, [x8, _dcdbas_pdev@GOTPAGEOFF]
Lloh11:
	ldr	x0, [x8]
Lloh12:
	adrp	x1, l_.str@PAGE
Lloh13:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_dbg
Lloh14:
	adrp	x8, _ENODEV@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
LBB0_9:
	ldr	w8, [x8]
	neg	w19, w8
LBB0_10:
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
LBB0_11:
	mov	x19, x0
	ldr	x8, [x0, #8]
	add	x0, x8, #8
	bl	_upper_32_bits
	cbz	x0, LBB0_13
; %bb.12:
Lloh16:
	adrp	x8, _dcdbas_pdev@GOTPAGE
Lloh17:
	ldr	x8, [x8, _dcdbas_pdev@GOTPAGEOFF]
Lloh18:
	ldr	x0, [x8]
Lloh19:
	adrp	x1, l_.str.1@PAGE
Lloh20:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_warn
Lloh21:
	adrp	x8, _EINVAL@GOTPAGE
Lloh22:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_9
LBB0_13:
	ldr	w8, [x19]
Lloh23:
	adrp	x9, _PAGE_SIZE@GOTPAGE
Lloh24:
	ldr	x9, [x9, _PAGE_SIZE@GOTPAGEOFF]
Lloh25:
	ldr	w9, [x9]
	mul	w8, w9, w8
Lloh26:
	adrp	x9, _MAX_SMI_DATA_BUF_SIZE@GOTPAGE
Lloh27:
	ldr	x9, [x9, _MAX_SMI_DATA_BUF_SIZE@GOTPAGEOFF]
Lloh28:
	ldr	w9, [x9]
	add	w9, w9, #8
	cmp	w8, w9
	csel	w20, w8, w9, lt
	ldr	x0, [x19, #8]
Lloh29:
	adrp	x8, _MEMREMAP_WB@GOTPAGE
Lloh30:
	ldr	x8, [x8, _MEMREMAP_WB@GOTPAGEOFF]
Lloh31:
	ldr	w2, [x8]
	mov	x1, x20
	bl	_memremap
Lloh32:
	adrp	x8, _eps_buffer@GOTPAGE
Lloh33:
	ldr	x8, [x8, _eps_buffer@GOTPAGEOFF]
Lloh34:
	str	x0, [x8]
	cbz	x0, LBB0_15
; %bb.14:
	ldr	x8, [x19, #8]
	add	x8, x8, #8
Lloh35:
	adrp	x9, _smi_data_buf_phys_addr@GOTPAGE
Lloh36:
	ldr	x9, [x9, _smi_data_buf_phys_addr@GOTPAGEOFF]
Lloh37:
	str	x8, [x9]
	add	x8, x0, #8
Lloh38:
	adrp	x9, _smi_data_buf@GOTPAGE
Lloh39:
	ldr	x9, [x9, _smi_data_buf@GOTPAGEOFF]
Lloh40:
	str	x8, [x9]
Lloh41:
	adrp	x8, _smi_data_buf_size@GOTPAGE
Lloh42:
	ldr	x8, [x8, _smi_data_buf_size@GOTPAGEOFF]
	sub	w9, w20, #8
Lloh43:
	str	w9, [x8]
Lloh44:
	adrp	x8, _max_smi_data_buf_size@GOTPAGE
Lloh45:
	ldr	x8, [x8, _max_smi_data_buf_size@GOTPAGEOFF]
Lloh46:
	adrp	x10, _wsmt_enabled@GOTPAGE
Lloh47:
	ldr	x10, [x10, _wsmt_enabled@GOTPAGEOFF]
Lloh48:
	str	w9, [x8]
	mov	w19, #1
Lloh49:
	str	w19, [x10]
Lloh50:
	adrp	x8, _dcdbas_pdev@GOTPAGE
Lloh51:
	ldr	x8, [x8, _dcdbas_pdev@GOTPAGEOFF]
Lloh52:
	ldr	x0, [x8]
Lloh53:
	adrp	x1, l_.str.3@PAGE
Lloh54:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_dev_info
	b	LBB0_10
LBB0_15:
Lloh55:
	adrp	x8, _dcdbas_pdev@GOTPAGE
Lloh56:
	ldr	x8, [x8, _dcdbas_pdev@GOTPAGEOFF]
Lloh57:
	ldr	x0, [x8]
Lloh58:
	adrp	x1, l_.str.2@PAGE
Lloh59:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dev_warn
Lloh60:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh61:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_9
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotStr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpAdd	Lloh53, Lloh54
	.loh AdrpLdrGotLdr	Lloh50, Lloh51, Lloh52
	.loh AdrpLdrGotStr	Lloh46, Lloh47, Lloh49
	.loh AdrpLdrGotStr	Lloh44, Lloh45, Lloh48
	.loh AdrpLdrGotStr	Lloh41, Lloh42, Lloh43
	.loh AdrpLdrGotStr	Lloh38, Lloh39, Lloh40
	.loh AdrpLdrGotStr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGot	Lloh60, Lloh61
	.loh AdrpAdd	Lloh58, Lloh59
	.loh AdrpLdrGotLdr	Lloh55, Lloh56, Lloh57
	.cfi_endproc
                                        ; -- End function
	.comm	_ACPI_SIG_WSMT,4,2              ; @ACPI_SIG_WSMT
	.comm	_ACPI_WSMT_FIXED_COMM_BUFFERS,4,2 ; @ACPI_WSMT_FIXED_COMM_BUFFERS
	.comm	_ACPI_WSMT_COMM_BUFFER_NESTED_PTR_PROTECTION,4,2 ; @ACPI_WSMT_COMM_BUFFER_NESTED_PTR_PROTECTION
	.comm	_dcdbas_pdev,8,3                ; @dcdbas_pdev
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"found WSMT, but no EPS found\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
l_.str.1:                               ; @.str.1
	.asciz	"found WSMT, but EPS buffer address is above 4GB\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.comm	_MAX_SMI_DATA_BUF_SIZE,4,2      ; @MAX_SMI_DATA_BUF_SIZE
	.comm	_MEMREMAP_WB,4,2                ; @MEMREMAP_WB
	.comm	_eps_buffer,8,3                 ; @eps_buffer
l_.str.2:                               ; @.str.2
	.asciz	"found WSMT, but failed to map EPS buffer\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_smi_data_buf_phys_addr,8,3     ; @smi_data_buf_phys_addr
	.comm	_smi_data_buf,8,3               ; @smi_data_buf
	.comm	_smi_data_buf_size,4,2          ; @smi_data_buf_size
	.comm	_max_smi_data_buf_size,4,2      ; @max_smi_data_buf_size
	.comm	_wsmt_enabled,4,2               ; @wsmt_enabled
l_.str.3:                               ; @.str.3
	.asciz	"WSMT found, using firmware-provided SMI buffer.\n"

	.no_dead_strip	_dcdbas_check_wsmt
.subsections_via_symbols
