	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function applesmc_device_init
_applesmc_device_init:                  ## @applesmc_device_init
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -40(%rbp)
	movq	_smcreg@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	je	LBB0_7
## %bb.1:
	movq	_INIT_TIMEOUT_MSECS@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	testl	%ebx, %ebx
	jle	LBB0_6
## %bb.2:
	movq	_MOTION_SENSOR_KEY@GOTPCREL(%rip), %r15
	leaq	-48(%rbp), %r14
	movq	_INIT_WAIT_MSECS@GOTPCREL(%rip), %r12
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	$224, -48(%rbp)
	movl	(%r15), %edi
	movq	%r14, %rsi
	movl	$2, %edx
	callq	_applesmc_write_key
	movq	(%r12), %rdi
	callq	_msleep
	subl	(%r12), %ebx
	testl	%ebx, %ebx
	jle	LBB0_6
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r15), %edi
	movq	%r14, %rsi
	movl	$2, %edx
	callq	_applesmc_read_key
	testl	%eax, %eax
	jne	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	-48(%rbp), %eax
	orl	-44(%rbp), %eax
	je	LBB0_5
	jmp	LBB0_7
LBB0_6:
	leaq	L_.str(%rip), %rdi
	callq	_pr_warn
LBB0_7:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-40(%rbp), %rax
	jne	LBB0_9
## %bb.8:
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_smcreg,4,2                     ## @smcreg
	.comm	_INIT_TIMEOUT_MSECS,4,2         ## @INIT_TIMEOUT_MSECS
	.comm	_MOTION_SENSOR_KEY,4,2          ## @MOTION_SENSOR_KEY
	.comm	_INIT_WAIT_MSECS,8,3            ## @INIT_WAIT_MSECS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to init the device\n"

	.no_dead_strip	_applesmc_device_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function applesmc_device_init
lCPI0_0:
	.long	224                             ; 0xe0
	.long	0                               ; 0x0
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_applesmc_device_init:                  ; @applesmc_device_init
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	d9, d8, [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 b8, -56
	.cfi_offset b9, -64
Lloh0:
	adrp	x8, _smcreg@GOTPAGE
Lloh1:
	ldr	x8, [x8, _smcreg@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cbz	w8, LBB0_7
; %bb.1:
Lloh3:
	adrp	x8, _INIT_TIMEOUT_MSECS@GOTPAGE
Lloh4:
	ldr	x8, [x8, _INIT_TIMEOUT_MSECS@GOTPAGEOFF]
Lloh5:
	ldr	w19, [x8]
	cmp	w19, #1
	b.lt	LBB0_6
; %bb.2:
Lloh6:
	adrp	x20, _MOTION_SENSOR_KEY@GOTPAGE
Lloh7:
	ldr	x20, [x20, _MOTION_SENSOR_KEY@GOTPAGEOFF]
Lloh8:
	adrp	x8, lCPI0_0@PAGE
Lloh9:
	ldr	d8, [x8, lCPI0_0@PAGEOFF]
Lloh10:
	adrp	x21, _INIT_WAIT_MSECS@GOTPAGE
Lloh11:
	ldr	x21, [x21, _INIT_WAIT_MSECS@GOTPAGEOFF]
	b	LBB0_4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	str	d8, [sp, #8]
	ldr	w0, [x20]
	add	x1, sp, #8
	mov	w2, #2
	bl	_applesmc_write_key
	ldr	x0, [x21]
	bl	_msleep
	ldr	w8, [x21]
	sub	w19, w19, w8
	cmp	w19, #0
	b.le	LBB0_6
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x20]
	add	x1, sp, #8
	mov	w2, #2
	bl	_applesmc_read_key
	cbnz	w0, LBB0_3
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldp	w8, w9, [sp, #8]
	orr	w8, w8, w9
	cbz	w8, LBB0_3
	b	LBB0_7
LBB0_6:
Lloh12:
	adrp	x0, l_.str@PAGE
Lloh13:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_warn
LBB0_7:
	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	d9, d8, [sp, #16]               ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdr	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpAdd	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_smcreg,4,2                     ; @smcreg
	.comm	_INIT_TIMEOUT_MSECS,4,2         ; @INIT_TIMEOUT_MSECS
	.comm	_MOTION_SENSOR_KEY,4,2          ; @MOTION_SENSOR_KEY
	.comm	_INIT_WAIT_MSECS,8,3            ; @INIT_WAIT_MSECS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to init the device\n"

	.no_dead_strip	_applesmc_device_init
.subsections_via_symbols
