	.file	"820308.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"P6"
.LC1:
	.string	"%d %d\n"
.LC2:
	.string	"255"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.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	r12
	push	rbx
	sub	rsp, 224
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 12, -40
	.cfi_offset 3, -48
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -40[rbp], rax
	xor	eax, eax
	mov	rax, rsp
	mov	r12, rax
	mov	edi, 0
	call	XOpenDisplay@PLT
	mov	QWORD PTR -224[rbp], rax
	cmp	QWORD PTR -224[rbp], 0
	jne	.L2
	mov	eax, -1
	jmp	.L3
.L2:
	mov	rax, QWORD PTR -224[rbp]
	mov	rdx, QWORD PTR 232[rax]
	mov	rax, QWORD PTR -224[rbp]
	mov	eax, DWORD PTR 224[rax]
	cdqe
	sal	rax, 7
	add	rax, rdx
	mov	rax, QWORD PTR 16[rax]
	mov	QWORD PTR -216[rbp], rax
	lea	rdx, -176[rbp]
	mov	rcx, QWORD PTR -216[rbp]
	mov	rax, QWORD PTR -224[rbp]
	mov	rsi, rcx
	mov	rdi, rax
	call	XGetWindowAttributes@PLT
	mov	eax, DWORD PTR -164[rbp]
	mov	ecx, eax
	mov	eax, DWORD PTR -168[rbp]
	mov	edx, eax
	mov	rsi, QWORD PTR -216[rbp]
	mov	rax, QWORD PTR -224[rbp]
	push	2
	push	-1
	mov	r9d, ecx
	mov	r8d, edx
	mov	ecx, 0
	mov	edx, 0
	mov	rdi, rax
	call	XGetImage@PLT
	add	rsp, 16
	mov	QWORD PTR -208[rbp], rax
	cmp	QWORD PTR -208[rbp], 0
	jne	.L4
	mov	eax, -1
	jmp	.L3
.L4:
	lea	rdi, .LC0[rip]
	call	puts@PLT
	mov	rax, QWORD PTR -208[rbp]
	mov	edx, DWORD PTR 4[rax]
	mov	rax, QWORD PTR -208[rbp]
	mov	eax, DWORD PTR [rax]
	mov	esi, eax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rdi, .LC2[rip]
	call	puts@PLT
	mov	rax, QWORD PTR -208[rbp]
	mov	eax, DWORD PTR 48[rax]
	lea	edx, 7[rax]
	test	eax, eax
	cmovs	eax, edx
	sar	eax, 3
	mov	DWORD PTR -228[rbp], eax
	mov	rax, QWORD PTR -208[rbp]
	mov	edx, DWORD PTR [rax]
	mov	eax, edx
	add	eax, eax
	lea	ebx, [rax+rdx]
	movsx	rax, ebx
	sub	rax, 1
	mov	QWORD PTR -200[rbp], rax
	movsx	rax, ebx
	mov	QWORD PTR -256[rbp], rax
	mov	QWORD PTR -248[rbp], 0
	movsx	rax, ebx
	mov	r14, rax
	mov	r15d, 0
	movsx	rax, ebx
	mov	edx, 16
	sub	rdx, 1
	add	rax, rdx
	mov	esi, 16
	mov	edx, 0
	div	rsi
	imul	rax, rax, 16
	mov	rcx, rax
	and	rcx, -4096
	mov	rdx, rsp
	sub	rdx, rcx
.L5:
	cmp	rsp, rdx
	je	.L6
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	jmp	.L5
.L6:
	mov	rdx, rax
	and	edx, 4095
	sub	rsp, rdx
	mov	rdx, rax
	and	edx, 4095
	test	rdx, rdx
	je	.L7
	and	eax, 4095
	sub	rax, 8
	add	rax, rsp
	or	QWORD PTR [rax], 0
.L7:
	mov	rax, rsp
	add	rax, 0
	mov	QWORD PTR -192[rbp], rax
	mov	DWORD PTR -232[rbp], 0
	jmp	.L8
.L11:
	mov	DWORD PTR -236[rbp], 0
	jmp	.L9
