	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tls_write_client_certificate
_tls_write_client_certificate:          ## @tls_write_client_certificate
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movq	(%rsi), %rbx
	movq	_TLS_RECORD_HEADER_LEN@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	addq	$7, %rax
	movq	%rdx, %r14
	subq	%rbx, %r14
	sarq	$2, %r14
	cmpq	%rax, %r14
	jge	LBB0_2
## %bb.1:
	movq	_TLS_ALERT_LEVEL_FATAL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_TLS_ALERT_INTERNAL_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	jmp	LBB0_18
LBB0_2:
	movq	%rdx, %r13
	movq	%rsi, %r12
	movq	_MSG_DEBUG@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	xorl	%eax, %eax
	callq	_wpa_printf
	movq	_TLS_RECORD_HEADER_LEN@GOTPCREL(%rip), %rax
	movslq	(%rax), %rcx
	movq	_TLS_HANDSHAKE_TYPE_CERTIFICATE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%rbx,%rcx,4)
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movq	%rcx, -72(%rbp)                 ## 8-byte Spill
	leaq	(%rbx,%rcx,4), %rbx
	addq	$28, %rbx
	movq	8(%r15), %rax
	testq	%rax, %rax
	movq	%r15, -48(%rbp)                 ## 8-byte Spill
	movq	%r12, -64(%rbp)                 ## 8-byte Spill
	je	LBB0_12
## %bb.3:
	movq	(%rax), %r15
	testq	%r15, %r15
	je	LBB0_12
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movslq	(%r15), %rdx
	leaq	3(%rdx), %rax
	movq	%r13, %rcx
	subq	%rbx, %rcx
	sarq	$2, %rcx
	cmpq	%rax, %rcx
	jb	LBB0_17
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	%rbx, %rdi
	movl	%edx, %esi
	callq	_WPA_PUT_BE24
	leaq	12(%rbx), %rdi
	movl	(%r15), %edx
	movl	8(%r15), %esi
	callq	_os_memcpy
	movslq	(%r15), %rax
	leaq	(%rbx,%rax,4), %rbx
	addq	$12, %rbx
	movq	%r15, %rdi
	callq	_x509_certificate_self_signed
	movq	%rax, %r12
	testq	%rax, %rax
	jne	LBB0_8
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax), %rax
	movl	8(%rax), %edi
	addq	$4, %r15
	movq	%r15, %rsi
	callq	_x509_certificate_get_subject
	movq	%rax, %r15
	testq	%rax, %rax
	jne	LBB0_4
## %bb.7:
	xorl	%r15d, %r15d
LBB0_8:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax), %rax
	testq	%rax, %rax
	movq	-56(%rbp), %r13                 ## 8-byte Reload
	je	LBB0_13
## %bb.9:
	testq	%r12, %r12
	je	LBB0_13
## %bb.10:
	cmpq	(%rax), %r15
	jne	LBB0_14
	jmp	LBB0_13
LBB0_12:
	movq	-56(%rbp), %r13                 ## 8-byte Reload
LBB0_13:
	movq	_MSG_DEBUG@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.2(%rip), %rsi
	xorl	%eax, %eax
	callq	_wpa_printf
LBB0_14:
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	leaq	(,%rax,4), %r15
	addq	%r13, %r15
	leaq	4(,%rax,4), %r12
	addq	%r13, %r12
	leaq	16(,%rax,4), %rdi
	addq	%r13, %rdi
	movq	%rbx, %rsi
	subq	%rdi, %rsi
	shrq	$2, %rsi
	addl	$-3, %esi
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_WPA_PUT_BE24
	movq	%rbx, %rsi
	subq	%r12, %rsi
	shrq	$2, %rsi
	addl	$-3, %esi
	movq	%r12, %rdi
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_WPA_PUT_BE24
	movq	-48(%rbp), %r12                 ## 8-byte Reload
	leaq	4(%r12), %rdi
	movq	_TLS_CONTENT_TYPE_HANDSHAKE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	subq	%r15, %rbx
	shrq	$2, %rbx
	leaq	-80(%rbp), %rax
	movq	%rax, (%rsp)
	movq	%r13, %rdx
	movl	%r14d, %ecx
	movq	%r15, %r8
	movl	%ebx, %r9d
	callq	_tlsv1_record_send
	testq	%rax, %rax
	js	LBB0_16
## %bb.15:
	movq	-80(%rbp), %rax
	leaq	(,%rax,4), %rbx
	addq	%r13, %rbx
	movq	%rbx, %rdx
	subq	%r15, %rdx
	shrq	$2, %rdx
	movq	%r12, %rdi
	movq	%r15, %rsi
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_tls_verify_hash_add
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	%rbx, (%rax)
	xorl	%eax, %eax
	jmp	LBB0_19
