	.file	"extr_agtiapi.c_agtiapi_CharIoctl.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"agtiapi_CharIoctl: old load->datasize = %d\n"
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"sem"
	.section	.rodata.str1.8
	.align 8
.LC2:
	.string	"agtiapi_CharIoctl: new load->datasize = %d\n"
	.section	.rodata.str1.1
.LC3:
	.string	"DPMC LEAN\n"
.LC4:
	.string	"do not dpmc lean\n"
	.section	.rodata.str1.8
	.align 8
.LC5:
	.string	"agtiapi_CharIoctl: IOCTL_MJ_CHECK_FATAL_ERROR call received for card %d\n"
	.align 8
.LC6:
	.string	"agtiapi_CharIoctl: Port Panic Status For Card %d is True\n"
	.align 8
.LC7:
	.string	"agtiapi_CharIoctl: Port Panic Status For Card %d is False\n"
	.align 8
.LC8:
	.string	"agtiapi_CharIoctl: IOCTL_MJ_FATAL_ERROR_DUMP_COMPLETE call received for card %d\n"
	.text
	.p2align 4
	.type	agtiapi_CharIoctl, @function
agtiapi_CharIoctl:
.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
	xor	r12d, r12d
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	sub	rsp, 32
	.cfi_def_cfa_offset 80
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 24[rsp], rax
	xor	eax, eax
	cmp	esi, 128
	je	.L25
