	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function i2c_powermac_master_xfer
_i2c_powermac_master_xfer:              ## @i2c_powermac_master_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	%rdi, %r13
	callq	_i2c_get_adapdata
	movq	%rax, %r14
	movq	_I2C_M_TEN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rbx)
	je	LBB0_2
## %bb.1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
	jmp	LBB0_11
LBB0_2:
	movq	%rbx, %rdi
	callq	_i2c_8bit_addr_from_msg
	movl	%eax, %r15d
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_pmac_i2c_open
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movl	%eax, %r12d
	leaq	L_.str(%rip), %rsi
	movq	%r13, %rdi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_11
LBB0_4:
	movl	%r15d, -44(%rbp)                ## 4-byte Spill
	movq	_pmac_i2c_mode_std@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	%r14, %rdi
	callq	_pmac_i2c_setmode
	testl	%eax, %eax
	je	LBB0_6
## %bb.5:
	movl	%eax, %r15d
	movl	(%r12), %edx
	leaq	L_.str.1(%rip), %rsi
	movq	%r13, %rdi
	movl	%eax, %ecx
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_10
LBB0_6:
	movl	4(%rbx), %r9d
	movl	8(%rbx), %r8d
	movq	%r14, %rdi
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	movl	%ebx, %esi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_pmac_i2c_xfer
	movl	%eax, %r15d
	testl	%eax, %eax
	jns	LBB0_10
## %bb.7:
	testb	$1, %bl
	leaq	L_.str.4(%rip), %rax
	leaq	L_.str.3(%rip), %rdx
	cmoveq	%rax, %rdx
	movq	_ENXIO@GOTPCREL(%rip), %rax
	sarl	%ebx
	movl	(%rax), %eax
	leaq	L_.str.2(%rip), %rsi
	movq	%r13, %rdi
	movl	%ebx, %ecx
	movl	%r15d, %r8d
	addl	%r15d, %eax
	jne	LBB0_9
## %bb.8:
	callq	_dev_dbg
	jmp	LBB0_10
LBB0_9:
	xorl	%eax, %eax
	callq	_dev_err
LBB0_10:
	movq	%r14, %rdi
	callq	_pmac_i2c_close
	testl	%r15d, %r15d
	movl	$1, %r12d
	cmovsl	%r15d, %r12d
LBB0_11:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_I2C_M_TEN,4,2                  ## @I2C_M_TEN
	.comm	_EINVAL,4,2                     ## @EINVAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to open I2C, err %d\n"

	.comm	_pmac_i2c_mode_std,4,2          ## @pmac_i2c_mode_std
L_.str.1:                               ## @.str.1
	.asciz	"Failed to set I2C mode %d, err %d\n"

	.comm	_ENXIO,4,2                      ## @ENXIO
L_.str.2:                               ## @.str.2
	.asciz	"I2C %s 0x%02x failed, err %d\n"

L_.str.3:                               ## @.str.3
	.asciz	"read from"

L_.str.4:                               ## @.str.4
	.asciz	"write to"

	.no_dead_strip	_i2c_powermac_master_xfer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function i2c_powermac_master_xfer
_i2c_powermac_master_xfer:              ; @i2c_powermac_master_xfer
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x23, x1
	mov	x20, x0
	bl	_i2c_get_adapdata
	ldr	w8, [x23]
Lloh0:
	adrp	x9, _I2C_M_TEN@GOTPAGE
Lloh1:
	ldr	x9, [x9, _I2C_M_TEN@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_2
; %bb.1:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_11
LBB0_2:
	mov	x19, x0
	mov	x0, x23
	bl	_i2c_8bit_addr_from_msg
	mov	x22, x0
	mov	x0, x19
	mov	w1, #0
	bl	_pmac_i2c_open
	cbz	w0, LBB0_4
; %bb.3:
	mov	x21, x0
	str	x21, [sp]
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_dev_err
	b	LBB0_11
LBB0_4:
Lloh8:
	adrp	x24, _pmac_i2c_mode_std@GOTPAGE
Lloh9:
	ldr	x24, [x24, _pmac_i2c_mode_std@GOTPAGEOFF]
	ldr	w1, [x24]
	mov	x0, x19
	bl	_pmac_i2c_setmode
	cbz	w0, LBB0_7
; %bb.5:
	mov	x21, x0
	ldr	w8, [x24]
	stp	x8, x21, [sp]
Lloh10:
	adrp	x1, l_.str.1@PAGE
Lloh11:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_6:
	mov	x0, x20
	bl	_dev_err
	b	LBB0_10
LBB0_7:
	ldp	w5, w4, [x23, #4]
	mov	x0, x19
	mov	x1, x22
	mov	w2, #0
	mov	w3, #0
	bl	_pmac_i2c_xfer
	mov	x21, x0
	tbz	w0, #31, LBB0_10
; %bb.8:
Lloh12:
	adrp	x8, _ENXIO@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
Lloh15:
	adrp	x9, l_.str.3@PAGE
Lloh16:
	add	x9, x9, l_.str.3@PAGEOFF
Lloh17:
	adrp	x10, l_.str.4@PAGE
Lloh18:
	add	x10, x10, l_.str.4@PAGEOFF
	tst	w22, #0x1
	csel	x2, x10, x9, eq
	asr	w3, w22, #1
	cmn	w21, w8
	b.ne	LBB0_12
; %bb.9:
Lloh19:
	adrp	x1, l_.str.2@PAGE
Lloh20:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x20
                                        ; kill: def $w3 killed $w3 killed $x3
	mov	x4, x21
	bl	_dev_dbg
LBB0_10:
	mov	x0, x19
	bl	_pmac_i2c_close
	cmp	w21, #0
	csinc	w21, w21, wzr, lt
LBB0_11:
	mov	x0, x21
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_12:
	mov	x8, x21
	stp	x3, x8, [sp, #8]
	str	x2, [sp]
Lloh21:
	adrp	x1, l_.str.2@PAGE
Lloh22:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_6
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_I2C_M_TEN,4,2                  ; @I2C_M_TEN
	.comm	_EINVAL,4,2                     ; @EINVAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to open I2C, err %d\n"

	.comm	_pmac_i2c_mode_std,4,2          ; @pmac_i2c_mode_std
l_.str.1:                               ; @.str.1
	.asciz	"Failed to set I2C mode %d, err %d\n"

	.comm	_ENXIO,4,2                      ; @ENXIO
l_.str.2:                               ; @.str.2
	.asciz	"I2C %s 0x%02x failed, err %d\n"

l_.str.3:                               ; @.str.3
	.asciz	"read from"

l_.str.4:                               ; @.str.4
	.asciz	"write to"

	.no_dead_strip	_i2c_powermac_master_xfer
.subsections_via_symbols
