	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function swsci
_swsci:                                 ## @swsci
	.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	8(%rdi), %r14
	testq	%r14, %r14
	je	LBB0_3
## %bb.1:
	movq	%rcx, %r8
	movl	%edx, %r12d
	movl	%esi, %ebx
	movq	_SWSCI_SCIC_MAIN_FUNCTION_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	%esi, %eax
	movq	_SWSCI_SCIC_MAIN_FUNCTION_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	sarl	%cl, %eax
	movq	_SWSCI_SCIC_SUB_FUNCTION_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	andl	%esi, %edx
	movq	_SWSCI_SCIC_SUB_FUNCTION_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	sarl	%cl, %edx
	movq	16(%rdi), %r15
	movq	_SWSCI_SBCB@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_4
## %bb.2:
	movl	(%rdi), %eax
	btl	%edx, %eax
	jb	LBB0_6
	jmp	LBB0_9
LBB0_3:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	jmp	LBB0_10
LBB0_4:
	movq	_SWSCI_GBDA@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_6
## %bb.5:
	movl	4(%rdi), %eax
	btl	%edx, %eax
	jae	LBB0_9
LBB0_6:
	movl	(%r14), %r13d
	testl	%r13d, %r13d
	je	LBB0_11
## %bb.7:
	movq	_MAX_DSLP@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	cmpl	%edx, %r13d
	jle	LBB0_12
## %bb.8:
	leaq	L_.str(%rip), %rdi
	movl	%r13d, %esi
	movq	%r8, %r13
	callq	_DRM_INFO_ONCE
	movq	%r13, %r8
	movq	_MAX_DSLP@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	jmp	LBB0_12
LBB0_9:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_10:
	xorl	%ebx, %ebx
	jmp	LBB0_23
LBB0_11:
	movl	$50, %r13d
LBB0_12:
	movq	_SWSCI_SCIC_INDICATOR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 4(%r14)
	je	LBB0_14
