	.file	"extr_parttest.c_main.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"Failed allocating memory!\n"
.LC1:
	.string	"Failed opening disk! %lx\n"
.LC2:
	.string	"Failed reading sector 0! %lx\n"
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC3:
	.string	"Sector 0 seems to be FAT boot sector\n"
	.align 8
.LC4:
	.string	"Sector 0 seems to be NTFS boot sector\n"
	.section	.rodata.str1.1
.LC5:
	.string	"Sector 0 might be MBR\n"
.LC6:
	.string	"Sector 0 not recognized\n"
	.section	.rodata.str1.8
	.align 8
.LC7:
	.string	"Failed opening partition! %lx\n"
	.align 8
.LC8:
	.string	"Failed reading first sector of the partition! %lx\n"
	.section	.rodata.str1.1
.LC9:
	.string	"Seems to be a FAT partittion\n"
.LC10:
	.string	"Seems to be a NTFS partition\n"
.LC11:
	.string	"Seems to be MBR\n"
.LC12:
	.string	"Not recognized\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	r15
	push	r14
	push	r13
	push	r12
	push	rbx
	sub	rsp, 56
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -56[rbp], rax
	xor	eax, eax
	movsx	rax, DWORD PTR MAX_PATH[rip]
	mov	rbx, rsp
	lea	rax, 15[0+rax*4]
	mov	rdx, rax
	and	rax, -4096
	sub	rbx, rax
	and	rdx, -16
	mov	rax, rbx
	cmp	rsp, rax
	je	.L3
.L25:
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	cmp	rsp, rax
	jne	.L25
.L3:
	and	edx, 4095
	sub	rsp, rdx
	test	rdx, rdx
	jne	.L26
.L4:
	mov	edi, DWORD PTR SECTOR_SIZE[rip]
	mov	r15, rsp
	call	malloc@PLT
	mov	r12, rax
	test	rax, rax
	je	.L27
	mov	esi, DWORD PTR DiskFormat[rip]
	xor	ecx, ecx
	xor	edx, edx
	mov	rdi, r15
	lea	r14, -60[rbp]
	lea	r13, -68[rbp]
	call	swprintf@PLT
	mov	rsi, r15
	mov	rdi, r14
	lea	rbx, -64[rbp]
	call	RtlInitUnicodeString@PLT
	mov	edx, DWORD PTR OBJ_CASE_INSENSITIVE[rip]
	xor	r8d, r8d
	xor	ecx, ecx
	mov	rsi, r14
	mov	rdi, r13
	call	InitializeObjectAttributes@PLT
	lea	rax, -72[rbp]
	xor	r8d, r8d
	mov	rcx, rbx
	mov	esi, DWORD PTR GENERIC_READ[rip]
	mov	rdi, rax
	mov	rdx, r13
	mov	QWORD PTR -96[rbp], rax
	mov	r9d, DWORD PTR FILE_SYNCHRONOUS_IO_NONALERT[rip]
	or	esi, DWORD PTR SYNCHRONIZE[rip]
	call	NtOpenFile@PLT
	mov	edi, eax
	mov	DWORD PTR -84[rbp], eax
	call	NT_SUCCESS@PLT
	test	eax, eax
	je	.L28
	mov	eax, DWORD PTR SECTOR_SIZE[rip]
	push	rdx
	mov	r9, r12
	mov	r8, rbx
	push	0
	mov	edi, DWORD PTR -72[rbp]
	xor	ecx, ecx
	xor	edx, edx
	push	0
	xor	esi, esi
	push	rax
	call	NtReadFile@PLT
	mov	edi, DWORD PTR -72[rbp]
	add	rsp, 32
	mov	DWORD PTR -84[rbp], eax
	call	NtClose@PLT
	mov	edi, DWORD PTR -84[rbp]
	call	NT_SUCCESS@PLT
	mov	rdi, r12
	test	eax, eax
	je	.L29
	call	CheckAgainstFAT@PLT
	test	rax, rax
	jne	.L30
	mov	rdi, r12
	call	CheckAgainstNTFS@PLT
	test	rax, rax
	je	.L11
	lea	rdi, .LC4[rip]
	call	printf@PLT