.L10:
	mov	rax, QWORD PTR -208[rbp]
	mov	rdx, QWORD PTR 16[rax]
	mov	eax, DWORD PTR -236[rbp]
	imul	eax, DWORD PTR -228[rbp]
	movsx	rcx, eax
	mov	rax, QWORD PTR -208[rbp]
	mov	eax, DWORD PTR [rax]
	imul	eax, DWORD PTR -232[rbp]
	imul	eax, DWORD PTR -228[rbp]
	cdqe
	add	rax, rcx
	add	rax, rdx
	mov	QWORD PTR -184[rbp], rax
	mov	rax, QWORD PTR -184[rbp]
	add	rax, 2
	movzx	ecx, BYTE PTR [rax]
	mov	edx, DWORD PTR -236[rbp]
	mov	eax, edx
	add	eax, eax
	add	eax, edx
	mov	rdx, QWORD PTR -192[rbp]
	cdqe
	mov	BYTE PTR [rdx+rax], cl
	mov	rax, QWORD PTR -184[rbp]
	add	rax, 1
	movzx	ecx, BYTE PTR [rax]
	mov	edx, DWORD PTR -236[rbp]
	mov	eax, edx
	add	eax, eax
	add	eax, edx
	add	eax, 1
	mov	rdx, QWORD PTR -192[rbp]
	cdqe
	mov	BYTE PTR [rdx+rax], cl
	mov	rax, QWORD PTR -184[rbp]
	movzx	ecx, BYTE PTR [rax]
	mov	edx, DWORD PTR -236[rbp]
	mov	eax, edx
	add	eax, eax
	add	eax, edx
	add	eax, 2
	mov	rdx, QWORD PTR -192[rbp]
	cdqe
	mov	BYTE PTR [rdx+rax], cl
	add	DWORD PTR -236[rbp], 1
.L9:
	mov	rax, QWORD PTR -208[rbp]
	mov	eax, DWORD PTR [rax]
	cmp	DWORD PTR -236[rbp], eax
	jl	.L10
	mov	rcx, QWORD PTR stdout[rip]
	movsx	rdx, ebx
	mov	rax, QWORD PTR -192[rbp]
	mov	esi, 1
	mov	rdi, rax
	call	fwrite@PLT
	add	DWORD PTR -232[rbp], 1
.L8:
	mov	rax, QWORD PTR -208[rbp]
	mov	eax, DWORD PTR 4[rax]
	cmp	DWORD PTR -232[rbp], eax
	jl	.L11
	mov	eax, 0
.L3:
	mov	rsp, r12
	mov	rsi, QWORD PTR -40[rbp]
	sub	rsi, QWORD PTR fs:40
	je	.L13
	call	__stack_chk_fail@PLT
.L13:
	lea	rsp, -32[rbp]
	pop	rbx
	pop	r12
	pop	r14
	pop	r15
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.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	"820308.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"P6\000"
	.align	2
.LC1:
	.ascii	"%d %d\012\000"
	.align	2
.LC2:
	.ascii	"255\000"
	.align	2
