	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function applesmc_get_key_at_index
_applesmc_get_key_at_index:             ## @applesmc_get_key_at_index
	.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	%rsi, %r14
	movl	%edi, %ebx
	movq	_APPLESMC_GET_KEY_BY_INDEX_CMD@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_send_command
	testq	%rax, %rax
	jne	LBB0_6
## %bb.1:
	movl	%ebx, %edi
	sarl	$24, %edi
	movq	_APPLESMC_DATA_PORT@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	callq	_outb
	movl	$4, %edi
	callq	___wait_status
	testq	%rax, %rax
	jne	LBB0_6
## %bb.2:
	movl	%ebx, %edi
	sarl	$16, %edi
	movl	(%r15), %esi
	callq	_outb
	movl	$4, %edi
	callq	___wait_status
	testq	%rax, %rax
	jne	LBB0_6
## %bb.3:
	movl	%ebx, %edi
	sarl	$8, %edi
	movl	(%r15), %esi
	callq	_outb
	movl	$4, %edi
	callq	___wait_status
	testq	%rax, %rax
	jne	LBB0_6
## %bb.4:
	movl	(%r15), %esi
	movl	%ebx, %edi
	callq	_outb
	movl	$4, %edi
	callq	___wait_status
	testq	%rax, %rax
	jne	LBB0_6
## %bb.5:
	movl	(%r15), %esi
	movl	$4, %edi
	callq	_outb
	movl	$5, %edi
	callq	___wait_status
	testq	%rax, %rax
	jne	LBB0_6
## %bb.7:
	movl	(%r15), %edi
	callq	_inb
	movb	%al, (%r14)
	movl	$5, %edi
	callq	___wait_status
	testq	%rax, %rax
	jne	LBB0_6
## %bb.8:
	movl	(%r15), %edi
	callq	_inb
	movb	%al, 1(%r14)
	movl	$5, %edi
	callq	___wait_status
	testq	%rax, %rax
	jne	LBB0_6
## %bb.9:
	movl	(%r15), %edi
	callq	_inb
	movb	%al, 2(%r14)
	movl	$5, %edi
	callq	___wait_status
	testq	%rax, %rax
	je	LBB0_10
LBB0_6:
	movq	_EIO@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_11:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	movl	(%r15), %edi
	callq	_inb
	movb	%al, 3(%r14)
	movb	$0, 4(%r14)
	xorl	%eax, %eax
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_APPLESMC_GET_KEY_BY_INDEX_CMD,4,2 ## @APPLESMC_GET_KEY_BY_INDEX_CMD
	.comm	_EIO,4,2                        ## @EIO
	.comm	_APPLESMC_DATA_PORT,4,2         ## @APPLESMC_DATA_PORT
	.no_dead_strip	_applesmc_get_key_at_index
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function applesmc_get_key_at_index
_applesmc_get_key_at_index:             ; @applesmc_get_key_at_index
	.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
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _APPLESMC_GET_KEY_BY_INDEX_CMD@GOTPAGE
Lloh1:
	ldr	x8, [x8, _APPLESMC_GET_KEY_BY_INDEX_CMD@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_send_command
	cbnz	x0, LBB0_9
; %bb.1:
	asr	w0, w20, #24
Lloh3:
	adrp	x21, _APPLESMC_DATA_PORT@GOTPAGE
Lloh4:
	ldr	x21, [x21, _APPLESMC_DATA_PORT@GOTPAGEOFF]
	ldr	w1, [x21]
	bl	_outb
	mov	w0, #4
	bl	___wait_status
	cbnz	x0, LBB0_9
; %bb.2:
	asr	w0, w20, #16
	ldr	w1, [x21]
	bl	_outb
	mov	w0, #4
	bl	___wait_status
	cbnz	x0, LBB0_9
; %bb.3:
	asr	w0, w20, #8
	ldr	w1, [x21]
	bl	_outb
	mov	w0, #4
	bl	___wait_status
	cbnz	x0, LBB0_9
; %bb.4:
	ldr	w1, [x21]
	mov	x0, x20
	bl	_outb
	mov	w0, #4
	bl	___wait_status
	cbnz	x0, LBB0_9
; %bb.5:
	ldr	w1, [x21]
	mov	w0, #4
	bl	_outb
	mov	w0, #5
	bl	___wait_status
	cbnz	x0, LBB0_9
; %bb.6:
	ldr	w0, [x21]
	bl	_inb
	strb	w0, [x19]
	mov	w0, #5
	bl	___wait_status
	cbnz	x0, LBB0_9
; %bb.7:
	ldr	w0, [x21]
	bl	_inb
	strb	w0, [x19, #1]
	mov	w0, #5
	bl	___wait_status
	cbnz	x0, LBB0_9
; %bb.8:
	ldr	w0, [x21]
	bl	_inb
	strb	w0, [x19, #2]
	mov	w0, #5
	bl	___wait_status
	cbz	x0, LBB0_11
LBB0_9:
Lloh5:
	adrp	x8, _EIO@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_10:
	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
LBB0_11:
	ldr	w0, [x21]
	bl	_inb
	mov	x8, x0
	mov	w0, #0
	strb	w8, [x19, #3]
	strb	wzr, [x19, #4]
	b	LBB0_10
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_APPLESMC_GET_KEY_BY_INDEX_CMD,4,2 ; @APPLESMC_GET_KEY_BY_INDEX_CMD
	.comm	_EIO,4,2                        ; @EIO
	.comm	_APPLESMC_DATA_PORT,4,2         ; @APPLESMC_DATA_PORT
	.no_dead_strip	_applesmc_get_key_at_index
.subsections_via_symbols