.L10:
	mov	esi, DWORD PTR DiskFormat[rip]
	xor	edx, edx
	mov	ecx, 1
	mov	rdi, r15
	call	swprintf@PLT
	mov	rsi, r15
	mov	rdi, r14
	call	RtlInitUnicodeString@PLT
	mov	edx, DWORD PTR OBJ_CASE_INSENSITIVE[rip]
	xor	r8d, r8d
	xor	ecx, ecx
	mov	rdi, r13
	mov	rsi, r14
	call	InitializeObjectAttributes@PLT
	mov	rdi, QWORD PTR -96[rbp]
	mov	rdx, r13
	mov	rcx, rbx
	mov	r9d, DWORD PTR FILE_SYNCHRONOUS_IO_NONALERT[rip]
	mov	r8d, DWORD PTR FILE_SHARE_READ[rip]
	mov	esi, DWORD PTR GENERIC_READ[rip]
	or	r8d, DWORD PTR FILE_SHARE_WRITE[rip]
	or	esi, DWORD PTR SYNCHRONIZE[rip]
	or	r8d, DWORD PTR FILE_SHARE_DELETE[rip]
	call	NtOpenFile@PLT
	mov	edi, eax
	mov	r13d, eax
	call	NT_SUCCESS@PLT
	test	eax, eax
	je	.L31
	push	rax
	mov	eax, DWORD PTR SECTOR_SIZE[rip]
	mov	r9, r12
	mov	r8, rbx
	push	0
	mov	edi, DWORD PTR -72[rbp]
	xor	ecx, ecx
	xor	edx, edx
	push	0
	xor	esi, esi
	push	rax
	call	NtReadFile@PLT
	add	rsp, 32
	mov	edi, eax
	mov	r13d, eax
	call	NT_SUCCESS@PLT
	mov	rdi, r12
	test	eax, eax
	je	.L32
	call	CheckAgainstFAT@PLT
	test	rax, rax
	je	.L15
	lea	rdi, .LC9[rip]
	call	printf@PLT
.L16:
	mov	rdi, r12
	call	free@PLT
	jmp	.L6
.L28:
	mov	rdi, r12
	call	free@PLT
	mov	edx, DWORD PTR -84[rbp]
	mov	edi, DWORD PTR stderr[rip]
	xor	eax, eax
	lea	rsi, .LC1[rip]
	call	fprintf@PLT
.L6:
	mov	rax, QWORD PTR -56[rbp]
	xor	rax, QWORD PTR fs:40
	jne	.L33
	lea	rsp, -40[rbp]
	xor	eax, eax
	pop	rbx
	pop	r12
	pop	r13
	pop	r14
	pop	r15
	pop	rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L30:
	.cfi_restore_state
	lea	rdi, .LC3[rip]
	call	printf@PLT
	jmp	.L10
.L26:
	or	QWORD PTR -8[rsp+rdx], 0
	jmp	.L4
.L29:
	call	free@PLT
	mov	edx, DWORD PTR -84[rbp]
	mov	edi, DWORD PTR stderr[rip]
	xor	eax, eax
	lea	rsi, .LC2[rip]
	call	fprintf@PLT
	jmp	.L6
.L27:
	mov	edi, DWORD PTR stderr[rip]
	lea	rsi, .LC0[rip]
	xor	eax, eax
	call	fprintf@PLT
	jmp	.L6
.L31:
	mov	rdi, r12
	call	free@PLT
	mov	edi, DWORD PTR stderr[rip]
	mov	edx, r13d
	xor	eax, eax
	lea	rsi, .LC7[rip]
	call	fprintf@PLT
	jmp	.L6
.L11:
	mov	rdi, r12
	call	CheckAgainstMBR@PLT
	test	rax, rax
	je	.L12
	lea	rdi, .LC5[rip]
	call	printf@PLT
	jmp	.L10
.L32:
	call	free@PLT
	mov	edi, DWORD PTR stderr[rip]
	mov	edx, r13d
	xor	eax, eax
	lea	rsi, .LC8[rip]
	call	fprintf@PLT
	jmp	.L6
.L15:
	mov	rdi, r12
	call	CheckAgainstNTFS@PLT
	test	rax, rax
	jne	.L34
	mov	rdi, r12
	call	CheckAgainstMBR@PLT
	test	rax, rax
	je	.L18
	lea	rdi, .LC11[rip]
	call	printf@PLT
	jmp	.L16
.L12:
	lea	rdi, .LC6[rip]
	call	printf@PLT
	jmp	.L10
.L34:
	lea	rdi, .LC10[rip]
	call	printf@PLT
	jmp	.L16
.L18:
	lea	rdi, .LC12[rip]
	call	printf@PLT
	jmp	.L16
.L33:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.comm	stderr,4,4
	.comm	SYNCHRONIZE,4,4
	.comm	SECTOR_SIZE,4,4
	.comm	OBJ_CASE_INSENSITIVE,4,4
	.comm	MAX_PATH,4,4
	.comm	GENERIC_READ,4,4
	.comm	FILE_SYNCHRONOUS_IO_NONALERT,4,4
	.comm	FILE_SHARE_WRITE,4,4
	.comm	FILE_SHARE_READ,4,4
	.comm	FILE_SHARE_DELETE,4,4
	.comm	DiskFormat,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_parttest.c_main.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"Failed allocating memory!\012\000"
	.align	2
