	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ishtp_cl_alloc_dma_buf         ## -- Begin function ishtp_cl_alloc_dma_buf
	.p2align	4, 0x90
_ishtp_cl_alloc_dma_buf:                ## @ishtp_cl_alloc_dma_buf
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	cmpq	$0, 56(%rdi)
	jne	LBB0_5
## %bb.1:
	movq	%rdi, %rbx
	movabsq	$4503599628419072, %rax         ## imm = 0x10000000100000
	movq	%rax, (%rdi)
	movl	32(%rdi), %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %r14
	movl	(%r14), %ecx
	leaq	-24(%rbp), %rdx
	movl	$1048576, %esi                  ## imm = 0x100000
	callq	_dma_alloc_coherent
	movq	%rax, 56(%rbx)
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	movq	-24(%rbp), %rax
	movq	%rax, 48(%rbx)
LBB0_3:
	movl	(%rbx), %eax
	movq	_DMA_SLOT_SIZE@GOTPCREL(%rip), %rcx
	cltd
	idivl	(%rcx)
	movl	%eax, 8(%rbx)
	movl	(%r14), %edx
	movl	%eax, %edi
	movl	$4, %esi
	callq	_kcalloc
	movl	%eax, 40(%rbx)
	leaq	36(%rbx), %rdi
	callq	_spin_lock_init
	movl	4(%rbx), %esi
	movl	32(%rbx), %edi
	movl	(%r14), %ecx
	leaq	-24(%rbp), %rdx
	callq	_dma_alloc_coherent
	movq	%rax, 24(%rbx)
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	movq	-24(%rbp), %rax
	movq	%rax, 16(%rbx)
LBB0_5:
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_DMA_SLOT_SIZE,4,2              ## @DMA_SLOT_SIZE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ishtp_cl_alloc_dma_buf         ; -- Begin function ishtp_cl_alloc_dma_buf
	.p2align	2
_ishtp_cl_alloc_dma_buf:                ; @ishtp_cl_alloc_dma_buf
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
	ldr	x8, [x0, #56]
	cbnz	x8, LBB0_5
; %bb.1:
	mov	x19, x0
	movi.2s	v0, #16, lsl #16
	str	d0, [x0]
	ldr	w0, [x0, #32]
Lloh0:
	adrp	x20, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x20, [x20, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w3, [x20]
	add	x2, sp, #8
	mov	w1, #1048576
	bl	_dma_alloc_coherent
	str	x0, [x19, #56]
	cbz	x0, LBB0_3
; %bb.2:
	ldr	x8, [sp, #8]
	str	x8, [x19, #48]
LBB0_3:
	ldr	w8, [x19]
Lloh2:
	adrp	x9, _DMA_SLOT_SIZE@GOTPAGE
Lloh3:
	ldr	x9, [x9, _DMA_SLOT_SIZE@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	sdiv	w0, w8, w9
	str	w0, [x19, #8]
	ldr	w2, [x20]
	mov	w1, #4
	bl	_kcalloc
	str	w0, [x19, #40]
	add	x0, x19, #36
	bl	_spin_lock_init
	ldr	w0, [x19, #32]
	ldr	w1, [x19, #4]
	ldr	w3, [x20]
	add	x2, sp, #8
	bl	_dma_alloc_coherent
	str	x0, [x19, #24]
	cbz	x0, LBB0_5
; %bb.4:
	ldr	x8, [sp, #8]
	str	x8, [x19, #16]
LBB0_5:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_DMA_SLOT_SIZE,4,2              ; @DMA_SLOT_SIZE
.subsections_via_symbols
