	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_intel_guc_fw_upload            ## -- Begin function intel_guc_fw_upload
	.p2align	4, 0x90
_intel_guc_fw_upload:                   ## @intel_guc_fw_upload
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	callq	_guc_to_gt
	movq	%rax, %rbx
	movq	(%rax), %r15
	movq	%r15, %rdi
	callq	_guc_prepare_xfer
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_guc_xfer_rsa
	movq	_UOS_MOVE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r14, %rdi
	movq	%rbx, %rsi
	movl	$8192, %edx                     ## imm = 0x2000
	callq	_intel_uc_fw_upload
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_3
## %bb.1:
	movq	%r15, %rdi
	callq	_guc_wait_ucode
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_2
LBB0_3:
	movq	_INTEL_UC_FIRMWARE_FAIL@GOTPCREL(%rip), %rax
LBB0_4:
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_intel_uc_fw_change_status
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	xorl	%ebx, %ebx
	movq	_INTEL_UC_FIRMWARE_RUNNING@GOTPCREL(%rip), %rax
	jmp	LBB0_4
	.cfi_endproc
                                        ## -- End function
	.comm	_UOS_MOVE,4,2                   ## @UOS_MOVE
	.comm	_INTEL_UC_FIRMWARE_RUNNING,4,2  ## @INTEL_UC_FIRMWARE_RUNNING
	.comm	_INTEL_UC_FIRMWARE_FAIL,4,2     ## @INTEL_UC_FIRMWARE_FAIL
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_intel_guc_fw_upload            ; -- Begin function intel_guc_fw_upload
	.p2align	2
_intel_guc_fw_upload:                   ; @intel_guc_fw_upload
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x0
	bl	_guc_to_gt
	mov	x20, x0
	ldr	x21, [x0]
	mov	x0, x21
	bl	_guc_prepare_xfer
	mov	x0, x19
	mov	x1, x21
	bl	_guc_xfer_rsa
Lloh0:
	adrp	x8, _UOS_MOVE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _UOS_MOVE@GOTPAGEOFF]
Lloh2:
	ldr	w3, [x8]
	mov	x0, x19
	mov	x1, x20
	mov	w2, #8192
	bl	_intel_uc_fw_upload
	mov	x20, x0
	cbnz	w0, LBB0_2
; %bb.1:
	mov	x0, x21
	bl	_guc_wait_ucode
	mov	x20, x0
	cbz	w0, LBB0_4
LBB0_2:
Lloh3:
	adrp	x8, _INTEL_UC_FIRMWARE_FAIL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _INTEL_UC_FIRMWARE_FAIL@GOTPAGEOFF]
LBB0_3:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_intel_uc_fw_change_status
	mov	x0, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_4:
Lloh5:
	adrp	x8, _INTEL_UC_FIRMWARE_RUNNING@GOTPAGE
Lloh6:
	ldr	x8, [x8, _INTEL_UC_FIRMWARE_RUNNING@GOTPAGEOFF]
	b	LBB0_3
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_UOS_MOVE,4,2                   ; @UOS_MOVE
	.comm	_INTEL_UC_FIRMWARE_RUNNING,4,2  ; @INTEL_UC_FIRMWARE_RUNNING
	.comm	_INTEL_UC_FIRMWARE_FAIL,4,2     ; @INTEL_UC_FIRMWARE_FAIL
.subsections_via_symbols
