	.file	"extr_amplc_pci230.c_pci230_ct_setup_ns_mode.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	pci230_ct_setup_ns_mode, @function
pci230_ct_setup_ns_mode:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	mov	r13d, r8d
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	mov	r12d, esi
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	mov	ebp, ecx
	mov	ecx, edx
	mov	edx, esi
	xor	esi, esi
	sub	rsp, 16
	.cfi_def_cfa_offset 48
	mov	rdi, QWORD PTR PCI230_Z2_CT_BASE[rip]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 8[rsp], rax
	xor	eax, eax
	mov	rax, QWORD PTR devpriv[rip]
	add	rdi, QWORD PTR [rax]
	call	i8254_set_mode@PLT
	mov	edx, r13d
	mov	edi, ebp
	lea	rsi, 4[rsp]
	call	pci230_choose_clk_count@PLT
	mov	edi, r12d
	mov	rbp, QWORD PTR PCI230_ZCLK_SCE[rip]
	mov	esi, eax
	mov	rax, QWORD PTR devpriv[rip]
	add	rbp, QWORD PTR [rax]
	call	CLK_CONFIG@PLT
	mov	rsi, rbp
	mov	edi, eax
	call	outb@PLT
	mov	ecx, DWORD PTR 4[rsp]
	cmp	ecx, 65535
	jbe	.L2
	mov	DWORD PTR 4[rsp], 0
	xor	ecx, ecx
.L2:
	mov	rax, QWORD PTR devpriv[rip]
	mov	rdi, QWORD PTR PCI230_Z2_CT_BASE[rip]
	xor	esi, esi
	mov	edx, r12d
	add	rdi, QWORD PTR [rax]
	call	i8254_write@PLT
	mov	rax, QWORD PTR 8[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L6
	add	rsp, 16
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
.L6:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	pci230_ct_setup_ns_mode, .-pci230_ct_setup_ns_mode
	.comm	devpriv,8,8
	.comm	PCI230_ZCLK_SCE,8,8
	.comm	PCI230_Z2_CT_BASE,8,8
	.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_amplc_pci230.c_pci230_ct_setup_ns_mode.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	pci230_ct_setup_ns_mode, %function
pci230_ct_setup_ns_mode:
	@ args = 4, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, lr}
	mov	r4, r1
	mov	r6, r3
	ldr	r5, .L7
	mov	r3, r2
	ldr	r7, .L7+4
	ldr	r2, [r5]
	ldr	r1, [r7]
	ldr	r0, [r2]
	ldr	ip, .L7+8
	sub	sp, sp, #12
	mov	r2, r4
	add	r0, r0, r1
	mov	r1, #0
	ldr	ip, [ip]
	str	ip, [sp, #4]
	mov	ip,#0
	bl	i8254_set_mode
	ldr	r2, [sp, #32]
	mov	r1, sp
	mov	r0, r6
	bl	pci230_choose_clk_count
	mov	r1, r0
	mov	r0, r4
	bl	CLK_CONFIG
	ldr	r2, [r5]
	ldr	r3, .L7+12
	ldr	r1, [r2]
	ldr	r3, [r3]
	add	r1, r1, r3
	bl	outb
	ldr	r3, [sp]
	ldr	r1, [r5]
	cmp	r3, #65536
	movcs	r2, #0
	ldr	r0, [r1]
	movcs	r3, r2
	strcs	r2, [sp]
	ldr	r2, [r7]
	mov	r1, #0
	add	r0, r0, r2
	mov	r2, r4
	bl	i8254_write
	ldr	r3, .L7+8
	ldr	r2, [r3]
	ldr	r3, [sp, #4]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L6
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, pc}
.L6:
	bl	__stack_chk_fail
.L8:
	.align	2
.L7:
	.word	devpriv
	.word	PCI230_Z2_CT_BASE
	.word	.LC0
	.word	PCI230_ZCLK_SCE
	.size	pci230_ct_setup_ns_mode, .-pci230_ct_setup_ns_mode
	.comm	devpriv,4,4
	.comm	PCI230_ZCLK_SCE,4,4
	.comm	PCI230_Z2_CT_BASE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