.L1:
	mov	rax, QWORD PTR 24[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L26
	add	rsp, 32
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	mov	eax, r12d
	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
.L25:
	.cfi_restore_state
	mov	rbx, rdx
	mov	r13, QWORD PTR [rdi]
	mov	edx, DWORD PTR M_WAITOK[rip]
	mov	esi, DWORD PTR TEMP[rip]
	mov	edi, DWORD PTR [rbx]
	call	malloc@PLT
	mov	esi, DWORD PTR [rbx]
	lea	rdi, .LC0[rip]
	mov	rbp, rax
	call	AGTIAPI_PRINTK@PLT
	mov	edi, DWORD PTR 4[rbx]
	mov	edx, DWORD PTR [rbx]
	mov	rsi, rbp
	call	copyin@PLT
	test	eax, eax
	je	.L3
.L23:
	mov	r12d, DWORD PTR IOCTL_CALL_FAIL[rip]
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L3:
	lea	r12, 12[rsp]
	xor	esi, esi
	lea	rdx, .LC1[rip]
	mov	rdi, r12
	call	sema_init@PLT
	mov	QWORD PTR 20[r13], 0
	mov	eax, DWORD PTR 8[rbp]
	cmp	eax, DWORD PTR IOCTL_MJ_GET_DEVICE_LIST[rip]
	mov	QWORD PTR 8[r13], r12
	je	.L27
	cmp	eax, DWORD PTR IOCTL_MN_GET_CARD_INFO[rip]
	je	.L28
	cmp	eax, DWORD PTR IOCTL_MJ_CHECK_DPMC_EVENT[rip]
	je	.L29
	cmp	eax, DWORD PTR IOCTL_MJ_CHECK_FATAL_ERROR[rip]
	je	.L30
	cmp	eax, DWORD PTR IOCTL_MJ_FATAL_ERROR_DUMP_COMPLETE[rip]
	je	.L31
	lea	r14, 16[r13]
	xor	r8d, r8d
	xor	ecx, ecx
	mov	rdx, r13
	mov	rsi, rbp
	mov	rdi, r14
	call	tiCOMMgntIOCTL@PLT
	cmp	DWORD PTR IOCTL_CALL_PENDING[rip], eax
	mov	r12d, eax
	je	.L32
	.p2align 4,,10
	.p2align 3
.L7:
	mov	esi, DWORD PTR 4[rbx]
	mov	edx, DWORD PTR [rbx]
	mov	QWORD PTR 8[r13], 0
	mov	rdi, rbp
	call	copyout@PLT
	test	eax, eax
	jne	.L23
	mov	esi, DWORD PTR TEMP[rip]
	mov	rdi, rbp
	call	free@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L29:
	mov	rdi, QWORD PTR 16[rbp]
	mov	eax, DWORD PTR 0[r13]
	test	DWORD PTR AGTIAPI_PORT_PANIC[rip], eax
	je	.L11
	lea	rsi, .LC3[rip]
	call	strcpy@PLT
.L12:
	mov	r12, QWORD PTR IOCTL_CALL_SUCCESS[rip]
	mov	QWORD PTR 0[rbp], r12
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L27:
	mov	rsi, rbp
	mov	rdi, r13
	call	agtiapi_getdevlist@PLT
	test	eax, eax
	jne	.L5
	mov	rax, QWORD PTR IOCTL_CALL_SUCCESS[rip]
	mov	r12d, eax
.L6:
	mov	rdx, QWORD PTR 16[rbp]
	mov	esi, DWORD PTR [rbx]
	mov	QWORD PTR 0[rbp], rax
	lea	rdi, .LC2[rip]
	mov	eax, DWORD PTR [rdx]
	sub	eax, DWORD PTR 4[rdx]
	sal	eax, 2
	sub	esi, eax
	mov	DWORD PTR [rbx], esi
	call	AGTIAPI_PRINTK@PLT
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L28:
	mov	rdx, QWORD PTR 16[rbp]
	mov	esi, DWORD PTR 24[rbp]
	mov	rdi, r13
	call	agtiapi_getCardInfo@PLT
	test	eax, eax
	je	.L12
.L17:
	mov	r12, QWORD PTR IOCTL_CALL_FAIL[rip]
	mov	QWORD PTR 0[rbp], r12
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L31:
	mov	esi, DWORD PTR 4[r13]
	lea	rdi, .LC8[rip]
	call	AGTIAPI_PRINTK@PLT
	mov	eax, DWORD PTR AGTIAPI_SOFT_RESET[rip]
	or	DWORD PTR 0[r13], eax
	mov	rdi, r13
	lea	rsi, 16[rsp]
	call	agtiapi_ResetCard@PLT
	cmp	DWORD PTR AGTIAPI_SUCCESS[rip], eax
	jne	.L17
	mov	eax, DWORD PTR AGTIAPI_PORT_PANIC[rip]
	mov	r12d, DWORD PTR IOCTL_CALL_SUCCESS[rip]
	not	eax
	and	DWORD PTR 0[r13], eax
	mov	rax, QWORD PTR IOCTL_MJ_FATAL_ERROR_SOFT_RESET_TRIG[rip]
	mov	QWORD PTR 0[rbp], rax
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L11:
	lea	rsi, .LC4[rip]
	call	strcpy@PLT
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L5:
	mov	rax, QWORD PTR IOCTL_CALL_FAIL[rip]
	mov	r12d, eax
	jmp	.L6
.L30:
	mov	esi, DWORD PTR 4[r13]
	lea	rdi, .LC5[rip]
	call	AGTIAPI_PRINTK@PLT
	mov	eax, DWORD PTR 0[r13]
	mov	esi, DWORD PTR 4[r13]
	test	DWORD PTR AGTIAPI_PORT_PANIC[rip], eax
	je	.L14
	lea	rdi, .LC6[rip]
	call	printf@PLT
	mov	rax, QWORD PTR IOCTL_MJ_FATAL_ERR_CHK_SEND_TRUE[rip]
	mov	QWORD PTR 0[rbp], rax
.L22:
	mov	r12d, DWORD PTR IOCTL_CALL_SUCCESS[rip]
	jmp	.L7
.L32:
	xor	ecx, ecx
	xor	edx, edx
	xor	esi, esi
	mov	rdi, r14
	call	ostiIOCTLWaitForSignal@PLT
	jmp	.L22
.L14:
	lea	rdi, .LC7[rip]
	call	AGTIAPI_PRINTK@PLT
	mov	rax, QWORD PTR IOCTL_MJ_FATAL_ERR_CHK_SEND_FALSE[rip]
	mov	QWORD PTR 0[rbp], rax
	jmp	.L22
.L26:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	agtiapi_CharIoctl, .-agtiapi_CharIoctl
	.comm	TEMP,4,4
	.comm	M_WAITOK,4,4
	.comm	IOCTL_MN_GET_CARD_INFO,4,4
	.comm	IOCTL_MJ_GET_DEVICE_LIST,4,4
	.comm	IOCTL_MJ_FATAL_ERR_CHK_SEND_TRUE,8,8
	.comm	IOCTL_MJ_FATAL_ERR_CHK_SEND_FALSE,8,8
	.comm	IOCTL_MJ_FATAL_ERROR_SOFT_RESET_TRIG,8,8
	.comm	IOCTL_MJ_FATAL_ERROR_DUMP_COMPLETE,4,4
	.comm	IOCTL_MJ_CHECK_FATAL_ERROR,4,4
	.comm	IOCTL_MJ_CHECK_DPMC_EVENT,4,4
	.comm	IOCTL_CALL_SUCCESS,8,8
	.comm	IOCTL_CALL_PENDING,4,4
	.comm	IOCTL_CALL_FAIL,8,8
	.comm	ENOTTY,4,4
	.comm	AGTIAPI_SUCCESS,4,4
	.comm	AGTIAPI_SOFT_RESET,4,4
	.comm	AGTIAPI_PORT_PANIC,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_agtiapi.c_agtiapi_CharIoctl.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"agtiapi_CharIoctl: old load->datasize = %d\012\000"
	.align	2
.LC1:
	.ascii	"sem\000"
	.align	2
.LC2:
	.ascii	"agtiapi_CharIoctl: new load->datasize = %d\012\000"
	.align	2
.LC3:
	.ascii	"DPMC LEAN\012\000"
	.align	2
.LC4:
	.ascii	"do not dpmc lean\012\000"
	.align	2
.LC5:
	.ascii	"agtiapi_CharIoctl: IOCTL_MJ_CHECK_FATAL_ERROR call "
	.ascii	"received for card %d\012\000"
	.align	2
.LC6:
	.ascii	"agtiapi_CharIoctl: Port Panic Status For Card %d is"
	.ascii	" True\012\000"
	.align	2
.LC7:
	.ascii	"agtiapi_CharIoctl: Port Panic Status For Card %d is"
	.ascii	" False\012\000"
	.align	2
.LC8:
	.ascii	"agtiapi_CharIoctl: IOCTL_MJ_FATAL_ERROR_DUMP_COMPLE"
	.ascii	"TE call received for card %d\012\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC9:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	agtiapi_CharIoctl, %function
agtiapi_CharIoctl:
	@ args = 4, pretend = 0, frame = 16
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	mov	r4, r2
	ldr	r2, .L33
	sub	sp, sp, #24
	cmp	r1, #128
	ldr	r2, [r2]
	str	r2, [sp, #20]
	mov	r2,#0
	movne	r5, #0
	beq	.L25
.L1:
	ldr	r3, .L33
	ldr	r2, [r3]
	ldr	r3, [sp, #20]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L26
	mov	r0, r5
	add	sp, sp, #24
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L25:
	mov	r3, r0
	ldr	r2, .L33+4
	ldr	r9, .L33+8
	ldr	r2, [r2]
	ldr	r1, [r9]
	ldr	r0, [r4]
	ldr	r8, [r3]
	bl	malloc
	mov	r6, r0
	ldr	r1, [r4]
	ldr	r0, .L33+12
	bl	AGTIAPI_PRINTK
	mov	r1, r6
	ldr	r2, [r4]
	ldr	r0, [r4, #4]
	bl	copyin
	subs	r7, r0, #0
	beq	.L3
.L23:
	ldr	r3, .L33+16
	ldr	r5, [r3]
	b	.L1
.L3:
	add	r5, sp, #12
	ldr	r2, .L33+20
	mov	r0, r5
	mov	r1, r7
	bl	sema_init
	ldr	r2, .L33+24
	ldr	r3, [r6, #4]
	ldr	r2, [r2]
	str	r5, [r8, #8]
	cmp	r3, r2
	str	r7, [r8, #16]
	str	r7, [r8, #20]
	beq	.L27
	ldr	r2, .L33+28
	ldr	r2, [r2]
	cmp	r3, r2
	beq	.L28
	ldr	r2, .L33+32
	ldr	r2, [r2]
	cmp	r3, r2
	beq	.L29
	ldr	r2, .L33+36
	ldr	r2, [r2]
	cmp	r3, r2
	beq	.L30
	ldr	r2, .L33+40
	ldr	r2, [r2]
	cmp	r3, r2
	beq	.L31
	add	r10, r8, #12
	mov	r3, r7
	mov	r0, r10
	mov	r2, r8
	mov	r1, r6
	str	r7, [sp]
	bl	tiCOMMgntIOCTL
	ldr	r3, .L33+44
	mov	r5, r0
	ldr	r3, [r3]
	cmp	r3, r0
	beq	.L32
.L7:
	mov	r3, #0
	mov	r0, r6
	ldr	r2, [r4]
	ldr	r1, [r4, #4]
	str	r3, [r8, #8]
	bl	copyout
	cmp	r0, #0
	bne	.L23
	mov	r0, r6
	ldr	r1, [r9]
	bl	free
	b	.L1
.L29:
	ldr	r3, .L33+48
	ldr	r2, [r8]
	ldr	r3, [r3]
	ldr	r0, [r6, #8]
	tst	r2, r3
	ldrne	r1, .L33+52
	ldreq	r1, .L33+56
	bl	strcpy
.L12:
	ldr	r3, .L33+60
	ldr	r5, [r3]
	str	r5, [r6]
	b	.L7
.L27:
	mov	r1, r6
	mov	r0, r8
	bl	agtiapi_getdevlist
	cmp	r0, #0
	ldreq	r3, .L33+60
	ldr	r0, [r6, #8]
	ldrne	r3, .L33+16
	ldr	r1, [r4]
	ldr	r2, [r3]
	ldr	r3, [r0]
	ldr	r0, [r0, #4]
	str	r2, [r6]
	sub	r3, r3, r0
	sub	r1, r1, r3, lsl #2
	str	r1, [r4]
	ldr	r0, .L33+64
	mov	r5, r2
	bl	AGTIAPI_PRINTK
	b	.L7
.L28:
	mov	r0, r8
	ldr	r2, [r6, #8]
	ldr	r1, [r6, #12]
	bl	agtiapi_getCardInfo
	cmp	r0, #0
	beq	.L12
.L17:
	ldr	r3, .L33+16
	ldr	r5, [r3]
	str	r5, [r6]
	b	.L7
.L31:
	ldr	r1, [r8, #4]
	ldr	r0, .L33+68
	bl	AGTIAPI_PRINTK
	ldr	r2, .L33+72
	ldr	r3, [r8]
	ldr	r2, [r2]
	mov	r0, r8
	orr	r3, r3, r2
	str	r3, [r8]
	add	r1, sp, #16
	bl	agtiapi_ResetCard
	ldr	r3, .L33+76
	ldr	r3, [r3]
	cmp	r3, r0
	bne	.L17
	ldr	r3, .L33+48
	ldr	r2, .L33+80
	ldr	r1, [r3]
	ldr	r3, [r8]
	ldr	r2, [r2]
	bic	r3, r3, r1
	ldr	r1, .L33+60
	str	r3, [r8]
	ldr	r5, [r1]
	str	r2, [r6]
	b	.L7
.L30:
	ldr	r1, [r8, #4]
	ldr	r0, .L33+84
	bl	AGTIAPI_PRINTK
	ldr	r3, .L33+48
	ldr	r2, [r8]
	ldr	r3, [r3]
	ldr	r1, [r8, #4]
	tst	r2, r3
	beq	.L14
	ldr	r0, .L33+88
	bl	printf
	ldr	r3, .L33+92
	ldr	r3, [r3]
	str	r3, [r6]
.L22:
	ldr	r3, .L33+60
	ldr	r5, [r3]
	b	.L7
.L32:
	mov	r0, r10
	mov	r3, r7
	mov	r2, r7
	mov	r1, r7
	bl	ostiIOCTLWaitForSignal
	b	.L22
.L14:
	ldr	r0, .L33+96
	bl	AGTIAPI_PRINTK
	ldr	r3, .L33+100
	ldr	r3, [r3]
	str	r3, [r6]
	b	.L22
.L26:
	bl	__stack_chk_fail
.L34:
	.align	2
.L33:
	.word	.LC9
	.word	M_WAITOK
	.word	TEMP
	.word	.LC0
	.word	IOCTL_CALL_FAIL
	.word	.LC1
	.word	IOCTL_MJ_GET_DEVICE_LIST
	.word	IOCTL_MN_GET_CARD_INFO
	.word	IOCTL_MJ_CHECK_DPMC_EVENT
	.word	IOCTL_MJ_CHECK_FATAL_ERROR
	.word	IOCTL_MJ_FATAL_ERROR_DUMP_COMPLETE
	.word	IOCTL_CALL_PENDING
	.word	AGTIAPI_PORT_PANIC
	.word	.LC3
	.word	.LC4
	.word	IOCTL_CALL_SUCCESS
	.word	.LC2
	.word	.LC8
	.word	AGTIAPI_SOFT_RESET
	.word	AGTIAPI_SUCCESS
	.word	IOCTL_MJ_FATAL_ERROR_SOFT_RESET_TRIG
	.word	.LC5
	.word	.LC6
	.word	IOCTL_MJ_FATAL_ERR_CHK_SEND_TRUE
	.word	.LC7
	.word	IOCTL_MJ_FATAL_ERR_CHK_SEND_FALSE
	.size	agtiapi_CharIoctl, .-agtiapi_CharIoctl
	.comm	TEMP,4,4
	.comm	M_WAITOK,4,4
	.comm	IOCTL_MN_GET_CARD_INFO,4,4
	.comm	IOCTL_MJ_GET_DEVICE_LIST,4,4
	.comm	IOCTL_MJ_FATAL_ERR_CHK_SEND_TRUE,4,4
	.comm	IOCTL_MJ_FATAL_ERR_CHK_SEND_FALSE,4,4
	.comm	IOCTL_MJ_FATAL_ERROR_SOFT_RESET_TRIG,4,4
	.comm	IOCTL_MJ_FATAL_ERROR_DUMP_COMPLETE,4,4
	.comm	IOCTL_MJ_CHECK_FATAL_ERROR,4,4
	.comm	IOCTL_MJ_CHECK_DPMC_EVENT,4,4
	.comm	IOCTL_CALL_SUCCESS,4,4
	.comm	IOCTL_CALL_PENDING,4,4
	.comm	IOCTL_CALL_FAIL,4,4
	.comm	ENOTTY,4,4
	.comm	AGTIAPI_SUCCESS,4,4
	.comm	AGTIAPI_SOFT_RESET,4,4
	.comm	AGTIAPI_PORT_PANIC,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
