	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amdgpu_amdkfd_submit_ib        ## -- Begin function amdgpu_amdkfd_submit_ib
	.p2align	4, 0x90
_amdgpu_amdkfd_submit_ib:               ## @amdgpu_amdkfd_submit_ib
	.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	%r9, %rbx
	movq	%r8, %r12
	movl	%ecx, %r13d
	movq	$0, -64(%rbp)
	cmpl	$128, %esi
	je	LBB0_4
## %bb.1:
	cmpl	$129, %esi
	je	LBB0_6
## %bb.2:
	cmpl	$130, %esi
	jne	LBB0_5
## %bb.3:
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
	movq	8(%rdi), %r15
	jmp	LBB0_7
LBB0_4:
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
	movq	(%rdi), %r15
	addq	$4, %r15
	jmp	LBB0_7
LBB0_6:
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
	movq	(%rdi), %r15
LBB0_7:
	leaq	-48(%rbp), %rdx
	movl	$1, %esi
	xorl	%ecx, %ecx
	callq	_amdgpu_job_alloc
	movl	%eax, %r14d
	testl	%eax, %eax
	jne	LBB0_12
## %bb.8:
	movq	-48(%rbp), %rax
	movq	%rbx, %r14
	movq	8(%rax), %rbx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movl	$24, %edx
	callq	_memset
	movl	%r13d, 16(%rbx)
	movq	%r12, (%rbx)
	movq	%r14, 8(%rbx)
	movq	-48(%rbp), %rax
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movq	%rcx, (%rax)
	movq	-48(%rbp), %rcx
	leaq	-64(%rbp), %r8
	movq	%r15, %rdi
	movl	$1, %esi
	movq	%rbx, %rdx
	callq	_amdgpu_ib_schedule
	testl	%eax, %eax
	je	LBB0_10
## %bb.9:
	movl	%eax, %r14d
	leaq	L_.str.1(%rip), %rdi
	callq	_DRM_ERROR
	jmp	LBB0_11
LBB0_5:
	leaq	L_.str(%rip), %rdi
	callq	_pr_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	jmp	LBB0_12
LBB0_10:
	movq	-64(%rbp), %rdi
	xorl	%esi, %esi
	callq	_dma_fence_wait
	movl	%eax, %r14d
LBB0_11:
	movq	-64(%rbp), %rdi
	callq	_dma_fence_put
	movq	-48(%rbp), %rdi
	callq	_amdgpu_job_free
LBB0_12:
	movl	%r14d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Invalid engine in IB submission: %d\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"amdgpu: failed to schedule IB.\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amdgpu_amdkfd_submit_ib        ; -- Begin function amdgpu_amdkfd_submit_ib
	.p2align	2
_amdgpu_amdkfd_submit_ib:               ; @amdgpu_amdkfd_submit_ib
	.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, x5
	mov	x21, x4
	mov	x22, x3
	mov	x20, x2
	str	xzr, [sp]
	cmp	w1, #128
	b.eq	LBB0_4
; %bb.1:
	cmp	w1, #129
	b.eq	LBB0_5
; %bb.2:
	cmp	w1, #130
	b.ne	LBB0_9
; %bb.3:
	ldr	x23, [x0, #8]
	b	LBB0_6
LBB0_4:
	ldr	x8, [x0]
	add	x23, x8, #4
	b	LBB0_6
LBB0_5:
	ldr	x23, [x0]
LBB0_6:
	add	x2, sp, #8
	mov	w1, #1
	mov	x3, #0
	bl	_amdgpu_job_alloc
	mov	x24, x0
	cbnz	w0, LBB0_12
; %bb.7:
	ldr	x8, [sp, #8]
	ldr	x24, [x8, #8]
	mov	x0, x24
	mov	w1, #0
	mov	w2, #24
	bl	_memset
	str	w22, [x24, #16]
	stp	x21, x19, [x24]
	ldr	x8, [sp, #8]
	str	x20, [x8]
	ldr	x3, [sp, #8]
	mov	x4, sp
	mov	x0, x23
	mov	w1, #1
	mov	x2, x24
	bl	_amdgpu_ib_schedule
	cbz	w0, LBB0_10
; %bb.8:
	mov	x24, x0
Lloh0:
	adrp	x0, l_.str.1@PAGE
Lloh1:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DRM_ERROR
	b	LBB0_11
LBB0_9:
Lloh2:
	adrp	x0, l_.str@PAGE
Lloh3:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_err
Lloh4:
	adrp	x8, _EINVAL@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	neg	w24, w8
	b	LBB0_12
LBB0_10:
	ldr	x0, [sp]
	mov	w1, #0
	bl	_dma_fence_wait
	mov	x24, x0
LBB0_11:
	ldr	x0, [sp]
	bl	_dma_fence_put
	ldr	x0, [sp, #8]
	bl	_amdgpu_job_free
LBB0_12:
	mov	x0, x24
	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
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Invalid engine in IB submission: %d\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"amdgpu: failed to schedule IB.\n"

.subsections_via_symbols
