	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_get_albums                     ## -- Begin function get_albums
	.p2align	4, 0x90
_get_albums:                            ## @get_albums
	.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
                                        ## kill: def $r9d killed $r9d def $r9
	movq	%r9, -64(%rbp)                  ## 8-byte Spill
	movl	%r8d, -52(%rbp)                 ## 4-byte Spill
	movq	%rcx, %r14
	movl	%edx, %r8d
	movl	%esi, %ecx
	movl	%edi, %ebx
	movq	24(%rbp), %r15
	leaq	L_.str(%rip), %rdi
	movl	%ebx, %esi
	movq	%r14, %rdx
	movq	%rcx, %r13
                                        ## kill: def $ecx killed $ecx killed $rcx
	movl	%r8d, -48(%rbp)                 ## 4-byte Spill
	callq	_dbg
	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
	movq	_debug_buff@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%r15)
	xorl	%r12d, %r12d
	xorl	%eax, %eax
	callq	_debug_init
	movl	%ebx, %edi
	callq	_conv_uid_get
	movq	%rax, %rbx
	movq	_types@GOTPCREL(%rip), %rax
	movq	_ALBUM_TYPE@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rdi
	shlq	$2, %rdi
	addq	(%rax), %rdi
	movq	%r14, %rsi
	callq	_get_fields
	testq	%rbx, %rbx
	je	LBB0_21
## %bb.1:
	testl	%eax, %eax
	js	LBB0_21
## %bb.2:
	movl	%eax, -68(%rbp)                 ## 4-byte Spill
	xorl	%r15d, %r15d
	movq	%r13, %r14
	testl	%r14d, %r14d
	cmovlel	%r15d, %r14d
	movq	_MAX_RESULT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	%eax, %r14d
	cmovgel	%eax, %r14d
	movl	-48(%rbp), %ecx                 ## 4-byte Reload
	testl	%ecx, %ecx
	cmovgl	%ecx, %r15d
	cmpl	%eax, %r15d
	cmovgel	%eax, %r15d
	movl	(%rbx), %esi
	movq	_NOAIO@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_load_user_metafile
	movq	%rbx, %rdi
	callq	_user_loaded
	testl	%eax, %eax
	je	LBB0_3
## %bb.4:
	movq	16(%rbp), %rdi
	movq	_ALBUM_TYPE@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	callq	_predicate_init
	cmpl	$0, -52(%rbp)                   ## 4-byte Folded Reload
	movq	%rbx, -80(%rbp)                 ## 8-byte Spill
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	je	LBB0_6
## %bb.5:
	movq	%rbx, %rdi
	movq	%rax, %rsi
	callq	_user_get_albums_count_pred
	movl	%eax, %r12d
	movl	%eax, %edi
	notl	%edi
	shrl	$31, %edi
	callq	_assert
	movl	%r12d, %eax
	subl	%r14d, %eax
	movl	%eax, %r14d
	subl	%r15d, %r14d
	xorl	%ecx, %ecx
	testl	%r14d, %r14d
	cmovnsl	%r15d, %eax
	cmovlel	%ecx, %r14d
	testl	%eax, %eax
	cmovlel	%ecx, %eax
	movl	%eax, %r15d
	movl	%r12d, %r13d
	jmp	LBB0_10
LBB0_3:
	movl	$-2, %r12d
	jmp	LBB0_21
