	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hinic_api_cmd_init             ## -- Begin function hinic_api_cmd_init
	.p2align	4, 0x90
_hinic_api_cmd_init:                    ## @hinic_api_cmd_init
	.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	%rdi, %r12
	movq	(%rsi), %rbx
	movq	%rsi, -56(%rbp)
	movq	_API_CHAIN_NUM_CELLS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -64(%rbp)
	movl	$4, %edi
	callq	_API_CMD_CELL_SIZE
	movl	%eax, -68(%rbp)
	movq	_HINIC_API_CMD_WRITE_TO_MGMT_CPU@GOTPCREL(%rip), %r15
	movl	(%r15), %ecx
	movq	_HINIC_API_CMD_MAX@GOTPCREL(%rip), %r13
	movl	(%r13), %edx
	xorl	%eax, %eax
	cmpl	%edx, %ecx
	jae	LBB0_13
## %bb.1:
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movl	$1, %r14d
	subl	%ecx, %r14d
	movq	%rcx, %rbx
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	%ebx, -72(%rbp)
	movl	%ecx, %ecx
	cmpq	%rcx, %rbx
	jne	LBB0_5
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	leaq	-72(%rbp), %rdi
	callq	_api_cmd_create_chain
	movq	%rax, (%r12,%rbx,8)
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	jne	LBB0_7
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	(%r13), %edx
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=1
	incq	%rbx
	movl	%edx, %ecx
	cmpq	%rcx, %rbx
	jae	LBB0_6
## %bb.15:                              ##   in Loop: Header=BB0_2 Depth=1
	movl	(%r15), %ecx
	decl	%r14d
	jmp	LBB0_2
LBB0_6:
	xorl	%eax, %eax
	jmp	LBB0_13
LBB0_7:
	movl	%ebx, %r13d
	leaq	L_.str(%rip), %rsi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	%ebx, %edx
	callq	_dev_err
	movq	(%r12,%r13,8), %rdi
	callq	_PTR_ERR
	movl	%eax, %r13d
	movl	(%r15), %eax
	cmpl	%ebx, %eax
	jae	LBB0_12
## %bb.8:
	addl	%eax, %r14d
	negl	%r14d
	movq	%rax, %rbx
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movl	%eax, %eax
	cmpq	%rax, %rbx
	jne	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	(%r12,%rbx,8), %rdi
	callq	_api_cmd_destroy_chain
LBB0_11:                                ##   in Loop: Header=BB0_9 Depth=1
	subl	$1, %r14d
	jb	LBB0_12
## %bb.14:                              ##   in Loop: Header=BB0_9 Depth=1
	movl	(%r15), %eax
	incq	%rbx
	jmp	LBB0_9
LBB0_12:
	movl	%r13d, %eax
LBB0_13:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_API_CHAIN_NUM_CELLS,4,2        ## @API_CHAIN_NUM_CELLS
	.comm	_HINIC_API_CMD_WRITE_TO_MGMT_CPU,4,2 ## @HINIC_API_CMD_WRITE_TO_MGMT_CPU
	.comm	_HINIC_API_CMD_MAX,4,2          ## @HINIC_API_CMD_MAX
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to create chain %d\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hinic_api_cmd_init             ; -- Begin function hinic_api_cmd_init
	.p2align	2
_hinic_api_cmd_init:                    ; @hinic_api_cmd_init
	.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	x19, x0
	ldr	x20, [x1]
	str	x1, [sp, #24]
Lloh0:
	adrp	x8, _API_CHAIN_NUM_CELLS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _API_CHAIN_NUM_CELLS@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	str	w8, [sp, #16]
	mov	w0, #4
	bl	_API_CMD_CELL_SIZE
Lloh3:
	adrp	x22, _HINIC_API_CMD_WRITE_TO_MGMT_CPU@GOTPAGE
Lloh4:
	ldr	x22, [x22, _HINIC_API_CMD_WRITE_TO_MGMT_CPU@GOTPAGEOFF]
	str	w0, [sp, #12]
	ldr	w9, [x22]
Lloh5:
	adrp	x23, _HINIC_API_CMD_MAX@GOTPAGE
Lloh6:
	ldr	x23, [x23, _HINIC_API_CMD_MAX@GOTPAGEOFF]
	ldr	w8, [x23]
	cmp	w9, w8
	b.hs	LBB0_7
; %bb.1:
	mov	x21, x9
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	str	w21, [sp, #8]
	cmp	x21, w9, uxtw
	b.ne	LBB0_5
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	add	x0, sp, #8
	bl	_api_cmd_create_chain
	str	x0, [x19, x21, lsl #3]
	bl	_IS_ERR
	cbnz	x0, LBB0_9
; %bb.4:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	w8, [x23]
LBB0_5:                                 ;   in Loop: Header=BB0_2 Depth=1
	add	x21, x21, #1
	cmp	x21, w8, uxtw
	b.hs	LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	w9, [x22]
	b	LBB0_2
LBB0_7:
	mov	w20, #0
LBB0_8:
	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_9:
Lloh7:
	adrp	x1, l_.str@PAGE
Lloh8:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	mov	x2, x21
	bl	_dev_err
	ldr	x0, [x19, w21, uxtw #3]
	bl	_PTR_ERR
	mov	x20, x0
	ldr	w8, [x22]
	cmp	w8, w21
	b.hs	LBB0_8
; %bb.10:
	mvn	w9, w8
	add	w21, w9, w21
	mov	x23, x8
	cmp	x23, w8, uxtw
	b.ne	LBB0_12
LBB0_11:
	ldr	x0, [x19, x23, lsl #3]
	bl	_api_cmd_destroy_chain
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	cbz	w21, LBB0_8
; %bb.13:                               ;   in Loop: Header=BB0_12 Depth=1
	ldr	w8, [x22]
	sub	w21, w21, #1
	add	x23, x23, #1
	cmp	x23, w8, uxtw
	b.eq	LBB0_11
	b	LBB0_12
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_API_CHAIN_NUM_CELLS,4,2        ; @API_CHAIN_NUM_CELLS
	.comm	_HINIC_API_CMD_WRITE_TO_MGMT_CPU,4,2 ; @HINIC_API_CMD_WRITE_TO_MGMT_CPU
	.comm	_HINIC_API_CMD_MAX,4,2          ; @HINIC_API_CMD_MAX
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to create chain %d\n"

.subsections_via_symbols
