	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function kfd_ioctl_create_queue
_kfd_ioctl_create_queue:                ## @kfd_ioctl_create_queue
	.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
	movq	%rsi, %r14
	movq	%rdi, %r12
	leaq	-48(%rbp), %rbx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movl	$4, %edx
	callq	_memset
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_pr_debug
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_set_queue_properties_from_user
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_10
## %bb.1:
	movl	(%r15), %esi
	leaq	L_.str.1(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_pr_debug
	movl	(%r15), %edi
	callq	_kfd_device_by_id
	testq	%rax, %rax
	je	LBB0_2
## %bb.3:
	movq	%rax, %r13
	movq	%r14, %rdi
	callq	_mutex_lock
	movq	%r13, %rdi
	movq	%r14, %rsi
	callq	_kfd_bind_process_to_device
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_6
## %bb.4:
	movq	_ESRCH@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_5
LBB0_2:
	movl	(%r15), %esi
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	_pr_debug
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_10
LBB0_6:
	movl	8(%r14), %esi
	movl	8(%r13), %edx
	leaq	L_.str.3(%rip), %rdi
	xorl	%eax, %eax
	callq	_pr_debug
	leaq	4(%r14), %rdi
	leaq	-48(%rbp), %rcx
	leaq	-52(%rbp), %r8
	movq	%r13, %rsi
	movq	%r12, %rdx
	callq	_pqm_create_queue
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_7
LBB0_5:
	movq	%r14, %rdi
	callq	_mutex_unlock
LBB0_10:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movl	-52(%rbp), %eax
	movl	%eax, 4(%r15)
	movq	_KFD_MMAP_TYPE_DOORBELL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 20(%r15)
	movl	(%r15), %edi
	callq	_KFD_MMAP_GPU_ID
	orl	20(%r15), %eax
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %eax
	movl	%eax, 20(%r15)
	movq	(%r13), %rax
	movl	(%rax), %edi
	callq	_KFD_IS_SOC15
	testq	%rax, %rax
	je	LBB0_9
## %bb.8:
	movl	-48(%rbp), %eax
	orl	%eax, 20(%r15)
LBB0_9:
	movq	%r14, %rdi
	callq	_mutex_unlock
	movl	4(%r15), %esi
	leaq	L_.str.4(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_pr_debug
	movl	8(%r15), %esi
	leaq	L_.str.5(%rip), %rdi
	xorl	%eax, %eax
	callq	_pr_debug
	movl	12(%r15), %esi
	leaq	L_.str.6(%rip), %rdi
	xorl	%eax, %eax
	callq	_pr_debug
	movl	16(%r15), %esi
	leaq	L_.str.7(%rip), %rdi
	xorl	%eax, %eax
	callq	_pr_debug
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Creating queue ioctl\n"

L_.str.1:                               ## @.str.1
	.asciz	"Looking for gpu id 0x%x\n"

L_.str.2:                               ## @.str.2
	.asciz	"Could not find gpu id 0x%x\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_ESRCH,4,2                      ## @ESRCH
L_.str.3:                               ## @.str.3
	.asciz	"Creating queue for PASID %d on gpu 0x%x\n"

	.comm	_KFD_MMAP_TYPE_DOORBELL,4,2     ## @KFD_MMAP_TYPE_DOORBELL
	.comm	_PAGE_SHIFT,4,2                 ## @PAGE_SHIFT
L_.str.4:                               ## @.str.4
	.asciz	"Queue id %d was created successfully\n"

L_.str.5:                               ## @.str.5
	.asciz	"Ring buffer address == 0x%016llX\n"

L_.str.6:                               ## @.str.6
	.asciz	"Read ptr address    == 0x%016llX\n"

L_.str.7:                               ## @.str.7
	.asciz	"Write ptr address   == 0x%016llX\n"

	.no_dead_strip	_kfd_ioctl_create_queue
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function kfd_ioctl_create_queue
_kfd_ioctl_create_queue:                ; @kfd_ioctl_create_queue
	.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	x19, x2
	mov	x20, x1
	mov	x21, x0
	add	x0, sp, #24
	mov	w1, #0
	mov	w2, #4
	bl	_memset
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_debug
	add	x0, sp, #24
	mov	x1, x19
	bl	_set_queue_properties_from_user
	mov	x23, x0
	cbnz	w0, LBB0_7
; %bb.1:
	ldr	w8, [x19]
	str	x8, [sp]
Lloh2:
	adrp	x0, l_.str.1@PAGE
Lloh3:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_pr_debug
	ldr	w0, [x19]
	bl	_kfd_device_by_id
	cbz	x0, LBB0_4
; %bb.2:
	mov	x22, x0
	mov	x0, x20
	bl	_mutex_lock
	mov	x0, x22
	mov	x1, x20
	bl	_kfd_bind_process_to_device
	bl	_IS_ERR
	cbz	x0, LBB0_5
; %bb.3:
Lloh4:
	adrp	x8, _ESRCH@GOTPAGE
Lloh5:
	ldr	x8, [x8, _ESRCH@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	neg	w23, w8
	b	LBB0_6
LBB0_4:
	ldr	w8, [x19]
	str	x8, [sp]
Lloh7:
	adrp	x0, l_.str.2@PAGE
Lloh8:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_pr_debug
Lloh9:
	adrp	x8, _EINVAL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	neg	w23, w8
	b	LBB0_7
LBB0_5:
	ldr	w8, [x20, #8]
	ldr	w9, [x22, #8]
	stp	x8, x9, [sp]
Lloh12:
	adrp	x0, l_.str.3@PAGE
Lloh13:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_pr_debug
	add	x0, x20, #4
	add	x3, sp, #24
	add	x4, sp, #28
	mov	x1, x22
	mov	x2, x21
	bl	_pqm_create_queue
	mov	x23, x0
	cbz	w0, LBB0_8
LBB0_6:
	mov	x0, x20
	bl	_mutex_unlock
LBB0_7:
	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
	add	sp, sp, #96
	ret
LBB0_8:
	ldr	w8, [sp, #28]
	str	w8, [x19, #4]
Lloh14:
	adrp	x8, _KFD_MMAP_TYPE_DOORBELL@GOTPAGE
Lloh15:
	ldr	x8, [x8, _KFD_MMAP_TYPE_DOORBELL@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	str	w8, [x19, #20]
	ldr	w0, [x19]
	bl	_KFD_MMAP_GPU_ID
	ldr	w8, [x19, #20]
Lloh17:
	adrp	x9, _PAGE_SHIFT@GOTPAGE
Lloh18:
	ldr	x9, [x9, _PAGE_SHIFT@GOTPAGEOFF]
	orr	w8, w8, w0
Lloh19:
	ldr	w9, [x9]
	lsl	w8, w8, w9
	str	w8, [x19, #20]
	ldr	x8, [x22]
	ldr	w0, [x8]
	bl	_KFD_IS_SOC15
	cbz	x0, LBB0_10
; %bb.9:
	ldr	w8, [sp, #24]
	ldr	w9, [x19, #20]
	orr	w8, w9, w8
	str	w8, [x19, #20]
LBB0_10:
	mov	x0, x20
	bl	_mutex_unlock
	ldr	w8, [x19, #4]
	str	x8, [sp]
Lloh20:
	adrp	x0, l_.str.4@PAGE
Lloh21:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_pr_debug
	ldr	w8, [x19, #8]
	str	x8, [sp]
Lloh22:
	adrp	x0, l_.str.5@PAGE
Lloh23:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_pr_debug
	ldr	w8, [x19, #12]
	str	x8, [sp]
Lloh24:
	adrp	x0, l_.str.6@PAGE
Lloh25:
	add	x0, x0, l_.str.6@PAGEOFF
	bl	_pr_debug
	ldr	w8, [x19, #16]
	str	x8, [sp]
Lloh26:
	adrp	x0, l_.str.7@PAGE
Lloh27:
	add	x0, x0, l_.str.7@PAGEOFF
	bl	_pr_debug
	mov	w23, #0
	b	LBB0_7
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpAdd	Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Creating queue ioctl\n"

l_.str.1:                               ; @.str.1
	.asciz	"Looking for gpu id 0x%x\n"

l_.str.2:                               ; @.str.2
	.asciz	"Could not find gpu id 0x%x\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_ESRCH,4,2                      ; @ESRCH
l_.str.3:                               ; @.str.3
	.asciz	"Creating queue for PASID %d on gpu 0x%x\n"

	.comm	_KFD_MMAP_TYPE_DOORBELL,4,2     ; @KFD_MMAP_TYPE_DOORBELL
	.comm	_PAGE_SHIFT,4,2                 ; @PAGE_SHIFT
l_.str.4:                               ; @.str.4
	.asciz	"Queue id %d was created successfully\n"

l_.str.5:                               ; @.str.5
	.asciz	"Ring buffer address == 0x%016llX\n"

l_.str.6:                               ; @.str.6
	.asciz	"Read ptr address    == 0x%016llX\n"

l_.str.7:                               ; @.str.7
	.asciz	"Write ptr address   == 0x%016llX\n"

	.no_dead_strip	_kfd_ioctl_create_queue
.subsections_via_symbols
