	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_user_change_photo              ## -- Begin function user_change_photo
	.p2align	4, 0x90
_user_change_photo:                     ## @user_change_photo
	.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	$88, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
	movl	%esi, %r15d
	movq	%rdi, %rbx
	movl	(%rdi), %esi
	leaq	L_.str(%rip), %rdi
	movl	%r15d, %edx
	movl	%ecx, -48(%rbp)                 ## 4-byte Spill
	callq	_dbg
	movq	_write_only@GOTPCREL(%rip), %rax
	movl	$1, %r14d
	cmpq	$0, (%rax)
	je	LBB0_2
LBB0_1:
	movl	%r14d, %eax
	addq	$88, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movq	%rbx, %rdi
	callq	_user_loaded
	movl	%eax, %edi
	callq	_assert
	movq	%rbx, %rdi
	movl	%r15d, %esi
	callq	_user_get_aid_by_pid
	xorl	%r14d, %r14d
	testl	%eax, %eax
	je	LBB0_1
## %bb.3:
	movl	%eax, %r12d
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_user_get_photo_data
	testq	%rax, %rax
	je	LBB0_1
## %bb.4:
	movq	%rax, %r13
	movl	%r12d, -64(%rbp)                ## 4-byte Spill
	movq	%rax, %rdi
	movl	%r15d, %esi
	callq	_data_get_hidden_state
	testq	%rax, %rax
	jne	LBB0_1
## %bb.5:
	movq	%rbx, -72(%rbp)                 ## 8-byte Spill
	movl	-48(%rbp), %ecx                 ## 4-byte Reload
	testl	%ecx, %ecx
	movl	%r15d, -44(%rbp)                ## 4-byte Spill
	jle	LBB0_20
## %bb.6:
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	addq	$4, %rax
	movq	%rax, -88(%rbp)                 ## 8-byte Spill
	movl	%ecx, %r14d
	shlq	$4, %r14
	xorl	%r12d, %r12d
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movq	%r14, -80(%rbp)                 ## 8-byte Spill
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_9 Depth=1
	movq	%r13, %r15
LBB0_8:                                 ##   in Loop: Header=BB0_9 Depth=1
	addq	$16, %r12
	movq	%r15, %r13
	cmpq	%r12, %r14
	je	LBB0_21
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%rbx,%r12), %rax
	movq	_photo_type_id@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	setne	%cl
	movq	_photo_type_owner_id@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rax
	setne	%al
	andb	%cl, %al
	movzbl	%al, %edi
	callq	_assert
	movq	(%rbx,%r12), %rax
	movq	_photo_type_album_id@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_7
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=1
	movl	8(%rbx,%r12), %r15d
	cmpl	%r15d, -64(%rbp)                ## 4-byte Folded Reload
	je	LBB0_7
## %bb.12:                              ##   in Loop: Header=BB0_9 Depth=1
	leaq	L_.str.1(%rip), %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movl	%r15d, %edx
	movl	-48(%rbp), %ecx                 ## 4-byte Reload
	callq	_dbg
	movl	%r15d, %edi
	callq	_check_album_id
	xorl	%r14d, %r14d
	testl	%eax, %eax
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	je	LBB0_1
## %bb.13:                              ##   in Loop: Header=BB0_9 Depth=1
	testl	%r15d, %r15d
	jns	LBB0_15
## %bb.14:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	%rbx, %rdi
	movl	%r15d, %esi
	callq	_user_create_album_force
LBB0_15:                                ##   in Loop: Header=BB0_9 Depth=1
	movq	%rbx, %rdi
	movl	%r15d, %esi
	callq	_user_get_photo_data
	testq	%rax, %rax
	je	LBB0_1
## %bb.16:                              ##   in Loop: Header=BB0_9 Depth=1
	movl	%r15d, %ebx
	movq	%rax, %r15
	movq	%rax, %rdi
	callq	_data_get_cnt
	movq	%rax, -96(%rbp)                 ## 8-byte Spill
	movl	%ebx, -60(%rbp)                 ## 4-byte Spill
	movl	%ebx, %edi
	callq	_GET_MAX_PHOTOS
	cmpq	%rax, -96(%rbp)                 ## 8-byte Folded Reload
	jge	LBB0_1
## %bb.17:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	%r13, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	callq	_data_get_local_id_by_id
	movl	%eax, %ebx
	movl	%eax, %edi
	notl	%edi
	shrl	$31, %edi
	callq	_assert
	movq	%r13, %rdi
	movl	%ebx, %esi
	leaq	-112(%rbp), %rdx
	callq	_data_get_actual_object
	shrq	$63, %rax
	xorl	$1, %eax
	movl	%eax, %edi
	callq	_assert
	movq	-112(%rbp), %rdi
	movl	-104(%rbp), %esi
	movq	_PHOTO_TYPE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_event_update_event
	movq	%rax, %r14
	cmpq	-112(%rbp), %rax
	jne	LBB0_19