LBB0_16:
	movq	_MSG_DEBUG@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.3(%rip), %rsi
	xorl	%eax, %eax
	callq	_wpa_printf
	movq	_TLS_ALERT_LEVEL_FATAL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_TLS_ALERT_INTERNAL_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	jmp	LBB0_18
LBB0_17:
	movq	_MSG_DEBUG@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
	xorl	%eax, %eax
	callq	_wpa_printf
	movq	_TLS_ALERT_LEVEL_FATAL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_TLS_ALERT_INTERNAL_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
LBB0_18:
	callq	_tls_alert
	movl	$-1, %eax
LBB0_19:
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_TLS_RECORD_HEADER_LEN,4,2      ## @TLS_RECORD_HEADER_LEN
	.comm	_TLS_ALERT_LEVEL_FATAL,4,2      ## @TLS_ALERT_LEVEL_FATAL
	.comm	_TLS_ALERT_INTERNAL_ERROR,4,2   ## @TLS_ALERT_INTERNAL_ERROR
	.comm	_MSG_DEBUG,4,2                  ## @MSG_DEBUG
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"TLSv1: Send Certificate"

	.comm	_TLS_HANDSHAKE_TYPE_CERTIFICATE,4,2 ## @TLS_HANDSHAKE_TYPE_CERTIFICATE
L_.str.1:                               ## @.str.1
	.asciz	"TLSv1: Not enough buffer space for Certificate (cert_len=%lu left=%lu)"

L_.str.2:                               ## @.str.2
	.asciz	"TLSv1: Full client certificate chain not configured - validation may fail"

	.comm	_TLS_CONTENT_TYPE_HANDSHAKE,4,2 ## @TLS_CONTENT_TYPE_HANDSHAKE
L_.str.3:                               ## @.str.3
	.asciz	"TLSv1: Failed to generate a record"

	.no_dead_strip	_tls_write_client_certificate
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tls_write_client_certificate
_tls_write_client_certificate:          ; @tls_write_client_certificate
	.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	x19, x0
	ldr	x21, [x1]
Lloh0:
	adrp	x22, _TLS_RECORD_HEADER_LEN@GOTPAGE
Lloh1:
	ldr	x22, [x22, _TLS_RECORD_HEADER_LEN@GOTPAGEOFF]
	ldrsw	x8, [x22]
	add	x8, x8, #7
	sub	x28, x2, x21
	cmp	x8, x28, asr #2
	b.gt	LBB0_16
; %bb.1:
	mov	x25, x2
	mov	x20, x1
Lloh2:
	adrp	x27, _MSG_DEBUG@GOTPAGE
Lloh3:
	ldr	x27, [x27, _MSG_DEBUG@GOTPAGEOFF]
	ldr	w0, [x27]
Lloh4:
	adrp	x1, l_.str@PAGE
Lloh5:
	add	x1, x1, l_.str@PAGEOFF
	bl	_wpa_printf
	ldrsw	x8, [x22]
	add	x22, x21, x8, lsl #2
