	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ## -- Begin function DiscreteKnapsack
LCPI0_0:
	.quad	0x3ff0000000000000              ## double 1
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_DiscreteKnapsack
	.p2align	4, 0x90
_DiscreteKnapsack:                      ## @DiscreteKnapsack
	.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	$104, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, -120(%rbp)                ## 8-byte Spill
	movq	%rdx, %rbx
	movl	%esi, %r12d
	movl	%edi, %r13d
	movq	_CurrentMemoryContext@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_ALLOCSET_SMALL_SIZES@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	L_.str(%rip), %rsi
	callq	_AllocSetContextCreate
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	%eax, %edi
	callq	_MemoryContextSwitchTo
	movl	%eax, -64(%rbp)                 ## 4-byte Spill
	movl	%r13d, %edi
	notl	%edi
	shrl	$31, %edi
	callq	_Assert
	testl	%r12d, %r12d
	setg	%al
	movq	%rbx, -112(%rbp)                ## 8-byte Spill
	testq	%rbx, %rbx
	setne	%cl
	andb	%al, %cl
	movzbl	%cl, %edi
	callq	_Assert
	leal	8(,%r13,8), %r14d
	movl	%r14d, %edi
	callq	_palloc
	movq	%rax, %r15
	movl	%r14d, %edi
	callq	_palloc
	movq	%r13, -56(%rbp)                 ## 8-byte Spill
	testl	%r13d, %r13d
	movq	%rax, %r13
	js	LBB0_3
## %bb.1:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	leal	1(%rax), %r14d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	$0, (%r15,%rbx,8)
	movl	%r12d, %edi
	callq	_bms_make_singleton
	movq	%rax, (%r13,%rbx,8)
	incq	%rbx
	cmpq	%rbx, %r14
	jne	LBB0_2
LBB0_3:
	testl	%r12d, %r12d
	jle	LBB0_4
## %bb.5:
	movslq	-56(%rbp), %rcx                 ## 4-byte Folded Reload
	movl	%r12d, -60(%rbp)                ## 4-byte Spill
	movl	%r12d, %eax
	movq	%rax, -104(%rbp)                ## 8-byte Spill
	movq	%r13, -80(%rbp)                 ## 8-byte Spill
	leaq	(%r13,%rcx,8), %rax
	movq	%rax, -96(%rbp)                 ## 8-byte Spill
	leaq	(%r15,%rcx,8), %rax
	movq	%rax, -88(%rbp)                 ## 8-byte Spill
	xorl	%edx, %edx
	movq	%rcx, -128(%rbp)                ## 8-byte Spill
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_15:                                ##   in Loop: Header=BB0_6 Depth=1
	movq	-72(%rbp), %rdx                 ## 8-byte Reload
	incq	%rdx
	cmpq	-104(%rbp), %rdx                ## 8-byte Folded Reload
	je	LBB0_16
LBB0_6:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_10 Depth 2
	movsd	LCPI0_0(%rip), %xmm1            ## xmm1 = mem[0],zero
	movq	-120(%rbp), %rax                ## 8-byte Reload
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	movsd	(%rax,%rdx,8), %xmm1            ## xmm1 = mem[0],zero
LBB0_8:                                 ##   in Loop: Header=BB0_6 Depth=1
	movq	-112(%rbp), %rax                ## 8-byte Reload
	movq	%rdx, -72(%rbp)                 ## 8-byte Spill
	movslq	(%rax,%rdx,4), %rbx
	cmpl	-56(%rbp), %ebx                 ## 4-byte Folded Reload
	jg	LBB0_15
## %bb.9:                               ##   in Loop: Header=BB0_6 Depth=1
	leaq	(,%rbx,8), %r15
	negq	%r15
	movl	$1, %r14d
	movq	-88(%rbp), %r13                 ## 8-byte Reload
	movq	-96(%rbp), %r12                 ## 8-byte Reload
	movsd	%xmm1, -136(%rbp)               ## 8-byte Spill
	jmp	LBB0_10
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_10 Depth=2
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_bms_add_member
	movq	%rax, (%r12)
	movsd	(%r13,%r15), %xmm0              ## xmm0 = mem[0],zero
	movsd	-136(%rbp), %xmm1               ## 8-byte Reload
                                        ## xmm1 = mem[0],zero
	addsd	%xmm1, %xmm0
	movsd	%xmm0, (%r13)
	movq	-128(%rbp), %rcx                ## 8-byte Reload
