	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mga_warp_install_microcode     ## -- Begin function mga_warp_install_microcode
	.p2align	4, 0x90
_mga_warp_install_microcode:            ## @mga_warp_install_microcode
	.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	16(%rdi), %rax
	movq	(%rax), %r13
	movq	8(%rax), %rcx
	movq	$0, -56(%rbp)
	movl	(%rdi), %eax
	addl	$-128, %eax
	cmpl	$3, %eax
	jae	LBB0_1
## %bb.2:
	movq	%rdi, %r15
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	cltq
	leaq	l_switch.table.mga_warp_install_microcode(%rip), %rcx
	movq	(%rcx,%rax,8), %rcx
	leaq	l_switch.table.mga_warp_install_microcode.7(%rip), %rdx
	movq	(%rdx,%rax,8), %rax
	movl	(%rax), %r14d
	movq	(%rcx), %r12
	leaq	L_.str(%rip), %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_platform_device_register_simple
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_3
## %bb.19:
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_DRM_ERROR
	movq	%rbx, %rdi
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_PTR_ERR                        ## TAILCALL
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_18:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movl	%r14d, -44(%rbp)                ## 4-byte Spill
	leaq	-56(%rbp), %rdi
	movq	%r12, %rsi
	movq	%rbx, %rdx
	callq	_request_ihex_firmware
                                        ## kill: def $eax killed $eax def $rax
	movq	%rbx, %rdi
	movq	%rax, %rbx
	callq	_platform_device_unregister
	testl	%ebx, %ebx
	je	LBB0_5
## %bb.4:
	leaq	L_.str.2(%rip), %rdi
	movq	%r12, %rsi
	xorl	%eax, %eax
	callq	_DRM_ERROR
	jmp	LBB0_18
LBB0_5:
	movq	%r12, -80(%rbp)                 ## 8-byte Spill
	movq	-56(%rbp), %rax
	movq	(%rax), %rbx
	testq	%rbx, %rbx
	movq	%r15, -72(%rbp)                 ## 8-byte Spill
	je	LBB0_6
## %bb.7:
	xorl	%r15d, %r15d
	xorl	%r12d, %r12d
	movl	-44(%rbp), %r14d                ## 4-byte Reload
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movl	4(%rbx), %edi
	callq	_be16_to_cpu
	movl	%eax, %edi
	callq	_WARP_UCODE_SIZE
	addl	%eax, %r12d
	incl	%r15d
	movq	%rbx, %rdi
	callq	_ihex_next_binrec
	movq	%rax, %rbx
	testq	%rax, %rax
	jne	LBB0_8
## %bb.9:
	cmpl	%r14d, %r15d
	jne	LBB0_10
LBB0_11:
	movl	%r12d, %edi
	callq	_PAGE_ALIGN
	movl	%eax, %ebx
	movl	%eax, %esi
	leaq	L_.str.4(%rip), %rdi
	xorl	%eax, %eax
	callq	_DRM_DEBUG
	movq	-72(%rbp), %r14                 ## 8-byte Reload
	movq	16(%r14), %rax
	movl	16(%rax), %edx
	cmpl	%edx, %ebx
	jbe	LBB0_13
## %bb.12:
	leaq	L_.str.5(%rip), %rdi
	movl	%ebx, %esi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_DRM_ERROR
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_17
LBB0_6:
	xorl	%r12d, %r12d
	xorl	%r15d, %r15d
	movl	-44(%rbp), %r14d                ## 4-byte Reload
	cmpl	%r14d, %r15d
	je	LBB0_11
LBB0_10:
	leaq	L_.str.3(%rip), %rdi
	xorl	%ebx, %ebx
	movq	-80(%rbp), %rsi                 ## 8-byte Reload
	xorl	%eax, %eax
	callq	_DRM_ERROR
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_17
LBB0_13:
	movq	8(%r14), %rdi
	xorl	%esi, %esi
	movl	$8, %edx
	callq	_memset
	movq	-56(%rbp), %rax
	movq	(%rax), %r12
	testq	%r12, %r12
	movl	$0, %ebx
	je	LBB0_17
## %bb.14:
	xorl	%r15d, %r15d
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_15:                                ## =>This Inner Loop Header: Depth=1
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	leaq	L_.str.6(%rip), %rdi
	movq	%rbx, %rsi
	movq	%r13, %rdx
	xorl	%eax, %eax
	callq	_DRM_DEBUG
	movq	8(%r14), %rax
	movq	%rbx, (%rax,%r15)
	movl	4(%r12), %edi
	callq	_be16_to_cpu
	movl	%eax, %r14d
	movl	%eax, %edi
	callq	_WARP_UCODE_SIZE
	movl	%eax, %ebx
	movl	(%r12), %esi
	movq	%r13, %rdi
	movl	%r14d, %edx
	callq	_memcpy
	movl	%ebx, %eax
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	movq	-72(%rbp), %r14                 ## 8-byte Reload
	addq	%rax, %rbx
	addq	%rax, %r13
	movq	%r12, %rdi
	callq	_ihex_next_binrec
	movq	%rax, %r12
	addq	$8, %r15
	testq	%rax, %rax
	jne	LBB0_15
