	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function saa7146_i2c_transfer
_saa7146_i2c_transfer:                  ## @saa7146_i2c_transfer
	.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
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	movl	%edx, %r12d
	movq	%rsi, %r13
	movq	%rdi, %r15
	movq	24(%rdi), %r14
	leaq	8(%rdi), %rbx
	movq	%rbx, %rdi
	callq	_mutex_lock_interruptible
	testq	%rax, %rax
	je	LBB0_1
## %bb.32:
	movq	_ERESTARTSYS@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
	jmp	LBB0_31
LBB0_1:
	movq	%r13, -80(%rbp)                 ## 8-byte Spill
	movq	%r14, -64(%rbp)                 ## 8-byte Spill
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	testl	%r12d, %r12d
	jle	LBB0_4
## %bb.2:
	movl	%r12d, %r13d
	negl	%r13d
	movl	$1, %ebx
	leaq	L_.str(%rip), %r14
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	movl	%ebx, %esi
	movl	%r12d, %edx
	xorl	%eax, %eax
	callq	_DEB_I2C
	leal	(%rbx,%r13), %eax
	incl	%eax
	movl	%ebx, %ecx
	incl	%ecx
	movl	%ecx, %ebx
	cmpl	$1, %eax
	jne	LBB0_3
LBB0_4:
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	movl	%r12d, %esi
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdx
	callq	_saa7146_i2c_msg_prepare
	testl	%eax, %eax
	js	LBB0_5
## %bb.7:
	cmpl	$3, %eax
	ja	LBB0_10
## %bb.8:
	movq	_SAA7146_I2C_SHORT_DELAY@GOTPCREL(%rip), %rdx
	movq	16(%r15), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, (%rdx)
	je	LBB0_9
LBB0_10:
	movl	$1, -48(%rbp)                   ## 4-byte Folded Spill
LBB0_11:
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	movl	%eax, -68(%rbp)                 ## 4-byte Spill
	movl	%eax, %eax
	movq	%rax, -88(%rbp)                 ## 8-byte Spill
LBB0_12:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_17 Depth 2
	movq	%r15, %rdi
	callq	_saa7146_i2c_reset
	movl	%eax, %r13d
	testl	%eax, %eax
	js	LBB0_15