## %bb.18:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	%r14, %rdi
	callq	_event_dup
	movq	%rax, %r14
LBB0_19:                                ##   in Loop: Header=BB0_9 Depth=1
	movq	%r13, %rdi
	movl	-44(%rbp), %r13d                ## 4-byte Reload
	movl	%r13d, %esi
	callq	_data_del
	movq	%r15, %rdi
	movl	%r13d, %esi
	callq	_data_add_object
	movl	%eax, %ebx
	movl	%eax, %edi
	notl	%edi
	shrl	$31, %edi
	callq	_assert
	movq	_ch_event@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -120(%rbp)
	movq	%r14, -128(%rbp)
	movq	%r15, %rdi
	leaq	-128(%rbp), %rsi
	movl	%ebx, %edx
	callq	_data_add_change
	movq	-88(%rbp), %rdi                 ## 8-byte Reload
	movl	%r13d, %esi
	movl	-60(%rbp), %edx                 ## 4-byte Reload
	callq	_lookup_set
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movq	-80(%rbp), %r14                 ## 8-byte Reload
	jmp	LBB0_8
LBB0_20:
	movq	%r13, %r15
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
LBB0_21:
	movq	%r15, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movq	%rbx, %rdx
	movl	-48(%rbp), %ecx                 ## 4-byte Reload
	xorl	%r8d, %r8d
	callq	_user_change_data
	movl	%eax, %r14d
	notl	%r14d
	shrl	$31, %r14d
	jmp	LBB0_1
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"user_change_photo %d: photo_id = %d, field_changes_n = %d\n"

	.comm	_write_only,8,3                 ## @write_only
	.comm	_photo_type_id,8,3              ## @photo_type_id
	.comm	_photo_type_owner_id,8,3        ## @photo_type_owner_id
	.comm	_photo_type_album_id,8,3        ## @photo_type_album_id
L_.str.1:                               ## @.str.1
	.asciz	"Move (photo_id = %d) to (album_id = %d) (field_changes_n = %d)\n"

	.comm	_PHOTO_TYPE,4,2                 ## @PHOTO_TYPE
	.comm	_ch_event,4,2                   ## @ch_event
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_user_change_photo              ; -- Begin function user_change_photo
	.p2align	2
_user_change_photo:                     ; @user_change_photo
	.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
	mov	x19, x3
	mov	x20, x2
	mov	x21, x1
	mov	x22, x0
	ldr	w1, [x0]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	x2, x21
	bl	_dbg
Lloh2:
	adrp	x8, _write_only@GOTPAGE
