	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_user_rotate_photo              ## -- Begin function user_rotate_photo
	.p2align	4, 0x90
_user_rotate_photo:                     ## @user_rotate_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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %eax
	andl	$-3, %eax
	xorl	%ebx, %ebx
	cmpl	$1, %eax
	jne	LBB0_27
## %bb.1:
	movl	%edx, %r14d
	movl	%esi, %r15d
	movq	%rdi, %r13
	movl	%esi, %edi
	callq	_check_photo_id
	testl	%eax, %eax
	je	LBB0_27
## %bb.2:
	movq	_write_only@GOTPCREL(%rip), %rax
	movl	$1, %ebx
	cmpq	$0, (%rax)
	jne	LBB0_27
## %bb.3:
	movq	%r13, %rdi
	callq	_user_loaded
	movl	%eax, %edi
	callq	_assert
	xorl	%ebx, %ebx
	leaq	-44(%rbp), %r8
	movq	%r13, %rdi
	movl	%r15d, %esi
	xorl	%edx, %edx
	movl	$1, %ecx
	callq	_user_photo_get_location
	testq	%rax, %rax
	je	LBB0_27
## %bb.4:
	movq	_location_buf@GOTPCREL(%rip), %rcx
	movq	(%rcx), %r12
	cmpl	$0, -44(%rbp)
	movq	%r13, -72(%rbp)                 ## 8-byte Spill
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	jle	LBB0_15
## %bb.5:
	movsbq	(%rax), %rbx
	testq	%rbx, %rbx
	jns	LBB0_15
## %bb.6:
	movq	_mode@GOTPCREL(%rip), %rcx
	movsbq	(%rcx), %rcx
	addq	%rcx, %rbx
	movl	$17, %edx
	subq	%rbx, %rdx
	movq	%rdx, -64(%rbp)                 ## 8-byte Spill
	movq	%r12, %rdi
	movq	%rax, %rsi
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_memcpy
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	leaq	(%r12,%rdi), %rax
	negq	%rbx
	movb	16(%r12,%rbx), %dl
	leal	-49(%rdx), %esi
	xorl	%ecx, %ecx
	cmpb	$2, %sil
	ja	LBB0_7
## %bb.8:
	movb	-2(%rax), %bl
	addb	$-119, %bl
	cmpb	$3, %bl
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	ja	LBB0_10
## %bb.9:
	leaq	(%r12,%rdi), %rax
	decq	%rax
	movsbl	%dl, %ecx
	movq	_location_buf@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	incb	(%rdx)
	movb	-1(%rax), %dl
	jmp	LBB0_10
LBB0_7:
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
LBB0_10:
	addb	$-123, %dl
	cmpb	$-5, %dl
	ja	LBB0_12
## %bb.11:
	movb	$120, (%rax)
	incq	%rax
	movq	_location_buf@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	decb	(%rdx)
LBB0_12:
	addq	%rdi, %rsi
	movl	%ecx, %edx
	addl	%r14d, %edx
	addl	%r14d, %ecx
	addl	$3, %ecx
	testw	%dx, %dx
	cmovnsl	%edx, %ecx
	andl	$65532, %ecx                    ## imm = 0xFFFC
	subw	%cx, %dx
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	je	LBB0_14
## %bb.13:
	addb	$48, %dl
	movb	%dl, (%rax)
	incq	%rax
	movq	_location_buf@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	decb	(%rcx)
LBB0_14:
	movq	%rax, %r12
LBB0_15:
	movq	%r12, -64(%rbp)                 ## 8-byte Spill
	leaq	1(%r12), %r13
	cmpl	$0, -44(%rbp)
	je	LBB0_23
## %bb.16:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	leaq	1(%rax), %r12
	movsbl	(%rax), %ebx
	testl	%ebx, %ebx
	jle	LBB0_20
## %bb.17:
	incl	%ebx
	.p2align	4, 0x90
LBB0_18:                                ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_READ_CHAR
	xorl	%edi, %edi
	callq	_assert
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_READ_INT
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_READ_INT
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_READ_INT
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_READ_LONG
	decl	%ebx
	cmpl	$1, %ebx
	jg	LBB0_18
## %bb.19:
	cmpl	$0, -44(%rbp)
	je	LBB0_23
LBB0_20:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movsbl	(%rax), %ebx
	testl	%ebx, %ebx
	jle	LBB0_23
## %bb.21:
	shll	$5, %r14d
	andl	$96, %r14d
	incl	%ebx
	.p2align	4, 0x90
LBB0_22:                                ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_READ_CHAR
	xorl	%edi, %edi
	callq	_assert
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_READ_INT
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_READ_INT
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_READ_INT
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_READ_LONG
	movq	%r13, %rdi
	movl	%r14d, %esi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	_save_location
	decl	%ebx
	cmpl	$1, %ebx
	jg	LBB0_22
LBB0_23:
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movb	$0, (%rax)
	cmpl	$0, -44(%rbp)
	je	LBB0_24
## %bb.25:
	xorl	%edi, %edi
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	cmpb	$0, (%rax)
	sete	%dil
	jmp	LBB0_26
LBB0_24:
	movl	$1, %edi
LBB0_26:
	callq	_assert
	movq	_location_buf@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	subl	%ecx, %r13d
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movl	%r15d, %esi
	xorl	%edx, %edx
	movl	%r13d, %r8d
	callq	_user_photo_set_location
	movl	%eax, %ebx
LBB0_27:
	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_rotate_photo              ; -- Begin function user_rotate_photo
	.p2align	2
_user_rotate_photo:                     ; @user_rotate_photo
	.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
	and	w8, w2, #0xfffffffd
	cmp	w8, #1
	b.ne	LBB0_4
