// File: /workspace/github_c_makefile_star2_O1/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 %rax, %rcx
shlq $0x8, %rcx
subq %rax, %rcx
addq $0xf, %rcx
movabsq $0x1fffffffff0, %rbx    # imm = 0x1FFFFFFFFF0
andq %rcx, %rbx
movq %rsp, %r14
movq %r14, %rdx
subq %rbx, %rdx
movq %rdx, %rsp
callq 0x11ec
negq %rbx
leaq (%r14,%rbx), %rdi
addq $0xff, %rdi
leaq 0xcc3(%rip), %rsi       # 0x2004
callq 0x10c0
movq %rax, %r13
movq %rax, %rdi
callq 0x10b0
xorl %ebx, %ebx
testl %eax, %eax
jne 0x138a
xorl %ebx, %ebx
leaq -0x460(%rbp), %r14
movq %r14, %rdi
movl $0x400, %esi            # imm = 0x400
movq %r13, %rdx
callq 0x1090
movq %r13, %rdi
callq 0x10b0
testl %eax, %eax
jne 0x138a
incl %ebx
movq %r13, %rdi
callq 0x10b0
testl %eax, %eax
je 0x1360
movq %r13, %rdi
callq 0x1080
movl %ebx, %r14d
movq %rsp, %rcx
movq %r14, %rax
shlq $0xa, %rax
subq %rax, %rcx
movq %rcx, -0x38(%rbp)
movq %rcx, %rsp
movq %rbx, -0x30(%rbp)
testl %ebx, %ebx
je 0x13e6
leaq -0x460(%rbp), %r15
movq %r14, %rbx
movq -0x38(%rbp), %r12
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
decq %rbx
jne 0x13bf
movq %r14, -0x40(%rbp)
movq %r13, -0x48(%rbp)
cmpl $0x2, -0x30(%rbp)
movq -0x38(%rbp), %r13
jl 0x1492
movq -0x30(%rbp), %rax
decl %eax
movq %rax, -0x50(%rbp)
leaq 0x400(%r13), %rax
movl $0x1, %r14d
xorl %r12d, %r12d
leaq -0x860(%rbp), %r15
leaq 0x1(%r12), %rcx
movq %rcx, -0x58(%rbp)
shlq $0xa, %r12
addq %r13, %r12
movq -0x40(%rbp), %rbx
movq %rax, -0x60(%rbp)
movq %rax, %r13
movq %r12, %rdi
movq %r13, %rsi
callq 0x10a0
testl %eax, %eax
jle 0x1468
movq %r15, %rdi
movq %r12, %rsi
callq 0x1030
movq %r12, %rdi
movq %r13, %rsi
callq 0x1030
movq %r13, %rdi
movq %r15, %rsi
callq 0x1030
addq $0x400, %r13            # imm = 0x400
decq %rbx
cmpq %rbx, %r14
jne 0x1438
incq %r14
movq -0x60(%rbp), %rax
addq $0x400, %rax            # imm = 0x400
movq -0x58(%rbp), %r12
cmpq -0x50(%rbp), %r12
movq -0x38(%rbp), %r13
jne 0x141d
cmpl $0x0, -0x30(%rbp)
movq -0x48(%rbp), %rbx
movq -0x40(%rbp), %r14
je 0x14de
leaq 0xb5f(%rip), %r15       # 0x2006
movq %r13, %rdi
callq 0x1060
decl %eax
cltq
cmpb $0xa, (%r13,%rax)
jne 0x14ca
movq %r15, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x1070
jmp 0x14d2
movq %r13, %rdi
callq 0x1040
addq $0x400, %r13            # imm = 0x400
decq %r14
jne 0x14a7
movq %rbx, %rdi
callq 0x1050
xorl %eax, %eax
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq