	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_intel_uc_fw_upload             ## -- Begin function intel_uc_fw_upload
	.p2align	4, 0x90
_intel_uc_fw_upload:                    ## @intel_uc_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	%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
	movl	%ecx, %r13d
	movl	%edx, %r12d
	movq	%rsi, %r15
	movq	%rdi, %r14
	callq	_intel_uc_fw_is_loaded
	movl	%eax, %edi
	callq	_GEM_BUG_ON
	movl	(%r15), %edi
	movq	_ENOEXEC@GOTPCREL(%rip), %rax
	xorl	%esi, %esi
	subl	(%rax), %esi
	callq	_i915_inject_load_error
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_1
LBB0_6:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movq	%r14, %rdi
	callq	_intel_uc_fw_is_available
	testl	%eax, %eax
	je	LBB0_2
## %bb.3:
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_intel_uc_fw_ggtt_bind
	movq	%r14, %rdi
	movq	%r15, %rsi
	movl	%r12d, %edx
	movl	%r13d, %ecx
	callq	_uc_fw_xfer
	movl	%eax, %ebx
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_intel_uc_fw_ggtt_unbind
	testl	%ebx, %ebx
	je	LBB0_4
## %bb.5:
	movl	(%r15), %r15d
	movl	4(%r14), %edi
	callq	_intel_uc_fw_type_repr
	movl	(%r14), %ecx
	leaq	L_.str(%rip), %rsi
	movl	%r15d, %edi
	movl	%eax, %edx
	movl	%ebx, %r8d
	callq	_i915_probe_error
	movq	_INTEL_UC_FIRMWARE_FAIL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_intel_uc_fw_change_status
	jmp	LBB0_6
LBB0_2:
	xorl	%ebx, %ebx
	movq	_ENOEXEC@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_6
LBB0_4:
	movq	_INTEL_UC_FIRMWARE_TRANSFERRED@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_intel_uc_fw_change_status
	xorl	%ebx, %ebx
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOEXEC,4,2                    ## @ENOEXEC
	.comm	_INTEL_UC_FIRMWARE_TRANSFERRED,4,2 ## @INTEL_UC_FIRMWARE_TRANSFERRED
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to load %s firmware %s (%d)\n"

	.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_uc_fw_upload             ; -- Begin function intel_uc_fw_upload
	.p2align	2
_intel_uc_fw_upload:                    ; @intel_uc_fw_upload
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x22, x3
	mov	x23, x2
	mov	x20, x1
	mov	x19, x0
	bl	_intel_uc_fw_is_loaded
	bl	_GEM_BUG_ON
	ldr	w0, [x20]
Lloh0:
	adrp	x24, _ENOEXEC@GOTPAGE
Lloh1:
	ldr	x24, [x24, _ENOEXEC@GOTPAGEOFF]
	ldr	w8, [x24]
	neg	w1, w8
	bl	_i915_inject_load_error
	mov	x21, x0
	cbnz	w0, LBB0_7
; %bb.1:
	mov	x0, x19
	bl	_intel_uc_fw_is_available
	cbz	w0, LBB0_4
; %bb.2:
	mov	x0, x19
	mov	x1, x20
	bl	_intel_uc_fw_ggtt_bind
	mov	x0, x19
	mov	x1, x20
	mov	x2, x23
	mov	x3, x22
	bl	_uc_fw_xfer
	mov	x21, x0
	mov	x0, x19
	mov	x1, x20
	bl	_intel_uc_fw_ggtt_unbind
	cbz	w21, LBB0_5
; %bb.3:
	ldr	w20, [x20]
	ldr	w0, [x19, #4]
	bl	_intel_uc_fw_type_repr
	mov	x2, x0
	ldr	w3, [x19]
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	mov	x4, x21
	bl	_i915_probe_error
Lloh4:
	adrp	x8, _INTEL_UC_FIRMWARE_FAIL@GOTPAGE
Lloh5:
	ldr	x8, [x8, _INTEL_UC_FIRMWARE_FAIL@GOTPAGEOFF]
	b	LBB0_6
LBB0_4:
	ldr	w8, [x24]
	neg	w21, w8
	b	LBB0_7
LBB0_5:
Lloh6:
	adrp	x8, _INTEL_UC_FIRMWARE_TRANSFERRED@GOTPAGE
Lloh7:
	ldr	x8, [x8, _INTEL_UC_FIRMWARE_TRANSFERRED@GOTPAGEOFF]
LBB0_6:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_intel_uc_fw_change_status
LBB0_7:
	mov	x0, x21
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOEXEC,4,2                    ; @ENOEXEC
	.comm	_INTEL_UC_FIRMWARE_TRANSFERRED,4,2 ; @INTEL_UC_FIRMWARE_TRANSFERRED
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to load %s firmware %s (%d)\n"

	.comm	_INTEL_UC_FIRMWARE_FAIL,4,2     ; @INTEL_UC_FIRMWARE_FAIL
.subsections_via_symbols
