	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_user_add_photo_location_engine ## -- Begin function user_add_photo_location_engine
	.p2align	4, 0x90
_user_add_photo_location_engine:        ## @user_add_photo_location_engine
	.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
	xorl	%ebx, %ebx
	testl	%r9d, %r9d
	jle	LBB0_20
## %bb.1:
	cmpl	$0, 16(%rbp)
	jle	LBB0_20
## %bb.2:
	movl	%r8d, %r12d
	movl	%ecx, %r13d
	movl	%edx, %r15d
	movl	%esi, %r14d
	movl	%r9d, -56(%rbp)                 ## 4-byte Spill
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	movl	%esi, %edi
	callq	_check_photo_id
	cmpl	$3, %r12d
	ja	LBB0_20
## %bb.3:
	movq	%r13, %rcx
	leal	-123(%r13), %ecx
	cmpb	$-26, %cl
	jb	LBB0_20
## %bb.4:
	testl	%eax, %eax
	je	LBB0_20
## %bb.5:
	movq	_write_only@GOTPCREL(%rip), %rax
	movl	$1, %ebx
	cmpq	$0, (%rax)
	jne	LBB0_20
## %bb.6:
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	callq	_user_loaded
	movsbl	%al, %edi
	callq	_assert
	leaq	-44(%rbp), %r8
	movq	%rbx, %rdi
	movl	%r14d, -52(%rbp)                ## 4-byte Spill
	movl	%r14d, %esi
	movl	%r15d, %edx
	movl	$1, %ecx
	callq	_user_photo_get_location
	testq	%rax, %rax
	je	LBB0_7
## %bb.8:
	movq	%rax, %r14
	movq	_location_buf@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	movl	-44(%rbp), %eax
	testl	%eax, %eax
	movq	%r13, %rcx
	movl	%r15d, -48(%rbp)                ## 4-byte Spill
	jle	LBB0_9
## %bb.10:
	movsbq	(%r14), %rbx
	testq	%rbx, %rbx
	js	LBB0_12
## %bb.11:
	movq	%rdx, %r13
	leaq	1(%rdx), %r15
	shlb	$5, %r12b
	addb	%r12b, %cl
	addb	$-96, %cl
	jmp	LBB0_14
LBB0_7:
	xorl	%ebx, %ebx
	jmp	LBB0_20
LBB0_9:
	movq	%rdx, %r13
	jmp	LBB0_13
LBB0_12:
	movq	_mode@GOTPCREL(%rip), %rax
	movsbq	(%rax), %rax
	addq	%rax, %rbx
	movl	$17, %r15d
	subq	%rbx, %r15
	movq	%rdx, %rdi
	movq	%rdx, -72(%rbp)                 ## 8-byte Spill
	movq	%r14, %rsi
	movl	%r15d, %edx
	callq	_memcpy
	movq	%r13, %rcx
	movq	-72(%rbp), %r13                 ## 8-byte Reload
	negq	%rbx
	addq	%rbx, %r13
	addq	$17, %r13
	addq	%r15, %r14
	movl	-44(%rbp), %eax
LBB0_13:
	leaq	1(%r13), %r15
	shlb	$5, %r12b
	addb	%r12b, %cl
	addb	$-96, %cl
	testl	%eax, %eax
	je	LBB0_18
LBB0_14:
	movsbl	(%r14), %ebx
	testl	%ebx, %ebx
	jle	LBB0_18
## %bb.15:
	movq	%rcx, %r12
	incq	%r14
	incl	%ebx
	.p2align	4, 0x90
LBB0_16:                                ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_READ_CHAR
	xorl	%edi, %edi
	callq	_assert
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_READ_INT
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_READ_INT
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_READ_INT
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_READ_LONG
	movq	%r15, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	_save_location
	decl	%ebx
	cmpl	$1, %ebx
	ja	LBB0_16
## %bb.17:
	movq	%r12, %rcx
	cmpb	$127, %cl
	je	LBB0_19
LBB0_18:
	movq	32(%rbp), %r9
	movl	24(%rbp), %r8d
	movsbl	%cl, %esi
	movq	%r15, %rdi
	movl	-56(%rbp), %edx                 ## 4-byte Reload
	movl	16(%rbp), %ecx
	callq	_save_location
LBB0_19:
	movb	$0, (%r13)
	movq	_location_buf@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	subl	%ecx, %r15d
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movl	-52(%rbp), %esi                 ## 4-byte Reload
	movl	-48(%rbp), %edx                 ## 4-byte Reload
	movl	%r15d, %r8d
	callq	_user_photo_set_location
	movl	%eax, %ebx
LBB0_20:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_write_only,8,3                 ## @write_only
	.comm	_location_buf,8,3               ## @location_buf
	.comm	_mode,1,0                       ## @mode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_user_add_photo_location_engine ; -- Begin function user_add_photo_location_engine
	.p2align	2
