	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_eap_teap_save_pac_bin          ## -- Begin function eap_teap_save_pac_bin
	.p2align	4, 0x90
_eap_teap_save_pac_bin:                 ## @eap_teap_save_pac_bin
	.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	%rdx, %r14
	movq	%rsi, %rbx
	movq	%rdi, %r15
	testq	%rsi, %rsi
	je	LBB0_1
## %bb.2:
	movq	_EAP_TEAP_PAC_KEY_LEN@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$6, %r12d
	movq	%rbx, %rcx
	movl	$-1, %eax
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%rcx), %edx
	cmpl	$65535, %edx                    ## imm = 0xFFFF
	jg	LBB0_14
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	4(%rcx), %esi
	cmpl	$65535, %esi                    ## imm = 0xFFFF
	jg	LBB0_14
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	addl	%esi, %edx
	addl	%edi, %edx
	addl	$6, %edx
	movslq	%edx, %rdx
	addq	%rdx, %r12
	movq	16(%rcx), %rcx
	testq	%rcx, %rcx
	jne	LBB0_3
	jmp	LBB0_6
LBB0_1:
	movl	$6, %r12d
LBB0_6:
	movq	%r12, %rdi
	callq	_os_malloc
	movq	%rax, %r13
	movl	$-1, %eax
	testq	%r13, %r13
	je	LBB0_14
## %bb.7:
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	movq	%r15, -64(%rbp)                 ## 8-byte Spill
	movq	%r14, -72(%rbp)                 ## 8-byte Spill
	movq	_EAP_TEAP_PAC_BINARY_MAGIC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_WPA_PUT_BE32
	leaq	16(%r13), %rdi
	movq	_EAP_TEAP_PAC_BINARY_FORMAT_VERSION@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_WPA_PUT_BE16
	testq	%rbx, %rbx
	movq	%r13, -48(%rbp)                 ## 8-byte Spill
	je	LBB0_8
## %bb.9:
	movq	%r13, %r14
	addq	$24, %r14
	xorl	%r15d, %r15d
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movl	8(%rbx), %esi
	movq	%r14, %rdi
	callq	_WPA_PUT_BE16
	leaq	8(%r14), %rdi
	movl	32(%rbx), %esi
	movq	_EAP_TEAP_PAC_KEY_LEN@GOTPCREL(%rip), %r12
	movl	(%r12), %edx
	callq	_os_memcpy
	movslq	(%r12), %r12
	leaq	(%r14,%r12,4), %r13
	addq	$8, %r13
	movl	(%rbx), %esi
	movq	%r13, %rdi
	callq	_WPA_PUT_BE16
	leaq	(%r14,%r12,4), %rdi
	addq	$16, %rdi
	movl	(%rbx), %edx
	movl	28(%rbx), %esi
	callq	_os_memcpy
	movslq	(%rbx), %r12
	leaq	8(,%r12,4), %r14
	addq	%r13, %r14
	movl	4(%rbx), %esi
	movq	%r14, %rdi
	callq	_WPA_PUT_BE16
	leaq	16(,%r12,4), %rdi
	addq	%r13, %rdi
	movl	4(%rbx), %edx
	movl	24(%rbx), %esi
	callq	_os_memcpy
	movslq	4(%rbx), %rax
	leaq	(%r14,%rax,4), %r14
	addq	$8, %r14
	movq	16(%rbx), %rbx
	incq	%r15
	testq	%rbx, %rbx
	jne	LBB0_10
	jmp	LBB0_11
LBB0_8:
	xorl	%r15d, %r15d
