	.file	"extr_hsi_core.c_hsi_alloc_controller.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"port%d"
	.text
	.p2align 4
	.globl	hsi_alloc_controller
	.type	hsi_alloc_controller, @function
hsi_alloc_controller:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 8
	.cfi_def_cfa_offset 64
	test	edi, edi
	je	.L2
	mov	ebp, edi
	mov	edi, 24
	mov	r13d, esi
	call	kzalloc@PLT
	mov	r12, rax
	test	rax, rax
	je	.L2
	mov	edx, r13d
	mov	esi, 8
	mov	edi, ebp
	call	kcalloc@PLT
	mov	rbx, rax
	test	rax, rax
	je	.L16
	mov	QWORD PTR 8[r12], rax
	mov	eax, DWORD PTR hsi_controller_release[rip]
	lea	rdi, 16[r12]
	lea	r15d, -1[rbp]
	mov	DWORD PTR [r12], ebp
	lea	r14, .LC0[rip]
	xor	ebp, ebp
	mov	DWORD PTR 16[r12], eax
	call	device_initialize@PLT
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L5:
	mov	edx, DWORD PTR hsi_dummy_msg[rip]
	mov	DWORD PTR [rax], ebp
	add	rbx, 8
	mov	DWORD PTR 56[rax], edx
	mov	rdx, QWORD PTR hsi_dummy_cl[rip]
	mov	QWORD PTR 48[rax], rdx
	mov	rax, QWORD PTR -8[rbx]
	mov	QWORD PTR 40[rax], rdx
	mov	rax, QWORD PTR -8[rbx]
	mov	QWORD PTR 32[rax], rdx
	mov	rax, QWORD PTR -8[rbx]
	mov	QWORD PTR 24[rax], rdx
	mov	rax, QWORD PTR -8[rbx]
	mov	QWORD PTR 16[rax], rdx
	mov	rax, QWORD PTR -8[rbx]
	lea	rdi, 12[rax]
	call	mutex_init@PLT
	mov	rax, QWORD PTR -8[rbx]
	lea	rdi, 8[rax]
	call	BLOCKING_INIT_NOTIFIER_HEAD@PLT
	mov	rax, QWORD PTR -8[rbx]
	mov	edx, ebp
	mov	rsi, r14
	lea	rdi, 4[rax]
	call	dev_set_name@PLT
	mov	rax, QWORD PTR 8[r12]
	mov	rdi, QWORD PTR [rax+rbp*8]
	mov	eax, DWORD PTR hsi_port_release[rip]
	mov	DWORD PTR 4[rdi], eax
	add	rdi, 4
	call	device_initialize@PLT
	lea	rax, 1[rbp]
	cmp	rbp, r15
	je	.L1
	mov	rbp, rax
.L6:
	mov	esi, r13d
	mov	edi, 64
	call	kzalloc@PLT
	mov	QWORD PTR [rbx], rax
	test	rax, rax
	jne	.L5
	mov	rdi, r12
	xor	r12d, r12d
	call	hsi_put_controller@PLT
.L1:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	rax, r12
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L2:
	.cfi_restore_state
	xor	r12d, r12d
	jmp	.L1
.L16:
	mov	rdi, r12
	xor	r12d, r12d
	call	kfree@PLT
	jmp	.L1
	.cfi_endproc
.LFE0:
	.size	hsi_alloc_controller, .-hsi_alloc_controller
	.comm	hsi_port_release,4,4
	.comm	hsi_dummy_msg,4,4
	.comm	hsi_dummy_cl,8,8
	.comm	hsi_controller_release,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_hsi_core.c_hsi_alloc_controller.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"port%d\000"
	.text
	.align	2
	.global	hsi_alloc_controller
	.syntax unified
	.arm
	.fpu softvfp
	.type	hsi_alloc_controller, %function
hsi_alloc_controller:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	subs	r6, r0, #0
	sub	sp, sp, #12
	beq	.L2
	mov	r0, #12
	mov	r7, r1
	bl	kzalloc
	subs	r5, r0, #0
	beq	.L2
	mov	r2, r7
	mov	r1, #4
	mov	r0, r6
	bl	kcalloc
	subs	r10, r0, #0
	mov	r0, r5
	beq	.L16
	ldr	r2, .L17
	str	r10, [r5, #4]
	ldr	r2, [r2]
	str	r6, [r5]
	str	r2, [r0, #8]!
	bl	device_initialize
	mov	r4, #0
	ldr	fp, .L17+4
	ldr	r9, .L17+8
	ldr	r8, .L17+12
	sub	r10, r10, #4
	b	.L6
.L5:
	ldr	r3, .L17+16
	ldr	ip, [fp]
	ldr	r1, [r3]
	str	r1, [r0, #32]
	ldr	r0, [r10]
	str	ip, [r2, #36]
	str	r4, [r2]
	str	r1, [r0, #28]
	ldr	r2, [r10]
	str	r1, [r2, #24]
	ldr	r2, [r10]
	str	r1, [r2, #20]
	ldr	r2, [r10]
	str	r1, [r2, #16]
	ldr	r0, [r10]
	add	r0, r0, #12
	bl	mutex_init
	ldr	r0, [r10]
	add	r0, r0, #8
	bl	BLOCKING_INIT_NOTIFIER_HEAD
	ldr	r0, [r10]
	mov	r2, r4
	mov	r1, r9
	add	r0, r0, #4
	bl	dev_set_name
	ldr	r1, [r5, #4]
	ldr	r2, [r8]
	ldr	r0, [r1, r4, lsl #2]
	add	r4, r4, #1
	str	r2, [r0, #4]!
	bl	device_initialize
	cmp	r6, r4
	beq	.L1
.L6:
	mov	r1, r7
	mov	r0, #40
	bl	kzalloc
	cmp	r0, #0
	mov	r2, r0
	str	r0, [r10, #4]!
	bne	.L5
	str	r0, [sp, #4]
	mov	r0, r5
	bl	hsi_put_controller
	ldr	r2, [sp, #4]
	mov	r5, r2
.L1:
	mov	r0, r5
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L2:
	mov	r5, #0
	mov	r0, r5
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L16:
	bl	kfree
	mov	r5, r10
	b	.L1
.L18:
	.align	2
.L17:
	.word	hsi_controller_release
	.word	hsi_dummy_msg
	.word	.LC0
	.word	hsi_port_release
	.word	hsi_dummy_cl
	.size	hsi_alloc_controller, .-hsi_alloc_controller
	.comm	hsi_port_release,4,4
	.comm	hsi_dummy_msg,4,4
	.comm	hsi_dummy_cl,4,4
	.comm	hsi_controller_release,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
