	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_get_albums_count               ## -- Begin function get_albums_count
	.p2align	4, 0x90
_get_albums_count:                      ## @get_albums_count
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movl	%edi, %ebx
	movq	_index_mode@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_write_only@GOTPCREL(%rip), %rcx
	xorl	%edi, %edi
	orl	(%rcx), %eax
	sete	%dil
	callq	_assert
	movl	%ebx, %edi
	callq	_conv_uid_get
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r14
	movl	(%rax), %esi
	movq	_NOAIO@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	callq	_load_user_metafile
	movq	%r14, %rdi
	callq	_user_loaded
	testl	%eax, %eax
	je	LBB0_3
## %bb.4:
	movq	_ALBUM_TYPE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_predicate_init
	movq	_MAX_ALBUMS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	xorl	%r15d, %r15d
	movq	%r14, %rdi
	xorl	%esi, %esi
	movq	%rax, %rcx
	callq	_user_get_albums
	testl	%eax, %eax
	jle	LBB0_7
## %bb.5:
	movl	%eax, %r14d
	shlq	$2, %r14
	xorl	%ebx, %ebx
	movq	_result_obj@GOTPCREL(%rip), %r12
	xorl	%r15d, %r15d
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r12), %rdi
	addq	%rbx, %rdi
	callq	_event_get_album_id
	xorl	%ecx, %ecx
	testl	%eax, %eax
	setg	%cl
	addl	%ecx, %r15d
	addq	$4, %rbx
	cmpq	%rbx, %r14
	jne	LBB0_6
	jmp	LBB0_7
LBB0_1:
	movl	$-1, %r15d
	jmp	LBB0_7
LBB0_3:
	movl	$-2, %r15d
LBB0_7:
	movl	%r15d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_index_mode,4,2                 ## @index_mode
	.comm	_write_only,4,2                 ## @write_only
	.comm	_NOAIO,4,2                      ## @NOAIO
	.comm	_ALBUM_TYPE,4,2                 ## @ALBUM_TYPE
	.comm	_MAX_ALBUMS,4,2                 ## @MAX_ALBUMS
	.comm	_result_obj,8,3                 ## @result_obj
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_get_albums_count               ; -- Begin function get_albums_count
	.p2align	2
_get_albums_count:                      ; @get_albums_count
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _index_mode@GOTPAGE
Lloh1:
	ldr	x8, [x8, _index_mode@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _write_only@GOTPAGE
Lloh4:
	ldr	x9, [x9, _write_only@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	orr	w8, w8, w9
	cmp	w8, #0
	cset	w0, eq
	bl	_assert
	mov	x0, x20
	bl	_conv_uid_get
	cbz	x0, LBB0_5
; %bb.1:
	mov	x20, x0
	ldr	w1, [x0]
Lloh6:
	adrp	x8, _NOAIO@GOTPAGE
Lloh7:
	ldr	x8, [x8, _NOAIO@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x8]
	bl	_load_user_metafile
	mov	x0, x20
	bl	_user_loaded
	cbz	w0, LBB0_6
; %bb.2:
Lloh9:
	adrp	x8, _ALBUM_TYPE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ALBUM_TYPE@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_predicate_init
	mov	x3, x0
Lloh12:
	adrp	x8, _MAX_ALBUMS@GOTPAGE
Lloh13:
	ldr	x8, [x8, _MAX_ALBUMS@GOTPAGEOFF]
Lloh14:
	ldr	w2, [x8]
	mov	x0, x20
	mov	w1, #0
	bl	_user_get_albums
	cmp	w0, #1
	b.lt	LBB0_7
; %bb.3:
	mov	x20, #0
	mov	w19, #0
	mov	w8, w0
	lsl	x21, x8, #2
Lloh15:
	adrp	x22, _result_obj@GOTPAGE
Lloh16:
	ldr	x22, [x22, _result_obj@GOTPAGEOFF]
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x22]
	add	x0, x8, x20
	bl	_event_get_album_id
	cmp	w0, #0
	cinc	w19, w19, gt
	add	x20, x20, #4
	cmp	x21, x20
	b.ne	LBB0_4
	b	LBB0_8
LBB0_5:
	mov	w19, #-1
	b	LBB0_8
LBB0_6:
	mov	w19, #-2
	b	LBB0_8
LBB0_7:
	mov	w19, #0
LBB0_8:
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_index_mode,4,2                 ; @index_mode
	.comm	_write_only,4,2                 ; @write_only
	.comm	_NOAIO,4,2                      ; @NOAIO
	.comm	_ALBUM_TYPE,4,2                 ; @ALBUM_TYPE
	.comm	_MAX_ALBUMS,4,2                 ; @MAX_ALBUMS
	.comm	_result_obj,8,3                 ; @result_obj
.subsections_via_symbols