Lloh6:
	adrp	x8, _TLS_HANDSHAKE_TYPE_CERTIFICATE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _TLS_HANDSHAKE_TYPE_CERTIFICATE@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	mov	x24, x22
	str	w8, [x24], #16
	add	x23, x22, #28
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_10
; %bb.2:
	ldr	x26, [x8]
	cbz	x26, LBB0_10
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldrsw	x1, [x26]
	add	x9, x1, #3
	sub	x8, x25, x23
	asr	x8, x8, #2
	cmp	x8, x9
	b.lo	LBB0_14
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x23
                                        ; kill: def $w1 killed $w1 killed $x1
	bl	_WPA_PUT_BE24
	add	x23, x23, #12
	ldr	w1, [x26, #8]
	ldr	w2, [x26]
	mov	x0, x23
	bl	_os_memcpy
	ldrsw	x8, [x26]
	add	x23, x23, x8, lsl #2
	mov	x0, x26
	bl	_x509_certificate_self_signed
	mov	x27, x0
	cbnz	x0, LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [x19, #8]
	ldr	w0, [x8, #8]
	add	x1, x26, #4
	bl	_x509_certificate_get_subject
	mov	x26, x0
	cbnz	x0, LBB0_3
LBB0_6:
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_9
; %bb.7:
	cbz	x27, LBB0_9
; %bb.8:
	ldr	x8, [x8]
	cmp	x26, x8
Lloh9:
	adrp	x27, _MSG_DEBUG@GOTPAGE
Lloh10:
	ldr	x27, [x27, _MSG_DEBUG@GOTPAGEOFF]
	b.ne	LBB0_11
	b	LBB0_10
LBB0_9:
Lloh11:
	adrp	x27, _MSG_DEBUG@GOTPAGE
Lloh12:
	ldr	x27, [x27, _MSG_DEBUG@GOTPAGEOFF]
LBB0_10:
	ldr	w0, [x27]
Lloh13:
	adrp	x1, l_.str.2@PAGE
Lloh14:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_wpa_printf
LBB0_11:
	add	x25, x22, #4
	lsr	x26, x28, #2
	sub	x8, x23, x24
	lsr	x8, x8, #2
	sub	w1, w8, #3
	mov	x0, x24
	bl	_WPA_PUT_BE24
	sub	x8, x23, x25
	lsr	x8, x8, #2
	sub	w1, w8, #3
	mov	x0, x25
	bl	_WPA_PUT_BE24
	add	x0, x19, #4
Lloh15:
	adrp	x8, _TLS_CONTENT_TYPE_HANDSHAKE@GOTPAGE
Lloh16:
	ldr	x8, [x8, _TLS_CONTENT_TYPE_HANDSHAKE@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	sub	x8, x23, x22
	lsr	x5, x8, #2
	add	x6, sp, #24
	mov	x2, x21
	mov	x3, x26
	mov	x4, x22
                                        ; kill: def $w5 killed $w5 killed $x5
	bl	_tlsv1_record_send
	tbnz	x0, #63, LBB0_13
; %bb.12:
	ldr	x8, [sp, #24]
	add	x21, x21, x8, lsl #2
	sub	x8, x21, x22
	lsr	x2, x8, #2
	mov	x0, x19
	mov	x1, x22
                                        ; kill: def $w2 killed $w2 killed $x2
	bl	_tls_verify_hash_add
	mov	w0, #0
	str	x21, [x20]
	b	LBB0_17
LBB0_13:
	ldr	w0, [x27]
Lloh18:
	adrp	x1, l_.str.3@PAGE
Lloh19:
	add	x1, x1, l_.str.3@PAGEOFF
	b	LBB0_15
LBB0_14:
Lloh20:
	adrp	x9, _MSG_DEBUG@GOTPAGE
Lloh21:
	ldr	x9, [x9, _MSG_DEBUG@GOTPAGEOFF]
Lloh22:
	ldr	w0, [x9]
	stp	x1, x8, [sp]
Lloh23:
	adrp	x1, l_.str.1@PAGE
Lloh24:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_15:
	bl	_wpa_printf
LBB0_16:
Lloh25:
	adrp	x8, _TLS_ALERT_LEVEL_FATAL@GOTPAGE
Lloh26:
	ldr	x8, [x8, _TLS_ALERT_LEVEL_FATAL@GOTPAGEOFF]
Lloh27:
	ldr	w1, [x8]
Lloh28:
	adrp	x8, _TLS_ALERT_INTERNAL_ERROR@GOTPAGE
Lloh29:
	ldr	x8, [x8, _TLS_ALERT_INTERNAL_ERROR@GOTPAGEOFF]
Lloh30:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_tls_alert
	mov	w0, #-1
LBB0_17:
	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 AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_TLS_RECORD_HEADER_LEN,4,2      ; @TLS_RECORD_HEADER_LEN
	.comm	_TLS_ALERT_LEVEL_FATAL,4,2      ; @TLS_ALERT_LEVEL_FATAL
	.comm	_TLS_ALERT_INTERNAL_ERROR,4,2   ; @TLS_ALERT_INTERNAL_ERROR
	.comm	_MSG_DEBUG,4,2                  ; @MSG_DEBUG
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"TLSv1: Send Certificate"

	.comm	_TLS_HANDSHAKE_TYPE_CERTIFICATE,4,2 ; @TLS_HANDSHAKE_TYPE_CERTIFICATE
l_.str.1:                               ; @.str.1
	.asciz	"TLSv1: Not enough buffer space for Certificate (cert_len=%lu left=%lu)"

l_.str.2:                               ; @.str.2
	.asciz	"TLSv1: Full client certificate chain not configured - validation may fail"

	.comm	_TLS_CONTENT_TYPE_HANDSHAKE,4,2 ; @TLS_CONTENT_TYPE_HANDSHAKE
l_.str.3:                               ; @.str.3
	.asciz	"TLSv1: Failed to generate a record"

	.no_dead_strip	_tls_write_client_certificate
.subsections_via_symbols
