	.file	"extr_fs3270.c_fs3270_open.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	fs3270_open, @function
fs3270_open:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	push	rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	mov	rax, QWORD PTR 8[rsi]
	mov	rbx, rsi
	mov	edi, DWORD PTR [rax]
	call	imajor@PLT
	cmp	rax, QWORD PTR IBM_FS3270_MAJOR[rip]
	je	.L2
.L18:
	mov	r12d, DWORD PTR ENODEV[rip]
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	neg	r12d
	mov	eax, r12d
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L2:
	.cfi_restore_state
	mov	rax, QWORD PTR 8[rbx]
	mov	edi, DWORD PTR [rax]
	call	iminor@PLT
	mov	r12d, eax
	test	eax, eax
	jne	.L4
	xor	eax, eax
	call	get_current_tty@PLT
	mov	rdi, rax
	test	rax, rax
	je	.L5
	mov	rax, QWORD PTR 8[rax]
	mov	rcx, QWORD PTR IBM_TTY3270_MAJOR[rip]
	cmp	QWORD PTR [rax], rcx
	je	.L6
.L5:
	call	tty_kref_put@PLT
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L6:
	mov	r12d, DWORD PTR RAW3270_FIRSTMINOR[rip]
	add	r12d, DWORD PTR [rdi]
	call	tty_kref_put@PLT
.L4:
	xor	eax, eax
	call	lock_kernel@PLT
	lea	rdi, fs3270_fn[rip]
	mov	esi, r12d
	call	raw3270_find_view@PLT
	mov	rdi, rax
	mov	rbp, rax
	call	IS_ERR@PLT
	test	rax, rax
	je	.L20
	xor	eax, eax
	call	fs3270_alloc_view@PLT
	mov	rdi, rax
	mov	rbp, rax
	call	IS_ERR@PLT
	test	rax, rax
	jne	.L17
	lea	rdi, 20[rbp]
	call	init_waitqueue_head@PLT
	mov	edi, DWORD PTR current[rip]
	call	task_pid@PLT
	mov	edi, eax
	call	get_pid@PLT
	mov	edx, r12d
	lea	rsi, fs3270_fn[rip]
	mov	rdi, rbp
	mov	DWORD PTR 16[rbp], eax
	call	raw3270_add_view@PLT
	mov	r12d, eax
	test	eax, eax
	jne	.L21
	mov	eax, DWORD PTR 0[rbp]
	imul	eax, DWORD PTR 4[rbp]
	xor	esi, esi
	lea	edi, 5[rax+rax]
	call	idal_buffer_alloc@PLT
	mov	rdi, rax
	mov	r12, rax
	call	IS_ERR@PLT
	test	rax, rax
	jne	.L22
	mov	QWORD PTR 8[rbp], r12
	mov	rdi, rbp
	call	raw3270_activate_view@PLT
	mov	r12d, eax
	test	eax, eax
	jne	.L23
	mov	QWORD PTR [rbx], rbp
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L20:
	mov	rdi, rbp
	call	raw3270_put_view@PLT
	mov	r12d, DWORD PTR EBUSY[rip]
	neg	r12d
.L8:
	xor	eax, eax
	call	unlock_kernel@PLT
	mov	eax, r12d
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L22:
	.cfi_restore_state
	mov	rdi, rbp
	call	raw3270_put_view@PLT
	mov	rdi, rbp
	call	raw3270_del_view@PLT
.L17:
	mov	rdi, rbp
	call	PTR_ERR@PLT
	mov	r12d, eax
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L21:
	mov	rdi, rbp
	call	fs3270_free_view@PLT
	jmp	.L8
.L23:
	mov	rdi, rbp
	call	raw3270_put_view@PLT
	mov	rdi, rbp
	call	raw3270_del_view@PLT
	jmp	.L8
	.cfi_endproc
.LFE0:
	.size	fs3270_open, .-fs3270_open
	.comm	fs3270_fn,4,4
	.comm	current,4,4
	.comm	RAW3270_FIRSTMINOR,4,4
	.comm	IBM_TTY3270_MAJOR,8,8
	.comm	IBM_FS3270_MAJOR,8,8
	.comm	ENODEV,4,4
	.comm	EBUSY,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_fs3270.c_fs3270_open.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	fs3270_open, %function
