	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_iwl_load_ucode_wait_alive      ## -- Begin function iwl_load_ucode_wait_alive
	.p2align	4, 0x90
_iwl_load_ucode_wait_alive:             ## @iwl_load_ucode_wait_alive
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	movq	%rdi, %r15
	movl	16(%rdi), %edi
	callq	_iwl_get_ucode_image
	movq	%rax, %rbx
	xorl	%edi, %edi
	testq	%rax, %rax
	sete	%dil
	callq	_WARN_ON
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_15
LBB0_3:
	movl	(%r15), %eax
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	movl	%r14d, (%r15)
	movl	$0, 4(%r15)
	leaq	8(%r15), %r12
	leaq	_iwl_load_ucode_wait_alive.alive_cmd(%rip), %r13
	movq	%r13, %rdi
	callq	_ARRAY_SIZE
	movq	_iwl_alive_fn@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r8d
	leaq	-48(%rbp), %rsi
	leaq	-56(%rbp), %r9
	movq	%r12, %rdi
	movq	%r13, %rdx
	movl	%eax, %ecx
	callq	_iwl_init_notification_wait
	movl	12(%r15), %edi
	movq	%rbx, %rsi
	xorl	%edx, %edx
	callq	_iwl_trans_start_fw
	testl	%eax, %eax
	je	LBB0_5
