	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_smapi_init                     ## -- Begin function smapi_init
	.p2align	4, 0x90
_smapi_init:                            ## @smapi_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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	movq	_TRACE_SMAPI@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	callq	_PRINTK_1
	movq	_rtc_lock@GOTPCREL(%rip), %r14
	movq	%r14, %rdi
	callq	_spin_lock_irqsave
	movl	$124, %edi
	callq	_CMOS_READ
	movl	%eax, %r12d
	movl	$125, %edi
	callq	_CMOS_READ
	movl	%eax, %ebx
	shll	$8, %ebx
	orl	%r12d, %ebx
	movq	_TRACE_SMAPI@GOTPCREL(%rip), %r12
	movq	%r14, %rdi
	callq	_spin_unlock_irqrestore
	movl	(%r12), %edi
	movzwl	%bx, %ebx
	leaq	L_.str.1(%rip), %rsi
	movl	%ebx, %edx
	callq	_PRINTK_2
	cmpl	$21321, %ebx                    ## imm = 0x5349
	jne	LBB0_4
## %bb.1:
	movq	_rtc_lock@GOTPCREL(%rip), %r14
	movq	%r14, %rdi
	callq	_spin_lock_irqsave
	movl	$126, %edi
	callq	_CMOS_READ
	movq	_g_usSmapiPort@GOTPCREL(%rip), %rbx
	movl	%eax, (%rbx)
	movl	$127, %edi
	callq	_CMOS_READ
	shll	$8, %eax
	orl	%eax, (%rbx)
	movq	%r14, %rdi
	callq	_spin_unlock_irqrestore
	movl	(%rbx), %edx
	testl	%edx, %edx
	je	LBB0_2
## %bb.3:
	movl	(%r12), %edi
	leaq	L_.str.3(%rip), %rsi
	callq	_PRINTK_2
	xorl	%r15d, %r15d
	jmp	LBB0_5
LBB0_4:
	leaq	L_.str.4(%rip), %rdi
	callq	_PRINTK_ERROR
	movq	_ENXIO@GOTPCREL(%rip), %rax
	subl	(%rax), %r13d
	movl	%r13d, %r15d
	jmp	LBB0_5
LBB0_2:
	leaq	L_.str.2(%rip), %rdi
	callq	_PRINTK_ERROR
LBB0_5:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EIO,4,2                        ## @EIO
	.comm	_TRACE_SMAPI,4,2                ## @TRACE_SMAPI
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"smapi::smapi_init entry\n"

	.comm	_rtc_lock,4,2                   ## @rtc_lock
L_.str.1:                               ## @.str.1
	.asciz	"smapi::smapi_init usSmapiID %x\n"

	.comm	_g_usSmapiPort,4,2              ## @g_usSmapiPort
L_.str.2:                               ## @.str.2
	.asciz	"smapi::smapi_init, ERROR unable to read from SMAPI port\n"

L_.str.3:                               ## @.str.3
	.asciz	"smapi::smapi_init, exit TRUE g_usSmapiPort %x\n"

L_.str.4:                               ## @.str.4
	.asciz	"smapi::smapi_init, ERROR invalid usSmapiID\n"

	.comm	_ENXIO,4,2                      ## @ENXIO
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_smapi_init                     ; -- Begin function smapi_init
	.p2align	2
_smapi_init:                            ; @smapi_init
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
Lloh0:
	adrp	x8, _EIO@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh2:
	ldr	w21, [x8]
Lloh3:
	adrp	x22, _TRACE_SMAPI@GOTPAGE
Lloh4:
	ldr	x22, [x22, _TRACE_SMAPI@GOTPAGEOFF]
	ldr	w0, [x22]
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	bl	_PRINTK_1
Lloh7:
	adrp	x19, _rtc_lock@GOTPAGE
Lloh8:
	ldr	x19, [x19, _rtc_lock@GOTPAGEOFF]
	mov	x0, x19
	bl	_spin_lock_irqsave
	mov	w0, #124
	bl	_CMOS_READ
	mov	x20, x0
	mov	w0, #125
	bl	_CMOS_READ
	orr	w20, w20, w0, lsl #8
	mov	x0, x19
	bl	_spin_unlock_irqrestore
	ldr	w0, [x22]
	and	w19, w20, #0xffff
Lloh9:
	adrp	x1, l_.str.1@PAGE
Lloh10:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, x19
	bl	_PRINTK_2
	mov	w8, #21321
	cmp	w19, w8
	b.ne	LBB0_3
; %bb.1:
Lloh11:
	adrp	x19, _rtc_lock@GOTPAGE
Lloh12:
	ldr	x19, [x19, _rtc_lock@GOTPAGEOFF]
	mov	x0, x19
	bl	_spin_lock_irqsave
	mov	w0, #126
	bl	_CMOS_READ
Lloh13:
	adrp	x20, _g_usSmapiPort@GOTPAGE
Lloh14:
	ldr	x20, [x20, _g_usSmapiPort@GOTPAGEOFF]
	str	w0, [x20]
	mov	w0, #127
	bl	_CMOS_READ
	ldr	w8, [x20]
	orr	w8, w8, w0, lsl #8
	str	w8, [x20]
	mov	x0, x19
	bl	_spin_unlock_irqrestore
	ldr	w2, [x20]
	cbz	w2, LBB0_4
; %bb.2:
	ldr	w0, [x22]
Lloh15:
	adrp	x1, l_.str.3@PAGE
Lloh16:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_PRINTK_2
	mov	w19, #0
	b	LBB0_5
LBB0_3:
Lloh17:
	adrp	x0, l_.str.4@PAGE
Lloh18:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_PRINTK_ERROR
Lloh19:
	adrp	x8, _ENXIO@GOTPAGE
Lloh20:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	neg	w19, w8
	b	LBB0_5
LBB0_4:
	neg	w19, w21
Lloh22:
	adrp	x0, l_.str.2@PAGE
Lloh23:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_PRINTK_ERROR
LBB0_5:
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_EIO,4,2                        ; @EIO
	.comm	_TRACE_SMAPI,4,2                ; @TRACE_SMAPI
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"smapi::smapi_init entry\n"

	.comm	_rtc_lock,4,2                   ; @rtc_lock
l_.str.1:                               ; @.str.1
	.asciz	"smapi::smapi_init usSmapiID %x\n"

	.comm	_g_usSmapiPort,4,2              ; @g_usSmapiPort
l_.str.2:                               ; @.str.2
	.asciz	"smapi::smapi_init, ERROR unable to read from SMAPI port\n"

l_.str.3:                               ; @.str.3
	.asciz	"smapi::smapi_init, exit TRUE g_usSmapiPort %x\n"

l_.str.4:                               ; @.str.4
	.asciz	"smapi::smapi_init, ERROR invalid usSmapiID\n"

	.comm	_ENXIO,4,2                      ; @ENXIO
.subsections_via_symbols
