	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function amdgpu_discovery_read_binary
_amdgpu_discovery_read_binary:          ## @amdgpu_discovery_read_binary
	.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
	pushq	%rax
	.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
	movq	_mmRCC_CONFIG_MEMSIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_RREG32
	movq	%rax, %r15
	movq	_BINARY_MAX_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jle	LBB0_3
## %bb.1:
	shll	$20, %r15d
	movl	%r15d, %ebx
	subl	%eax, %ebx
	movq	_mmMM_DATA@GOTPCREL(%rip), %r13
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	callq	_spin_lock_irqsave
	movq	_mmMM_INDEX@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%ebx, %esi
	orl	$-2147483648, %esi              ## imm = 0x80000000
	callq	_WREG32_NO_KIQ
	movq	_mmMM_INDEX_HI@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%ebx, %esi
	sarl	$31, %esi
	callq	_WREG32_NO_KIQ
	movl	(%r13), %edi
	callq	_RREG32_NO_KIQ
	movl	%eax, (%r12)
	addq	$4, %r12
	movq	%r14, %rdi
	callq	_spin_unlock_irqrestore
	addl	$4, %ebx
	cmpl	%r15d, %ebx
	jl	LBB0_2
LBB0_3:
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_mmRCC_CONFIG_MEMSIZE,4,2       ## @mmRCC_CONFIG_MEMSIZE
	.comm	_BINARY_MAX_SIZE,4,2            ## @BINARY_MAX_SIZE
	.comm	_mmMM_INDEX,4,2                 ## @mmMM_INDEX
	.comm	_mmMM_INDEX_HI,4,2              ## @mmMM_INDEX_HI
	.comm	_mmMM_DATA,4,2                  ## @mmMM_DATA
	.no_dead_strip	_amdgpu_discovery_read_binary
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function amdgpu_discovery_read_binary
_amdgpu_discovery_read_binary:          ; @amdgpu_discovery_read_binary
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _mmRCC_CONFIG_MEMSIZE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _mmRCC_CONFIG_MEMSIZE@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_RREG32
Lloh3:
	adrp	x8, _BINARY_MAX_SIZE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _BINARY_MAX_SIZE@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	cmp	w8, #1
	b.lt	LBB0_3
; %bb.1:
	lsl	w21, w0, #20
	sub	w22, w21, w8
Lloh6:
	adrp	x23, _mmMM_INDEX@GOTPAGE
Lloh7:
	ldr	x23, [x23, _mmMM_INDEX@GOTPAGEOFF]
Lloh8:
	adrp	x24, _mmMM_INDEX_HI@GOTPAGE
Lloh9:
	ldr	x24, [x24, _mmMM_INDEX_HI@GOTPAGEOFF]
Lloh10:
	adrp	x25, _mmMM_DATA@GOTPAGE
Lloh11:
	ldr	x25, [x25, _mmMM_DATA@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	bl	_spin_lock_irqsave
	ldr	w0, [x23]
	orr	w1, w22, #0x80000000
	bl	_WREG32_NO_KIQ
	ldr	w0, [x24]
	asr	w1, w22, #31
	bl	_WREG32_NO_KIQ
	ldr	w0, [x25]
	bl	_RREG32_NO_KIQ
	str	w0, [x19], #4
	mov	x0, x20
	bl	_spin_unlock_irqrestore
	add	w22, w22, #4
	cmp	w22, w21
	b.lt	LBB0_2
LBB0_3:
	mov	w0, #0
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_mmRCC_CONFIG_MEMSIZE,4,2       ; @mmRCC_CONFIG_MEMSIZE
	.comm	_BINARY_MAX_SIZE,4,2            ; @BINARY_MAX_SIZE
	.comm	_mmMM_INDEX,4,2                 ; @mmMM_INDEX
	.comm	_mmMM_INDEX_HI,4,2              ; @mmMM_INDEX_HI
	.comm	_mmMM_DATA,4,2                  ; @mmMM_DATA
	.no_dead_strip	_amdgpu_discovery_read_binary
.subsections_via_symbols
