// File: /workspace/github_c_makefile_star2_O0/Astor-Bizard[P]ProjetS5_Groupe2/src/lectureSH.c
// Function: sectionFlagsTranslation
char* sectionFlagsTranslation(uint32_t flags) {
	char* flagsString = (char*) malloc(sizeof(char)*FLAG_STRING_LENGTH);
	if (flagsString==NULL) {
		printf("\nErreur lors d'allocation de flagsString.\n");
		return NULL;
	}

	int i = 0;
	if (flags&SHF_WRITE) {
		flagsString[i++] = 'W';
	}
	if (flags&SHF_ALLOC) {
		flagsString[i++] = 'A';
	}
	if (flags&SHF_EXECINSTR) {
		flagsString[i++] = 'X';
	}
	if (flags&SHF_MERGE) {
		flagsString[i++] = 'M';
	}
	if (flags&SHF_STRINGS) {
		flagsString[i++] = 'S';
	}
	if (flags&SHF_INFO_LINK) {
		flagsString[i++] = 'I';
	}
	if (flags&SHF_LINK_ORDER) {
		flagsString[i++] = 'L';
	}
	if (flags&SHF_GROUP) {
		flagsString[i++] = 'G';
	}
	if (flags&SHF_TLS) {
		flagsString[i++] = 'T';
	}
	if (flags&SHF_EXCLUDE) {
		flagsString[i++] = 'E';
	}
	if (flags&SHF_OS_NONCONFORMING) {
		flagsString[i++] = 'O';
	}
	if (flags&SHF_MASKOS) {
		flagsString[i++] = 'o';
	}
	if (flags&SHF_MASKPROC) {
		flagsString[i++] = 'p';
	}
	flagsString[i] = '\0';

	return flagsString;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0xc(%rbp)
movl $0x4, %edi
callq 0x10c0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x255b
leaq 0x34d1(%rip), %rdi      # 0x5a18
movb $0x0, %al
callq 0x1070
movq $0x0, -0x8(%rbp)
jmp 0x2731
movl $0x0, -0x1c(%rbp)
movl -0xc(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x2583
movq -0x18(%rbp), %rax
movl -0x1c(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x1c(%rbp)
movslq %ecx, %rcx
movb $0x57, (%rax,%rcx)
movl -0xc(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x25a4
movq -0x18(%rbp), %rax
movl -0x1c(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x1c(%rbp)
movslq %ecx, %rcx
movb $0x41, (%rax,%rcx)
movl -0xc(%rbp), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x25c5
movq -0x18(%rbp), %rax
movl -0x1c(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x1c(%rbp)
movslq %ecx, %rcx
movb $0x58, (%rax,%rcx)
movl -0xc(%rbp), %eax
andl $0x10, %eax
cmpl $0x0, %eax
je 0x25e6
movq -0x18(%rbp), %rax
movl -0x1c(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x1c(%rbp)
movslq %ecx, %rcx
movb $0x4d, (%rax,%rcx)
movl -0xc(%rbp), %eax
andl $0x20, %eax
cmpl $0x0, %eax
je 0x2607
movq -0x18(%rbp), %rax
movl -0x1c(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x1c(%rbp)
movslq %ecx, %rcx
movb $0x53, (%rax,%rcx)
movl -0xc(%rbp), %eax
andl $0x40, %eax
cmpl $0x0, %eax
je 0x2628
movq -0x18(%rbp), %rax
movl -0x1c(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x1c(%rbp)
movslq %ecx, %rcx
movb $0x49, (%rax,%rcx)
movl -0xc(%rbp), %eax
andl $0x80, %eax
cmpl $0x0, %eax
je 0x264b
movq -0x18(%rbp), %rax
movl -0x1c(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x1c(%rbp)
movslq %ecx, %rcx
movb $0x4c, (%rax,%rcx)
movl -0xc(%rbp), %eax
andl $0x200, %eax            # imm = 0x200
cmpl $0x0, %eax
je 0x266e
movq -0x18(%rbp), %rax
movl -0x1c(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x1c(%rbp)
movslq %ecx, %rcx
movb $0x47, (%rax,%rcx)
movl -0xc(%rbp), %eax
andl $0x400, %eax            # imm = 0x400
cmpl $0x0, %eax
je 0x2691
movq -0x18(%rbp), %rax
movl -0x1c(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x1c(%rbp)
movslq %ecx, %rcx
movb $0x54, (%rax,%rcx)
movl -0xc(%rbp), %eax
andl $0x80000000, %eax       # imm = 0x80000000
cmpl $0x0, %eax
je 0x26b4
movq -0x18(%rbp), %rax
movl -0x1c(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x1c(%rbp)
movslq %ecx, %rcx
movb $0x45, (%rax,%rcx)
movl -0xc(%rbp), %eax
andl $0x100, %eax            # imm = 0x100
cmpl $0x0, %eax
je 0x26d7
movq -0x18(%rbp), %rax
movl -0x1c(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x1c(%rbp)
movslq %ecx, %rcx
movb $0x4f, (%rax,%rcx)
movl -0xc(%rbp), %eax
andl $0xff00000, %eax        # imm = 0xFF00000
cmpl $0x0, %eax
je 0x26fa
movq -0x18(%rbp), %rax
movl -0x1c(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x1c(%rbp)
movslq %ecx, %rcx
movb $0x6f, (%rax,%rcx)
movl -0xc(%rbp), %eax
andl $0xf0000000, %eax       # imm = 0xF0000000
cmpl $0x0, %eax
je 0x271d
movq -0x18(%rbp), %rax
movl -0x1c(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x1c(%rbp)
movslq %ecx, %rcx
movb $0x70, (%rax,%rcx)
movq -0x18(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)