	.file	"extr_thermal.c_armada_thermal_attach.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"Could not allocate memory for the status register\n"
	.align 8
.LC1:
	.string	"Could not allocate memory for the control register\n"
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC2:
	.string	"Armada Thermal"
.LC3:
	.string	"temperature"
.LC4:
	.string	"SoC temperature"
	.text
	.p2align 4
	.type	armada_thermal_attach, @function
armada_thermal_attach:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	mov	r12d, edi
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	sub	rsp, 16
	.cfi_def_cfa_offset 64
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 8[rsp], rax
	xor	eax, eax
	lea	r13, 4[rsp]
	call	device_get_softc@PLT
	mov	ecx, DWORD PTR RF_ACTIVE[rip]
	mov	rdx, r13
	mov	edi, r12d
	mov	rbp, rax
	mov	esi, DWORD PTR SYS_RES_MEMORY[rip]
	mov	eax, DWORD PTR STAT_RID[rip]
	mov	DWORD PTR 4[rsp], eax
	call	bus_alloc_resource_any@PLT
	mov	QWORD PTR 24[rbp], rax
	test	rax, rax
	je	.L12
	mov	eax, DWORD PTR CTRL_RID[rip]
	mov	ecx, DWORD PTR RF_ACTIVE[rip]
	mov	rdx, r13
	mov	edi, r12d
	mov	esi, DWORD PTR SYS_RES_MEMORY[rip]
	mov	DWORD PTR 4[rsp], eax
	call	bus_alloc_resource_any@PLT
	mov	QWORD PTR 16[rbp], rax
	test	rax, rax
	je	.L13
	mov	rax, QWORD PTR 32[rbp]
	mov	rdi, rbp
	mov	ebx, 1000
	call	[QWORD PTR [rax]]
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L15:
	mov	edi, 10
	call	DELAY@PLT
	sub	ebx, 1
	je	.L14
.L6:
	mov	rsi, rbp
	mov	rdi, rbp
	call	armada_tsen_get_temp@PLT
	test	rax, rax
	jne	.L15
	mov	ecx, DWORD PTR MTX_DEF[rip]
	lea	r14, 8[rbp]
	lea	r13, 4[rbp]
	xor	edx, edx
	lea	rsi, .LC2[rip]
	mov	rdi, r14
	call	mtx_init@PLT
	mov	rdi, r13
	xor	edx, edx
	mov	rsi, r14
	call	callout_init_mtx@PLT
	mov	edx, DWORD PTR armada_temp_update[rip]
	mov	rcx, rbp
	mov	rdi, r13
	mov	esi, DWORD PTR hz[rip]
	call	callout_reset@PLT
	mov	edi, r12d
	call	device_get_sysctl_ctx@PLT
	mov	edi, r12d
	mov	r13, rax
	call	device_get_sysctl_tree@PLT
	mov	edi, eax
	call	SYSCTL_CHILDREN@PLT
	sub	rsp, 8
	.cfi_def_cfa_offset 72
	mov	r9, rbp
	mov	rdi, r13
	mov	rsi, rax
	lea	rax, .LC4[rip]
	mov	edx, DWORD PTR OID_AUTO[rip]
	mov	r8d, DWORD PTR CTLFLAG_RD[rip]
	push	rax
	.cfi_def_cfa_offset 80
	lea	rcx, .LC3[rip]
	call	SYSCTL_ADD_LONG@PLT
	pop	rax
	.cfi_def_cfa_offset 72
	xor	eax, eax
	pop	rdx
	.cfi_def_cfa_offset 64
