	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function i2c_opal_smbus_xfer
_i2c_opal_smbus_xfer:                   ## @i2c_opal_smbus_xfer
	.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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r9d, %r13d
	movl	%r8d, -60(%rbp)                 ## 4-byte Spill
	movl	%ecx, %r14d
	movl	%esi, %r15d
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	(%rdi), %rbx
	leaq	-112(%rbp), %rdi
	xorl	%r12d, %r12d
	xorl	%esi, %esi
	movl	$48, %edx
	callq	_memset
	movl	%r15d, %edi
	callq	_cpu_to_be16
	movl	%eax, -72(%rbp)
	leal	-128(%r13), %eax
	cmpl	$4, %eax
	ja	LBB0_8
## %bb.1:
	movq	%rbx, %r12
	movq	_OPAL_I2C_RAW_WRITE@GOTPCREL(%rip), %r15
	movq	_OPAL_I2C_RAW_READ@GOTPCREL(%rip), %rbx
	leaq	LJTI0_0(%rip), %rcx
	movslq	(%rcx,%rax,4), %rax
	addq	%rcx, %rax
	jmpq	*%rax
LBB0_3:
	testb	%r14b, %r14b
	jne	LBB0_5
## %bb.4:
	movq	16(%rbp), %rax
	movl	(%rax), %eax
	movzbl	%al, %ecx
	movl	%ecx, -56(%rbp)
	movzbl	%ah, %eax
	movl	%eax, -52(%rbp)
LBB0_5:
	leaq	-56(%rbp), %rdi
	callq	___pa
	movl	%eax, %edi
	callq	_cpu_to_be64
	movq	%rax, -80(%rbp)
	movl	$2, %edi
	jmp	LBB0_6
LBB0_8:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %r12d
	jmp	LBB0_14
LBB0_7:
	movq	16(%rbp), %rbx
	movq	(%rbx), %rdi
	addq	$4, %rdi
	callq	___pa
	movl	%eax, %edi
	callq	_cpu_to_be64
	movq	%rax, -80(%rbp)
	movq	(%rbx), %rax
	movl	(%rax), %edi
	jmp	LBB0_6
LBB0_2:
	movq	16(%rbp), %rdi
	callq	___pa
	movl	%eax, %edi
	callq	_cpu_to_be64
	movq	%rax, -80(%rbp)
	movl	$1, %edi
LBB0_6:
	callq	_cpu_to_be32
	movq	%rax, -88(%rbp)
	movl	-60(%rbp), %edi                 ## 4-byte Reload
	callq	_cpu_to_be32
	movq	%rax, -96(%rbp)
	movl	$1, -112(%rbp)
	movq	_OPAL_I2C_SM_WRITE@GOTPCREL(%rip), %r15
	movq	_OPAL_I2C_SM_READ@GOTPCREL(%rip), %rbx
	jmp	LBB0_10
LBB0_9:
	movq	16(%rbp), %rdi
	callq	___pa
	movl	%eax, %edi
	callq	_cpu_to_be64
	movq	%rax, -80(%rbp)
	movl	$1, %edi
	callq	_cpu_to_be32
	movq	%rax, -88(%rbp)
LBB0_10:
	movq	_I2C_SMBUS_READ@GOTPCREL(%rip), %rax
	cmpb	%r14b, (%rax)
	cmovneq	%r15, %rbx
	movq	(%rbx), %rax
	movq	%rax, -104(%rbp)
	leaq	-112(%rbp), %rsi
	movq	%r12, %rdi
	callq	_i2c_opal_send_request
	movl	%eax, %r12d
	cmpl	$128, %r13d
	jne	LBB0_14
## %bb.11:
	testb	%r14b, %r14b
	je	LBB0_14
## %bb.12:
	testl	%r12d, %r12d
	jne	LBB0_14
## %bb.13:
	movl	-52(%rbp), %eax
	shll	$8, %eax
	orl	-56(%rbp), %eax
	movq	16(%rbp), %rcx
	movl	%eax, (%rcx)
	xorl	%r12d, %r12d
LBB0_14:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_16
## %bb.15:
	movl	%r12d, %eax
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_16:
	callq	___stack_chk_fail
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_3, LBB0_3-LJTI0_0
.set L0_0_set_10, LBB0_10-LJTI0_0
.set L0_0_set_7, LBB0_7-LJTI0_0
.set L0_0_set_2, LBB0_2-LJTI0_0
.set L0_0_set_9, LBB0_9-LJTI0_0
LJTI0_0:
	.long	L0_0_set_3
	.long	L0_0_set_10
	.long	L0_0_set_7
	.long	L0_0_set_2
	.long	L0_0_set_9
	.end_data_region
                                        ## -- End function
	.comm	_I2C_SMBUS_READ,1,0             ## @I2C_SMBUS_READ
	.comm	_OPAL_I2C_RAW_READ,8,3          ## @OPAL_I2C_RAW_READ
	.comm	_OPAL_I2C_RAW_WRITE,8,3         ## @OPAL_I2C_RAW_WRITE
	.comm	_OPAL_I2C_SM_READ,8,3           ## @OPAL_I2C_SM_READ
	.comm	_OPAL_I2C_SM_WRITE,8,3          ## @OPAL_I2C_SM_WRITE
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_i2c_opal_smbus_xfer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function i2c_opal_smbus_xfer
_i2c_opal_smbus_xfer:                   ; @i2c_opal_smbus_xfer
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	mov	x19, x6
	mov	x20, x5
	mov	x22, x4
	mov	x23, x3
	mov	x24, x1
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #56]
	ldr	x21, [x0]
	mov	x0, sp
	mov	w1, #0
	mov	w2, #48
	bl	_memset
	mov	x0, x24
	bl	_cpu_to_be16
	str	w0, [sp, #40]
	sub	w10, w20, #128
	cmp	w10, #4
	b.hi	LBB0_5
; %bb.1:
Lloh3:
	adrp	x8, _OPAL_I2C_RAW_WRITE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _OPAL_I2C_RAW_WRITE@GOTPAGEOFF]
	and	w23, w23, #0xff
