	.file	"448728.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"rb"
	.text
	.globl	HandleBmpFile
	.type	HandleBmpFile, @function
HandleBmpFile:
.LFB6:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 192
	mov	QWORD PTR -168[rbp], rdi
	mov	QWORD PTR -176[rbp], rsi
	mov	QWORD PTR -184[rbp], rdx
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	cmp	QWORD PTR -168[rbp], 0
	jne	.L2
	mov	eax, 0
	jmp	.L8
.L2:
	mov	rax, QWORD PTR -168[rbp]
	lea	rsi, .LC0[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR fp[rip], rax
	mov	rax, QWORD PTR fp[rip]
	test	rax, rax
	jne	.L4
	mov	eax, 0
	jmp	.L8
.L4:
	mov	rdx, QWORD PTR fp[rip]
	lea	rax, -144[rbp]
	mov	rcx, rdx
	mov	edx, 1
	mov	esi, 122
	mov	rdi, rax
	call	fread@PLT
	test	rax, rax
	jne	.L5
	mov	rax, QWORD PTR fp[rip]
	mov	rdi, rax
	call	fclose@PLT
	mov	eax, 0
	jmp	.L8
.L5:
	mov	eax, DWORD PTR -126[rbp]
	mov	edx, eax
	mov	rax, QWORD PTR -176[rbp]
	mov	WORD PTR [rax], dx
	mov	eax, DWORD PTR -122[rbp]
	neg	eax
	mov	edx, eax
	mov	rax, QWORD PTR -184[rbp]
	mov	WORD PTR [rax], dx
	mov	eax, DWORD PTR -134[rbp]
	mov	ecx, eax
	mov	rax, QWORD PTR fp[rip]
	mov	edx, 0
	mov	rsi, rcx
	mov	rdi, rax
	call	fseek@PLT
	mov	eax, DWORD PTR -126[rbp]
	mov	edx, DWORD PTR -122[rbp]
	neg	edx
	imul	eax, edx
	add	eax, eax
	mov	DWORD PTR -156[rbp], eax
	mov	eax, DWORD PTR -156[rbp]
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR -152[rbp], rax
	cmp	QWORD PTR -152[rbp], 0
	jne	.L6
	mov	rax, QWORD PTR fp[rip]
	mov	rdi, rax
	call	fclose@PLT
	mov	eax, 0
	jmp	.L8
.L6:
	mov	rdx, QWORD PTR fp[rip]
	mov	esi, DWORD PTR -156[rbp]
	mov	rax, QWORD PTR -152[rbp]
	mov	rcx, rdx
	mov	edx, 1
	mov	rdi, rax
	call	fread@PLT
	test	rax, rax
	jne	.L7
	mov	rax, QWORD PTR fp[rip]
	mov	rdi, rax
	call	fclose@PLT
	mov	rax, QWORD PTR -152[rbp]
	mov	rdi, rax
	call	free@PLT
	mov	eax, 0
	jmp	.L8
.L7:
	mov	rax, QWORD PTR -152[rbp]
.L8:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L9
	call	__stack_chk_fail@PLT
.L9:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	HandleBmpFile, .-HandleBmpFile
	.ident	"GCC: (Ubuntu 10.5.0-1ubuntu1~20.04) 10.5.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, 6
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"448728.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"rb\000"
	.align	2
.LC1:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	HandleBmpFile
	.syntax unified
	.arm
	.fpu softvfp
	.type	HandleBmpFile, %function
HandleBmpFile:
	@ args = 0, pretend = 0, frame = 152
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #152
	str	r0, [fp, #-144]
	str	r1, [fp, #-148]
	str	r2, [fp, #-152]
	ldr	r3, .L10
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, [fp, #-144]
	cmp	r3, #0
	bne	.L2
	mov	r3, #0
	b	.L8
.L2:
	ldr	r1, .L10+4
	ldr	r0, [fp, #-144]
	bl	fopen
	mov	r3, r0
	ldr	r2, .L10+8
	str	r3, [r2]
	ldr	r3, .L10+8
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L4
	mov	r3, #0
	b	.L8
.L4:
	ldr	r3, .L10+8
	ldr	r3, [r3]
	sub	r0, fp, #132
	mov	r2, #1
	mov	r1, #122
	bl	fread
	mov	r3, r0
	cmp	r3, #0
	bne	.L5
	ldr	r3, .L10+8
	ldr	r3, [r3]
	mov	r0, r3
	bl	fclose
	mov	r3, #0
	b	.L8
.L5:
	ldrh	r3, [fp, #-114]
	ldrh	r2, [fp, #-112]
	lsl	r2, r2, #16
	orr	r3, r2, r3
	lsl	r3, r3, #16
	lsr	r2, r3, #16
	ldr	r3, [fp, #-148]
	strh	r2, [r3]	@ movhi
	ldrh	r3, [fp, #-110]
	ldrh	r2, [fp, #-108]
	lsl	r2, r2, #16
	orr	r3, r2, r3
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	rsb	r3, r3, #0
	lsl	r3, r3, #16
	lsr	r2, r3, #16
	ldr	r3, [fp, #-152]
	strh	r2, [r3]	@ movhi
	ldr	r3, .L10+8
	ldr	r0, [r3]
	ldrh	r3, [fp, #-122]
	ldrh	r2, [fp, #-120]
	lsl	r2, r2, #16
	orr	r3, r2, r3
	mov	r2, #0
	mov	r1, r3
	bl	fseek
	ldrh	r3, [fp, #-114]
	ldrh	r2, [fp, #-112]
	lsl	r2, r2, #16
	orr	r3, r2, r3
	mov	r1, r3
	ldrh	r3, [fp, #-110]
	ldrh	r2, [fp, #-108]
	lsl	r2, r2, #16
	orr	r3, r2, r3
	rsb	r3, r3, #0
	mul	r3, r1, r3
	lsl	r3, r3, #1
	str	r3, [fp, #-140]
	ldr	r0, [fp, #-140]
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-136]
	ldr	r3, [fp, #-136]
	cmp	r3, #0
	bne	.L6
	ldr	r3, .L10+8
	ldr	r3, [r3]
	mov	r0, r3
	bl	fclose
	mov	r3, #0
	b	.L8
.L6:
	ldr	r3, .L10+8
	ldr	r3, [r3]
	mov	r2, #1
	ldr	r1, [fp, #-140]
	ldr	r0, [fp, #-136]
	bl	fread
	mov	r3, r0
	cmp	r3, #0
	bne	.L7
	ldr	r3, .L10+8
	ldr	r3, [r3]
	mov	r0, r3
	bl	fclose
	ldr	r0, [fp, #-136]
	bl	free
	mov	r3, #0
	b	.L8
.L7:
	ldr	r3, [fp, #-136]
.L8:
	ldr	r2, .L10
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L9
	bl	__stack_chk_fail
.L9:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L11:
	.align	2
.L10:
	.word	.LC1
	.word	.LC0
	.word	fp
	.size	HandleBmpFile, .-HandleBmpFile
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