Lloh3:
	ldr	x8, [x8, _write_only@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	cbz	x8, LBB0_3
; %bb.1:
	mov	w0, #1
LBB0_2:
	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
LBB0_3:
	mov	x0, x22
	bl	_user_loaded
	bl	_assert
	mov	x0, x22
	mov	x1, x21
	bl	_user_get_aid_by_pid
	cbz	w0, LBB0_2
; %bb.4:
	mov	x23, x0
	mov	x0, x22
	mov	x1, x23
	bl	_user_get_photo_data
	cbz	x0, LBB0_2
; %bb.5:
	mov	x26, x0
	mov	x1, x21
	bl	_data_get_hidden_state
	cbz	x0, LBB0_7
LBB0_6:
	mov	w0, #0
	b	LBB0_2
LBB0_7:
	cmp	w19, #1
	str	x20, [sp]                       ; 8-byte Folded Spill
	b.lt	LBB0_23
; %bb.8:
	add	x8, x22, #4
	str	x8, [sp, #8]                    ; 8-byte Folded Spill
Lloh5:
	adrp	x25, _photo_type_id@GOTPAGE
Lloh6:
	ldr	x25, [x25, _photo_type_id@GOTPAGEOFF]
Lloh7:
	adrp	x27, _photo_type_owner_id@GOTPAGE
Lloh8:
	ldr	x27, [x27, _photo_type_owner_id@GOTPAGEOFF]
	mov	w24, w19
	b	LBB0_11
LBB0_9:                                 ;   in Loop: Header=BB0_11 Depth=1
	mov	x28, x26
LBB0_10:                                ;   in Loop: Header=BB0_11 Depth=1
	add	x20, x20, #16
	mov	x26, x28
	subs	x24, x24, #1
	b.eq	LBB0_24
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x20]
	ldr	x9, [x25]
	cmp	x8, x9
	ldr	x9, [x27]
	ccmp	x8, x9, #4, ne
	cset	w0, ne
	bl	_assert
	ldr	x8, [x20]
Lloh9:
	adrp	x9, _photo_type_album_id@GOTPAGE
Lloh10:
	ldr	x9, [x9, _photo_type_album_id@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_9
; %bb.12:                               ;   in Loop: Header=BB0_11 Depth=1
	ldr	w27, [x20, #8]
	cmp	w23, w27
	b.ne	LBB0_14
; %bb.13:                               ;   in Loop: Header=BB0_11 Depth=1
	mov	x28, x26
	b	LBB0_22
LBB0_14:                                ;   in Loop: Header=BB0_11 Depth=1
Lloh12:
	adrp	x0, l_.str.1@PAGE
Lloh13:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x21
	mov	x2, x27
	mov	x3, x19
	bl	_dbg
	mov	x0, x27
	bl	_check_album_id
	cbz	w0, LBB0_2
; %bb.15:                               ;   in Loop: Header=BB0_11 Depth=1
	tbz	w27, #31, LBB0_17
; %bb.16:                               ;   in Loop: Header=BB0_11 Depth=1
	mov	x0, x22
	mov	x1, x27
	bl	_user_create_album_force
LBB0_17:                                ;   in Loop: Header=BB0_11 Depth=1
	mov	x0, x22
	mov	x1, x27
	bl	_user_get_photo_data
	cbz	x0, LBB0_2
; %bb.18:                               ;   in Loop: Header=BB0_11 Depth=1
	mov	x28, x0
	bl	_data_get_cnt
	mov	x25, x0
	mov	x0, x27
	bl	_GET_MAX_PHOTOS
	cmp	x25, x0
	b.ge	LBB0_6
; %bb.19:                               ;   in Loop: Header=BB0_11 Depth=1
	mov	x0, x26
	mov	x1, x21
	bl	_data_get_local_id_by_id
	mov	x25, x0
	mvn	w8, w0
	lsr	w0, w8, #31
	bl	_assert
	add	x2, sp, #32
	mov	x0, x26
	mov	x1, x25
	bl	_data_get_actual_object
	lsr	x8, x0, #63
	eor	w0, w8, #0x1
	bl	_assert
	ldr	x0, [sp, #32]
	ldr	w1, [sp, #40]
Lloh14:
	adrp	x8, _PHOTO_TYPE@GOTPAGE
Lloh15:
	ldr	x8, [x8, _PHOTO_TYPE@GOTPAGEOFF]
Lloh16:
	ldr	w2, [x8]
	bl	_event_update_event
	mov	x25, x0
	ldr	x8, [sp, #32]
	cmp	x0, x8
	b.ne	LBB0_21
; %bb.20:                               ;   in Loop: Header=BB0_11 Depth=1
	mov	x0, x25
	bl	_event_dup
	mov	x25, x0
LBB0_21:                                ;   in Loop: Header=BB0_11 Depth=1
	mov	x0, x26
	mov	x1, x21
	bl	_data_del
	mov	x0, x28
	mov	x1, x21
	bl	_data_add_object
	mov	x26, x0
	mvn	w8, w0
	lsr	w0, w8, #31
	bl	_assert
Lloh17:
	adrp	x8, _ch_event@GOTPAGE
Lloh18:
	ldr	x8, [x8, _ch_event@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	str	w8, [sp, #24]
	str	x25, [sp, #16]
	add	x1, sp, #16
	mov	x0, x28
	mov	x2, x26
	bl	_data_add_change
	ldr	x0, [sp, #8]                    ; 8-byte Folded Reload
	mov	x1, x21
	mov	x2, x27
	bl	_lookup_set
Lloh20:
	adrp	x25, _photo_type_id@GOTPAGE
Lloh21:
	ldr	x25, [x25, _photo_type_id@GOTPAGEOFF]
LBB0_22:                                ;   in Loop: Header=BB0_11 Depth=1
Lloh22:
	adrp	x27, _photo_type_owner_id@GOTPAGE
Lloh23:
	ldr	x27, [x27, _photo_type_owner_id@GOTPAGEOFF]
	b	LBB0_10
LBB0_23:
	mov	x28, x26
LBB0_24:
	mov	x0, x28
	mov	x1, x21
	ldr	x2, [sp]                        ; 8-byte Folded Reload
	mov	x3, x19
	mov	w4, #0
	bl	_user_change_data
	mvn	w8, w0
	lsr	w0, w8, #31
	b	LBB0_2
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"user_change_photo %d: photo_id = %d, field_changes_n = %d\n"

	.comm	_write_only,8,3                 ; @write_only
	.comm	_photo_type_id,8,3              ; @photo_type_id
	.comm	_photo_type_owner_id,8,3        ; @photo_type_owner_id
	.comm	_photo_type_album_id,8,3        ; @photo_type_album_id
l_.str.1:                               ; @.str.1
	.asciz	"Move (photo_id = %d) to (album_id = %d) (field_changes_n = %d)\n"

	.comm	_PHOTO_TYPE,4,2                 ; @PHOTO_TYPE
	.comm	_ch_event,4,2                   ; @ch_event
.subsections_via_symbols
