From 5e198a7989eafa1eadb7c15e8c236626456552b0 Mon Sep 17 00:00:00 2001
From: chylex <contact@chylex.com>
Date: Fri, 11 Feb 2022 06:44:54 +0100
Subject: [PATCH] Fix access violation in 2015 - Day 1

---
 2015/01/main.asm | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/2015/01/main.asm b/2015/01/main.asm
index 7e7d282..ac2cb5e 100644
--- a/2015/01/main.asm
+++ b/2015/01/main.asm
@@ -1,13 +1,8 @@
 bits 32
-extern _print
-
-section .data
-
-print_final_floor:            db `Final floor: %d\n`, 0
-print_first_entered_basement: db `First entered basement: %d\n`, 0
 
 section .text
 
+extern _print
 global _entryPoint
 
 _entryPoint:
@@ -52,12 +47,21 @@ _entryPoint:
   push eax
   push dword print_final_floor
   call _print
+  pop eax
+  pop eax
 
   push edi
   push dword print_first_entered_basement
   call _print
+  pop edi
+  pop edi
 
   pop edi
   pop ebx
   leave
   ret
+
+section .data
+
+print_final_floor:            db `Final floor: %d\n`, 0
+print_first_entered_basement: db `First entered basement: %d\n`, 0