	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sh_mobile_ceu_add_device
_sh_mobile_ceu_add_device:              ## @sh_mobile_ceu_add_device
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movl	4(%rdi), %edi
	callq	_to_soc_camera_host
	movq	8(%rax), %rbx
	cmpq	$0, (%rbx)
	je	LBB0_2
## %bb.1:
	movq	_EBUSY@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_6
LBB0_2:
	movq	%rax, %r15
	movl	(%r14), %edx
	movl	4(%r14), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_info
	movl	(%r15), %edi
	callq	_pm_runtime_get_sync
	movq	_CAPSR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	$65536, %edx                    ## imm = 0x10000
	callq	_ceu_write
	movq	_CSTSR@GOTPCREL(%rip), %r15
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r15), %esi
	movq	%rbx, %rdi
	callq	_ceu_read
	testb	$1, %al
	je	LBB0_5
## %bb.3:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	$1, %edi
	callq	_msleep
	jmp	LBB0_4
LBB0_5:
	movq	%r14, (%rbx)
	xorl	%eax, %eax
LBB0_6:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EBUSY,4,2                      ## @EBUSY
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"SuperH Mobile CEU driver attached to camera %d\n"

	.comm	_CAPSR,4,2                      ## @CAPSR
	.comm	_CSTSR,4,2                      ## @CSTSR
	.no_dead_strip	_sh_mobile_ceu_add_device
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sh_mobile_ceu_add_device
_sh_mobile_ceu_add_device:              ; @sh_mobile_ceu_add_device
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x0
	ldr	w0, [x0, #4]
	bl	_to_soc_camera_host
	ldr	x20, [x0, #8]
	ldr	x8, [x20]
	cbz	x8, LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _EBUSY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_6
LBB0_2:
	mov	x21, x0
	ldp	w2, w0, [x19]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_info
	ldr	w0, [x21]
	bl	_pm_runtime_get_sync
Lloh5:
	adrp	x8, _CAPSR@GOTPAGE
Lloh6:
	ldr	x8, [x8, _CAPSR@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	x0, x20
	mov	w2, #65536
	bl	_ceu_write
Lloh8:
	adrp	x21, _CSTSR@GOTPAGE
Lloh9:
	ldr	x21, [x21, _CSTSR@GOTPAGEOFF]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x21]
	mov	x0, x20
	bl	_ceu_read
	tbz	w0, #0, LBB0_5
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	w0, #1
	bl	_msleep
	b	LBB0_3
LBB0_5:
	mov	w0, #0
	str	x19, [x20]
LBB0_6:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_EBUSY,4,2                      ; @EBUSY
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"SuperH Mobile CEU driver attached to camera %d\n"

	.comm	_CAPSR,4,2                      ; @CAPSR
	.comm	_CSTSR,4,2                      ; @CSTSR
	.no_dead_strip	_sh_mobile_ceu_add_device
.subsections_via_symbols
