	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_radius_msg_add_mppe_keys       ## -- Begin function radius_msg_add_mppe_keys
	.p2align	4, 0x90
_radius_msg_add_mppe_keys:              ## @radius_msg_add_mppe_keys
	.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
	movq	%r9, %r15
	movq	%r8, %rbx
	movq	%rcx, -80(%rbp)                 ## 8-byte Spill
	movq	%rdx, -72(%rbp)                 ## 8-byte Spill
	movq	%rsi, -64(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r12
	movq	_RADIUS_VENDOR_ID_MICROSOFT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_htonl
	movl	%eax, -48(%rbp)
	leal	30(%r15), %edi
	callq	_os_malloc
	xorl	%r13d, %r13d
	testq	%rax, %rax
	je	LBB0_6
## %bb.1:
	movq	%rax, %r14
	leaq	-48(%rbp), %rsi
	movq	%rax, %rdi
	movl	$4, %edx
	callq	_os_memcpy
	movq	_RADIUS_VENDOR_ATTR_MS_MPPE_SEND_KEY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 20(%r14)
	leaq	-44(%rbp), %rdi
	movl	$4, %esi
	callq	_os_get_random
	testq	%rax, %rax
	js	LBB0_2
## %bb.3:
	leaq	24(%r14), %rdi
	movl	$32768, %esi                    ## imm = 0x8000
	orl	-44(%rbp), %esi
	movl	%esi, -44(%rbp)
	callq	_WPA_PUT_BE16
	movq	%r14, %rax
	addq	$32, %rax
	movl	-44(%rbp), %edx
	movq	%rbx, %rdi
	leaq	-56(%rbp), %rbx
	movq	%r15, %rsi
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movq	-72(%rbp), %r8                  ## 8-byte Reload
	movq	-80(%rbp), %r9                  ## 8-byte Reload
	pushq	%rbx
	pushq	%rax
	callq	_encrypt_ms_key
	addq	$16, %rsp
	movl	-56(%rbp), %ecx
	leal	10(%rcx), %eax
	movl	%eax, 16(%r14)
	movq	_RADIUS_ATTR_VENDOR_SPECIFIC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	addl	$14, %ecx
	movq	%r12, %r15
	movq	%r12, %rdi
	movq	%r14, %rdx
                                        ## kill: def $ecx killed $ecx killed $rcx
	callq	_radius_msg_add_attr
	movq	%rax, %rbx
	movq	%r14, %rdi
	callq	_os_free
	testq	%rbx, %rbx
	je	LBB0_6
## %bb.4:
	movq	24(%rbp), %rbx
	leal	30(%rbx), %edi
	callq	_os_malloc
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	movq	%rax, %r14
	movq	16(%rbp), %r12
	leaq	-48(%rbp), %rsi
	movq	%rax, %rdi
	movl	$4, %edx
	callq	_os_memcpy
	movq	_RADIUS_VENDOR_ATTR_MS_MPPE_RECV_KEY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 20(%r14)
	leaq	24(%r14), %rdi
	movl	-44(%rbp), %esi
	xorl	$1, %esi
	movl	%esi, -44(%rbp)
	callq	_WPA_PUT_BE16
	movq	%r14, %rax
	addq	$32, %rax
	movl	-44(%rbp), %edx
	movq	%r12, %rdi
	movq	%rbx, %rsi
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movq	-72(%rbp), %r8                  ## 8-byte Reload
	movq	-80(%rbp), %r9                  ## 8-byte Reload
	leaq	-56(%rbp), %rbx
	pushq	%rbx
	pushq	%rax
	callq	_encrypt_ms_key
	addq	$16, %rsp
	movl	-56(%rbp), %ecx
	leal	10(%rcx), %eax
	movl	%eax, 16(%r14)
	movq	_RADIUS_ATTR_VENDOR_SPECIFIC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	addl	$14, %ecx
	movq	%r15, %rdi
	movq	%r14, %rdx
                                        ## kill: def $ecx killed $ecx killed $rcx
	callq	_radius_msg_add_attr
	movq	%rax, %rbx
	movq	%r14, %rdi
	callq	_os_free
	xorl	%r13d, %r13d
	testq	%rbx, %rbx
	setne	%r13b
	jmp	LBB0_6
LBB0_2:
	movq	%r14, %rdi
	callq	_os_free
LBB0_6:
	movl	%r13d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_RADIUS_VENDOR_ID_MICROSOFT,4,2 ## @RADIUS_VENDOR_ID_MICROSOFT
	.comm	_RADIUS_VENDOR_ATTR_MS_MPPE_SEND_KEY,4,2 ## @RADIUS_VENDOR_ATTR_MS_MPPE_SEND_KEY
	.comm	_RADIUS_ATTR_VENDOR_SPECIFIC,4,2 ## @RADIUS_ATTR_VENDOR_SPECIFIC
	.comm	_RADIUS_VENDOR_ATTR_MS_MPPE_RECV_KEY,4,2 ## @RADIUS_VENDOR_ATTR_MS_MPPE_RECV_KEY
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_radius_msg_add_mppe_keys       ; -- Begin function radius_msg_add_mppe_keys
	.p2align	2
_radius_msg_add_mppe_keys:              ; @radius_msg_add_mppe_keys
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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	x20, x7
	mov	x21, x6
	mov	x25, x5
	mov	x27, x4
	mov	x22, x3
	mov	x23, x2
	mov	x24, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _RADIUS_VENDOR_ID_MICROSOFT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _RADIUS_VENDOR_ID_MICROSOFT@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_htonl
	str	w0, [sp, #28]
	add	w0, w25, #30
	bl	_os_malloc
	cbz	x0, LBB0_7
; %bb.1:
	mov	x26, x0
	add	x1, sp, #28
	mov	w2, #4
	bl	_os_memcpy
Lloh3:
	adrp	x8, _RADIUS_VENDOR_ATTR_MS_MPPE_SEND_KEY@GOTPAGE
Lloh4:
	ldr	x8, [x8, _RADIUS_VENDOR_ATTR_MS_MPPE_SEND_KEY@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	str	w8, [x26, #20]
	add	x0, sp, #12
	mov	w1, #4
	bl	_os_get_random
	tbnz	x0, #63, LBB0_5
; %bb.2:
	add	x0, x26, #24
	ldr	w8, [sp, #12]
	orr	w1, w8, #0x8000
	str	w1, [sp, #12]
	bl	_WPA_PUT_BE16
	add	x6, x26, #32
	ldr	w2, [sp, #12]
	add	x7, sp, #16
	mov	x0, x27
	mov	x1, x25
	mov	x3, x24
	mov	x4, x23
	mov	x5, x22
	bl	_encrypt_ms_key
	ldr	w8, [sp, #16]
	add	w9, w8, #10
	str	w9, [x26, #16]
Lloh6:
	adrp	x27, _RADIUS_ATTR_VENDOR_SPECIFIC@GOTPAGE
Lloh7:
	ldr	x27, [x27, _RADIUS_ATTR_VENDOR_SPECIFIC@GOTPAGEOFF]
	ldr	w1, [x27]
	add	w3, w8, #14
	mov	x0, x19
	mov	x2, x26
	bl	_radius_msg_add_attr
	mov	x25, x0
	mov	x0, x26
	bl	_os_free
	cbz	x25, LBB0_6
; %bb.3:
	add	w0, w20, #30
	bl	_os_malloc
	cbz	x0, LBB0_7
; %bb.4:
	mov	x25, x0
	add	x1, sp, #28
	mov	w2, #4
	bl	_os_memcpy
Lloh8:
	adrp	x8, _RADIUS_VENDOR_ATTR_MS_MPPE_RECV_KEY@GOTPAGE
Lloh9:
	ldr	x8, [x8, _RADIUS_VENDOR_ATTR_MS_MPPE_RECV_KEY@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	str	w8, [x25, #20]
	add	x0, x25, #24
	ldr	w8, [sp, #12]
	eor	w1, w8, #0x1
	str	w1, [sp, #12]
	bl	_WPA_PUT_BE16
	add	x6, x25, #32
	ldr	w2, [sp, #12]
	add	x7, sp, #16
	mov	x0, x21
	mov	x1, x20
	mov	x3, x24
	mov	x4, x23
	mov	x5, x22
	bl	_encrypt_ms_key
	ldr	w8, [sp, #16]
	add	w9, w8, #10
	str	w9, [x25, #16]
	ldr	w1, [x27]
	add	w3, w8, #14
	mov	x0, x19
	mov	x2, x25
	bl	_radius_msg_add_attr
	mov	x19, x0
	mov	x0, x25
	bl	_os_free
	cmp	x19, #0
	cset	w0, ne
	b	LBB0_7
LBB0_5:
	mov	x0, x26
	bl	_os_free
LBB0_6:
	mov	w0, #0
LBB0_7:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_RADIUS_VENDOR_ID_MICROSOFT,4,2 ; @RADIUS_VENDOR_ID_MICROSOFT
	.comm	_RADIUS_VENDOR_ATTR_MS_MPPE_SEND_KEY,4,2 ; @RADIUS_VENDOR_ATTR_MS_MPPE_SEND_KEY
	.comm	_RADIUS_ATTR_VENDOR_SPECIFIC,4,2 ; @RADIUS_ATTR_VENDOR_SPECIFIC
	.comm	_RADIUS_VENDOR_ATTR_MS_MPPE_RECV_KEY,4,2 ; @RADIUS_VENDOR_ATTR_MS_MPPE_RECV_KEY
.subsections_via_symbols
