	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cros_ec_lpc_io_bytes_mec       ## -- Begin function cros_ec_lpc_io_bytes_mec
	.p2align	4, 0x90
_cros_ec_lpc_io_bytes_mec:              ## @cros_ec_lpc_io_bytes_mec
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_mec_emi_base@GOTPCREL(%rip), %rbx
	cmpq	$0, (%rbx)
	sete	%al
	movq	_mec_emi_end@GOTPCREL(%rip), %r14
	cmpq	$0, (%r14)
	movq	%rcx, %r12
	movl	%edx, %r13d
                                        ## kill: def $esi killed $esi def $rsi
	movq	%rsi, -64(%rbp)                 ## 8-byte Spill
	movl	%edi, -52(%rbp)                 ## 4-byte Spill
	sete	%cl
	orb	%al, %cl
	movzbl	%cl, %edi
	callq	_WARN_ON
	xorl	%r15d, %r15d
	cmpq	$0, (%rbx)
	je	LBB0_20
## %bb.1:
	cmpq	$0, (%r14)
	je	LBB0_20
## %bb.2:
	movq	_ACCESS_TYPE_BYTE@GOTPCREL(%rip), %rax
	movq	%rax, %rcx
	cmpl	$4, %r13d
	jb	LBB0_4
## %bb.3:
	movq	_ACCESS_TYPE_LONG_AUTO_INCREMENT@GOTPCREL(%rip), %rcx
LBB0_4:
	movq	-64(%rbp), %r15                 ## 8-byte Reload
	movl	%r15d, %r14d
	andl	$3, %r14d
	cmovneq	%rax, %rcx
	movl	(%rcx), %ebx
	movq	_io_mutex@GOTPCREL(%rip), %rdi
	callq	_mutex_lock
	movl	%r15d, %edi
	movl	%ebx, -48(%rbp)                 ## 4-byte Spill
	movl	%ebx, %esi
	callq	_cros_ec_lpc_mec_emi_write_address
	movq	_mec_emi_base@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	callq	_MEC_EMI_EC_DATA_B0
	testl	%r13d, %r13d
	je	LBB0_5
## %bb.6:
	movl	%r13d, -44(%rbp)                ## 4-byte Spill
	movq	%r12, -88(%rbp)                 ## 8-byte Spill
	addl	%r14d, %eax
	xorl	%r15d, %r15d
	xorl	%ecx, %ecx
	movq	%rcx, -72(%rbp)                 ## 8-byte Spill
LBB0_7:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_8 Depth 2
	movslq	-72(%rbp), %rdx                 ## 4-byte Folded Reload
	movq	-88(%rbp), %rcx                 ## 8-byte Reload
	leaq	(%rcx,%rdx,8), %r14
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	movl	%ecx, %r13d
	movq	%rdx, -80(%rbp)                 ## 8-byte Spill
	subl	%edx, %r13d
	movl	%eax, %eax
	movq	%rax, -96(%rbp)                 ## 8-byte Spill
	xorl	%r12d, %r12d
	jmp	LBB0_8
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_8 Depth=2
	movq	(%r14,%r12,8), %rdi
	movl	%ebx, %esi
	callq	_outb
	movq	(%r14,%r12,8), %rax
LBB0_12:                                ##   in Loop: Header=BB0_8 Depth=2
	addq	%rax, %r15
	incq	%r12
	cmpl	%r12d, %r13d
	je	LBB0_19
LBB0_8:                                 ##   Parent Loop BB0_7 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	-96(%rbp), %rax                 ## 8-byte Reload
	leaq	(%rax,%r12), %rbx
	movq	_mec_emi_base@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	callq	_MEC_EMI_EC_DATA_B3
	cmpl	%eax, %ebx
	jg	LBB0_13
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=2
	movl	-52(%rbp), %eax                 ## 4-byte Reload
	movq	_MEC_IO_READ@GOTPCREL(%rip), %rcx
	cmpl	%eax, (%rcx)
	jne	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_8 Depth=2
	movl	%ebx, %edi
	callq	_inb
	movq	%rax, (%r14,%r12,8)
	jmp	LBB0_12
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_7 Depth=1
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	movq	-72(%rbp), %r13                 ## 8-byte Reload
	subl	%r13d, %ecx
	subl	%r12d, %ecx
	movq	_ACCESS_TYPE_LONG_AUTO_INCREMENT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, %r14d
	movl	-52(%rbp), %edx                 ## 4-byte Reload
	movq	_MEC_IO_WRITE@GOTPCREL(%rip), %rsi
	cmpl	%edx, (%rsi)
	movl	-48(%rbp), %edx                 ## 4-byte Reload
	jne	LBB0_15
## %bb.14:                              ##   in Loop: Header=BB0_7 Depth=1
	movq	_ACCESS_TYPE_BYTE@GOTPCREL(%rip), %rsi
	movl	(%rsi), %r14d
