	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_HPDF_Encrypt_CreateUserKey     ## -- Begin function HPDF_Encrypt_CreateUserKey
	.p2align	4, 0x90
_HPDF_Encrypt_CreateUserKey:            ## @HPDF_Encrypt_CreateUserKey
	.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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r13
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	leaq	L_.str(%rip), %rdi
	callq	_HPDF_PTRACE
	movq	(%r13), %rsi
	movl	8(%r13), %edx
	leaq	-52(%rbp), %rbx
	movq	%rbx, %rdi
	callq	_ARC4Init
	movq	_HPDF_PADDING_STRING@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	16(%r13), %rdx
	movq	_HPDF_PASSWD_LEN@GOTPCREL(%rip), %r12
	movl	(%r12), %ecx
	movq	%rbx, %rdi
	callq	_ARC4CryptBuf
	movq	24(%r13), %rax
	movq	_HPDF_ENCRYPT_R3@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_19
## %bb.1:
	movq	%rsp, -80(%rbp)                 ## 8-byte Spill
	movq	_HPDF_MD5_KEY_LEN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %eax
	movq	%rcx, %rbx
	shlq	$2, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r15
	movl	(%rbx), %eax
	shlq	$2, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r14
	leaq	-100(%rbp), %rbx
	movq	%rbx, %rdi
	callq	_HPDF_MD5Init
	movq	_HPDF_PADDING_STRING@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movl	(%r12), %edx
	movq	_HPDF_MD5_KEY_LEN@GOTPCREL(%rip), %r12
	movq	%rbx, %rdi
	callq	_HPDF_MD5Update
	movq	32(%r13), %rsi
	movq	_HPDF_ID_LEN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_HPDF_MD5Update
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_HPDF_MD5Final
	leaq	L_.str.1(%rip), %rdi
	callq	_HPDF_PTRACE
	movq	(%r13), %rsi
	movl	8(%r13), %edx
	leaq	-52(%rbp), %rbx
	movq	%rbx, %rdi
	callq	_ARC4Init
	movl	(%r12), %ecx
	movq	%rbx, %rdi
	movq	%r15, -88(%rbp)                 ## 8-byte Spill
	movq	%r15, %rsi
	movq	%r14, -64(%rbp)                 ## 8-byte Spill
	movq	%r14, %rdx
	callq	_ARC4CryptBuf
	leaq	L_.str.2(%rip), %rdi
	callq	_HPDF_PTRACE
	movl	$1, %ebx
	movq	%r13, -72(%rbp)                 ## 8-byte Spill
	movq	-88(%rbp), %r14                 ## 8-byte Reload
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_17:                                ##   in Loop: Header=BB0_2 Depth=1
	movl	(%r15), %edx
	movq	%r14, %rdi
	movq	-64(%rbp), %r13                 ## 8-byte Reload
	movq	%r13, %rsi
	callq	_HPDF_MemCpy
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movl	8(%rax), %edx
	leaq	-52(%rbp), %rdi
	movq	%r12, %rsi
	movq	%r15, %r12
	callq	_ARC4Init
	movl	(%r15), %ecx
	leaq	-52(%rbp), %rdi
	movq	%r14, %rsi
	movq	%r13, %rdx
	movq	-72(%rbp), %r13                 ## 8-byte Reload
	callq	_ARC4CryptBuf
	movq	-96(%rbp), %rsp                 ## 8-byte Reload
	incq	%rbx
	cmpq	$20, %rbx
	je	LBB0_18
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_9 Depth 2
                                        ##     Child Loop BB0_14 Depth 2
                                        ##     Child Loop BB0_16 Depth 2
	movq	%rsp, -96(%rbp)                 ## 8-byte Spill
	movq	%r12, %r15
	movl	(%r12), %eax
	shlq	$2, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r12
	movq	%rbx, %rdi
	callq	_HPDF_PTRACE
	movl	8(%r13), %eax
	testl	%eax, %eax
	jle	LBB0_17
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	(%r13), %rcx
	cmpl	$8, %eax
	jb	LBB0_4
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%r12, %rsi
	subq	%rcx, %rsi
	movl	$0, %edx
	cmpq	$32, %rsi
	jb	LBB0_13
