	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amdgpu_cs_ioctl                ## -- Begin function amdgpu_cs_ioctl
	.p2align	4, 0x90
_amdgpu_cs_ioctl:                       ## @amdgpu_cs_ioctl
	.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
	subq	$32, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	(%rdi), %rbx
	movq	$0, -56(%rbp)
	cmpl	$0, (%rbx)
	je	LBB0_1
## %bb.2:
	movq	%rsi, %r15
	movq	%rbx, -40(%rbp)
	movq	%rdx, -48(%rbp)
	leaq	-56(%rbp), %rdi
	callq	_amdgpu_cs_parser_init
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movl	%eax, %r12d
	leaq	L_.str(%rip), %rdi
LBB0_19:
	xorl	%r14d, %r14d
	movl	%r12d, %esi
	xorl	%eax, %eax
	callq	_DRM_ERROR
	jmp	LBB0_20
LBB0_1:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
	jmp	LBB0_21
LBB0_4:
	leaq	-56(%rbp), %rsi
	movq	%rbx, %rdi
	callq	_amdgpu_cs_ib_fill
	xorl	%r14d, %r14d
	testl	%eax, %eax
	je	LBB0_5
LBB0_13:
	movl	%eax, %r12d
LBB0_20:
	leaq	-56(%rbp), %rdi
	movl	%r12d, %esi
	movl	%r14d, %edx
	callq	_amdgpu_cs_parser_fini
LBB0_21:
	movl	%r12d, %eax
	addq	$32, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	leaq	-56(%rbp), %rsi
	movq	%rbx, %rdi
	callq	_amdgpu_cs_dependencies
	testl	%eax, %eax
	je	LBB0_7
## %bb.6:
	movl	%eax, %r12d
	leaq	L_.str.1(%rip), %rdi
	jmp	LBB0_19
LBB0_7:
	leaq	-56(%rbp), %rdi
	movq	%r15, %rsi
	callq	_amdgpu_cs_parser_bos
	testl	%eax, %eax
	je	LBB0_8
## %bb.14:
	movl	%eax, %r12d
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%r12d, %eax
	jne	LBB0_16
## %bb.15:
	leaq	L_.str.2(%rip), %rdi
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_DRM_ERROR
	jmp	LBB0_20
LBB0_8:
	movq	-56(%rbp), %rax
	cmpl	$0, (%rax)
	jle	LBB0_11
## %bb.9:
	xorl	%ebx, %ebx
	leaq	-56(%rbp), %r14
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_trace_amdgpu_cs
	incl	%ebx
	movq	-56(%rbp), %rax
	cmpl	(%rax), %ebx
	jl	LBB0_10
LBB0_11:
	leaq	-56(%rbp), %rdi
	callq	_amdgpu_cs_vm_handling
	movl	$1, %r14d
	testl	%eax, %eax
	jne	LBB0_13
## %bb.12:
	leaq	-56(%rbp), %rdi
	movq	%r15, %rsi
	callq	_amdgpu_cs_submit
	jmp	LBB0_13
LBB0_16:
	movq	_ERESTARTSYS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%r12d, %eax
	je	LBB0_20
## %bb.17:
	movq	_EAGAIN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%r12d, %eax
	je	LBB0_20
## %bb.18:
	leaq	L_.str.3(%rip), %rdi
	jmp	LBB0_19
	.cfi_endproc
                                        ## -- End function
	.comm	_EBUSY,4,2                      ## @EBUSY
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to initialize parser %d!\n"

L_.str.1:                               ## @.str.1
	.asciz	"Failed in the dependencies handling %d!\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
L_.str.2:                               ## @.str.2
	.asciz	"Not enough memory for command submission!\n"

	.comm	_ERESTARTSYS,4,2                ## @ERESTARTSYS
	.comm	_EAGAIN,4,2                     ## @EAGAIN
L_.str.3:                               ## @.str.3
	.asciz	"Failed to process the buffer list %d!\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amdgpu_cs_ioctl                ; -- Begin function amdgpu_cs_ioctl
	.p2align	2