## %bb.4:
	movl	%eax, %ebx
	movl	-52(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, (%r15)
	leaq	-48(%rbp), %rsi
	movq	%r12, %rdi
	callq	_iwl_remove_notification
	jmp	LBB0_15
LBB0_5:
	movl	-52(%rbp), %r13d                ## 4-byte Reload
	movq	_UCODE_ALIVE_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-48(%rbp), %rsi
	movq	%r12, %rdi
	callq	_iwl_wait_notification
	testl	%eax, %eax
	je	LBB0_7
## %bb.6:
	movl	%eax, %ebx
LBB0_14:
	movl	%r13d, (%r15)
LBB0_15:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	cmpl	$0, -56(%rbp)
	je	LBB0_8
## %bb.9:
	movl	$1, 4(%r15)
	movq	_IWL_UCODE_WOWLAN@GOTPCREL(%rip), %rax
	cmpl	%r14d, (%rax)
	je	LBB0_11
## %bb.10:
	movl	$5, %edi
	callq	_msleep
LBB0_11:
	movq	%r15, %rdi
	callq	_iwl_alive_notify
	testl	%eax, %eax
	je	LBB0_12
## %bb.13:
	movl	%eax, %ebx
	leaq	L_.str.1(%rip), %rsi
	movq	%r15, %rdi
	movl	%eax, %edx
	callq	_IWL_WARN
	jmp	LBB0_14
LBB0_8:
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	callq	_IWL_ERR
	movl	%r13d, (%r15)
	movq	_EIO@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_12:
	xorl	%ebx, %ebx
	jmp	LBB0_15
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__const
	.p2align	2                               ## @iwl_load_ucode_wait_alive.alive_cmd
_iwl_load_ucode_wait_alive.alive_cmd:
	.long	128                             ## 0x80

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_iwl_alive_fn,4,2               ## @iwl_alive_fn
	.comm	_UCODE_ALIVE_TIMEOUT,4,2        ## @UCODE_ALIVE_TIMEOUT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Loaded ucode is not valid!\n"

	.comm	_EIO,4,2                        ## @EIO
	.comm	_IWL_UCODE_WOWLAN,4,2           ## @IWL_UCODE_WOWLAN
L_.str.1:                               ## @.str.1
	.asciz	"Could not complete ALIVE transition: %d\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_iwl_load_ucode_wait_alive      ; -- Begin function iwl_load_ucode_wait_alive
	.p2align	2
_iwl_load_ucode_wait_alive:             ; @iwl_load_ucode_wait_alive
	.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	x20, x1
	mov	x19, x0
	ldr	w0, [x0, #16]
	bl	_iwl_get_ucode_image
	mov	x21, x0
	cmp	x0, #0
	cset	w0, eq
	bl	_WARN_ON
	cbz	x0, LBB0_3
; %bb.1:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_2:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_8
LBB0_3:
	ldr	w24, [x19]
	add	x22, x19, #8
	stp	w20, wzr, [x19]
Lloh2:
	adrp	x23, _iwl_load_ucode_wait_alive.alive_cmd@PAGE
Lloh3:
	add	x23, x23, _iwl_load_ucode_wait_alive.alive_cmd@PAGEOFF
	mov	x0, x23
	bl	_ARRAY_SIZE
	mov	x3, x0
Lloh4:
	adrp	x8, _iwl_alive_fn@GOTPAGE
Lloh5:
	ldr	x8, [x8, _iwl_alive_fn@GOTPAGEOFF]
Lloh6:
	ldr	w4, [x8]
	add	x1, sp, #8
	mov	x5, sp
	mov	x0, x22
	mov	x2, x23
	bl	_iwl_init_notification_wait
	ldr	w0, [x19, #12]
	mov	x1, x21
	mov	w2, #0
	bl	_iwl_trans_start_fw
	cbz	w0, LBB0_5
; %bb.4:
	mov	x21, x0
	str	w24, [x19]
	add	x1, sp, #8
	mov	x0, x22
	bl	_iwl_remove_notification
	b	LBB0_8
LBB0_5:
Lloh7:
	adrp	x8, _UCODE_ALIVE_TIMEOUT@GOTPAGE
Lloh8:
	ldr	x8, [x8, _UCODE_ALIVE_TIMEOUT@GOTPAGEOFF]
Lloh9:
	ldr	w2, [x8]
	add	x1, sp, #8
	mov	x0, x22
	bl	_iwl_wait_notification
	cbz	w0, LBB0_9
; %bb.6:
	mov	x21, x0
LBB0_7:
	str	w24, [x19]
LBB0_8:
	mov	x0, x21
	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_9:
	ldr	w8, [sp]
	cbz	w8, LBB0_14
; %bb.10:
	mov	w8, #1
	str	w8, [x19, #4]
Lloh10:
	adrp	x8, _IWL_UCODE_WOWLAN@GOTPAGE
Lloh11:
	ldr	x8, [x8, _IWL_UCODE_WOWLAN@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	cmp	w8, w20
	b.eq	LBB0_12
; %bb.11:
	mov	w0, #5
	bl	_msleep
LBB0_12:
	mov	x0, x19
	bl	_iwl_alive_notify
	mov	x21, x0
	cbz	w0, LBB0_8
; %bb.13:
Lloh13:
	adrp	x1, l_.str.1@PAGE
Lloh14:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	mov	x2, x21
	bl	_IWL_WARN
	b	LBB0_7
LBB0_14:
Lloh15:
	adrp	x1, l_.str@PAGE
Lloh16:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_IWL_ERR
	str	w24, [x19]
Lloh17:
	adrp	x8, _EIO@GOTPAGE
Lloh18:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
	b	LBB0_2
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpAdd	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__const
	.p2align	2                               ; @iwl_load_ucode_wait_alive.alive_cmd
_iwl_load_ucode_wait_alive.alive_cmd:
	.long	128                             ; 0x80

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_iwl_alive_fn,4,2               ; @iwl_alive_fn
	.comm	_UCODE_ALIVE_TIMEOUT,4,2        ; @UCODE_ALIVE_TIMEOUT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Loaded ucode is not valid!\n"

	.comm	_EIO,4,2                        ; @EIO
	.comm	_IWL_UCODE_WOWLAN,4,2           ; @IWL_UCODE_WOWLAN
l_.str.1:                               ; @.str.1
	.asciz	"Could not complete ALIVE transition: %d\n"

.subsections_via_symbols
