	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mlx5tool_fw_update
_mlx5tool_fw_update:                    ## @mlx5tool_fw_update
	.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
	movq	%rdx, %rbx
	movq	%rsi, %r12
	movl	%edi, %r15d
	movq	_O_RDONLY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rdx, %rdi
	callq	_open
	movl	%eax, %r14d
	cmpl	$-1, %eax
	je	LBB0_1
## %bb.3:
	leaq	-40(%rbp), %rsi
	movl	%r14d, %edi
	callq	_fstat
	testl	%eax, %eax
	je	LBB0_5
## %bb.4:
	leaq	L_.str.1(%rip), %rdi
	jmp	LBB0_2
LBB0_1:
	leaq	L_.str(%rip), %rdi
	jmp	LBB0_2
LBB0_5:
	leaq	-56(%rbp), %rdi
	xorl	%esi, %esi
	movl	$16, %edx
	callq	_memset
	leaq	-44(%rbp), %rdi
	movq	%r12, %rsi
	movl	$4, %edx
	callq	_memcpy
	movl	-40(%rbp), %r12d
	movq	_PROT_READ@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_MAP_PRIVATE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	xorl	%edi, %edi
	movl	%r12d, %esi
	movl	%r14d, %r8d
	xorl	%r9d, %r9d
	callq	_mmap
	movq	%rax, -56(%rbp)
	movq	_MAP_FAILED@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_7
## %bb.6:
	leaq	L_.str.2(%rip), %rdi
LBB0_2:
	movq	%rbx, %rsi
	xorl	%eax, %eax
	callq	_warn
	movl	$1, %ebx
LBB0_10:
	movl	%r14d, %edi
	callq	_close
	movl	%ebx, %eax
	addq	$32, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movl	%r12d, -48(%rbp)
	movq	_MLX5_FW_UPDATE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-56(%rbp), %rdx
	movl	%r15d, %edi
	callq	_ioctl
	cmpl	$-1, %eax
	jne	LBB0_9
## %bb.8:
	leaq	L_.str.3(%rip), %rdi
	xorl	%eax, %eax
	callq	_warn
LBB0_9:
	movq	-56(%rbp), %rdi
	movl	%r12d, %esi
	callq	_munmap
	xorl	%ebx, %ebx
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_O_RDONLY,4,2                   ## @O_RDONLY
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Unable to open %s"

L_.str.1:                               ## @.str.1
	.asciz	"Unable to stat %s"

	.comm	_PROT_READ,4,2                  ## @PROT_READ
	.comm	_MAP_PRIVATE,4,2                ## @MAP_PRIVATE
	.comm	_MAP_FAILED,8,3                 ## @MAP_FAILED
L_.str.2:                               ## @.str.2
	.asciz	"Unable to mmap %s"

	.comm	_MLX5_FW_UPDATE,4,2             ## @MLX5_FW_UPDATE
L_.str.3:                               ## @.str.3
	.asciz	"MLX5_FW_UPDATE"

	.no_dead_strip	_mlx5tool_fw_update
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mlx5tool_fw_update
_mlx5tool_fw_update:                    ; @mlx5tool_fw_update
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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, x2
	mov	x22, x1
	mov	x21, x0
Lloh0:
	adrp	x8, _O_RDONLY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _O_RDONLY@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x2
	bl	_open
	mov	x19, x0
	cmn	w0, #1
	b.eq	LBB0_3
; %bb.1:
	add	x1, sp, #24
	mov	x0, x19
	bl	_fstat
	cbz	w0, LBB0_4
; %bb.2:
	str	x20, [sp]
Lloh3:
	adrp	x0, l_.str.1@PAGE
Lloh4:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_6
LBB0_3:
	str	x20, [sp]
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_6
LBB0_4:
	add	x23, sp, #8
	add	x0, sp, #8
	mov	w1, #0
	mov	w2, #16
	bl	_memset
	add	x0, x23, #12
	mov	x1, x22
	mov	w2, #4
	bl	_memcpy
	ldr	w22, [sp, #24]
Lloh7:
	adrp	x8, _PROT_READ@GOTPAGE
Lloh8:
	ldr	x8, [x8, _PROT_READ@GOTPAGEOFF]
Lloh9:
	ldr	w2, [x8]
Lloh10:
	adrp	x8, _MAP_PRIVATE@GOTPAGE
Lloh11:
	ldr	x8, [x8, _MAP_PRIVATE@GOTPAGEOFF]
Lloh12:
	ldr	w3, [x8]
	mov	x0, #0
	mov	x1, x22
	mov	x4, x19
	mov	w5, #0
	bl	_mmap
	str	x0, [sp, #8]
Lloh13:
	adrp	x8, _MAP_FAILED@GOTPAGE
Lloh14:
	ldr	x8, [x8, _MAP_FAILED@GOTPAGEOFF]
Lloh15:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_8
; %bb.5:
	str	x20, [sp]
Lloh16:
	adrp	x0, l_.str.2@PAGE
Lloh17:
	add	x0, x0, l_.str.2@PAGEOFF
LBB0_6:
	bl	_warn
	mov	w20, #1
LBB0_7:
	mov	x0, x19
	bl	_close
	mov	x0, x20
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_8:
	str	w22, [sp, #16]
Lloh18:
	adrp	x8, _MLX5_FW_UPDATE@GOTPAGE
Lloh19:
	ldr	x8, [x8, _MLX5_FW_UPDATE@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
	add	x2, sp, #8
	mov	x0, x21
	bl	_ioctl
	cmn	w0, #1
	b.ne	LBB0_10
; %bb.9:
Lloh21:
	adrp	x0, l_.str.3@PAGE
Lloh22:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_warn
LBB0_10:
	ldr	x0, [sp, #8]
	mov	x1, x22
	bl	_munmap
	mov	w20, #0
	b	LBB0_7
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_O_RDONLY,4,2                   ; @O_RDONLY
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Unable to open %s"

l_.str.1:                               ; @.str.1
	.asciz	"Unable to stat %s"

	.comm	_PROT_READ,4,2                  ; @PROT_READ
	.comm	_MAP_PRIVATE,4,2                ; @MAP_PRIVATE
	.comm	_MAP_FAILED,8,3                 ; @MAP_FAILED
l_.str.2:                               ; @.str.2
	.asciz	"Unable to mmap %s"

	.comm	_MLX5_FW_UPDATE,4,2             ; @MLX5_FW_UPDATE
l_.str.3:                               ; @.str.3
	.asciz	"MLX5_FW_UPDATE"

	.no_dead_strip	_mlx5tool_fw_update
.subsections_via_symbols