_user_add_photo_location_engine:        ; @user_add_photo_location_engine
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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, x0
	mov	w0, #0
	cmp	w5, #1
	b.lt	LBB0_19
; %bb.1:
	mov	x23, x6
	cmp	w6, #1
	b.lt	LBB0_19
; %bb.2:
	mov	x22, x7
	mov	x24, x5
	mov	x28, x4
	mov	x25, x3
	mov	x19, x2
	mov	x20, x1
	mov	x0, x1
	bl	_check_photo_id
	mov	x8, x0
	mov	w0, #0
	cmp	w28, #3
	b.hi	LBB0_19
; %bb.3:
	sub	w9, w25, #123
	and	w9, w9, #0xff
	cmp	w9, #230
	b.lo	LBB0_19
; %bb.4:
	cbz	w8, LBB0_19
; %bb.5:
Lloh0:
	adrp	x8, _write_only@GOTPAGE
Lloh1:
	ldr	x8, [x8, _write_only@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cbz	x8, LBB0_7
; %bb.6:
	mov	w0, #1
	b	LBB0_19
LBB0_7:
	mov	x0, x21
	bl	_user_loaded
	bl	_assert
	add	x4, sp, #12
	mov	x0, x21
	mov	x1, x20
	mov	x2, x19
	mov	w3, #1
	bl	_user_photo_get_location
	cbz	x0, LBB0_19
; %bb.8:
	mov	x26, x0
Lloh3:
	adrp	x8, _location_buf@GOTPAGE
Lloh4:
	ldr	x8, [x8, _location_buf@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x8]
	ldr	w8, [sp, #12]
	cmp	w8, #1
	b.lt	LBB0_12
; %bb.9:
	ldrsb	x8, [x26]
	str	x9, [sp]                        ; 8-byte Folded Spill
	tbnz	x8, #63, LBB0_11
; %bb.10:
	add	x27, x9, #1
	add	w8, w25, w28, lsl #5
	sub	w25, w8, #96
	b	LBB0_13
LBB0_11:
Lloh6:
	adrp	x9, _mode@GOTPAGE
Lloh7:
	ldr	x9, [x9, _mode@GOTPAGEOFF]
Lloh8:
	ldrsb	x9, [x9]
	mov	w10, #17
	add	x8, x8, x9
	sub	x27, x10, x8
	ldr	x0, [sp]                        ; 8-byte Folded Reload
	mov	x1, x26
	mov	x2, x27
	bl	_memcpy
	ldr	x9, [sp]                        ; 8-byte Folded Reload
	add	x9, x9, x27
	add	x26, x26, x27
	ldr	w8, [sp, #12]
LBB0_12:
	str	x9, [sp]                        ; 8-byte Folded Spill
	add	x27, x9, #1
	add	w9, w25, w28, lsl #5
	sub	w25, w9, #96
	cbz	w8, LBB0_17
LBB0_13:
	ldrsb	w8, [x26], #1
	cmp	w8, #1
	b.lt	LBB0_17
; %bb.14:
	add	w28, w8, #1
LBB0_15:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x26
	mov	w1, #0
	bl	_READ_CHAR
	mov	w0, #0
	bl	_assert
	mov	x0, x26
	mov	w1, #0
	bl	_READ_INT
	mov	x0, x26
	mov	w1, #0
	bl	_READ_INT
	mov	x0, x26
	mov	w1, #0
	bl	_READ_INT
	mov	x0, x26
	mov	x1, #0
	bl	_READ_LONG
	mov	x0, x27
	mov	w1, #0
	mov	w2, #0
	mov	w3, #0
	mov	w4, #0
	mov	x5, #0
	bl	_save_location
	sub	w28, w28, #1
	cmp	w28, #1
	b.hi	LBB0_15
; %bb.16:
	and	w8, w25, #0xff
	cmp	w8, #127
	b.eq	LBB0_18
LBB0_17:
	ldr	x5, [x29, #16]
	sxtb	w1, w25
	mov	x0, x27
	mov	x2, x24
	mov	x3, x23
	mov	x4, x22
	bl	_save_location
LBB0_18:
	ldr	x8, [sp]                        ; 8-byte Folded Reload
	strb	wzr, [x8]
Lloh9:
	adrp	x8, _location_buf@GOTPAGE
Lloh10:
	ldr	x8, [x8, _location_buf@GOTPAGEOFF]
Lloh11:
	ldr	x3, [x8]
	sub	w4, w27, w3
	mov	x0, x21
	mov	x1, x20
	mov	x2, x19
	bl	_user_photo_set_location
LBB0_19:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_write_only,8,3                 ; @write_only
	.comm	_location_buf,8,3               ; @location_buf
	.comm	_mode,1,0                       ; @mode
.subsections_via_symbols
