	.file	"extr_tegra_rtc.c_tegra_rtc_attach.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"Cannot map registers.\n"
.LC1:
	.string	"Cannot allocate interrupt.\n"
.LC2:
	.string	"Cannot get i2c clock: %d\n"
.LC3:
	.string	"Cannot enable clock: %d\n"
.LC4:
	.string	"Cannot setup interrupt.\n"
	.text
	.p2align 4
	.type	tegra_rtc_attach, @function
tegra_rtc_attach:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	mov	r12d, edi
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	sub	rsp, 16
	.cfi_def_cfa_offset 48
	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	DWORD PTR 32[rax], r12d
	mov	rdi, rax
	mov	rbp, rax
	call	LOCK_INIT@PLT
	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], 0
	call	bus_alloc_resource_any@PLT
	mov	QWORD PTR 0[rbp], rax
	test	rax, rax
	je	.L28
	mov	ecx, DWORD PTR RF_ACTIVE[rip]
	mov	esi, DWORD PTR SYS_RES_IRQ[rip]
	mov	rdx, r13
	mov	edi, r12d
	mov	DWORD PTR 4[rsp], 0
	call	bus_alloc_resource_any@PLT
	mov	QWORD PTR 8[rbp], rax
	test	rax, rax
	je	.L29
	lea	rcx, 24[rbp]
	xor	edx, edx
	xor	esi, esi
	mov	edi, r12d
	call	clk_get_by_ofw_index@PLT
	mov	r13d, eax
	test	eax, eax
	jne	.L30
	mov	rdi, QWORD PTR 24[rbp]
	call	clk_enable@PLT
	mov	r13d, eax
	test	eax, eax
	jne	.L31
	mov	esi, DWORD PTR RTC_SECONDS_ALARM0[rip]
	xor	edx, edx
	mov	rdi, rbp
	call	WR4@PLT
	mov	esi, DWORD PTR RTC_SECONDS_ALARM1[rip]
	xor	edx, edx
	mov	rdi, rbp
	call	WR4@PLT
	mov	esi, DWORD PTR RTC_INTR_STATUS[rip]
	mov	edx, -1
	mov	rdi, rbp
	call	WR4@PLT
	mov	esi, DWORD PTR RTC_INTR_MASK[rip]
	xor	edx, edx
	mov	rdi, rbp
	call	WR4@PLT
	sub	rsp, 8
	.cfi_def_cfa_offset 56
	lea	rax, 16[rbp]
	mov	r9, rbp
	mov	rsi, QWORD PTR 8[rbp]
	push	rax
	.cfi_def_cfa_offset 64
	xor	ecx, ecx
	mov	edi, r12d
	mov	r8d, DWORD PTR tegra_rtc_intr[rip]
	mov	edx, DWORD PTR INTR_TYPE_MISC[rip]
	or	edx, DWORD PTR INTR_MPSAFE[rip]
	call	bus_setup_intr@PLT
	mov	r13d, eax
	pop	rax
	.cfi_def_cfa_offset 56
	pop	rdx
	.cfi_def_cfa_offset 48
	test	r13d, r13d
	jne	.L32
	mov	edi, r12d
	call	bus_generic_attach@PLT
	mov	r13d, eax
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L30:
	mov	edx, eax
	lea	rsi, .LC2[rip]
	mov	edi, r12d
	xor	eax, eax
	call	device_printf@PLT
.L3:
	mov	rdi, QWORD PTR 24[rbp]
	test	rdi, rdi
	je	.L9
	call	clk_release@PLT
.L9:
	mov	rdx, QWORD PTR 16[rbp]
	mov	rcx, QWORD PTR 8[rbp]
	test	rdx, rdx
	je	.L10
	mov	rsi, rcx
	mov	edi, r12d
	call	bus_teardown_intr@PLT
	mov	rcx, QWORD PTR 8[rbp]
.L10:
	test	rcx, rcx
	je	.L11
	mov	esi, DWORD PTR SYS_RES_IRQ[rip]
	xor	edx, edx
	mov	edi, r12d
	call	bus_release_resource@PLT