## %bb.13:
	leaq	L_.str.1(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_DRM_DEBUG_DRIVER
	movq	_EBUSY@GOTPCREL(%rip), %rax
	jmp	LBB0_23
LBB0_14:
	movq	%r8, -56(%rbp)                  ## 8-byte Spill
	orl	%ebx, %eax
	movl	%r12d, 8(%r14)
	movl	%eax, 4(%r14)
	movq	_SWSCI@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	leaq	-44(%rbp), %rdx
	movq	%r15, %rdi
	callq	_pci_read_config_word
	movl	-44(%rbp), %eax
	movq	_SWSCI_SCISEL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movq	_SWSCI_GSSCIE@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edx
	testl	%eax, %ecx
	je	LBB0_16
## %bb.15:
	movl	%edx, %esi
	andl	%eax, %esi
	je	LBB0_17
LBB0_16:
	orl	%eax, %ecx
	notl	%edx
	andl	%ecx, %edx
	movl	%edx, -44(%rbp)
	movl	(%r12), %esi
	movq	%r15, %rdi
	callq	_pci_write_config_word
	movl	(%rbx), %edx
	movl	-44(%rbp), %eax
LBB0_17:
	orl	%edx, %eax
	movl	%eax, -44(%rbp)
	movl	(%r12), %esi
	movq	%r15, %rdi
	movl	%eax, %edx
	callq	_pci_write_config_word
	movl	4(%r14), %r15d
	xorl	%edi, %edi
	movq	_SWSCI_SCIC_INDICATOR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	%r15d, %eax
	sete	%dil
	movl	%r13d, %esi
	callq	_wait_for
	testq	%rax, %rax
	je	LBB0_19
## %bb.18:
	leaq	L_.str.2(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_DRM_DEBUG_DRIVER
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	jmp	LBB0_23
LBB0_19:
	movq	_SWSCI_SCIC_EXIT_STATUS_MASK@GOTPCREL(%rip), %rax
	andl	(%rax), %r15d
	movq	_SWSCI_SCIC_EXIT_STATUS_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	sarl	%cl, %r15d
	movq	_SWSCI_SCIC_EXIT_STATUS_SUCCESS@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r15d
	jne	LBB0_22
## %bb.20:
	xorl	%ebx, %ebx
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	testq	%rcx, %rcx
	je	LBB0_24
## %bb.21:
	movl	8(%r14), %eax
	movl	%eax, (%rcx)
	jmp	LBB0_24
LBB0_22:
	leaq	L_.str.3(%rip), %rdi
	xorl	%ebx, %ebx
	movl	%r15d, %esi
	xorl	%eax, %eax
	callq	_DRM_DEBUG_DRIVER
	movq	_EIO@GOTPCREL(%rip), %rax
LBB0_23:
	subl	(%rax), %ebx
LBB0_24:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_SWSCI_SCIC_MAIN_FUNCTION_MASK,4,2 ## @SWSCI_SCIC_MAIN_FUNCTION_MASK
	.comm	_SWSCI_SCIC_MAIN_FUNCTION_SHIFT,4,2 ## @SWSCI_SCIC_MAIN_FUNCTION_SHIFT
	.comm	_SWSCI_SCIC_SUB_FUNCTION_MASK,4,2 ## @SWSCI_SCIC_SUB_FUNCTION_MASK
	.comm	_SWSCI_SCIC_SUB_FUNCTION_SHIFT,4,2 ## @SWSCI_SCIC_SUB_FUNCTION_SHIFT
	.comm	_SWSCI_SBCB,4,2                 ## @SWSCI_SBCB
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_SWSCI_GBDA,4,2                 ## @SWSCI_GBDA
	.comm	_MAX_DSLP,4,2                   ## @MAX_DSLP
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ACPI BIOS requests an excessive sleep of %u ms, using %u ms instead\n"

	.comm	_SWSCI_SCIC_INDICATOR,4,2       ## @SWSCI_SCIC_INDICATOR
L_.str.1:                               ## @.str.1
	.asciz	"SWSCI request already in progress\n"

	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_SWSCI,4,2                      ## @SWSCI
	.comm	_SWSCI_SCISEL,4,2               ## @SWSCI_SCISEL
	.comm	_SWSCI_GSSCIE,4,2               ## @SWSCI_GSSCIE
L_.str.2:                               ## @.str.2
	.asciz	"SWSCI request timed out\n"

	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.comm	_SWSCI_SCIC_EXIT_STATUS_MASK,4,2 ## @SWSCI_SCIC_EXIT_STATUS_MASK
	.comm	_SWSCI_SCIC_EXIT_STATUS_SHIFT,4,2 ## @SWSCI_SCIC_EXIT_STATUS_SHIFT
	.comm	_SWSCI_SCIC_EXIT_STATUS_SUCCESS,4,2 ## @SWSCI_SCIC_EXIT_STATUS_SUCCESS
L_.str.3:                               ## @.str.3
	.asciz	"SWSCI request error %u\n"

	.comm	_EIO,4,2                        ## @EIO
	.comm	_C,4,2                          ## @C
	.no_dead_strip	_swsci
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function swsci
_swsci:                                 ; @swsci
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	ldr	x24, [x0, #8]
	cbz	x24, LBB0_3
; %bb.1:
	mov	x19, x3
	mov	x22, x2
	mov	x23, x1
	ldr	x20, [x0, #16]
Lloh0:
	adrp	x8, _SWSCI_SCIC_MAIN_FUNCTION_MASK@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SWSCI_SCIC_MAIN_FUNCTION_MASK@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	and	w8, w8, w1
Lloh3:
	adrp	x9, _SWSCI_SCIC_MAIN_FUNCTION_SHIFT@GOTPAGE
Lloh4:
	ldr	x9, [x9, _SWSCI_SCIC_MAIN_FUNCTION_SHIFT@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	asr	w8, w8, w9
Lloh6:
	adrp	x9, _SWSCI_SCIC_SUB_FUNCTION_MASK@GOTPAGE
Lloh7:
	ldr	x9, [x9, _SWSCI_SCIC_SUB_FUNCTION_MASK@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	and	w9, w9, w1
Lloh9:
	adrp	x10, _SWSCI_SCIC_SUB_FUNCTION_SHIFT@GOTPAGE
Lloh10:
	ldr	x10, [x10, _SWSCI_SCIC_SUB_FUNCTION_SHIFT@GOTPAGEOFF]
Lloh11:
	ldr	w10, [x10]
	asr	w9, w9, w10
Lloh12:
	adrp	x10, _SWSCI_SBCB@GOTPAGE
Lloh13:
	ldr	x10, [x10, _SWSCI_SBCB@GOTPAGEOFF]
Lloh14:
	ldr	w10, [x10]
	cmp	w8, w10
	b.ne	LBB0_4
; %bb.2:
	ldr	w8, [x0]
	lsr	w8, w8, w9
	tbnz	w8, #0, LBB0_6
	b	LBB0_9
LBB0_3:
Lloh15:
	adrp	x8, _ENODEV@GOTPAGE
Lloh16:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
	b	LBB0_22
LBB0_4:
Lloh17:
	adrp	x10, _SWSCI_GBDA@GOTPAGE
Lloh18:
	ldr	x10, [x10, _SWSCI_GBDA@GOTPAGEOFF]
Lloh19:
	ldr	w10, [x10]
	cmp	w8, w10
	b.ne	LBB0_6
; %bb.5:
	ldr	w8, [x0, #4]
	lsr	w8, w8, w9
	tbz	w8, #0, LBB0_9
LBB0_6:
	ldr	w21, [x24]
	cbz	w21, LBB0_10
; %bb.7:
Lloh20:
	adrp	x25, _MAX_DSLP@GOTPAGE
Lloh21:
	ldr	x25, [x25, _MAX_DSLP@GOTPAGEOFF]
	ldr	w2, [x25]
	cmp	w21, w2
	b.le	LBB0_11
; %bb.8:
Lloh22:
	adrp	x0, l_.str@PAGE
Lloh23:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x21
	bl	_DRM_INFO_ONCE
	ldr	w21, [x25]
	b	LBB0_11
LBB0_9:
Lloh24:
	adrp	x8, _EINVAL@GOTPAGE
Lloh25:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_22
LBB0_10:
	mov	w21, #50
LBB0_11:
	ldr	w9, [x24, #4]
Lloh26:
	adrp	x25, _SWSCI_SCIC_INDICATOR@GOTPAGE
Lloh27:
	ldr	x25, [x25, _SWSCI_SCIC_INDICATOR@GOTPAGEOFF]
	ldr	w8, [x25]
	tst	w8, w9
	b.eq	LBB0_13
; %bb.12:
Lloh28:
	adrp	x0, l_.str.1@PAGE
Lloh29:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DRM_DEBUG_DRIVER
Lloh30:
	adrp	x8, _EBUSY@GOTPAGE
Lloh31:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
	b	LBB0_22
LBB0_13:
	orr	w8, w8, w23
	stp	w8, w22, [x24, #4]
Lloh32:
	adrp	x22, _SWSCI@GOTPAGE
Lloh33:
	ldr	x22, [x22, _SWSCI@GOTPAGEOFF]
	ldr	w1, [x22]
	add	x2, sp, #12
	mov	x0, x20
	bl	_pci_read_config_word
Lloh34:
	adrp	x9, _SWSCI_SCISEL@GOTPAGE
Lloh35:
	ldr	x9, [x9, _SWSCI_SCISEL@GOTPAGEOFF]
	ldr	w8, [sp, #12]
Lloh36:
	ldr	w10, [x9]
Lloh37:
	adrp	x23, _SWSCI_GSSCIE@GOTPAGE
Lloh38:
	ldr	x23, [x23, _SWSCI_GSSCIE@GOTPAGEOFF]
	ldr	w9, [x23]
	tst	w10, w8
	b.eq	LBB0_15
; %bb.14:
	and	w11, w9, w8
	cbz	w11, LBB0_16
LBB0_15:
	orr	w8, w10, w8
	bic	w2, w8, w9
	str	w2, [sp, #12]
	ldr	w1, [x22]
	mov	x0, x20
	bl	_pci_write_config_word
	ldr	w9, [x23]
	ldr	w8, [sp, #12]
LBB0_16:
	orr	w2, w8, w9
	str	w2, [sp, #12]
	ldr	w1, [x22]
	mov	x0, x20
	bl	_pci_write_config_word
	ldr	w20, [x24, #4]
	ldr	w8, [x25]
	tst	w8, w20
	cset	w0, eq
	mov	x1, x21
	bl	_wait_for
	cbz	x0, LBB0_18
; %bb.17:
Lloh39:
	adrp	x0, l_.str.2@PAGE
Lloh40:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_DRM_DEBUG_DRIVER
Lloh41:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh42:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
	b	LBB0_22
LBB0_18:
Lloh43:
	adrp	x8, _SWSCI_SCIC_EXIT_STATUS_MASK@GOTPAGE
Lloh44:
	ldr	x8, [x8, _SWSCI_SCIC_EXIT_STATUS_MASK@GOTPAGEOFF]
Lloh45:
	ldr	w8, [x8]
	and	w8, w8, w20
Lloh46:
	adrp	x9, _SWSCI_SCIC_EXIT_STATUS_SHIFT@GOTPAGE
Lloh47:
	ldr	x9, [x9, _SWSCI_SCIC_EXIT_STATUS_SHIFT@GOTPAGEOFF]
Lloh48:
	ldr	w9, [x9]
	asr	w8, w8, w9
Lloh49:
	adrp	x9, _SWSCI_SCIC_EXIT_STATUS_SUCCESS@GOTPAGE
Lloh50:
	ldr	x9, [x9, _SWSCI_SCIC_EXIT_STATUS_SUCCESS@GOTPAGEOFF]
Lloh51:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_21
; %bb.19:
	mov	w0, #0
	cbz	x19, LBB0_23
; %bb.20:
	ldr	w8, [x24, #8]
	str	w8, [x19]
	b	LBB0_23
LBB0_21:
	str	x8, [sp]
Lloh52:
	adrp	x0, l_.str.3@PAGE
Lloh53:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_DRM_DEBUG_DRIVER
Lloh54:
	adrp	x8, _EIO@GOTPAGE
Lloh55:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
LBB0_22:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_23:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh30, Lloh31
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpLdrGot	Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGot	Lloh32, Lloh33
	.loh AdrpLdrGot	Lloh41, Lloh42
	.loh AdrpAdd	Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh49, Lloh50, Lloh51
	.loh AdrpLdrGotLdr	Lloh46, Lloh47, Lloh48
	.loh AdrpLdrGotLdr	Lloh43, Lloh44, Lloh45
	.loh AdrpLdrGot	Lloh54, Lloh55
	.loh AdrpAdd	Lloh52, Lloh53
	.cfi_endproc
                                        ; -- End function
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_SWSCI_SCIC_MAIN_FUNCTION_MASK,4,2 ; @SWSCI_SCIC_MAIN_FUNCTION_MASK
	.comm	_SWSCI_SCIC_MAIN_FUNCTION_SHIFT,4,2 ; @SWSCI_SCIC_MAIN_FUNCTION_SHIFT
	.comm	_SWSCI_SCIC_SUB_FUNCTION_MASK,4,2 ; @SWSCI_SCIC_SUB_FUNCTION_MASK
	.comm	_SWSCI_SCIC_SUB_FUNCTION_SHIFT,4,2 ; @SWSCI_SCIC_SUB_FUNCTION_SHIFT
	.comm	_SWSCI_SBCB,4,2                 ; @SWSCI_SBCB
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_SWSCI_GBDA,4,2                 ; @SWSCI_GBDA
	.comm	_MAX_DSLP,4,2                   ; @MAX_DSLP
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ACPI BIOS requests an excessive sleep of %u ms, using %u ms instead\n"

	.comm	_SWSCI_SCIC_INDICATOR,4,2       ; @SWSCI_SCIC_INDICATOR
l_.str.1:                               ; @.str.1
	.asciz	"SWSCI request already in progress\n"

	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_SWSCI,4,2                      ; @SWSCI
	.comm	_SWSCI_SCISEL,4,2               ; @SWSCI_SCISEL
	.comm	_SWSCI_GSSCIE,4,2               ; @SWSCI_GSSCIE
l_.str.2:                               ; @.str.2
	.asciz	"SWSCI request timed out\n"

	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.comm	_SWSCI_SCIC_EXIT_STATUS_MASK,4,2 ; @SWSCI_SCIC_EXIT_STATUS_MASK
	.comm	_SWSCI_SCIC_EXIT_STATUS_SHIFT,4,2 ; @SWSCI_SCIC_EXIT_STATUS_SHIFT
	.comm	_SWSCI_SCIC_EXIT_STATUS_SUCCESS,4,2 ; @SWSCI_SCIC_EXIT_STATUS_SUCCESS
l_.str.3:                               ; @.str.3
	.asciz	"SWSCI request error %u\n"

	.comm	_EIO,4,2                        ; @EIO
	.comm	_C,4,2                          ; @C
	.no_dead_strip	_swsci
.subsections_via_symbols