LBB0_14:                                ##   in Loop: Header=BB0_10 Depth=2
	addq	$-8, %r12
	leaq	(%rcx,%r14), %rax
	decq	%rax
	decq	%r14
	addq	$-8, %r13
	cmpq	%rbx, %rax
	jle	LBB0_15
LBB0_10:                                ##   Parent Loop BB0_6 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movsd	(%r13,%r15), %xmm0              ## xmm0 = mem[0],zero
	addsd	%xmm1, %xmm0
	ucomisd	(%r13), %xmm0
	jb	LBB0_14
## %bb.11:                              ##   in Loop: Header=BB0_10 Depth=2
	movq	(%r12), %rdi
	testl	%ebx, %ebx
	je	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_10 Depth=2
	movq	%rdi, %rsi
	callq	_bms_del_members
	movq	%rax, (%r12)
	movq	(%r12,%r15), %rsi
	movq	%rax, %rdi
	callq	_bms_add_members
	movq	%rax, %rdi
	movq	%rax, (%r12)
	jmp	LBB0_13
LBB0_16:
	movl	-60(%rbp), %r12d                ## 4-byte Reload
	movl	-44(%rbp), %r14d                ## 4-byte Reload
	movq	-80(%rbp), %r13                 ## 8-byte Reload
	movq	%rcx, %rbx
	jmp	LBB0_17
LBB0_4:
	movslq	-56(%rbp), %rbx                 ## 4-byte Folded Reload
	movl	-44(%rbp), %r14d                ## 4-byte Reload
LBB0_17:
	movl	-64(%rbp), %edi                 ## 4-byte Reload
	callq	_MemoryContextSwitchTo
	movq	(%r13,%rbx,8), %rdi
	callq	_bms_copy
	movl	%eax, %edi
	movl	%r12d, %esi
	callq	_bms_del_member
	movq	%rax, %rbx
	movl	%r14d, %edi
	callq	_MemoryContextDelete
	movq	%rbx, %rax
	addq	$104, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CurrentMemoryContext,4,2       ## @CurrentMemoryContext
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Knapsack"

	.comm	_ALLOCSET_SMALL_SIZES,4,2       ## @ALLOCSET_SMALL_SIZES
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_DiscreteKnapsack               ; -- Begin function DiscreteKnapsack
	.p2align	2
