	.file	"613110.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"rb"
.LC1:
	.string	"./42_Watermark.ppm"
.LC2:
	.string	"wb"
.LC3:
	.string	"./42_WatermarkAlpha.ppm"
.LC4:
	.string	"P6\n%[^\n]\n%li %li\n%li\n"
	.align 8
.LC5:
	.string	"malloc returned null pointer in AddAlpha.  Bailing out!"
.LC6:
	.string	"%c%c%c"
.LC7:
	.string	"P6\n#.\n%li %li\n255\n"
	.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
	sub	rsp, 192
	mov	DWORD PTR -180[rbp], edi
	mov	QWORD PTR -192[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	lea	rsi, .LC0[rip]
	lea	rdi, .LC1[rip]
	call	fopen@PLT
	mov	QWORD PTR -128[rbp], rax
	lea	rsi, .LC2[rip]
	lea	rdi, .LC3[rip]
	call	fopen@PLT
	mov	QWORD PTR -120[rbp], rax
	lea	rdi, -144[rbp]
	lea	rsi, -152[rbp]
	lea	rcx, -160[rbp]
	lea	rdx, -96[rbp]
	mov	rax, QWORD PTR -128[rbp]
	mov	r9, rdi
	mov	r8, rsi
	lea	rsi, .LC4[rip]
	mov	rdi, rax
	mov	eax, 0
	call	__isoc99_fscanf@PLT
	mov	rdx, QWORD PTR -160[rbp]
	mov	rax, QWORD PTR -152[rbp]
	imul	rax, rdx
	mov	QWORD PTR -112[rbp], rax
	mov	rax, QWORD PTR -112[rbp]
	sal	rax, 2
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR -104[rbp], rax
	cmp	QWORD PTR -104[rbp], 0
	jne	.L2
	lea	rdi, .LC5[rip]
	call	puts@PLT
	mov	edi, 1
	call	exit@PLT
.L2:
	mov	QWORD PTR -136[rbp], 0
	jmp	.L3
.L4:
	lea	rsi, -161[rbp]
	lea	rcx, -162[rbp]
	lea	rdx, -163[rbp]
	mov	rax, QWORD PTR -128[rbp]
	mov	r8, rsi
	lea	rsi, .LC6[rip]
	mov	rdi, rax
	mov	eax, 0
	call	__isoc99_fscanf@PLT
	mov	rax, QWORD PTR -136[rbp]
	sal	rax, 2
	mov	rdx, rax
	mov	rax, QWORD PTR -104[rbp]
	add	rax, rdx
	mov	BYTE PTR [rax], -1
	mov	rax, QWORD PTR -136[rbp]
	sal	rax, 2
	lea	rdx, 1[rax]
	mov	rax, QWORD PTR -104[rbp]
	add	rax, rdx
	mov	BYTE PTR [rax], -1
	mov	rax, QWORD PTR -136[rbp]
	sal	rax, 2
	lea	rdx, 2[rax]
	mov	rax, QWORD PTR -104[rbp]
	add	rax, rdx
	mov	BYTE PTR [rax], -1
	mov	rax, QWORD PTR -136[rbp]
	sal	rax, 2
	lea	rdx, 3[rax]
	mov	rax, QWORD PTR -104[rbp]
	add	rdx, rax
	movzx	eax, BYTE PTR -163[rbp]
	mov	BYTE PTR [rdx], al
	add	QWORD PTR -136[rbp], 1
.L3:
	mov	rax, QWORD PTR -136[rbp]
	cmp	rax, QWORD PTR -112[rbp]
	jl	.L4
	mov	rax, QWORD PTR -128[rbp]
	mov	rdi, rax
	call	fclose@PLT
	mov	rcx, QWORD PTR -152[rbp]
	mov	rdx, QWORD PTR -160[rbp]
	mov	rax, QWORD PTR -120[rbp]
	lea	rsi, .LC7[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	rax, QWORD PTR -120[rbp]
	mov	rdi, rax
	call	fflush@PLT
	mov	rdx, QWORD PTR -152[rbp]
	mov	rax, QWORD PTR -160[rbp]
	imul	rax, rdx
	sal	rax, 2
	mov	QWORD PTR -112[rbp], rax
	mov	QWORD PTR -136[rbp], 0
	jmp	.L5
.L6:
	mov	rdx, QWORD PTR -136[rbp]
	mov	rax, QWORD PTR -104[rbp]
	add	rax, rdx
	movzx	eax, BYTE PTR [rax]
	movzx	eax, al
	mov	rdx, QWORD PTR -120[rbp]
	mov	rsi, rdx
	mov	edi, eax
	call	fputc@PLT
	add	QWORD PTR -136[rbp], 1
.L5:
	mov	rax, QWORD PTR -136[rbp]
	cmp	rax, QWORD PTR -112[rbp]
	jl	.L6
	mov	rax, QWORD PTR -120[rbp]
	mov	rdi, rax
	call	fclose@PLT
	mov	eax, 0
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L8
	call	__stack_chk_fail@PLT
.L8:
	leave
	.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	"613110.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"rb\000"
	.align	2
.LC1:
	.ascii	"./42_Watermark.ppm\000"
	.align	2
.LC2:
	.ascii	"wb\000"
	.align	2
.LC3:
	.ascii	"./42_WatermarkAlpha.ppm\000"
	.align	2
.LC4:
	.ascii	"P6\012%[^\012]\012%li %li\012%li\012\000"
	.align	2
.LC5:
	.ascii	"malloc returned null pointer in AddAlpha.  Bailing "
	.ascii	"out!\000"
	.align	2
.LC6:
	.ascii	"%c%c%c\000"
	.align	2
.LC7:
	.ascii	"P6\012#.\012%li %li\012255\012\000"
	.align	2
.LC8:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 128
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #136
	str	r0, [fp, #-128]
	str	r1, [fp, #-132]
	ldr	r3, .L9
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r1, .L9+4
	ldr	r0, .L9+8
	bl	fopen
	str	r0, [fp, #-104]
	ldr	r1, .L9+12
	ldr	r0, .L9+16
	bl	fopen
	str	r0, [fp, #-100]
	sub	r1, fp, #120
	sub	r2, fp, #88
	sub	r3, fp, #112
	str	r3, [sp, #4]
	sub	r3, fp, #116
	str	r3, [sp]
	mov	r3, r1
	ldr	r1, .L9+20
	ldr	r0, [fp, #-104]
	bl	__isoc99_fscanf
	ldr	r3, [fp, #-120]
	ldr	r2, [fp, #-116]
	mul	r3, r2, r3
	str	r3, [fp, #-96]
	ldr	r3, [fp, #-96]
	lsl	r3, r3, #2
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-92]
	ldr	r3, [fp, #-92]
	cmp	r3, #0
	bne	.L2
	ldr	r0, .L9+24
	bl	puts
	mov	r0, #1
	bl	exit
.L2:
	mov	r3, #0
	str	r3, [fp, #-108]
	b	.L3
.L4:
	sub	r1, fp, #122
	sub	r2, fp, #123
	sub	r3, fp, #121
	str	r3, [sp]
	mov	r3, r1
	ldr	r1, .L9+28
	ldr	r0, [fp, #-104]
	bl	__isoc99_fscanf
	ldr	r3, [fp, #-108]
	lsl	r3, r3, #2
	mov	r2, r3
	ldr	r3, [fp, #-92]
	add	r3, r3, r2
	mvn	r2, #0
	strb	r2, [r3]
	ldr	r3, [fp, #-108]
	lsl	r3, r3, #2
	add	r3, r3, #1
	ldr	r2, [fp, #-92]
	add	r3, r2, r3
	mvn	r2, #0
	strb	r2, [r3]
	ldr	r3, [fp, #-108]
	lsl	r3, r3, #2
	add	r3, r3, #2
	ldr	r2, [fp, #-92]
	add	r3, r2, r3
	mvn	r2, #0
	strb	r2, [r3]
	ldr	r3, [fp, #-108]
	lsl	r3, r3, #2
	add	r3, r3, #3
	ldr	r2, [fp, #-92]
	add	r3, r2, r3
	ldrb	r2, [fp, #-123]	@ zero_extendqisi2
	strb	r2, [r3]
	ldr	r3, [fp, #-108]
	add	r3, r3, #1
	str	r3, [fp, #-108]
.L3:
	ldr	r2, [fp, #-108]
	ldr	r3, [fp, #-96]
	cmp	r2, r3
	blt	.L4
	ldr	r0, [fp, #-104]
	bl	fclose
	ldr	r2, [fp, #-120]
	ldr	r3, [fp, #-116]
	ldr	r1, .L9+32
	ldr	r0, [fp, #-100]
	bl	fprintf
	ldr	r0, [fp, #-100]
	bl	fflush
	ldr	r3, [fp, #-116]
	ldr	r2, [fp, #-120]
	mul	r3, r2, r3
	lsl	r3, r3, #2
	str	r3, [fp, #-96]
	mov	r3, #0
	str	r3, [fp, #-108]
	b	.L5
.L6:
	ldr	r3, [fp, #-108]
	ldr	r2, [fp, #-92]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	ldr	r1, [fp, #-100]
	mov	r0, r3
	bl	fputc
	ldr	r3, [fp, #-108]
	add	r3, r3, #1
	str	r3, [fp, #-108]
.L5:
	ldr	r2, [fp, #-108]
	ldr	r3, [fp, #-96]
	cmp	r2, r3
	blt	.L6
	ldr	r0, [fp, #-100]
	bl	fclose
	mov	r3, #0
	ldr	r2, .L9
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L8
	bl	__stack_chk_fail
.L8:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L10:
	.align	2
.L9:
	.word	.LC8
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
