	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_heim_ntlm_calculate_ntlm2      ## -- Begin function heim_ntlm_calculate_ntlm2
	.p2align	4, 0x90
_heim_ntlm_calculate_ntlm2:             ## @heim_ntlm_calculate_ntlm2
	.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	%r9, -96(%rbp)                  ## 8-byte Spill
	movq	%r8, -104(%rbp)                 ## 8-byte Spill
	movq	%rcx, %rbx
	movq	%rdx, %r14
	movq	%rsi, %r15
	movq	%rdi, %r12
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	xorl	%edi, %edi
	callq	_time
	movl	%eax, %edi
	callq	_unix2nttime
	movl	%eax, %r13d
	leaq	-72(%rbp), %rdi
	movl	$8, %esi
	callq	_RAND_bytes
	cmpl	$1, %eax
	jne	LBB0_4
## %bb.1:
	movq	16(%rbp), %rax
	movq	%r12, %rdi
	movq	%r15, %rsi
	movq	%r14, %rdx
	movq	%rax, %r14
	movq	%rbx, %rcx
	movq	%rax, %r8
	callq	_heim_ntlm_ntlmv2_key
	xorl	%eax, %eax
	callq	_krb5_storage_emem
	testq	%rax, %rax
	je	LBB0_8
## %bb.2:
	movq	%rax, %r15
	movq	_KRB5_STORAGE_BYTEORDER_LE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_krb5_storage_set_flags
	movq	%r15, %rdi
	movl	$257, %esi                      ## imm = 0x101
	callq	_krb5_store_uint32
	movl	%eax, %edi
	xorl	%esi, %esi
	callq	_CHECK
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_krb5_store_uint32
	movl	%eax, %edi
	xorl	%esi, %esi
	callq	_CHECK
	movq	%r15, %rdi
	movl	%r13d, %esi
	callq	_krb5_store_uint32
	movl	%eax, %edi
	xorl	%esi, %esi
	callq	_CHECK
	movq	%r15, %rdi
	callq	_krb5_store_uint32
	movl	%eax, %edi
	xorl	%esi, %esi
	callq	_CHECK
	leaq	-72(%rbp), %rsi
	movq	%r15, %rdi
	movl	$8, %edx
	callq	_krb5_storage_write
	movl	%eax, %edi
	movl	$8, %esi
	callq	_CHECK
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_krb5_store_uint32
	movl	%eax, %edi
	xorl	%esi, %esi
	callq	_CHECK
	movq	-96(%rbp), %rbx                 ## 8-byte Reload
	movq	(%rbx), %rsi
	movl	8(%rbx), %edx
	movq	%r15, %rdi
	callq	_krb5_storage_write
	movl	8(%rbx), %esi
	movl	%eax, %edi
	callq	_CHECK
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_krb5_store_uint32
	movl	%eax, %edi
	xorl	%esi, %esi
	callq	_CHECK
	leaq	-88(%rbp), %rsi
	movq	%r15, %rdi
	callq	_krb5_storage_to_data
	movl	%eax, %edi
	xorl	%esi, %esi
	callq	_CHECK
	movq	%r15, %rdi
	callq	_krb5_storage_free
	movq	-88(%rbp), %rsi
	movl	-80(%rbp), %edx
	leaq	-64(%rbp), %r8
	movq	%r14, %rdi
	movq	-104(%rbp), %rcx                ## 8-byte Reload
	callq	_heim_ntlm_derive_ntlm2_sess
	testl	%eax, %eax
	je	LBB0_5
## %bb.3:
	movl	%eax, %ebx
	leaq	-88(%rbp), %rdi
	callq	_krb5_data_free
	jmp	LBB0_10
LBB0_4:
	movq	_HNTLM_ERR_RAND@GOTPCREL(%rip), %rax
	jmp	LBB0_9
LBB0_5:
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_krb5_storage_emem
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	movq	%rax, %r14
	movq	24(%rbp), %r12
	leaq	-64(%rbp), %rsi
	movq	%rax, %rdi
	movl	$16, %edx
	callq	_krb5_storage_write
	movl	%eax, %edi
	movl	$16, %esi
	callq	_CHECK
	movq	-88(%rbp), %rsi
	movl	-80(%rbp), %edx
	movq	%r14, %rdi
	callq	_krb5_storage_write
	movl	-80(%rbp), %esi
	movl	%eax, %edi
	callq	_CHECK
	leaq	-88(%rbp), %r15
	movq	%r15, %rdi
	callq	_krb5_data_free
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_krb5_storage_to_data
	movl	%eax, %edi
	xorl	%esi, %esi
	callq	_CHECK
	movq	%r14, %rdi
	callq	_krb5_storage_free
	movq	-88(%rbp), %rax
	movq	%rax, (%r12)
	movl	-80(%rbp), %eax
	movl	%eax, 8(%r12)
	jmp	LBB0_10
LBB0_7:
	leaq	-88(%rbp), %rdi
	callq	_krb5_data_free
LBB0_8:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
LBB0_9:
	movl	(%rax), %ebx
