	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function s3c24xx_i2c_wait_idle
_s3c24xx_i2c_wait_idle:                 ## @s3c24xx_i2c_wait_idle
	.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	%rdi, %rbx
	movl	(%rdi), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_dbg
	xorl	%eax, %eax
	callq	_ktime_get
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	_S3C2410_IICSTAT@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	addq	8(%rbx), %rdi
	callq	_readl
	movq	_S3C2410_IICSTAT_START@GOTPCREL(%rip), %rcx
	testq	%rax, (%rcx)
	je	LBB0_9
## %bb.1:
	xorl	%eax, %eax
	callq	_cpu_relax
	movq	_S3C2410_IICSTAT@GOTPCREL(%rip), %r15
	movq	(%r15), %rdi
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	addq	8(%rbx), %rdi
	callq	_readl
	movq	%rax, %r12
	movq	_S3C2410_IICSTAT_START@GOTPCREL(%rip), %r14
	movq	(%r14), %rax
	testq	%r12, %rax
	je	LBB0_3
## %bb.2:
	xorl	%eax, %eax
	callq	_cpu_relax
	movq	(%r15), %rdi
	addq	8(%rbx), %rdi
	callq	_readl
	movq	%rax, %r12
	movq	(%r14), %rax
LBB0_3:
	testq	%r12, %rax
	je	LBB0_9
## %bb.4:
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	movl	%edi, %esi
	callq	_ktime_us_delta
	movq	_S3C2410_IDLE_TIMEOUT@GOTPCREL(%rip), %r15
	cmpl	(%r15), %eax
	jge	LBB0_8
## %bb.5:
	movl	$1, %ebx
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	leal	(%rbx,%rbx), %esi
	movq	%rbx, %rdi
	callq	_usleep_range
	movl	(%r15), %r14d
	xorl	%eax, %eax
	callq	_ktime_get
	movl	%eax, %r13d
	movq	_S3C2410_IICSTAT@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	addq	8(%rax), %rdi
	callq	_readl
	movq	%rax, %r12
	movq	_S3C2410_IICSTAT_START@GOTPCREL(%rip), %rax
	testq	%r12, (%rax)
	je	LBB0_9
## %bb.6:                               ##   in Loop: Header=BB0_7 Depth=1
	movslq	%r14d, %rax
	imulq	$1717986919, %rax, %rax         ## imm = 0x66666667
	movq	%rax, %rcx
	shrq	$63, %rcx
	sarq	$34, %rax
	addl	%ecx, %eax
	cltq
	cmpq	%rax, %rbx
	setb	%cl
	shlq	%cl, %rbx
	movl	%r13d, %edi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	callq	_ktime_us_delta
	cmpl	(%r15), %eax
	jl	LBB0_7
LBB0_8:
	movq	_S3C2410_IICSTAT_START@GOTPCREL(%rip), %rax
	testq	%r12, (%rax)
	je	LBB0_9
## %bb.10:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_dev_warn                       ## TAILCALL
LBB0_9:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"waiting for bus idle\n"

	.comm	_S3C2410_IICSTAT,8,3            ## @S3C2410_IICSTAT
	.comm	_S3C2410_IICSTAT_START,8,3      ## @S3C2410_IICSTAT_START
	.comm	_S3C2410_IDLE_TIMEOUT,4,2       ## @S3C2410_IDLE_TIMEOUT
L_.str.1:                               ## @.str.1
	.asciz	"timeout waiting for bus idle\n"

	.no_dead_strip	_s3c24xx_i2c_wait_idle
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function s3c24xx_i2c_wait_idle
_s3c24xx_i2c_wait_idle:                 ; @s3c24xx_i2c_wait_idle
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x0
	ldr	w0, [x0]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_dbg
	bl	_ktime_get
	mov	x20, x0
	ldr	x8, [x19, #8]
Lloh2:
	adrp	x24, _S3C2410_IICSTAT@GOTPAGE
Lloh3:
	ldr	x24, [x24, _S3C2410_IICSTAT@GOTPAGEOFF]
	ldr	x9, [x24]
	add	x0, x9, x8
	bl	_readl
Lloh4:
	adrp	x25, _S3C2410_IICSTAT_START@GOTPAGE
Lloh5:
	ldr	x25, [x25, _S3C2410_IICSTAT_START@GOTPAGEOFF]
	ldr	x8, [x25]
	tst	x8, x0
	b.eq	LBB0_10
; %bb.1:
	bl	_cpu_relax
	ldr	x8, [x19, #8]
	ldr	x9, [x24]
	add	x0, x9, x8
	bl	_readl
	ldr	x8, [x25]
	tst	x8, x0
	b.eq	LBB0_3
; %bb.2:
	bl	_cpu_relax
	ldr	x8, [x19, #8]
	ldr	x9, [x24]
	add	x0, x9, x8
	bl	_readl
	mov	x21, x0
	ldr	x8, [x25]
	tst	x8, x21
	b.ne	LBB0_4
	b	LBB0_10
LBB0_3:
	mov	x21, x0
	tst	x8, x21
	b.eq	LBB0_10
LBB0_4:
	mov	x0, x20
	mov	x1, x20
	bl	_ktime_us_delta
Lloh6:
	adrp	x26, _S3C2410_IDLE_TIMEOUT@GOTPAGE
Lloh7:
	ldr	x26, [x26, _S3C2410_IDLE_TIMEOUT@GOTPAGEOFF]
	ldr	w8, [x26]
	cmp	w0, w8
	b.ge	LBB0_8
; %bb.5:
	mov	w22, #1
	mov	w27, #26215
	movk	w27, #26214, lsl #16
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	lsl	w1, w22, #1
	mov	x0, x22
	bl	_usleep_range
	ldr	w28, [x26]
	bl	_ktime_get
	mov	x23, x0
	ldr	x8, [x19, #8]
	ldr	x9, [x24]
	add	x0, x9, x8
	bl	_readl
	ldr	x8, [x25]
	tst	x8, x0
	b.eq	LBB0_10
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	x21, x0
	smull	x8, w28, w27
	lsr	x9, x8, #63
	asr	x8, x8, #34
	add	w8, w8, w9
	cmp	x22, w8, sxtw
	cset	w8, lo
	lsl	x22, x22, x8
	mov	x0, x23
	mov	x1, x20
	bl	_ktime_us_delta
	ldr	w8, [x26]
	cmp	w0, w8
	b.lt	LBB0_6
LBB0_8:
	ldr	x8, [x25]
	tst	x8, x21
	b.eq	LBB0_10
; %bb.9:
	ldr	w0, [x19]
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
	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
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	b	_dev_warn
LBB0_10:
	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
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"waiting for bus idle\n"

	.comm	_S3C2410_IICSTAT,8,3            ; @S3C2410_IICSTAT
	.comm	_S3C2410_IICSTAT_START,8,3      ; @S3C2410_IICSTAT_START
	.comm	_S3C2410_IDLE_TIMEOUT,4,2       ; @S3C2410_IDLE_TIMEOUT
l_.str.1:                               ; @.str.1
	.asciz	"timeout waiting for bus idle\n"

	.no_dead_strip	_s3c24xx_i2c_wait_idle
.subsections_via_symbols