## %bb.6:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	%eax, %edx
	andl	$-8, %edx
	movd	%ebx, %xmm0
	pshufd	$0, %xmm0, %xmm0                ## xmm0 = xmm0[0,0,0,0]
	leaq	-8(%rdx), %rsi
	movq	%rsi, %r8
	shrq	$3, %r8
	incq	%r8
	testq	%rsi, %rsi
	je	LBB0_7
## %bb.8:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%r8, %rsi
	andq	$-2, %rsi
	xorl	%edi, %edi
	.p2align	4, 0x90
LBB0_9:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movdqu	(%rcx,%rdi,4), %xmm1
	movdqu	16(%rcx,%rdi,4), %xmm2
	pxor	%xmm0, %xmm1
	pxor	%xmm0, %xmm2
	movdqa	%xmm1, (%r12,%rdi,4)
	movdqa	%xmm2, 16(%r12,%rdi,4)
	movdqu	32(%rcx,%rdi,4), %xmm1
	movdqu	48(%rcx,%rdi,4), %xmm2
	pxor	%xmm0, %xmm1
	pxor	%xmm0, %xmm2
	movdqa	%xmm1, 32(%r12,%rdi,4)
	movdqa	%xmm2, 48(%r12,%rdi,4)
	addq	$16, %rdi
	addq	$-2, %rsi
	jne	LBB0_9
## %bb.10:                              ##   in Loop: Header=BB0_2 Depth=1
	testb	$1, %r8b
	je	LBB0_12
LBB0_11:                                ##   in Loop: Header=BB0_2 Depth=1
	movdqu	(%rcx,%rdi,4), %xmm1
	movdqu	16(%rcx,%rdi,4), %xmm2
	pxor	%xmm0, %xmm1
	pxor	%xmm0, %xmm2
	movdqa	%xmm1, (%r12,%rdi,4)
	movdqa	%xmm2, 16(%r12,%rdi,4)
LBB0_12:                                ##   in Loop: Header=BB0_2 Depth=1
	cmpq	%rax, %rdx
	je	LBB0_17
	jmp	LBB0_13
LBB0_4:                                 ##   in Loop: Header=BB0_2 Depth=1
	xorl	%edx, %edx
LBB0_13:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	%rdx, %r8
	notq	%r8
	addq	%rax, %r8
	movq	%rax, %rdi
	andq	$3, %rdi
	je	LBB0_15
	.p2align	4, 0x90
LBB0_14:                                ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	(%rcx,%rdx,4), %esi
	xorl	%ebx, %esi
	movl	%esi, (%r12,%rdx,4)
	incq	%rdx
	decq	%rdi
	jne	LBB0_14
LBB0_15:                                ##   in Loop: Header=BB0_2 Depth=1
	cmpq	$3, %r8
	jb	LBB0_17
	.p2align	4, 0x90
LBB0_16:                                ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	(%rcx,%rdx,4), %esi
	xorl	%ebx, %esi
	movl	%esi, (%r12,%rdx,4)
	movl	4(%rcx,%rdx,4), %esi
	xorl	%ebx, %esi
	movl	%esi, 4(%r12,%rdx,4)
	movl	8(%rcx,%rdx,4), %esi
	xorl	%ebx, %esi
	movl	%esi, 8(%r12,%rdx,4)
	movl	12(%rcx,%rdx,4), %esi
	xorl	%ebx, %esi
	movl	%esi, 12(%r12,%rdx,4)
	addq	$4, %rdx
	cmpq	%rdx, %rax
	jne	LBB0_16
	jmp	LBB0_17
LBB0_7:                                 ##   in Loop: Header=BB0_2 Depth=1
	xorl	%edi, %edi
	testb	$1, %r8b
	jne	LBB0_11
	jmp	LBB0_12