LBB0_10:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_12
## %bb.11:
	movl	%ebx, %eax
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_HNTLM_ERR_RAND,4,2             ## @HNTLM_ERR_RAND
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_KRB5_STORAGE_BYTEORDER_LE,4,2  ## @KRB5_STORAGE_BYTEORDER_LE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_heim_ntlm_calculate_ntlm2      ; -- Begin function heim_ntlm_calculate_ntlm2
	.p2align	2
_heim_ntlm_calculate_ntlm2:             ; @heim_ntlm_calculate_ntlm2
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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, x7
	mov	x20, x6
	mov	x22, x5
	mov	x21, x4
	mov	x23, x3
	mov	x25, x2
	mov	x26, x1
	mov	x27, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #40]
	mov	x0, #0
	bl	_time
	bl	_unix2nttime
	mov	x24, x0
	add	x0, sp, #16
	mov	w1, #8
	bl	_RAND_bytes
	cmp	w0, #1
	b.ne	LBB0_4
; %bb.1:
	mov	x0, x27
	mov	x1, x26
	mov	x2, x25
	mov	x3, x23
	mov	x4, x20
	bl	_heim_ntlm_ntlmv2_key
	bl	_krb5_storage_emem
	cbz	x0, LBB0_8
; %bb.2:
	mov	x23, x0
Lloh3:
	adrp	x8, _KRB5_STORAGE_BYTEORDER_LE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _KRB5_STORAGE_BYTEORDER_LE@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	bl	_krb5_storage_set_flags
	mov	x0, x23
	mov	w1, #257
	bl	_krb5_store_uint32
	mov	w1, #0
	bl	_CHECK
	mov	x0, x23
	mov	w1, #0
	bl	_krb5_store_uint32
	mov	w1, #0
	bl	_CHECK
	mov	x0, x23
	mov	x1, x24
	bl	_krb5_store_uint32
	mov	w1, #0
	bl	_CHECK
	mov	x0, x23
	bl	_krb5_store_uint32
	mov	w1, #0
	bl	_CHECK
	add	x1, sp, #16
	mov	x0, x23
	mov	w2, #8
	bl	_krb5_storage_write
	mov	w1, #8
	bl	_CHECK
	mov	x0, x23
	mov	w1, #0
	bl	_krb5_store_uint32
	mov	w1, #0
	bl	_CHECK
	ldr	x1, [x22]
	ldr	w2, [x22, #8]
	mov	x0, x23
	bl	_krb5_storage_write
	ldr	w1, [x22, #8]
	bl	_CHECK
	mov	x0, x23
	mov	w1, #0
	bl	_krb5_store_uint32
	mov	w1, #0
	bl	_CHECK
	mov	x1, sp
	mov	x0, x23
	bl	_krb5_storage_to_data
	mov	w1, #0
	bl	_CHECK
	mov	x0, x23
	bl	_krb5_storage_free
	ldr	x1, [sp]
	ldr	w2, [sp, #8]
	add	x4, sp, #24
	mov	x0, x20
	mov	x3, x21
	bl	_heim_ntlm_derive_ntlm2_sess
	cbz	w0, LBB0_5
; %bb.3:
	mov	x20, x0
	mov	x0, sp
	bl	_krb5_data_free
	b	LBB0_10
LBB0_4:
Lloh6:
	adrp	x8, _HNTLM_ERR_RAND@GOTPAGE
Lloh7:
	ldr	x8, [x8, _HNTLM_ERR_RAND@GOTPAGEOFF]
	b	LBB0_9
LBB0_5:
	bl	_krb5_storage_emem
	cbz	x0, LBB0_7
; %bb.6:
	mov	x20, x0
	add	x1, sp, #24
	mov	w2, #16
	bl	_krb5_storage_write
	mov	w1, #16
	bl	_CHECK
	ldr	x1, [sp]
	ldr	w2, [sp, #8]
	mov	x0, x20
	bl	_krb5_storage_write
	ldr	w1, [sp, #8]
	bl	_CHECK
	mov	x0, sp
	bl	_krb5_data_free
	mov	x1, sp
	mov	x0, x20
	bl	_krb5_storage_to_data
	mov	w1, #0
	bl	_CHECK
	mov	x0, x20
	bl	_krb5_storage_free
	mov	w20, #0
	ldr	x8, [sp]
	str	x8, [x19]
	ldr	w8, [sp, #8]
	str	w8, [x19, #8]
	b	LBB0_10
LBB0_7:
	mov	x0, sp
	bl	_krb5_data_free
LBB0_8:
Lloh8:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_9:
	ldr	w20, [x8]
LBB0_10:
	ldr	x8, [sp, #40]
Lloh10:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh11:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh12:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_12
; %bb.11:
	mov	x0, x20
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
LBB0_12:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_HNTLM_ERR_RAND,4,2             ; @HNTLM_ERR_RAND
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_KRB5_STORAGE_BYTEORDER_LE,4,2  ; @KRB5_STORAGE_BYTEORDER_LE
.subsections_via_symbols
