	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function select_max
LCPI0_0:
	.long	1                               ## 0x1
	.long	0                               ## 0x0
	.long	0                               ## 0x0
	.long	0                               ## 0x0
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_select_max:                            ## @select_max
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	_max@GOTPCREL(%rip), %r14
	movq	(%r14), %rax
	movl	(%rax), %ecx
	cmpl	$1, %ecx
	je	LBB0_11
## %bb.1:
	movq	_M@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	testl	%edx, %edx
	jle	LBB0_2
## %bb.3:
	movl	$1, %ebx
	cmpl	$1, %edx
	je	LBB0_10
## %bb.4:
	leaq	-1(%rdx), %rsi
	cmpq	$9, %rsi
	jae	LBB0_6
## %bb.5:
	movl	$1, %ebx
	movl	$1, %esi
	jmp	LBB0_9
LBB0_2:
	xorl	%ebx, %ebx
	jmp	LBB0_10
LBB0_6:
	movl	%esi, %edi
	andl	$7, %edi
	testq	%rdi, %rdi
	movl	$8, %ebx
	cmovneq	%rdi, %rbx
	movq	%rsi, %rdi
	subq	%rbx, %rdi
	negq	%rbx
	addq	%rbx, %rsi
	incq	%rsi
	movd	%ecx, %xmm0
	pshufd	$0, %xmm0, %xmm2                ## xmm2 = xmm0[0,0,0,0]
	pxor	%xmm0, %xmm0
	movdqa	LCPI0_0(%rip), %xmm1            ## xmm1 = [1,0,0,0]
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movups	8(%rax,%rbx,8), %xmm3
	movups	24(%rax,%rbx,8), %xmm4
	shufps	$136, %xmm4, %xmm3              ## xmm3 = xmm3[0,2],xmm4[0,2]
	movups	40(%rax,%rbx,8), %xmm4
	movups	56(%rax,%rbx,8), %xmm5
	shufps	$136, %xmm5, %xmm4              ## xmm4 = xmm4[0,2],xmm5[0,2]
	pcmpeqd	%xmm2, %xmm3
	psubd	%xmm3, %xmm1
	pcmpeqd	%xmm2, %xmm4
	psubd	%xmm4, %xmm0
	addq	$8, %rbx
	cmpq	%rbx, %rdi
	jne	LBB0_7
## %bb.8:
	paddd	%xmm1, %xmm0
	pshufd	$238, %xmm0, %xmm1              ## xmm1 = xmm0[2,3,2,3]
	paddd	%xmm0, %xmm1
	pshufd	$85, %xmm1, %xmm0               ## xmm0 = xmm1[1,1,1,1]
	paddd	%xmm1, %xmm0
	movd	%xmm0, %ebx
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	xorl	%edi, %edi
	cmpl	(%rax,%rsi,8), %ecx
	sete	%dil
	addl	%edi, %ebx
	incq	%rsi
	cmpq	%rsi, %rdx
	jne	LBB0_9
LBB0_10:
	xorl	%eax, %eax
	callq	_random
	cltd
	idivl	%ebx
	movq	(%r14), %rax
	movslq	%edx, %rcx
	movl	4(%rax,%rcx,8), %esi
	movq	_active_pos@GOTPCREL(%rip), %rdx
	movl	%esi, (%rdx)
	movl	(%rax,%rcx,8), %edx
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_printf                         ## TAILCALL
LBB0_11:
	leaq	L_str(%rip), %rdi
	callq	_puts
	movl	$1, %edi
	callq	_exit
	.cfi_endproc
                                        ## -- End function
	.comm	_max,8,3                        ## @max
	.comm	_M,4,2                          ## @M
	.comm	_active_pos,4,2                 ## @active_pos
	.section	__TEXT,__cstring,cstring_literals
L_.str.1:                               ## @.str.1
	.asciz	"0x%03X (%d) "

L_str:                                  ## @str
	.asciz	"no solution!"

	.no_dead_strip	_select_max
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ; -- Begin function select_max
lCPI0_0:
	.long	1                               ; 0x1
	.long	0                               ; 0x0
	.long	0                               ; 0x0
	.long	0                               ; 0x0
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_select_max:                            ; @select_max
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
Lloh0:
	adrp	x19, _max@GOTPAGE