LBB0_11:
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movq	-72(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rsi
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdx
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	callq	_eap_teap_write_pac
	testq	%rax, %rax
	je	LBB0_13
## %bb.12:
	movq	%rbx, %rdi
	callq	_os_free
	movl	$-1, %eax
	jmp	LBB0_14
LBB0_13:
	movq	_MSG_DEBUG@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdx
	movq	%r14, %rcx
	callq	_wpa_printf
	xorl	%eax, %eax
LBB0_14:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EAP_TEAP_PAC_KEY_LEN,4,2       ## @EAP_TEAP_PAC_KEY_LEN
	.comm	_EAP_TEAP_PAC_BINARY_MAGIC,4,2  ## @EAP_TEAP_PAC_BINARY_MAGIC
	.comm	_EAP_TEAP_PAC_BINARY_FORMAT_VERSION,4,2 ## @EAP_TEAP_PAC_BINARY_FORMAT_VERSION
	.comm	_MSG_DEBUG,4,2                  ## @MSG_DEBUG
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"EAP-TEAP: Wrote %lu PAC entries into '%s' (bin)"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_eap_teap_save_pac_bin          ; -- Begin function eap_teap_save_pac_bin
	.p2align	2
_eap_teap_save_pac_bin:                 ; @eap_teap_save_pac_bin
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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, x2
	mov	x22, x1
	mov	x20, x0
	cbz	x1, LBB0_5
; %bb.1:
Lloh0:
	adrp	x8, _EAP_TEAP_PAC_KEY_LEN@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EAP_TEAP_PAC_KEY_LEN@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	mov	w21, #6
	mov	x9, x22
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w10, [x9]
	cmp	w10, #16, lsl #12               ; =65536
	b.ge	LBB0_12
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	w11, [x9, #4]
	cmp	w11, #16, lsl #12               ; =65536
	b.ge	LBB0_12
; %bb.4:                                ;   in Loop: Header=BB0_2 Depth=1
	add	w10, w10, w11
	add	w10, w10, w8
	add	w10, w10, #6
	add	x21, x21, w10, sxtw
	ldr	x9, [x9, #16]
	cbnz	x9, LBB0_2
	b	LBB0_6
LBB0_5:
	mov	w21, #6
LBB0_6:
	mov	x0, x21
	bl	_os_malloc
	cbz	x0, LBB0_12
; %bb.7:
	mov	x23, x0
Lloh3:
	adrp	x8, _EAP_TEAP_PAC_BINARY_MAGIC@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EAP_TEAP_PAC_BINARY_MAGIC@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	bl	_WPA_PUT_BE32
	add	x0, x23, #16
Lloh6:
	adrp	x8, _EAP_TEAP_PAC_BINARY_FORMAT_VERSION@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EAP_TEAP_PAC_BINARY_FORMAT_VERSION@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	bl	_WPA_PUT_BE16
	mov	x24, #0
	cbz	x22, LBB0_10
; %bb.8:
	add	x25, x23, #24
Lloh9:
	adrp	x26, _EAP_TEAP_PAC_KEY_LEN@GOTPAGE
Lloh10:
	ldr	x26, [x26, _EAP_TEAP_PAC_KEY_LEN@GOTPAGEOFF]
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x22, #8]
	mov	x0, x25
	bl	_WPA_PUT_BE16
	add	x25, x25, #8
	ldr	w1, [x22, #32]
	ldr	w2, [x26]
	mov	x0, x25
	bl	_os_memcpy
	ldrsw	x8, [x26]
	add	x25, x25, x8, lsl #2
	ldr	w1, [x22]
	mov	x0, x25
	bl	_WPA_PUT_BE16
	add	x25, x25, #8
	ldr	w1, [x22, #28]
	ldr	w2, [x22]
	mov	x0, x25
	bl	_os_memcpy
	ldp	w8, w1, [x22]
                                        ; kill: def $w8 killed $w8 def $x8
	sxtw	x8, w8
	add	x25, x25, x8, lsl #2
	mov	x0, x25
	bl	_WPA_PUT_BE16
	add	x25, x25, #8
	ldr	w1, [x22, #24]
	ldr	w2, [x22, #4]
	mov	x0, x25
	bl	_os_memcpy
	ldrsw	x8, [x22, #4]
	add	x25, x25, x8, lsl #2
	ldr	x22, [x22, #16]
	add	x24, x24, #1
	cbnz	x22, LBB0_9
LBB0_10:
	mov	x0, x20
	mov	x1, x19
	mov	x2, x23
	mov	x3, x21
	bl	_eap_teap_write_pac
	cbz	x0, LBB0_14
; %bb.11:
	mov	x0, x23
	bl	_os_free
LBB0_12:
	mov	w0, #-1
LBB0_13:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_14:
Lloh11:
	adrp	x8, _MSG_DEBUG@GOTPAGE
Lloh12:
	ldr	x8, [x8, _MSG_DEBUG@GOTPAGEOFF]
Lloh13:
	ldr	w0, [x8]
Lloh14:
	adrp	x1, l_.str@PAGE
Lloh15:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x24
	mov	x3, x19
	bl	_wpa_printf
	mov	w0, #0
	b	LBB0_13
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_EAP_TEAP_PAC_KEY_LEN,4,2       ; @EAP_TEAP_PAC_KEY_LEN
	.comm	_EAP_TEAP_PAC_BINARY_MAGIC,4,2  ; @EAP_TEAP_PAC_BINARY_MAGIC
	.comm	_EAP_TEAP_PAC_BINARY_FORMAT_VERSION,4,2 ; @EAP_TEAP_PAC_BINARY_FORMAT_VERSION
	.comm	_MSG_DEBUG,4,2                  ; @MSG_DEBUG
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"EAP-TEAP: Wrote %lu PAC entries into '%s' (bin)"

.subsections_via_symbols