Lloh5:
	adrp	x9, _OPAL_I2C_RAW_READ@GOTPAGE
Lloh6:
	ldr	x9, [x9, _OPAL_I2C_RAW_READ@GOTPAGEOFF]
Lloh7:
	adrp	x11, lJTI0_0@PAGE
Lloh8:
	add	x11, x11, lJTI0_0@PAGEOFF
	adr	x12, LBB0_2
	ldrb	w13, [x11, x10]
	add	x12, x12, x13, lsl #2
	br	x12
LBB0_2:
	cbnz	w23, LBB0_4
; %bb.3:
	ldr	w8, [x19]
	and	w9, w8, #0xff
	ubfx	w8, w8, #8, #8
	stp	w9, w8, [sp, #48]
LBB0_4:
	add	x0, sp, #48
	bl	___pa
	bl	_cpu_to_be64
	str	x0, [sp, #32]
	mov	w0, #2
	b	LBB0_7
LBB0_5:
Lloh9:
	adrp	x8, _EINVAL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_15
LBB0_6:
	ldr	x8, [x19]
	add	x0, x8, #4
	bl	___pa
	bl	_cpu_to_be64
	str	x0, [sp, #32]
	ldr	x8, [x19]
	ldr	w0, [x8]
LBB0_7:
	bl	_cpu_to_be32
	str	x0, [sp, #24]
	mov	x0, x22
	bl	_cpu_to_be32
	str	x0, [sp, #16]
	mov	w8, #1
	str	w8, [sp]
	b	LBB0_9
LBB0_8:
	mov	x0, x19
	bl	___pa
	bl	_cpu_to_be64
	str	x0, [sp, #32]
	mov	w24, #1
	mov	w0, #1
	bl	_cpu_to_be32
	str	x0, [sp, #24]
	mov	x0, x22
	bl	_cpu_to_be32
	str	x0, [sp, #16]
	str	w24, [sp]
LBB0_9:
Lloh12:
	adrp	x8, _OPAL_I2C_SM_WRITE@GOTPAGE
Lloh13:
	ldr	x8, [x8, _OPAL_I2C_SM_WRITE@GOTPAGEOFF]
Lloh14:
	adrp	x9, _OPAL_I2C_SM_READ@GOTPAGE
Lloh15:
	ldr	x9, [x9, _OPAL_I2C_SM_READ@GOTPAGEOFF]
	b	LBB0_11
LBB0_10:
	mov	x0, x19
	bl	___pa
	bl	_cpu_to_be64
	str	x0, [sp, #32]
	mov	w0, #1
	bl	_cpu_to_be32
	str	x0, [sp, #24]
Lloh16:
	adrp	x8, _OPAL_I2C_RAW_WRITE@GOTPAGE
Lloh17:
	ldr	x8, [x8, _OPAL_I2C_RAW_WRITE@GOTPAGEOFF]
Lloh18:
	adrp	x9, _OPAL_I2C_RAW_READ@GOTPAGE
Lloh19:
	ldr	x9, [x9, _OPAL_I2C_RAW_READ@GOTPAGEOFF]
LBB0_11:
Lloh20:
	adrp	x10, _I2C_SMBUS_READ@GOTPAGE
Lloh21:
	ldr	x10, [x10, _I2C_SMBUS_READ@GOTPAGEOFF]
	ldrb	w10, [x10]
	cmp	w10, w23
	csel	x8, x9, x8, eq
	ldr	x8, [x8]
	str	x8, [sp, #8]
	mov	x1, sp
	mov	x0, x21
	bl	_i2c_opal_send_request
	cmp	w20, #128
	b.ne	LBB0_15
; %bb.12:
	cbz	w23, LBB0_15
; %bb.13:
	cbnz	w0, LBB0_15
; %bb.14:
	ldp	w9, w8, [sp, #48]
	orr	w8, w9, w8, lsl #8
	str	w8, [x19]
LBB0_15:
	ldr	x8, [sp, #56]
Lloh22:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh23:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh24:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_17
; %bb.16:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_17:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_2-LBB0_2)>>2
	.byte	(LBB0_11-LBB0_2)>>2
	.byte	(LBB0_6-LBB0_2)>>2
	.byte	(LBB0_8-LBB0_2)>>2
	.byte	(LBB0_10-LBB0_2)>>2
                                        ; -- End function
	.comm	_I2C_SMBUS_READ,1,0             ; @I2C_SMBUS_READ
	.comm	_OPAL_I2C_RAW_READ,8,3          ; @OPAL_I2C_RAW_READ
	.comm	_OPAL_I2C_RAW_WRITE,8,3         ; @OPAL_I2C_RAW_WRITE
	.comm	_OPAL_I2C_SM_READ,8,3           ; @OPAL_I2C_SM_READ
	.comm	_OPAL_I2C_SM_WRITE,8,3          ; @OPAL_I2C_SM_WRITE
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_i2c_opal_smbus_xfer
.subsections_via_symbols
