	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ipw_get_ordinal
_ipw_get_ordinal:                       ## @ipw_get_ordinal
	.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	%rcx, %r13
	movq	%rdx, %r12
	movl	%esi, %r15d
	movq	%rdi, %r14
	leaq	L_.str(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_IPW_DEBUG_ORD
	testq	%r14, %r14
	je	LBB0_3
## %bb.1:
	testq	%r12, %r12
	je	LBB0_3
## %bb.2:
	testq	%r13, %r13
	je	LBB0_3
## %bb.4:
	movl	(%r14), %eax
	testl	%eax, %eax
	je	LBB0_7
## %bb.5:
	movl	4(%r14), %ecx
	testl	%ecx, %ecx
	je	LBB0_7
## %bb.6:
	movl	8(%r14), %edx
	testl	%edx, %edx
	je	LBB0_7
## %bb.8:
	movq	_IPW_ORD_TABLE_ID_MASK@GOTPCREL(%rip), %rsi
	movl	(%rsi), %esi
	andl	%r15d, %esi
	cmpl	$128, %esi
	je	LBB0_20
## %bb.9:
	cmpl	$129, %esi
	je	LBB0_16
## %bb.10:
	cmpl	$130, %esi
	jne	LBB0_22
## %bb.11:
	movq	_IPW_ORD_TABLE_VALUE_MASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %r15d
	movl	12(%r14), %edx
	cmpl	%edx, %r15d
	jle	LBB0_13
## %bb.12:
	leaq	L_.str.3(%rip), %rdi
	xorl	%ebx, %ebx
	movl	%r15d, %esi
	xorl	%eax, %eax
	callq	_IPW_DEBUG_ORD
	jmp	LBB0_25
LBB0_3:
	leaq	L_.str.1(%rip), %rdi
	jmp	LBB0_24
LBB0_7:
	leaq	L_.str.2(%rip), %rdi
LBB0_23:
	xorl	%ebx, %ebx
LBB0_24:
	xorl	%eax, %eax
	callq	_IPW_DEBUG_ORD
LBB0_25:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
LBB0_26:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_20:
	movq	_IPW_ORD_TABLE_VALUE_MASK@GOTPCREL(%rip), %rax
	andl	(%rax), %r15d
	cmpl	20(%r14), %r15d
	jg	LBB0_17
## %bb.21:
	leal	(%rdx,%r15,8), %esi
	movq	%r14, %rdi
	callq	_ipw_read_reg32
	movl	8(%r14), %eax
	leal	(%rax,%r15,8), %esi
	addl	$4, %esi
	movq	%r14, %rdi
	callq	_ipw_read_reg32
	xorl	%ebx, %ebx
	jmp	LBB0_26
LBB0_16:
	movq	_IPW_ORD_TABLE_VALUE_MASK@GOTPCREL(%rip), %rax
	andl	(%rax), %r15d
	cmpl	16(%r14), %r15d
	jle	LBB0_18
LBB0_17:
	leaq	L_.str.6(%rip), %rdi
	jmp	LBB0_23
LBB0_22:
	leaq	L_.str.8(%rip), %rdi
	jmp	LBB0_23
LBB0_18:
	cmpl	$3, (%r13)
	jbe	LBB0_14
## %bb.19:
	leal	(%rcx,%r15,4), %esi
	movq	%r14, %rdi
	callq	_ipw_read_reg32
	movl	%eax, (%r12)
	movl	$4, (%r13)
	xorl	%ebx, %ebx
	jmp	LBB0_26
LBB0_13:
	cmpl	$3, (%r13)
	ja	LBB0_15
LBB0_14:
	leaq	L_.str.4(%rip), %rdi
	xorl	%ebx, %ebx
	movl	$4, %esi
	xorl	%eax, %eax
	callq	_IPW_DEBUG_ORD
	jmp	LBB0_25
LBB0_15:
	leal	(,%r15,4), %ecx
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	leal	(%rax,%r15,4), %edx
	leaq	L_.str.5(%rip), %rdi
	xorl	%ebx, %ebx
	movl	%r15d, %esi
	xorl	%eax, %eax
	callq	_IPW_DEBUG_ORD
	movl	$4, (%r13)
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	addl	(%r14), %esi
	movq	%r14, %rdi
	callq	_ipw_read32
	movl	%eax, (%r12)
	jmp	LBB0_26
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ordinal = %i\n"

L_.str.1:                               ## @.str.1
	.asciz	"Invalid argument\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.2:                               ## @.str.2
	.asciz	"Access ordinals before initialization\n"

	.comm	_IPW_ORD_TABLE_ID_MASK,4,2      ## @IPW_ORD_TABLE_ID_MASK
	.comm	_IPW_ORD_TABLE_VALUE_MASK,4,2   ## @IPW_ORD_TABLE_VALUE_MASK
L_.str.3:                               ## @.str.3
	.asciz	"ordinal value (%i) longer then max (%i)\n"

L_.str.4:                               ## @.str.4
	.asciz	"ordinal buffer length too small, need %zd\n"

L_.str.5:                               ## @.str.5
	.asciz	"Reading TABLE0[%i] from offset 0x%08x\n"

L_.str.6:                               ## @.str.6
	.asciz	"ordinal value too long\n"

L_.str.8:                               ## @.str.8
	.asciz	"Invalid ordinal!\n"

	.no_dead_strip	_ipw_get_ordinal
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ipw_get_ordinal
_ipw_get_ordinal:                       ; @ipw_get_ordinal
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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, x3
	mov	x20, x2
	mov	x22, x1
	mov	x19, x0
	str	x22, [sp]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_IPW_DEBUG_ORD
	cbz	x19, LBB0_11
; %bb.1:
	cbz	x20, LBB0_11
; %bb.2:
	cbz	x21, LBB0_11
; %bb.3:
	ldr	w8, [x19]
	cbz	w8, LBB0_12
; %bb.4:
	ldr	w9, [x19, #4]
	cbz	w9, LBB0_12
; %bb.5:
	ldr	w10, [x19, #8]
	cbz	w10, LBB0_12
; %bb.6:
Lloh2:
	adrp	x11, _IPW_ORD_TABLE_ID_MASK@GOTPAGE
Lloh3:
	ldr	x11, [x11, _IPW_ORD_TABLE_ID_MASK@GOTPAGEOFF]
Lloh4:
	ldr	w11, [x11]
	and	w11, w11, w22
	cmp	w11, #128
	b.eq	LBB0_15
; %bb.7:
	cmp	w11, #129
	b.eq	LBB0_17
; %bb.8:
	cmp	w11, #130
	b.ne	LBB0_19
; %bb.9:
Lloh5:
	adrp	x9, _IPW_ORD_TABLE_VALUE_MASK@GOTPAGE
Lloh6:
	ldr	x9, [x9, _IPW_ORD_TABLE_VALUE_MASK@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	and	w9, w9, w22
	ldr	w10, [x19, #12]
	cmp	w9, w10
	b.le	LBB0_22
; %bb.10:
	stp	x9, x10, [sp]
Lloh8:
	adrp	x0, l_.str.3@PAGE
Lloh9:
	add	x0, x0, l_.str.3@PAGEOFF
	b	LBB0_13
LBB0_11:
Lloh10:
	adrp	x0, l_.str.1@PAGE
Lloh11:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_13
LBB0_12:
Lloh12:
	adrp	x0, l_.str.2@PAGE
Lloh13:
	add	x0, x0, l_.str.2@PAGEOFF
LBB0_13:
	bl	_IPW_DEBUG_ORD
Lloh14:
	adrp	x8, _EINVAL@GOTPAGE
Lloh15:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_14:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
LBB0_15:
Lloh17:
	adrp	x8, _IPW_ORD_TABLE_VALUE_MASK@GOTPAGE
Lloh18:
	ldr	x8, [x8, _IPW_ORD_TABLE_VALUE_MASK@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	and	w8, w8, w22
	ldr	w9, [x19, #20]
	cmp	w8, w9
	b.gt	LBB0_18
; %bb.16:
	lsl	w20, w8, #3
	add	w1, w20, w10
	mov	x0, x19
	bl	_ipw_read_reg32
	ldr	w8, [x19, #8]
	add	w8, w8, w20
	add	w1, w8, #4
	mov	x0, x19
	bl	_ipw_read_reg32
	mov	w0, #0
	b	LBB0_14
LBB0_17:
Lloh20:
	adrp	x8, _IPW_ORD_TABLE_VALUE_MASK@GOTPAGE
Lloh21:
	ldr	x8, [x8, _IPW_ORD_TABLE_VALUE_MASK@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	and	w8, w8, w22
	ldr	w10, [x19, #16]
	cmp	w8, w10
	b.le	LBB0_20
LBB0_18:
Lloh23:
	adrp	x0, l_.str.6@PAGE
Lloh24:
	add	x0, x0, l_.str.6@PAGEOFF
	b	LBB0_13
LBB0_19:
Lloh25:
	adrp	x0, l_.str.8@PAGE
Lloh26:
	add	x0, x0, l_.str.8@PAGEOFF
	b	LBB0_13
LBB0_20:
	ldr	w10, [x21]
	cmp	w10, #3
	b.ls	LBB0_23
; %bb.21:
	add	w1, w9, w8, lsl #2
	mov	x0, x19
	bl	_ipw_read_reg32
	mov	x8, x0
	mov	w0, #0
	str	w8, [x20]
	mov	w8, #4
	str	w8, [x21]
	b	LBB0_14
LBB0_22:
	ldr	w10, [x21]
	cmp	w10, #3
	b.hi	LBB0_24
LBB0_23:
	mov	w8, #4
	str	x8, [sp]
Lloh27:
	adrp	x0, l_.str.4@PAGE
Lloh28:
	add	x0, x0, l_.str.4@PAGEOFF
	b	LBB0_13
LBB0_24:
	lsl	w22, w9, #2
	add	w8, w22, w8
                                        ; kill: def $w9 killed $w9 killed $x9 def $x9
	stp	x9, x8, [sp]
Lloh29:
	adrp	x0, l_.str.5@PAGE
Lloh30:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_IPW_DEBUG_ORD
	mov	w8, #4
	str	w8, [x21]
	ldr	w8, [x19]
	add	w1, w8, w22
	mov	x0, x19
	bl	_ipw_read32
	mov	x8, x0
	mov	w0, #0
	str	w8, [x20]
	b	LBB0_14
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpAdd	Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ordinal = %i\n"

l_.str.1:                               ; @.str.1
	.asciz	"Invalid argument\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.2:                               ; @.str.2
	.asciz	"Access ordinals before initialization\n"

	.comm	_IPW_ORD_TABLE_ID_MASK,4,2      ; @IPW_ORD_TABLE_ID_MASK
	.comm	_IPW_ORD_TABLE_VALUE_MASK,4,2   ; @IPW_ORD_TABLE_VALUE_MASK
l_.str.3:                               ; @.str.3
	.asciz	"ordinal value (%i) longer then max (%i)\n"

l_.str.4:                               ; @.str.4
	.asciz	"ordinal buffer length too small, need %zd\n"

l_.str.5:                               ; @.str.5
	.asciz	"Reading TABLE0[%i] from offset 0x%08x\n"

l_.str.6:                               ; @.str.6
	.asciz	"ordinal value too long\n"

l_.str.8:                               ; @.str.8
	.asciz	"Invalid ordinal!\n"

	.no_dead_strip	_ipw_get_ordinal
.subsections_via_symbols