LBB0_6:
	cmpl	$0, -64(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_9
## %bb.7:
	testq	%rax, %rax
	je	LBB0_9
## %bb.8:
	movq	%rbx, %rdi
	movq	%rax, %rsi
	callq	_user_get_albums_count_pred
	movl	%eax, %ebx
	movl	%eax, %edi
	notl	%edi
	shrl	$31, %edi
	callq	_assert
	movl	%ebx, %r13d
	subl	%r14d, %ebx
	xorl	%r12d, %r12d
	testl	%ebx, %ebx
	cmovgl	%ebx, %r12d
	jmp	LBB0_10
LBB0_9:
	movq	%rbx, %rdi
	movl	%r14d, %esi
	movl	%r15d, %edx
	movq	%rax, %rcx
	callq	_user_get_albums
	movl	%eax, %r12d
	movq	%rbx, %rdi
	callq	_user_get_albums_count
	movl	%eax, %r13d
	movl	%r12d, %edi
	notl	%edi
	shrl	$31, %edi
	callq	_assert
LBB0_10:
	cmpl	%r15d, %r12d
	cmovll	%r12d, %r15d
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	leal	(%r15,%rbx), %esi
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_debug
	testl	%ebx, %ebx
	je	LBB0_12
## %bb.11:
	leaq	L_.str.2(%rip), %rdi
	movl	%r13d, %esi
	xorl	%eax, %eax
	callq	_debug
LBB0_12:
	testl	%r15d, %r15d
	jle	LBB0_20
## %bb.13:
	cmpq	$0, -48(%rbp)                   ## 8-byte Folded Reload
	movl	$0, %r13d
	cmovnel	%r14d, %r13d
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	testl	%eax, %eax
	cmovel	%eax, %r13d
	decl	%r14d
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	movq	_result_obj@GOTPCREL(%rip), %r14
	jmp	LBB0_14
	.p2align	4, 0x90
LBB0_18:                                ##   in Loop: Header=BB0_14 Depth=1
	addq	(%r14), %r12
	movq	_ALBUM_TYPE@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	_return_fields@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	callq	_event_to_array
	leaq	L_.str.4(%rip), %rdi
	movl	%ebx, %esi
	movl	%eax, %edx
LBB0_19:                                ##   in Loop: Header=BB0_14 Depth=1
	xorl	%eax, %eax
	callq	_debug
	incl	%r13d
	decl	%r15d
	movq	_result_obj@GOTPCREL(%rip), %r14
	je	LBB0_20
LBB0_14:                                ## =>This Inner Loop Header: Depth=1
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	addl	%r15d, %eax
	cmpl	$0, -52(%rbp)                   ## 4-byte Folded Reload
	cmovel	%r13d, %eax
	movslq	%eax, %r12
	shlq	$2, %r12
	movq	(%r14), %rdi
	addq	%r12, %rdi
	callq	_event_get_album_id
	movl	%eax, %ebx
	movl	-68(%rbp), %ecx                 ## 4-byte Reload
	testl	%ecx, %ecx
	jne	LBB0_18
## %bb.15:                              ##   in Loop: Header=BB0_14 Depth=1
	movl	%ebx, %edx
	cmpl	$0, -64(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_17
## %bb.16:                              ##   in Loop: Header=BB0_14 Depth=1
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	movl	%ebx, %esi
	callq	_user_get_photos_count
	movl	%eax, %edx
LBB0_17:                                ##   in Loop: Header=BB0_14 Depth=1
	leaq	L_.str.3(%rip), %rdi
	movl	%ebx, %esi
	jmp	LBB0_19
LBB0_20:
	leaq	L_.str.5(%rip), %rdi
	xorl	%eax, %eax
	callq	_debug
	movq	_debug_error@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	cmpq	$0, (%rax)
	sete	%r12b
LBB0_21:
	movl	%r12d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"get_albums (uid = %d) (fields = %s) (offset = %d) (limit = %d)\n"

	.comm	_index_mode,4,2                 ## @index_mode
	.comm	_write_only,4,2                 ## @write_only
	.comm	_debug_buff,8,3                 ## @debug_buff
	.comm	_types,8,3                      ## @types
	.comm	_ALBUM_TYPE,8,3                 ## @ALBUM_TYPE
	.comm	_MAX_RESULT,4,2                 ## @MAX_RESULT
	.comm	_NOAIO,4,2                      ## @NOAIO
L_.str.1:                               ## @.str.1
	.asciz	"a:%d:{"

L_.str.2:                               ## @.str.2
	.asciz	"s:5:\"count\";i:%d;"

	.comm	_result_obj,8,3                 ## @result_obj
L_.str.3:                               ## @.str.3
	.asciz	"i:%d;i:%d;"

L_.str.4:                               ## @.str.4
	.asciz	"i:%d;%s"

	.comm	_return_fields,4,2              ## @return_fields
L_.str.5:                               ## @.str.5
	.asciz	"}"

	.comm	_debug_error,8,3                ## @debug_error
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_get_albums                     ; -- Begin function get_albums
	.p2align	2
_get_albums:                            ; @get_albums
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	mov	x21, x7
	mov	x24, x6
	str	w5, [sp, #28]                   ; 4-byte Folded Spill
	mov	x20, x4
	mov	x22, x3
	mov	x25, x2
	mov	x23, x1
	mov	x26, x0
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x26
	mov	x2, x3
	mov	x3, x23
	mov	x4, x25
	bl	_dbg
Lloh2:
	adrp	x8, _index_mode@GOTPAGE
Lloh3:
	ldr	x8, [x8, _index_mode@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
Lloh5:
	adrp	x9, _write_only@GOTPAGE
Lloh6:
	ldr	x9, [x9, _write_only@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	orr	w8, w8, w9
	cmp	w8, #0
	cset	w0, eq
	bl	_assert
Lloh8:
	adrp	x8, _debug_buff@GOTPAGE
Lloh9:
	ldr	x8, [x8, _debug_buff@GOTPAGEOFF]
Lloh10:
	ldr	x8, [x8]
	str	x8, [x21]
	bl	_debug_init
	mov	x0, x26
	bl	_conv_uid_get
	mov	x19, x0
Lloh11:
	adrp	x8, _types@GOTPAGE
Lloh12:
	ldr	x8, [x8, _types@GOTPAGEOFF]
Lloh13:
	ldr	x8, [x8]
Lloh14:
	adrp	x9, _ALBUM_TYPE@GOTPAGE
Lloh15:
	ldr	x9, [x9, _ALBUM_TYPE@GOTPAGEOFF]
Lloh16:
	ldr	x9, [x9]
	add	x0, x8, x9, lsl #2
	mov	x1, x22
	bl	_get_fields
	mov	x22, x0
	mov	w0, #0
	cbz	x19, LBB0_22
; %bb.1:
	tbnz	w22, #31, LBB0_22
; %bb.2:
Lloh17:
	adrp	x8, _MAX_RESULT@GOTPAGE
Lloh18:
	ldr	x8, [x8, _MAX_RESULT@GOTPAGEOFF]
	cmp	w23, #0
	csel	w9, w23, wzr, gt
Lloh19:
	ldr	w8, [x8]
	cmp	w9, w8
	csel	w23, w9, w8, lt
	cmp	w25, #0
	csel	w9, w25, wzr, gt
	cmp	w9, w8
	csel	w25, w9, w8, lt
	ldr	w1, [x19]
Lloh20:
	adrp	x8, _NOAIO@GOTPAGE
Lloh21:
	ldr	x8, [x8, _NOAIO@GOTPAGEOFF]
Lloh22:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_load_user_metafile
	mov	x0, x19
	bl	_user_loaded
	cbz	w0, LBB0_5
; %bb.3:
Lloh23:
	adrp	x8, _ALBUM_TYPE@GOTPAGE
Lloh24:
	ldr	x8, [x8, _ALBUM_TYPE@GOTPAGEOFF]
Lloh25:
	ldr	x1, [x8]
	mov	x0, x24
	bl	_predicate_init
	mov	x24, x0
	str	x19, [sp, #16]                  ; 8-byte Folded Spill
	cbz	w20, LBB0_6
; %bb.4:
	mov	x0, x19
	mov	x1, x24
	bl	_user_get_albums_count_pred
	mov	x27, x0
	mvn	w8, w0
	lsr	w0, w8, #31
	bl	_assert
	sub	w8, w27, w23
	sub	w9, w8, w25
	cmp	w9, #0
	csel	w8, w8, w25, lt
	csel	w23, w9, wzr, gt
	cmp	w8, #0
	csel	w25, w8, wzr, gt
	mov	x26, x27
	b	LBB0_10
LBB0_5:
	mov	w0, #-2
	b	LBB0_22
LBB0_6:
	ldr	w8, [sp, #28]                   ; 4-byte Folded Reload
	cbz	w8, LBB0_9
; %bb.7:
	cbz	x24, LBB0_9
; %bb.8:
	mov	x0, x19
	mov	x1, x24
	bl	_user_get_albums_count_pred
	mov	x26, x0
	mvn	w8, w0
	lsr	w0, w8, #31
	bl	_assert
	sub	w8, w26, w23
	cmp	w8, #0
	csel	w27, w8, wzr, gt
	b	LBB0_10
LBB0_9:
	mov	x0, x19
	mov	x1, x23
	mov	x2, x25
	mov	x3, x24
	bl	_user_get_albums
	mov	x27, x0
	mov	x0, x19
	bl	_user_get_albums_count
	mov	x26, x0
	mvn	w8, w27
	lsr	w0, w8, #31
	bl	_assert
LBB0_10:
	cmp	w27, w25
	csel	w27, w27, w25, lt
	ldr	w19, [sp, #28]                  ; 4-byte Folded Reload
	add	w8, w27, w19
	str	x8, [sp]
Lloh26:
	adrp	x0, l_.str.1@PAGE
Lloh27:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_debug
	cbz	w19, LBB0_12
; %bb.11:
	str	x26, [sp]
Lloh28:
	adrp	x0, l_.str.2@PAGE
Lloh29:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_debug
LBB0_12:
	cmp	w27, #1
	b.lt	LBB0_21
; %bb.13:
	cmp	x24, #0
	ldr	w8, [sp, #28]                   ; 4-byte Folded Reload
	ccmp	w8, #0, #4, ne
	csel	w26, w23, wzr, ne
	sub	w28, w23, #1
Lloh30:
	adrp	x23, _result_obj@GOTPAGE
Lloh31:
	ldr	x23, [x23, _result_obj@GOTPAGEOFF]
Lloh32:
	adrp	x19, _return_fields@GOTPAGE
Lloh33:
	ldr	x19, [x19, _return_fields@GOTPAGEOFF]
Lloh34:
	adrp	x24, l_.str.4@PAGE
Lloh35:
	add	x24, x24, l_.str.4@PAGEOFF
	b	LBB0_16
LBB0_14:                                ;   in Loop: Header=BB0_16 Depth=1
	sxtw	x8, w21
	ldr	x9, [x23]
	add	x0, x9, x8, lsl #2
Lloh36:
	adrp	x8, _ALBUM_TYPE@GOTPAGE
Lloh37:
	ldr	x8, [x8, _ALBUM_TYPE@GOTPAGEOFF]
Lloh38:
	ldr	x1, [x8]
	ldr	w2, [x19]
	mov	x3, x22
	bl	_event_to_array
                                        ; kill: def $w0 killed $w0 def $x0
                                        ; kill: def $w25 killed $w25 killed $x25 def $x25
	stp	x25, x0, [sp]
	mov	x0, x24
LBB0_15:                                ;   in Loop: Header=BB0_16 Depth=1
	bl	_debug
	add	w26, w26, #1
	subs	w27, w27, #1
	b.eq	LBB0_21
LBB0_16:                                ; =>This Inner Loop Header: Depth=1
	add	w8, w28, w27
	cmp	w20, #0
	csel	w21, w26, w8, eq
	ldr	x8, [x23]
	add	x0, x8, w21, sxtw #2
	bl	_event_get_album_id
	mov	x25, x0
	cbnz	w22, LBB0_14
; %bb.17:                               ;   in Loop: Header=BB0_16 Depth=1
	ldr	w8, [sp, #28]                   ; 4-byte Folded Reload
	cbz	w8, LBB0_19
; %bb.18:                               ;   in Loop: Header=BB0_16 Depth=1
	ldr	x0, [sp, #16]                   ; 8-byte Folded Reload
	mov	x1, x25
	bl	_user_get_photos_count
                                        ; kill: def $w0 killed $w0 def $x0
	b	LBB0_20
LBB0_19:                                ;   in Loop: Header=BB0_16 Depth=1
	mov	x0, x25
LBB0_20:                                ;   in Loop: Header=BB0_16 Depth=1
	stp	x25, x0, [sp]
Lloh39:
	adrp	x0, l_.str.3@PAGE
Lloh40:
	add	x0, x0, l_.str.3@PAGEOFF
	b	LBB0_15
LBB0_21:
Lloh41:
	adrp	x0, l_.str.5@PAGE
Lloh42:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_debug
Lloh43:
	adrp	x8, _debug_error@GOTPAGE
Lloh44:
	ldr	x8, [x8, _debug_error@GOTPAGEOFF]
Lloh45:
	ldr	x8, [x8]
	cmp	x8, #0
	cset	w0, eq
LBB0_22:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpAdd	Lloh34, Lloh35
	.loh AdrpLdrGot	Lloh32, Lloh33
	.loh AdrpLdrGot	Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpAdd	Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh43, Lloh44, Lloh45
	.loh AdrpAdd	Lloh41, Lloh42
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"get_albums (uid = %d) (fields = %s) (offset = %d) (limit = %d)\n"

	.comm	_index_mode,4,2                 ; @index_mode
	.comm	_write_only,4,2                 ; @write_only
	.comm	_debug_buff,8,3                 ; @debug_buff
	.comm	_types,8,3                      ; @types
	.comm	_ALBUM_TYPE,8,3                 ; @ALBUM_TYPE
	.comm	_MAX_RESULT,4,2                 ; @MAX_RESULT
	.comm	_NOAIO,4,2                      ; @NOAIO
l_.str.1:                               ; @.str.1
	.asciz	"a:%d:{"

l_.str.2:                               ; @.str.2
	.asciz	"s:5:\"count\";i:%d;"

	.comm	_result_obj,8,3                 ; @result_obj
l_.str.3:                               ; @.str.3
	.asciz	"i:%d;i:%d;"

l_.str.4:                               ; @.str.4
	.asciz	"i:%d;%s"

	.comm	_return_fields,4,2              ; @return_fields
l_.str.5:                               ; @.str.5
	.asciz	"}"

	.comm	_debug_error,8,3                ; @debug_error
.subsections_via_symbols
