	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_tl_do_change_photo             ## -- Begin function tl_do_change_photo
	.p2align	4, 0x90
_tl_do_change_photo:                    ## @tl_do_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	(%rdi), %r14
	movl	8(%r14), %edi
	callq	_check_photo_id
	xorl	%edi, %edi
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	movq	(%r14), %rax
	testq	%rax, %rax
	jle	LBB0_3
## %bb.2:
	movq	_MAX_EVENT_SIZE@GOTPCREL(%rip), %rcx
	xorl	%edi, %edi
	cmpq	(%rcx), %rax
	setl	%dil
LBB0_3:
	callq	_assert
	movl	12(%r14), %edi
	callq	_conv_uid
	movq	%rax, %rbx
	xorl	%edi, %edi
	testq	%rax, %rax
	setne	%dil
	callq	_assert
	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_4
## %bb.5:
	movq	_PHOTO_TYPE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	20(%r14), %esi
	movl	16(%r14), %edx
	movq	(%r14), %rcx
	callq	_rpc_get_fields
	testq	%rax, %rax
	js	LBB0_6
## %bb.7:
	movq	_field_changes_n@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_8
## %bb.9:
	movl	8(%r14), %esi
	movl	12(%r14), %edi
	movq	_LEV_PHOTO_CHANGE_PHOTO@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_do_change_data
	movl	%eax, %r12d
	andl	$1, %r12d
	jmp	LBB0_10
LBB0_4:
	movl	$-2, %eax
	jmp	LBB0_20
LBB0_6:
	movq	_TL_ERROR_BAD_VALUE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	callq	_tl_fetch_set_error_format
	movl	$-1, %eax
	jmp	LBB0_20
LBB0_8:
	movl	$1, %r12d
LBB0_10:
	movq	_location_changes_n@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jle	LBB0_16
## %bb.11:
	movl	$56, %ebx
	xorl	%r13d, %r13d
	movq	_photo_type__original_location@GOTPCREL(%rip), %r15
	jmp	LBB0_12
	.p2align	4, 0x90
LBB0_14:                                ##   in Loop: Header=BB0_12 Depth=1
	movl	-28(%rax,%rbx), %ecx
	movl	-32(%rax,%rbx), %r8d
	movl	-36(%rax,%rbx), %r9d
	movl	-40(%rax,%rbx), %r10d
	movl	-48(%rax,%rbx), %r11d
	movl	-44(%rax,%rbx), %eax
	subq	$8, %rsp
	pushq	%r11
	pushq	%rax
	pushq	%r10
	callq	_do_add_photo_location
LBB0_15:                                ##   in Loop: Header=BB0_12 Depth=1
	addq	$32, %rsp
	andl	%eax, %r12d
	incq	%r13
	movq	_location_changes_n@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	addq	$64, %rbx
	cmpq	%rax, %r13
	jge	LBB0_16
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	movq	_location_changes@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	-56(%rax,%rbx), %rcx
	xorl	%edx, %edx
	cmpq	(%r15), %rcx
	sete	%dl
	cmpq	$0, (%rax,%rbx)
	movl	8(%r14), %esi
	movl	12(%r14), %edi
	je	LBB0_14
## %bb.13:                              ##   in Loop: Header=BB0_12 Depth=1
	movl	-4(%rax,%rbx), %ecx
	movl	-8(%rax,%rbx), %r8d
	movl	-12(%rax,%rbx), %r9d
	movl	-16(%rax,%rbx), %r10d
	movl	-24(%rax,%rbx), %r11d
	movl	-20(%rax,%rbx), %eax
	subq	$8, %rsp
	pushq	%r11
	pushq	%rax
	pushq	%r10
	callq	_do_add_photo_location_engine
	jmp	LBB0_15
LBB0_16:
	testl	%r12d, %r12d
	jne	LBB0_17
## %bb.18:
	movq	_TL_BOOL_FALSE@GOTPCREL(%rip), %rax
	jmp	LBB0_19
LBB0_17:
	movq	_TL_BOOL_TRUE@GOTPCREL(%rip), %rax
LBB0_19:
	movl	(%rax), %edi
	callq	_tl_store_int
	xorl	%eax, %eax
LBB0_20:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MAX_EVENT_SIZE,8,3             ## @MAX_EVENT_SIZE
	.comm	_NOAIO,4,2                      ## @NOAIO
	.comm	_PHOTO_TYPE,4,2                 ## @PHOTO_TYPE
	.comm	_TL_ERROR_BAD_VALUE,4,2         ## @TL_ERROR_BAD_VALUE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Can't parse changes"

	.comm	_field_changes_n,8,3            ## @field_changes_n
	.comm	_LEV_PHOTO_CHANGE_PHOTO,4,2     ## @LEV_PHOTO_CHANGE_PHOTO
	.comm	_location_changes_n,4,2         ## @location_changes_n
	.comm	_location_changes,8,3           ## @location_changes
	.comm	_photo_type__original_location,8,3 ## @photo_type__original_location
	.comm	_TL_BOOL_TRUE,4,2               ## @TL_BOOL_TRUE
	.comm	_TL_BOOL_FALSE,4,2              ## @TL_BOOL_FALSE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_tl_do_change_photo             ; -- Begin function tl_do_change_photo
	.p2align	2
