	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function piix4_imc_sleep
_piix4_imc_sleep:                       ## @piix4_imc_sleep
	.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
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_MAX_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	_KERNCZ_IMC_IDX@GOTPCREL(%rip), %r14
	movl	(%r14), %edi
	leaq	L_.str(%rip), %rdx
	movl	$2, %esi
	callq	_request_muxed_region
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	xorl	%r15d, %r15d
	movl	$130, %edi
	xorl	%esi, %esi
	callq	_piix4_imc_write
	movl	$131, %edi
	movl	$180, %esi
	callq	_piix4_imc_write
	movl	$128, %edi
	movl	$150, %esi
	callq	_piix4_imc_write
	testl	%ebx, %ebx
	je	LBB0_6
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	$130, %edi
	callq	_piix4_imc_read
	cmpl	$250, %eax
	je	LBB0_4
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	$1000, %edi                     ## imm = 0x3E8
	movl	$2000, %esi                     ## imm = 0x7D0
	callq	_usleep_range
	decl	%ebx
	jne	LBB0_3
LBB0_6:
	movl	(%r14), %edi
	movl	$2, %esi
	callq	_release_region
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_1:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
LBB0_7:
	subl	(%rax), %r15d
LBB0_8:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movl	(%r14), %edi
	movl	$2, %esi
	callq	_release_region
	xorl	%r15d, %r15d
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.comm	_MAX_TIMEOUT,4,2                ## @MAX_TIMEOUT
	.comm	_KERNCZ_IMC_IDX,4,2             ## @KERNCZ_IMC_IDX
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"smbus_kerncz_imc"

	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.no_dead_strip	_piix4_imc_sleep
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function piix4_imc_sleep
_piix4_imc_sleep:                       ; @piix4_imc_sleep
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
Lloh0:
	adrp	x8, _MAX_TIMEOUT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MAX_TIMEOUT@GOTPAGEOFF]
Lloh2:
	ldr	w20, [x8]
Lloh3:
	adrp	x19, _KERNCZ_IMC_IDX@GOTPAGE
Lloh4:
	ldr	x19, [x19, _KERNCZ_IMC_IDX@GOTPAGEOFF]
	ldr	w0, [x19]
Lloh5:
	adrp	x2, l_.str@PAGE
Lloh6:
	add	x2, x2, l_.str@PAGEOFF
	mov	w1, #2
	bl	_request_muxed_region
	cbz	w0, LBB0_5
; %bb.1:
	mov	w0, #130
	mov	w1, #0
	bl	_piix4_imc_write
	mov	w0, #131
	mov	w1, #180
	bl	_piix4_imc_write
	mov	w0, #128
	mov	w1, #150
	bl	_piix4_imc_write
	cbz	w20, LBB0_4
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	mov	w0, #130
	bl	_piix4_imc_read
	cmp	w0, #250
	b.eq	LBB0_8
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	sub	w20, w20, #1
	mov	w0, #1000
	mov	w1, #2000
	bl	_usleep_range
	cbnz	w20, LBB0_2
LBB0_4:
	ldr	w0, [x19]
	mov	w1, #2
	bl	_release_region
Lloh7:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh8:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
	b	LBB0_6
LBB0_5:
Lloh9:
	adrp	x8, _EBUSY@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
LBB0_6:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_7:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_8:
	ldr	w0, [x19]
	mov	w1, #2
	bl	_release_region
	mov	w0, #0
	b	LBB0_7
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_MAX_TIMEOUT,4,2                ; @MAX_TIMEOUT
	.comm	_KERNCZ_IMC_IDX,4,2             ; @KERNCZ_IMC_IDX
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"smbus_kerncz_imc"

	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.no_dead_strip	_piix4_imc_sleep
.subsections_via_symbols