LBB0_15:                                ##   in Loop: Header=BB0_7 Depth=1
	addq	%r12, %r13
	cmpl	$4, %ecx
	cmovael	%eax, %r14d
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movl	%ecx, %ecx
	addq	%r12, %rcx
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	cmpl	%edx, %r14d
	jne	LBB0_17
## %bb.16:                              ##   in Loop: Header=BB0_7 Depth=1
	cmpl	%eax, %edx
	je	LBB0_18
LBB0_17:                                ##   in Loop: Header=BB0_7 Depth=1
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
                                        ## kill: def $edi killed $edi killed $rdi
	movl	%r14d, %esi
	callq	_cros_ec_lpc_mec_emi_write_address
	movl	%r14d, %edx
LBB0_18:                                ##   in Loop: Header=BB0_7 Depth=1
	movl	%edx, -48(%rbp)                 ## 4-byte Spill
	movq	-80(%rbp), %rbx                 ## 8-byte Reload
	addq	%r12, %rbx
	movq	_mec_emi_base@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	callq	_MEC_EMI_EC_DATA_B0
	cmpl	-44(%rbp), %r13d                ## 4-byte Folded Reload
	movq	%rbx, -72(%rbp)                 ## 8-byte Spill
	jb	LBB0_7
	jmp	LBB0_19
LBB0_5:
	xorl	%r15d, %r15d
LBB0_19:
	movq	_io_mutex@GOTPCREL(%rip), %rdi
	callq	_mutex_unlock
LBB0_20:
	movq	%r15, %rax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_mec_emi_base,8,3               ## @mec_emi_base
	.comm	_mec_emi_end,8,3                ## @mec_emi_end
	.comm	_ACCESS_TYPE_BYTE,4,2           ## @ACCESS_TYPE_BYTE
	.comm	_ACCESS_TYPE_LONG_AUTO_INCREMENT,4,2 ## @ACCESS_TYPE_LONG_AUTO_INCREMENT
	.comm	_io_mutex,4,2                   ## @io_mutex
	.comm	_MEC_IO_READ,4,2                ## @MEC_IO_READ
	.comm	_MEC_IO_WRITE,4,2               ## @MEC_IO_WRITE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cros_ec_lpc_io_bytes_mec       ; -- Begin function cros_ec_lpc_io_bytes_mec
	.p2align	2
_cros_ec_lpc_io_bytes_mec:              ; @cros_ec_lpc_io_bytes_mec
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x20, x3
	mov	x21, x2
	mov	x23, x1
	mov	x22, x0
Lloh0:
	adrp	x26, _mec_emi_base@GOTPAGE
Lloh1:
	ldr	x26, [x26, _mec_emi_base@GOTPAGEOFF]
	ldr	x8, [x26]
	cmp	x8, #0
Lloh2:
	adrp	x19, _mec_emi_end@GOTPAGE
Lloh3:
	ldr	x19, [x19, _mec_emi_end@GOTPAGEOFF]
	ldr	x8, [x19]
	ccmp	x8, #0, #4, ne
	cset	w0, eq
	bl	_WARN_ON
	ldr	x8, [x26]
	ldr	x9, [x19]
	cmp	x8, #0
	ccmp	x9, #0, #4, ne
	b.ne	LBB0_2
; %bb.1:
	mov	x23, #0
	b	LBB0_15
LBB0_2:
	and	w19, w23, #0x3
	cmp	w21, #4
	ccmp	w19, #0, #0, hs
Lloh4:
	adrp	x8, _ACCESS_TYPE_BYTE@GOTPAGE
Lloh5:
	ldr	x8, [x8, _ACCESS_TYPE_BYTE@GOTPAGEOFF]
Lloh6:
	adrp	x9, _ACCESS_TYPE_LONG_AUTO_INCREMENT@GOTPAGE
Lloh7:
	ldr	x9, [x9, _ACCESS_TYPE_LONG_AUTO_INCREMENT@GOTPAGEOFF]
	csel	x8, x8, x9, ne
	ldr	w24, [x8]
Lloh8:
	adrp	x0, _io_mutex@GOTPAGE
Lloh9:
	ldr	x0, [x0, _io_mutex@GOTPAGEOFF]
	bl	_mutex_lock
	mov	x0, x23
	mov	x1, x24
	bl	_cros_ec_lpc_mec_emi_write_address
	ldr	x0, [x26]
	bl	_MEC_EMI_EC_DATA_B0
	cbz	w21, LBB0_13