LBB0_18:
	movq	16(%r13), %rdi
	movq	_HPDF_PASSWD_LEN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%esi, %esi
	callq	_HPDF_MemSet
	movq	16(%r13), %rdi
	movl	(%r12), %edx
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	callq	_HPDF_MemCpy
	movq	-80(%rbp), %rsp                 ## 8-byte Reload
LBB0_19:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_21
## %bb.20:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_21:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	" HPDF_Encrypt_CreateUserKey\n"

	.comm	_HPDF_PADDING_STRING,8,3        ## @HPDF_PADDING_STRING
	.comm	_HPDF_PASSWD_LEN,4,2            ## @HPDF_PASSWD_LEN
	.comm	_HPDF_ENCRYPT_R3,8,3            ## @HPDF_ENCRYPT_R3
	.comm	_HPDF_MD5_KEY_LEN,4,2           ## @HPDF_MD5_KEY_LEN
	.comm	_HPDF_ID_LEN,4,2                ## @HPDF_ID_LEN
L_.str.1:                               ## @.str.1
	.asciz	"@ Algorithm 3.5 step 3\n"

L_.str.2:                               ## @.str.2
	.asciz	"@ Algorithm 3.5 step 4\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_HPDF_Encrypt_CreateUserKey     ; -- Begin function HPDF_Encrypt_CreateUserKey
	.p2align	2