## %bb.16:
	xorl	%ebx, %ebx
LBB0_17:
	movq	-56(%rbp), %rdi
	callq	_release_firmware
	jmp	LBB0_18
	.cfi_endproc
                                        ## -- End function
	.comm	_FIRMWARE_G400,8,3              ## @FIRMWARE_G400
	.comm	_MGA_MAX_G400_PIPES,4,2         ## @MGA_MAX_G400_PIPES
	.comm	_FIRMWARE_G200,8,3              ## @FIRMWARE_G200
	.comm	_MGA_MAX_G200_PIPES,4,2         ## @MGA_MAX_G200_PIPES
	.comm	_EINVAL,4,2                     ## @EINVAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"mga_warp"

L_.str.1:                               ## @.str.1
	.asciz	"mga: Failed to register microcode\n"

L_.str.2:                               ## @.str.2
	.asciz	"mga: Failed to load microcode \"%s\"\n"

L_.str.3:                               ## @.str.3
	.asciz	"mga: Invalid microcode \"%s\"\n"

L_.str.4:                               ## @.str.4
	.asciz	"MGA ucode size = %d bytes\n"

L_.str.5:                               ## @.str.5
	.asciz	"microcode too large! (%u > %lu)\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
L_.str.6:                               ## @.str.6
	.asciz	" pcbase = 0x%08lx  vcbase = %p\n"

	.section	__DATA,__const
	.p2align	3                               ## @switch.table.mga_warp_install_microcode
l_switch.table.mga_warp_install_microcode:
	.quad	_FIRMWARE_G400
	.quad	_FIRMWARE_G400
	.quad	_FIRMWARE_G200

	.p2align	3                               ## @switch.table.mga_warp_install_microcode.7
l_switch.table.mga_warp_install_microcode.7:
	.quad	_MGA_MAX_G400_PIPES
	.quad	_MGA_MAX_G400_PIPES
	.quad	_MGA_MAX_G200_PIPES

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mga_warp_install_microcode     ; -- Begin function mga_warp_install_microcode
	.p2align	2
