// File: /workspace/github_c_makefile_star2_O0/icysunlight[P]miniftpd/ftpproto.c
// Function: getfileper
void getfileper(struct stat* fbuf,char* per)
{
    switch ( fbuf->st_mode & S_IFMT )
    {
    case S_IFSOCK:
        per[0] = 's';
        break;     
    case S_IFLNK:
        per[0] = 'l';
        break;     
    case S_IFREG:
        per[0] = '-';
        break;     
    case S_IFBLK:
        per[0] = 'b';
        break;     
    case S_IFDIR:
        per[0] = 'd';
        break;     
    case S_IFCHR:
        per[0] = 'c';
        break;     
    case S_IFIFO:
        per[0] = 'p';
        break;     
    }
    
    if ( fbuf->st_mode & S_IRUSR )
        per[1] = 'r';
    if ( fbuf->st_mode & S_IRUSR )
        per[2] = 'w';
    if ( fbuf->st_mode & S_IXUSR )
        per[3] = 'x';
    if ( fbuf->st_mode & S_IRGRP )
        per[4] = 'r';
    if ( fbuf->st_mode & S_IRGRP )
        per[5] = 'w';
    if ( fbuf->st_mode & S_IXGRP )
        per[6] = 'x';
    if ( fbuf->st_mode & S_IROTH )
        per[7] = 'r';
    if ( fbuf->st_mode & S_IROTH )
        per[8] = 'w';
    if ( fbuf->st_mode & S_IXOTH )
        per[9] = 'x';

    if ( fbuf->st_mode & S_ISUID)
        per[3] = (per[3] == 'x') ? 's' : 'S';
    if ( fbuf->st_mode & S_ISGID)
        per[6] = (per[6] == 'x') ? 's' : 'S';
    if ( fbuf->st_mode & S_ISVTX)
        per[9] = (per[9] == 'x') ? 't' : 'T';
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movl 0x18(%rax), %eax
andl $0xf000, %eax           # imm = 0xF000
movl %eax, -0x14(%rbp)
subl $0x1000, %eax           # imm = 0x1000
je 0x58e6
jmp 0x5868
movl -0x14(%rbp), %eax
subl $0x2000, %eax           # imm = 0x2000
je 0x58dd
jmp 0x5874
movl -0x14(%rbp), %eax
subl $0x4000, %eax           # imm = 0x4000
je 0x58d4
jmp 0x5880
movl -0x14(%rbp), %eax
subl $0x6000, %eax           # imm = 0x6000
je 0x58cb
jmp 0x588c
movl -0x14(%rbp), %eax
subl $0x8000, %eax           # imm = 0x8000
je 0x58c2
jmp 0x5898
movl -0x14(%rbp), %eax
subl $0xa000, %eax           # imm = 0xA000
je 0x58b9
jmp 0x58a4
movl -0x14(%rbp), %eax
subl $0xc000, %eax           # imm = 0xC000
jne 0x58ed
jmp 0x58b0
movq -0x10(%rbp), %rax
movb $0x73, (%rax)
jmp 0x58ed
movq -0x10(%rbp), %rax
movb $0x6c, (%rax)
jmp 0x58ed
movq -0x10(%rbp), %rax
movb $0x2d, (%rax)
jmp 0x58ed
movq -0x10(%rbp), %rax
movb $0x62, (%rax)
jmp 0x58ed
movq -0x10(%rbp), %rax
movb $0x64, (%rax)
jmp 0x58ed
movq -0x10(%rbp), %rax
movb $0x63, (%rax)
jmp 0x58ed
movq -0x10(%rbp), %rax
movb $0x70, (%rax)
movq -0x8(%rbp), %rax
movl 0x18(%rax), %eax
andl $0x100, %eax            # imm = 0x100
cmpl $0x0, %eax
je 0x5906
movq -0x10(%rbp), %rax
movb $0x72, 0x1(%rax)
movq -0x8(%rbp), %rax
movl 0x18(%rax), %eax
andl $0x100, %eax            # imm = 0x100
cmpl $0x0, %eax
je 0x591f
movq -0x10(%rbp), %rax
movb $0x77, 0x2(%rax)
movq -0x8(%rbp), %rax
movl 0x18(%rax), %eax
andl $0x40, %eax
cmpl $0x0, %eax
je 0x5936
movq -0x10(%rbp), %rax
movb $0x78, 0x3(%rax)
movq -0x8(%rbp), %rax
movl 0x18(%rax), %eax
andl $0x20, %eax
cmpl $0x0, %eax
je 0x594d
movq -0x10(%rbp), %rax
movb $0x72, 0x4(%rax)
movq -0x8(%rbp), %rax
movl 0x18(%rax), %eax
andl $0x20, %eax
cmpl $0x0, %eax
je 0x5964
movq -0x10(%rbp), %rax
movb $0x77, 0x5(%rax)
movq -0x8(%rbp), %rax
movl 0x18(%rax), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0x597b
movq -0x10(%rbp), %rax
movb $0x78, 0x6(%rax)
movq -0x8(%rbp), %rax
movl 0x18(%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x5992
movq -0x10(%rbp), %rax
movb $0x72, 0x7(%rax)
movq -0x8(%rbp), %rax
movl 0x18(%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x59a9
movq -0x10(%rbp), %rax
movb $0x77, 0x8(%rax)
movq -0x8(%rbp), %rax
movl 0x18(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x59c0
movq -0x10(%rbp), %rax
movb $0x78, 0x9(%rax)
movq -0x8(%rbp), %rax
movl 0x18(%rax), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
je 0x59f2
movq -0x10(%rbp), %rax
movsbl 0x3(%rax), %edx
movl $0x53, %eax
movl $0x73, %ecx
cmpl $0x78, %edx
cmovel %ecx, %eax
movb %al, %cl
movq -0x10(%rbp), %rax
movb %cl, 0x3(%rax)
movq -0x8(%rbp), %rax
movl 0x18(%rax), %eax
andl $0x400, %eax            # imm = 0x400
cmpl $0x0, %eax
je 0x5a24
movq -0x10(%rbp), %rax
movsbl 0x6(%rax), %edx
movl $0x53, %eax
movl $0x73, %ecx
cmpl $0x78, %edx
cmovel %ecx, %eax
movb %al, %cl
movq -0x10(%rbp), %rax
movb %cl, 0x6(%rax)
movq -0x8(%rbp), %rax
movl 0x18(%rax), %eax
andl $0x200, %eax            # imm = 0x200
cmpl $0x0, %eax
je 0x5a56
movq -0x10(%rbp), %rax
movsbl 0x9(%rax), %edx
movl $0x54, %eax
movl $0x74, %ecx
cmpl $0x78, %edx
cmovel %ecx, %eax
movb %al, %cl
movq -0x10(%rbp), %rax
movb %cl, 0x9(%rax)
popq %rbp
retq
nopl (%rax,%rax)