	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.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
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	$0, -48(%rbp)
	movq	$0, -64(%rbp)
	cmpl	$1, %edi
	jg	LBB0_2
## %bb.1:
	movq	_AV_LOG_INFO@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	jmp	LBB0_3
LBB0_2:
	movq	8(%rsi), %rdi
	callq	_atoi
	movl	%eax, %edi
LBB0_3:
	callq	_av_log_set_level
	leaq	-52(%rbp), %rdi
	movl	$1, %esi
	callq	_av_lfg_init
	movq	_cmp@GOTPCREL(%rip), %r12
	xorl	%r13d, %r13d
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_5 Depth=1
	movq	-72(%rbp), %rdi
	callq	_av_free
	incl	%r13d
	cmpl	$10000, %r13d                   ## imm = 0x2710
	je	LBB0_11
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	leaq	-52(%rbp), %rdi
	callq	_av_lfg_get
	movl	%eax, %ebx
	movq	-48(%rbp), %rdi
	callq	_check
	cmpl	$1000, %eax                     ## imm = 0x3E8
	jge	LBB0_10
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movslq	%ebx, %r15
	imulq	$1630906997, %r15, %rax         ## imm = 0x6135AA75
	movq	%rax, %rcx
	shrq	$63, %rcx
	sarq	$47, %rax
	addl	%ecx, %eax
	imull	$86294, %eax, %eax              ## imm = 0x15116
	subl	%eax, %r15d
	movq	_AV_LOG_DEBUG@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	xorl	%edi, %edi
	leaq	L_.str.1(%rip), %rdx
	movl	%r15d, %ecx
	xorl	%eax, %eax
	callq	_av_log
	cmpq	$0, -64(%rbp)
	jne	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=1
	xorl	%eax, %eax
	callq	_av_tree_node_alloc
	movq	%rax, -64(%rbp)
	testq	%rax, %rax
	je	LBB0_12
LBB0_8:                                 ##   in Loop: Header=BB0_5 Depth=1
	incl	%r15d
	movslq	%r15d, %rsi
	movl	(%r12), %edx
	leaq	-48(%rbp), %r14
	movq	%r14, %rdi
	leaq	-64(%rbp), %rcx
	callq	_av_tree_insert
	leaq	-52(%rbp), %rdi
	callq	_av_lfg_get
	movslq	%eax, %r15
	imulq	$1630906997, %r15, %rax         ## imm = 0x6135AA75
	movq	%rax, %rcx
	shrq	$63, %rcx
	sarq	$47, %rax
	addl	%ecx, %eax
	movq	%rbx, %rdx
	imull	$86294, %eax, %ebx              ## imm = 0x15116
	movl	%r15d, %ecx
	subl	%ebx, %ecx
	movq	$0, -72(%rbp)
	movl	(%rdx), %esi
	xorl	%edi, %edi
	leaq	L_.str.3(%rip), %rdx
	xorl	%eax, %eax
	callq	_av_log
	negl	%ebx
	leal	(%r15,%rbx), %eax
	incl	%eax
	movslq	%eax, %rbx
	movl	(%r12), %edx
	movq	%r14, %rdi
	movq	%rbx, %rsi
	leaq	-72(%rbp), %rcx
	callq	_av_tree_insert
	movq	-48(%rbp), %rdi
	movl	(%r12), %edx
	movq	%rbx, %rsi
	xorl	%ecx, %ecx
	callq	_av_tree_find
	testq	%rax, %rax
	je	LBB0_4
## %bb.9:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edi, %edi
	leaq	L_.str.4(%rip), %rdx
	movl	%r13d, %ecx
	xorl	%eax, %eax
	callq	_av_log
	jmp	LBB0_4
LBB0_10:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	xorl	%edi, %edi
	movl	%r13d, %ecx
	xorl	%eax, %eax
	callq	_av_log
	movq	-48(%rbp), %rdi
	xorl	%esi, %esi
	callq	_print
	jmp	LBB0_13
LBB0_11:
	movq	-64(%rbp), %rdi
	callq	_av_free
	movq	-48(%rbp), %rdi
	callq	_av_tree_destroy
	xorl	%eax, %eax
	jmp	LBB0_14
LBB0_12:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.2(%rip), %rdx
	xorl	%edi, %edi
	xorl	%eax, %eax
	callq	_av_log
LBB0_13:
	movl	$1, %eax
LBB0_14:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AV_LOG_INFO,4,2                ## @AV_LOG_INFO
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"FATAL error %d\n"

	.comm	_AV_LOG_DEBUG,4,2               ## @AV_LOG_DEBUG
L_.str.1:                               ## @.str.1
	.asciz	"inserting %4d\n"

L_.str.2:                               ## @.str.2
	.asciz	"Memory allocation failure.\n"

	.comm	_cmp,4,2                        ## @cmp
L_.str.3:                               ## @.str.3
	.asciz	"removing %4d\n"