_HPDF_Encrypt_CreateUserKey:            ; @HPDF_Encrypt_CreateUserKey
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	sub	sp, sp, #16
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-88]
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_HPDF_PTRACE
	ldr	x1, [x19]
	ldr	w2, [x19, #8]
	sub	x0, x29, #92
	bl	_ARC4Init
Lloh5:
	adrp	x22, _HPDF_PADDING_STRING@GOTPAGE
Lloh6:
	ldr	x22, [x22, _HPDF_PADDING_STRING@GOTPAGEOFF]
	ldr	x1, [x22]
	ldr	x2, [x19, #16]
Lloh7:
	adrp	x25, _HPDF_PASSWD_LEN@GOTPAGE
Lloh8:
	ldr	x25, [x25, _HPDF_PASSWD_LEN@GOTPAGEOFF]
	ldr	w3, [x25]
	sub	x0, x29, #92
	bl	_ARC4CryptBuf
	ldr	x8, [x19, #24]
Lloh9:
	adrp	x9, _HPDF_ENCRYPT_R3@GOTPAGE
Lloh10:
	ldr	x9, [x9, _HPDF_ENCRYPT_R3@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_12
; %bb.1:
	mov	x24, sp
Lloh12:
	adrp	x26, _HPDF_MD5_KEY_LEN@GOTPAGE
Lloh13:
	ldr	x26, [x26, _HPDF_MD5_KEY_LEN@GOTPAGEOFF]
	ldr	w8, [x26]
	lsl	x8, x8, #2
	mov	x9, x8
Lloh14:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh15:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0x7fffffff0
	sub	x21, x9, x8
	mov	sp, x21
	ldr	w8, [x26]
	lsl	x8, x8, #2
	mov	x9, x8
Lloh16:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh17:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0x7fffffff0
	sub	x20, x9, x8
	mov	sp, x20
	sub	x0, x29, #96
	bl	_HPDF_MD5Init
	ldr	x1, [x22]
	ldr	w2, [x25]
	sub	x0, x29, #96
	bl	_HPDF_MD5Update
	ldr	x1, [x19, #32]
Lloh18:
	adrp	x8, _HPDF_ID_LEN@GOTPAGE
Lloh19:
	ldr	x8, [x8, _HPDF_ID_LEN@GOTPAGEOFF]
Lloh20:
	ldr	w2, [x8]
	sub	x0, x29, #96
	bl	_HPDF_MD5Update
	sub	x1, x29, #96
	mov	x0, x21
	bl	_HPDF_MD5Final
Lloh21:
	adrp	x0, l_.str.1@PAGE
Lloh22:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_HPDF_PTRACE
	ldr	x1, [x19]
	ldr	w2, [x19, #8]
	sub	x0, x29, #92
	bl	_ARC4Init
	ldr	w3, [x26]
	sub	x0, x29, #92
	mov	x1, x21
	mov	x2, x20
	bl	_ARC4CryptBuf
Lloh23:
	adrp	x0, l_.str.2@PAGE
Lloh24:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_HPDF_PTRACE
	mov	w22, #1
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldr	w2, [x26]
	mov	x0, x21
	mov	x1, x20
	bl	_HPDF_MemCpy
	ldr	w2, [x19, #8]
	sub	x0, x29, #92
	mov	x1, x23
	bl	_ARC4Init
	ldr	w3, [x26]
	sub	x0, x29, #92
	mov	x1, x21
	mov	x2, x20
	bl	_ARC4CryptBuf
	mov	sp, x27
	add	x22, x22, #1
	cmp	x22, #20
	b.eq	LBB0_11
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_7 Depth 2
                                        ;     Child Loop BB0_10 Depth 2
	mov	x27, sp
	ldr	w8, [x26]
	lsl	x8, x8, #2
	mov	x9, x8
Lloh25:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh26:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0x7fffffff0
	sub	x23, x9, x8
	mov	sp, x23
	mov	x0, x22
	bl	_HPDF_PTRACE
	ldr	w8, [x19, #8]
	cmp	w8, #1
	b.lt	LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x9, #0
	ldr	x10, [x19]
	cmp	w8, #16
	b.lo	LBB0_9
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	sub	x11, x23, x10
	cmp	x11, #64
	b.lo	LBB0_9
; %bb.6:                                ;   in Loop: Header=BB0_3 Depth=1
	and	x9, x8, #0xfffffff0
	dup.4s	v0, w22
	add	x11, x23, #32
	add	x12, x10, #32
	mov	x13, x9
LBB0_7:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldp	q1, q2, [x12, #-32]
	ldp	q3, q4, [x12], #64
	eor.16b	v1, v1, v0
	eor.16b	v2, v2, v0
	eor.16b	v3, v3, v0
	eor.16b	v4, v4, v0
	stp	q1, q2, [x11, #-32]
	stp	q3, q4, [x11], #64
	subs	x13, x13, #16
	b.ne	LBB0_7
; %bb.8:                                ;   in Loop: Header=BB0_3 Depth=1
	cmp	x9, x8
	b.eq	LBB0_2
LBB0_9:                                 ;   in Loop: Header=BB0_3 Depth=1
	lsl	x12, x9, #2
	add	x11, x23, x12
	add	x10, x10, x12
	sub	x8, x8, x9
LBB0_10:                                ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w9, [x10], #4
	eor	w9, w9, w22
	str	w9, [x11], #4
	subs	x8, x8, #1
	b.ne	LBB0_10
	b	LBB0_2
LBB0_11:
	ldr	x0, [x19, #16]
	ldr	w2, [x25]
	mov	w1, #0
	bl	_HPDF_MemSet
	ldr	x0, [x19, #16]
	ldr	w2, [x26]
	mov	x1, x20
	bl	_HPDF_MemCpy
	mov	sp, x24
LBB0_12:
	ldur	x8, [x29, #-88]
Lloh27:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh28:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh29:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_14
; %bb.13:
	sub	sp, x29, #80
	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
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_14:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	" HPDF_Encrypt_CreateUserKey\n"

	.comm	_HPDF_PADDING_STRING,8,3        ; @HPDF_PADDING_STRING
	.comm	_HPDF_PASSWD_LEN,4,2            ; @HPDF_PASSWD_LEN
	.comm	_HPDF_ENCRYPT_R3,8,3            ; @HPDF_ENCRYPT_R3
	.comm	_HPDF_MD5_KEY_LEN,4,2           ; @HPDF_MD5_KEY_LEN
	.comm	_HPDF_ID_LEN,4,2                ; @HPDF_ID_LEN
l_.str.1:                               ; @.str.1
	.asciz	"@ Algorithm 3.5 step 3\n"

l_.str.2:                               ; @.str.2
	.asciz	"@ Algorithm 3.5 step 4\n"

.subsections_via_symbols