fs3270_open:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	ldr	r3, [r1, #4]
	push	{r4, r5, r6, lr}
	ldr	r0, [r3]
	mov	r5, r1
	bl	imajor
	ldr	r3, .L23
	ldr	r3, [r3]
	cmp	r0, r3
	beq	.L2
.L18:
	ldr	r3, .L23+4
	ldr	r0, [r3]
	rsb	r4, r0, #0
	mov	r0, r4
	pop	{r4, r5, r6, pc}
.L2:
	ldr	r3, [r5, #4]
	ldr	r0, [r3]
	bl	iminor
	subs	r4, r0, #0
	bne	.L4
	bl	get_current_tty
	subs	r3, r0, #0
	beq	.L5
	ldr	r1, [r3, #4]
	ldr	r2, .L23+8
	ldr	r1, [r1]
	ldr	r2, [r2]
	cmp	r1, r2
	beq	.L6
.L5:
	mov	r0, r3
	bl	tty_kref_put
	b	.L18
.L6:
	ldr	r2, .L23+12
	ldr	r4, [r3]
	ldr	r3, [r2]
	add	r4, r4, r3
	bl	tty_kref_put
.L4:
	bl	lock_kernel
	mov	r1, r4
	ldr	r0, .L23+16
	bl	raw3270_find_view
	mov	r6, r0
	bl	IS_ERR
	cmp	r0, #0
	beq	.L20
	bl	fs3270_alloc_view
	mov	r6, r0
	bl	IS_ERR
	cmp	r0, #0
	bne	.L17
	add	r0, r6, #16
	bl	init_waitqueue_head
	ldr	r3, .L23+20
	ldr	r0, [r3]
	bl	task_pid
	bl	get_pid
	mov	r2, r4
	str	r0, [r6, #12]
	ldr	r1, .L23+16
	mov	r0, r6
	bl	raw3270_add_view
	subs	r4, r0, #0
	bne	.L21
	ldr	r0, [r6, #4]
	ldr	r3, [r6]
	mov	r1, r4
	mul	r3, r0, r3
	lsl	r0, r3, #1
	add	r0, r0, #5
	bl	idal_buffer_alloc
	mov	r4, r0
	bl	IS_ERR
	cmp	r0, #0
	bne	.L22
	str	r4, [r6, #8]
	mov	r0, r6
	bl	raw3270_activate_view
	subs	r4, r0, #0
	streq	r6, [r5]
	beq	.L8
	mov	r0, r6
	bl	raw3270_put_view
	mov	r0, r6
	bl	raw3270_del_view
	b	.L8
.L20:
	mov	r0, r6
	bl	raw3270_put_view
	ldr	r3, .L23+24
	ldr	r0, [r3]
	rsb	r4, r0, #0
.L8:
	bl	unlock_kernel
	mov	r0, r4
	pop	{r4, r5, r6, pc}
.L22:
	mov	r0, r6
	bl	raw3270_put_view
	mov	r0, r6
	bl	raw3270_del_view
.L17:
	mov	r0, r6
	bl	PTR_ERR
	mov	r4, r0
	b	.L8
.L21:
	mov	r0, r6
	bl	fs3270_free_view
	b	.L8
.L24:
	.align	2
.L23:
	.word	IBM_FS3270_MAJOR
	.word	ENODEV
	.word	IBM_TTY3270_MAJOR
	.word	RAW3270_FIRSTMINOR
	.word	fs3270_fn
	.word	current
	.word	EBUSY
	.size	fs3270_open, .-fs3270_open
	.comm	fs3270_fn,4,4
	.comm	current,4,4
	.comm	RAW3270_FIRSTMINOR,4,4
	.comm	IBM_TTY3270_MAJOR,4,4
	.comm	IBM_FS3270_MAJOR,4,4
	.comm	ENODEV,4,4
	.comm	EBUSY,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
