	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amdgpu_gfx_scratch_get         ## -- Begin function amdgpu_gfx_scratch_get
	.p2align	4, 0x90
_amdgpu_gfx_scratch_get:                ## @amdgpu_gfx_scratch_get
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	movl	(%rdi), %eax
	bsfl	%eax, %edx
	movl	$-1, %ecx
	cmovnel	%edx, %ecx
	je	LBB0_3
## %bb.1:
	incl	%ecx
	cmpl	4(%rdi), %ecx
	jle	LBB0_2
LBB0_3:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	popq	%rbp
	retq
LBB0_2:
	leal	-1(%rcx), %edx
	btrl	%edx, %eax
	movl	%eax, (%rdi)
	movq	8(%rdi), %rax
	movslq	%ecx, %rcx
	addq	%rcx, %rax
	decq	%rax
	movq	%rax, (%rsi)
	xorl	%eax, %eax
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amdgpu_gfx_scratch_get         ; -- Begin function amdgpu_gfx_scratch_get
	.p2align	2
_amdgpu_gfx_scratch_get:                ; @amdgpu_gfx_scratch_get
	.cfi_startproc
; %bb.0:
	ldr	w9, [x0]
	rbit	w8, w9
	clz	w8, w8
	cmp	w9, #0
	csinc	w10, wzr, w8, eq
	cbz	w9, LBB0_2
; %bb.1:
	ldr	w8, [x0, #4]
	cmp	w10, w8
	b.le	LBB0_3
LBB0_2:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w0, w8
	ret
LBB0_3:
	sub	w10, w10, #1
	mov	w11, #1
	lsl	w11, w11, w10
	bic	w9, w9, w11
	str	w9, [x0]
	ldr	x9, [x0, #8]
	add	x9, x9, w10, sxtw
	str	x9, [x1]
	mov	w0, #0
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
.subsections_via_symbols
