	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_solo_tw28_init                 ## -- Begin function solo_tw28_init
	.p2align	4, 0x90
_solo_tw28_init:                        ## @solo_tw28_init
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movl	$0, (%rdi)
	movl	4(%rdi), %eax
	xorl	%ecx, %ecx
	cmpl	$4, %eax
	jl	LBB0_11
## %bb.1:
	xorl	%ebx, %ebx
	movq	_SOLO_I2C_TW@GOTPCREL(%rip), %r12
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	$1, %eax
	movl	%ebx, %ecx
	shll	%cl, %eax
	orl	%eax, 12(%r14)
LBB0_8:                                 ##   in Loop: Header=BB0_2 Depth=1
	incl	(%r14)
LBB0_9:                                 ##   in Loop: Header=BB0_2 Depth=1
	incl	%ebx
	movl	4(%r14), %eax
	leal	3(%rax), %ecx
	testl	%eax, %eax
	cmovnsl	%eax, %ecx
	sarl	$2, %ecx
	cmpl	%ecx, %ebx
	jge	LBB0_10
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r12), %r15d
	movl	%ebx, %edi
	callq	_TW_CHIP_OFFSET_ADDR
	movq	%r14, %rdi
	movl	%r15d, %esi
	movl	%eax, %edx
	movl	$255, %ecx
	callq	_solo_i2c_readbyte
                                        ## kill: def $eax killed $eax def $rax
	sarl	$3, %eax
	leal	-12(%rax), %ecx
	cmpl	$2, %ecx
	jb	LBB0_5
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	cmpl	$24, %eax
	jne	LBB0_6
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	$1, %eax
	movl	%ebx, %ecx
	shll	%cl, %eax
	orl	%eax, 8(%r14)
	jmp	LBB0_8
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	(%r12), %r15d
	movl	%ebx, %edi
	callq	_TW_CHIP_OFFSET_ADDR
	movq	%r14, %rdi
	movl	%r15d, %esi
	movl	%eax, %edx
	movl	$89, %ecx
	callq	_solo_i2c_readbyte
	andl	$-8, %eax
	cmpl	$32, %eax
	jne	LBB0_9
## %bb.7:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	$1, %eax
	movl	%ebx, %ecx
	shll	%cl, %eax
	orl	%eax, 16(%r14)
	jmp	LBB0_8
LBB0_10:
	movl	(%r14), %ecx
LBB0_11:
	sarl	$2, %eax
	cmpl	%eax, %ecx
	jne	LBB0_12
## %bb.13:
	movq	%r14, %rdi
	callq	_saa712x_setup
	cmpl	$0, (%r14)
	jle	LBB0_21
## %bb.14:
	xorl	%ebx, %ebx
	jmp	LBB0_15
	.p2align	4, 0x90
LBB0_16:                                ##   in Loop: Header=BB0_15 Depth=1
	movl	%ebx, %edi
	callq	_TW_CHIP_OFFSET_ADDR
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_tw2865_setup
LBB0_20:                                ##   in Loop: Header=BB0_15 Depth=1
	incl	%ebx
	cmpl	(%r14), %ebx
	jge	LBB0_21
LBB0_15:                                ## =>This Inner Loop Header: Depth=1
	movl	8(%r14), %eax
	movl	$1, %r15d
	movl	%ebx, %ecx
	shll	%cl, %r15d
	btl	%ebx, %eax
	jb	LBB0_16
## %bb.17:                              ##   in Loop: Header=BB0_15 Depth=1
	andl	12(%r14), %r15d
	movl	%ebx, %edi
	callq	_TW_CHIP_OFFSET_ADDR
	movq	%r14, %rdi
	movl	%eax, %esi
	testl	%r15d, %r15d
	je	LBB0_19
## %bb.18:                              ##   in Loop: Header=BB0_15 Depth=1
	callq	_tw2864_setup
	jmp	LBB0_20
LBB0_19:                                ##   in Loop: Header=BB0_15 Depth=1
	callq	_tw2815_setup
	jmp	LBB0_20
LBB0_12:
	movq	24(%r14), %rdi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_22
LBB0_21:
	xorl	%eax, %eax
LBB0_22:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SOLO_I2C_TW,4,2                ## @SOLO_I2C_TW
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Could not initialize any techwell chips\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_solo_tw28_init                 ; -- Begin function solo_tw28_init
	.p2align	2