_mga_warp_install_microcode:            ; @mga_warp_install_microcode
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	ldr	x8, [x0, #16]
	ldp	x20, x21, [x8]
	str	xzr, [sp, #24]
	ldr	w8, [x0]
	sub	w8, w8, #128
	cmp	w8, #3
	b.hs	LBB0_3
; %bb.1:
	mov	x19, x0
	sbfiz	x8, x8, #3, #32
Lloh0:
	adrp	x9, l_switch.table.mga_warp_install_microcode@PAGE
Lloh1:
	add	x9, x9, l_switch.table.mga_warp_install_microcode@PAGEOFF
	ldr	x9, [x9, x8]
Lloh2:
	adrp	x10, l_switch.table.mga_warp_install_microcode.7@PAGE
Lloh3:
	add	x10, x10, l_switch.table.mga_warp_install_microcode.7@PAGEOFF
	ldr	x8, [x10, x8]
	ldr	w25, [x8]
	ldr	x22, [x9]
Lloh4:
	adrp	x0, l_.str@PAGE
Lloh5:
	add	x0, x0, l_.str@PAGEOFF
	mov	w1, #0
	mov	x2, #0
	mov	w3, #0
	bl	_platform_device_register_simple
	mov	x24, x0
	bl	_IS_ERR
	cbz	x0, LBB0_5
; %bb.2:
Lloh6:
	adrp	x0, l_.str.1@PAGE
Lloh7:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DRM_ERROR
	mov	x0, x24
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #112
	b	_PTR_ERR
LBB0_3:
Lloh8:
	adrp	x8, _EINVAL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w23, w8
LBB0_4:
	mov	x0, x23
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_5:
	add	x0, sp, #24
	mov	x1, x22
	mov	x2, x24
	bl	_request_ihex_firmware
	mov	x23, x0
	mov	x0, x24
	bl	_platform_device_unregister
	cbz	w23, LBB0_7
; %bb.6:
	str	x22, [sp]
Lloh11:
	adrp	x0, l_.str.2@PAGE
Lloh12:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_DRM_ERROR
	b	LBB0_4
LBB0_7:
	ldr	x8, [sp, #24]
	ldr	x24, [x8]
	cbz	x24, LBB0_13
; %bb.8:
	mov	w26, #0
	mov	w23, #0
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x24, #4]
	bl	_be16_to_cpu
	bl	_WARP_UCODE_SIZE
	add	w23, w0, w23
	add	w26, w26, #1
	mov	x0, x24
	bl	_ihex_next_binrec
	mov	x24, x0
	cbnz	x0, LBB0_9
; %bb.10:
	cmp	w26, w25
	b.ne	LBB0_14
LBB0_11:
	mov	x0, x23
	bl	_PAGE_ALIGN
	mov	x22, x0
	mov	w1, w0
Lloh13:
	adrp	x0, l_.str.4@PAGE
Lloh14:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_DRM_DEBUG
	ldr	x8, [x19, #16]
	ldr	w8, [x8, #16]
	cmp	w22, w8
	b.ls	LBB0_16
; %bb.12:
	stp	x22, x8, [sp]
Lloh15:
	adrp	x0, l_.str.5@PAGE
Lloh16:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_DRM_ERROR
Lloh17:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh18:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_15
LBB0_13:
	mov	w23, #0
	mov	w26, #0
	cmp	w26, w25
	b.eq	LBB0_11
LBB0_14:
	str	x22, [sp]
Lloh19:
	adrp	x0, l_.str.3@PAGE
Lloh20:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_DRM_ERROR
Lloh21:
	adrp	x8, _EINVAL@GOTPAGE
Lloh22:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_15:
	ldr	w8, [x8]
	neg	w23, w8
	b	LBB0_20
LBB0_16:
	ldr	x0, [x19, #8]
	mov	w1, #0
	mov	w2, #8
	bl	_memset
	ldr	x8, [sp, #24]
	ldr	x22, [x8]
	cbz	x22, LBB0_19
; %bb.17:
	mov	x26, #0
Lloh23:
	adrp	x23, l_.str.6@PAGE
Lloh24:
	add	x23, x23, l_.str.6@PAGEOFF
LBB0_18:                                ; =>This Inner Loop Header: Depth=1
	str	x20, [sp]
	mov	x0, x23
	mov	x1, x21
	bl	_DRM_DEBUG
	ldr	x8, [x19, #8]
	str	x21, [x8, x26]
	ldr	w0, [x22, #4]
	bl	_be16_to_cpu
	mov	x24, x0
	bl	_WARP_UCODE_SIZE
	mov	x25, x0
	ldr	w1, [x22]
	mov	x0, x20
	mov	x2, x24
	bl	_memcpy
	mov	w8, w25
	add	x21, x21, x8
	add	x20, x20, x8
	mov	x0, x22
	bl	_ihex_next_binrec
	mov	x22, x0
	add	x26, x26, #8
	cbnz	x0, LBB0_18
LBB0_19:
	mov	w23, #0
LBB0_20:
	ldr	x0, [sp, #24]
	bl	_release_firmware
	b	LBB0_4
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.comm	_FIRMWARE_G400,8,3              ; @FIRMWARE_G400
	.comm	_MGA_MAX_G400_PIPES,4,2         ; @MGA_MAX_G400_PIPES
	.comm	_FIRMWARE_G200,8,3              ; @FIRMWARE_G200
	.comm	_MGA_MAX_G200_PIPES,4,2         ; @MGA_MAX_G200_PIPES
	.comm	_EINVAL,4,2                     ; @EINVAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"mga_warp"

l_.str.1:                               ; @.str.1
	.asciz	"mga: Failed to register microcode\n"

l_.str.2:                               ; @.str.2
	.asciz	"mga: Failed to load microcode \"%s\"\n"

l_.str.3:                               ; @.str.3
	.asciz	"mga: Invalid microcode \"%s\"\n"

l_.str.4:                               ; @.str.4
	.asciz	"MGA ucode size = %d bytes\n"

l_.str.5:                               ; @.str.5
	.asciz	"microcode too large! (%u > %lu)\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
l_.str.6:                               ; @.str.6
	.asciz	" pcbase = 0x%08lx  vcbase = %p\n"

	.section	__DATA,__const
	.p2align	3                               ; @switch.table.mga_warp_install_microcode
l_switch.table.mga_warp_install_microcode:
	.quad	_FIRMWARE_G400
	.quad	_FIRMWARE_G400
	.quad	_FIRMWARE_G200

	.p2align	3                               ; @switch.table.mga_warp_install_microcode.7
l_switch.table.mga_warp_install_microcode.7:
	.quad	_MGA_MAX_G400_PIPES
	.quad	_MGA_MAX_G400_PIPES
	.quad	_MGA_MAX_G200_PIPES

.subsections_via_symbols
