	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function synquacer_i2c_master_start
_synquacer_i2c_master_start:            ## @synquacer_i2c_master_start
	.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, %r14
	movq	%rsi, %rdi
	callq	_i2c_8bit_addr_from_msg
	movq	_SYNQUACER_I2C_REG_DAR@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rsi
	addq	8(%r14), %rsi
	movzbl	%al, %edi
	callq	_writeb
	movl	(%r14), %edi
	movl	(%rbx), %edx
	leaq	L_.str(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_dbg
	movq	_SYNQUACER_I2C_REG_BSR@GOTPCREL(%rip), %r12
	movq	(%r12), %rdi
	addq	8(%r14), %rdi
	callq	_readb
	movl	%eax, %ebx
	movq	_SYNQUACER_I2C_REG_BCR@GOTPCREL(%rip), %r13
	movq	(%r13), %rdi
	addq	8(%r14), %rdi
	callq	_readb
	movl	%eax, %r15d
	movl	(%r14), %edi
	movzbl	%bl, %ebx
	movzbl	%al, %ecx
	leaq	L_.str.1(%rip), %rsi
	movl	%ebx, %edx
	xorl	%eax, %eax
	callq	_dev_dbg
	movq	_SYNQUACER_I2C_BSR_BB@GOTPCREL(%rip), %rcx
	movq	_SYNQUACER_I2C_BCR_MSS@GOTPCREL(%rip), %rdx
	movb	(%rdx), %al
	movl	(%r14), %edi
	testb	%bl, (%rcx)
	je	LBB0_4
## %bb.1:
	testb	%r15b, %al
	je	LBB0_2
## %bb.3:
	leaq	L_.str.3(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_dbg
	movq	_SYNQUACER_I2C_BCR_SCC@GOTPCREL(%rip), %rax
	movb	(%rax), %al
	jmp	LBB0_7
LBB0_4:
	testb	%r15b, %al
	je	LBB0_6
## %bb.5:
	leaq	L_.str.4(%rip), %rsi
	xorl	%ebx, %ebx
	jmp	LBB0_10
LBB0_2:
	leaq	L_.str.2(%rip), %rsi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_dev_dbg
	movq	_EBUSY@GOTPCREL(%rip), %rax
	jmp	LBB0_11
LBB0_6:
	leaq	L_.str.5(%rip), %rsi
	xorl	%eax, %eax
	movq	%rdx, %rbx
	callq	_dev_dbg
	movb	(%rbx), %al
	orb	%r15b, %al
	movq	_SYNQUACER_I2C_BCR_INTE@GOTPCREL(%rip), %rcx
	orb	(%rcx), %al
	movq	_SYNQUACER_I2C_BCR_BEIE@GOTPCREL(%rip), %rcx
	movb	(%rcx), %r15b
LBB0_7:
	orb	%al, %r15b
	movq	(%r13), %rsi
	addq	8(%r14), %rsi
	movzbl	%r15b, %edi
	callq	_writeb
	movl	16(%r14), %esi
	movl	$10, %edi
	callq	_WAIT_PCLK
	movq	(%r12), %rdi
	addq	8(%r14), %rdi
	callq	_readb
	movl	%eax, %ebx
	movq	(%r13), %rdi
	addq	8(%r14), %rdi
	callq	_readb
	movl	%eax, %r15d
	movl	(%r14), %edi
	movzbl	%bl, %r12d
	movzbl	%al, %ecx
	leaq	L_.str.1(%rip), %rsi
	xorl	%ebx, %ebx
	movl	%r12d, %edx
	xorl	%eax, %eax
	callq	_dev_dbg
	movq	_SYNQUACER_I2C_BSR_AL@GOTPCREL(%rip), %rax
	testb	%r12b, (%rax)
	jne	LBB0_9
## %bb.8:
	movq	_SYNQUACER_I2C_BCR_MSS@GOTPCREL(%rip), %rax
	testb	%r15b, (%rax)
	jne	LBB0_12
LBB0_9:
	movl	(%r14), %edi
	leaq	L_.str.6(%rip), %rsi
LBB0_10:
	xorl	%eax, %eax
	callq	_dev_dbg
	movq	_EAGAIN@GOTPCREL(%rip), %rax
LBB0_11:
	subl	(%rax), %ebx
LBB0_12:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SYNQUACER_I2C_REG_DAR,8,3      ## @SYNQUACER_I2C_REG_DAR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"slave:0x%02x\n"

	.comm	_SYNQUACER_I2C_REG_BSR,8,3      ## @SYNQUACER_I2C_REG_BSR
	.comm	_SYNQUACER_I2C_REG_BCR,8,3      ## @SYNQUACER_I2C_REG_BCR
L_.str.1:                               ## @.str.1
	.asciz	"bsr:0x%02x, bcr:0x%02x\n"

	.comm	_SYNQUACER_I2C_BSR_BB,1,0       ## @SYNQUACER_I2C_BSR_BB
	.comm	_SYNQUACER_I2C_BCR_MSS,1,0      ## @SYNQUACER_I2C_BCR_MSS
L_.str.2:                               ## @.str.2
	.asciz	"bus is busy"

	.comm	_EBUSY,4,2                      ## @EBUSY
L_.str.3:                               ## @.str.3
	.asciz	"Continuous Start"

	.comm	_SYNQUACER_I2C_BCR_SCC,1,0      ## @SYNQUACER_I2C_BCR_SCC
L_.str.4:                               ## @.str.4
	.asciz	"not in master mode"

	.comm	_EAGAIN,4,2                     ## @EAGAIN
L_.str.5:                               ## @.str.5
	.asciz	"Start Condition"

	.comm	_SYNQUACER_I2C_BCR_INTE,1,0     ## @SYNQUACER_I2C_BCR_INTE
	.comm	_SYNQUACER_I2C_BCR_BEIE,1,0     ## @SYNQUACER_I2C_BCR_BEIE
	.comm	_SYNQUACER_I2C_BSR_AL,1,0       ## @SYNQUACER_I2C_BSR_AL
L_.str.6:                               ## @.str.6
	.asciz	"arbitration lost\n"

	.no_dead_strip	_synquacer_i2c_master_start
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function synquacer_i2c_master_start
_synquacer_i2c_master_start:            ; @synquacer_i2c_master_start
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x20, x1
	mov	x19, x0
	mov	x0, x1
	bl	_i2c_8bit_addr_from_msg
	ldr	x8, [x19, #8]
Lloh0:
	adrp	x9, _SYNQUACER_I2C_REG_DAR@GOTPAGE
Lloh1:
	ldr	x9, [x9, _SYNQUACER_I2C_REG_DAR@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writeb
	ldr	w0, [x19]
	ldr	w8, [x20]
	str	x8, [sp]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_dbg
	ldr	x8, [x19, #8]
Lloh5:
	adrp	x23, _SYNQUACER_I2C_REG_BSR@GOTPAGE
Lloh6:
	ldr	x23, [x23, _SYNQUACER_I2C_REG_BSR@GOTPAGEOFF]
	ldr	x9, [x23]
	add	x0, x9, x8
	bl	_readb
	mov	x21, x0
	ldr	x8, [x19, #8]
Lloh7:
	adrp	x24, _SYNQUACER_I2C_REG_BCR@GOTPAGE
Lloh8:
	ldr	x24, [x24, _SYNQUACER_I2C_REG_BCR@GOTPAGEOFF]
	ldr	x9, [x24]
	add	x0, x9, x8
	bl	_readb
	mov	x20, x0
	ldr	w0, [x19]
	mov	w8, w20
	mov	w9, w21
	stp	x9, x8, [sp]
Lloh9:
	adrp	x1, l_.str.1@PAGE
Lloh10:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_dbg
Lloh11:
	adrp	x8, _SYNQUACER_I2C_BSR_BB@GOTPAGE
Lloh12:
	ldr	x8, [x8, _SYNQUACER_I2C_BSR_BB@GOTPAGEOFF]
	ldrb	w9, [x8]
Lloh13:
	adrp	x22, _SYNQUACER_I2C_BCR_MSS@GOTPAGE
Lloh14:
	ldr	x22, [x22, _SYNQUACER_I2C_BCR_MSS@GOTPAGEOFF]
	ldrb	w8, [x22]
	and	w8, w8, w20
	ldr	w0, [x19]
	tst	w9, w21
	b.eq	LBB0_3
; %bb.1:
	cbz	w8, LBB0_5
; %bb.2:
Lloh15:
	adrp	x1, l_.str.3@PAGE
Lloh16:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_dev_dbg
Lloh17:
	adrp	x8, _SYNQUACER_I2C_BCR_SCC@GOTPAGE
Lloh18:
	ldr	x8, [x8, _SYNQUACER_I2C_BCR_SCC@GOTPAGEOFF]
	ldrb	w8, [x8]
	b	LBB0_7
LBB0_3:
	cbz	w8, LBB0_6
; %bb.4:
Lloh19:
	adrp	x1, l_.str.4@PAGE
Lloh20:
	add	x1, x1, l_.str.4@PAGEOFF
	b	LBB0_9
LBB0_5:
Lloh21:
	adrp	x1, l_.str.2@PAGE
Lloh22:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dev_dbg
Lloh23:
	adrp	x8, _EBUSY@GOTPAGE
Lloh24:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
	b	LBB0_10
LBB0_6:
Lloh25:
	adrp	x1, l_.str.5@PAGE
Lloh26:
	add	x1, x1, l_.str.5@PAGEOFF
	bl	_dev_dbg
	ldrb	w8, [x22]
Lloh27:
	adrp	x9, _SYNQUACER_I2C_BCR_INTE@GOTPAGE
Lloh28:
	ldr	x9, [x9, _SYNQUACER_I2C_BCR_INTE@GOTPAGEOFF]
	orr	w8, w8, w20
	ldrb	w9, [x9]
	orr	w8, w8, w9
Lloh29:
	adrp	x9, _SYNQUACER_I2C_BCR_BEIE@GOTPAGE
Lloh30:
	ldr	x9, [x9, _SYNQUACER_I2C_BCR_BEIE@GOTPAGEOFF]
	ldrb	w20, [x9]
LBB0_7:
	orr	w8, w8, w20
	ldr	x9, [x19, #8]
	ldr	x10, [x24]
	add	x1, x10, x9
	and	w0, w8, #0xff
	bl	_writeb
	ldr	w1, [x19, #16]
	mov	w0, #10
	bl	_WAIT_PCLK
	ldr	x8, [x19, #8]
	ldr	x9, [x23]
	add	x0, x9, x8
	bl	_readb
	mov	x21, x0
	ldr	x8, [x19, #8]
	ldr	x9, [x24]
	add	x0, x9, x8
	bl	_readb
	mov	x20, x0
	ldr	w0, [x19]
	mov	w8, w20
	mov	w9, w21
	stp	x9, x8, [sp]
Lloh31:
	adrp	x1, l_.str.1@PAGE
Lloh32:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_dbg
Lloh33:
	adrp	x8, _SYNQUACER_I2C_BSR_AL@GOTPAGE
Lloh34:
	ldr	x8, [x8, _SYNQUACER_I2C_BSR_AL@GOTPAGEOFF]
	ldrb	w8, [x8]
	tst	w8, w21
	b.eq	LBB0_12
LBB0_8:
	ldr	w0, [x19]
Lloh35:
	adrp	x1, l_.str.6@PAGE
Lloh36:
	add	x1, x1, l_.str.6@PAGEOFF
LBB0_9:
	bl	_dev_dbg
Lloh37:
	adrp	x8, _EAGAIN@GOTPAGE
Lloh38:
	ldr	x8, [x8, _EAGAIN@GOTPAGEOFF]
LBB0_10:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_11:
	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
	add	sp, sp, #80
	ret
LBB0_12:
	ldrb	w8, [x22]
	tst	w8, w20
	b.eq	LBB0_8
; %bb.13:
	mov	w0, #0
	b	LBB0_11
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh33, Lloh34
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpAdd	Lloh35, Lloh36
	.loh AdrpLdrGot	Lloh37, Lloh38
	.cfi_endproc
                                        ; -- End function
	.comm	_SYNQUACER_I2C_REG_DAR,8,3      ; @SYNQUACER_I2C_REG_DAR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"slave:0x%02x\n"

	.comm	_SYNQUACER_I2C_REG_BSR,8,3      ; @SYNQUACER_I2C_REG_BSR
	.comm	_SYNQUACER_I2C_REG_BCR,8,3      ; @SYNQUACER_I2C_REG_BCR
l_.str.1:                               ; @.str.1
	.asciz	"bsr:0x%02x, bcr:0x%02x\n"

	.comm	_SYNQUACER_I2C_BSR_BB,1,0       ; @SYNQUACER_I2C_BSR_BB
	.comm	_SYNQUACER_I2C_BCR_MSS,1,0      ; @SYNQUACER_I2C_BCR_MSS
l_.str.2:                               ; @.str.2
	.asciz	"bus is busy"

	.comm	_EBUSY,4,2                      ; @EBUSY
l_.str.3:                               ; @.str.3
	.asciz	"Continuous Start"

	.comm	_SYNQUACER_I2C_BCR_SCC,1,0      ; @SYNQUACER_I2C_BCR_SCC
l_.str.4:                               ; @.str.4
	.asciz	"not in master mode"

	.comm	_EAGAIN,4,2                     ; @EAGAIN
l_.str.5:                               ; @.str.5
	.asciz	"Start Condition"

	.comm	_SYNQUACER_I2C_BCR_INTE,1,0     ; @SYNQUACER_I2C_BCR_INTE
	.comm	_SYNQUACER_I2C_BCR_BEIE,1,0     ; @SYNQUACER_I2C_BCR_BEIE
	.comm	_SYNQUACER_I2C_BSR_AL,1,0       ; @SYNQUACER_I2C_BSR_AL
l_.str.6:                               ; @.str.6
	.asciz	"arbitration lost\n"

	.no_dead_strip	_synquacer_i2c_master_start
.subsections_via_symbols
