	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_intel_gvt_load_firmware        ## -- Begin function intel_gvt_load_firmware
	.p2align	4, 0x90
_intel_gvt_load_firmware:               ## @intel_gvt_load_firmware
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	24(%rdi), %r12
	movq	(%r12), %r13
	movq	_PATH_MAX@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	callq	_kmalloc
	testq	%rax, %rax
	je	LBB0_10
## %bb.1:
	movq	%rax, %r15
	movl	36(%r14), %edi
	movl	(%rbx), %esi
	callq	_kmalloc
	testq	%rax, %rax
	je	LBB0_7
## %bb.2:
	movq	%rax, (%r14)
	movl	32(%r14), %edi
	movl	(%rbx), %esi
	callq	_kmalloc
	testq	%rax, %rax
	je	LBB0_8
## %bb.3:
	movq	%rax, 8(%r14)
	movq	_GVT_FIRMWARE_PATH@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	movl	(%r13), %ecx
	movl	4(%r13), %r8d
	movl	8(%r13), %r9d
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	callq	_sprintf
	leaq	L_.str.1(%rip), %rdi
	xorl	%ebx, %ebx
	movq	%r15, %rsi
	xorl	%eax, %eax
	callq	_gvt_dbg_core
	movq	(%r12), %rdx
	addq	$12, %rdx
	leaq	-48(%rbp), %rdi
	movq	%r15, %rsi
	callq	_request_firmware
	movl	%eax, %r12d
	movq	%r15, %rdi
	callq	_kfree
	testl	%r12d, %r12d
	jne	LBB0_6
## %bb.4:
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	_gvt_dbg_core
	movq	-48(%rbp), %rsi
	movq	%r14, %rdi
	callq	_verify_firmware
	testl	%eax, %eax
	je	LBB0_12
## %bb.5:
	movq	-48(%rbp), %rdi
	callq	_release_firmware
LBB0_6:
	movq	%r14, %rdi
	callq	_expose_firmware_sysfs
	jmp	LBB0_11
LBB0_7:
	movq	%r15, %rdi
	jmp	LBB0_9
LBB0_8:
	movq	%r15, %rdi
	callq	_kfree
	movq	(%r14), %rdi
LBB0_9:
	callq	_kfree
LBB0_10:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_11:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	leaq	L_.str.3(%rip), %rdi
	xorl	%eax, %eax
	callq	_gvt_dbg_core
	movq	-48(%rbp), %rax
	movq	(%rax), %rbx
	movq	(%r14), %rdi
	movq	24(%rbx), %rsi
	addq	%rbx, %rsi
	movl	16(%rbx), %edx
	callq	_memcpy
	movq	8(%r14), %rdi
	movq	-48(%rbp), %rax
	movq	8(%rbx), %rsi
	addq	(%rax), %rsi
	movl	(%rbx), %edx
	callq	_memcpy
	movq	-48(%rbp), %rdi
	callq	_release_firmware
	movl	$1, 16(%r14)
	xorl	%ebx, %ebx
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_PATH_MAX,4,2                   ## @PATH_MAX
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s/vid_0x%04x_did_0x%04x_rid_0x%02x.golden_hw_state"

	.comm	_GVT_FIRMWARE_PATH,8,3          ## @GVT_FIRMWARE_PATH
L_.str.1:                               ## @.str.1
	.asciz	"request hw state firmware %s...\n"

L_.str.2:                               ## @.str.2
	.asciz	"success.\n"

L_.str.3:                               ## @.str.3
	.asciz	"verified.\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_intel_gvt_load_firmware        ; -- Begin function intel_gvt_load_firmware
	.p2align	2
_intel_gvt_load_firmware:               ; @intel_gvt_load_firmware
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x19, x0
	ldr	x21, [x0, #24]
	ldr	x22, [x21]
Lloh0:
	adrp	x8, _PATH_MAX@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PATH_MAX@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
Lloh3:
	adrp	x23, _GFP_KERNEL@GOTPAGE
Lloh4:
	ldr	x23, [x23, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w1, [x23]
	bl	_kmalloc
	cbz	x0, LBB0_10
; %bb.1:
	mov	x20, x0
	ldr	w0, [x19, #36]
	ldr	w1, [x23]
	bl	_kmalloc
	cbz	x0, LBB0_7
; %bb.2:
	str	x0, [x19]
	ldr	w0, [x19, #32]
	ldr	w1, [x23]
	bl	_kmalloc
	cbz	x0, LBB0_8
; %bb.3:
	str	x0, [x19, #8]
Lloh5:
	adrp	x8, _GVT_FIRMWARE_PATH@GOTPAGE
Lloh6:
	ldr	x8, [x8, _GVT_FIRMWARE_PATH@GOTPAGEOFF]
Lloh7:
	ldr	x2, [x8]
	ldp	w3, w4, [x22]
	ldr	w5, [x22, #8]
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_sprintf
	str	x20, [sp]
Lloh10:
	adrp	x0, l_.str.1@PAGE
Lloh11:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_gvt_dbg_core
	ldr	x8, [x21]
	add	x2, x8, #12
	add	x0, sp, #8
	mov	x1, x20
	bl	_request_firmware
	mov	x21, x0
	mov	x0, x20
	bl	_kfree
	cbnz	w21, LBB0_6
; %bb.4:
Lloh12:
	adrp	x0, l_.str.2@PAGE
Lloh13:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_gvt_dbg_core
	ldr	x1, [sp, #8]
	mov	x0, x19
	bl	_verify_firmware
	cbz	w0, LBB0_12
; %bb.5:
	ldr	x0, [sp, #8]
	bl	_release_firmware
LBB0_6:
	mov	x0, x19
	bl	_expose_firmware_sysfs
	mov	w0, #0
	b	LBB0_11
LBB0_7:
	mov	x0, x20
	b	LBB0_9
LBB0_8:
	mov	x0, x20
	bl	_kfree
	ldr	x0, [x19]
LBB0_9:
	bl	_kfree
LBB0_10:
Lloh14:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_11:
	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
	add	sp, sp, #80
	ret
LBB0_12:
Lloh17:
	adrp	x0, l_.str.3@PAGE
Lloh18:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_gvt_dbg_core
	ldr	x8, [sp, #8]
	ldr	x20, [x8]
	ldr	x0, [x19]
	ldr	x8, [x20, #24]
	add	x1, x8, x20
	ldr	w2, [x20, #16]
	bl	_memcpy
	ldr	x0, [x19, #8]
	ldr	x8, [sp, #8]
	ldr	x8, [x8]
	ldr	x9, [x20, #8]
	add	x1, x9, x8
	ldr	w2, [x20]
	bl	_memcpy
	ldr	x0, [sp, #8]
	bl	_release_firmware
	mov	w0, #0
	mov	w8, #1
	str	w8, [x19, #16]
	b	LBB0_11
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_PATH_MAX,4,2                   ; @PATH_MAX
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s/vid_0x%04x_did_0x%04x_rid_0x%02x.golden_hw_state"

	.comm	_GVT_FIRMWARE_PATH,8,3          ; @GVT_FIRMWARE_PATH
l_.str.1:                               ; @.str.1
	.asciz	"request hw state firmware %s...\n"

l_.str.2:                               ; @.str.2
	.asciz	"success.\n"

l_.str.3:                               ; @.str.3
	.asciz	"verified.\n"

.subsections_via_symbols
