	.file	"extr_tdi.c_TdiOpenDevice.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	TdiOpenDevice, @function
TdiOpenDevice:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	xor	r15d, r15d
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	mov	r14, rcx
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13, rsi
	mov	rsi, rcx
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	mov	r12d, edx
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	rbp, r9
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	rbx, r8
	sub	rsp, 40
	.cfi_def_cfa_offset 96
	mov	DWORD PTR 12[rsp], edi
	mov	edi, DWORD PTR MAX_TRACE[rip]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 24[rsp], rax
	xor	eax, eax
	call	AFD_DbgPrint@PLT
	cmp	QWORD PTR AFD_SHARE_REUSE[rip], r14
	mov	r10d, DWORD PTR 12[rsp]
	jne	.L2
	mov	r15, QWORD PTR FILE_SHARE_READ[rip]
	or	r15, QWORD PTR FILE_SHARE_WRITE[rip]
.L2:
	lea	r14, 16[rsp]
	xor	r8d, r8d
	xor	ecx, ecx
	mov	esi, r10d
	mov	edx, DWORD PTR OBJ_CASE_INSENSITIVE[rip]
	mov	rdi, r14
	or	edx, DWORD PTR OBJ_KERNEL_HANDLE[rip]
	call	InitializeObjectAttributes@PLT
	lea	rcx, 20[rsp]
	xor	r8d, r8d
	mov	rdi, rbx
	mov	eax, DWORD PTR FILE_OPEN_IF[rip]
	sub	rsp, 8
	.cfi_def_cfa_offset 104
	mov	r9d, DWORD PTR FILE_ATTRIBUTE_NORMAL[rip]
	mov	rdx, r14
	push	r13
	.cfi_def_cfa_offset 112
	mov	esi, DWORD PTR GENERIC_READ[rip]
	push	r12
	.cfi_def_cfa_offset 120
	or	esi, DWORD PTR GENERIC_WRITE[rip]
	push	0
	.cfi_def_cfa_offset 128
	or	esi, DWORD PTR SYNCHRONIZE[rip]
	push	rax
	.cfi_def_cfa_offset 136
	push	r15
	.cfi_def_cfa_offset 144
	call	ZwCreateFile@PLT
	add	rsp, 48
	.cfi_def_cfa_offset 96
	mov	edi, eax
	mov	r12d, eax
	call	NT_SUCCESS@PLT
	test	rax, rax
	je	.L3
	mov	rax, QWORD PTR IoFileObjectType[rip]
	mov	edi, DWORD PTR [rbx]
	xor	r9d, r9d
	mov	r8, rbp
	mov	ecx, DWORD PTR KernelMode[rip]
	mov	esi, DWORD PTR GENERIC_READ[rip]
	mov	edx, DWORD PTR [rax]
	or	esi, DWORD PTR GENERIC_WRITE[rip]
	or	esi, DWORD PTR SYNCHRONIZE[rip]
	call	ObReferenceObjectByHandle@PLT
	mov	edi, eax
	mov	r12d, eax
	call	NT_SUCCESS@PLT
	test	rax, rax
	jne	.L4
	mov	edi, DWORD PTR MIN_TRACE[rip]
	movsx	rsi, r12d
	call	AFD_DbgPrint@PLT
	mov	edi, DWORD PTR [rbx]
	call	ZwClose@PLT
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L3:
	mov	edi, DWORD PTR MIN_TRACE[rip]
	movsx	rsi, r12d
	call	AFD_DbgPrint@PLT
.L5:
	mov	edi, r12d
	call	NT_SUCCESS@PLT
	test	rax, rax
	jne	.L1
	mov	eax, DWORD PTR INVALID_HANDLE_VALUE[rip]
	mov	DWORD PTR [rbx], eax
	mov	QWORD PTR 0[rbp], 0