.L1:
	mov	rcx, QWORD PTR 8[rsp]
	xor	rcx, QWORD PTR fs:40
	jne	.L16
	add	rsp, 16
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	pop	rbx
	.cfi_def_cfa_offset 40
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L12:
	.cfi_restore_state
	lea	rsi, .LC0[rip]
	mov	edi, r12d
	call	device_printf@PLT
	mov	eax, DWORD PTR ENXIO[rip]
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L14:
	mov	r13, QWORD PTR 24[rbp]
	mov	rdi, r13
	call	rman_get_rid@PLT
	mov	esi, DWORD PTR SYS_RES_MEMORY[rip]
	mov	rcx, r13
	mov	edi, r12d
	mov	edx, eax
	call	bus_release_resource@PLT
	mov	r13, QWORD PTR 16[rbp]
	mov	QWORD PTR 24[rbp], 0
	mov	rdi, r13
	call	rman_get_rid@PLT
	mov	esi, DWORD PTR SYS_RES_MEMORY[rip]
	mov	rcx, r13
	mov	edi, r12d
	mov	edx, eax
	call	bus_release_resource@PLT
	mov	QWORD PTR 16[rbp], 0
	mov	eax, DWORD PTR ENXIO[rip]
	jmp	.L1
.L13:
	lea	rsi, .LC1[rip]
	mov	edi, r12d
	call	device_printf@PLT
	mov	r13, QWORD PTR 24[rbp]
	mov	rdi, r13
	call	rman_get_rid@PLT
	mov	esi, DWORD PTR SYS_RES_MEMORY[rip]
	mov	rcx, r13
	mov	edi, r12d
	mov	edx, eax
	call	bus_release_resource@PLT
	mov	QWORD PTR 24[rbp], 0
	mov	eax, DWORD PTR ENXIO[rip]
	jmp	.L1
.L16:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	armada_thermal_attach, .-armada_thermal_attach
	.comm	hz,4,4
	.comm	armada_temp_update,4,4
	.comm	SYS_RES_MEMORY,4,4
	.comm	STAT_RID,4,4
	.comm	RF_ACTIVE,4,4
	.comm	OID_AUTO,4,4
	.comm	MTX_DEF,4,4
	.comm	ENXIO,4,4
	.comm	CTRL_RID,4,4
	.comm	CTLFLAG_RD,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_thermal.c_armada_thermal_attach.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"Could not allocate memory for the status register\012"
	.ascii	"\000"
	.align	2
.LC1:
	.ascii	"Could not allocate memory for the control register\012"
	.ascii	"\000"
	.align	2
.LC2:
	.ascii	"Armada Thermal\000"
	.align	2
.LC3:
	.ascii	"temperature\000"
	.align	2
.LC4:
	.ascii	"SoC temperature\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC5:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	armada_thermal_attach, %function