; %bb.3:
	str	w24, [sp, #20]                  ; 4-byte Folded Spill
	str	x23, [sp, #24]                  ; 8-byte Folded Spill
	str	w21, [sp, #36]                  ; 4-byte Folded Spill
	str	x20, [sp, #8]                   ; 8-byte Folded Spill
	mov	x23, #0
	str	xzr, [sp, #40]                  ; 8-byte Folded Spill
	add	w0, w0, w19
Lloh10:
	adrp	x28, _MEC_IO_READ@GOTPAGE
Lloh11:
	ldr	x28, [x28, _MEC_IO_READ@GOTPAGEOFF]
LBB0_4:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_7 Depth 2
	mov	x19, #0
	ldr	x9, [sp, #40]                   ; 8-byte Folded Reload
	sxtw	x8, w9
	str	x8, [sp]                        ; 8-byte Folded Spill
	ldr	x8, [sp, #8]                    ; 8-byte Folded Reload
	add	x24, x8, w9, sxtw #3
	ldr	w8, [sp, #36]                   ; 4-byte Folded Reload
	sub	w21, w8, w9
	mov	w20, w0
	b	LBB0_7
LBB0_5:                                 ;   in Loop: Header=BB0_7 Depth=2
	lsl	x27, x19, #3
	ldr	x0, [x24, x27]
	mov	x1, x25
	bl	_outb
	ldr	x0, [x24, x27]
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=2
	add	x23, x0, x23
	add	x19, x19, #1
	cmp	w21, w19
	b.eq	LBB0_14
LBB0_7:                                 ;   Parent Loop BB0_4 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	add	x25, x20, x19
	ldr	x0, [x26]
	bl	_MEC_EMI_EC_DATA_B3
	cmp	w25, w0
	b.gt	LBB0_10
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=2
	ldr	w8, [x28]
	cmp	w8, w22
	b.ne	LBB0_5
; %bb.9:                                ;   in Loop: Header=BB0_7 Depth=2
	mov	x0, x25
	bl	_inb
	str	x0, [x24, x19, lsl #3]
	b	LBB0_6
LBB0_10:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w21, [sp, #36]                  ; 4-byte Folded Reload
	ldr	x8, [sp, #40]                   ; 8-byte Folded Reload
	sub	w8, w21, w8
	sub	w8, w8, w19
Lloh12:
	adrp	x9, _MEC_IO_WRITE@GOTPAGE
Lloh13:
	ldr	x9, [x9, _MEC_IO_WRITE@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	cmp	w9, w22
	ccmp	w8, #4, #2, eq
Lloh15:
	adrp	x8, _ACCESS_TYPE_BYTE@GOTPAGE
Lloh16:
	ldr	x8, [x8, _ACCESS_TYPE_BYTE@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
Lloh18:
	adrp	x9, _ACCESS_TYPE_LONG_AUTO_INCREMENT@GOTPAGE
Lloh19:
	ldr	x9, [x9, _ACCESS_TYPE_LONG_AUTO_INCREMENT@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
	csel	w25, w8, w9, lo
	ldr	x20, [sp, #24]                  ; 8-byte Folded Reload
	add	x20, x19, w20, uxtw
	ldr	w8, [sp, #20]                   ; 4-byte Folded Reload
	cmp	w25, w8
	ccmp	w8, w9, #0, eq
	b.eq	LBB0_12
; %bb.11:                               ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x20
	mov	x1, x25
	bl	_cros_ec_lpc_mec_emi_write_address
	mov	x8, x25
LBB0_12:                                ;   in Loop: Header=BB0_4 Depth=1
	str	w8, [sp, #20]                   ; 4-byte Folded Spill
	str	x20, [sp, #24]                  ; 8-byte Folded Spill
	ldr	x8, [sp, #40]                   ; 8-byte Folded Reload
	add	x20, x8, x19
	ldr	x8, [sp]                        ; 8-byte Folded Reload
	add	x8, x8, x19
	str	x8, [sp, #40]                   ; 8-byte Folded Spill
	ldr	x0, [x26]
	bl	_MEC_EMI_EC_DATA_B0
	cmp	w20, w21
	b.lo	LBB0_4
	b	LBB0_14
LBB0_13:
	mov	x23, #0
LBB0_14:
Lloh21:
	adrp	x0, _io_mutex@GOTPAGE
Lloh22:
	ldr	x0, [x0, _io_mutex@GOTPAGEOFF]
	bl	_mutex_unlock
LBB0_15:
	mov	x0, x23
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_mec_emi_base,8,3               ; @mec_emi_base
	.comm	_mec_emi_end,8,3                ; @mec_emi_end
	.comm	_ACCESS_TYPE_BYTE,4,2           ; @ACCESS_TYPE_BYTE
	.comm	_ACCESS_TYPE_LONG_AUTO_INCREMENT,4,2 ; @ACCESS_TYPE_LONG_AUTO_INCREMENT
	.comm	_io_mutex,4,2                   ; @io_mutex
	.comm	_MEC_IO_READ,4,2                ; @MEC_IO_READ
	.comm	_MEC_IO_WRITE,4,2               ; @MEC_IO_WRITE
.subsections_via_symbols
