	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function kmx61_set_scale
_kmx61_set_scale:                       ## @kmx61_set_scale
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %r14
	movq	_kmx61_uscale_table@GOTPCREL(%rip), %r12
	movq	(%r12), %rdi
	callq	_ARRAY_SIZE
	testl	%eax, %eax
	jle	LBB0_8
## %bb.1:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r12), %rdi
	cmpq	%r15, (%rdi,%rbx,8)
	je	LBB0_3
## %bb.7:                               ##   in Loop: Header=BB0_2 Depth=1
	incq	%rbx
	callq	_ARRAY_SIZE
	cltq
	cmpq	%rax, %rbx
	jl	LBB0_2
LBB0_8:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_9:
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movq	_KMX61_ACC@GOTPCREL(%rip), %r15
	movq	_KMX61_MAG@GOTPCREL(%rip), %r12
	movl	(%r12), %edx
	orl	(%r15), %edx
	leaq	-36(%rbp), %rsi
	movq	%r14, %rdi
	callq	_kmx61_get_mode
	testl	%eax, %eax
	js	LBB0_9
## %bb.4:
	movq	_KMX61_ALL_STBY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r12), %edx
	orl	(%r15), %edx
	movq	%r14, %rdi
	movl	$1, %ecx
	callq	_kmx61_set_mode
	testl	%eax, %eax
	js	LBB0_9
## %bb.5:
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_kmx61_set_range
	testl	%eax, %eax
	js	LBB0_9
## %bb.6:
	movl	-36(%rbp), %esi
	movl	(%r12), %edx
	orl	(%r15), %edx
	movq	%r14, %rdi
	movl	$1, %ecx
	callq	_kmx61_set_mode
	jmp	LBB0_9
	.cfi_endproc
                                        ## -- End function
	.comm	_kmx61_uscale_table,8,3         ## @kmx61_uscale_table
	.comm	_KMX61_ACC,4,2                  ## @KMX61_ACC
	.comm	_KMX61_MAG,4,2                  ## @KMX61_MAG
	.comm	_KMX61_ALL_STBY,4,2             ## @KMX61_ALL_STBY
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_kmx61_set_scale
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function kmx61_set_scale
_kmx61_set_scale:                       ; @kmx61_set_scale
	.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, x1
	mov	x19, x0
Lloh0:
	adrp	x22, _kmx61_uscale_table@GOTPAGE
Lloh1:
	ldr	x22, [x22, _kmx61_uscale_table@GOTPAGEOFF]
	ldr	x0, [x22]
	bl	_ARRAY_SIZE
	cmp	w0, #1
	b.lt	LBB0_4
; %bb.1:
	mov	x20, #0
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x22]
	ldr	x8, [x0, x20, lsl #3]
	cmp	x8, x21
	b.eq	LBB0_6
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	add	x20, x20, #1
	bl	_ARRAY_SIZE
	cmp	x20, w0, sxtw
	b.lt	LBB0_2
LBB0_4:
Lloh2:
	adrp	x8, _EINVAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_5:
	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_6:
Lloh5:
	adrp	x21, _KMX61_ACC@GOTPAGE
Lloh6:
	ldr	x21, [x21, _KMX61_ACC@GOTPAGEOFF]
	ldr	w8, [x21]
Lloh7:
	adrp	x22, _KMX61_MAG@GOTPAGE
Lloh8:
	ldr	x22, [x22, _KMX61_MAG@GOTPAGEOFF]
	ldr	w9, [x22]
	orr	w2, w9, w8
	add	x1, sp, #12
	mov	x0, x19
	bl	_kmx61_get_mode
	tbnz	w0, #31, LBB0_5
; %bb.7:
Lloh9:
	adrp	x8, _KMX61_ALL_STBY@GOTPAGE
Lloh10:
	ldr	x8, [x8, _KMX61_ALL_STBY@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	ldr	w8, [x21]
	ldr	w9, [x22]
	orr	w2, w9, w8
	mov	x0, x19
	mov	w3, #1
	bl	_kmx61_set_mode
	tbnz	w0, #31, LBB0_5
; %bb.8:
	mov	x0, x19
	mov	x1, x20
	bl	_kmx61_set_range
	tbnz	w0, #31, LBB0_5
; %bb.9:
	ldr	w1, [sp, #12]
	ldr	w8, [x21]
	ldr	w9, [x22]
	orr	w2, w9, w8
	mov	x0, x19
	mov	w3, #1
	bl	_kmx61_set_mode
	b	LBB0_5
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_kmx61_uscale_table,8,3         ; @kmx61_uscale_table
	.comm	_KMX61_ACC,4,2                  ; @KMX61_ACC
	.comm	_KMX61_MAG,4,2                  ; @KMX61_MAG
	.comm	_KMX61_ALL_STBY,4,2             ; @KMX61_ALL_STBY
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_kmx61_set_scale
.subsections_via_symbols
