	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_gpu_fft_alloc                  ## -- Begin function gpu_fft_alloc
	.p2align	4, 0x90
_gpu_fft_alloc:                         ## @gpu_fft_alloc
	.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	%rdx, %r15
	movl	%esi, %r14d
	movl	%edi, %ebx
	leaq	-64(%rbp), %rdi
	callq	_gpu_fft_get_host_info
	movq	%rax, %rcx
	movl	$-5, %eax
	testq	%rcx, %rcx
	jne	LBB0_7
## %bb.1:
	movl	%ebx, %edi
	movl	$1, %esi
	callq	_qpu_enable
	movq	%rax, %rcx
	movl	$-1, %eax
	testq	%rcx, %rcx
	je	LBB0_2
LBB0_7:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movl	-44(%rbp), %ecx
	movl	%ebx, %edi
	movl	%r14d, %esi
	movl	$4096, %edx                     ## imm = 0x1000
	callq	_mem_alloc
	testl	%eax, %eax
	je	LBB0_3
## %bb.4:
	movl	%eax, %r12d
	movl	-64(%rbp), %esi
	movl	-48(%rbp), %edi
	callq	_mapmem
	testq	%rax, %rax
	je	LBB0_5
## %bb.6:
	movq	%rax, %r13
	movl	%ebx, %edi
	movl	%r12d, %esi
	callq	_mem_lock
	movq	%rax, 8(%r15)
	addq	-56(%rbp), %rax
	movq	%rax, %rdi
	callq	_BUS_TO_PHYS
	movl	%eax, %edi
	movl	%r14d, %esi
	callq	_mapmem
	movq	%rax, (%r15)
	movq	%r13, (%rax)
	movl	-64(%rbp), %ecx
	movl	%ecx, 8(%rax)
	movl	%ebx, 12(%rax)
	movl	%r12d, 16(%rax)
	movl	%r14d, 20(%rax)
	xorl	%eax, %eax
	jmp	LBB0_7
LBB0_3:
	movl	%ebx, %edi
	xorl	%esi, %esi
	callq	_qpu_enable
	movl	$-3, %eax
	jmp	LBB0_7
LBB0_5:
	movl	%ebx, %edi
	movl	%r12d, %esi
	callq	_mem_free
	movl	%ebx, %edi
	xorl	%esi, %esi
	callq	_qpu_enable
	movl	$-4, %eax
	jmp	LBB0_7
	.cfi_endproc
                                        ## -- End function
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_gpu_fft_alloc                  ; -- Begin function gpu_fft_alloc
	.p2align	2
_gpu_fft_alloc:                         ; @gpu_fft_alloc
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	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
	mov	x21, x2
	mov	x20, x1
	mov	x19, x0
	add	x0, sp, #8
	bl	_gpu_fft_get_host_info
	cbz	x0, LBB0_2
; %bb.1:
	mov	w0, #-5
	b	LBB0_4
LBB0_2:
	mov	x0, x19
	mov	w1, #1
	bl	_qpu_enable
	cbz	x0, LBB0_5
; %bb.3:
	mov	w0, #-1
LBB0_4:
	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
	add	sp, sp, #96
	ret
LBB0_5:
	ldr	w3, [sp, #28]
	mov	x0, x19
	mov	x1, x20
	mov	w2, #4096
	bl	_mem_alloc
	cbz	w0, LBB0_8
; %bb.6:
	mov	x22, x0
	ldr	w0, [sp, #24]
	ldr	w1, [sp, #8]
	bl	_mapmem
	cbz	x0, LBB0_9
; %bb.7:
	mov	x23, x0
	mov	x0, x19
	mov	x1, x22
	bl	_mem_lock
	str	x0, [x21, #8]
	ldr	x8, [sp, #16]
	add	x0, x8, x0
	bl	_BUS_TO_PHYS
	mov	x1, x20
	bl	_mapmem
	mov	x8, x0
	mov	w0, #0
	str	x8, [x21]
	str	x23, [x8]
	ldr	w9, [sp, #8]
	stp	w9, w19, [x8, #8]
	stp	w22, w20, [x8, #16]
	b	LBB0_4
LBB0_8:
	mov	x0, x19
	mov	w1, #0
	bl	_qpu_enable
	mov	w0, #-3
	b	LBB0_4
LBB0_9:
	mov	x0, x19
	mov	x1, x22
	bl	_mem_free
	mov	x0, x19
	mov	w1, #0
	bl	_qpu_enable
	mov	w0, #-4
	b	LBB0_4
	.cfi_endproc
                                        ; -- End function
.subsections_via_symbols
