	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amdgpu_discovery_get_ip_version ## -- Begin function amdgpu_discovery_get_ip_version
	.p2align	4, 0x90
_amdgpu_discovery_get_ip_version:       ## @amdgpu_discovery_get_ip_version
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, -44(%rbp)                 ## 4-byte Spill
	movslq	(%rdi), %rbx
	testq	%rbx, %rbx
	je	LBB0_1
## %bb.2:
	movq	%rdi, %r13
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	movq	(%rbx), %rax
	movq	_IP_DISCOVERY@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movl	(%rax,%rcx,4), %edi
	callq	_le16_to_cpu
	movslq	%eax, %rcx
	movq	%rcx, -88(%rbp)                 ## 8-byte Spill
	movl	8(%rcx,%rbx), %edi
	callq	_le16_to_cpu
	testl	%eax, %eax
	jle	LBB0_13
## %bb.3:
	movl	%eax, %eax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	xorl	%ecx, %ecx
	movq	%rbx, -80(%rbp)                 ## 8-byte Spill
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_4 Depth=1
	movq	-96(%rbp), %rcx                 ## 8-byte Reload
	incq	%rcx
	cmpq	-72(%rbp), %rcx                 ## 8-byte Folded Reload
	movq	-80(%rbp), %rbx                 ## 8-byte Reload
	je	LBB0_13
LBB0_4:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_6 Depth 2
	movq	-88(%rbp), %rax                 ## 8-byte Reload
	movq	(%rbx,%rax), %rax
	movq	%rcx, -96(%rbp)                 ## 8-byte Spill
	movl	(%rax,%rcx,4), %edi
	callq	_le16_to_cpu
	movl	%eax, %r14d
	movslq	(%r13), %rax
	movslq	%r14d, %rcx
	movl	(%rax,%rcx), %edi
	callq	_le16_to_cpu
	testl	%eax, %eax
	jle	LBB0_12
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	%eax, %r15d
	addl	$4, %r14d
	.p2align	4, 0x90
LBB0_6:                                 ##   Parent Loop BB0_4 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movslq	(%r13), %r12
	movslq	%r14d, %rbx
	movl	12(%r12,%rbx), %edi
	callq	_le16_to_cpu
	cmpl	-44(%rbp), %eax                 ## 4-byte Folded Reload
	je	LBB0_7
## %bb.11:                              ##   in Loop: Header=BB0_6 Depth=2
	movl	8(%rbx,%r12), %eax
	leal	(%rbx,%rax,4), %r14d
	addl	$12, %r14d
	decl	%r15d
	jne	LBB0_6
	jmp	LBB0_12
LBB0_1:
	leaq	L_.str(%rip), %rdi
	callq	_DRM_ERROR
LBB0_13:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_14
LBB0_7:
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	testq	%rcx, %rcx
	je	LBB0_9
## %bb.8:
	movl	(%rbx,%r12), %eax
	movl	%eax, (%rcx)
LBB0_9:
	xorl	%eax, %eax
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	testq	%rdx, %rdx
	je	LBB0_14
## %bb.10:
	movl	4(%rbx,%r12), %ecx
	movl	%ecx, (%rdx)
LBB0_14:
	addq	$56, %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	"ip discovery uninitialized\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_IP_DISCOVERY,8,3               ## @IP_DISCOVERY
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amdgpu_discovery_get_ip_version ; -- Begin function amdgpu_discovery_get_ip_version
	.p2align	2
_amdgpu_discovery_get_ip_version:       ; @amdgpu_discovery_get_ip_version
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	ldrsw	x23, [x0]
	cbz	w23, LBB0_8
; %bb.1:
	mov	x19, x3
	mov	x20, x2
	mov	x21, x1
	mov	x22, x0
	ldr	x8, [x23]
Lloh0:
	adrp	x9, _IP_DISCOVERY@GOTPAGE
Lloh1:
	ldr	x9, [x9, _IP_DISCOVERY@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	ldr	w0, [x8, x9, lsl #2]
	bl	_le16_to_cpu
	add	w8, w0, w23
	sxtw	x25, w8
	ldr	w0, [x25, #8]
	bl	_le16_to_cpu
	cmp	w0, #1
	b.lt	LBB0_9
; %bb.2:
	mov	x26, #0
	mov	w27, w0
	b	LBB0_4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x26, x26, #1
	cmp	x26, x27
	b.eq	LBB0_9
LBB0_4:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_6 Depth 2
	ldr	x8, [x25]
	ldr	w0, [x8, x26, lsl #2]
	bl	_le16_to_cpu
	mov	x24, x0
	ldrsw	x8, [x22]
	ldr	w0, [x8, w0, sxtw]
	bl	_le16_to_cpu
	cmp	w0, #1
	b.lt	LBB0_3
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x23, x0
	add	w24, w24, #4
LBB0_6:                                 ;   Parent Loop BB0_4 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldrsw	x8, [x22]
	add	x28, x8, w24, sxtw
	ldr	w0, [x28, #12]
	bl	_le16_to_cpu
	cmp	w0, w21
	b.eq	LBB0_10
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=2
	ldr	w8, [x28, #8]
	add	w8, w24, w8, lsl #2
	add	w24, w8, #12
	subs	w23, w23, #1
	b.ne	LBB0_6
	b	LBB0_3
LBB0_8:
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_ERROR
LBB0_9:
Lloh5:
	adrp	x8, _EINVAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_14
LBB0_10:
	cbz	x20, LBB0_12
; %bb.11:
	ldr	w8, [x28]
	str	w8, [x20]
LBB0_12:
	mov	w0, #0
	cbz	x19, LBB0_14
; %bb.13:
	ldr	w8, [x28, #4]
	str	w8, [x19]
LBB0_14:
	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
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ip discovery uninitialized\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_IP_DISCOVERY,8,3               ; @IP_DISCOVERY
.subsections_via_symbols