_tl_do_change_photo:                    ; @tl_do_change_photo
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	ldr	x20, [x0]
	ldr	w0, [x20, #8]
	bl	_check_photo_id
	cbz	x0, LBB0_4
; %bb.1:
	ldr	x8, [x20]
	cmp	x8, #1
	b.lt	LBB0_3
; %bb.2:
Lloh0:
	adrp	x9, _MAX_EVENT_SIZE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _MAX_EVENT_SIZE@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	cset	w0, lt
	b	LBB0_4
LBB0_3:
	mov	w0, #0
LBB0_4:
	bl	_assert
	ldr	w0, [x20, #12]
	bl	_conv_uid
	mov	x19, x0
	cmp	x0, #0
	cset	w0, ne
	bl	_assert
	ldr	w1, [x19]
Lloh3:
	adrp	x8, _NOAIO@GOTPAGE
Lloh4:
	ldr	x8, [x8, _NOAIO@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_load_user_metafile
	mov	x0, x19
	bl	_user_loaded
	cbz	w0, LBB0_8
; %bb.5:
Lloh6:
	adrp	x8, _PHOTO_TYPE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _PHOTO_TYPE@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
	ldp	w2, w1, [x20, #16]
	ldr	x3, [x20]
	bl	_rpc_get_fields
	tbnz	x0, #63, LBB0_9
; %bb.6:
Lloh9:
	adrp	x8, _field_changes_n@GOTPAGE
Lloh10:
	ldr	x8, [x8, _field_changes_n@GOTPAGEOFF]
Lloh11:
	ldr	x8, [x8]
	cbz	x8, LBB0_10
; %bb.7:
	ldp	w1, w0, [x20, #8]
Lloh12:
	adrp	x8, _LEV_PHOTO_CHANGE_PHOTO@GOTPAGE
Lloh13:
	ldr	x8, [x8, _LEV_PHOTO_CHANGE_PHOTO@GOTPAGEOFF]
Lloh14:
	ldr	w2, [x8]
	bl	_do_change_data
	and	w19, w0, #0x1
	b	LBB0_11
LBB0_8:
	mov	w0, #-2
	b	LBB0_18
LBB0_9:
Lloh15:
	adrp	x8, _TL_ERROR_BAD_VALUE@GOTPAGE
Lloh16:
	ldr	x8, [x8, _TL_ERROR_BAD_VALUE@GOTPAGEOFF]
Lloh17:
	ldr	w0, [x8]
Lloh18:
	adrp	x1, l_.str@PAGE
Lloh19:
	add	x1, x1, l_.str@PAGEOFF
	bl	_tl_fetch_set_error_format
	mov	w0, #-1
	b	LBB0_18
LBB0_10:
	mov	w19, #1
LBB0_11:
Lloh20:
	adrp	x21, _location_changes_n@GOTPAGE
Lloh21:
	ldr	x21, [x21, _location_changes_n@GOTPAGEOFF]
	ldr	w8, [x21]
	cmp	w8, #1
	b.lt	LBB0_17
; %bb.12:
	mov	x22, #0
	mov	x23, #0
Lloh22:
	adrp	x24, _location_changes@GOTPAGE
Lloh23:
	ldr	x24, [x24, _location_changes@GOTPAGEOFF]
Lloh24:
	adrp	x25, _photo_type__original_location@GOTPAGE
Lloh25:
	ldr	x25, [x25, _photo_type__original_location@GOTPAGEOFF]
	b	LBB0_15
LBB0_13:                                ;   in Loop: Header=BB0_15 Depth=1
	ldp	w4, w3, [x8, #24]
	ldp	w6, w5, [x8, #16]
	ldp	w8, w7, [x8, #8]
	str	w8, [sp]
	bl	_do_add_photo_location
LBB0_14:                                ;   in Loop: Header=BB0_15 Depth=1
	and	w19, w0, w19
	add	x23, x23, #1
	ldrsw	x8, [x21]
	add	x22, x22, #64
	cmp	x23, x8
	b.ge	LBB0_17
LBB0_15:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x24]
	add	x8, x8, x22
	ldr	x9, [x8, #56]
	ldp	w1, w0, [x20, #8]
	ldr	x10, [x8]
	ldr	x11, [x25]
	cmp	x10, x11
	cset	w2, eq
	cbz	x9, LBB0_13
; %bb.16:                               ;   in Loop: Header=BB0_15 Depth=1
	ldp	w4, w3, [x8, #48]
	ldp	w6, w5, [x8, #40]
	ldp	w8, w7, [x8, #32]
	str	w8, [sp]
	bl	_do_add_photo_location_engine
	b	LBB0_14
LBB0_17:
Lloh26:
	adrp	x8, _TL_BOOL_TRUE@GOTPAGE
Lloh27:
	ldr	x8, [x8, _TL_BOOL_TRUE@GOTPAGEOFF]
Lloh28:
	adrp	x9, _TL_BOOL_FALSE@GOTPAGE
Lloh29:
	ldr	x9, [x9, _TL_BOOL_FALSE@GOTPAGEOFF]
	cmp	w19, #0
	csel	x8, x9, x8, eq
	ldr	w0, [x8]
	bl	_tl_store_int
	mov	w0, #0
LBB0_18:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpLdrGot	Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_MAX_EVENT_SIZE,8,3             ; @MAX_EVENT_SIZE
	.comm	_NOAIO,4,2                      ; @NOAIO
	.comm	_PHOTO_TYPE,4,2                 ; @PHOTO_TYPE
	.comm	_TL_ERROR_BAD_VALUE,4,2         ; @TL_ERROR_BAD_VALUE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Can't parse changes"

	.comm	_field_changes_n,8,3            ; @field_changes_n
	.comm	_LEV_PHOTO_CHANGE_PHOTO,4,2     ; @LEV_PHOTO_CHANGE_PHOTO
	.comm	_location_changes_n,4,2         ; @location_changes_n
	.comm	_location_changes,8,3           ; @location_changes
	.comm	_photo_type__original_location,8,3 ; @photo_type__original_location
	.comm	_TL_BOOL_TRUE,4,2               ; @TL_BOOL_TRUE
	.comm	_TL_BOOL_FALSE,4,2              ; @TL_BOOL_FALSE
.subsections_via_symbols
