	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function activate_firmware
_activate_firmware:                     ## @activate_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	%r12
	pushq	%rbx
	subq	$32, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %ebx
	movl	%esi, %r14d
	movl	%edi, %r15d
	leaq	-56(%rbp), %r12
	movq	%r12, %rdi
	xorl	%esi, %esi
	movl	$24, %edx
	callq	_memset
	movq	_NVME_OPC_FIRMWARE_ACTIVATE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -36(%rbp)
	shll	$3, %ebx
	orl	%r14d, %ebx
	movl	%ebx, %edi
	callq	_htole32
	movl	%eax, -40(%rbp)
	movq	$0, -48(%rbp)
	movq	_NVME_PASSTHROUGH_CMD@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r15d, %edi
	movq	%r12, %rdx
	callq	_ioctl
	testq	%rax, %rax
	jns	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rsi
	movl	$1, %edi
	callq	_err
LBB0_2:
	movl	-56(%rbp), %edi
	callq	_NVME_STATUS_GET_SCT
	movq	%rax, %rbx
	movl	-56(%rbp), %edi
	callq	_NVME_STATUS_GET_SC
	movq	_NVME_SCT_COMMAND_SPECIFIC@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rbx
	jne	LBB0_4
## %bb.3:
	movq	_NVME_SC_FIRMWARE_REQUIRES_RESET@GOTPCREL(%rip), %rcx
	movl	$1, %ebx
	cmpq	(%rcx), %rax
	je	LBB0_6
LBB0_4:
	leaq	-56(%rbp), %rdi
	callq	_nvme_completion_is_error
	xorl	%ebx, %ebx
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	leaq	L_.str.1(%rip), %rsi
	movl	$1, %edi
	callq	_errx
LBB0_6:
	movl	%ebx, %eax
	addq	$32, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_NVME_OPC_FIRMWARE_ACTIVATE,4,2 ## @NVME_OPC_FIRMWARE_ACTIVATE
	.comm	_NVME_PASSTHROUGH_CMD,4,2       ## @NVME_PASSTHROUGH_CMD
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"firmware activate request failed"

	.comm	_NVME_SCT_COMMAND_SPECIFIC,8,3  ## @NVME_SCT_COMMAND_SPECIFIC
	.comm	_NVME_SC_FIRMWARE_REQUIRES_RESET,8,3 ## @NVME_SC_FIRMWARE_REQUIRES_RESET
L_.str.1:                               ## @.str.1
	.asciz	"firmware activate request returned error"

	.no_dead_strip	_activate_firmware
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function activate_firmware
_activate_firmware:                     ; @activate_firmware
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	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
	mov	x19, x2
	mov	x20, x1
	mov	x21, x0
	add	x0, sp, #8
	mov	w1, #0
	mov	w2, #24
	bl	_memset
Lloh0:
	adrp	x8, _NVME_OPC_FIRMWARE_ACTIVATE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _NVME_OPC_FIRMWARE_ACTIVATE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	str	w8, [sp, #28]
	orr	w0, w20, w19, lsl #3
	bl	_htole32
	str	w0, [sp, #24]
	str	xzr, [sp, #16]
Lloh3:
	adrp	x8, _NVME_PASSTHROUGH_CMD@GOTPAGE
Lloh4:
	ldr	x8, [x8, _NVME_PASSTHROUGH_CMD@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	add	x2, sp, #8
	mov	x0, x21
	bl	_ioctl
	tbz	x0, #63, LBB0_2
; %bb.1:
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #1
	bl	_err
LBB0_2:
	ldr	w0, [sp, #8]
	bl	_NVME_STATUS_GET_SCT
	mov	x19, x0
	ldr	w0, [sp, #8]
	bl	_NVME_STATUS_GET_SC
Lloh8:
	adrp	x8, _NVME_SCT_COMMAND_SPECIFIC@GOTPAGE
Lloh9:
	ldr	x8, [x8, _NVME_SCT_COMMAND_SPECIFIC@GOTPAGEOFF]
Lloh10:
	ldr	x8, [x8]
Lloh11:
	adrp	x9, _NVME_SC_FIRMWARE_REQUIRES_RESET@GOTPAGE
Lloh12:
	ldr	x9, [x9, _NVME_SC_FIRMWARE_REQUIRES_RESET@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x9]
	cmp	x19, x8
	ccmp	x0, x9, #0, eq
	b.eq	LBB0_5
; %bb.3:
	add	x0, sp, #8
	bl	_nvme_completion_is_error
	cbz	x0, LBB0_6
; %bb.4:
Lloh14:
	adrp	x1, l_.str.1@PAGE
Lloh15:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	w0, #1
	bl	_errx
	mov	w0, #0
	b	LBB0_6
LBB0_5:
	mov	w0, #1
LBB0_6:
	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
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_NVME_OPC_FIRMWARE_ACTIVATE,4,2 ; @NVME_OPC_FIRMWARE_ACTIVATE
	.comm	_NVME_PASSTHROUGH_CMD,4,2       ; @NVME_PASSTHROUGH_CMD
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"firmware activate request failed"

	.comm	_NVME_SCT_COMMAND_SPECIFIC,8,3  ; @NVME_SCT_COMMAND_SPECIFIC
	.comm	_NVME_SC_FIRMWARE_REQUIRES_RESET,8,3 ; @NVME_SC_FIRMWARE_REQUIRES_RESET
l_.str.1:                               ; @.str.1
	.asciz	"firmware activate request returned error"

	.no_dead_strip	_activate_firmware
.subsections_via_symbols