_DiscreteKnapsack:                      ; @DiscreteKnapsack
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #176
	.cfi_def_cfa_offset 176
	stp	d9, d8, [sp, #64]               ; 16-byte Folded Spill
	stp	x28, x27, [sp, #80]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #96]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #112]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #128]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #144]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #160]            ; 16-byte Folded Spill
	add	x29, sp, #160
	.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
	.cfi_offset b8, -104
	.cfi_offset b9, -112
	mov	x21, x3
	mov	x20, x2
	mov	x28, x1
	mov	x22, x0
Lloh0:
	adrp	x8, _CurrentMemoryContext@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CurrentMemoryContext@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
Lloh3:
	adrp	x8, _ALLOCSET_SMALL_SIZES@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ALLOCSET_SMALL_SIZES@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	bl	_AllocSetContextCreate
	mov	x26, x0
	bl	_MemoryContextSwitchTo
	mov	x19, x0
	mvn	w8, w22
	lsr	w0, w8, #31
	bl	_Assert
	cmp	w28, #0
	str	x20, [sp, #56]                  ; 8-byte Folded Spill
	ccmp	x20, #0, #4, gt
	cset	w0, ne
	bl	_Assert
	lsl	w8, w22, #3
	add	w25, w8, #8
	mov	x0, x25
	bl	_palloc
	mov	x27, x0
	mov	x0, x25
	bl	_palloc
	str	x0, [sp, #24]                   ; 8-byte Folded Spill
	tbnz	w22, #31, LBB0_3
; %bb.1:
	add	w20, w22, #1
	mov	x23, x27
	ldr	x24, [sp, #24]                  ; 8-byte Folded Reload
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	str	xzr, [x23], #8
	mov	x0, x28
	bl	_bms_make_singleton
	str	x0, [x24], #8
	subs	x20, x20, #1
	b.ne	LBB0_2
LBB0_3:
	cmp	w28, #0
	b.le	LBB0_17
; %bb.4:
	stp	w19, w26, [sp, #16]             ; 8-byte Folded Spill
	mov	x26, #0
	mov	x8, x22
	sxtw	x10, w8
	mov	w24, w28
	sbfiz	x8, x8, #3, #32
	ldr	x9, [sp, #24]                   ; 8-byte Folded Reload
	add	x9, x9, x8
	str	x9, [sp, #48]                   ; 8-byte Folded Spill
	str	x10, [sp, #8]                   ; 8-byte Folded Spill
	add	x9, x10, #1
	add	x8, x27, x8
	stp	x8, x9, [sp, #32]               ; 16-byte Folded Spill
	mov	x19, x28
	b	LBB0_6
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	add	x26, x26, #1
	cmp	x26, x24
	b.eq	LBB0_16
LBB0_6:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_13 Depth 2
	cbz	x21, LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	d8, [x21, x26, lsl #3]
	b	LBB0_9
LBB0_8:                                 ;   in Loop: Header=BB0_6 Depth=1
	fmov	d8, #1.00000000
LBB0_9:                                 ;   in Loop: Header=BB0_6 Depth=1
	ldr	x8, [sp, #56]                   ; 8-byte Folded Reload
	ldrsw	x28, [x8, x26, lsl #2]
	cmp	w28, w22
	b.gt	LBB0_5
; %bb.10:                               ;   in Loop: Header=BB0_6 Depth=1
	ldp	x27, x25, [sp, #32]             ; 16-byte Folded Reload
	ldr	x20, [sp, #48]                  ; 8-byte Folded Reload
	neg	x23, x28, lsl #3
	b	LBB0_13
LBB0_11:                                ;   in Loop: Header=BB0_13 Depth=2
	mov	x1, x26
	bl	_bms_add_member
	str	x0, [x20]
	ldr	d0, [x27, x23]
	fadd	d0, d8, d0
	str	d0, [x27]
LBB0_12:                                ;   in Loop: Header=BB0_13 Depth=2
	sub	x20, x20, #8
	sub	x25, x25, #1
	sub	x27, x27, #8
	cmp	x25, x28
	b.le	LBB0_5
LBB0_13:                                ;   Parent Loop BB0_6 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	d0, [x27]
	ldr	d1, [x27, x23]
	fadd	d1, d8, d1
	fcmp	d0, d1
	b.hi	LBB0_12
; %bb.14:                               ;   in Loop: Header=BB0_13 Depth=2
	ldr	x0, [x20]
	cbz	w28, LBB0_11
; %bb.15:                               ;   in Loop: Header=BB0_13 Depth=2
	mov	x1, x0
	bl	_bms_del_members
	str	x0, [x20]
	ldr	x1, [x20, x23]
	bl	_bms_add_members
	str	x0, [x20]
	b	LBB0_11
LBB0_16:
	mov	x28, x19
	ldp	w19, w26, [sp, #16]             ; 8-byte Folded Reload
	ldr	x20, [sp, #8]                   ; 8-byte Folded Reload
	b	LBB0_18
LBB0_17:
	sxtw	x20, w22
LBB0_18:
	mov	x0, x19
	bl	_MemoryContextSwitchTo
	ldr	x8, [sp, #24]                   ; 8-byte Folded Reload
	ldr	x0, [x8, x20, lsl #3]
	bl	_bms_copy
	mov	x1, x28
	bl	_bms_del_member
	mov	x19, x0
	mov	x0, x26
	bl	_MemoryContextDelete
	mov	x0, x19
	ldp	x29, x30, [sp, #160]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #144]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #128]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #112]            ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #96]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #80]             ; 16-byte Folded Reload
	ldp	d9, d8, [sp, #64]               ; 16-byte Folded Reload
	add	sp, sp, #176
	ret
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_CurrentMemoryContext,4,2       ; @CurrentMemoryContext
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Knapsack"

	.comm	_ALLOCSET_SMALL_SIZES,4,2       ; @ALLOCSET_SMALL_SIZES
.subsections_via_symbols