armada_thermal_attach:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	ldr	r3, .L17
	sub	sp, sp, #24
	mov	r7, r0
	ldr	r3, [r3]
	str	r3, [sp, #20]
	mov	r3,#0
	bl	device_get_softc
	ldr	r3, .L17+4
	ldr	r4, .L17+8
	ldr	r8, .L17+12
	ldr	ip, [r3]
	mov	r6, r0
	ldr	r3, [r4]
	mov	r0, r7
	ldr	r1, [r8]
	add	r2, sp, #16
	str	ip, [sp, #16]
	bl	bus_alloc_resource_any
	cmp	r0, #0
	str	r0, [r6, #16]
	beq	.L12
	ldr	r2, .L17+16
	ldr	r3, [r4]
	ldr	ip, [r2]
	mov	r0, r7
	ldr	r1, [r8]
	add	r2, sp, #16
	str	ip, [sp, #16]
	bl	bus_alloc_resource_any
	cmp	r0, #0
	mov	r4, r0
	str	r0, [r6, #12]
	beq	.L13
	ldr	r3, [r6, #20]
	mov	r0, r6
	ldr	r3, [r3]
	blx	r3
	mov	r5, #1000
	b	.L6
.L15:
	mov	r0, #10
	bl	DELAY
	subs	r5, r5, #1
	beq	.L14
.L6:
	mov	r1, r6
	mov	r0, r6
	bl	armada_tsen_get_temp
	subs	r4, r0, #0
	bne	.L15
	ldr	r3, .L17+20
	add	r8, r6, #8
	ldr	r3, [r3]
	add	r5, r6, #4
	mov	r2, r4
	ldr	r1, .L17+24
	mov	r0, r8
	bl	mtx_init
	mov	r1, r8
	mov	r0, r5
	mov	r2, r4
	bl	callout_init_mtx
	ldr	r3, .L17+28
	ldr	r2, .L17+32
	ldr	r1, [r3]
	ldr	r2, [r2]
	mov	r3, r6
	mov	r0, r5
	bl	callout_reset
	mov	r0, r7
	bl	device_get_sysctl_ctx
	mov	r5, r0
	mov	r0, r7
	bl	device_get_sysctl_tree
	bl	SYSCTL_CHILDREN
	ldr	r3, .L17+36
	ldr	r2, .L17+40
	ldr	ip, [r3]
	ldr	r3, .L17+44
	str	r6, [sp, #4]
	str	ip, [sp]
	mov	r1, r0
	ldr	r2, [r2]
	mov	r0, r5
	str	r3, [sp, #8]
	ldr	r3, .L17+48
	bl	SYSCTL_ADD_LONG
.L1:
	ldr	r3, .L17
	ldr	r2, [r3]
	ldr	r3, [sp, #20]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L16
	mov	r0, r4
	add	sp, sp, #24
	@ sp needed
	pop	{r4, r5, r6, r7, r8, pc}
.L12:
	mov	r0, r7
	ldr	r1, .L17+52
	bl	device_printf
	ldr	r3, .L17+56
	ldr	r4, [r3]
	b	.L1
.L14:
	ldr	r0, [r6, #16]
	ldr	r4, [r8]
	bl	rman_get_rid
	mov	r1, r4
	mov	r2, r0
	ldr	r3, [r6, #16]
	mov	r0, r7
	bl	bus_release_resource
	ldr	r0, [r6, #12]
	str	r5, [r6, #16]
	ldr	r4, [r8]
	bl	rman_get_rid
	mov	r1, r4
	mov	r2, r0
	ldr	r3, [r6, #12]
	mov	r0, r7
	bl	bus_release_resource
	ldr	r3, .L17+56
	str	r5, [r6, #12]
	ldr	r4, [r3]
	b	.L1
.L13:
	ldr	r1, .L17+60
	mov	r0, r7
	bl	device_printf
	ldr	r0, [r6, #16]
	ldr	r5, [r8]
	bl	rman_get_rid
	ldr	r3, [r6, #16]
	mov	r2, r0
	mov	r1, r5
	mov	r0, r7
	bl	bus_release_resource
	ldr	r3, .L17+56
	str	r4, [r6, #16]
	ldr	r4, [r3]
	b	.L1
.L16:
	bl	__stack_chk_fail
.L18:
	.align	2
.L17:
	.word	.LC5
	.word	STAT_RID
	.word	RF_ACTIVE
	.word	SYS_RES_MEMORY
	.word	CTRL_RID
	.word	MTX_DEF
	.word	.LC2
	.word	hz
	.word	armada_temp_update
	.word	CTLFLAG_RD
	.word	OID_AUTO
	.word	.LC4
	.word	.LC3
	.word	.LC0
	.word	ENXIO
	.word	.LC1
	.size	armada_thermal_attach, .-armada_thermal_attach
	.comm	hz,4,4
	.comm	armada_temp_update,4,4
	.comm	SYS_RES_MEMORY,4,4
	.comm	STAT_RID,4,4
	.comm	RF_ACTIVE,4,4
	.comm	OID_AUTO,4,4
	.comm	MTX_DEF,4,4
	.comm	ENXIO,4,4
	.comm	CTRL_RID,4,4
	.comm	CTLFLAG_RD,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
