Program: knapsack

x86 assembly:
	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_max                            ## -- Begin function max
	.p2align	4, 0x90
_max:                                   ## @max
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	movl	%edi, -8(%rbp)
	movl	%esi, -12(%rbp)
	movl	-8(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jle	LBB0_2
## %bb.1:
	movl	-8(%rbp), %eax
	movl	%eax, -4(%rbp)
	jmp	LBB0_3
LBB0_2:
	movl	-12(%rbp), %eax
	movl	%eax, -4(%rbp)
LBB0_3:
	movl	-4(%rbp), %eax
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.globl	_knapSack                       ## -- Begin function knapSack
	.p2align	4, 0x90
_knapSack:                              ## @knapSack
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	subq	$32, %rsp
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	%rdx, -24(%rbp)
	movl	$0, -28(%rbp)
LBB1_1:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB1_3 Depth 2
	cmpl	$50, -28(%rbp)
	jg	LBB1_15
## %bb.2:                               ##   in Loop: Header=BB1_1 Depth=1
	movl	$0, -32(%rbp)
LBB1_3:                                 ##   Parent Loop BB1_1 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	cmpl	$250, -32(%rbp)
	jg	LBB1_13
## %bb.4:                               ##   in Loop: Header=BB1_3 Depth=2
	cmpl	$0, -28(%rbp)
	je	LBB1_6
## %bb.5:                               ##   in Loop: Header=BB1_3 Depth=2
	cmpl	$0, -32(%rbp)
	jne	LBB1_7
LBB1_6:                                 ##   in Loop: Header=BB1_3 Depth=2
	movq	-24(%rbp), %rax
	movslq	-28(%rbp), %rcx
	imulq	$1004, %rcx, %rcx               ## imm = 0x3EC
	addq	%rcx, %rax
	movslq	-32(%rbp), %rcx
	movl	$0, (%rax,%rcx,4)
	jmp	LBB1_11
LBB1_7:                                 ##   in Loop: Header=BB1_3 Depth=2
	movq	-8(%rbp), %rax
	movl	-28(%rbp), %ecx
	subl	$1, %ecx
	movslq	%ecx, %rcx
	movl	(%rax,%rcx,4), %eax
	cmpl	-32(%rbp), %eax
	jg	LBB1_9
## %bb.8:                               ##   in Loop: Header=BB1_3 Depth=2
	movq	-16(%rbp), %rax
	movl	-28(%rbp), %ecx
	subl	$1, %ecx
	movslq	%ecx, %rcx
	movl	(%rax,%rcx,4), %edi
	movq	-24(%rbp), %rax
	movl	-28(%rbp), %ecx
	subl	$1, %ecx
	movslq	%ecx, %rcx
	imulq	$1004, %rcx, %rcx               ## imm = 0x3EC
	addq	%rcx, %rax
	movl	-32(%rbp), %ecx
	movq	-8(%rbp), %rdx
	movl	-28(%rbp), %esi
	subl	$1, %esi
	movslq	%esi, %rsi
	subl	(%rdx,%rsi,4), %ecx
	movslq	%ecx, %rcx
	addl	(%rax,%rcx,4), %edi
	movq	-24(%rbp), %rax
	movl	-28(%rbp), %ecx
	subl	$1, %ecx
	movslq	%ecx, %rcx
	imulq	$1004, %rcx, %rcx               ## imm = 0x3EC
	addq	%rcx, %rax
	movslq	-32(%rbp), %rcx
	movl	(%rax,%rcx,4), %esi
	callq	_max
	movl	%eax, %edx
	movq	-24(%rbp), %rax
	movslq	-28(%rbp), %rcx
	imulq	$1004, %rcx, %rcx               ## imm = 0x3EC
	addq	%rcx, %rax
	movslq	-32(%rbp), %rcx
	movl	%edx, (%rax,%rcx,4)
	jmp	LBB1_10
LBB1_9:                                 ##   in Loop: Header=BB1_3 Depth=2
	movq	-24(%rbp), %rax
	movl	-28(%rbp), %ecx
	subl	$1, %ecx
	movslq	%ecx, %rcx
	imulq	$1004, %rcx, %rcx               ## imm = 0x3EC
	addq	%rcx, %rax
	movslq	-32(%rbp), %rcx
	movl	(%rax,%rcx,4), %edx
	movq	-24(%rbp), %rax
	movslq	-28(%rbp), %rcx
	imulq	$1004, %rcx, %rcx               ## imm = 0x3EC
	addq	%rcx, %rax
	movslq	-32(%rbp), %rcx
	movl	%edx, (%rax,%rcx,4)
LBB1_10:                                ##   in Loop: Header=BB1_3 Depth=2
	jmp	LBB1_11
LBB1_11:                                ##   in Loop: Header=BB1_3 Depth=2
	jmp	LBB1_12
LBB1_12:                                ##   in Loop: Header=BB1_3 Depth=2
	movl	-32(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -32(%rbp)
	jmp	LBB1_3
LBB1_13:                                ##   in Loop: Header=BB1_1 Depth=1
	jmp	LBB1_14
LBB1_14:                                ##   in Loop: Header=BB1_1 Depth=1
	movl	-28(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -28(%rbp)
	jmp	LBB1_1
LBB1_15:
	addq	$32, %rsp
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.globl	_main                           ## -- Begin function main
	.p2align	4, 0x90
_main:                                  ## @main
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	movl	$51232, %eax                    ## imm = 0xC820
	callq	____chkstk_darwin
	subq	%rax, %rsp
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -8(%rbp)
	movl	$0, -51220(%rbp)
	movl	$50, -51224(%rbp)
	movl	$250, -51228(%rbp)
	leaq	-51216(%rbp), %rdx
	leaq	_wt(%rip), %rdi
	leaq	_val(%rip), %rsi
	callq	_knapSack
	movslq	-51224(%rbp), %rcx
	leaq	-51216(%rbp), %rax
	imulq	$1004, %rcx, %rcx               ## imm = 0x3EC
	addq	%rcx, %rax
	movl	1000(%rax), %esi
	leaq	L_.str(%rip), %rdi
	movb	$0, %al
	callq	_libmin_printf
	leaq	L_.str.1(%rip), %rdi
	movb	$0, %al
	callq	_libmin_printf
LBB2_1:                                 ## =>This Inner Loop Header: Depth=1
	cmpl	$0, -51224(%rbp)
	je	LBB2_5
## %bb.2:                               ##   in Loop: Header=BB2_1 Depth=1
	movslq	-51224(%rbp), %rcx
	leaq	-51216(%rbp), %rax
	imulq	$1004, %rcx, %rcx               ## imm = 0x3EC
	addq	%rcx, %rax
	movslq	-51228(%rbp), %rcx
	movl	(%rax,%rcx,4), %eax
	movl	-51224(%rbp), %ecx
	subl	$1, %ecx
	movslq	%ecx, %rdx
	leaq	-51216(%rbp), %rcx
	imulq	$1004, %rdx, %rdx               ## imm = 0x3EC
	addq	%rdx, %rcx
	movslq	-51228(%rbp), %rdx
	cmpl	(%rcx,%rdx,4), %eax
	je	LBB2_4
## %bb.3:                               ##   in Loop: Header=BB2_1 Depth=1
	movl	-51224(%rbp), %esi
	movl	-51224(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rcx
	leaq	_wt(%rip), %rax
	movl	(%rax,%rcx,4), %edx
	movl	-51224(%rbp), %eax
	subl	$1, %eax
	movslq	%eax, %rcx
	leaq	_val(%rip), %rax
	movl	(%rax,%rcx,4), %ecx
	leaq	L_.str.2(%rip), %rdi
	movb	$0, %al
	callq	_libmin_printf
	movl	-51228(%rbp), %eax
	movl	-51224(%rbp), %ecx
	subl	$1, %ecx
	movslq	%ecx, %rdx
	leaq	_wt(%rip), %rcx
	subl	(%rcx,%rdx,4), %eax
	movl	%eax, -51228(%rbp)
LBB2_4:                                 ##   in Loop: Header=BB2_1 Depth=1
	movl	-51224(%rbp), %eax
	addl	$-1, %eax
	movl	%eax, -51224(%rbp)
	jmp	LBB2_1
LBB2_5:
	movl	$250, %esi
	subl	-51228(%rbp), %esi
	leaq	L_.str.3(%rip), %rdi
	movb	$0, %al
	callq	_libmin_printf
	callq	_libmin_success
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	-8(%rbp), %rcx
	cmpq	%rcx, %rax
	jne	LBB2_7
## %bb.6:
	xorl	%eax, %eax
	addq	$51232, %rsp                    ## imm = 0xC820
	popq	%rbp
	retq
LBB2_7:
	callq	___stack_chk_fail
	ud2
	.cfi_endproc
                                        ## -- End function
	.section	__DATA,__data
	.globl	_val                            ## @val
	.p2align	4
_val:
	.long	27                              ## 0x1b
	.long	34                              ## 0x22
	.long	9                               ## 0x9
	.long	22                              ## 0x16
	.long	8                               ## 0x8
	.long	17                              ## 0x11
	.long	22                              ## 0x16
	.long	21                              ## 0x15
	.long	23                              ## 0x17
	.long	19                              ## 0x13
	.long	7                               ## 0x7
	.long	36                              ## 0x24
	.long	11                              ## 0xb
	.long	42                              ## 0x2a
	.long	37                              ## 0x25
	.long	16                              ## 0x10
	.long	10                              ## 0xa
	.long	26                              ## 0x1a
	.long	10                              ## 0xa
	.long	50                              ## 0x32
	.long	23                              ## 0x17
	.long	46                              ## 0x2e
	.long	37                              ## 0x25
	.long	3                               ## 0x3
	.long	14                              ## 0xe
	.long	16                              ## 0x10
	.long	35                              ## 0x23
	.long	14                              ## 0xe
	.long	15                              ## 0xf
	.long	44                              ## 0x2c
	.long	49                              ## 0x31
	.long	2                               ## 0x2
	.long	45                              ## 0x2d
	.long	3                               ## 0x3
	.long	15                              ## 0xf
	.long	1                               ## 0x1
	.long	34                              ## 0x22
	.long	44                              ## 0x2c
	.long	19                              ## 0x13
	.long	25                              ## 0x19
	.long	43                              ## 0x2b
	.long	28                              ## 0x1c
	.long	26                              ## 0x1a
	.long	4                               ## 0x4
	.long	30                              ## 0x1e
	.long	24                              ## 0x18
	.long	49                              ## 0x31
	.long	11                              ## 0xb
	.long	48                              ## 0x30
	.long	13                              ## 0xd

	.globl	_wt                             ## @wt
	.p2align	4
_wt:
	.long	23                              ## 0x17
	.long	47                              ## 0x2f
	.long	22                              ## 0x16
	.long	15                              ## 0xf
	.long	42                              ## 0x2a
	.long	30                              ## 0x1e
	.long	15                              ## 0xf
	.long	32                              ## 0x20
	.long	47                              ## 0x2f
	.long	33                              ## 0x21
	.long	15                              ## 0xf
	.long	38                              ## 0x26
	.long	44                              ## 0x2c
	.long	7                               ## 0x7
	.long	16                              ## 0x10
	.long	34                              ## 0x22
	.long	30                              ## 0x1e
	.long	33                              ## 0x21
	.long	3                               ## 0x3
	.long	2                               ## 0x2
	.long	43                              ## 0x2b
	.long	31                              ## 0x1f
	.long	46                              ## 0x2e
	.long	17                              ## 0x11
	.long	30                              ## 0x1e
	.long	1                               ## 0x1
	.long	34                              ## 0x22
	.long	21                              ## 0x15
	.long	30                              ## 0x1e
	.long	21                              ## 0x15
	.long	29                              ## 0x1d
	.long	21                              ## 0x15
	.long	36                              ## 0x24
	.long	14                              ## 0xe
	.long	18                              ## 0x12
	.long	21                              ## 0x15
	.long	13                              ## 0xd
	.long	3                               ## 0x3
	.long	27                              ## 0x1b
	.long	44                              ## 0x2c
	.long	33                              ## 0x21
	.long	11                              ## 0xb
	.long	9                               ## 0x9
	.long	31                              ## 0x1f
	.long	40                              ## 0x28
	.long	40                              ## 0x28
	.long	30                              ## 0x1e
	.long	9                               ## 0x9
	.long	41                              ## 0x29
	.long	31                              ## 0x1f

	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Max value: %d\n"

L_.str.1:                               ## @.str.1
	.asciz	"Selected packs:\n"

L_.str.2:                               ## @.str.2
	.asciz	"  Package %d with wt=%d and val=%d\n"

L_.str.3:                               ## @.str.3
	.asciz	"Total weight: %d\n"

.subsections_via_symbols


ARM64 assembly:
	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_max                            ; -- Begin function max
	.p2align	2
_max:                                   ; @max
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #16
	.cfi_def_cfa_offset 16
	str	w0, [sp, #8]
	str	w1, [sp, #4]
	ldr	w8, [sp, #8]
	ldr	w9, [sp, #4]
	subs	w8, w8, w9
	cset	w8, le
	tbnz	w8, #0, LBB0_2
	b	LBB0_1
LBB0_1:
	ldr	w8, [sp, #8]
	str	w8, [sp, #12]
	b	LBB0_3
LBB0_2:
	ldr	w8, [sp, #4]
	str	w8, [sp, #12]
	b	LBB0_3
LBB0_3:
	ldr	w0, [sp, #12]
	add	sp, sp, #16
	ret
	.cfi_endproc
                                        ; -- End function
	.globl	_knapSack                       ; -- Begin function knapSack
	.p2align	2
_knapSack:                              ; @knapSack
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	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
	stur	x0, [x29, #-8]
	stur	x1, [x29, #-16]
	str	x2, [sp, #24]
	str	wzr, [sp, #20]
	b	LBB1_1
LBB1_1:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB1_3 Depth 2
	ldr	w8, [sp, #20]
	subs	w8, w8, #50
	cset	w8, gt
	tbnz	w8, #0, LBB1_15
	b	LBB1_2
LBB1_2:                                 ;   in Loop: Header=BB1_1 Depth=1
	str	wzr, [sp, #16]
	b	LBB1_3
LBB1_3:                                 ;   Parent Loop BB1_1 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w8, [sp, #16]
	subs	w8, w8, #250
	cset	w8, gt
	tbnz	w8, #0, LBB1_13
	b	LBB1_4
LBB1_4:                                 ;   in Loop: Header=BB1_3 Depth=2
	ldr	w8, [sp, #20]
	subs	w8, w8, #0
	cset	w8, eq
	tbnz	w8, #0, LBB1_6
	b	LBB1_5
LBB1_5:                                 ;   in Loop: Header=BB1_3 Depth=2
	ldr	w8, [sp, #16]
	subs	w8, w8, #0
	cset	w8, ne
	tbnz	w8, #0, LBB1_7
	b	LBB1_6
LBB1_6:                                 ;   in Loop: Header=BB1_3 Depth=2
	ldr	x8, [sp, #24]
	ldrsw	x9, [sp, #20]
	mov	x10, #1004
	mul	x9, x9, x10
	add	x9, x8, x9
	ldrsw	x10, [sp, #16]
	mov	w8, #0
	str	w8, [x9, x10, lsl #2]
	b	LBB1_11
LBB1_7:                                 ;   in Loop: Header=BB1_3 Depth=2
	ldur	x8, [x29, #-8]
	ldr	w9, [sp, #20]
	subs	w9, w9, #1
	ldr	w8, [x8, w9, sxtw #2]
	ldr	w9, [sp, #16]
	subs	w8, w8, w9
	cset	w8, gt
	tbnz	w8, #0, LBB1_9
	b	LBB1_8
LBB1_8:                                 ;   in Loop: Header=BB1_3 Depth=2
	ldur	x8, [x29, #-16]
	ldr	w9, [sp, #20]
	subs	w9, w9, #1
	ldr	w8, [x8, w9, sxtw #2]
	ldr	x11, [sp, #24]
	ldr	w9, [sp, #20]
	subs	w9, w9, #1
	mov	x10, #1004
	str	x10, [sp, #8]                   ; 8-byte Folded Spill
	mov	w10, #1004
	smaddl	x9, w9, w10, x11
	ldr	w10, [sp, #16]
	ldur	x11, [x29, #-8]
	ldr	w12, [sp, #20]
	subs	w12, w12, #1
	ldr	w11, [x11, w12, sxtw #2]
	subs	w10, w10, w11
	ldr	w9, [x9, w10, sxtw #2]
	add	w0, w8, w9
	ldr	x10, [sp, #24]
	ldr	w8, [sp, #20]
	subs	w8, w8, #1
	mov	w9, #1004
	smaddl	x8, w8, w9, x10
	ldrsw	x9, [sp, #16]
	ldr	w1, [x8, x9, lsl #2]
	bl	_max
	ldr	x10, [sp, #8]                   ; 8-byte Folded Reload
	ldr	x8, [sp, #24]
	ldrsw	x9, [sp, #20]
	mul	x9, x9, x10
	add	x8, x8, x9
	ldrsw	x9, [sp, #16]
	str	w0, [x8, x9, lsl #2]
	b	LBB1_10
LBB1_9:                                 ;   in Loop: Header=BB1_3 Depth=2
	ldr	x10, [sp, #24]
	ldr	w8, [sp, #20]
	subs	w8, w8, #1
	mov	x11, #1004
	mov	w9, #1004
	smaddl	x8, w8, w9, x10
	ldrsw	x9, [sp, #16]
	ldr	w8, [x8, x9, lsl #2]
	ldr	x9, [sp, #24]
	ldrsw	x10, [sp, #20]
	mul	x10, x10, x11
	add	x9, x9, x10
	ldrsw	x10, [sp, #16]
	str	w8, [x9, x10, lsl #2]
	b	LBB1_10
LBB1_10:                                ;   in Loop: Header=BB1_3 Depth=2
	b	LBB1_11
LBB1_11:                                ;   in Loop: Header=BB1_3 Depth=2
	b	LBB1_12
LBB1_12:                                ;   in Loop: Header=BB1_3 Depth=2
	ldr	w8, [sp, #16]
	add	w8, w8, #1
	str	w8, [sp, #16]
	b	LBB1_3
LBB1_13:                                ;   in Loop: Header=BB1_1 Depth=1
	b	LBB1_14
LBB1_14:                                ;   in Loop: Header=BB1_1 Depth=1
	ldr	w8, [sp, #20]
	add	w8, w8, #1
	str	w8, [sp, #20]
	b	LBB1_1
LBB1_15:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.cfi_endproc
                                        ; -- End function
	.globl	_main                           ; -- Begin function main
	.p2align	2
_main:                                  ; @main
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w27, -24
	.cfi_offset w28, -32
	mov	w9, #51264
	adrp	x16, ___chkstk_darwin@GOTPAGE
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	sub	sp, sp, #12, lsl #12            ; =49152
	sub	sp, sp, #2112
	adrp	x8, ___stack_chk_guard@GOTPAGE
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
	ldr	x8, [x8]
	stur	x8, [x29, #-24]
	str	wzr, [sp, #48]
	mov	w8, #50
	str	w8, [sp, #44]
	mov	w8, #250
	str	w8, [sp, #40]
	adrp	x0, _wt@PAGE
	add	x0, x0, _wt@PAGEOFF
	adrp	x1, _val@PAGE
	add	x1, x1, _val@PAGEOFF
	add	x2, sp, #52
	str	x2, [sp, #32]                   ; 8-byte Folded Spill
	bl	_knapSack
	ldr	x8, [sp, #32]                   ; 8-byte Folded Reload
	ldrsw	x9, [sp, #44]
	mov	x10, #1004
	mul	x9, x9, x10
	add	x8, x8, x9
	ldr	w9, [x8, #1000]
                                        ; implicit-def: $x8
	mov	x8, x9
	mov	x9, sp
	str	x8, [x9]
	adrp	x0, l_.str@PAGE
	add	x0, x0, l_.str@PAGEOFF
	bl	_libmin_printf
	adrp	x0, l_.str.1@PAGE
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_libmin_printf
	b	LBB2_1
LBB2_1:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [sp, #44]
	subs	w8, w8, #0
	cset	w8, eq
	tbnz	w8, #0, LBB2_5
	b	LBB2_2
LBB2_2:                                 ;   in Loop: Header=BB2_1 Depth=1
	ldrsw	x8, [sp, #44]
	mov	x9, #1004
	mul	x9, x8, x9
	add	x11, sp, #52
	mov	x8, x11
	add	x8, x8, x9
	ldrsw	x9, [sp, #40]
	ldr	w8, [x8, x9, lsl #2]
	ldr	w9, [sp, #44]
	subs	w9, w9, #1
	mov	w10, #1004
	smaddl	x9, w9, w10, x11
	ldrsw	x10, [sp, #40]
	ldr	w9, [x9, x10, lsl #2]
	subs	w8, w8, w9
	cset	w8, eq
	tbnz	w8, #0, LBB2_4
	b	LBB2_3
LBB2_3:                                 ;   in Loop: Header=BB2_1 Depth=1
	ldr	w8, [sp, #44]
                                        ; implicit-def: $x11
	mov	x11, x8
	ldr	w8, [sp, #44]
	subs	w9, w8, #1
	adrp	x8, _wt@PAGE
	add	x8, x8, _wt@PAGEOFF
	str	x8, [sp, #24]                   ; 8-byte Folded Spill
	ldr	w8, [x8, w9, sxtw #2]
                                        ; implicit-def: $x10
	mov	x10, x8
	ldr	w8, [sp, #44]
	subs	w9, w8, #1
	adrp	x8, _val@PAGE
	add	x8, x8, _val@PAGEOFF
	ldr	w9, [x8, w9, sxtw #2]
                                        ; implicit-def: $x8
	mov	x8, x9
	mov	x9, sp
	str	x11, [x9]
	str	x10, [x9, #8]
	str	x8, [x9, #16]
	adrp	x0, l_.str.2@PAGE
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_libmin_printf
	ldr	x9, [sp, #24]                   ; 8-byte Folded Reload
	ldr	w8, [sp, #40]
	ldr	w10, [sp, #44]
	subs	w10, w10, #1
	ldr	w9, [x9, w10, sxtw #2]
	subs	w8, w8, w9
	str	w8, [sp, #40]
	b	LBB2_4
LBB2_4:                                 ;   in Loop: Header=BB2_1 Depth=1
	ldr	w8, [sp, #44]
	subs	w8, w8, #1
	str	w8, [sp, #44]
	b	LBB2_1
LBB2_5:
	ldr	w9, [sp, #40]
	mov	w8, #250
	subs	w10, w8, w9
	mov	x9, sp
                                        ; implicit-def: $x8
	mov	x8, x10
	str	x8, [x9]
	adrp	x0, l_.str.3@PAGE
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_libmin_printf
	bl	_libmin_success
	ldur	x9, [x29, #-24]
	adrp	x8, ___stack_chk_guard@GOTPAGE
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
	ldr	x8, [x8]
	subs	x8, x8, x9
	cset	w8, eq
	tbnz	w8, #0, LBB2_7
	b	LBB2_6
LBB2_6:
	bl	___stack_chk_fail
LBB2_7:
	mov	w0, #0
	add	sp, sp, #12, lsl #12            ; =49152
	add	sp, sp, #2112
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #32             ; 16-byte Folded Reload
	ret
	.cfi_endproc
                                        ; -- End function
	.section	__DATA,__data
	.globl	_val                            ; @val
	.p2align	2
_val:
	.long	27                              ; 0x1b
	.long	34                              ; 0x22
	.long	9                               ; 0x9
	.long	22                              ; 0x16
	.long	8                               ; 0x8
	.long	17                              ; 0x11
	.long	22                              ; 0x16
	.long	21                              ; 0x15
	.long	23                              ; 0x17
	.long	19                              ; 0x13
	.long	7                               ; 0x7
	.long	36                              ; 0x24
	.long	11                              ; 0xb
	.long	42                              ; 0x2a
	.long	37                              ; 0x25
	.long	16                              ; 0x10
	.long	10                              ; 0xa
	.long	26                              ; 0x1a
	.long	10                              ; 0xa
	.long	50                              ; 0x32
	.long	23                              ; 0x17
	.long	46                              ; 0x2e
	.long	37                              ; 0x25
	.long	3                               ; 0x3
	.long	14                              ; 0xe
	.long	16                              ; 0x10
	.long	35                              ; 0x23
	.long	14                              ; 0xe
	.long	15                              ; 0xf
	.long	44                              ; 0x2c
	.long	49                              ; 0x31
	.long	2                               ; 0x2
	.long	45                              ; 0x2d
	.long	3                               ; 0x3
	.long	15                              ; 0xf
	.long	1                               ; 0x1
	.long	34                              ; 0x22
	.long	44                              ; 0x2c
	.long	19                              ; 0x13
	.long	25                              ; 0x19
	.long	43                              ; 0x2b
	.long	28                              ; 0x1c
	.long	26                              ; 0x1a
	.long	4                               ; 0x4
	.long	30                              ; 0x1e
	.long	24                              ; 0x18
	.long	49                              ; 0x31
	.long	11                              ; 0xb
	.long	48                              ; 0x30
	.long	13                              ; 0xd

	.globl	_wt                             ; @wt
	.p2align	2
_wt:
	.long	23                              ; 0x17
	.long	47                              ; 0x2f
	.long	22                              ; 0x16
	.long	15                              ; 0xf
	.long	42                              ; 0x2a
	.long	30                              ; 0x1e
	.long	15                              ; 0xf
	.long	32                              ; 0x20
	.long	47                              ; 0x2f
	.long	33                              ; 0x21
	.long	15                              ; 0xf
	.long	38                              ; 0x26
	.long	44                              ; 0x2c
	.long	7                               ; 0x7
	.long	16                              ; 0x10
	.long	34                              ; 0x22
	.long	30                              ; 0x1e
	.long	33                              ; 0x21
	.long	3                               ; 0x3
	.long	2                               ; 0x2
	.long	43                              ; 0x2b
	.long	31                              ; 0x1f
	.long	46                              ; 0x2e
	.long	17                              ; 0x11
	.long	30                              ; 0x1e
	.long	1                               ; 0x1
	.long	34                              ; 0x22
	.long	21                              ; 0x15
	.long	30                              ; 0x1e
	.long	21                              ; 0x15
	.long	29                              ; 0x1d
	.long	21                              ; 0x15
	.long	36                              ; 0x24
	.long	14                              ; 0xe
	.long	18                              ; 0x12
	.long	21                              ; 0x15
	.long	13                              ; 0xd
	.long	3                               ; 0x3
	.long	27                              ; 0x1b
	.long	44                              ; 0x2c
	.long	33                              ; 0x21
	.long	11                              ; 0xb
	.long	9                               ; 0x9
	.long	31                              ; 0x1f
	.long	40                              ; 0x28
	.long	40                              ; 0x28
	.long	30                              ; 0x1e
	.long	9                               ; 0x9
	.long	41                              ; 0x29
	.long	31                              ; 0x1f

	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Max value: %d\n"

l_.str.1:                               ; @.str.1
	.asciz	"Selected packs:\n"

l_.str.2:                               ; @.str.2
	.asciz	"  Package %d with wt=%d and val=%d\n"

l_.str.3:                               ; @.str.3
	.asciz	"Total weight: %d\n"

.subsections_via_symbols