// File: AlexTheMagnus[P]Project_Hex/src/infraestructure/iconChanger.cc
// Function: NativeIconChanger::createNewAppFile(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void createNewAppFile(string settingFileName, string iconName) {
        string fileLine;
        std::ifstream settingFile = openFile(getSettingFileFullPath(settingFileName));
        std::ofstream tempSettingFile(getAptAppsPath() + getTempFileName());

        if (!(settingFile.is_open()) || !(tempSettingFile.is_open())) {  //no se pudo abrir alguno de los 2
            printErrorOpeningAppFileMessage();
            exit(-1);
        }

        while (getline(settingFile, fileLine, '\n')) {
            if ((fileLine.compare(0, 5, "Icon=")) == 0) {
                fileLine = "Icon=" + getIconFullPath(iconName);
            }
            tempSettingFile << fileLine << std::endl;
        }

        settingFile.close();
        tempSettingFile.close();
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x590, %rsp            # imm = 0x590
movq %rsi, -0x558(%rbp)
movq %rdx, -0x568(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x560(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x32c0
movq -0x558(%rbp), %rsi
leaq -0x280(%rbp), %rdi
callq 0x30d0
jmp 0x518e
movq -0x560(%rbp), %rsi
leaq -0x260(%rbp), %rdi
leaq -0x280(%rbp), %rdx
callq 0x5830
jmp 0x51aa
movq -0x560(%rbp), %rsi
leaq -0x240(%rbp), %rdi
leaq -0x260(%rbp), %rdx
callq 0x5770
jmp 0x51c6
leaq -0x260(%rbp), %rdi
callq 0x3140
leaq -0x280(%rbp), %rdi
callq 0x3140
movq -0x560(%rbp), %rsi
leaq -0x4d0(%rbp), %rdi
callq 0x5980
jmp 0x51f3
movq -0x560(%rbp), %rsi
leaq -0x4f0(%rbp), %rdi
callq 0x59b0
jmp 0x5208
leaq -0x4b0(%rbp), %rdi
leaq -0x4d0(%rbp), %rsi
leaq -0x4f0(%rbp), %rdx
callq 0x58b0
jmp 0x5224
leaq -0x490(%rbp), %rdi
leaq -0x4b0(%rbp), %rsi
movl $0x10, %edx
callq 0x33b0
jmp 0x523e
leaq -0x4b0(%rbp), %rdi
callq 0x3140
leaq -0x4f0(%rbp), %rdi
callq 0x3140
leaq -0x4d0(%rbp), %rdi
callq 0x3140
leaq -0x240(%rbp), %rdi
callq 0x3320
movb %al, -0x569(%rbp)
jmp 0x5276
movb -0x569(%rbp), %al
testb $0x1, %al
jne 0x5282
jmp 0x52a6
leaq -0x490(%rbp), %rdi
callq 0x3180
movb %al, -0x56a(%rbp)
jmp 0x5296
movb -0x56a(%rbp), %al
testb $0x1, %al
jne 0x53a9
jmp 0x52a6
movq -0x560(%rbp), %rdi
callq 0x5a20
jmp 0x52b4
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x3270
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x288(%rbp)
movl %eax, -0x28c(%rbp)
jmp 0x557a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x288(%rbp)
movl %eax, -0x28c(%rbp)
jmp 0x5307
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x288(%rbp)
movl %eax, -0x28c(%rbp)
leaq -0x260(%rbp), %rdi
callq 0x3140
leaq -0x280(%rbp), %rdi
callq 0x3140
jmp 0x557a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x288(%rbp)
movl %eax, -0x28c(%rbp)
jmp 0x556e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x288(%rbp)
movl %eax, -0x28c(%rbp)
jmp 0x5381
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x288(%rbp)
movl %eax, -0x28c(%rbp)
jmp 0x5375
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x288(%rbp)
movl %eax, -0x28c(%rbp)
leaq -0x4b0(%rbp), %rdi
callq 0x3140
leaq -0x4f0(%rbp), %rdi
callq 0x3140
leaq -0x4d0(%rbp), %rdi
callq 0x3140
jmp 0x556e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x288(%rbp)
movl %eax, -0x28c(%rbp)
jmp 0x5562
jmp 0x53ab
leaq -0x240(%rbp), %rdi
leaq -0x38(%rbp), %rsi
movl $0xa, %edx
callq 0x3390
movq %rax, -0x578(%rbp)
jmp 0x53c9
movq -0x578(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x32a0
movb %al, -0x579(%rbp)
jmp 0x53e7
movb -0x579(%rbp), %al
testb $0x1, %al
jne 0x53f6
jmp 0x551c
leaq 0x1d08(%rip), %rcx      # 0x7105
xorl %eax, %eax
movl %eax, %esi
leaq -0x38(%rbp), %rdi
movl $0x5, %edx
callq 0x32b0
movl %eax, -0x580(%rbp)
jmp 0x5417
movl -0x580(%rbp), %eax
cmpl $0x0, %eax
jne 0x54e9
movq -0x568(%rbp), %rsi
leaq -0x550(%rbp), %rdi
callq 0x30d0
jmp 0x543b
movq -0x560(%rbp), %rsi
leaq -0x530(%rbp), %rdi
leaq -0x550(%rbp), %rdx
callq 0x5af0
jmp 0x5457
leaq 0x1ca7(%rip), %rsi      # 0x7105
leaq -0x510(%rbp), %rdi
leaq -0x530(%rbp), %rdx
callq 0x5aa0
jmp 0x5473
leaq -0x38(%rbp), %rdi
leaq -0x510(%rbp), %rsi
callq 0x3280
leaq -0x510(%rbp), %rdi
callq 0x3140
leaq -0x530(%rbp), %rdi
callq 0x3140
leaq -0x550(%rbp), %rdi
callq 0x3140
jmp 0x54e9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x288(%rbp)
movl %eax, -0x28c(%rbp)
jmp 0x54db
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x288(%rbp)
movl %eax, -0x28c(%rbp)
leaq -0x530(%rbp), %rdi
callq 0x3140
leaq -0x550(%rbp), %rdi
callq 0x3140
jmp 0x5562
leaq -0x490(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x31e0
movq %rax, -0x588(%rbp)
jmp 0x5502
movq -0x588(%rbp), %rdi
movq 0x4ab0(%rip), %rsi      # 0x9fc0
callq 0x3220
jmp 0x5517
jmp 0x53ab
leaq -0x240(%rbp), %rdi
callq 0x3060
jmp 0x552a
leaq -0x490(%rbp), %rdi
callq 0x32d0
jmp 0x5538
leaq -0x490(%rbp), %rdi
callq 0x32f0
leaq -0x240(%rbp), %rdi
callq 0x3080
leaq -0x38(%rbp), %rdi
callq 0x3140
addq $0x590, %rsp            # imm = 0x590
popq %rbp
retq
leaq -0x490(%rbp), %rdi
callq 0x32f0
leaq -0x240(%rbp), %rdi
callq 0x3080
leaq -0x38(%rbp), %rdi
callq 0x3140
movq -0x288(%rbp), %rdi
callq 0x3350
nop