.L11:
	mov	rcx, QWORD PTR 0[rbp]
	test	rcx, rcx
	je	.L12
	mov	esi, DWORD PTR SYS_RES_MEMORY[rip]
	xor	edx, edx
	mov	edi, r12d
	call	bus_release_resource@PLT
.L12:
	mov	rdi, rbp
	call	LOCK_DESTROY@PLT
.L1:
	mov	rax, QWORD PTR 8[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L33
	add	rsp, 16
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	mov	eax, r13d
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L32:
	.cfi_restore_state
	lea	rsi, .LC4[rip]
	mov	edi, r12d
	xor	eax, eax
	call	device_printf@PLT
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L28:
	lea	rsi, .LC0[rip]
	mov	edi, r12d
	call	device_printf@PLT
	mov	r13d, DWORD PTR ENXIO[rip]
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L31:
	mov	edx, eax
	lea	rsi, .LC3[rip]
	mov	edi, r12d
	xor	eax, eax
	call	device_printf@PLT
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L29:
	lea	rsi, .LC1[rip]
	mov	edi, r12d
	call	device_printf@PLT
	mov	r13d, DWORD PTR ENXIO[rip]
	jmp	.L3
.L33:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	tegra_rtc_attach, .-tegra_rtc_attach
	.comm	tegra_rtc_intr,4,4
	.comm	SYS_RES_MEMORY,4,4
	.comm	SYS_RES_IRQ,4,4
	.comm	RTC_SECONDS_ALARM1,4,4
	.comm	RTC_SECONDS_ALARM0,4,4
	.comm	RTC_INTR_STATUS,4,4
	.comm	RTC_INTR_MASK,4,4
	.comm	RF_ACTIVE,4,4
	.comm	INTR_TYPE_MISC,4,4
	.comm	INTR_MPSAFE,4,4
	.comm	ENXIO,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_tegra_rtc.c_tegra_rtc_attach.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"Cannot map registers.\012\000"
	.align	2
.LC1:
	.ascii	"Cannot allocate interrupt.\012\000"
	.align	2
.LC2:
	.ascii	"Cannot get i2c clock: %d\012\000"
	.align	2
.LC3:
	.ascii	"Cannot enable clock: %d\012\000"
	.align	2
.LC4:
	.ascii	"Cannot setup interrupt.\012\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC5:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	tegra_rtc_attach, %function
tegra_rtc_attach:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	ldr	r3, .L34
	sub	sp, sp, #24
	ldr	r3, [r3]
	str	r3, [sp, #20]
	mov	r3,#0
	mov	r5, r0
	bl	device_get_softc
	mov	r6, #0
	ldr	r8, .L34+4
	ldr	r7, .L34+8
	str	r5, [r0, #16]
	mov	r4, r0
	bl	LOCK_INIT
	mov	r0, r5
	ldr	r3, [r8]
	ldr	r1, [r7]
	add	r2, sp, #16
	str	r6, [sp, #16]
	bl	bus_alloc_resource_any
	cmp	r0, r6
	str	r0, [r4]
	beq	.L28
	ldr	r1, .L34+12
	mov	r0, r5
	ldr	r3, [r8]
	ldr	r1, [r1]
	add	r2, sp, #16
	str	r6, [sp, #16]
	bl	bus_alloc_resource_any
	cmp	r0, #0
	str	r0, [r4, #4]
	beq	.L29
	mov	r2, r6
	mov	r1, r6
	mov	r0, r5
	add	r3, r4, #12
	bl	clk_get_by_ofw_index
	subs	r6, r0, #0
	bne	.L30
	ldr	r0, [r4, #12]
	bl	clk_enable
	subs	r6, r0, #0
	bne	.L31
	ldr	r3, .L34+16
	mov	r2, r6
	ldr	r1, [r3]
	mov	r0, r4
	bl	WR4
	ldr	r3, .L34+20
	mov	r2, r6
	ldr	r1, [r3]
	mov	r0, r4
	bl	WR4
	ldr	r3, .L34+24
	mvn	r2, #0
	ldr	r1, [r3]
	mov	r0, r4
	bl	WR4
	ldr	r3, .L34+28
	mov	r2, r6
	ldr	r1, [r3]
	mov	r0, r4
	bl	WR4
	ldr	r1, .L34+32
	ldr	r2, .L34+36
	ldr	r3, .L34+40
	ldr	r0, [r1]
	ldr	r2, [r2]
	ldr	ip, [r3]
	orr	r2, r0, r2
	add	r0, r4, #8
	ldr	r1, [r4, #4]
	mov	r3, r6
	str	r0, [sp, #8]
	str	ip, [sp]
	mov	r0, r5
	str	r4, [sp, #4]
	bl	bus_setup_intr
	subs	r6, r0, #0
	bne	.L32
	mov	r0, r5
	bl	bus_generic_attach
	mov	r6, r0
	b	.L1
.L30:
	mov	r2, r6
	mov	r0, r5
	ldr	r1, .L34+44
	bl	device_printf
.L3:
	ldr	r0, [r4, #12]
	cmp	r0, #0
	beq	.L9
	bl	clk_release
.L9:
	ldr	r2, [r4, #8]
	ldr	r3, [r4, #4]
	cmp	r2, #0
	beq	.L10
	mov	r1, r3
	mov	r0, r5
	bl	bus_teardown_intr
	ldr	r3, [r4, #4]
.L10:
	cmp	r3, #0
	beq	.L11
	ldr	r2, .L34+12
	mov	r0, r5
	ldr	r1, [r2]
	mov	r2, #0
	bl	bus_release_resource
.L11:
	ldr	r3, [r4]
	cmp	r3, #0
	beq	.L12
	mov	r0, r5
	mov	r2, #0
	ldr	r1, [r7]
	bl	bus_release_resource
.L12:
	mov	r0, r4
	bl	LOCK_DESTROY
.L1:
	ldr	r3, .L34
	ldr	r2, [r3]
	ldr	r3, [sp, #20]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L33
	mov	r0, r6
	add	sp, sp, #24
	@ sp needed
	pop	{r4, r5, r6, r7, r8, pc}
.L32:
	mov	r0, r5
	ldr	r1, .L34+48
	bl	device_printf
	b	.L3
.L28:
	mov	r0, r5
	ldr	r1, .L34+52
	bl	device_printf
	ldr	r3, .L34+56
	ldr	r6, [r3]
	b	.L3
.L31:
	mov	r2, r6
	mov	r0, r5
	ldr	r1, .L34+60
	bl	device_printf
	b	.L3
.L29:
	mov	r0, r5
	ldr	r1, .L34+64
	bl	device_printf
	ldr	r3, .L34+56
	ldr	r6, [r3]
	b	.L3
.L33:
	bl	__stack_chk_fail
.L35:
	.align	2
.L34:
	.word	.LC5
	.word	RF_ACTIVE
	.word	SYS_RES_MEMORY
	.word	SYS_RES_IRQ
	.word	RTC_SECONDS_ALARM0
	.word	RTC_SECONDS_ALARM1
	.word	RTC_INTR_STATUS
	.word	RTC_INTR_MASK
	.word	INTR_TYPE_MISC
	.word	INTR_MPSAFE
	.word	tegra_rtc_intr
	.word	.LC2
	.word	.LC4
	.word	.LC0
	.word	ENXIO
	.word	.LC3
	.word	.LC1
	.size	tegra_rtc_attach, .-tegra_rtc_attach
	.comm	tegra_rtc_intr,4,4
	.comm	SYS_RES_MEMORY,4,4
	.comm	SYS_RES_IRQ,4,4
	.comm	RTC_SECONDS_ALARM1,4,4
	.comm	RTC_SECONDS_ALARM0,4,4
	.comm	RTC_INTR_STATUS,4,4
	.comm	RTC_INTR_MASK,4,4
	.comm	RF_ACTIVE,4,4
	.comm	INTR_TYPE_MISC,4,4
	.comm	INTR_MPSAFE,4,4
	.comm	ENXIO,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