L_.str.4:                               ## @.str.4
	.asciz	"removal failure %d\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_main                           ; -- Begin function main
	.p2align	2
_main:                                  ; @main
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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
	stp	xzr, xzr, [sp, #32]
	cmp	w0, #1
	b.gt	LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _AV_LOG_INFO@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AV_LOG_INFO@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	b	LBB0_3
LBB0_2:
	ldr	x0, [x1, #8]
	bl	_atoi
LBB0_3:
	mov	w23, #20758
	movk	w23, #1, lsl #16
	bl	_av_log_set_level
	add	x0, sp, #28
	mov	w1, #1
	bl	_av_lfg_init
	mov	w24, #0
Lloh3:
	adrp	x25, _AV_LOG_DEBUG@GOTPAGE
Lloh4:
	ldr	x25, [x25, _AV_LOG_DEBUG@GOTPAGEOFF]
Lloh5:
	adrp	x19, l_.str.1@PAGE
Lloh6:
	add	x19, x19, l_.str.1@PAGEOFF
Lloh7:
	adrp	x26, _cmp@GOTPAGE
Lloh8:
	ldr	x26, [x26, _cmp@GOTPAGEOFF]
Lloh9:
	adrp	x20, l_.str.3@PAGE
Lloh10:
	add	x20, x20, l_.str.3@PAGEOFF
	mov	w28, #10000
Lloh11:
	adrp	x27, _AV_LOG_ERROR@GOTPAGE
Lloh12:
	ldr	x27, [x27, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh13:
	adrp	x21, l_.str.4@PAGE
Lloh14:
	add	x21, x21, l_.str.4@PAGEOFF
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldr	x0, [sp, #16]
	bl	_av_free
	add	w24, w24, #1
	cmp	w24, w28
	b.eq	LBB0_11
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	add	x0, sp, #28
	bl	_av_lfg_get
	mov	x22, x0
	ldr	x0, [sp, #40]
	bl	_check
	cmp	w0, #1000
	b.ge	LBB0_10
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	sdiv	w8, w22, w23
	msub	w22, w8, w23, w22
	ldr	w1, [x25]
	str	x22, [sp]
	mov	x0, #0
	mov	x2, x19
	bl	_av_log
	ldr	x8, [sp, #32]
	cbnz	x8, LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	bl	_av_tree_node_alloc
	str	x0, [sp, #32]
	cbz	x0, LBB0_12
LBB0_8:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	w8, w22, #1
	sxtw	x1, w8
	ldr	w2, [x26]
	add	x0, sp, #40
	add	x3, sp, #32
	bl	_av_tree_insert
	add	x0, sp, #28
	bl	_av_lfg_get
	sdiv	w8, w0, w23
	msub	w22, w8, w23, w0
	str	xzr, [sp, #16]
	ldr	w1, [x25]
	str	x22, [sp]
	mov	x0, #0
	mov	x2, x20
	bl	_av_log
	add	w8, w22, #1
	sxtw	x22, w8
	ldr	w2, [x26]
	add	x0, sp, #40
	add	x3, sp, #16
	mov	x1, x22
	bl	_av_tree_insert
	ldr	x0, [sp, #40]
	ldr	w2, [x26]
	mov	x1, x22
	mov	x3, #0
	bl	_av_tree_find
	cbz	x0, LBB0_4
; %bb.9:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w1, [x27]
	str	x24, [sp]
	mov	x0, #0
	mov	x2, x21
	bl	_av_log
	b	LBB0_4
LBB0_10:
	ldr	w1, [x27]
                                        ; kill: def $w24 killed $w24 killed $x24 def $x24
	str	x24, [sp]
Lloh15:
	adrp	x2, l_.str@PAGE
Lloh16:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, #0
	bl	_av_log
	ldr	x0, [sp, #40]
	mov	w1, #0
	bl	_print
	b	LBB0_13
LBB0_11:
	ldr	x0, [sp, #32]
	bl	_av_free
	ldr	x0, [sp, #40]
	bl	_av_tree_destroy
	mov	w0, #0
	b	LBB0_14
LBB0_12:
	ldr	w1, [x27]
Lloh17:
	adrp	x2, l_.str.2@PAGE
Lloh18:
	add	x2, x2, l_.str.2@PAGEOFF
	bl	_av_log
LBB0_13:
	mov	w0, #1
LBB0_14:
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_AV_LOG_INFO,4,2                ; @AV_LOG_INFO
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"FATAL error %d\n"

	.comm	_AV_LOG_DEBUG,4,2               ; @AV_LOG_DEBUG
l_.str.1:                               ; @.str.1
	.asciz	"inserting %4d\n"

l_.str.2:                               ; @.str.2
	.asciz	"Memory allocation failure.\n"

	.comm	_cmp,4,2                        ; @cmp
l_.str.3:                               ; @.str.3
	.asciz	"removing %4d\n"

l_.str.4:                               ; @.str.4
	.asciz	"removal failure %d\n"

.subsections_via_symbols
