	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cafe_smbus_read_data
_cafe_smbus_read_data:                  ## @cafe_smbus_read_data
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	movl	%edx, %r12d
	movl	%esi, %r15d
	movq	%rdi, %r13
	leaq	4(%rdi), %rbx
	movq	%rbx, %rdi
	callq	_spin_lock_irqsave
	movq	_TWSIC0_EN@GOTPCREL(%rip), %rax
	movq	_TWSIC0_SID_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	movl	%r15d, %edx
	shll	%cl, %edx
	movq	_TWSIC0_SID@GOTPCREL(%rip), %rcx
	andl	(%rcx), %edx
	orl	(%rax), %edx
	movq	_TWSIC0_OVMAGIC@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	movq	_TWSIC0_CLKDIV@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	movq	_REG_TWSIC0@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_mcam_reg_write
	movq	_REG_TWSIC1@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movq	%rbx, %rdi
	callq	_mcam_reg_read
	movq	_TWSIC1_ADDR_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	movl	%r12d, -44(%rbp)                ## 4-byte Spill
	shll	%cl, %r12d
	movq	_TWSIC1_ADDR@GOTPCREL(%rip), %rax
	andl	(%rax), %r12d
	movq	_TWSIC1_READ@GOTPCREL(%rip), %rax
	orl	(%rax), %r12d
	movl	(%r14), %esi
	movq	%rbx, %rdi
	movl	%r12d, %edx
	callq	_mcam_reg_write
	movq	%rbx, %rdi
	callq	_spin_unlock_irqrestore
	movl	(%r13), %r12d
	movq	%rbx, %rdi
	callq	_cafe_smbus_read_done
	movq	_CAFE_SMBUS_TIMEOUT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movl	%r12d, %edi
	movl	%eax, %esi
	callq	_wait_event_timeout
	movq	%rbx, %rdi
	callq	_spin_lock_irqsave
	movl	(%r14), %esi
	movq	%rbx, %rdi
	callq	_mcam_reg_read
	movl	%eax, %r12d
	movq	%rbx, %rdi
	callq	_spin_unlock_irqrestore
	movq	_TWSIC1_ERROR@GOTPCREL(%rip), %rax
	testl	%r12d, (%rax)
	je	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rsi
	movq	%r13, %rdi
	movl	%r15d, %edx
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
LBB0_4:
	callq	_cam_err
	movq	_EIO@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_6
LBB0_2:
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	movq	_TWSIC1_RVALID@GOTPCREL(%rip), %rax
	testl	%r12d, (%rax)
	je	LBB0_3
## %bb.5:
	movzbl	%r12b, %eax
	movl	%eax, (%rsi)
	xorl	%eax, %eax
LBB0_6:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	leaq	L_.str.1(%rip), %rsi
	movq	%r13, %rdi
	movl	%r15d, %edx
	jmp	LBB0_4
	.cfi_endproc
                                        ## -- End function
	.comm	_TWSIC0_EN,4,2                  ## @TWSIC0_EN
	.comm	_TWSIC0_SID_SHIFT,4,2           ## @TWSIC0_SID_SHIFT
	.comm	_TWSIC0_SID,4,2                 ## @TWSIC0_SID
	.comm	_TWSIC0_OVMAGIC,4,2             ## @TWSIC0_OVMAGIC
	.comm	_TWSIC0_CLKDIV,4,2              ## @TWSIC0_CLKDIV
	.comm	_REG_TWSIC0,4,2                 ## @REG_TWSIC0
	.comm	_REG_TWSIC1,4,2                 ## @REG_TWSIC1
	.comm	_TWSIC1_READ,4,2                ## @TWSIC1_READ
	.comm	_TWSIC1_ADDR_SHIFT,4,2          ## @TWSIC1_ADDR_SHIFT
	.comm	_TWSIC1_ADDR,4,2                ## @TWSIC1_ADDR
	.comm	_CAFE_SMBUS_TIMEOUT,4,2         ## @CAFE_SMBUS_TIMEOUT
	.comm	_TWSIC1_ERROR,4,2               ## @TWSIC1_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"SMBUS read (%02x/%02x) error\n"

	.comm	_EIO,4,2                        ## @EIO
	.comm	_TWSIC1_RVALID,4,2              ## @TWSIC1_RVALID
L_.str.1:                               ## @.str.1
	.asciz	"SMBUS read (%02x/%02x) timed out\n"

	.no_dead_strip	_cafe_smbus_read_data
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cafe_smbus_read_data
_cafe_smbus_read_data:                  ; @cafe_smbus_read_data
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x22, x3
	mov	x19, x2
	mov	x20, x1
	mov	x21, x0
	add	x23, x0, #4
	mov	x0, x23
	bl	_spin_lock_irqsave
Lloh0:
	adrp	x8, _TWSIC0_EN@GOTPAGE
