	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ipu_idmac_buffer_is_ready      ## -- Begin function ipu_idmac_buffer_is_ready
	.p2align	4, 0x90
_ipu_idmac_buffer_is_ready:             ## @ipu_idmac_buffer_is_ready
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %ebx
	movq	%rdi, %r14
	movq	8(%rdi), %r15
	movq	%r15, %rdi
	callq	_spin_lock_irqsave
	cmpl	$2, %ebx
	je	LBB0_5
## %bb.1:
	cmpl	$1, %ebx
	je	LBB0_4
## %bb.2:
	xorl	%r12d, %r12d
	testl	%ebx, %ebx
	jne	LBB0_7
## %bb.3:
	movl	(%r14), %edi
	callq	_IPU_CHA_BUF0_RDY
	jmp	LBB0_6
LBB0_5:
	movl	(%r14), %edi
	callq	_IPU_CHA_BUF2_RDY
	jmp	LBB0_6
LBB0_4:
	movl	(%r14), %edi
	callq	_IPU_CHA_BUF1_RDY
LBB0_6:
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_ipu_cm_read
	movl	%eax, %r12d
LBB0_7:
	movq	%r15, %rdi
	callq	_spin_unlock_irqrestore
	movl	(%r14), %edi
	callq	_idma_mask
	xorl	%ecx, %ecx
	testl	%r12d, %eax
	setne	%cl
	movl	%ecx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ipu_idmac_buffer_is_ready      ; -- Begin function ipu_idmac_buffer_is_ready
	.p2align	2
_ipu_idmac_buffer_is_ready:             ; @ipu_idmac_buffer_is_ready
	.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	x21, x1
	mov	x19, x0
	ldr	x20, [x0, #8]
	mov	x0, x20
	bl	_spin_lock_irqsave
	cmp	w21, #2
	b.eq	LBB0_4
; %bb.1:
	cmp	w21, #1
	b.eq	LBB0_5
; %bb.2:
	cbnz	w21, LBB0_7
; %bb.3:
	ldr	w0, [x19]
	bl	_IPU_CHA_BUF0_RDY
	b	LBB0_6
LBB0_4:
	ldr	w0, [x19]
	bl	_IPU_CHA_BUF2_RDY
	b	LBB0_6
LBB0_5:
	ldr	w0, [x19]
	bl	_IPU_CHA_BUF1_RDY
LBB0_6:
	mov	x1, x0
	mov	x0, x20
	bl	_ipu_cm_read
	mov	x21, x0
	b	LBB0_8
LBB0_7:
	mov	w21, #0
LBB0_8:
	mov	x0, x20
	bl	_spin_unlock_irqrestore
	ldr	w0, [x19]
	bl	_idma_mask
	tst	w0, w21
	cset	w0, ne
	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
	.cfi_endproc
                                        ; -- End function
.subsections_via_symbols