_amdgpu_cs_ioctl:                       ; @amdgpu_cs_ioctl
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	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
	ldr	x21, [x0]
	str	xzr, [sp, #8]
	ldr	w8, [x21]
	cbz	w8, LBB0_4
; %bb.1:
	mov	x20, x1
	stp	x2, x21, [sp, #16]
	add	x0, sp, #8
	bl	_amdgpu_cs_parser_init
	cbz	w0, LBB0_5
; %bb.2:
	mov	x19, x0
	str	x19, [sp]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
LBB0_3:
	bl	_DRM_ERROR
	mov	w2, #0
	b	LBB0_9
LBB0_4:
Lloh2:
	adrp	x8, _EBUSY@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w19, w8
	b	LBB0_10
LBB0_5:
	add	x1, sp, #8
	mov	x0, x21
	bl	_amdgpu_cs_ib_fill
	cbz	w0, LBB0_7
; %bb.6:
	mov	x19, x0
	mov	w2, #0
	b	LBB0_9
LBB0_7:
	add	x1, sp, #8
	mov	x0, x21
	bl	_amdgpu_cs_dependencies
	cbz	w0, LBB0_11
; %bb.8:
	mov	x19, x0
	str	x19, [sp]
Lloh5:
	adrp	x0, l_.str.1@PAGE
Lloh6:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DRM_ERROR
	mov	w2, #0
                                        ; kill: def $w19 killed $w19 killed $x19 def $x19
LBB0_9:
	add	x0, sp, #8
	mov	x1, x19
	bl	_amdgpu_cs_parser_fini
LBB0_10:
	mov	x0, x19
	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
	add	sp, sp, #80
	ret
LBB0_11:
	add	x0, sp, #8
	mov	x1, x20
	bl	_amdgpu_cs_parser_bos
	cbz	w0, LBB0_14
; %bb.12:
	mov	x19, x0
Lloh7:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh8:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	cmn	w0, w8
	b.ne	LBB0_20
; %bb.13:
Lloh10:
	adrp	x0, l_.str.2@PAGE
Lloh11:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_3
LBB0_14:
	ldr	x8, [sp, #8]
	ldr	w8, [x8]
	cmp	w8, #1
	b.lt	LBB0_17
; %bb.15:
	mov	w19, #0
LBB0_16:                                ; =>This Inner Loop Header: Depth=1
	add	x0, sp, #8
	mov	x1, x19
	bl	_trace_amdgpu_cs
	add	w19, w19, #1
	ldr	x8, [sp, #8]
	ldr	w8, [x8]
	cmp	w19, w8
	b.lt	LBB0_16
LBB0_17:
	add	x0, sp, #8
	bl	_amdgpu_cs_vm_handling
	cbnz	w0, LBB0_19
; %bb.18:
	add	x0, sp, #8
	mov	x1, x20
	bl	_amdgpu_cs_submit
LBB0_19:
	mov	x19, x0
	mov	w2, #1
	b	LBB0_9
LBB0_20:
Lloh12:
	adrp	x8, _ERESTARTSYS@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ERESTARTSYS@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	cmn	w19, w8
	b.eq	LBB0_22
; %bb.21:
Lloh15:
	adrp	x8, _EAGAIN@GOTPAGE
Lloh16:
	ldr	x8, [x8, _EAGAIN@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	cmn	w19, w8
	b.ne	LBB0_23
LBB0_22:
	mov	w2, #0
	b	LBB0_9
LBB0_23:
	mov	x8, x19
	str	x8, [sp]
Lloh18:
	adrp	x0, l_.str.3@PAGE
Lloh19:
	add	x0, x0, l_.str.3@PAGEOFF
	b	LBB0_3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_EBUSY,4,2                      ; @EBUSY
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to initialize parser %d!\n"

l_.str.1:                               ; @.str.1
	.asciz	"Failed in the dependencies handling %d!\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
l_.str.2:                               ; @.str.2
	.asciz	"Not enough memory for command submission!\n"

	.comm	_ERESTARTSYS,4,2                ; @ERESTARTSYS
	.comm	_EAGAIN,4,2                     ; @EAGAIN
l_.str.3:                               ; @.str.3
	.asciz	"Failed to process the buffer list %d!\n"

.subsections_via_symbols
