	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_dbgdev_wave_reset_wavefronts   ## -- Begin function dbgdev_wave_reset_wavefronts
	.p2align	4, 0x90
_dbgdev_wave_reset_wavefronts:          ## @dbgdev_wave_reset_wavefronts
	.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	%rsi, %r12
	movq	%rdi, %r14
	movl	16(%rdi), %ebx
	movl	20(%rdi), %r13d
	movq	$0, -56(%rbp)
	movq	_HSA_DBG_WAVEMODE_BROADCAST_PROCESS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -60(%rbp)
	movq	_HSA_DBG_WAVEOP_KILL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -64(%rbp)
	leaq	L_.str(%rip), %rdi
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	callq	_pr_debug
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_1:                                 ##   in Loop: Header=BB0_2 Depth=1
	incl	%ebx
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	cmpl	%r13d, %ebx
	ja	LBB0_8
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	8(%r14), %rax
	movl	(%r14), %edi
	movl	%ebx, %esi
	callq	*16(%rax)
	testq	%rax, %rax
	je	LBB0_1
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	8(%r14), %rax
	movl	(%r14), %edi
	movl	%ebx, %esi
	callq	*8(%rax)
	cmpl	(%r12), %eax
	jne	LBB0_1
## %bb.5:
	leaq	L_.str.1(%rip), %rdi
	xorl	%r15d, %r15d
	movl	%ebx, %esi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_pr_debug
	movq	%r14, %rdi
	movq	%r12, %rsi
	callq	_kfd_get_process_device_data
	testq	%rax, %rax
	je	LBB0_9
## %bb.6:
	leaq	-64(%rbp), %rdi
	leaq	-56(%rbp), %rsi
	leaq	-48(%rbp), %rdx
	callq	_dbgdev_wave_control_set_registers
	testl	%eax, %eax
	je	LBB0_12
## %bb.7:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	jmp	LBB0_10
LBB0_8:
	movl	(%r12), %esi
	leaq	L_.str.2(%rip), %rdi
	callq	_pr_err
LBB0_9:
	movq	_EFAULT@GOTPCREL(%rip), %rax
LBB0_10:
	subl	(%rax), %r15d
LBB0_11:
	movl	%r15d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	movl	%ebx, -56(%rbp)
	movq	8(%r14), %rax
	movl	(%r14), %edi
	movl	-48(%rbp), %esi
	movq	-56(%rbp), %rdx
	callq	*(%rax)
	xorl	%r15d, %r15d
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_HSA_DBG_WAVEMODE_BROADCAST_PROCESS,4,2 ## @HSA_DBG_WAVEMODE_BROADCAST_PROCESS
	.comm	_HSA_DBG_WAVEOP_KILL,4,2        ## @HSA_DBG_WAVEOP_KILL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Killing all process wavefronts\n"

L_.str.1:                               ## @.str.1
	.asciz	"Killing wave fronts of vmid %d and pasid %d\n"

L_.str.2:                               ## @.str.2
	.asciz	"Didn't find vmid for pasid %d\n"

	.comm	_EFAULT,4,2                     ## @EFAULT
	.comm	_EINVAL,4,2                     ## @EINVAL
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_dbgdev_wave_reset_wavefronts   ; -- Begin function dbgdev_wave_reset_wavefronts
	.p2align	2
_dbgdev_wave_reset_wavefronts:          ; @dbgdev_wave_reset_wavefronts
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	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
	mov	x21, x1
	mov	x19, x0
	ldp	w20, w22, [x0, #16]
	str	xzr, [sp, #40]
Lloh0:
	adrp	x8, _HSA_DBG_WAVEMODE_BROADCAST_PROCESS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _HSA_DBG_WAVEMODE_BROADCAST_PROCESS@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _HSA_DBG_WAVEOP_KILL@GOTPAGE
Lloh4:
	ldr	x9, [x9, _HSA_DBG_WAVEOP_KILL@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	stp	w9, w8, [sp, #24]
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_debug
	b	LBB0_2
LBB0_1:                                 ;   in Loop: Header=BB0_2 Depth=1
	add	w20, w20, #1
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	cmp	w20, w22
	b.hi	LBB0_8
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	x8, [x19, #8]
	ldr	x8, [x8, #16]
	ldr	w0, [x19]
	mov	x1, x20
	blr	x8
	cbz	x0, LBB0_1
; %bb.4:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	x8, [x19, #8]
	ldr	x8, [x8, #8]
	ldr	w0, [x19]
	mov	x1, x20
	blr	x8
                                        ; kill: def $w0 killed $w0 def $x0
	ldr	w8, [x21]
	cmp	w0, w8
	b.ne	LBB0_1
; %bb.5:
	stp	x20, x0, [sp]
Lloh8:
	adrp	x0, l_.str.1@PAGE
Lloh9:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_pr_debug
	mov	x0, x19
	mov	x1, x21
	bl	_kfd_get_process_device_data
	cbz	x0, LBB0_9
; %bb.6:
	add	x0, sp, #24
	add	x1, sp, #40
	add	x2, sp, #32
	bl	_dbgdev_wave_control_set_registers
	cbz	w0, LBB0_12
; %bb.7:
Lloh10:
	adrp	x8, _EINVAL@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_10
LBB0_8:
	ldr	w1, [x21]
Lloh12:
	adrp	x0, l_.str.2@PAGE
Lloh13:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_pr_err
LBB0_9:
Lloh14:
	adrp	x8, _EFAULT@GOTPAGE
Lloh15:
	ldr	x8, [x8, _EFAULT@GOTPAGEOFF]
LBB0_10:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_11:
	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
	add	sp, sp, #96
	ret
LBB0_12:
	str	w20, [sp, #40]
	ldr	x8, [x19, #8]
	ldr	x8, [x8]
	ldr	w0, [x19]
	ldr	w1, [sp, #32]
	ldr	x2, [sp, #40]
	blr	x8
	mov	w0, #0
	b	LBB0_11
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_HSA_DBG_WAVEMODE_BROADCAST_PROCESS,4,2 ; @HSA_DBG_WAVEMODE_BROADCAST_PROCESS
	.comm	_HSA_DBG_WAVEOP_KILL,4,2        ; @HSA_DBG_WAVEOP_KILL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Killing all process wavefronts\n"

l_.str.1:                               ; @.str.1
	.asciz	"Killing wave fronts of vmid %d and pasid %d\n"

l_.str.2:                               ; @.str.2
	.asciz	"Didn't find vmid for pasid %d\n"

	.comm	_EFAULT,4,2                     ; @EFAULT
	.comm	_EINVAL,4,2                     ; @EINVAL
.subsections_via_symbols