## %bb.13:                              ##   in Loop: Header=BB0_12 Depth=1
	movl	%ebx, -44(%rbp)                 ## 4-byte Spill
	movq	-88(%rbp), %rbx                 ## 8-byte Reload
	cmpl	$0, -68(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_14
	.p2align	4, 0x90
LBB0_17:                                ##   Parent Loop BB0_12 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	%r15, %rdi
	movq	%r14, %rsi
	movl	-48(%rbp), %edx                 ## 4-byte Reload
	callq	_saa7146_i2c_writeout
	movq	%rax, %r13
	testl	%r13d, %r13d
	jne	LBB0_18
## %bb.16:                              ##   in Loop: Header=BB0_17 Depth=2
	addq	$4, %r14
	decq	%rbx
	jne	LBB0_17
	jmp	LBB0_24
	.p2align	4, 0x90
LBB0_14:                                ##   in Loop: Header=BB0_12 Depth=1
	testl	%r13d, %r13d
	jne	LBB0_21
	jmp	LBB0_24
LBB0_18:                                ##   in Loop: Header=BB0_12 Depth=1
	movq	_EREMOTEIO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%r13d, %eax
	jne	LBB0_20
## %bb.19:                              ##   in Loop: Header=BB0_12 Depth=1
	movq	16(%r15), %rax
	movl	(%rax), %eax
	movq	_SAA7146_USE_I2C_IRQ@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	jne	LBB0_27
LBB0_20:                                ##   in Loop: Header=BB0_12 Depth=1
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	_DEB_I2C
LBB0_21:                                ##   in Loop: Header=BB0_12 Depth=1
	movl	$10, %edi
	callq	_msleep
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	subl	$1, %ebx
	setb	%al
	cmpl	%r12d, %r13d
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	je	LBB0_23
## %bb.22:                              ##   in Loop: Header=BB0_12 Depth=1
	testb	%al, %al
	je	LBB0_12
LBB0_23:
	cmpl	%r12d, %r13d
	jne	LBB0_27
LBB0_24:
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	movl	%r12d, %esi
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	callq	_saa7146_i2c_msg_cleanup
	testq	%rax, %rax
	je	LBB0_26
## %bb.25:
	leaq	L_.str.3(%rip), %rdi
	xorl	%r13d, %r13d
	xorl	%eax, %eax
	callq	_DEB_I2C
	movq	_EIO@GOTPCREL(%rip), %rax
	subl	(%rax), %r13d
	jmp	LBB0_27
LBB0_5:
	movq	_EIO@GOTPCREL(%rip), %rax
	movl	$0, -48(%rbp)                   ## 4-byte Folded Spill
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
	jmp	LBB0_27
LBB0_26:
	leaq	L_.str.4(%rip), %rdi
	movl	%r12d, %esi
	xorl	%eax, %eax
	callq	_DEB_I2C
	movl	%r12d, %r13d
	jmp	LBB0_27
LBB0_9:
	movl	$0, -48(%rbp)                   ## 4-byte Folded Spill
	jmp	LBB0_11
LBB0_15:
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_DEB_I2C
LBB0_27:
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	cmpq	$0, (%r15)
	jne	LBB0_30
## %bb.28:
	movl	$0, -72(%rbp)
	movq	%r15, %rdi
	callq	_saa7146_i2c_reset
	leaq	-72(%rbp), %rsi
	movq	%r15, %rdi
	movl	-48(%rbp), %edx                 ## 4-byte Reload
	callq	_saa7146_i2c_writeout
	testq	%rax, %rax
	je	LBB0_30
## %bb.29:
	leaq	L_.str.5(%rip), %rdi
	callq	_pr_info
LBB0_30:
	movq	%rbx, %rdi
	callq	_mutex_unlock
LBB0_31:
	movl	%r13d, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ERESTARTSYS,4,2                ## @ERESTARTSYS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"msg:%d/%d\n"

	.comm	_EIO,4,2                        ## @EIO
	.comm	_SAA7146_I2C_SHORT_DELAY,4,2    ## @SAA7146_I2C_SHORT_DELAY
L_.str.1:                               ## @.str.1
	.asciz	"could not reset i2c-device\n"

	.comm	_EREMOTEIO,4,2                  ## @EREMOTEIO
	.comm	_SAA7146_USE_I2C_IRQ,4,2        ## @SAA7146_USE_I2C_IRQ
L_.str.2:                               ## @.str.2
	.asciz	"error while sending message(s). starting again\n"

L_.str.3:                               ## @.str.3
	.asciz	"could not cleanup i2c-message\n"

L_.str.4:                               ## @.str.4
	.asciz	"transmission successful. (msg:%d)\n"

L_.str.5:                               ## @.str.5
	.asciz	"revision 0 error. this should never happen\n"

	.no_dead_strip	_saa7146_i2c_transfer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function saa7146_i2c_transfer
_saa7146_i2c_transfer:                  ; @saa7146_i2c_transfer
	.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	x27, x3
	mov	x21, x2
	mov	x25, x1
	mov	x20, x0
	ldr	x23, [x0, #24]
	add	x19, x0, #8
	mov	x0, x19
	bl	_mutex_lock_interruptible
	cbz	x0, LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _ERESTARTSYS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ERESTARTSYS@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w25, w8
	b	LBB0_30
LBB0_2:
	cmp	w21, #1
	b.lt	LBB0_5
; %bb.3:
	mov	w24, #0
Lloh3:
	adrp	x22, l_.str@PAGE
Lloh4:
	add	x22, x22, l_.str@PAGEOFF
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	add	w24, w24, #1
	stp	x24, x21, [sp]
	mov	x0, x22
	bl	_DEB_I2C
	cmp	w21, w24
	b.ne	LBB0_4
LBB0_5:
	mov	x0, x25
	mov	x1, x21
	mov	x2, x23
	bl	_saa7146_i2c_msg_prepare
	tbnz	w0, #31, LBB0_23
; %bb.6:
	mov	x26, x0
	cmp	w0, #3
	str	x25, [sp, #24]                  ; 8-byte Folded Spill
	b.hi	LBB0_8
; %bb.7:
Lloh5:
	adrp	x8, _SAA7146_I2C_SHORT_DELAY@GOTPAGE
Lloh6:
	ldr	x8, [x8, _SAA7146_I2C_SHORT_DELAY@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	ldr	x9, [x20, #16]
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_31
LBB0_8:
	mov	w22, #1
LBB0_9:
	mov	w8, w26
	str	x8, [sp, #32]                   ; 8-byte Folded Spill
LBB0_10:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_12 Depth 2
	mov	x28, x27
	mov	x0, x20
	bl	_saa7146_i2c_reset
	mov	x25, x0
	tbnz	w0, #31, LBB0_32
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	ldr	x24, [sp, #32]                  ; 8-byte Folded Reload
	mov	x27, x23
	cbz	w26, LBB0_14
LBB0_12:                                ;   Parent Loop BB0_10 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	mov	x0, x20
	mov	x1, x27
	mov	x2, x22
	bl	_saa7146_i2c_writeout
	mov	x25, x0
	cbnz	w25, LBB0_15
; %bb.13:                               ;   in Loop: Header=BB0_12 Depth=2
	add	x27, x27, #4
	subs	x24, x24, #1
	b.ne	LBB0_12
	b	LBB0_21
LBB0_14:                                ;   in Loop: Header=BB0_10 Depth=1
	cbnz	w25, LBB0_18
	b	LBB0_21
LBB0_15:                                ;   in Loop: Header=BB0_10 Depth=1
Lloh8:
	adrp	x8, _EREMOTEIO@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EREMOTEIO@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	cmn	w8, w25
	b.ne	LBB0_17
; %bb.16:                               ;   in Loop: Header=BB0_10 Depth=1
Lloh11:
	adrp	x8, _SAA7146_USE_I2C_IRQ@GOTPAGE
Lloh12:
	ldr	x8, [x8, _SAA7146_USE_I2C_IRQ@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	ldr	x9, [x20, #16]
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_26
LBB0_17:                                ;   in Loop: Header=BB0_10 Depth=1
Lloh14:
	adrp	x0, l_.str.2@PAGE
Lloh15:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_DEB_I2C
LBB0_18:                                ;   in Loop: Header=BB0_10 Depth=1
	mov	w0, #10
	bl	_msleep
	cmp	w25, w21
	b.eq	LBB0_20
; %bb.19:                               ;   in Loop: Header=BB0_10 Depth=1
	sub	w27, w28, #1
	cbnz	w28, LBB0_10
LBB0_20:
	cmp	w25, w21
	b.ne	LBB0_26
LBB0_21:
	ldr	x0, [sp, #24]                   ; 8-byte Folded Reload
	mov	x1, x21
	mov	x2, x23
	bl	_saa7146_i2c_msg_cleanup
	cbz	x0, LBB0_25
; %bb.22:
Lloh16:
	adrp	x0, l_.str.3@PAGE
Lloh17:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_DEB_I2C
	b	LBB0_24
LBB0_23:
	mov	w22, #0
LBB0_24:
Lloh18:
	adrp	x8, _EIO@GOTPAGE
Lloh19:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	neg	w25, w8
	ldr	x8, [x20]
	cbnz	x8, LBB0_29
	b	LBB0_27
LBB0_25:
	mov	x8, x21
	str	x8, [sp]
Lloh21:
	adrp	x0, l_.str.4@PAGE
Lloh22:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_DEB_I2C
	mov	x25, x21
LBB0_26:
	ldr	x8, [x20]
	cbnz	x8, LBB0_29
LBB0_27:
	str	wzr, [sp, #44]
	mov	x0, x20
	bl	_saa7146_i2c_reset
	add	x1, sp, #44
	mov	x0, x20
	mov	x2, x22
	bl	_saa7146_i2c_writeout
	cbz	x0, LBB0_29
; %bb.28:
Lloh23:
	adrp	x0, l_.str.5@PAGE
Lloh24:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_pr_info
LBB0_29:
	mov	x0, x19
	bl	_mutex_unlock
LBB0_30:
	mov	x0, x25
	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
LBB0_31:
	mov	w22, #0
	b	LBB0_9
LBB0_32:
Lloh25:
	adrp	x0, l_.str.1@PAGE
Lloh26:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DEB_I2C
	ldr	x8, [x20]
	cbnz	x8, LBB0_29
	b	LBB0_27
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpAdd	Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_ERESTARTSYS,4,2                ; @ERESTARTSYS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"msg:%d/%d\n"

	.comm	_EIO,4,2                        ; @EIO
	.comm	_SAA7146_I2C_SHORT_DELAY,4,2    ; @SAA7146_I2C_SHORT_DELAY
l_.str.1:                               ; @.str.1
	.asciz	"could not reset i2c-device\n"

	.comm	_EREMOTEIO,4,2                  ; @EREMOTEIO
	.comm	_SAA7146_USE_I2C_IRQ,4,2        ; @SAA7146_USE_I2C_IRQ
l_.str.2:                               ; @.str.2
	.asciz	"error while sending message(s). starting again\n"

l_.str.3:                               ; @.str.3
	.asciz	"could not cleanup i2c-message\n"

l_.str.4:                               ; @.str.4
	.asciz	"transmission successful. (msg:%d)\n"

l_.str.5:                               ; @.str.5
	.asciz	"revision 0 error. this should never happen\n"

	.no_dead_strip	_saa7146_i2c_transfer
.subsections_via_symbols