Lloh1:
	ldr	x8, [x8, _TWSIC0_EN@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _TWSIC0_SID_SHIFT@GOTPAGE
Lloh4:
	ldr	x9, [x9, _TWSIC0_SID_SHIFT@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	lsl	w9, w20, w9
Lloh6:
	adrp	x10, _TWSIC0_SID@GOTPAGE
Lloh7:
	ldr	x10, [x10, _TWSIC0_SID@GOTPAGEOFF]
Lloh8:
	ldr	w10, [x10]
	and	w9, w9, w10
	orr	w8, w9, w8
Lloh9:
	adrp	x9, _TWSIC0_OVMAGIC@GOTPAGE
Lloh10:
	ldr	x9, [x9, _TWSIC0_OVMAGIC@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
Lloh12:
	adrp	x10, _TWSIC0_CLKDIV@GOTPAGE
Lloh13:
	ldr	x10, [x10, _TWSIC0_CLKDIV@GOTPAGEOFF]
	orr	w8, w8, w9
Lloh14:
	ldr	w9, [x10]
	orr	w2, w8, w9
Lloh15:
	adrp	x8, _REG_TWSIC0@GOTPAGE
Lloh16:
	ldr	x8, [x8, _REG_TWSIC0@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	mov	x0, x23
	bl	_mcam_reg_write
Lloh18:
	adrp	x25, _REG_TWSIC1@GOTPAGE
Lloh19:
	ldr	x25, [x25, _REG_TWSIC1@GOTPAGEOFF]
	ldr	w1, [x25]
	mov	x0, x23
	bl	_mcam_reg_read
Lloh20:
	adrp	x8, _TWSIC1_READ@GOTPAGE
Lloh21:
	ldr	x8, [x8, _TWSIC1_READ@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
Lloh23:
	adrp	x9, _TWSIC1_ADDR_SHIFT@GOTPAGE
Lloh24:
	ldr	x9, [x9, _TWSIC1_ADDR_SHIFT@GOTPAGEOFF]
Lloh25:
	ldr	w9, [x9]
	lsl	w9, w19, w9
Lloh26:
	adrp	x10, _TWSIC1_ADDR@GOTPAGE
Lloh27:
	ldr	x10, [x10, _TWSIC1_ADDR@GOTPAGEOFF]
Lloh28:
	ldr	w10, [x10]
	and	w9, w9, w10
	orr	w2, w9, w8
	ldr	w1, [x25]
	mov	x0, x23
	bl	_mcam_reg_write
	mov	x0, x23
	bl	_spin_unlock_irqrestore
	ldr	w24, [x21]
	mov	x0, x23
	bl	_cafe_smbus_read_done
	mov	x1, x0
Lloh29:
	adrp	x8, _CAFE_SMBUS_TIMEOUT@GOTPAGE
Lloh30:
	ldr	x8, [x8, _CAFE_SMBUS_TIMEOUT@GOTPAGEOFF]
Lloh31:
	ldr	w2, [x8]
	mov	x0, x24
	bl	_wait_event_timeout
	mov	x0, x23
	bl	_spin_lock_irqsave
	ldr	w1, [x25]
	mov	x0, x23
	bl	_mcam_reg_read
	mov	x24, x0
	mov	x0, x23
	bl	_spin_unlock_irqrestore
Lloh32:
	adrp	x8, _TWSIC1_ERROR@GOTPAGE
Lloh33:
	ldr	x8, [x8, _TWSIC1_ERROR@GOTPAGEOFF]
Lloh34:
	ldr	w8, [x8]
	tst	w8, w24
	b.eq	LBB0_3
; %bb.1:
Lloh35:
	adrp	x1, l_.str@PAGE
Lloh36:
	add	x1, x1, l_.str@PAGEOFF
LBB0_2:
	mov	x0, x21
	mov	x2, x20
	mov	x3, x19
	bl	_cam_err
Lloh37:
	adrp	x8, _EIO@GOTPAGE
Lloh38:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh39:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_5
LBB0_3:
Lloh40:
	adrp	x8, _TWSIC1_RVALID@GOTPAGE
Lloh41:
	ldr	x8, [x8, _TWSIC1_RVALID@GOTPAGEOFF]
Lloh42:
	ldr	w8, [x8]
	tst	w8, w24
	b.eq	LBB0_6
; %bb.4:
	mov	w0, #0
	and	w8, w24, #0xff
	str	w8, [x22]
LBB0_5:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_6:
Lloh43:
	adrp	x1, l_.str.1@PAGE
Lloh44:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_2
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpAdd	Lloh43, Lloh44
	.cfi_endproc
                                        ; -- End function
	.comm	_TWSIC0_EN,4,2                  ; @TWSIC0_EN
	.comm	_TWSIC0_SID_SHIFT,4,2           ; @TWSIC0_SID_SHIFT
	.comm	_TWSIC0_SID,4,2                 ; @TWSIC0_SID
	.comm	_TWSIC0_OVMAGIC,4,2             ; @TWSIC0_OVMAGIC
	.comm	_TWSIC0_CLKDIV,4,2              ; @TWSIC0_CLKDIV
	.comm	_REG_TWSIC0,4,2                 ; @REG_TWSIC0
	.comm	_REG_TWSIC1,4,2                 ; @REG_TWSIC1
	.comm	_TWSIC1_READ,4,2                ; @TWSIC1_READ
	.comm	_TWSIC1_ADDR_SHIFT,4,2          ; @TWSIC1_ADDR_SHIFT
	.comm	_TWSIC1_ADDR,4,2                ; @TWSIC1_ADDR
	.comm	_CAFE_SMBUS_TIMEOUT,4,2         ; @CAFE_SMBUS_TIMEOUT
	.comm	_TWSIC1_ERROR,4,2               ; @TWSIC1_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"SMBUS read (%02x/%02x) error\n"

	.comm	_EIO,4,2                        ; @EIO
	.comm	_TWSIC1_RVALID,4,2              ; @TWSIC1_RVALID
l_.str.1:                               ; @.str.1
	.asciz	"SMBUS read (%02x/%02x) timed out\n"

	.no_dead_strip	_cafe_smbus_read_data
.subsections_via_symbols
