// File: /workspace/github_c_makefile_star2_O2/CSerxzm[P]WindowstoLinuxInterface/src/SORT.c
// Function: main
int main(int argc, char** argv) 
{   
    char lines[argc+1][255];
    predealLine(argc, argv, lines);
    char* srcname = lines[1];
    FILE* src = fopen(srcname, "r");
    char fileLine[1024]; 
    int lineCnt = 0;
    while(!feof(src)) {
        fgets(fileLine, 1024, src);
        if(feof(src)) {
            break;
        }
        lineCnt++;
    }
    int i, j;
    rewind(src);
    char fileLineList[lineCnt][1024], temp[1024];
    for(i = 0; i < lineCnt; i++) {
        fgets(fileLine, 1024, src);
        strcpy(fileLineList[i], fileLine);
    }
    for(i = 0; i < lineCnt-1; ++i) {
        for(j = i+1; j < lineCnt; ++j) {
            if(strcmp(fileLineList[i], fileLineList[j])>0) {
                strcpy(temp, fileLineList[i]);
                strcpy(fileLineList[i], fileLineList[j]);
                strcpy(fileLineList[j], temp);
            }
        }
    }
    for(i = 0; i < lineCnt; i++) {
        int len = strlen(fileLineList[i]);
        if(fileLineList[i][len-1] == '\n')
            printf("%s", fileLineList[i]);
        else
            printf("%s\n", fileLineList[i]);
    }

    fclose(src);
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x838, %rsp            # imm = 0x838
leal 0x1(%rdi), %eax
movq %rsp, %rbx
imulq $0xff, %rax, %rax
addq $0xf, %rax
andq $-0x10, %rax
subq %rax, %rbx
movq %rbx, %rsp
movq %rbx, %rdx
callq 0x11ec
addq $0xff, %rbx
leaq 0xcfb(%rip), %rsi       # 0x2004
movq %rbx, %rdi
callq 0x10c0
movq %rax, %r13
xorl %ebx, %ebx
leaq -0x460(%rbp), %r14
movq %r13, %rdi
callq 0x10b0
testl %eax, %eax
jne 0x134a
movq %r14, %rdi
movl $0x400, %esi            # imm = 0x400
movq %r13, %rdx
callq 0x1090
movq %r13, %rdi
callq 0x10b0
testl %eax, %eax
jne 0x134a
incq %rbx
jmp 0x131d
movq %r13, %rdi
callq 0x1080
movq %rsp, %r12
movq %rbx, %rax
shlq $0xa, %rax
subq %rax, %r12
movq %r12, %rsp
leaq -0x460(%rbp), %r15
movq %r12, -0x30(%rbp)
movq %rbx, %r14
subq $0x1, %r14
jb 0x139a
movq %r15, %rdi
movl $0x400, %esi            # imm = 0x400
movq %r13, %rdx
callq 0x1090
movq %r12, %rdi
movq %r15, %rsi
callq 0x1030
addq $0x400, %r12            # imm = 0x400
jmp 0x1370
leaq -0x1(%rbx), %rax
movq %rax, -0x50(%rbp)
movq -0x30(%rbp), %r14
leaq 0x400(%r14), %rax
movq %rax, -0x40(%rbp)
pushq $0x1
popq %rax
movq %rax, -0x38(%rbp)
xorl %r12d, %r12d
leaq -0x860(%rbp), %r15
movq %r13, -0x48(%rbp)
cmpq -0x50(%rbp), %r12
jge 0x143d
movq %r12, -0x58(%rbp)
shlq $0xa, %r12
addq %r14, %r12
movq -0x40(%rbp), %r13
movq -0x38(%rbp), %r14
cmpq %rbx, %r14
jae 0x1420
movq %r12, %rdi
movq %r13, %rsi
callq 0x10a0
testl %eax, %eax
jle 0x1414
movq %r15, %rdi
movq %r12, %rsi
callq 0x1030
movq %r12, %rdi
movq %r13, %rsi
callq 0x1030
movq %r13, %rdi
movq %r15, %rsi
callq 0x1030
incq %r14
addq $0x400, %r13            # imm = 0x400
jmp 0x13df
movq -0x58(%rbp), %r12
incq %r12
incq -0x38(%rbp)
addq $0x400, -0x40(%rbp)     # imm = 0x400
movq -0x48(%rbp), %r13
movq -0x30(%rbp), %r14
jmp 0x13c6
leaq 0xbc2(%rip), %r15       # 0x2006
subq $0x1, %rbx
jb 0x147d
movq %r14, %rdi
callq 0x1060
decl %eax
cltq
cmpb $0xa, (%r14,%rax)
jne 0x146c
movq %r15, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x1070
jmp 0x1474
movq %r14, %rdi
callq 0x1040
addq $0x400, %r14            # imm = 0x400
jmp 0x1444
movq %r13, %rdi
callq 0x1050
xorl %eax, %eax
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq