	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function eap_ttls_build_phase2_mschapv2
_eap_ttls_build_phase2_mschapv2:        ## @eap_ttls_build_phase2_mschapv2
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r13
	movq	%rdi, %r15
	movl	$100, %edi
	callq	_os_malloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r12
	cmpq	$0, 16(%r13)
	je	LBB0_4
## %bb.3:
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	leaq	400(%r12), %r15
	movq	_RADIUS_ATTR_MS_CHAP2_SUCCESS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_RADIUS_VENDOR_ID_MICROSOFT@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	movl	$1, %ecx
	movl	$43, %r8d
	callq	_eap_ttls_avp_hdr
	movq	%r13, -48(%rbp)                 ## 8-byte Spill
	movq	%rax, %r13
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	8(%rax), %eax
	leaq	4(%r13), %rdi
	movl	%eax, (%r13)
	movq	%r15, %rbx
	subq	%rdi, %rbx
	shrq	$2, %rbx
	leaq	L_.str(%rip), %rdx
	movl	%ebx, %esi
	callq	_os_snprintf
	movl	%eax, %r14d
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_os_snprintf_error
	xorl	%ecx, %ecx
	testl	%eax, %eax
	cmovel	%r14d, %ecx
	movslq	%ecx, %rax
	leaq	4(,%rax,4), %rbx
	addq	%r13, %rbx
	movq	-48(%rbp), %r13                 ## 8-byte Reload
	subq	%rbx, %r15
	shrq	$2, %r15
	movl	4(%r13), %edx
	movq	%rbx, %rdi
	movl	%r15d, %esi
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	movl	$4, %ecx
	callq	_wpa_snprintf_hex_uppercase
	cltq
	leaq	(%rbx,%rax,4), %rbx
	jmp	LBB0_5
LBB0_1:
	xorl	%ebx, %ebx
	jmp	LBB0_6
LBB0_4:
	movq	_RADIUS_ATTR_MS_CHAP_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_RADIUS_VENDOR_ID_MICROSOFT@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	movl	$1, %ecx
	movl	$6, %r8d
	callq	_eap_ttls_avp_hdr
	movq	%rax, %rbx
	leaq	L_.str.1(%rip), %rsi
	movq	%rax, %rdi
	movl	$6, %edx
	callq	_os_memcpy
	addq	$24, %rbx
	movq	%r12, %rdi
	movq	%rbx, %rsi
	callq	_AVP_PAD
LBB0_5:
	subq	%r12, %rbx
	shrq	$2, %rbx
	leaq	-64(%rbp), %r14
	movq	%r14, %rdi
	movq	%r12, %rsi
	movl	%ebx, %edx
	callq	_wpabuf_set
	movq	_MSG_DEBUG@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.2(%rip), %rsi
	movq	%r14, %rdx
	callq	_wpa_hexdump_buf_key
	movq	%r15, %rdi
	movq	%r13, %rsi
	movq	%r14, %rdx
	callq	_eap_server_tls_encrypt
	movq	%rax, %rbx
	movq	%r12, %rdi
	callq	_os_free
LBB0_6:
	movq	%rbx, %rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_RADIUS_ATTR_MS_CHAP2_SUCCESS,4,2 ## @RADIUS_ATTR_MS_CHAP2_SUCCESS
	.comm	_RADIUS_VENDOR_ID_MICROSOFT,4,2 ## @RADIUS_VENDOR_ID_MICROSOFT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"S="

	.comm	_RADIUS_ATTR_MS_CHAP_ERROR,4,2  ## @RADIUS_ATTR_MS_CHAP_ERROR
L_.str.1:                               ## @.str.1
	.asciz	"Failed"

	.comm	_MSG_DEBUG,4,2                  ## @MSG_DEBUG
L_.str.2:                               ## @.str.2
	.asciz	"EAP-TTLS/MSCHAPV2: Encrypting Phase 2 data"

	.no_dead_strip	_eap_ttls_build_phase2_mschapv2
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function eap_ttls_build_phase2_mschapv2
_eap_ttls_build_phase2_mschapv2:        ; @eap_ttls_build_phase2_mschapv2
	.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
	mov	x19, x1
	mov	x20, x0
	mov	w0, #100
	bl	_os_malloc
	cbz	x0, LBB0_3