.LC1:
	.ascii	"Failed opening disk! %lx\012\000"
	.align	2
.LC2:
	.ascii	"Failed reading sector 0! %lx\012\000"
	.align	2
.LC3:
	.ascii	"Sector 0 seems to be FAT boot sector\012\000"
	.align	2
.LC4:
	.ascii	"Sector 0 seems to be NTFS boot sector\012\000"
	.align	2
.LC5:
	.ascii	"Sector 0 might be MBR\012\000"
	.align	2
.LC6:
	.ascii	"Sector 0 not recognized\012\000"
	.align	2
.LC7:
	.ascii	"Failed opening partition! %lx\012\000"
	.align	2
.LC8:
	.ascii	"Failed reading first sector of the partition! %lx\012"
	.ascii	"\000"
	.align	2
.LC9:
	.ascii	"Seems to be a FAT partittion\012\000"
	.align	2
.LC10:
	.ascii	"Seems to be a NTFS partition\012\000"
	.align	2
.LC11:
	.ascii	"Seems to be MBR\012\000"
	.align	2
.LC12:
	.ascii	"Not recognized\012\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC13:
	.word	__stack_chk_guard
	.section	.text.startup,"ax",%progbits
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 32
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	add	fp, sp, #32
	sub	sp, sp, #60
	ldr	r3, .L25
	ldr	r8, .L25+4
	ldr	r3, [r3]
	ldr	r0, [r8]
	lsl	r3, r3, #2
	add	r3, r3, #7
	bic	r3, r3, #7
	sub	sp, sp, r3
	ldr	r3, .L25+8
	ldr	r3, [r3]
	str	r3, [fp, #-40]
	mov	r3,#0
	bl	malloc
	subs	r4, r0, #0
	beq	.L19
	mov	r3, #0
	mov	r5, r3
	ldr	r1, .L25+12
	add	r6, sp, #24
	mov	r2, r3
	ldr	r1, [r1]
	mov	r0, r6
	bl	swprintf
	mov	r1, r6
	sub	r0, fp, #44
	bl	RtlInitUnicodeString
	ldr	r2, .L25+16
	str	r5, [sp]
	ldr	r10, .L25+20
	ldr	r7, .L25+24
	ldr	r9, .L25+28
	mov	r3, r5
	ldr	r2, [r2]
	sub	r1, fp, #44
	sub	r0, fp, #52
	bl	InitializeObjectAttributes
	ldr	r2, [r7]
	ldr	r3, [r9]
	ldr	r1, [r10]
	str	r3, [sp, #4]
	orr	r1, r1, r2
	sub	r3, fp, #48
	sub	r2, fp, #52
	str	r5, [sp]
	sub	r0, fp, #56
	bl	NtOpenFile
	str	r0, [fp, #-64]
	bl	NT_SUCCESS
	cmp	r0, r5
	beq	.L20
	ldr	r3, [r8]
	sub	r2, fp, #48
	mov	r1, r5
	str	r5, [sp, #16]
	str	r5, [sp, #12]
	str	r2, [sp]
	str	r3, [sp, #8]
	mov	r2, r5
	mov	r3, r5
	ldr	r0, [fp, #-56]
	str	r4, [sp, #4]
	bl	NtReadFile
	mov	r5, r0
	ldr	r0, [fp, #-56]
	bl	NtClose
	mov	r0, r5
	bl	NT_SUCCESS
	cmp	r0, #0
	mov	r0, r4
	beq	.L21
	bl	CheckAgainstFAT
	cmp	r0, #0
	beq	.L6
	ldr	r0, .L25+32
	bl	printf
.L7:
	mov	r5, #0
	ldr	r3, .L25+12
	mov	r2, r5
	ldr	r1, [r3]
	mov	r0, r6
	mov	r3, #1
	bl	swprintf
	mov	r1, r6
	sub	r0, fp, #44
	bl	RtlInitUnicodeString
	ldr	r3, .L25+16
	sub	r1, fp, #44
	ldr	r2, [r3]
	sub	r0, fp, #52
	mov	r3, r5
	str	r5, [sp]
	bl	InitializeObjectAttributes
	ldr	r1, .L25+36
	ldr	r3, .L25+40
	ldr	r2, .L25+44
	ldr	lr, [r1]
	ldr	r3, [r3]
	ldr	ip, [r2]
	ldr	r0, [r10]
	ldr	r2, [r9]
	orr	r3, r3, lr
	ldr	r1, [r7]
	orr	r3, r3, ip
	orr	r1, r0, r1
	str	r2, [sp, #4]
	str	r3, [sp]
	sub	r2, fp, #52
	sub	r3, fp, #48
	sub	r0, fp, #56
	bl	NtOpenFile
	mov	r6, r0
	bl	NT_SUCCESS
	cmp	r0, r5
	beq	.L22
	ldr	r3, [r8]
	mov	r2, r5
	str	r3, [sp, #8]
	sub	r3, fp, #48
	mov	r1, r5
	str	r5, [sp, #16]
	str	r5, [sp, #12]
	str	r3, [sp]
	ldr	r0, [fp, #-56]
	mov	r3, r5
	str	r4, [sp, #4]
	bl	NtReadFile
	mov	r5, r0
	bl	NT_SUCCESS
	cmp	r0, #0
	mov	r0, r4
	beq	.L23
	bl	CheckAgainstFAT
	cmp	r0, #0
	beq	.L12
	ldr	r0, .L25+48
	bl	printf
.L13:
	mov	r0, r4
	bl	free
	b	.L3
.L21:
	bl	free
	ldr	r3, .L25+52
	mov	r2, r5
	ldr	r0, [r3]
	ldr	r1, .L25+56
	bl	fprintf
.L3:
	ldr	r3, .L25+8
	ldr	r2, [r3]
	ldr	r3, [fp, #-40]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L24
	mov	r0, #0
	sub	sp, fp, #32
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L20:
	mov	r0, r4
	bl	free
	ldr	r3, .L25+52
	ldr	r2, [fp, #-64]
	ldr	r0, [r3]
	ldr	r1, .L25+60
	bl	fprintf
	b	.L3
.L6:
	mov	r0, r4
	bl	CheckAgainstNTFS
	cmp	r0, #0
	beq	.L8
	ldr	r0, .L25+64
	bl	printf
	b	.L7
.L8:
	mov	r0, r4
	bl	CheckAgainstMBR
	cmp	r0, #0
	ldrne	r0, .L25+68
	ldreq	r0, .L25+72
	bl	printf
	b	.L7
.L23:
	bl	free
	ldr	r3, .L25+52
	mov	r2, r5
	ldr	r0, [r3]
	ldr	r1, .L25+76
	bl	fprintf
	b	.L3
.L22:
	mov	r0, r4
	bl	free
	ldr	r3, .L25+52
	mov	r2, r6
	ldr	r0, [r3]
	ldr	r1, .L25+80
	bl	fprintf
	b	.L3
.L12:
	mov	r0, r4
	bl	CheckAgainstNTFS
	cmp	r0, #0
	beq	.L14
	ldr	r0, .L25+84
	bl	printf
	b	.L13
.L14:
	mov	r0, r4
	bl	CheckAgainstMBR
	cmp	r0, #0
	ldrne	r0, .L25+88
	ldreq	r0, .L25+92
	bl	printf
	b	.L13
.L19:
	ldr	r3, .L25+52
	ldr	r1, .L25+96
	ldr	r0, [r3]
	bl	fprintf
	b	.L3
.L24:
	bl	__stack_chk_fail
.L26:
	.align	2
.L25:
	.word	MAX_PATH
	.word	SECTOR_SIZE
	.word	.LC13
	.word	DiskFormat
	.word	OBJ_CASE_INSENSITIVE
	.word	GENERIC_READ
	.word	SYNCHRONIZE
	.word	FILE_SYNCHRONOUS_IO_NONALERT
	.word	.LC3
	.word	FILE_SHARE_WRITE
	.word	FILE_SHARE_READ
	.word	FILE_SHARE_DELETE
	.word	.LC9
	.word	stderr
	.word	.LC2
	.word	.LC1
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	.LC8
	.word	.LC7
	.word	.LC10
	.word	.LC11
	.word	.LC12
	.word	.LC0
	.size	main, .-main
	.comm	stderr,4,4
	.comm	SYNCHRONIZE,4,4
	.comm	SECTOR_SIZE,4,4
	.comm	OBJ_CASE_INSENSITIVE,4,4
	.comm	MAX_PATH,4,4
	.comm	GENERIC_READ,4,4
	.comm	FILE_SYNCHRONOUS_IO_NONALERT,4,4
	.comm	FILE_SHARE_WRITE,4,4
	.comm	FILE_SHARE_READ,4,4
	.comm	FILE_SHARE_DELETE,4,4
	.comm	DiskFormat,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