.LC3:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 136
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, fp, lr}
	add	fp, sp, #12
	sub	sp, sp, #152
	ldr	r3, .L11
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	mov	r3, sp
	mov	r5, r3
	mov	r0, #0
	bl	XOpenDisplay
	str	r0, [fp, #-136]
	ldr	r3, [fp, #-136]
	cmp	r3, #0
	bne	.L2
	mvn	r3, #0
	b	.L3
.L2:
	ldr	r3, [fp, #-136]
	ldr	r2, [r3, #140]
	ldr	r3, [fp, #-136]
	ldr	r3, [r3, #132]
	mov	r1, r3
	mov	r3, r1
	lsl	r3, r3, #2
	add	r3, r3, r1
	lsl	r3, r3, #4
	add	r3, r2, r3
	ldr	r3, [r3, #8]
	str	r3, [fp, #-132]
	sub	r3, fp, #108
	mov	r2, r3
	ldr	r1, [fp, #-132]
	ldr	r0, [fp, #-136]
	bl	XGetWindowAttributes
	ldr	r3, [fp, #-100]
	mov	r2, r3
	ldr	r3, [fp, #-96]
	mov	r1, r3
	mov	r3, #2
	str	r3, [sp, #12]
	mvn	r3, #0
	str	r3, [sp, #8]
	str	r1, [sp, #4]
	str	r2, [sp]
	mov	r3, #0
	mov	r2, #0
	ldr	r1, [fp, #-132]
	ldr	r0, [fp, #-136]
	bl	XGetImage
	str	r0, [fp, #-128]
	ldr	r3, [fp, #-128]
	cmp	r3, #0
	bne	.L4
	mvn	r3, #0
	b	.L3
.L4:
	ldr	r0, .L11+4
	bl	puts
	ldr	r3, [fp, #-128]
	ldr	r1, [r3]
	ldr	r3, [fp, #-128]
	ldr	r3, [r3, #4]
	mov	r2, r3
	ldr	r0, .L11+8
	bl	printf
	ldr	r0, .L11+12
	bl	puts
	ldr	r3, [fp, #-128]
	ldr	r3, [r3, #44]
	add	r2, r3, #7
	cmp	r3, #0
	movlt	r3, r2
	movge	r3, r3
	asr	r3, r3, #3
	str	r3, [fp, #-124]
	ldr	r3, [fp, #-128]
	ldr	r2, [r3]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r4, r3, r2
	sub	r3, r4, #1
	str	r3, [fp, #-120]
	mov	r3, r4
	mov	r0, r3
	mov	r1, #0
	mov	r2, #0
	mov	r3, #0
	lsl	r3, r1, #3
	orr	r3, r3, r0, lsr #29
	lsl	r2, r0, #3
	mov	r3, r4
	mov	r0, r3
	mov	r1, #0
	mov	r2, #0
	mov	r3, #0
	lsl	r3, r1, #3
	orr	r3, r3, r0, lsr #29
	lsl	r2, r0, #3
	mov	r3, r4
	add	r3, r3, #7
	lsr	r3, r3, #3
	lsl	r3, r3, #3
	sub	sp, sp, r3
	add	r3, sp, #16
	add	r3, r3, #0
	str	r3, [fp, #-116]
	mov	r3, #0
	str	r3, [fp, #-140]
	b	.L5
.L8:
	mov	r3, #0
	str	r3, [fp, #-144]
	b	.L6
.L7:
	ldr	r3, [fp, #-128]
	ldr	r2, [r3, #16]
	ldr	r3, [fp, #-144]
	ldr	r1, [fp, #-124]
	mul	r3, r1, r3
	mov	r0, r3
	ldr	r3, [fp, #-128]
	ldr	r3, [r3]
	ldr	r1, [fp, #-140]
	mul	r3, r1, r3
	ldr	r1, [fp, #-124]
	mul	r3, r1, r3
	add	r3, r0, r3
	add	r3, r2, r3
	str	r3, [fp, #-112]
	ldr	r3, [fp, #-112]
	add	r1, r3, #2
	ldr	r2, [fp, #-144]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	ldrb	r1, [r1]	@ zero_extendqisi2
	ldr	r2, [fp, #-116]
	strb	r1, [r2, r3]
	ldr	r3, [fp, #-112]
	add	r1, r3, #1
	ldr	r2, [fp, #-144]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	add	r3, r3, #1
	ldrb	r1, [r1]	@ zero_extendqisi2
	ldr	r2, [fp, #-116]
	strb	r1, [r2, r3]
	ldr	r2, [fp, #-144]
	mov	r3, r2
	lsl	r3, r3, #1
	add	r3, r3, r2
	add	r3, r3, #2
	ldr	r2, [fp, #-112]
	ldrb	r1, [r2]	@ zero_extendqisi2
	ldr	r2, [fp, #-116]
	strb	r1, [r2, r3]
	ldr	r3, [fp, #-144]
	add	r3, r3, #1
	str	r3, [fp, #-144]
.L6:
	ldr	r3, [fp, #-128]
	ldr	r3, [r3]
	ldr	r2, [fp, #-144]
	cmp	r2, r3
	blt	.L7
	mov	r2, r4
	ldr	r3, .L11+16
	ldr	r3, [r3]
	mov	r1, #1
	ldr	r0, [fp, #-116]
	bl	fwrite
	ldr	r3, [fp, #-140]
	add	r3, r3, #1
	str	r3, [fp, #-140]
.L5:
	ldr	r3, [fp, #-128]
	ldr	r3, [r3, #4]
	ldr	r2, [fp, #-140]
	cmp	r2, r3
	blt	.L8
	mov	r3, #0
.L3:
	mov	sp, r5
	ldr	r2, .L11
	ldr	r1, [r2]
	ldr	r2, [fp, #-16]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L10
	bl	__stack_chk_fail
.L10:
	mov	r0, r3
	sub	sp, fp, #12
	@ sp needed
	pop	{r4, r5, fp, pc}
.L12:
	.align	2
.L11:
	.word	.LC3
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	stdout
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