; %bb.1:
	mov	x21, x0
	ldr	x8, [x19, #16]
	cbz	x8, LBB0_4
; %bb.2:
	add	x25, x21, #400
Lloh0:
	adrp	x8, _RADIUS_ATTR_MS_CHAP2_SUCCESS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _RADIUS_ATTR_MS_CHAP2_SUCCESS@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x8, _RADIUS_VENDOR_ID_MICROSOFT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _RADIUS_VENDOR_ID_MICROSOFT@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	mov	x0, x21
	mov	w3, #1
	mov	w4, #43
	bl	_eap_ttls_avp_hdr
	mov	x22, x0
	ldr	w8, [x19, #8]
	str	w8, [x22], #4
	sub	x8, x25, x22
	lsr	x23, x8, #2
Lloh6:
	adrp	x2, l_.str@PAGE
Lloh7:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x22
	mov	x1, x23
	bl	_os_snprintf
	mov	x24, x0
	mov	x0, x23
	mov	x1, x24
	bl	_os_snprintf_error
	cmp	w0, #0
	csel	w8, w24, wzr, eq
	add	x22, x22, w8, sxtw #2
	sub	x8, x25, x22
	lsr	x1, x8, #2
	ldr	w2, [x19, #4]
	mov	x0, x22
                                        ; kill: def $w1 killed $w1 killed $x1
	mov	w3, #4
	bl	_wpa_snprintf_hex_uppercase
	add	x22, x22, w0, sxtw #2
	b	LBB0_5
LBB0_3:
	mov	x19, #0
	b	LBB0_6
LBB0_4:
Lloh8:
	adrp	x8, _RADIUS_ATTR_MS_CHAP_ERROR@GOTPAGE
Lloh9:
	ldr	x8, [x8, _RADIUS_ATTR_MS_CHAP_ERROR@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
Lloh11:
	adrp	x8, _RADIUS_VENDOR_ID_MICROSOFT@GOTPAGE
Lloh12:
	ldr	x8, [x8, _RADIUS_VENDOR_ID_MICROSOFT@GOTPAGEOFF]
Lloh13:
	ldr	w2, [x8]
	mov	x0, x21
	mov	w3, #1
	mov	w4, #6
	bl	_eap_ttls_avp_hdr
	mov	x22, x0
Lloh14:
	adrp	x1, l_.str.1@PAGE
Lloh15:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	w2, #6
	bl	_os_memcpy
	add	x22, x22, #24
	mov	x0, x21
	mov	x1, x22
	bl	_AVP_PAD
LBB0_5:
	sub	x8, x22, x21
	lsr	x2, x8, #2
	add	x0, sp, #8
	mov	x1, x21
                                        ; kill: def $w2 killed $w2 killed $x2
	bl	_wpabuf_set
Lloh16:
	adrp	x8, _MSG_DEBUG@GOTPAGE
Lloh17:
	ldr	x8, [x8, _MSG_DEBUG@GOTPAGEOFF]
Lloh18:
	ldr	w0, [x8]
Lloh19:
	adrp	x1, l_.str.2@PAGE
Lloh20:
	add	x1, x1, l_.str.2@PAGEOFF
	add	x2, sp, #8
	bl	_wpa_hexdump_buf_key
	add	x2, sp, #8
	mov	x0, x20
	mov	x1, x19
	bl	_eap_server_tls_encrypt
	mov	x19, x0
	mov	x0, x21
	bl	_os_free
LBB0_6:
	mov	x0, x19
	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 AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_RADIUS_ATTR_MS_CHAP2_SUCCESS,4,2 ; @RADIUS_ATTR_MS_CHAP2_SUCCESS
	.comm	_RADIUS_VENDOR_ID_MICROSOFT,4,2 ; @RADIUS_VENDOR_ID_MICROSOFT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"S="

	.comm	_RADIUS_ATTR_MS_CHAP_ERROR,4,2  ; @RADIUS_ATTR_MS_CHAP_ERROR
l_.str.1:                               ; @.str.1
	.asciz	"Failed"

	.comm	_MSG_DEBUG,4,2                  ; @MSG_DEBUG
l_.str.2:                               ; @.str.2
	.asciz	"EAP-TTLS/MSCHAPV2: Encrypting Phase 2 data"

	.no_dead_strip	_eap_ttls_build_phase2_mschapv2
.subsections_via_symbols