_solo_tw28_init:                        ; @solo_tw28_init
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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, x0
	str	wzr, [x0]
	ldr	w8, [x0, #4]
	cmp	w8, #4
	b.lt	LBB0_10
; %bb.1:
	mov	w20, #0
Lloh0:
	adrp	x22, _SOLO_I2C_TW@GOTPAGE
Lloh1:
	ldr	x22, [x22, _SOLO_I2C_TW@GOTPAGEOFF]
	mov	w23, #1
	b	LBB0_5
LBB0_2:                                 ;   in Loop: Header=BB0_5 Depth=1
	lsl	w8, w23, w20
	ldr	w9, [x19, #12]
	orr	w8, w9, w8
	str	w8, [x19, #12]
LBB0_3:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldr	w8, [x19]
	add	w8, w8, #1
	str	w8, [x19]
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	w20, w20, #1
	ldr	w8, [x19, #4]
	add	w9, w8, #3
	cmp	w8, #0
	csel	w9, w9, w8, lt
	cmp	w20, w9, asr #2
	b.ge	LBB0_12
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w21, [x22]
	mov	x0, x20
	bl	_TW_CHIP_OFFSET_ADDR
	mov	x2, x0
	mov	x0, x19
	mov	x1, x21
	mov	w3, #255
	bl	_solo_i2c_readbyte
	asr	w8, w0, #3
	sub	w9, w8, #12
	cmp	w9, #2
	b.lo	LBB0_2
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	cmp	w8, #24
	b.ne	LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	lsl	w8, w23, w20
	ldr	w9, [x19, #8]
	orr	w8, w9, w8
	str	w8, [x19, #8]
	b	LBB0_3
LBB0_8:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldr	w21, [x22]
	mov	x0, x20
	bl	_TW_CHIP_OFFSET_ADDR
	mov	x2, x0
	mov	x0, x19
	mov	x1, x21
	mov	w3, #89
	bl	_solo_i2c_readbyte
	and	w8, w0, #0xfffffff8
	cmp	w8, #32
	b.ne	LBB0_4
; %bb.9:                                ;   in Loop: Header=BB0_5 Depth=1
	lsl	w8, w23, w20
	ldr	w9, [x19, #16]
	orr	w8, w9, w8
	str	w8, [x19, #16]
	b	LBB0_3
LBB0_10:
	mov	w9, #0
	cmp	w9, w8, asr #2
	b.eq	LBB0_13
LBB0_11:
	ldr	x0, [x19, #24]
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
Lloh4:
	adrp	x8, _EINVAL@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_22
LBB0_12:
	ldr	w9, [x19]
	cmp	w9, w8, asr #2
	b.ne	LBB0_11
LBB0_13:
	mov	x0, x19
	bl	_saa712x_setup
	ldr	w8, [x19]
	cmp	w8, #1
	b.lt	LBB0_21
; %bb.14:
	mov	w20, #0
	mov	w21, #1
	b	LBB0_17
LBB0_15:                                ;   in Loop: Header=BB0_17 Depth=1
	mov	x0, x20
	bl	_TW_CHIP_OFFSET_ADDR
	mov	x1, x0
	mov	x0, x19
	bl	_tw2865_setup
LBB0_16:                                ;   in Loop: Header=BB0_17 Depth=1
	add	w20, w20, #1
	ldr	w8, [x19]
	cmp	w20, w8
	b.ge	LBB0_21
LBB0_17:                                ; =>This Inner Loop Header: Depth=1
	ldr	w9, [x19, #8]
	lsl	w8, w21, w20
	tst	w9, w8
	b.ne	LBB0_15
; %bb.18:                               ;   in Loop: Header=BB0_17 Depth=1
	ldr	w9, [x19, #12]
	and	w22, w9, w8
	mov	x0, x20
	bl	_TW_CHIP_OFFSET_ADDR
	mov	x1, x0
	mov	x0, x19
	cbz	w22, LBB0_20
; %bb.19:                               ;   in Loop: Header=BB0_17 Depth=1
	bl	_tw2864_setup
	b	LBB0_16
LBB0_20:                                ;   in Loop: Header=BB0_17 Depth=1
	bl	_tw2815_setup
	b	LBB0_16
LBB0_21:
	mov	w0, #0
LBB0_22:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.comm	_SOLO_I2C_TW,4,2                ; @SOLO_I2C_TW
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Could not initialize any techwell chips\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
.subsections_via_symbols
