// File: /workspace/github_c_makefile_star2_O0/bokunimowakaru[P]petit15term/lpc21isp/lpc21isp.c
// Function: ReadArguments
static void ReadArguments(ISP_ENVIRONMENT *IspEnvironment, unsigned int argc, char *argv[])
{
    unsigned int i;

    if (argc >= 5)
    {
        for (i = 1; i < argc - 3; i++)
        {
            if (stricmp(argv[i], "-wipe") == 0)
            {
                IspEnvironment->WipeDevice = 1;
                DebugPrintf(3, "Wipe entire device before writing.\n");
                continue;
            }

            if (stricmp(argv[i], "-bin") == 0)
            {
                IspEnvironment->FileFormat = FORMAT_BINARY;
                DebugPrintf(3, "Binary format file input.\n");
                continue;
            }

            if (stricmp(argv[i], "-hex") == 0)
            {
                IspEnvironment->FileFormat = FORMAT_HEX;
                DebugPrintf(3, "Hex format file input.\n");
                continue;
            }

            if (stricmp(argv[i], "-logfile") == 0)
            {
                IspEnvironment->LogFile = 1;
                DebugPrintf(3, "Log terminal output.\n");
                continue;
            }

            if (stricmp(argv[i], "-detectonly") == 0)
            {
                IspEnvironment->DetectOnly  = 1;
                IspEnvironment->ProgramChip = 0;
                DebugPrintf(3, "Only detect LPC chip part id.\n");
                continue;
            }

            if(strnicmp(argv[i],"-debug", 6) == 0)
            {
                char* num;
                num = argv[i] + 6;
                while(*num && isdigit((int)*num) == 0) num++;
                if(isdigit((int)*num) != 0) debug_level = atoi( num);
                else debug_level = 4;
                DebugPrintf(3, "Turn on debug, level: %d.\n", debug_level);
                continue;
            }
            // isdigit(*num) -> isdigit((int)*num)�ɕύX by �����j

            if (stricmp(argv[i], "-boothold") == 0)
            {
                IspEnvironment->BootHold = 1;
                DebugPrintf(3, "hold EnableBootLoader asserted throughout programming sequence.\n");
                continue;
            }

            if (stricmp(argv[i], "-donotstart") == 0)
            {
                IspEnvironment->DoNotStart = 1;
                DebugPrintf(3, "Do NOT start MCU after programming.\n");
                continue;
            }

            if(strnicmp(argv[i],"-try", 4) == 0)
            {
                int
                    retry;
                retry=atoi(&argv[i][4]);
                if(retry>0)
                {
                    IspEnvironment->nQuestionMarks=retry;
                    DebugPrintf(3, "Retry count: %d.\n", IspEnvironment->nQuestionMarks);
                }
                else
                {
                    fprintf(stderr,"invalid argument for -try: \"%s\"\n",argv[i]);
                }
                continue;
            }


            if (stricmp(argv[i], "-control") == 0)
            {
                IspEnvironment->ControlLines = 1;
                DebugPrintf(3, "Use RTS/DTR to control target state.\n");
                continue;
            }

            if (stricmp(argv[i], "-controlswap") == 0)
            {
                IspEnvironment->ControlLinesSwapped = 1;
                DebugPrintf(3, "Use RTS to control reset, and DTR to control P0.14(ISP).\n");
                continue;
            }

            if (stricmp(argv[i], "-controlinv") == 0)
            {
                IspEnvironment->ControlLinesInverted = 1;
                DebugPrintf(3, "Invert state of RTS & DTR (0=true/assert/set, 1=false/deassert/clear).\n");
                continue;
            }

            if (stricmp(argv[i], "-halfduplex") == 0)
            {
                IspEnvironment->HalfDuplex = 1;
                DebugPrintf(3, "halfduplex serial communication.\n");
                continue;
            }

            if (stricmp(argv[i], "-writedelay") == 0)
            {
                IspEnvironment->WriteDelay = 1;
                DebugPrintf(3, "Write delay enabled.\n");
                continue;
            }

            if (stricmp(argv[i], "-ADARM") == 0)
            {
                IspEnvironment->micro = ANALOG_DEVICES_ARM;
                DebugPrintf(2, "Target: Analog Devices.\n");
                continue;
            }

            if (stricmp(argv[i], "-NXPARM") == 0 || stricmp(argv[i], "-PHILIPSARM") == 0)
            {
                IspEnvironment->micro = NXP_ARM;
                DebugPrintf(2, "Target: NXP.\n");
                continue;
            }

            if (stricmp(argv[i], "-Verify") == 0)
            {
                IspEnvironment->Verify = 1;
                DebugPrintf(2, "Verify after copy RAM to Flash.\n");
                continue;
            }

#ifdef INTEGRATED_IN_WIN_APP
            if (stricmp(argv[i], "-nosync") == 0)
            {
                IspEnvironment->NoSync = 1;
                DebugPrintf(2, "Performing no syncing, already done.\n");
                continue;
            }
#endif

#ifdef TERMINAL_SUPPORT
            if (CheckTerminalParameters(IspEnvironment, argv[i]))
            {
                continue;
            }
#endif

            if(*argv[i] == '-') DebugPrintf( 2, "Unknown command line option: \"%s\"\n", argv[i]);
            else
            {
                int ret_val;
                if(IspEnvironment->FileFormat == FORMAT_HEX)
                {
                    ret_val = AddFileHex(IspEnvironment, argv[i]);
                }
                else
                {
                    ret_val = AddFileBinary(IspEnvironment, argv[i]);
                }
                if( ret_val != 0)
                {
                    DebugPrintf( 2, "Unknown command line option: \"%s\"\n", argv[i]);
                }
            }
        }

        // Newest cygwin delivers a '\x0d' at the end of argument
        // when calling lpc21isp from batch file
        for (i = 0; i < strlen(argv[argc - 1]) && i < (sizeof(IspEnvironment->StringOscillator) - 1) &&
            argv[argc - 1][i] >= '0' && argv[argc - 1][i] <= '9'; i++)
        {
            IspEnvironment->StringOscillator[i] = argv[argc - 1][i];
        }
        IspEnvironment->StringOscillator[i] = 0;

        IspEnvironment->serial_port = argv[argc - 3];
        IspEnvironment->baud_rate = argv[argc - 2];
    }

    if (argc < 5)
    {
        debug_level = (debug_level < 2) ? 2 : debug_level;
    }

    if (argc < 5)
    {
        DebugPrintf(2, "\n"
                       "Portable command line ISP\n"
                       "for NXP LPC family and Analog Devices ADUC 70xx\n"
                       "Version " VERSION_STR " compiled for " COMPILED_FOR ": " __DATE__ ", " __TIME__ "\n"
                       "Copyright (c) by Martin Maurer, 2003-2013, Email: Martin.Maurer@clibb.de\n"
                       "Portions Copyright (c) by Aeolus Development 2004, www.aeolusdevelopment.com\n"
                       "\n");

        DebugPrintf(1, "Syntax:  lpc21isp [Options] file[ file[ ...]] comport baudrate Oscillator_in_kHz\n\n"
                       "Example: lpc21isp test.hex com1 115200 14746\n\n"
                       "Options: -bin         for uploading binary file\n"
                       "         -hex         for uploading file in intel hex format (default)\n"
                       "         -term        for starting terminal after upload\n"
                       "         -termonly    for starting terminal without an upload\n"
                       "         -localecho   for local echo in terminal\n"
                       "         -detectonly  detect only used LPC chiptype (NXPARM only)\n"
                       "         -debug0      for no debug\n"
                       "         -debug3      for progress info only\n"
                       "         -debug5      for full debug\n"
                       "         -donotstart  do not start MCU after download\n"
                       "         -try<n>      try n times to synchronise\n"
                       "         -wipe        Erase entire device before upload\n"
                       "         -control     for controlling RS232 lines for easier booting\n"
                       "                      (Reset = DTR, EnableBootLoader = RTS)\n"
                       "         -boothold    hold EnableBootLoader asserted throughout sequence\n"
#ifdef INTEGRATED_IN_WIN_APP
                       "         -nosync      Do not synchronize device via '?'\n"
#endif
                       "         -controlswap swap RS232 control lines\n"
                       "                      (Reset = RTS, EnableBootLoader = DTR)\n"
                       "         -controlinv  Invert state of RTS & DTR \n"
                       "                      (0=true/assert/set, 1=false/deassert/clear).\n"
                       "         -verify      Verify the data in Flash after every writes to\n"
                       "                      sector. To detect errors in writing to Flash ROM\n"
                       "         -logfile     for enabling logging of terminal output to lpc21isp.log\n"
                       "         -halfduplex  use halfduplex serial communication (i.e. with K-Line)\n"
                       "         -writedelay  Add delay after serial port writes (for compatibility)\n"
                       "         -ADARM       for downloading to an Analog Devices\n"
                       "                      ARM microcontroller ADUC70xx\n"
                       "         -NXPARM      for downloading to a chip of NXP LPC family (default)\n");

        exit(1);
    }

    if (IspEnvironment->micro == NXP_ARM)
    {
        // If StringOscillator is bigger than 100 MHz, there seems to be something wrong
        if (strlen(IspEnvironment->StringOscillator) > 5)
        {
            DebugPrintf(1, "Invalid crystal frequency %s\n", IspEnvironment->StringOscillator);
            exit(1);
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
cmpl $0x5, -0xc(%rbp)
jb 0x5f00
movl $0x1, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movl -0xc(%rbp), %ecx
subl $0x3, %ecx
cmpl %ecx, %eax
jae 0x5e07
movq -0x18(%rbp), %rax
movl -0x1c(%rbp), %ecx
movq (%rax,%rcx,8), %rdi
leaq 0x5c52(%rip), %rsi      # 0xb489
callq 0x4380
cmpl $0x0, %eax
jne 0x5861
movq -0x8(%rbp), %rax
movb $0x1, 0x36(%rax)
movl $0x3, %edi
leaq 0x5c3a(%rip), %rsi      # 0xb48f
movb $0x0, %al
callq 0x44e0
jmp 0x5df9
movq -0x18(%rbp), %rax
movl -0x1c(%rbp), %ecx
movq (%rax,%rcx,8), %rdi
leaq 0x5c40(%rip), %rsi      # 0xb4b3
callq 0x4380
cmpl $0x0, %eax
jne 0x58a0
movq -0x8(%rbp), %rax
movl $0x0, 0x4(%rax)
movl $0x3, %edi
leaq 0x5c24(%rip), %rsi      # 0xb4b8
movb $0x0, %al
callq 0x44e0
jmp 0x5df9
movq -0x18(%rbp), %rax
movl -0x1c(%rbp), %ecx
movq (%rax,%rcx,8), %rdi
leaq 0x5c21(%rip), %rsi      # 0xb4d3
callq 0x4380
cmpl $0x0, %eax
jne 0x58df
movq -0x8(%rbp), %rax
movl $0x1, 0x4(%rax)
movl $0x3, %edi
leaq 0x5c05(%rip), %rsi      # 0xb4d8
movb $0x0, %al
callq 0x44e0
jmp 0x5df9
movq -0x18(%rbp), %rax
movl -0x1c(%rbp), %ecx
movq (%rax,%rcx,8), %rdi
leaq 0x5bff(%rip), %rsi      # 0xb4f0
callq 0x4380
cmpl $0x0, %eax
jne 0x591b
movq -0x8(%rbp), %rax
movb $0x1, 0xc(%rax)
movl $0x3, %edi
leaq 0x5bea(%rip), %rsi      # 0xb4f9
movb $0x0, %al
callq 0x44e0
jmp 0x5df9
movq -0x18(%rbp), %rax
movl -0x1c(%rbp), %ecx
movq (%rax,%rcx,8), %rdi
leaq 0x5be2(%rip), %rsi      # 0xb50f
callq 0x4380
cmpl $0x0, %eax
jne 0x595f
movq -0x8(%rbp), %rax
movb $0x1, 0x35(%rax)
movq -0x8(%rbp), %rax
movb $0x0, 0x8(%rax)
movl $0x3, %edi
leaq 0x5bc8(%rip), %rsi      # 0xb51b
movb $0x0, %al
callq 0x44e0
jmp 0x5df9
movq -0x18(%rbp), %rax
movl -0x1c(%rbp), %ecx
movq (%rax,%rcx,8), %rdi
leaq 0x5bc9(%rip), %rsi      # 0xb53a
movl $0x6, %edx
callq 0x43b0
cmpl $0x0, %eax
jne 0x5a3c
movq -0x18(%rbp), %rax
movl -0x1c(%rbp), %ecx
movq (%rax,%rcx,8), %rax
addq $0x6, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x31(%rbp)
je 0x59cc
callq 0x4260
movq (%rax), %rax
movq -0x28(%rbp), %rcx
movsbl (%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
sete %al
movb %al, -0x31(%rbp)
movb -0x31(%rbp), %al
testb $0x1, %al
jne 0x59d5
jmp 0x59e3
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x5997
callq 0x4260
movq (%rax), %rax
movq -0x28(%rbp), %rcx
movsbl (%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
je 0x5a14
movq -0x28(%rbp), %rdi
callq 0x4230
movl %eax, 0xa73e(%rip)      # 0x10150
jmp 0x5a1e
movl $0x4, 0xa732(%rip)      # 0x10150
movl 0xa72c(%rip), %edx      # 0x10150
movl $0x3, %edi
leaq 0x5b11(%rip), %rsi      # 0xb541
movb $0x0, %al
callq 0x44e0
jmp 0x5df9
movq -0x18(%rbp), %rax
movl -0x1c(%rbp), %ecx
movq (%rax,%rcx,8), %rdi
leaq 0x5b0e(%rip), %rsi      # 0xb55c
callq 0x4380
cmpl $0x0, %eax
jne 0x5a7b
movq -0x8(%rbp), %rax
movl $0x1, 0x20(%rax)
movl $0x3, %edi
leaq 0x5af7(%rip), %rsi      # 0xb566
movb $0x0, %al
callq 0x44e0
jmp 0x5df9
movq -0x18(%rbp), %rax
movl -0x1c(%rbp), %ecx
movq (%rax,%rcx,8), %rdi
leaq 0x5b1a(%rip), %rsi      # 0xb5a7
callq 0x4380
cmpl $0x0, %eax
jne 0x5aba
movq -0x8(%rbp), %rax
movl $0x1, 0x1c(%rax)
movl $0x3, %edi
leaq 0x5b05(%rip), %rsi      # 0xb5b3
movb $0x0, %al
callq 0x44e0
jmp 0x5df9
movq -0x18(%rbp), %rax
movl -0x1c(%rbp), %ecx
movq (%rax,%rcx,8), %rdi
leaq 0x5b0c(%rip), %rsi      # 0xb5d8
movl $0x4, %edx
callq 0x43b0
cmpl $0x0, %eax
jne 0x5b46
movq -0x18(%rbp), %rax
movl -0x1c(%rbp), %ecx
movq (%rax,%rcx,8), %rdi
addq $0x4, %rdi
callq 0x4230
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
jle 0x5b1e
movl -0x2c(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x18(%rax)
movq -0x8(%rbp), %rax
movl 0x18(%rax), %edx
movl $0x3, %edi
leaq 0x5ac8(%rip), %rsi      # 0xb5dd
movb $0x0, %al
callq 0x44e0
jmp 0x5b41
movq 0xa4d3(%rip), %rax      # 0xfff8
movq (%rax), %rdi
movq -0x18(%rbp), %rax
movl -0x1c(%rbp), %ecx
movq (%rax,%rcx,8), %rdx
leaq 0x5ab5(%rip), %rsi      # 0xb5ef
movb $0x0, %al
callq 0x4140
jmp 0x5df9
movq -0x18(%rbp), %rax
movl -0x1c(%rbp), %ecx
movq (%rax,%rcx,8), %rdi
leaq 0x5ab8(%rip), %rsi      # 0xb610
callq 0x4380
cmpl $0x0, %eax
jne 0x5b82
movq -0x8(%rbp), %rax
movb $0x1, 0x9(%rax)
movl $0x3, %edi
leaq 0x5aa3(%rip), %rsi      # 0xb619
movb $0x0, %al
callq 0x44e0
jmp 0x5df9
movq -0x18(%rbp), %rax
movl -0x1c(%rbp), %ecx
movq (%rax,%rcx,8), %rdi
leaq 0x5aab(%rip), %rsi      # 0xb63f
callq 0x4380
cmpl $0x0, %eax
jne 0x5bbe
movq -0x8(%rbp), %rax
movb $0x1, 0xa(%rax)
movl $0x3, %edi
leaq 0x5a9a(%rip), %rsi      # 0xb64c
movb $0x0, %al
callq 0x44e0
jmp 0x5df9
movq -0x18(%rbp), %rax
movl -0x1c(%rbp), %ecx
movq (%rax,%rcx,8), %rdi
leaq 0x5ab6(%rip), %rsi      # 0xb686
callq 0x4380
cmpl $0x0, %eax
jne 0x5bfa
movq -0x8(%rbp), %rax
movb $0x1, 0xb(%rax)
movl $0x3, %edi
leaq 0x5aa4(%rip), %rsi      # 0xb692
movb $0x0, %al
callq 0x44e0
jmp 0x5df9
movq -0x18(%rbp), %rax
movl -0x1c(%rbp), %ecx
movq (%rax,%rcx,8), %rdi
leaq 0x5ace(%rip), %rsi      # 0xb6da
callq 0x4380
cmpl $0x0, %eax
jne 0x5c36
movq -0x8(%rbp), %rax
movb $0x1, 0x33(%rax)
movl $0x3, %edi
leaq 0x5abc(%rip), %rsi      # 0xb6e6
movb $0x0, %al
callq 0x44e0
jmp 0x5df9
movq -0x18(%rbp), %rax
movl -0x1c(%rbp), %ecx
movq (%rax,%rcx,8), %rdi
leaq 0x5ac0(%rip), %rsi      # 0xb708
callq 0x4380
cmpl $0x0, %eax
jne 0x5c72
movq -0x8(%rbp), %rax
movb $0x1, 0x34(%rax)
movl $0x3, %edi
leaq 0x5aae(%rip), %rsi      # 0xb714
movb $0x0, %al
callq 0x44e0
jmp 0x5df9
movq -0x18(%rbp), %rax
movl -0x1c(%rbp), %ecx
movq (%rax,%rcx,8), %rdi
leaq 0x5aa6(%rip), %rsi      # 0xb72a
callq 0x4380
cmpl $0x0, %eax
jne 0x5cb0
movq -0x8(%rbp), %rax
movl $0x1, (%rax)
movl $0x2, %edi
leaq 0x5a8d(%rip), %rsi      # 0xb731
movb $0x0, %al
callq 0x44e0
jmp 0x5df9
movq -0x18(%rbp), %rax
movl -0x1c(%rbp), %ecx
movq (%rax,%rcx,8), %rdi
leaq 0x5a88(%rip), %rsi      # 0xb74a
callq 0x4380
cmpl $0x0, %eax
je 0x5ce8
movq -0x18(%rbp), %rax
movl -0x1c(%rbp), %ecx
movq (%rax,%rcx,8), %rdi
leaq 0x5a74(%rip), %rsi      # 0xb752
callq 0x4380
cmpl $0x0, %eax
jne 0x5d0a
movq -0x8(%rbp), %rax
movl $0x0, (%rax)
movl $0x2, %edi
leaq 0x5a60(%rip), %rsi      # 0xb75e
movb $0x0, %al
callq 0x44e0
jmp 0x5df9
movq -0x18(%rbp), %rax
movl -0x1c(%rbp), %ecx
movq (%rax,%rcx,8), %rdi
leaq 0x5a50(%rip), %rsi      # 0xb76c
callq 0x4380
cmpl $0x0, %eax
jne 0x5d46
movq -0x8(%rbp), %rax
movb $0x1, 0x37(%rax)
movl $0x2, %edi
leaq 0x5a3a(%rip), %rsi      # 0xb774
movb $0x0, %al
callq 0x44e0
jmp 0x5df9
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movl -0x1c(%rbp), %ecx
movq (%rax,%rcx,8), %rsi
callq 0xab50
cmpl $0x0, %eax
je 0x5d64
jmp 0x5df9
movq -0x18(%rbp), %rax
movl -0x1c(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
jne 0x5d97
movq -0x18(%rbp), %rax
movl -0x1c(%rbp), %ecx
movq (%rax,%rcx,8), %rdx
movl $0x2, %edi
leaq 0x5a07(%rip), %rsi      # 0xb795
movb $0x0, %al
callq 0x44e0
jmp 0x5df7
movq -0x8(%rbp), %rax
cmpl $0x1, 0x4(%rax)
jne 0x5dba
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movl -0x1c(%rbp), %ecx
movq (%rax,%rcx,8), %rsi
callq 0x6ae0
movl %eax, -0x30(%rbp)
jmp 0x5dd1
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movl -0x1c(%rbp), %ecx
movq (%rax,%rcx,8), %rsi
callq 0x6b70
movl %eax, -0x30(%rbp)
cmpl $0x0, -0x30(%rbp)
je 0x5df5
movq -0x18(%rbp), %rax
movl -0x1c(%rbp), %ecx
movq (%rax,%rcx,8), %rdx
movl $0x2, %edi
leaq 0x59a7(%rip), %rsi      # 0xb795
movb $0x0, %al
callq 0x44e0
jmp 0x5df7
jmp 0x5df9
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x5814
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movq %rax, -0x40(%rbp)
movq -0x18(%rbp), %rax
movl -0xc(%rbp), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rdi
callq 0x40a0
movq -0x40(%rbp), %rcx
movq %rax, %rdx
xorl %eax, %eax
cmpq %rdx, %rcx
movb %al, -0x32(%rbp)
jae 0x5e8c
movl -0x1c(%rbp), %eax
movl %eax, %ecx
xorl %eax, %eax
cmpq $0x5, %rcx
movb %al, -0x32(%rbp)
jae 0x5e8c
movq -0x18(%rbp), %rax
movl -0xc(%rbp), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
movl -0x1c(%rbp), %ecx
movsbl (%rax,%rcx), %ecx
xorl %eax, %eax
cmpl $0x30, %ecx
movb %al, -0x32(%rbp)
jl 0x5e8c
movq -0x18(%rbp), %rax
movl -0xc(%rbp), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
movl -0x1c(%rbp), %ecx
movsbl (%rax,%rcx), %eax
cmpl $0x39, %eax
setle %al
movb %al, -0x32(%rbp)
movb -0x32(%rbp), %al
testb $0x1, %al
jne 0x5e95
jmp 0x5ec4
movq -0x18(%rbp), %rax
movl -0xc(%rbp), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
movl -0x1c(%rbp), %ecx
movb (%rax,%rcx), %dl
movq -0x8(%rbp), %rax
movl -0x1c(%rbp), %ecx
movb %dl, 0x48(%rax,%rcx)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x5e0e
movq -0x8(%rbp), %rax
movl -0x1c(%rbp), %ecx
movb $0x0, 0x48(%rax,%rcx)
movq -0x18(%rbp), %rax
movl -0xc(%rbp), %ecx
subl $0x3, %ecx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x18(%rbp), %rax
movl -0xc(%rbp), %ecx
subl $0x2, %ecx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x40(%rax)
cmpl $0x5, -0xc(%rbp)
jae 0x5f2b
cmpl $0x2, 0xa243(%rip)      # 0x10150
jge 0x5f19
movl $0x2, %eax
movl %eax, -0x44(%rbp)
jmp 0x5f22
movl 0xa231(%rip), %eax      # 0x10150
movl %eax, -0x44(%rbp)
movl -0x44(%rbp), %eax
movl %eax, 0xa225(%rip)      # 0x10150
cmpl $0x5, -0xc(%rbp)
jae 0x5f61
movl $0x2, %edi
leaq 0x587b(%rip), %rsi      # 0xb7b8
movb $0x0, %al
callq 0x44e0
movl $0x1, %edi
leaq 0x5982(%rip), %rsi      # 0xb8d2
movb $0x0, %al
callq 0x44e0
movl $0x1, %edi
callq 0x4250
movq -0x8(%rbp), %rax
cmpl $0x0, (%rax)
jne 0x5fa4
movq -0x8(%rbp), %rdi
addq $0x48, %rdi
callq 0x40a0
cmpq $0x5, %rax
jbe 0x5fa2
movq -0x8(%rbp), %rdx
addq $0x48, %rdx
movl $0x1, %edi
leaq 0x600e(%rip), %rsi      # 0xbf9f
movb $0x0, %al
callq 0x44e0
movl $0x1, %edi
callq 0x4250
jmp 0x5fa4
addq $0x50, %rsp
popq %rbp
retq
nopw (%rax,%rax)