.L1:
	mov	rax, QWORD PTR 24[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L12
	add	rsp, 40
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, r12d
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L4:
	.cfi_restore_state
	mov	rsi, QWORD PTR 0[rbp]
	mov	edi, DWORD PTR MAX_TRACE[rip]
	call	AFD_DbgPrint@PLT
	jmp	.L5
.L12:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	TdiOpenDevice, .-TdiOpenDevice
	.comm	SYNCHRONIZE,4,4
	.comm	OBJ_KERNEL_HANDLE,4,4
	.comm	OBJ_CASE_INSENSITIVE,4,4
	.comm	MIN_TRACE,4,4
	.comm	MAX_TRACE,4,4
	.comm	KernelMode,4,4
	.comm	IoFileObjectType,8,8
	.comm	INVALID_HANDLE_VALUE,4,4
	.comm	GENERIC_WRITE,4,4
	.comm	GENERIC_READ,4,4
	.comm	FILE_SHARE_WRITE,8,8
	.comm	FILE_SHARE_READ,8,8
	.comm	FILE_OPEN_IF,4,4
	.comm	FILE_ATTRIBUTE_NORMAL,4,4
	.comm	AFD_SHARE_REUSE,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_tdi.c_TdiOpenDevice.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	TdiOpenDevice, %function
TdiOpenDevice:
	@ args = 8, pretend = 0, frame = 24
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r4, r3
	ldr	fp, .L12
	sub	sp, sp, #60
	mov	r5, r1
	mov	r1, r3
	ldr	r3, .L12+4
	str	r2, [sp, #36]
	mov	r7, r0
	ldr	r0, [fp]
	ldr	r3, [r3]
	str	r3, [sp, #52]
	mov	r3,#0
	ldr	r6, [sp, #96]
	ldr	r10, [sp, #100]
	bl	AFD_DbgPrint
	ldr	r3, .L12+8
	mov	r1, r7
	ldr	r3, [r3]
	add	r0, sp, #44
	cmp	r3, r4
	movne	r3, #0
	mov	r4, #0
	ldreq	r3, .L12+12
	ldreq	r2, .L12+16
	ldreq	r3, [r3]
	ldreq	r2, [r2]
	ldr	r9, .L12+20
	orreq	r3, r2, r3
	str	r3, [sp, #32]
	ldr	r2, .L12+24
	ldr	r3, .L12+28
	ldr	r2, [r2]
	ldr	r3, [r3]
	str	r4, [sp]
	orr	r2, r2, r3
	mov	r3, r4
	bl	InitializeObjectAttributes
	ldr	r8, .L12+32
	ldr	r3, .L12+36
	ldr	lr, [sp, #36]
	ldr	r2, .L12+40
	ldr	r0, [r3]
	ldr	r1, [r8]
	ldr	r3, [r9]
	ldr	r7, .L12+44
	ldr	ip, [r2]
	str	r5, [sp, #24]
	str	lr, [sp, #20]
	str	r4, [sp, #16]
	str	r4, [sp]
	ldr	lr, [sp, #32]
	orr	r3, r3, r1
	ldr	r1, [r7]
	add	r2, sp, #44
	orr	r1, r3, r1
	str	lr, [sp, #8]
	str	ip, [sp, #12]
	str	r0, [sp, #4]
	add	r3, sp, #48
	mov	r0, r6
	bl	ZwCreateFile
	mov	r5, r0
	bl	NT_SUCCESS
	cmp	r0, r4
	beq	.L3
	ldr	r2, .L12+48
	ldr	r0, [r8]
	ldr	r3, [r9]
	ldr	r2, [r2]
	ldr	r1, [r7]
	orr	r3, r3, r0
	ldr	r0, .L12+52
	ldr	r2, [r2]
	str	r4, [sp, #4]
	str	r10, [sp]
	orr	r1, r3, r1
	ldr	r3, [r0]
	ldr	r0, [r6]
	bl	ObReferenceObjectByHandle
	mov	r5, r0
	bl	NT_SUCCESS
	cmp	r0, r4
	bne	.L4
	ldr	r3, .L12+56
	mov	r1, r5
	ldr	r0, [r3]
	bl	AFD_DbgPrint
	ldr	r0, [r6]
	bl	ZwClose
	b	.L5
.L3:
	ldr	r3, .L12+56
	mov	r1, r5
	ldr	r0, [r3]
	bl	AFD_DbgPrint
.L5:
	mov	r0, r5
	bl	NT_SUCCESS
	cmp	r0, #0
	ldreq	r3, .L12+60
	ldreq	r3, [r3]
	streq	r3, [r6]
	ldr	r3, .L12+4
	streq	r0, [r10]
	ldr	r2, [r3]
	ldr	r3, [sp, #52]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L11
	mov	r0, r5
	add	sp, sp, #60
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L4:
	ldr	r0, [fp]
	ldr	r1, [r10]
	bl	AFD_DbgPrint
	b	.L5
.L11:
	bl	__stack_chk_fail
.L13:
	.align	2
.L12:
	.word	MAX_TRACE
	.word	.LC0
	.word	AFD_SHARE_REUSE
	.word	FILE_SHARE_WRITE
	.word	FILE_SHARE_READ
	.word	GENERIC_READ
	.word	OBJ_CASE_INSENSITIVE
	.word	OBJ_KERNEL_HANDLE
	.word	GENERIC_WRITE
	.word	FILE_ATTRIBUTE_NORMAL
	.word	FILE_OPEN_IF
	.word	SYNCHRONIZE
	.word	IoFileObjectType
	.word	KernelMode
	.word	MIN_TRACE
	.word	INVALID_HANDLE_VALUE
	.size	TdiOpenDevice, .-TdiOpenDevice
	.comm	SYNCHRONIZE,4,4
	.comm	OBJ_KERNEL_HANDLE,4,4
	.comm	OBJ_CASE_INSENSITIVE,4,4
	.comm	MIN_TRACE,4,4
	.comm	MAX_TRACE,4,4
	.comm	KernelMode,4,4
	.comm	IoFileObjectType,4,4
	.comm	INVALID_HANDLE_VALUE,4,4
	.comm	GENERIC_WRITE,4,4
	.comm	GENERIC_READ,4,4
	.comm	FILE_SHARE_WRITE,4,4
	.comm	FILE_SHARE_READ,4,4
	.comm	FILE_OPEN_IF,4,4
	.comm	FILE_ATTRIBUTE_NORMAL,4,4
	.comm	AFD_SHARE_REUSE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