Lloh1:
	ldr	x19, [x19, _max@GOTPAGEOFF]
	ldr	x9, [x19]
	ldr	w8, [x9]
	cmp	w8, #1
	b.eq	LBB0_13
; %bb.1:
Lloh2:
	adrp	x10, _M@GOTPAGE
Lloh3:
	ldr	x10, [x10, _M@GOTPAGEOFF]
Lloh4:
	ldr	w10, [x10]
	cmp	w10, #1
	b.lt	LBB0_4
; %bb.2:
	cmp	w10, #1
	b.ne	LBB0_5
; %bb.3:
	mov	w20, #1
	b	LBB0_12
LBB0_4:
	mov	w20, #0
	b	LBB0_12
LBB0_5:
	sub	x11, x10, #1
	cmp	x11, #17
	b.hs	LBB0_7
; %bb.6:
	mov	w11, #1
	mov	w20, #1
	b	LBB0_10
LBB0_7:
	ands	x12, x11, #0xf
	mov	w13, #16
	csel	x12, x13, x12, eq
	sub	x12, x11, x12
	add	x11, x12, #1
	dup.4s	v0, w8
Lloh5:
	adrp	x13, lCPI0_0@PAGE
Lloh6:
	ldr	q1, [x13, lCPI0_0@PAGEOFF]
	add	x13, x9, #72
	movi.2d	v2, #0000000000000000
	movi.2d	v3, #0000000000000000
	movi.2d	v4, #0000000000000000
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	sub	x14, x13, #64
	ld2.4s	{ v5, v6 }, [x14]
	sub	x14, x13, #32
	ld2.4s	{ v16, v17 }, [x14]
	mov	x14, x13
	ld2.4s	{ v18, v19 }, [x14], #32
	ld2.4s	{ v20, v21 }, [x14]
	cmeq.4s	v5, v0, v5
	cmeq.4s	v6, v0, v16
	cmeq.4s	v7, v0, v18
	cmeq.4s	v16, v0, v20
	sub.4s	v1, v1, v5
	sub.4s	v2, v2, v6
	sub.4s	v3, v3, v7
	sub.4s	v4, v4, v16
	add	x13, x13, #128
	subs	x12, x12, #16
	b.ne	LBB0_8
; %bb.9:
	add.4s	v0, v2, v1
	add.4s	v0, v3, v0
	add.4s	v0, v4, v0
	addv.4s	s0, v0
	fmov	w20, s0
LBB0_10:
	sub	x10, x10, x11
	add	x9, x9, x11, lsl #3
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	ldr	w11, [x9], #8
	cmp	w8, w11
	cinc	w20, w20, eq
	subs	x10, x10, #1
	b.ne	LBB0_11
LBB0_12:
	bl	_random
	sdiv	w8, w0, w20
	msub	w8, w8, w20, w0
	ldr	x9, [x19]
	add	x8, x9, w8, sxtw #3
	ldr	w9, [x8, #4]
Lloh7:
	adrp	x10, _active_pos@GOTPAGE
Lloh8:
	ldr	x10, [x10, _active_pos@GOTPAGEOFF]
Lloh9:
	str	w9, [x10]
	ldr	w8, [x8]
	stp	x9, x8, [sp]
Lloh10:
	adrp	x0, l_.str.1@PAGE
Lloh11:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_printf
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
LBB0_13:
Lloh12:
	adrp	x0, l_str@PAGE
Lloh13:
	add	x0, x0, l_str@PAGEOFF
	bl	_puts
	mov	w0, #1
	bl	_exit
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdr	Lloh5, Lloh6
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotStr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_max,8,3                        ; @max
	.comm	_M,4,2                          ; @M
	.comm	_active_pos,4,2                 ; @active_pos
	.section	__TEXT,__cstring,cstring_literals
l_.str.1:                               ; @.str.1
	.asciz	"0x%03X (%d) "

l_str:                                  ; @str
	.asciz	"no solution!"

	.no_dead_strip	_select_max
.subsections_via_symbols
