LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/cram/cram_codecs.c
// Function: cram_byte_array_stop_encode
int cram_byte_array_stop_encode(cram_slice *slice, cram_codec *c,
                                char *in, int in_size) {
    BLOCK_APPEND(c->out, in, in_size);
    BLOCK_APPEND_CHAR(c->out, c->u.e_byte_array_stop.stop);
    return 0;

 block_err:
    return -1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebp
movq %rdx, %r15
movq %rsi, %rbx
movq 0x8(%rsi), %r13
movslq %ecx, %r14
movq 0x30(%r13), %r12
addq %r14, %r12
movq 0x28(%r13), %rax
cmpq %r12, %rax
ja 0x9255d
leaq 0x320(%rax), %rcx
shrq $0x2, %rcx
addq %rcx, %rax
addq $0x320, %rax            # imm = 0x320
cmpq %r12, %rax
cmovaq %rax, %r12
movq 0x20(%r13), %rdi
movq %r12, %rsi
callq 0x4840
testq %rax, %rax
je 0x925df
movq %r12, 0x28(%r13)
movq %rax, 0x20(%r13)
testl %ebp, %ebp
je 0x92578
movq 0x20(%r13), %rdi
addq 0x30(%r13), %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x43c0
addq %r14, 0x30(%r13)
movq 0x8(%rbx), %r14
movb 0x60(%rbx), %bpl
movq 0x28(%r14), %rax
movq 0x30(%r14), %rcx
leaq 0x1(%rcx), %rbx
cmpq %rbx, %rax
jbe 0x92597
movq 0x20(%r14), %rax
jmp 0x925d3
leaq 0x320(%rax), %rcx
shrq $0x2, %rcx
addq %rcx, %rax
addq $0x320, %rax            # imm = 0x320
cmpq %rbx, %rax
cmovaq %rax, %rbx
movq 0x20(%r14), %rdi
movq %rbx, %rsi
callq 0x4840
testq %rax, %rax
je 0x925df
movq %rbx, 0x28(%r14)
movq %rax, 0x20(%r14)
movq 0x30(%r14), %rcx
leaq 0x1(%rcx), %rbx
movq %rbx, 0x30(%r14)
movb %bpl, (%rax,%rcx)
xorl %eax, %eax
jmp 0x925e4
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/cram/cram_codecs.c
// Function: cram_byte_array_stop_encode_init
cram_codec *cram_byte_array_stop_encode_init(cram_stats *st,
                                             enum cram_encoding codec,
                                             enum cram_external_type option,
                                             void *dat,
                                             int version, varint_vec *vv) {
    cram_codec *c;

    c = malloc(sizeof(*c));
    if (!c)
        return NULL;
    c->codec = E_BYTE_ARRAY_STOP;
    c->free = cram_byte_array_stop_encode_free;
    c->encode = cram_byte_array_stop_encode;
    c->store = cram_byte_array_stop_encode_store;
    c->flush = NULL;

    c->u.e_byte_array_stop.stop = ((int *)dat)[0];
    c->u.e_byte_array_stop.content_id = ((int *)dat)[1];

    return c;
}

// Assembly:
pushq %rbx
movq %rcx, %rbx
movl $0x880, %edi            # imm = 0x880
callq 0x4680
testq %rax, %rax
je 0x92815
movl $0x5, (%rax)
leaq -0x1f5(%rip), %rcx      # 0x925f3
movq %rcx, 0x20(%rax)
leaq -0x2f8(%rip), %rcx      # 0x924fb
movq %rcx, 0x30(%rax)
leaq -0x201(%rip), %rcx      # 0x925fd
movq %rcx, 0x38(%rax)
movq $0x0, 0x48(%rax)
movb (%rbx), %cl
movb %cl, 0x60(%rax)
movl 0x4(%rbx), %ecx
movl %ecx, 0x64(%rax)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/cram/cram_codecs.c
// Function: cram_encoding2str
const char *cram_encoding2str(enum cram_encoding t) {
    switch (t) {
    case E_NULL:            return "NULL";
    case E_EXTERNAL:        return "EXTERNAL";
    case E_GOLOMB:          return "GOLOMB";
    case E_HUFFMAN:         return "HUFFMAN";
    case E_BYTE_ARRAY_LEN:  return "BYTE_ARRAY_LEN";
    case E_BYTE_ARRAY_STOP: return "BYTE_ARRAY_STOP";
    case E_BETA:            return "BETA";
    case E_SUBEXP:          return "SUBEXP";
    case E_GOLOMB_RICE:     return "GOLOMB_RICE";
    case E_GAMMA:           return "GAMMA";

    case E_VARINT_UNSIGNED: return "VARINT_UNSIGNED";
    case E_VARINT_SIGNED:   return "VARINT_SIGNED";
    case E_CONST_BYTE:      return "CONST_BYTE";
    case E_CONST_INT:       return "CONST_INT";

    case E_NUM_CODECS:
    default:                return "?";
    }
}

// Assembly:
cmpl $0x9, %edi
ja 0x92836
movl %edi, %eax
leaq 0x1005f(%rip), %rcx     # 0xa2884
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x4051(%rip), %rax      # 0x96886
retq
addl $-0x29, %edi
cmpl $0x3, %edi
ja 0x928b6
leaq 0x10067(%rip), %rax     # 0xa28ac
movslq (%rax,%rdi,4), %rcx
addq %rax, %rcx
jmpq *%rcx
leaq 0x10781(%rip), %rax     # 0xa2fd6
retq
leaq 0x1073c(%rip), %rax     # 0xa2f99
retq
leaq 0x1076b(%rip), %rax     # 0xa2fd0
retq
leaq 0x1071d(%rip), %rax     # 0xa2f8a
retq
leaq 0x1077f(%rip), %rax     # 0xa2ff4
retq
leaq 0x10714(%rip), %rax     # 0xa2f91
retq
leaq 0x10738(%rip), %rax     # 0xa2fbd
retq
leaq 0x8782(%rip), %rax      # 0x9b00f
retq
leaq 0x1076a(%rip), %rax     # 0xa2fff
retq
leaq 0x10749(%rip), %rax     # 0xa2fe6
retq
leaq 0x10703(%rip), %rax     # 0xa2fa8
retq
leaq 0x1070b(%rip), %rax     # 0xa2fb8
retq
leaq 0x1070f(%rip), %rax     # 0xa2fc4
retq
leaq 0x5742(%rip), %rax      # 0x97fff
retq
// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/cram/cram_codecs.c
// Function: cram_codec_to_id
int cram_codec_to_id(cram_codec *c, int *id2) {
    int bnum1, bnum2 = -2;

    switch (c->codec) {
    case E_CONST_INT:
    case E_CONST_BYTE:
        bnum1 = -2; // no blocks used
        break;

    case E_HUFFMAN:
        bnum1 = c->u.huffman.ncodes == 1 ? -2 : -1;
        break;

    case E_GOLOMB:
    case E_BETA:
    case E_SUBEXP:
    case E_GOLOMB_RICE:
    case E_GAMMA:
        // CORE block
        bnum1 = -1;
        break;

    case E_EXTERNAL:
    case E_VARINT_UNSIGNED:
    case E_VARINT_SIGNED:
        bnum1 = c->u.external.content_id;
        break;

    case E_BYTE_ARRAY_LEN:
        bnum1 = cram_codec_to_id(c->u.byte_array_len.len_codec, NULL);
        bnum2 = cram_codec_to_id(c->u.byte_array_len.val_codec, NULL);
        break;

    case E_BYTE_ARRAY_STOP:
        bnum1 = c->u.byte_array_stop.content_id;
        break;

    case E_NULL:
        bnum1 = -2;
        break;

    default:
        hts_log_error("Unknown codec type %d", c->codec);
        bnum1 = -1;
    }

    if (id2)
        *id2 = bnum2;
    return bnum1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r15
movl (%rdi), %ecx
movl $0xfffffffe, %ebp       # imm = 0xFFFFFFFE
cmpq $0x9, %rcx
ja 0x928f0
leaq 0xffdd(%rip), %rax      # 0xa28bc
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
jmp 0x92940
leal -0x29(%rcx), %eax
cmpl $0x2, %eax
jb 0x92908
leal -0x2b(%rcx), %eax
cmpl $0x2, %eax
jae 0x92955
movl $0xfffffffe, %r14d      # imm = 0xFFFFFFFE
jmp 0x92940
movl 0x60(%r15), %r14d
jmp 0x92940
movl 0x64(%r15), %r14d
jmp 0x92940
xorl %r14d, %r14d
cmpl $0x1, 0x60(%r15)
sete %r14b
notl %r14d
jmp 0x92940
movq 0x60(%r15), %rdi
xorl %esi, %esi
callq 0x928be
movl %eax, %r14d
movq 0x68(%r15), %rdi
xorl %esi, %esi
callq 0x928be
movl %eax, %ebp
testq %rbx, %rbx
je 0x92947
movl %ebp, (%rbx)
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x10716(%rip), %rsi     # 0xa3072
leaq 0x10720(%rip), %rdx     # 0xa3083
movl $0x1, %edi
xorl %eax, %eax
callq 0x13de5
jmp 0x928e8
// File: /workspace/github_c_makefile_star2_O3/vampirefrog[P]x68ksjis/sjis2utf8.c
// Function: main
int main(int argc, char **argv) {
	FILE *in = stdin, *out = stdout;
	if(argc > 1) in = fopen(argv[1], "rb");
	if(argc > 2) out = fopen(argv[2], "wb");

	int last_byte = 0;
	int b = 0;
	while((b = sjis_fgetc(in)) != EOF) {
		if(b == -2) fprintf(stderr, "Invalid char found at %d\n", ftell(in));
		utf8_fputc(sjis_char_to_unicode(b), out);
	}

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq 0x15df6(%rip), %rax     # 0x16fd0
movq (%rax), %rbx
cmpl $0x2, %edi
jl 0x1214
movq %rsi, %r15
movl %edi, %ebp
movq 0x8(%rsi), %rdi
leaq 0x1e12(%rip), %rsi      # 0x3004
callq 0x1080
movq %rax, %r14
cmpl $0x2, %ebp
je 0x121e
movq 0x10(%r15), %rdi
leaq 0x1dfd(%rip), %rsi      # 0x3007
callq 0x1080
movq %rax, %rbx
jmp 0x121e
movq 0x15dbd(%rip), %rax     # 0x16fd8
movq (%rax), %r14
movq %r14, %rdi
callq 0x1499
movl %eax, %ebp
cmpl $-0x2, %eax
je 0x1246
cmpl $-0x1, %ebp
je 0x1250
movzwl %bp, %edi
callq 0x1610
movl %eax, %edi
movq %rbx, %rsi
callq 0x26bb
jmp 0x121e
movq %r14, %rdi
callq 0x10b0
jmp 0x1232
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/Astor-Bizard[P]ProjetS5_Groupe2/src/lecture_headers.c
// Function: lire_octets
long long int lire_octets(char mode, FILE *f, int nb_octet)
{
	int i;
	long long int retour = 0;
	for(i=0 ; i<nb_octet;i++)
	{
		if(mode == B_ENDIAN) 
		{
			retour = (retour << 8) | fgetc(f);			
		}
		else if (mode == L_ENDIAN)
		{
			
			retour = retour | (fgetc(f) << 8*i);
		}
	}
	return retour;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
xorl %r15d, %r15d
testl %edx, %edx
jle 0x16db
movl %edx, %ebx
movq %rsi, %r14
movsbl %dil, %ebp
xorl %r12d, %r12d
cmpl $0x1, %ebp
je 0x16bf
cmpl $0x2, %ebp
jne 0x16d1
shlq $0x8, %r12
movq %r14, %rdi
callq 0x10a0
jmp 0x16cc
movq %r14, %rdi
callq 0x10a0
movl %r15d, %ecx
shll %cl, %eax
cltq
orq %rax, %r12
addl $0x8, %r15d
decl %ebx
jne 0x16a7
jmp 0x16de
xorl %r12d, %r12d
movq %r12, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/Astor-Bizard[P]ProjetS5_Groupe2/src/lectureSH.c
// Function: fetchSectionNames
char* fetchSectionNames(FILE* f, Elf32_Ehdr elfHeader, SectionsHeadersList shList) {
	int i;

	char* names = (char*) malloc(sizeof(char)*shList.headers[elfHeader.e_shstrndx].sh_size);
	if (names==NULL) {
		printf("\nErreur lors de l'allocation initiale de la table des noms.\n");
		return NULL;
	}

	fseek(f, shList.headers[elfHeader.e_shstrndx].sh_offset, 0);
	for(i=0; i<shList.headers[elfHeader.e_shstrndx].sh_size; i++)
		names[i] = fgetc(f);
	
	return names;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x68(%rsp), %r15
movzwl 0x62(%rsp), %eax
leaq (%rax,%rax,4), %r12
movl 0x14(%r15,%r12,8), %edi
callq 0x10d0
movq %rax, %r14
testq %rax, %rax
je 0x1dc7
leaq (%r15,%r12,8), %r15
addq $0x14, %r15
movl -0x4(%r15), %esi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x10e0
cmpl $0x0, (%r15)
je 0x1dd3
xorl %r12d, %r12d
movq %rbx, %rdi
callq 0x10a0
movb %al, (%r14,%r12)
incq %r12
movl (%r15), %eax
cmpq %rax, %r12
jb 0x1dae
jmp 0x1dd3
leaq 0x2bbf(%rip), %rdi      # 0x498d
callq 0x1060
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/Astor-Bizard[P]ProjetS5_Groupe2/src/lectureSH.c
// Function: getSectionName
char* getSectionName(char* names, uint32_t sh_name) {
	int i = 0;

	while(names[sh_name+i] != '\0')
		i++;
	i++;

	char* sectionName = (char*) malloc(sizeof(char)*i);
	if (names==NULL) {
		printf("\nErreur lors de l'allocation initiale d'un nom de section.\n");
		return NULL;
	}

	i = 0;
	while(names[sh_name+i] != '\0') {
		sectionName[i] = names[sh_name+i];
		i++;
	}
	sectionName[i] = '\0';

	return sectionName;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
movl %esi, %r15d
xorl %eax, %eax
leal (%r15,%rax), %ecx
incq %rax
cmpb $0x0, (%r14,%rcx)
jne 0x1df1
movl %eax, %edi
callq 0x10d0
movb (%r14,%r15), %cl
testb %cl, %cl
je 0x1e29
incl %ebx
xorl %edx, %edx
movq %rdx, %rsi
movb %cl, (%rax,%rdx)
incq %rdx
addl %ebx, %esi
movb (%r14,%rsi), %cl
testb %cl, %cl
jne 0x1e12
movl %edx, %ecx
jmp 0x1e2b
xorl %ecx, %ecx
movb $0x0, (%rax,%rcx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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
pushq %rbx
pushq %rax
movl %edi, %ebp
movl $0x4, %edi
callq 0x10d0
movq %rax, %rbx
testq %rax, %rax
je 0x1f1a
xorl %eax, %eax
testb $0x1, %bpl
je 0x1e69
movb $0x57, (%rbx)
movl $0x1, %eax
testb $0x2, %bpl
je 0x1e77
movl %eax, %ecx
incl %eax
movb $0x41, (%rbx,%rcx)
testb $0x4, %bpl
je 0x1e85
movl %eax, %ecx
incl %eax
movb $0x58, (%rbx,%rcx)
testb $0x10, %bpl
je 0x1e93
movl %eax, %ecx
incl %eax
movb $0x4d, (%rbx,%rcx)
testb $0x20, %bpl
je 0x1ea1
movl %eax, %ecx
incl %eax
movb $0x53, (%rbx,%rcx)
testb $0x40, %bpl
je 0x1eaf
movl %eax, %ecx
incl %eax
movb $0x49, (%rbx,%rcx)
testb %bpl, %bpl
jns 0x1ebc
movl %eax, %ecx
incl %eax
movb $0x4c, (%rbx,%rcx)
btl $0x9, %ebp
jae 0x1eca
movl %eax, %ecx
incl %eax
movb $0x47, (%rbx,%rcx)
btl $0xa, %ebp
jae 0x1ed8
movl %eax, %ecx
incl %eax
movb $0x54, (%rbx,%rcx)
testl %ebp, %ebp
jns 0x1ee4
movl %eax, %ecx
incl %eax
movb $0x45, (%rbx,%rcx)
btl $0x8, %ebp
jae 0x1ef2
movl %eax, %ecx
incl %eax
movb $0x4f, (%rbx,%rcx)
testl $0xff00000, %ebp        # imm = 0xFF00000
je 0x1f02
movl %eax, %ecx
incl %eax
movb $0x6f, (%rbx,%rcx)
cmpl $0x10000000, %ebp       # imm = 0x10000000
jb 0x1f12
movl %eax, %ecx
incl %eax
movb $0x70, (%rbx,%rcx)
movl %eax, %eax
movb $0x0, (%rbx,%rax)
jmp 0x1f26
leaq 0x2aa8(%rip), %rdi      # 0x49c9
callq 0x1060
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/Astor-Bizard[P]ProjetS5_Groupe2/src/lectureSH.c
// Function: displaySectionsHeaders
void displaySectionsHeaders(Elf32_Ehdr elfHeader, SectionsHeadersList shList) {
	int i;
	char* sectionName;
	char* flags;

	printf("There are %d section headers, starting at offset 0x%x:\n\n", shList.size, elfHeader.e_shoff);
	printf("Section Headers:\n");
	printf("  [Nr] Name              Type            Addr     Off    Size   ES Flg Lk Inf Al\n");
	
	for(i=0; i<shList.size; i++) {
		sectionName = getSectionName(shList.names, shList.headers[i].sh_name);
		if(strlen(sectionName)>17)
			sectionName[17] = '\0';
		flags = sectionFlagsTranslation(shList.headers[i].sh_flags);

		printf("  [%2d] %-17s %-15s %08x %06x %06x %02x %3s %2d %3d %2d\n", i, sectionName, typeNameFromValue(shList.headers[i].sh_type), shList.headers[i].sh_addr, shList.headers[i].sh_offset, shList.headers[i].sh_size, shList.headers[i].sh_entsize, flags, shList.headers[i].sh_link, shList.headers[i].sh_info, shList.headers[i].sh_addralign);
		
		free(flags);
		free(sectionName);
	}
	printf("Key to Flags:\n");
	printf("  W (write), A (alloc), X (execute), M (merge), S (strings)\n");
	printf("  I (info), L (link order), G (group), T (TLS), E (exclude), x (unknown)\n");
	printf("  O (extra OS processing required) o (OS specific), p (processor specific)\n");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movslq 0x98(%rsp), %rbx
movl 0x70(%rsp), %edx
leaq 0x29ca(%rip), %rdi      # 0x491b
movl %ebx, %esi
xorl %eax, %eax
callq 0x1090
leaq 0x2a92(%rip), %rdi      # 0x49f3
callq 0x1060
leaq 0x2a97(%rip), %rdi      # 0x4a04
callq 0x1060
movq %rbx, 0x8(%rsp)
testq %rbx, %rbx
jle 0x203b
leaq 0x88(%rsp), %rax
movq (%rax), %r15
movq 0x8(%rax), %rax
movq %rax, (%rsp)
addq $0x24, %r15
xorl %r12d, %r12d
movl -0x24(%r15), %esi
movq (%rsp), %rdi
callq 0x1de2
movq %rax, %r13
movq %rax, %rdi
callq 0x1080
cmpq $0x12, %rax
jb 0x1fbd
movb $0x0, 0x11(%r13)
movl -0x1c(%r15), %edi
callq 0x1e3e
movq %rax, %rbp
movl -0x20(%r15), %edi
callq 0x1c5c
movl -0x18(%r15), %r8d
movl -0x14(%r15), %r9d
movl -0x10(%r15), %ecx
movq %rcx, 0x10(%rsp)
movl (%r15), %r11d
movl -0xc(%r15), %ebx
movl -0x8(%r15), %r14d
movl -0x4(%r15), %r10d
leaq 0x295b(%rip), %rdi      # 0x4954
movl %r12d, %esi
movq %r13, %rdx
movq %rax, %rcx
xorl %eax, %eax
pushq %r10
pushq %r14
pushq %rbx
pushq %rbp
pushq %r11
pushq 0x38(%rsp)
callq 0x1090
addq $0x30, %rsp
movq %rbp, %rdi
callq 0x1030
movq %r13, %rdi
callq 0x1030
incq %r12
addq $0x28, %r15
cmpq %r12, 0x8(%rsp)
jne 0x1f9a
leaq 0x2a13(%rip), %rdi      # 0x4a55
callq 0x1060
leaq 0x2a15(%rip), %rdi      # 0x4a63
callq 0x1060
leaq 0x2a45(%rip), %rdi      # 0x4a9f
callq 0x1060
leaq 0x2a82(%rip), %rdi      # 0x4ae8
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1060
// File: /workspace/github_c_makefile_star2_O3/Astor-Bizard[P]ProjetS5_Groupe2/src/afficher_section.c
// Function: afficher_string
void afficher_string(unsigned char *section, int size){
	int i,j;
	unsigned char aff[17];
	for(j=0;j<17;j++)aff[j]='\0';
	printf("  0x%08x ",0);
	i=0;
	// On affiche le contenu de la section
	while(i<size){
		// Affichage de l'offset
		if(i!=0){
			if(i%16==0){
				printf(" %s\n  0x%08x ",aff,i);	// Affichage non hexa
				for(j=0;j<17;j++)aff[j]='\0';
			}
			else if(i%4==0) printf(" ");
		}

		// Affichage hexa
		printf("%02x",section[i]);

		// Memorisation du caractère pour écriture non hexa
		aff[i%16]=section[i];
		if(aff[i%16]<32 || aff[i%16]>126) aff[i%16]='.';
		i++;
	}

	// Terminaison de l'affichage
	while(i%16!=0){
		if(i%4==0) printf(" ");
		printf("  ");
		i++;
	}
	printf(" %s\n\n",aff);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %esi, %ebx
movq %rdi, %r14
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
movb $0x0, 0x10(%rsp)
leaq 0x28b0(%rip), %rdi      # 0x4b84
xorl %esi, %esi
xorl %eax, %eax
callq 0x1090
testl %ebx, %ebx
jle 0x2394
movl %ebx, %r12d
movl $0x2e, %r13d
xorl %ebp, %ebp
movl $0x0, %r15d
testq %rbp, %rbp
je 0x2338
movl %ebp, %r15d
andl $0xf, %r15d
je 0x2316
testb $0x3, %bpl
jne 0x2338
movl $0x20, %edi
callq 0x1040
jmp 0x2338
xorl %r15d, %r15d
leaq 0x2860(%rip), %rdi      # 0x4b80
movq %rsp, %rsi
movl %ebp, %edx
xorl %eax, %eax
callq 0x1090
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
movb $0x0, 0x10(%rsp)
movzbl (%r14,%rbp), %esi
leaq 0x284a(%rip), %rdi      # 0x4b8e
xorl %eax, %eax
callq 0x1090
movzbl (%r14,%rbp), %eax
leal -0x7f(%rax), %ecx
cmpb $-0x5f, %cl
cmovbl %r13d, %eax
movl %r15d, %ecx
movb %al, (%rsp,%rcx)
incq %rbp
cmpq %rbp, %r12
jne 0x22f0
testb $0xf, %bl
je 0x2394
leaq 0x2081(%rip), %r14      # 0x43f5
testb $0x3, %bl
jne 0x2383
movl $0x20, %edi
callq 0x1040
movq %r14, %rdi
xorl %eax, %eax
callq 0x1090
incl %ebx
testb $0xf, %bl
jne 0x2374
leaq 0x1cb1(%rip), %rdi      # 0x404c
movq %rsp, %rsi
xorl %eax, %eax
callq 0x1090
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/Astor-Bizard[P]ProjetS5_Groupe2/src/afficher_section.c
// Function: index_Shdr
int index_Shdr(char str[], SectionsHeadersList shList) {
	int i,num_sh;
	char *name;
	int different;
	if(str[0]!='\0'){
		// Cas nombre : on traduit le nombre (string) en int
		i=0;
		num_sh=0;
		while(is_digit(str[i])){
			num_sh = num_sh*10 + str[i]-ASCII_0;
			i++;
		}
		if(str[i]=='\0'){
			if(num_sh<shList.size){
				name=getSectionNameBis(shList.names, shList.headers[num_sh]);
				strcpy(str, name);
				free(name);
			}
			else num_sh=-1;
		}
		// Cas nom : on le cherche dans la table shstrtab
		else{
			num_sh=-1;
			different=1;
			while(num_sh<shList.size-1 && different){
				num_sh++;
				name=getSectionNameBis(shList.names, shList.headers[num_sh]);
				different=strcmp(str, name);
				free(name);
			}
			if(different) num_sh=-1;
		}
		return num_sh;
	}
	else return -1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdi, 0x28(%rsp)
movb (%rdi), %dl
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testb %dl, %dl
je 0x24aa
leaq 0x90(%rsp), %rcx
leal -0x3a(%rdx), %esi
cmpb $-0xa, %sil
jb 0x2417
movq 0x28(%rsp), %rsi
incq %rsi
xorl %r15d, %r15d
leal (%r15,%r15,4), %edi
movzbl %dl, %edx
leal (%rdx,%rdi,2), %r15d
addl $-0x30, %r15d
movb (%rsi), %dl
leal -0x3a(%rdx), %edi
incq %rsi
cmpb $-0xb, %dil
ja 0x23f2
testb %dl, %dl
je 0x24b9
movl 0x10(%rcx), %r12d
testl %r12d, %r12d
jle 0x24aa
decl %r12d
movq (%rcx), %r13
movq 0x8(%rcx), %r14
xorl %ecx, %ecx
movq %rcx, %rbx
movq 0x20(%r13), %rax
movq %rax, 0x50(%rsp)
movups (%r13), %xmm0
movups 0x10(%r13), %xmm1
movaps %xmm1, 0x40(%rsp)
movaps %xmm0, 0x30(%rsp)
movq 0x50(%rsp), %rax
movq %rax, 0x20(%rsp)
movaps 0x30(%rsp), %xmm0
movaps 0x40(%rsp), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movq %r14, %rdi
callq 0x1e35
movq %rax, %r15
movq 0x28(%rsp), %rdi
movq %rax, %rsi
callq 0x10b0
movl %eax, %ebp
movq %r15, %rdi
callq 0x1030
leaq 0x1(%rbx), %rcx
cmpq %r12, %rbx
jge 0x24a0
addq $0x28, %r13
testl %ebp, %ebp
jne 0x2430
decl %ecx
xorl %eax, %eax
negl %ebp
sbbl %eax, %eax
orl %ecx, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl 0x10(%rcx), %r15d
jge 0x24aa
movq (%rcx), %rax
movq 0x8(%rcx), %rdi
movslq %r15d, %rcx
leaq (%rcx,%rcx,4), %rcx
movq 0x20(%rax,%rcx,8), %rdx
movq %rdx, 0x50(%rsp)
movups (%rax,%rcx,8), %xmm0
movups 0x10(%rax,%rcx,8), %xmm1
movaps %xmm1, 0x40(%rsp)
movaps %xmm0, 0x30(%rsp)
movq 0x50(%rsp), %rax
movq %rax, 0x20(%rsp)
movaps 0x30(%rsp), %xmm0
movaps 0x40(%rsp), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
callq 0x1e35
movq %rax, %r14
movq 0x28(%rsp), %rdi
movq %rax, %rsi
callq 0x1050
movq %r14, %rdi
callq 0x1030
movl %r15d, %eax
jmp 0x24aa
// File: /workspace/github_c_makefile_star2_O3/Astor-Bizard[P]ProjetS5_Groupe2/src/afficher_section.c
// Function: recuperer_section_num
unsigned char *recuperer_section_num(FILE *f, SectionsHeadersList shList, int num_sh) {
	int i;
	unsigned char c;
	unsigned char *section;

	if(num_sh<0 || num_sh>=shList.size){
		return NULL;
	}
	else{
		// On se place
		fseek(f,shList.headers[num_sh].sh_offset,0);
		section=malloc(sizeof(unsigned char)*shList.headers[num_sh].sh_size);
		if(section != NULL){
			// On mémorise le contenu de la section
			for(i=0;i<shList.headers[num_sh].sh_size;i++){
				c=fgetc(f);
				section[i]=c;
			}
		}
		else{
			fprintf(stderr,"Erreur d'allocation !\n");
			exit(42);
		}
	}
	return section;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
xorl %r14d, %r14d
testl %esi, %esi
js 0x279c
cmpl %esi, 0x40(%rsp)
jle 0x279c
movq %rdi, %rbx
leaq 0x30(%rsp), %rax
movq (%rax), %r12
movl %esi, %eax
leaq (%rax,%rax,4), %r13
movl 0x10(%r12,%r13,8), %esi
xorl %edx, %edx
callq 0x10e0
movl 0x14(%r12,%r13,8), %r15d
movq %r15, %rdi
callq 0x10d0
testq %rax, %rax
je 0x27a9
movq %rax, %r14
testl %r15d, %r15d
je 0x279c
leaq (%r12,%r13,8), %r15
addq $0x14, %r15
xorl %r12d, %r12d
movq %rbx, %rdi
callq 0x10a0
movb %al, (%r14,%r12)
incq %r12
movl (%r15), %eax
cmpq %rax, %r12
jb 0x2785
movq %r14, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
callq 0x1185
nop
// File: /workspace/github_c_makefile_star2_O3/Astor-Bizard[P]ProjetS5_Groupe2/src/lectureST.c
// Function: fetchSymbolNames
char* fetchSymbolNames(FILE* f, SectionsHeadersList shList, int symbolTabIndex) 
{
	int i;

	char* symbols = (char*) malloc(sizeof(char)*shList.headers[symbolTabIndex+1].sh_size);
	if (symbols==NULL) {
		printf("Erreur lors de l'allocation initiale de la table des noms.");
		return NULL;
	}

	fseek(f, shList.headers[symbolTabIndex+1].sh_offset, 0);
	for(i=0; i<shList.headers[symbolTabIndex+1].sh_size; i++)
		symbols[i] = fgetc(f);
	
	return symbols;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x30(%rsp), %r15
incl %esi
movslq %esi, %rax
leaq (%rax,%rax,4), %r12
movl 0x14(%r15,%r12,8), %edi
callq 0x10d0
movq %rax, %r14
testq %rax, %rax
je 0x2af5
leaq (%r15,%r12,8), %r15
addq $0x14, %r15
movl -0x4(%r15), %esi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x10e0
cmpl $0x0, (%r15)
je 0x2b03
xorl %r12d, %r12d
movq %rbx, %rdi
callq 0x10a0
movb %al, (%r14,%r12)
incq %r12
movl (%r15), %eax
cmpq %rax, %r12
jb 0x2adc
jmp 0x2b03
leaq 0x1e92(%rip), %rdi      # 0x498e
xorl %eax, %eax
callq 0x1090
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/Astor-Bizard[P]ProjetS5_Groupe2/src/lectureST.c
// Function: afficherTableSymboles
void afficherTableSymboles(ListeSymboles listeSymboles, Elf32_Ehdr elfHeader) {
	char* symbolString;
	unsigned char bind, info;
	int j;

	printf("\nSymbol table '.symtab' contains %d entries:\n", listeSymboles.nbSymboles);
	printf("   Num:    Value  Size Type    Bind   Vis      Ndx Name\n");

	for(j=0; j<listeSymboles.nbSymboles; j++)
	{
		info = 15 & listeSymboles.symboles[j].st_info;
		bind = 15<<4 & listeSymboles.symboles[j].st_info;

		symbolString = getSymbolNameBis(listeSymboles.names, listeSymboles.symboles[j]);

		printf("   %3d: %08x %5d %-7s %-6s %-7s  ", j, listeSymboles.symboles[j].st_value, listeSymboles.symboles[j].st_size, typeSymbole(info), bindSymbole(bind), visionSymbole(listeSymboles.symboles[j].st_other));
		switch(listeSymboles.symboles[j].st_shndx)
		{
			case 0: printf("UND ");
				break;
			case 65521: printf("ABS ");
				break;
			case 65522: printf("COM ");
				break;
			default: printf("%3d ", listeSymboles.symboles[j].st_shndx);
		}
		printf("%s\n", symbolString);
		free(symbolString);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movslq 0x60(%rsp), %rbx
leaq 0x21b9(%rip), %rdi      # 0x4ce5
movl %ebx, %esi
xorl %eax, %eax
callq 0x1090
leaq 0x226c(%rip), %rdi      # 0x4da8
callq 0x1060
movq %rbx, 0x10(%rsp)
testq %rbx, %rbx
jle 0x2c85
leaq 0x50(%rsp), %rax
movq (%rax), %rbx
movq 0x8(%rax), %rax
movq %rax, 0x8(%rsp)
addq $0xe, %rbx
xorl %r13d, %r13d
movzbl -0x2(%rbx), %r14d
movl -0xe(%rbx), %esi
movq 0x8(%rsp), %rdi
callq 0x2d24
movq %rax, %rbp
movl -0xa(%rbx), %r12d
movl -0x6(%rbx), %r15d
movl %r14d, %edi
andl $0xf, %edi
callq 0x2c99
shrl $0x4, %r14d
cmpl $0x1, %r14d
jle 0x2bb4
cmpl $0x2, %r14d
je 0x2bcf
cmpl $0xd, %r14d
je 0x2bd8
cmpl $0xf, %r14d
jne 0x2be1
leaq 0x1d00(%rip), %r9       # 0x48b2
jmp 0x2be8
leaq 0x21a6(%rip), %r9       # 0x4d61
testl %r14d, %r14d
je 0x2be8
cmpl $0x1, %r14d
jne 0x2be1
leaq 0x219a(%rip), %r9       # 0x4d67
jmp 0x2be8
leaq 0x2198(%rip), %r9       # 0x4d6e
jmp 0x2be8
leaq 0x1ccc(%rip), %r9       # 0x48ab
jmp 0x2be8
leaq 0x1d2b(%rip), %r9       # 0x4913
cmpb $0x0, -0x1(%rbx)
leaq 0x1d20(%rip), %rcx      # 0x4913
leaq 0x2179(%rip), %rdx      # 0x4d73
cmoveq %rdx, %rcx
movq %rcx, (%rsp)
leaq 0x210a(%rip), %rdi      # 0x4d13
movl %r13d, %esi
movl %r12d, %edx
movl %r15d, %ecx
movq %rax, %r8
xorl %eax, %eax
callq 0x1090
movzwl (%rbx), %esi
cmpl $0xfff2, %esi           # imm = 0xFFF2
je 0x2c45
cmpl $0xfff1, %esi           # imm = 0xFFF1
je 0x2c3c
testl %esi, %esi
jne 0x2c55
leaq 0x20fb(%rip), %rdi      # 0x4d35
jmp 0x2c4c
leaq 0x20f7(%rip), %rdi      # 0x4d3a
jmp 0x2c4c
leaq 0x20f3(%rip), %rdi      # 0x4d3f
xorl %eax, %eax
callq 0x1090
jmp 0x2c63
leaq 0x20e8(%rip), %rdi      # 0x4d44
xorl %eax, %eax
callq 0x1090
movq %rbp, %rdi
callq 0x1060
movq %rbp, %rdi
callq 0x1030
incq %r13
addq $0x10, %rbx
cmpq %r13, 0x10(%rsp)
jne 0x2b67
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/Astor-Bizard[P]ProjetS5_Groupe2/src/lectureST.c
// Function: bindSymbole
char* bindSymbole(unsigned char bind)
{
	char* bindSymboleChar;

	switch(bind>>4)
	{
		case STB_LOCAL:
			bindSymboleChar = "LOCAL";
			break;
		case STB_GLOBAL:
			bindSymboleChar = "GLOBAL";
			break;
		case STB_WEAK:
			bindSymboleChar = "WEAK";
			break;
		case STB_LOPROC:
			bindSymboleChar = "LOPROC";
			break;
		case STB_HIPROC:
			bindSymboleChar = "HIPROC";
			break;
		default:
			bindSymboleChar = "# ERR #";
			break;
	}
	return bindSymboleChar;
}

// Assembly:
shrb $0x4, %dil
movzbl %dil, %eax
cmpl $0x1, %eax
jle 0x2cde
cmpl $0x2, %eax
je 0x2cef
cmpl $0xd, %eax
je 0x2cf7
cmpl $0xf, %eax
jne 0x2d07
leaq 0x1bd5(%rip), %rax      # 0x48b2
retq
testl %eax, %eax
je 0x2cff
cmpl $0x1, %eax
jne 0x2d07
leaq 0x2079(%rip), %rax      # 0x4d67
retq
leaq 0x2078(%rip), %rax      # 0x4d6e
retq
leaq 0x1bad(%rip), %rax      # 0x48ab
retq
leaq 0x205b(%rip), %rax      # 0x4d61
retq
leaq 0x1c05(%rip), %rax      # 0x4913
retq
// File: /workspace/github_c_makefile_star2_O3/Astor-Bizard[P]ProjetS5_Groupe2/src/lectureST.c
// Function: getSymbolName
char* getSymbolName(char* symbols, uint32_t symbolIndex) 
{
	int i = 0;

	while(symbols[symbolIndex+i] != '\0')
		i++;
	i++;

	char* symbolName = (char*) malloc(sizeof(char)*i);
	if (symbols==NULL) {
		printf("Erreur lors de l'allocation initiale d'un nom de section.");
		return NULL;
	}

	i = 0;
	while(symbols[symbolIndex+i] != '\0') {
		symbolName[i] = symbols[symbolIndex+i];
		i++;
	}
	symbolName[i] = '\0';

	return symbolName;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
movl %esi, %r15d
xorl %eax, %eax
leal (%r15,%rax), %ecx
incq %rax
cmpb $0x0, (%r14,%rcx)
jne 0x2d33
movl %eax, %edi
callq 0x10d0
movb (%r14,%r15), %cl
testb %cl, %cl
je 0x2d6b
incl %ebx
xorl %edx, %edx
movq %rdx, %rsi
movb %cl, (%rax,%rdx)
incq %rdx
addl %ebx, %esi
movb (%r14,%rsi), %cl
testb %cl, %cl
jne 0x2d54
movl %edx, %ecx
jmp 0x2d6d
xorl %ecx, %ecx
movb $0x0, (%rax,%rcx)
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_c_makefile_star2_O3/Astor-Bizard[P]ProjetS5_Groupe2/src/affichage_relocation.c
// Function: lire_octets_charT
long long unsigned int lire_octets_charT(unsigned char *tableau, 
    int hdr_mode, 
    int debut, 
    int nombre)
{
	int i;
	long long unsigned int R=0;
	if(hdr_mode == B_ENDIAN)
	{
		for(i=0;i<nombre;i++)
		{
			R = (R<<8) | tableau[debut+i];
		}
	}
	else
	{
		for(i=0; i<nombre; i++)
		{
			R =  R | (tableau[debut+i] << (i*8));
		}
	}
    return R;
}

// Assembly:
cmpl $0x2, %esi
jne 0x2da2
testl %ecx, %ecx
jle 0x2dce
movslq %edx, %rax
movl %ecx, %ecx
addq %rax, %rdi
xorl %edx, %edx
xorl %eax, %eax
shlq $0x8, %rax
movzbl (%rdi,%rdx), %esi
orq %rsi, %rax
incq %rdx
cmpq %rdx, %rcx
jne 0x2d8d
jmp 0x2dcd
testl %ecx, %ecx
jle 0x2dce
movslq %edx, %rax
movl %ecx, %edx
addq %rax, %rdi
shlq $0x3, %rdx
xorl %ecx, %ecx
xorl %eax, %eax
movzbl (%rdi), %esi
shll %cl, %esi
movslq %esi, %rsi
orq %rsi, %rax
incq %rdi
addq $0x8, %rcx
cmpq %rcx, %rdx
jne 0x2db6
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/Astor-Bizard[P]ProjetS5_Groupe2/src/affichage_relocation.c
// Function: print_section
void print_section(unsigned long long int addr, SectionsHeadersList liste_sections, Elf32_Ehdr header)
{
    int i;
    for(i=0; i< header.e_shnum;i++)
    {
        if(liste_sections.headers[i].sh_offset <= addr && addr <= liste_sections.headers[i].sh_offset + liste_sections.headers[i].sh_size)
        {
            printf("%s", liste_sections.names + liste_sections.headers[i].sh_name);
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movzwl 0x88(%rsp), %eax
testq %rax, %rax
je 0x2e5b
movq %rdi, %rbx
leaq 0x40(%rsp), %rcx
movq (%rcx), %r15
movq 0x8(%rcx), %r12
shll $0x3, %eax
leaq (%rax,%rax,4), %r13
leaq 0x1d68(%rip), %r14      # 0x4b93
xorl %ebp, %ebp
movl 0x10(%r15,%rbp), %eax
cmpq %rbx, %rax
ja 0x2e52
addl 0x14(%r15,%rbp), %eax
cmpq %rbx, %rax
jb 0x2e52
movl (%r15,%rbp), %esi
addq %r12, %rsi
movq %r14, %rdi
xorl %eax, %eax
callq 0x1090
addq $0x28, %rbp
cmpq %rbp, %r13
jne 0x2e2d
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/Astor-Bizard[P]ProjetS5_Groupe2/src/affichage_relocation.c
// Function: print_symbol
void print_symbol(int sym, ListeSymboles table_symbol, Elf32_Ehdr header, SectionsHeadersList liste_sections)
{
    printf("%08x   ", table_symbol.symboles[sym].st_value);
		char *name;
    if((table_symbol.symboles[sym].st_info & 0xf) != 3)
    {
	   name = getSymbolNameBis(table_symbol.names, table_symbol.symboles[sym]);
    }
    else
    {
		name = getSectionNameBis(liste_sections.names, liste_sections.headers[table_symbol.symboles[sym].st_shndx]);
    }
	printf("%s",name);
	free(name);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x60, %rsp
movq 0x80(%rsp), %r14
movslq %edi, %r15
shlq $0x4, %r15
leaq (%r14,%r15), %rbx
movl 0x4(%r14,%r15), %esi
leaq 0x2201(%rip), %rdi      # 0x5093
xorl %eax, %eax
callq 0x1090
movb 0xc(%r14,%r15), %al
andb $0xf, %al
cmpb $0x3, %al
jne 0x2efc
leaq 0xd0(%rsp), %rax
movq (%rax), %rcx
movq 0x8(%rax), %rdi
movzwl 0xe(%rbx), %eax
leaq (%rax,%rax,4), %rax
movq 0x20(%rcx,%rax,8), %rdx
movq %rdx, 0x50(%rsp)
movups (%rcx,%rax,8), %xmm0
movups 0x10(%rcx,%rax,8), %xmm1
movaps %xmm1, 0x40(%rsp)
movaps %xmm0, 0x30(%rsp)
movq 0x50(%rsp), %rax
movq %rax, 0x20(%rsp)
movaps 0x30(%rsp), %xmm0
movaps 0x40(%rsp), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
callq 0x1e35
jmp 0x2f14
leaq 0x80(%rsp), %rax
movq 0x8(%rax), %rdi
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
callq 0x2c94
movq %rax, %rbx
leaq 0x1c75(%rip), %rdi      # 0x4b93
movq %rax, %rsi
xorl %eax, %eax
callq 0x1090
movq %rbx, %rdi
addq $0x60, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x1030
// File: /workspace/github_c_makefile_star2_O3/Astor-Bizard[P]ProjetS5_Groupe2/src/affichage_relocation.c
// Function: affichage_relocation
Str_Reloc affichage_relocation(FILE* f,
    Elf32_Ehdr header,
    SectionsHeadersList liste_sections, 
    ListeSymboles table_symbol,
    int silent)
{
    // initialisation
    Str_Reloc RETOUR;
    RETOUR.nb_Rel=0;
    RETOUR.Rel=NULL;
    RETOUR.Sec_Rel=NULL;

	int i=0,ok=0;
    char* CurrentSectionName;

    // on parcours les titres des sections pour trouver les sections de reallocation.
    i=0;
	while(i<header.e_shnum)
	{
        CurrentSectionName = liste_sections.names + liste_sections.headers[i].sh_name;
		// on vérifie toutes les sections
		// si ce sont des sections de relocations:
		/*if( CurrentSectionName[0]=='.' 
			&& CurrentSectionName[1]=='r' 
			&& CurrentSectionName[2]=='e' 
			&& CurrentSectionName[3]=='l' 
			&& CurrentSectionName[4]=='a' )
		{
            //printf("Nom de la section courante:%s n°%i\n",CurrentSectionName,i);
			//afficher_sectionRA(f, liste_sections, header, i, &RETOUR, table_symbol);
		}
		else */if (CurrentSectionName[0]=='.' 
            && CurrentSectionName[1]=='r' 
            && CurrentSectionName[2]=='e' 
            && CurrentSectionName[3]=='l' )
		{
            //printf("Nom de la section courante:%s n°%i\n", CurrentSectionName, i);
			afficher_sectionR(f, liste_sections, header, i, &RETOUR, table_symbol, silent);
			ok = 1;
		}
        i++;
	}
	if(!ok && !silent) printf("\nThere are no relocations in this file.\n");
    return RETOUR;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movl %edx, %r12d
movq %rsi, 0x70(%rsp)
movq %rdi, %rbx
movl $0x0, (%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rdi)
movzwl 0xe0(%rsp), %edx
testq %rdx, %rdx
je 0x337b
leaq 0xe8(%rsp), %r13
movq (%r13), %rax
shll $0x3, %edx
leaq (%rdx,%rdx,4), %r14
xorl %ebp, %ebp
xorl %r15d, %r15d
xorl %edi, %edi
movq 0x8(%r13), %rdx
movl (%rax,%rbp), %esi
cmpb $0x2e, (%rdx,%rsi)
jne 0x3369
cmpb $0x72, 0x1(%rdx,%rsi)
jne 0x3369
cmpb $0x65, 0x2(%rdx,%rsi)
jne 0x3369
cmpb $0x6c, 0x3(%rdx,%rsi)
jne 0x3369
leaq 0x100(%rsp), %rdx
movq 0x10(%rdx), %rax
movq %rax, 0x60(%rsp)
movups (%rdx), %xmm0
movups %xmm0, 0x50(%rsp)
leaq 0xb0(%rsp), %rdx
movl 0x30(%rdx), %eax
movl %eax, 0x48(%rsp)
movups (%rdx), %xmm0
movups 0x10(%rdx), %xmm1
movups 0x20(%rdx), %xmm2
movups %xmm2, 0x38(%rsp)
movups %xmm1, 0x28(%rsp)
movups %xmm0, 0x18(%rsp)
movq 0x10(%r13), %rax
movq %rax, 0x10(%rsp)
movups (%r13), %xmm0
movups %xmm0, (%rsp)
movq 0x70(%rsp), %rdi
movl %r15d, %esi
movq %rbx, %rdx
movl %r12d, %ecx
callq 0x2f39
movq (%r13), %rax
movl $0x1, %edi
incl %r15d
addq $0x28, %rbp
cmpq %rbp, %r14
jne 0x32d3
jmp 0x337d
xorl %edi, %edi
orl %r12d, %edi
jne 0x338e
leaq 0x1d99(%rip), %rdi      # 0x5122
callq 0x1060
movq %rbx, %rax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/phoboslab[P]pl_mpeg/pl_mpeg_player_gl.c
// Function: app_on_video
void app_on_video(plm_t *mpeg, plm_frame_t *frame, void *user) {
	app_t *self = (app_t *)user;
	
	// Hand the decoded data over to OpenGL. For the RGB texture mode, the
	// YCrCb->RGB conversion is done on the CPU.

	if (self->texture_mode == APP_TEXTURE_MODE_YCRCB) {
		app_update_texture(self, GL_TEXTURE0, self->texture_y, &frame->y);
		app_update_texture(self, GL_TEXTURE1, self->texture_cb, &frame->cb);
		app_update_texture(self, GL_TEXTURE2, self->texture_cr, &frame->cr);

		// The dimensions of the planes are always rounded up to the next
		// multiple of 16. We don't want to display these extra pixels, so
		// calculate the crop w/h and hand it over to the shader program.
		float cw = (float)frame->width / (float)frame->y.width;
		float ch = (float)frame->height / (float)frame->y.height;
		glUniform2f(self->texture_crop_size, cw, ch);
	}
	else {
		plm_frame_to_rgb(frame, self->rgb_data, frame->width * 3);
	
		glBindTexture(GL_TEXTURE_2D, self->texture_rgb);
		glTexImage2D(
			GL_TEXTURE_2D, 0, GL_RGB, frame->width, frame->height, 0,
			GL_RGB, GL_UNSIGNED_BYTE, self->rgb_data
		);

		// plm_frame_to_rgb() always returns the cropped portion of the display
		// size, so the crop size is always 1.0, 1.0
		glUniform2f(self->texture_crop_size, 1.0, 1.0);
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
cmpl $0x1, 0x3c(%rdx)
jne 0x8adf
movl 0x40(%rbx), %edx
leaq 0x10(%r14), %rcx
movl $0x84c0, %esi           # imm = 0x84C0
callq 0x8ed0
movl 0x44(%rbx), %edx
leaq 0x30(%r14), %rcx
movl $0x84c1, %esi           # imm = 0x84C1
callq 0x8ed0
movl 0x48(%rbx), %edx
leaq 0x20(%r14), %rcx
movl $0x84c2, %esi           # imm = 0x84C2
callq 0x8ed0
movl 0x8(%r14), %eax
cvtsi2ss %rax, %xmm0
movl 0x10(%r14), %eax
cvtsi2ss %rax, %xmm2
movl 0xc(%r14), %eax
cvtsi2ss %rax, %xmm1
movl 0x14(%r14), %eax
cvtsi2ss %rax, %xmm3
divss %xmm2, %xmm0
divss %xmm3, %xmm1
movq 0x5491(%rip), %rax      # 0xdf68
movq (%rax), %rax
movl 0x4c(%rbx), %edi
jmp 0x8b48
movq 0x58(%rbx), %rsi
movl 0x8(%r14), %eax
leal (%rax,%rax,2), %edx
movq %r14, %rdi
callq 0x5f05
movl 0x50(%rbx), %esi
movl $0xde1, %edi            # imm = 0xDE1
callq 0x21e0
movl 0x8(%r14), %ecx
movl 0xc(%r14), %r8d
subq $0x8, %rsp
movl $0xde1, %edi            # imm = 0xDE1
xorl %esi, %esi
movl $0x1907, %edx           # imm = 0x1907
xorl %r9d, %r9d
pushq 0x58(%rbx)
pushq $0x1401                 # imm = 0x1401
pushq $0x1907                 # imm = 0x1907
callq 0x20b0
addq $0x20, %rsp
movq 0x5431(%rip), %rax      # 0xdf68
movq (%rax), %rax
movl 0x4c(%rbx), %edi
movss 0x1b93(%rip), %xmm0     # 0xa6d8
movaps %xmm0, %xmm1
addq $0x8, %rsp
popq %rbx
popq %r14
jmpq *%rax
// File: /workspace/github_c_makefile_star2_O3/phoboslab[P]pl_mpeg/pl_mpeg_player_gl.c
// Function: app_compile_shader
GLuint app_compile_shader(app_t *self, GLenum type, const char *source) {
	GLuint shader = glCreateShader(type);
	glShaderSource(shader, 1, &source, NULL);
	glCompileShader(shader);
	
	GLint success;
	glGetShaderiv(shader, GL_COMPILE_STATUS, &success);
	if (!success) {
		int log_written;
		char log[256];
		glGetShaderInfoLog(shader, 256, &log_written, log);
		SDL_Log("Error compiling shader: %s.\n", log);
	}
	return shader;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
movl %esi, %edi
leaq 0x8(%rsp), %r14
movq %rdx, (%r14)
movq 0x5428(%rip), %rax      # 0xdfa8
callq *(%rax)
movl %eax, %ebx
movq 0x540d(%rip), %rax      # 0xdf98
movl %ebx, %edi
movl $0x1, %esi
movq %r14, %rdx
xorl %ecx, %ecx
callq *(%rax)
movq 0x53e8(%rip), %rax      # 0xdf88
movl %ebx, %edi
callq *(%rax)
movq 0x53c5(%rip), %rax      # 0xdf70
leaq 0x4(%rsp), %r14
movl %ebx, %edi
movl $0x8b81, %esi           # imm = 0x8B81
movq %r14, %rdx
callq *(%rax)
cmpl $0x0, (%r14)
jne 0x8bee
movq 0x53e7(%rip), %rax      # 0xdfb0
movq %rsp, %rdx
leaq 0x10(%rsp), %r14
movl %ebx, %edi
movl $0x100, %esi            # imm = 0x100
movq %r14, %rcx
callq *(%rax)
leaq 0x1ef2(%rip), %rdi      # 0xaad6
movq %r14, %rsi
xorl %eax, %eax
callq 0x2200
movl %ebx, %eax
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/phoboslab[P]pl_mpeg/pl_mpeg_player_gl.c
// Function: app_create_texture
GLuint app_create_texture(app_t *self, GLuint index, const char *name) {
	GLuint texture;
	glCreateTextures(GL_TEXTURE_2D, 1, &texture);
	
	glBindTexture(GL_TEXTURE_2D, texture);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
	
	glUniform1i(glGetUniformLocation(self->shader_program, name), index);
	return texture;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdx, %r15
movl %esi, %ebx
movq %rdi, %r12
movq 0x5369(%rip), %rax      # 0xdf80
leaq 0xc(%rsp), %r14
movl $0xde1, %edi            # imm = 0xDE1
movl $0x1, %esi
movq %r14, %rdx
callq *(%rax)
movl (%r14), %esi
movl $0xde1, %edi            # imm = 0xDE1
callq 0x21e0
movl $0xde1, %edi            # imm = 0xDE1
movl $0x2800, %esi           # imm = 0x2800
movl $0x2601, %edx           # imm = 0x2601
callq 0x2220
movl $0xde1, %edi            # imm = 0xDE1
movl $0x2801, %esi           # imm = 0x2801
movl $0x2601, %edx           # imm = 0x2601
callq 0x2220
movl $0xde1, %edi            # imm = 0xDE1
movl $0x2802, %esi           # imm = 0x2802
movl $0x812f, %edx           # imm = 0x812F
callq 0x2220
movl $0xde1, %edi            # imm = 0xDE1
movl $0x2803, %esi           # imm = 0x2803
movl $0x812f, %edx           # imm = 0x812F
callq 0x2220
movq 0x5331(%rip), %rax      # 0xdfc0
movq (%rax), %r13
movq 0x52c7(%rip), %rax      # 0xdf60
movl 0x30(%r12), %edi
movq %r15, %rsi
callq *(%rax)
movl %eax, %edi
movl %ebx, %esi
callq *%r13
movl (%r14), %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/phoboslab[P]pl_mpeg/pl_mpeg_player_gl.c
// Function: app_destroy
void app_destroy(app_t *self) {
	plm_destroy(self->plm);
	
	if (self->texture_mode == APP_TEXTURE_MODE_RGB) {
		free(self->rgb_data);
	}

	if (self->audio_device) {
		SDL_CloseAudioDevice(self->audio_device);
	}
	
	SDL_GL_DeleteContext(self->gl);
	SDL_Quit();
	
	free(self);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rdi
callq 0x2aa1
cmpl $0x2, 0x3c(%rbx)
jne 0x8cd6
movq 0x58(%rbx), %rdi
callq 0x21b0
movl 0x20(%rbx), %edi
testl %edi, %edi
je 0x8ce2
callq 0x20d0
movq 0x28(%rbx), %rdi
callq 0x2060
callq 0x2050
movq %rbx, %rdi
popq %rbx
jmp 0x21b0
// File: /workspace/github_c_makefile_star2_O3/phoboslab[P]pl_mpeg/pl_mpeg_player_gl.c
// Function: app_update_texture
void app_update_texture(app_t *self, GLuint unit, GLuint texture, plm_plane_t *plane) {
	glActiveTexture(unit);
	glBindTexture(GL_TEXTURE_2D, texture);
	glTexImage2D(
		GL_TEXTURE_2D, 0, GL_LUMINANCE, plane->width, plane->height, 0,
		GL_LUMINANCE, GL_UNSIGNED_BYTE, plane->data
	);
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rcx, %rbx
movl %edx, %ebp
movl %esi, %edi
movq 0x50e7(%rip), %rax      # 0xdfc8
callq *(%rax)
movl $0xde1, %edi            # imm = 0xDE1
movl %ebp, %esi
callq 0x21e0
movl (%rbx), %ecx
movl 0x4(%rbx), %r8d
subq $0x8, %rsp
movl $0xde1, %edi            # imm = 0xDE1
xorl %esi, %esi
movl $0x1909, %edx           # imm = 0x1909
xorl %r9d, %r9d
pushq 0x8(%rbx)
pushq $0x1401                 # imm = 0x1401
pushq $0x1909                 # imm = 0x1909
callq 0x20b0
addq $0x28, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/phoboslab[P]pl_mpeg/pl_mpeg_player_gl.c
// Function: main
int main(int argc, char *argv[]) {
	if (argc < 2) {
		SDL_Log("Usage: pl_mpeg_player_gl <file.mpg>");
		exit(1);
	}
	
	app_t *app = app_create(argv[1], APP_TEXTURE_MODE_YCRCB);
	while (!app->wants_to_quit) {
		app_update(app);
	}
	app_destroy(app);
	
	return EXIT_SUCCESS;
}

// Assembly:
pushq %rbx
cmpl $0x1, %edi
jle 0x8f58
movq 0x8(%rsi), %rdi
movl $0x1, %esi
callq 0x8719
movq %rax, %rbx
cmpl $0x0, 0x10(%rax)
jne 0x8f4c
movq %rbx, %rdi
callq 0x8cf9
cmpl $0x0, 0x10(%rbx)
je 0x8f3e
movq %rbx, %rdi
callq 0x8cbb
xorl %eax, %eax
popq %rbx
retq
leaq 0x1b94(%rip), %rdi      # 0xaaf3
xorl %eax, %eax
callq 0x2200
movl $0x1, %edi
callq 0x21c0
// File: /workspace/github_c_makefile_star2_O3/mjosaarinen[P]brutus/crypto_aead/trivia128v2/ref/encrypt.c
// Function: Field_Mult_32
u32 Field_Mult_32(u32 a, u32 b)
{
   u32 result=0, i;  

   b=Reverse_32(b); 

   if((b&1)==1) result=a;

   for(i=1;i<32;i++)
   {   
	b=b>>1;
	result=Mult_by_alpha_power(result,1); 
	if((b&1)==1) result=result^a;
   }
   return result;
}

// Assembly:
movl %esi, %eax
xorl %ecx, %ecx
movl $0x1f, %edx
movl %eax, %esi
andl $0x1, %esi
orl %esi, %ecx
shrl %eax
addl %ecx, %ecx
decl %edx
jne 0x1551
andl $0x1, %eax
orl %eax, %ecx
negl %eax
andl %edi, %eax
movl $0x1f, %edx
movl %ecx, %esi
shrl %esi
leal (%rax,%rax), %r8d
movl %r8d, %r9d
xorl $0x400007, %r9d         # imm = 0x400007
testl %eax, %eax
cmovnsl %r8d, %r9d
shll $0x1e, %ecx
sarl $0x1f, %ecx
andl %edi, %ecx
movl %ecx, %eax
xorl %r9d, %eax
movl %esi, %ecx
decl %edx
jne 0x1570
retq
// File: /workspace/github_c_makefile_star2_O3/mvermeulen[P]wspy/proctree.c
// Function: lookup_pid
struct proc_table_entry *lookup_pid(unsigned int pid,int insert){
  int bucket = pid % NUM_PROC_TABLE_BUCKETS;
  struct proc_table_entry *pentry;

  for (pentry=proc_table[bucket];pentry;pentry=pentry->next){
    if (pentry->pid == pid) return pentry;
  }
  // not found
  if (!insert) return NULL;

  pentry = calloc(1,sizeof(struct proc_table_entry));
  pentry->pid = pid;
  pentry->pinfo = calloc(1,sizeof(struct process_info));
  pentry->pinfo->pid = pid;
  if (proc_table[bucket]){
    pentry->next = proc_table[bucket];
    pentry->next->prev = pentry;
  }
  proc_table[bucket] = pentry;
  num_processes++;
  total_processes++;
  if (num_processes > max_num_processes)
    max_num_processes = num_processes;
  return pentry;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movl %edi, %ebx
movl %edi, %eax
imulq $0x446f8657, %rax, %rax # imm = 0x446F8657
shrq $0x20, %rax
movl %edi, %ecx
subl %eax, %ecx
shrl %ecx
addl %eax, %ecx
shrl $0x6, %ecx
imull $0x65, %ecx, %eax
movl %edi, %r15d
subl %eax, %r15d
leaq 0x3e61(%rip), %r12      # 0x5140
movq (%r12,%r15,8), %r13
testq %r13, %r13
je 0x12f9
movq %r13, %r14
cmpl %ebx, (%r14)
je 0x135f
movq 0x18(%r14), %r14
testq %r14, %r14
jne 0x12eb
testl %esi, %esi
je 0x135c
movl $0x1, %edi
movl $0x20, %esi
callq 0x10c0
movq %rax, %r14
movl %ebx, (%rax)
movl $0x1, %edi
movl $0x68, %esi
callq 0x10c0
movq %rax, 0x8(%r14)
movl %ebx, (%rax)
testq %r13, %r13
je 0x1333
movq %r13, 0x18(%r14)
movq %r14, 0x10(%r13)
movq %r14, (%r12,%r15,8)
movl 0x3df3(%rip), %ecx      # 0x5130
incl 0x3df1(%rip)            # 0x5134
leal 0x1(%rcx), %eax
movl %eax, 0x3de4(%rip)      # 0x5130
cmpl 0x3de6(%rip), %ecx      # 0x5138
jl 0x135f
movl %eax, 0x3dde(%rip)      # 0x5138
jmp 0x135f
xorl %r14d, %r14d
movq %r14, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq