	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ipu_add_client_devices
_ipu_add_client_devices:                ## @ipu_add_client_devices
	.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), %r15
	movq	_ipu_client_id_mutex@GOTPCREL(%rip), %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	movq	_ipu_client_id@GOTPCREL(%rip), %r12
	movl	(%r12), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	_client_reg@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rdi
	callq	_ARRAY_SIZE
	addl	%eax, (%r12)
	movq	%r14, %rdi
	callq	_mutex_unlock
	movq	(%rbx), %rdi
	callq	_ARRAY_SIZE
	testl	%eax, %eax
	je	LBB0_9
## %bb.1:
	xorl	%eax, %eax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	xorl	%r12d, %r12d
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_2:                                 ##   in Loop: Header=BB0_4 Depth=1
	movl	(%r15), %ecx
	cmpq	$2, %r12
	leaq	L_.str.1(%rip), %r8
	leaq	L_.str.2(%rip), %rax
	cmovbq	%rax, %r8
	movl	%r12d, %r9d
	andl	$1, %r9d
	movq	%r15, %rdi
	leaq	L_.str(%rip), %rsi
	movl	%r12d, %edx
	callq	_dev_info
LBB0_3:                                 ##   in Loop: Header=BB0_4 Depth=1
	incq	%r12
	movq	_client_reg@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rdi
	callq	_ARRAY_SIZE
	movl	%eax, %eax
	addq	$16, -64(%rbp)                  ## 8-byte Folded Spill
	cmpq	%rax, %r12
	jae	LBB0_9
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%rbx), %r13
	movl	(%r15), %edi
	movl	%r12d, %esi
	callq	_of_graph_get_port_by_id
	testq	%rax, %rax
	je	LBB0_2
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	%rax, %r14
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	movl	8(%r13,%rbx), %edi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	callq	_platform_device_alloc
	testq	%rax, %rax
	je	LBB0_12
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	%rax, %r15
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, (%r15)
	movq	%r14, (%r13,%rbx)
	addq	%rbx, %r13
	movq	%r15, %rdi
	movq	%r13, %rsi
	movl	$8, %edx
	callq	_platform_device_add_data
	testl	%eax, %eax
	jne	LBB0_10
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	%r15, %rdi
	callq	_platform_device_add
	testl	%eax, %eax
	jne	LBB0_10
## %bb.8:                               ##   in Loop: Header=BB0_4 Depth=1
	incl	-44(%rbp)                       ## 4-byte Folded Spill
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	jmp	LBB0_3
LBB0_9:
	xorl	%r13d, %r13d
	jmp	LBB0_14
LBB0_10:
	movl	%eax, %r13d
	movq	%r15, %rdi
	callq	_platform_device_put
	jmp	LBB0_13
LBB0_12:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
LBB0_13:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_to_platform_device
	movl	%eax, %edi
	callq	_platform_device_unregister_children
LBB0_14:
	movl	%r13d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ipu_client_id_mutex,4,2        ## @ipu_client_id_mutex
	.comm	_ipu_client_id,4,2              ## @ipu_client_id
	.comm	_client_reg,8,3                 ## @client_reg
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"no port@%d node in %pOF, not using %s%d\n"

L_.str.1:                               ## @.str.1
	.asciz	"DI"

L_.str.2:                               ## @.str.2
	.asciz	"CSI"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_ipu_add_client_devices
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ipu_add_client_devices
_ipu_add_client_devices:                ; @ipu_add_client_devices
	.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
	ldr	x19, [x0]
Lloh0:
	adrp	x21, _ipu_client_id_mutex@GOTPAGE
Lloh1:
	ldr	x21, [x21, _ipu_client_id_mutex@GOTPAGEOFF]
	mov	x0, x21
	bl	_mutex_lock
Lloh2:
	adrp	x22, _ipu_client_id@GOTPAGE
Lloh3:
	ldr	x22, [x22, _ipu_client_id@GOTPAGEOFF]
	ldr	w20, [x22]
Lloh4:
	adrp	x26, _client_reg@GOTPAGE
Lloh5:
	ldr	x26, [x26, _client_reg@GOTPAGEOFF]
	ldr	x0, [x26]
	bl	_ARRAY_SIZE
	ldr	w8, [x22]
	add	w8, w8, w0
	str	w8, [x22]
	mov	x0, x21
	bl	_mutex_unlock
	ldr	x0, [x26]
	bl	_ARRAY_SIZE
	cbz	w0, LBB0_9
; %bb.1:
	mov	x27, #0
	mov	x21, #0
Lloh6:
	adrp	x28, l_.str.2@PAGE
Lloh7:
	add	x28, x28, l_.str.2@PAGEOFF
Lloh8:
	adrp	x22, l_.str@PAGE
Lloh9:
	add	x22, x22, l_.str@PAGEOFF
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	w3, [x19]
	cmp	x21, #2
Lloh10:
	adrp	x8, l_.str.1@PAGE
Lloh11:
	add	x8, x8, l_.str.1@PAGEOFF
	csel	x4, x28, x8, lo
	and	w5, w21, #0x1
	mov	x0, x19
	mov	x1, x22
	mov	x2, x21
	bl	_dev_info
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x21, x21, #1
	ldr	x0, [x26]
	bl	_ARRAY_SIZE
	add	x27, x27, #16
	cmp	x21, w0, uxtw
	b.hs	LBB0_9
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x24, [x26]
	ldr	w0, [x19]
	mov	x1, x21
	bl	_of_graph_get_port_by_id
	cbz	x0, LBB0_2
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x23, x0
	add	x25, x24, x27
	ldr	w0, [x25, #8]
	mov	x1, x20
	bl	_platform_device_alloc
	cbz	x0, LBB0_11
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x24, x0
	str	x19, [x0]
	str	x23, [x25]
	mov	x1, x25
	mov	w2, #8
	bl	_platform_device_add_data
	cbnz	w0, LBB0_10
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x24
	bl	_platform_device_add
	cbnz	w0, LBB0_10
; %bb.8:                                ;   in Loop: Header=BB0_4 Depth=1
	add	w20, w20, #1
	b	LBB0_3
LBB0_9:
	mov	w23, #0
	b	LBB0_13
LBB0_10:
	mov	x23, x0
	mov	x0, x24
	bl	_platform_device_put
	b	LBB0_12
LBB0_11:
Lloh12:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w23, w8
LBB0_12:
	mov	x0, x19
	bl	_to_platform_device
	bl	_platform_device_unregister_children
LBB0_13:
	mov	x0, x23
	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 AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_ipu_client_id_mutex,4,2        ; @ipu_client_id_mutex
	.comm	_ipu_client_id,4,2              ; @ipu_client_id
	.comm	_client_reg,8,3                 ; @client_reg
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"no port@%d node in %pOF, not using %s%d\n"

l_.str.1:                               ; @.str.1
	.asciz	"DI"

l_.str.2:                               ; @.str.2
	.asciz	"CSI"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_ipu_add_client_devices
.subsections_via_symbols
