	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function get_ipu_resources
_get_ipu_resources:                     ## @get_ipu_resources
	.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	%rdi, %rbx
	movq	64(%rdi), %r14
	movq	56(%rdi), %r12
	movq	(%r12), %rdi
	movl	48(%rbx), %esi
	callq	_ipu_ic_get
	movq	%rax, 40(%rbx)
	movq	%rax, %rdi
	callq	_IS_ERR
	movq	(%r12), %rdi
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movl	(%rdi), %edi
	leaq	L_.str(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_err
	movq	40(%rbx), %rdi
	callq	_PTR_ERR
	movl	%eax, %r14d
	jmp	LBB0_14
LBB0_2:
	movl	12(%r14), %esi
	callq	_ipu_idmac_get
	movq	%rax, 32(%rbx)
	movq	(%r12), %rdi
	movl	8(%r14), %esi
	callq	_ipu_idmac_get
	movq	%rax, 16(%rbx)
	movq	32(%rbx), %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	jne	LBB0_4
## %bb.3:
	movq	16(%rbx), %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_6
LBB0_4:
	movq	(%r12), %rax
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
LBB0_5:
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_dev_err
	movq	_EBUSY@GOTPCREL(%rip), %rax
	subl	(%rax), %r14d
LBB0_14:
	movq	%rbx, %rdi
	callq	_release_ipu_resources
LBB0_15:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movq	(%r12), %rdi
	movl	4(%r14), %esi
	callq	_ipu_idmac_get
	movq	%rax, 24(%rbx)
	movq	(%r12), %rdi
	movl	(%r14), %esi
	callq	_ipu_idmac_get
	movq	%rax, 8(%rbx)
	movq	24(%rbx), %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	jne	LBB0_8
## %bb.7:
	movq	8(%rbx), %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_9
LBB0_8:
	movq	(%r12), %rax
	movl	(%rax), %edi
	leaq	L_.str.2(%rip), %rsi
	jmp	LBB0_5
LBB0_9:
	movq	(%r12), %rdi
	movq	16(%rbx), %rsi
	movq	_IPU_IRQ_EOF@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_ipu_idmac_channel_irq
	movl	%eax, (%rbx)
	movq	_norotate_irq@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	_do_bh@GOTPCREL(%rip), %r13
	movl	(%r13), %edx
	leaq	L_.str.3(%rip), %r8
	xorl	%r14d, %r14d
	movl	%eax, %edi
	xorl	%ecx, %ecx
	movq	%rbx, %r9
	callq	_request_threaded_irq
	movq	(%r12), %rdi
	testl	%eax, %eax
	js	LBB0_10
## %bb.11:
	movq	8(%rbx), %rsi
	movq	_IPU_IRQ_EOF@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_ipu_idmac_channel_irq
	movl	%eax, 4(%rbx)
	movq	_rotate_irq@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	(%r13), %edx
	leaq	L_.str.3(%rip), %r8
	movl	%eax, %edi
	xorl	%ecx, %ecx
	movq	%rbx, %r9
	callq	_request_threaded_irq
	testl	%eax, %eax
	jns	LBB0_15
## %bb.12:
	movl	%eax, %r15d
	movq	(%r12), %rax
	movl	(%rax), %edi
	movl	4(%rbx), %edx
	leaq	L_.str.4(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_err
	movl	$-1, 4(%rbx)
	jmp	LBB0_13
LBB0_10:
	movl	%eax, %r15d
	movl	(%rdi), %edi
	movl	(%rbx), %edx
	leaq	L_.str.4(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_err
	movl	$-1, (%rbx)
LBB0_13:
	movl	%r15d, %r14d
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"could not acquire IC\n"

L_.str.1:                               ## @.str.1
	.asciz	"could not acquire idmac channels\n"

	.comm	_EBUSY,4,2                      ## @EBUSY
L_.str.2:                               ## @.str.2
	.asciz	"could not acquire idmac rotation channels\n"

	.comm	_IPU_IRQ_EOF,4,2                ## @IPU_IRQ_EOF
	.comm	_norotate_irq,4,2               ## @norotate_irq
	.comm	_do_bh,4,2                      ## @do_bh
L_.str.3:                               ## @.str.3
	.asciz	"ipu-ic"

L_.str.4:                               ## @.str.4
	.asciz	"could not acquire irq %d\n"

	.comm	_rotate_irq,4,2                 ## @rotate_irq
	.no_dead_strip	_get_ipu_resources
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function get_ipu_resources
_get_ipu_resources:                     ; @get_ipu_resources
	.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	x19, x0
	ldp	x22, x20, [x0, #56]
	ldr	x0, [x22]
	ldr	w1, [x19, #48]
	bl	_ipu_ic_get
	str	x0, [x19, #40]
	bl	_IS_ERR
	mov	x8, x0
	ldr	x0, [x22]
	cbz	x8, LBB0_2
; %bb.1:
	ldr	w0, [x0]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	ldr	x0, [x19, #40]
	bl	_PTR_ERR
	mov	x20, x0
	b	LBB0_6
LBB0_2:
	ldr	w1, [x20, #12]
	bl	_ipu_idmac_get
	str	x0, [x19, #32]
	ldr	x0, [x22]
	ldr	w1, [x20, #8]
	bl	_ipu_idmac_get
	str	x0, [x19, #16]
	ldr	x0, [x19, #32]
	bl	_IS_ERR
	cbnz	x0, LBB0_4
; %bb.3:
	ldr	x0, [x19, #16]
	bl	_IS_ERR
	cbz	x0, LBB0_8
LBB0_4:
	ldr	x8, [x22]
	ldr	w0, [x8]
Lloh2:
	adrp	x1, l_.str.1@PAGE
Lloh3:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_5:
	bl	_dev_err
Lloh4:
	adrp	x8, _EBUSY@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_6:
	mov	x0, x19
	bl	_release_ipu_resources
LBB0_7:
	mov	x0, x20
	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_8:
	ldr	x0, [x22]
	ldr	w1, [x20, #4]
	bl	_ipu_idmac_get
	str	x0, [x19, #24]
	ldr	x0, [x22]
	ldr	w1, [x20]
	bl	_ipu_idmac_get
	str	x0, [x19, #8]
	ldr	x0, [x19, #24]
	bl	_IS_ERR
	cbnz	x0, LBB0_10
; %bb.9:
	ldr	x0, [x19, #8]
	bl	_IS_ERR
	cbz	x0, LBB0_11
LBB0_10:
	ldr	x8, [x22]
	ldr	w0, [x8]
Lloh7:
	adrp	x1, l_.str.2@PAGE
Lloh8:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_5
LBB0_11:
	ldr	x0, [x22]
	ldr	x1, [x19, #16]
Lloh9:
	adrp	x21, _IPU_IRQ_EOF@GOTPAGE
Lloh10:
	ldr	x21, [x21, _IPU_IRQ_EOF@GOTPAGEOFF]
	ldr	w2, [x21]
	bl	_ipu_idmac_channel_irq
	str	w0, [x19]
Lloh11:
	adrp	x8, _norotate_irq@GOTPAGE
Lloh12:
	ldr	x8, [x8, _norotate_irq@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
Lloh14:
	adrp	x23, _do_bh@GOTPAGE
Lloh15:
	ldr	x23, [x23, _do_bh@GOTPAGEOFF]
	ldr	w2, [x23]
Lloh16:
	adrp	x4, l_.str.3@PAGE
Lloh17:
	add	x4, x4, l_.str.3@PAGEOFF
                                        ; kill: def $w0 killed $w0 killed $x0
	mov	w3, #0
	mov	x5, x19
	bl	_request_threaded_irq
	mov	x20, x0
	ldr	x0, [x22]
	tbnz	w20, #31, LBB0_14
; %bb.12:
	ldr	x1, [x19, #8]
	ldr	w2, [x21]
	bl	_ipu_idmac_channel_irq
	str	w0, [x19, #4]
Lloh18:
	adrp	x8, _rotate_irq@GOTPAGE
Lloh19:
	ldr	x8, [x8, _rotate_irq@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
	ldr	w2, [x23]
Lloh21:
	adrp	x4, l_.str.3@PAGE
Lloh22:
	add	x4, x4, l_.str.3@PAGEOFF
                                        ; kill: def $w0 killed $w0 killed $x0
	mov	w3, #0
	mov	x5, x19
	bl	_request_threaded_irq
	mov	w20, #0
	tbz	w0, #31, LBB0_7
; %bb.13:
	mov	x21, x0
	ldr	x8, [x22]
	ldr	w0, [x8]
	ldr	w8, [x19, #4]
	str	x8, [sp]
Lloh23:
	adrp	x1, l_.str.4@PAGE
Lloh24:
	add	x1, x1, l_.str.4@PAGEOFF
	bl	_dev_err
	mov	w8, #-1
	str	w8, [x19, #4]
	mov	x20, x21
	b	LBB0_6
LBB0_14:
	ldr	w0, [x0]
	ldr	w8, [x19]
	str	x8, [sp]
Lloh25:
	adrp	x1, l_.str.4@PAGE
Lloh26:
	add	x1, x1, l_.str.4@PAGEOFF
	bl	_dev_err
	mov	w8, #-1
	str	w8, [x19]
	b	LBB0_6
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpAdd	Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"could not acquire IC\n"

l_.str.1:                               ; @.str.1
	.asciz	"could not acquire idmac channels\n"

	.comm	_EBUSY,4,2                      ; @EBUSY
l_.str.2:                               ; @.str.2
	.asciz	"could not acquire idmac rotation channels\n"

	.comm	_IPU_IRQ_EOF,4,2                ; @IPU_IRQ_EOF
	.comm	_norotate_irq,4,2               ; @norotate_irq
	.comm	_do_bh,4,2                      ; @do_bh
l_.str.3:                               ; @.str.3
	.asciz	"ipu-ic"

l_.str.4:                               ; @.str.4
	.asciz	"could not acquire irq %d\n"

	.comm	_rotate_irq,4,2                 ; @rotate_irq
	.no_dead_strip	_get_ipu_resources
.subsections_via_symbols