; %bb.1:
	mov	x23, x2
	mov	x19, x1
	mov	x20, x0
	mov	x0, x1
	bl	_check_photo_id
	cbz	w0, LBB0_5
; %bb.2:
Lloh0:
	adrp	x8, _write_only@GOTPAGE
Lloh1:
	ldr	x8, [x8, _write_only@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cbz	x8, LBB0_6
; %bb.3:
	mov	w0, #1
	b	LBB0_5
LBB0_4:
	mov	w0, #0
LBB0_5:
	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
LBB0_6:
	mov	x0, x20
	bl	_user_loaded
	bl	_assert
	add	x4, sp, #12
	mov	x0, x20
	mov	x1, x19
	mov	w2, #0
	mov	w3, #1
	bl	_user_photo_get_location
	cbz	x0, LBB0_5
; %bb.7:
	mov	x21, x0
Lloh3:
	adrp	x26, _location_buf@GOTPAGE
Lloh4:
	ldr	x26, [x26, _location_buf@GOTPAGEOFF]
	ldr	x22, [x26]
	ldr	w8, [sp, #12]
	cmp	w8, #1
	b.lt	LBB0_17
; %bb.8:
	ldrsb	x8, [x21]
	tbz	x8, #63, LBB0_17
; %bb.9:
Lloh5:
	adrp	x9, _mode@GOTPAGE
Lloh6:
	ldr	x9, [x9, _mode@GOTPAGEOFF]
Lloh7:
	ldrsb	x9, [x9]
	mov	w10, #17
	add	x8, x8, x9
	sub	x24, x10, x8
	mov	x0, x22
	mov	x1, x21
	mov	x2, x24
	bl	_memcpy
	add	x22, x22, x24
	mov	x10, x22
	ldrsb	w8, [x10, #-1]!
	and	w9, w8, #0xff
	sub	w11, w8, #49
	cmp	w11, #2
	b.hi	LBB0_12
; %bb.10:
	ldurb	w11, [x22, #-2]
	sub	w11, w11, #119
	cmp	w11, #3
	b.hi	LBB0_12
; %bb.11:
	ldr	x9, [x26]
	ldrb	w11, [x9]
	add	w11, w11, #1
	strb	w11, [x9]
	ldurb	w9, [x10, #-1]
	mov	x22, x10
	b	LBB0_13
LBB0_12:
	mov	w8, #0
LBB0_13:
	add	x21, x21, x24
	sub	w9, w9, #123
	and	w9, w9, #0xff
	cmp	w9, #251
	b.hi	LBB0_15
; %bb.14:
	mov	w9, #120
	strb	w9, [x22], #1
	ldr	x9, [x26]
	ldrb	w10, [x9]
	sub	w10, w10, #1
	strb	w10, [x9]
LBB0_15:
	add	w8, w8, w23
	sxth	w9, w8
	ubfx	w9, w9, #29, #2
	add	w9, w8, w9
	and	w9, w9, #0xfffffffc
	sub	w8, w8, w9
	tst	w8, #0xffff
	b.eq	LBB0_17
; %bb.16:
	add	w8, w8, #48
	strb	w8, [x22], #1
	ldr	x8, [x26]
	ldrb	w9, [x8]
	sub	w9, w9, #1
	strb	w9, [x8]
LBB0_17:
	add	x24, x22, #1
	ldr	w8, [sp, #12]
	cbz	w8, LBB0_25
; %bb.18:
	add	x25, x21, #1
	ldrsb	w8, [x21]
	cmp	w8, #1
	b.lt	LBB0_22
; %bb.19:
	add	w27, w8, #1
LBB0_20:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x25
	mov	w1, #0
	bl	_READ_CHAR
	mov	w0, #0
	bl	_assert
	mov	x0, x25
	mov	w1, #0
	bl	_READ_INT
	mov	x0, x25
	mov	w1, #0
	bl	_READ_INT
	mov	x0, x25
	mov	w1, #0
	bl	_READ_INT
	mov	x0, x25
	mov	x1, #0
	bl	_READ_LONG
	sub	w27, w27, #1
	cmp	w27, #1
	b.gt	LBB0_20
; %bb.21:
	ldr	w8, [sp, #12]
	cbz	w8, LBB0_25
LBB0_22:
	ldrsb	w8, [x21]
	cmp	w8, #1
	b.lt	LBB0_25
; %bb.23:
	ubfiz	w23, w23, #5, #2
	add	w27, w8, #1
LBB0_24:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x25
	mov	w1, #0
	bl	_READ_CHAR
	mov	w0, #0
	bl	_assert
	mov	x0, x25
	mov	w1, #0
	bl	_READ_INT
	mov	x0, x25
	mov	w1, #0
	bl	_READ_INT
	mov	x0, x25
	mov	w1, #0
	bl	_READ_INT
	mov	x0, x25
	mov	x1, #0
	bl	_READ_LONG
	mov	x0, x24
	mov	x1, x23
	mov	w2, #0
	mov	w3, #0
	mov	w4, #0
	mov	x5, #0
	bl	_save_location
	sub	w27, w27, #1
	cmp	w27, #1
	b.gt	LBB0_24
LBB0_25:
	strb	wzr, [x22]
	ldr	w8, [sp, #12]
	cbz	w8, LBB0_27
; %bb.26:
	ldrb	w8, [x21]
	cmp	w8, #0
	cset	w0, eq
	b	LBB0_28
LBB0_27:
	mov	w0, #1
LBB0_28:
	bl	_assert
	ldr	x3, [x26]
	sub	w4, w24, w3
	mov	x0, x20
	mov	x1, x19
	mov	w2, #0
	bl	_user_photo_set_location
	b	LBB0_5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.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
