LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/Astor-Bizard[P]ProjetS5_Groupe2/src/displayCorrectionSymbols.c
// Function: recuperer_donnees
Elf32_Addr recuperer_donnees(char argv[], char nom[])
{
	int taille,i=0;
	char nb[42];
	Elf32_Addr addr;
	
	
	while(argv[i]!='=')
	{
		nom[i]=argv[i];
		i++;
	}
	nom[i]='\0';

	i++;
	taille=i;


	if(argv[i] != '0' && argv[i+1] != 'x')
	{
		printf("Erreur d'argument. Forme attendue : <section>=0x<addr>\n");
		exit(1);
	}

	i+=2;
	while(argv[i]!='\0')
	{
		nb[i-taille-2] = argv[i];
		i++;
	}
	nb[i-taille-2]='\0';

	addr = strtol(nb,NULL,16);
	return addr;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x18(%rbp)
movq -0x8(%rbp), %rax
movslq -0x18(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x3d, %eax
je 0x12b9
movq -0x8(%rbp), %rax
movslq -0x18(%rbp), %rcx
movb (%rax,%rcx), %dl
movq -0x10(%rbp), %rax
movslq -0x18(%rbp), %rcx
movb %dl, (%rax,%rcx)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x1287
movq -0x10(%rbp), %rax
movslq -0x18(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
movl -0x18(%rbp), %eax
movl %eax, -0x14(%rbp)
movq -0x8(%rbp), %rax
movslq -0x18(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x30, %eax
je 0x1313
movq -0x8(%rbp), %rax
movl -0x18(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x78, %eax
je 0x1313
leaq 0x5d02(%rip), %rdi      # 0x7004
movb $0x0, %al
callq 0x1070
movl $0x1, %edi
callq 0x1150
movl -0x18(%rbp), %eax
addl $0x2, %eax
movl %eax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movslq -0x18(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x0, %eax
je 0x1352
movq -0x8(%rbp), %rax
movslq -0x18(%rbp), %rcx
movb (%rax,%rcx), %cl
movl -0x18(%rbp), %eax
subl -0x14(%rbp), %eax
subl $0x2, %eax
cltq
movb %cl, -0x50(%rbp,%rax)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x131c
movl -0x18(%rbp), %eax
subl -0x14(%rbp), %eax
subl $0x2, %eax
cltq
movb $0x0, -0x50(%rbp,%rax)
leaq -0x50(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0x10, %edx
callq 0x10d0
movl %eax, -0x54(%rbp)
movl -0x54(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/Astor-Bizard[P]ProjetS5_Groupe2/src/displayCorrectionSymbols.c
// Function: remplirDonnees
Table_Donnees remplirDonnees(int argc,char *argv[],
		Elf32_Ehdr Old_elfHeaders,SectionsHeadersList Old_section_headers)
{
	int i;
	char nom[42];
	Elf32_Addr addr;
	Table_Donnees tab_donnees;


	tab_donnees.nbSecRel = argc-3;
	tab_donnees.table_Addr = malloc(sizeof(Elf32_Addr)*tab_donnees.nbSecRel);
	if (tab_donnees.table_Addr==NULL) {
		printf("\nErreur lors de l'allocation initiale de tab_donnees.table_Addr.\n");
		exit(1);
	}
	tab_donnees.table_Num_Addr = malloc(sizeof(int)*tab_donnees.nbSecRel);
	if (tab_donnees.table_Num_Addr==NULL) {
		printf("\nErreur lors de l'allocation initiale de tab_donnees.table_Num_Addr.\n");
		free(tab_donnees.table_Addr);
		exit(1);
	}

	for(i=0;i<tab_donnees.nbSecRel;i++)
	{
		addr = recuperer_donnees(argv[i+3],nom);
		
		tab_donnees.table_Num_Addr[i]=index_Shdr(nom, Old_section_headers); 
		tab_donnees.table_Addr[i]=addr;
	}

	return tab_donnees;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x50(%rbp)
movq %rdi, %rax
movq %rax, -0x60(%rbp)
leaq 0x48(%rbp), %rax
movq %rax, -0x58(%rbp)
movl %esi, -0x4(%rbp)
movq %rdx, -0x10(%rbp)
movl -0x4(%rbp), %eax
subl $0x3, %eax
movl %eax, (%rdi)
movslq (%rdi), %rdi
shlq $0x2, %rdi
callq 0x10f0
movq -0x50(%rbp), %rdi
movq %rax, 0x8(%rdi)
cmpq $0x0, 0x8(%rdi)
jne 0x13e0
leaq 0x5c6d(%rip), %rdi      # 0x703c
movb $0x0, %al
callq 0x1070
movl $0x1, %edi
callq 0x1150
movq -0x50(%rbp), %rax
movslq (%rax), %rdi
shlq $0x2, %rdi
callq 0x10f0
movq %rax, %rcx
movq -0x50(%rbp), %rax
movq %rcx, 0x10(%rax)
cmpq $0x0, 0x10(%rax)
jne 0x1427
leaq 0x5c75(%rip), %rdi      # 0x707e
movb $0x0, %al
callq 0x1070
movq -0x50(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x1030
movl $0x1, %edi
callq 0x1150
movl $0x0, -0x14(%rbp)
movq -0x50(%rbp), %rcx
movl -0x14(%rbp), %eax
cmpl (%rcx), %eax
jge 0x14a8
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
addl $0x3, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
leaq -0x40(%rbp), %rsi
callq 0x1270
movl %eax, %ecx
movq -0x58(%rbp), %rax
movl %ecx, -0x44(%rbp)
leaq -0x40(%rbp), %rdi
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0x3110
movl %eax, %esi
movq -0x50(%rbp), %rax
movq 0x10(%rax), %rcx
movslq -0x14(%rbp), %rdx
movl %esi, (%rcx,%rdx,4)
movl -0x44(%rbp), %edx
movq 0x8(%rax), %rax
movslq -0x14(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x142e
movq -0x60(%rbp), %rax
addq $0x80, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Astor-Bizard[P]ProjetS5_Groupe2/src/renum_section.c
// Function: nbSecRel
int nbSecRel(Elf32_Ehdr elfHeaders, Elf32_Shdr *section_headers)
{
	
	int i;
	int retour = 0;	
	for(i=0; i<elfHeaders.e_shnum; i++)
	{
		if(section_headers[i].sh_type == SHT_REL)
		{
			retour++;
		}
	}
	return retour;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
movq %rdi, -0x8(%rbp)
movl $0x0, -0x10(%rbp)
movl $0x0, -0xc(%rbp)
movq -0x18(%rbp), %rcx
movl -0xc(%rbp), %eax
movzwl 0x30(%rcx), %ecx
cmpl %ecx, %eax
jge 0x5258
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
cmpl $0x9, 0x4(%rax)
jne 0x524b
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x524d
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x521e
movl -0x10(%rbp), %eax
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/Astor-Bizard[P]ProjetS5_Groupe2/src/renum_section.c
// Function: ecrire_nouvelles_sections
void ecrire_nouvelles_sections(FILE *f_read, FILE *f_write, SectionsHeadersList NewShList, SectionsHeadersList OldShList){
	int i,num_sh_new,num_sh_old;
	unsigned char *section;
	// pour chaque section
	for(num_sh_new=1; num_sh_new<NewShList.size; num_sh_new++){
		// on récupère son contenu
		num_sh_old=index_Shdr(NewShList.names+NewShList.headers[num_sh_new].sh_name,OldShList);
		section=recuperer_section_num(f_read,OldShList,num_sh_old);
		// on se place au bon endroit pour l'écrire (on rajoute des 0 si c'est trop loin)
		if(fseek(f_write,NewShList.headers[num_sh_new].sh_offset,0)){
			printf("## Erreur d'écriture des sections ##\n");
			return;
		}
		for(i=0;i<NewShList.headers[num_sh_new].sh_size;i++){
			fputc(section[i],f_write);
		}
		free(section);
	}
	printf("%d sections ont été copiées (section NULL non prise en compte)\n",NewShList.size-1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
leaq 0x28(%rbp), %rax
movq %rax, -0x38(%rbp)
leaq 0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x1, -0x18(%rbp)
movq -0x30(%rbp), %rcx
movl -0x18(%rbp), %eax
cmpl 0x10(%rcx), %eax
jge 0x5398
movq -0x30(%rbp), %rcx
movq -0x38(%rbp), %rax
movq 0x8(%rcx), %rdi
movq (%rcx), %rcx
movslq -0x18(%rbp), %rdx
imulq $0x28, %rdx, %rdx
addq %rdx, %rcx
movl (%rcx), %ecx
addq %rcx, %rdi
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0x3110
movl %eax, %ecx
movq -0x38(%rbp), %rax
movl %ecx, -0x1c(%rbp)
movq -0x8(%rbp), %rdi
movl -0x1c(%rbp), %esi
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0x3600
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, -0x28(%rbp)
movq -0x10(%rbp), %rdi
movq (%rax), %rax
movslq -0x18(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl 0x10(%rax), %eax
movl %eax, %esi
xorl %edx, %edx
callq 0x1100
cmpl $0x0, %eax
je 0x5340
leaq 0x2fae(%rip), %rdi      # 0x82e5
movb $0x0, %al
callq 0x1070
jmp 0x53b0
movl $0x0, -0x14(%rbp)
movq -0x30(%rbp), %rcx
movl -0x14(%rbp), %eax
movq (%rcx), %rcx
movslq -0x18(%rbp), %rdx
imulq $0x28, %rdx, %rdx
addq %rdx, %rcx
cmpl 0x14(%rcx), %eax
jae 0x5381
movq -0x28(%rbp), %rax
movslq -0x14(%rbp), %rcx
movzbl (%rax,%rcx), %edi
movq -0x10(%rbp), %rsi
callq 0x10a0
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x5347
movq -0x28(%rbp), %rdi
callq 0x1030
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x5287
movq -0x30(%rbp), %rax
movl 0x10(%rax), %esi
subl $0x1, %esi
leaq 0x2f63(%rip), %rdi      # 0x830c
movb $0x0, %al
callq 0x1070
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Astor-Bizard[P]ProjetS5_Groupe2/src/correctionSymboles.c
// Function: fwrite32
size_t fwrite32(FILE* f, int mode, uint32_t value) {
	uint32_t bytes;
	if(mode==L_ENDIAN)
		bytes = ByteSwap32(value);
	else
		bytes = value;
	return fwrite(&bytes, 4, 1, f);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
cmpl $0x1, -0xc(%rbp)
jne 0x5424
movl -0x10(%rbp), %eax
shlq $0x18, %rax
movabsq $0xff000000, %rcx       # imm = 0xFF000000
andq %rcx, %rax
movl -0x10(%rbp), %ecx
shlq $0x8, %rcx
andq $0xff0000, %rcx         # imm = 0xFF0000
orq %rcx, %rax
movl -0x10(%rbp), %ecx
shrq $0x8, %rcx
andq $0xff00, %rcx           # imm = 0xFF00
orq %rcx, %rax
movl -0x10(%rbp), %ecx
shrq $0x18, %rcx
andq $0xff, %rcx
orq %rcx, %rax
movl %eax, -0x14(%rbp)
jmp 0x542a
movl -0x10(%rbp), %eax
movl %eax, -0x14(%rbp)
movq -0x8(%rbp), %rcx
leaq -0x14(%rbp), %rdi
movl $0x4, %esi
movl $0x1, %edx
callq 0x1160
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Astor-Bizard[P]ProjetS5_Groupe2/src/correctionSymboles.c
// Function: fwrite16
size_t fwrite16(FILE* f, int mode, uint16_t value) {
	uint16_t bytes;
	if(mode==L_ENDIAN)
		bytes = ByteSwap16(value);
	else
		bytes = value;
	return fwrite(&bytes, 2, 1, f);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movw %dx, %ax
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movw %ax, -0xe(%rbp)
cmpl $0x1, -0xc(%rbp)
jne 0x548d
movzwl -0xe(%rbp), %eax
shll $0x8, %eax
andl $0xff00, %eax           # imm = 0xFF00
movzwl -0xe(%rbp), %ecx
shrl $0x8, %ecx
andl $0xff, %ecx
orl %ecx, %eax
movw %ax, -0x10(%rbp)
jmp 0x5495
movw -0xe(%rbp), %ax
movw %ax, -0x10(%rbp)
movq -0x8(%rbp), %rcx
leaq -0x10(%rbp), %rdi
movl $0x2, %esi
movl $0x1, %edx
callq 0x1160
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Astor-Bizard[P]ProjetS5_Groupe2/src/reimpl_R_ARM.c
// Function: r_arm_abs32
void r_arm_abs32(FILE* oldF, FILE *newF, Elf32_Ehdr oldElfHeader, ListeSymboles symbList, Str_Reloc tableReloc, int index, Elf32_Addr addrDest, unsigned char *sectionARecopier) {
	// (S + A) | T , addresse du symbole + relocation, T = 1 si symbole est du type STT_FUNC sinon 0
	// S = valeur du symbole 
	// A = addend de la relocalisation
	// T = 0
	uint16_t addrSymbole = (255<<8 & tableReloc.Rel[index].r_info)>>8;
	uint32_t addend = (uint32_t) lire_octets(oldElfHeader.e_ident[EI_DATA], oldF, 4);
	uint32_t valeurSymb = (uint32_t) symbList.symboles[addrSymbole].st_value;
	uint32_t res = valeurSymb + addend;
	fwrite32(newF, oldElfHeader.e_ident[EI_DATA], ByteSwap32(res));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movl %ecx, -0x50(%rbp)
movl %edx, %eax
movl -0x50(%rbp), %edx
movl %eax, -0x4c(%rbp)
movq %rsi, %rax
movl -0x4c(%rbp), %esi
movq %rax, -0x48(%rbp)
movq %rdi, %r9
movq -0x48(%rbp), %rdi
leaq 0x60(%rbp), %rcx
leaq 0x48(%rbp), %rax
movq %rax, -0x40(%rbp)
leaq 0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
movq %r9, -0x8(%rbp)
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movq %r8, -0x20(%rbp)
movq 0x8(%rcx), %rcx
movslq -0x14(%rbp), %rdx
movl 0x4(%rcx,%rdx,8), %ecx
andl $0xff00, %ecx           # imm = 0xFF00
shrl $0x8, %ecx
movw %cx, -0x22(%rbp)
movb 0x5(%rax), %al
movq -0x8(%rbp), %rsi
movl $0x4, %edx
movsbl %al, %edi
callq 0x1ae0
movq -0x40(%rbp), %rcx
movq %rax, %rdx
movq -0x38(%rbp), %rax
movl %edx, -0x28(%rbp)
movq (%rcx), %rcx
movzwl -0x22(%rbp), %edx
shlq $0x4, %rdx
addq %rdx, %rcx
movl 0x4(%rcx), %ecx
movl %ecx, -0x2c(%rbp)
movl -0x2c(%rbp), %ecx
addl -0x28(%rbp), %ecx
movl %ecx, -0x30(%rbp)
movq -0x10(%rbp), %rdi
movzbl 0x5(%rax), %esi
movl -0x30(%rbp), %eax
shlq $0x18, %rax
movabsq $0xff000000, %rcx       # imm = 0xFF000000
andq %rcx, %rax
movl -0x30(%rbp), %ecx
shlq $0x8, %rcx
andq $0xff0000, %rcx         # imm = 0xFF0000
orq %rcx, %rax
movl -0x30(%rbp), %ecx
shrq $0x8, %rcx
andq $0xff00, %rcx           # imm = 0xFF00
orq %rcx, %rax
movl -0x30(%rbp), %ecx
shrq $0x18, %rcx
andq $0xff, %rcx
orq %rcx, %rax
movl %eax, %edx
callq 0x53c0
addq $0x50, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/Astor-Bizard[P]ProjetS5_Groupe2/src/reimpl_R_ARM.c
// Function: r_arm_abs16
void r_arm_abs16(FILE* oldF, FILE *newF, Elf32_Ehdr oldElfHeader, ListeSymboles symbList, Str_Reloc tableReloc, int index, Elf32_Addr addrDest, unsigned char *sectionARecopier) {
	uint16_t addrSymbole = (255<<8 & tableReloc.Rel[index].r_info)>>8;
	uint16_t addend = (uint16_t) lire_octets(oldElfHeader.e_ident[EI_DATA], oldF, 2);
	uint16_t valeurSymb = (uint16_t) symbList.symboles[addrSymbole].st_value;
	uint16_t res = valeurSymb + addend;
	fwrite16(newF, oldElfHeader.e_ident[EI_DATA], ByteSwap16(res));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movl %ecx, -0x48(%rbp)
movl %edx, %eax
movl -0x48(%rbp), %edx
movl %eax, -0x44(%rbp)
movq %rsi, %rax
movl -0x44(%rbp), %esi
movq %rax, -0x40(%rbp)
movq %rdi, %r9
movq -0x40(%rbp), %rdi
leaq 0x60(%rbp), %rcx
leaq 0x48(%rbp), %rax
movq %rax, -0x38(%rbp)
leaq 0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
movq %r9, -0x8(%rbp)
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movq %r8, -0x20(%rbp)
movq 0x8(%rcx), %rcx
movslq -0x14(%rbp), %rdx
movl 0x4(%rcx,%rdx,8), %ecx
andl $0xff00, %ecx           # imm = 0xFF00
shrl $0x8, %ecx
movw %cx, -0x22(%rbp)
movb 0x5(%rax), %al
movq -0x8(%rbp), %rsi
movl $0x2, %edx
movsbl %al, %edi
callq 0x1ae0
movq -0x38(%rbp), %rcx
movq %rax, %rdx
movq -0x30(%rbp), %rax
movw %dx, -0x24(%rbp)
movq (%rcx), %rcx
movzwl -0x22(%rbp), %edx
shlq $0x4, %rdx
addq %rdx, %rcx
movl 0x4(%rcx), %ecx
movw %cx, -0x26(%rbp)
movzwl -0x26(%rbp), %ecx
movzwl -0x24(%rbp), %edx
addl %edx, %ecx
movw %cx, -0x28(%rbp)
movq -0x10(%rbp), %rdi
movzbl 0x5(%rax), %esi
movzwl -0x28(%rbp), %eax
shll $0x8, %eax
andl $0xff00, %eax           # imm = 0xFF00
movzwl -0x28(%rbp), %ecx
shrl $0x8, %ecx
andl $0xff, %ecx
orl %ecx, %eax
movzwl %ax, %edx
callq 0x5450
addq $0x50, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Astor-Bizard[P]ProjetS5_Groupe2/src/reimpl_R_ARM.c
// Function: r_arm_abs8
void r_arm_abs8(FILE* oldF, FILE *newF, Elf32_Ehdr oldElfHeader, ListeSymboles symbList, Str_Reloc tableReloc, int index, Elf32_Addr addrDest, unsigned char *sectionARecopier) {
	uint16_t addrSymbole = (255<<8 & tableReloc.Rel[index].r_info)>>8;
	uint8_t addend = (uint8_t) lire_octets(oldElfHeader.e_ident[EI_DATA], oldF, 1);
	uint8_t valeurSymb = (uint8_t) symbList.symboles[addrSymbole].st_value;
	uint8_t res = valeurSymb + addend;
	fwrite8(newF, oldElfHeader.e_ident[EI_DATA], res);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movl %ecx, -0x48(%rbp)
movl %edx, %eax
movl -0x48(%rbp), %edx
movl %eax, -0x44(%rbp)
movq %rsi, %rax
movl -0x44(%rbp), %esi
movq %rax, -0x40(%rbp)
movq %rdi, %r9
movq -0x40(%rbp), %rdi
leaq 0x60(%rbp), %rcx
leaq 0x48(%rbp), %rax
movq %rax, -0x38(%rbp)
leaq 0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
movq %r9, -0x8(%rbp)
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movq %r8, -0x20(%rbp)
movq 0x8(%rcx), %rcx
movslq -0x14(%rbp), %rdx
movl 0x4(%rcx,%rdx,8), %ecx
andl $0xff00, %ecx           # imm = 0xFF00
shrl $0x8, %ecx
movw %cx, -0x22(%rbp)
movb 0x5(%rax), %al
movq -0x8(%rbp), %rsi
movl $0x1, %edx
movsbl %al, %edi
callq 0x1ae0
movq -0x38(%rbp), %rcx
movq %rax, %rdx
movq -0x30(%rbp), %rax
movb %dl, -0x23(%rbp)
movq (%rcx), %rcx
movzwl -0x22(%rbp), %edx
shlq $0x4, %rdx
addq %rdx, %rcx
movl 0x4(%rcx), %ecx
movb %cl, -0x24(%rbp)
movzbl -0x24(%rbp), %ecx
movzbl -0x23(%rbp), %edx
addl %edx, %ecx
movb %cl, -0x25(%rbp)
movq -0x10(%rbp), %rdi
movzbl 0x5(%rax), %esi
movzbl -0x25(%rbp), %edx
callq 0x54c0
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/Astor-Bizard[P]ProjetS5_Groupe2/src/reimpl_R_ARM.c
// Function: r_arm_jump24
void r_arm_jump24(FILE* oldF, FILE *newF, Elf32_Ehdr oldElfHeader, ListeSymboles symbList, Str_Reloc tableReloc, int index, Elf32_Addr addrDest, unsigned char *sectionARecopier) {
	// ((S+A) | T) - P
	// P correspond au qqchose dérivé de r_offset du REL (en clair faut juste redécaler sur offset)
	uint16_t addrSymbole = (255<<8 & tableReloc.Rel[index].r_info)>>8;
	uint32_t addend = (uint32_t) lire_octets(oldElfHeader.e_ident[EI_DATA], oldF, 4);
	uint32_t keep = addend & 0xFF000000;
	addend = (addend & 0x00FFFFFF) << 2;
	uint32_t valeurSymb = (uint32_t) symbList.symboles[addrSymbole].st_value;
	uint32_t p = (uint32_t) addrDest + (uint32_t) tableReloc.Rel[index].r_offset; 
	uint32_t res = ((((((valeurSymb + addend) - p) & 0x0FFFFFFE) >> 2) & 0x00FFFFFF) | keep);
	fwrite32(newF, oldElfHeader.e_ident[EI_DATA], ByteSwap32(res));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movl %ecx, -0x60(%rbp)
movl %edx, %eax
movl -0x60(%rbp), %edx
movl %eax, -0x5c(%rbp)
movq %rsi, %rax
movl -0x5c(%rbp), %esi
movq %rax, -0x58(%rbp)
movq %rdi, %r9
movq -0x58(%rbp), %rdi
leaq 0x60(%rbp), %rcx
movq %rcx, -0x48(%rbp)
leaq 0x48(%rbp), %rax
movq %rax, -0x50(%rbp)
leaq 0x10(%rbp), %rax
movq %rax, -0x40(%rbp)
movq %r9, -0x8(%rbp)
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movq %r8, -0x20(%rbp)
movq 0x8(%rcx), %rcx
movslq -0x14(%rbp), %rdx
movl 0x4(%rcx,%rdx,8), %ecx
andl $0xff00, %ecx           # imm = 0xFF00
shrl $0x8, %ecx
movw %cx, -0x22(%rbp)
movb 0x5(%rax), %al
movq -0x8(%rbp), %rsi
movl $0x4, %edx
movsbl %al, %edi
callq 0x1ae0
movq -0x50(%rbp), %rcx
movq -0x48(%rbp), %rdx
movq %rax, %rsi
movq -0x40(%rbp), %rax
movl %esi, -0x28(%rbp)
movl -0x28(%rbp), %esi
andl $0xff000000, %esi       # imm = 0xFF000000
movl %esi, -0x2c(%rbp)
movl -0x28(%rbp), %esi
andl $0xffffff, %esi         # imm = 0xFFFFFF
shll $0x2, %esi
movl %esi, -0x28(%rbp)
movq (%rcx), %rcx
movzwl -0x22(%rbp), %esi
shlq $0x4, %rsi
addq %rsi, %rcx
movl 0x4(%rcx), %ecx
movl %ecx, -0x30(%rbp)
movl -0x18(%rbp), %ecx
movq 0x8(%rdx), %rdx
movslq -0x14(%rbp), %rsi
addl (%rdx,%rsi,8), %ecx
movl %ecx, -0x34(%rbp)
movl -0x30(%rbp), %ecx
addl -0x28(%rbp), %ecx
subl -0x34(%rbp), %ecx
andl $0xffffffe, %ecx        # imm = 0xFFFFFFE
shrl $0x2, %ecx
andl $0xffffff, %ecx         # imm = 0xFFFFFF
orl -0x2c(%rbp), %ecx
movl %ecx, -0x38(%rbp)
movq -0x10(%rbp), %rdi
movzbl 0x5(%rax), %esi
movl -0x38(%rbp), %eax
shlq $0x18, %rax
movabsq $0xff000000, %rcx       # imm = 0xFF000000
andq %rcx, %rax
movl -0x38(%rbp), %ecx
shlq $0x8, %rcx
andq $0xff0000, %rcx         # imm = 0xFF0000
orq %rcx, %rax
movl -0x38(%rbp), %ecx
shrq $0x8, %rcx
andq $0xff00, %rcx           # imm = 0xFF00
orq %rcx, %rax
movl -0x38(%rbp), %ecx
shrq $0x18, %rcx
andq $0xff, %rcx
orq %rcx, %rax
movl %eax, %edx
callq 0x53c0
addq $0x60, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Arlu[P]RDMA-Hello-World/client.c
// Function: chat
void chat()
{
    struct RemoteMR remote_mr = {
            .remote_addr = (uint64_t)ib_res.buf,
            .rkey = ib_res.mr->rkey
    };

    // Send Hello World via send and receive request:
    memcpy(ib_res.buf, MSG_SEND_RECV, sizeof(MSG_SEND_RECV));
    post_send(BUFFER_SIZE);
    wait_completions(SEND_WRID);

    // Send remote address and rkey:
    memcpy(ib_res.buf, &remote_mr, sizeof(struct RemoteMR));
    post_send(sizeof(struct RemoteMR));
    wait_completions(SEND_WRID);

    // Send Hello World via RDMA Read:
    memcpy(ib_res.buf, MSG_READ, sizeof(MSG_READ));
    post_send(1); // Notify the server for read.
    wait_completions(SEND_WRID);

    // Get remote address and rkey:
    post_recv(sizeof(struct RemoteMR));
    wait_completions(RECV_WRID);
    memcpy(&remote_mr, ib_res.buf, sizeof(struct RemoteMR));

    // Send Hello World via RDMA Write:
    memcpy(ib_res.buf, MSG_WRITE, sizeof(MSG_WRITE));
    post_send_write(remote_mr, BUFFER_SIZE);
    wait_completions(WRITE_WRID);

    post_send(1); // Notify the server for continue.
    wait_completions(SEND_WRID);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
leaq 0x3db9(%rip), %rax      # 0x61a8
movq 0x60(%rax), %rax
movq %rax, -0x10(%rbp)
leaq 0x3daa(%rip), %rax      # 0x61a8
movq 0x10(%rax), %rax
movl 0x28(%rax), %eax
movl %eax, -0x8(%rbp)
leaq 0x3d99(%rip), %rax      # 0x61a8
movq 0x60(%rax), %rdi
leaq 0x1bea(%rip), %rsi      # 0x4004
movl $0x23, %edx
callq 0x2170
movl $0x400, %edi            # imm = 0x400
callq 0x3180
movl $0x2, %edi
callq 0x3460
leaq 0x3d69(%rip), %rax      # 0x61a8
movq 0x60(%rax), %rax
movq -0x10(%rbp), %rcx
movq %rcx, (%rax)
movq -0x8(%rbp), %rcx
movq %rcx, 0x8(%rax)
movl $0x10, %edi
callq 0x3180
movl $0x2, %edi
callq 0x3460
leaq 0x3d3b(%rip), %rax      # 0x61a8
movq 0x60(%rax), %rax
movq 0x1baf(%rip), %rcx      # 0x4027
movq %rcx, (%rax)
movq 0x1bad(%rip), %rcx      # 0x402f
movq %rcx, 0x8(%rax)
movq 0x1baa(%rip), %rcx      # 0x4037
movq %rcx, 0x10(%rax)
movl 0x1ba8(%rip), %ecx      # 0x403f
movl %ecx, 0x18(%rax)
movl $0x1, %edi
callq 0x3180
movl $0x2, %edi
callq 0x3460
movl $0x10, %edi
callq 0x30c0
movl $0x1, %edi
callq 0x3460
leaq 0x3cdf(%rip), %rax      # 0x61a8
movq 0x60(%rax), %rax
movq (%rax), %rcx
movq %rcx, -0x10(%rbp)
movq 0x8(%rax), %rax
movq %rax, -0x8(%rbp)
leaq 0x3cc5(%rip), %rax      # 0x61a8
movq 0x60(%rax), %rax
movq 0x1b55(%rip), %rcx      # 0x4043
movq %rcx, (%rax)
movq 0x1b53(%rip), %rcx      # 0x404b
movq %rcx, 0x8(%rax)
movq 0x1b50(%rip), %rcx      # 0x4053
movq %rcx, 0x10(%rax)
movl 0x1b4e(%rip), %ecx      # 0x405b
movl %ecx, 0x18(%rax)
movb 0x1b49(%rip), %cl       # 0x405f
movb %cl, 0x1c(%rax)
movq -0x10(%rbp), %rdi
movl -0x8(%rbp), %esi
movl $0x400, %edx            # imm = 0x400
callq 0x3360
movl $0x8, %edi
callq 0x3460
movl $0x1, %edi
callq 0x3180
movl $0x2, %edi
callq 0x3460
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/Arlu[P]RDMA-Hello-World/client.c
// Function: main
int main(int argc, char *argv[])
{
    if (argc < 2)
    {
        printf("It must get hostname!\n");
        exit(EXIT_FAILURE);
    }

    server_name = strdup(argv[1]);

    if (setup_ib())
    {
        perror("Failed to setup IB.");
    }

    chat();

    close_ib_connection();

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpl $0x2, -0x8(%rbp)
jge 0x2584
leaq 0x1aed(%rip), %rdi      # 0x4060
movb $0x0, %al
callq 0x20d0
movl $0x1, %edi
callq 0x2240
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x22b0
movq %rax, %rcx
leaq 0x3bed(%rip), %rax      # 0x6188
movq %rcx, (%rax)
movb $0x0, %al
callq 0x2a40
cmpl $0x0, %eax
je 0x25b6
leaq 0x1ac6(%rip), %rdi      # 0x4077
callq 0x2210
callq 0x23e0
movb $0x0, %al
callq 0x2ff0
xorl %eax, %eax
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Arlu[P]RDMA-Hello-World/setup_ib.c
// Function: connect_between_qps
int connect_between_qps()
{
    struct ibv_qp_attr qp_attr = {
            .qp_state		= IBV_QPS_RTR,
            .path_mtu		= MTU,
            .dest_qp_num	= remote_dest.qpn,
            .rq_psn			= remote_dest.psn,
            .max_dest_rd_atomic	= 1,
            .min_rnr_timer		= 12,
            .ah_attr		= {
                    .is_global	= 0,
                    .dlid		= remote_dest.lid,
                    .sl		= 0,
                    .src_path_bits	= 0,
                    .port_num	= IB_PORT
            }
    };

    if (ibv_modify_qp(ib_res.qp, &qp_attr, IBV_QP_STATE | IBV_QP_PATH_MTU | IBV_QP_DEST_QPN | IBV_QP_RQ_PSN |
                                           IBV_QP_MAX_DEST_RD_ATOMIC | IBV_QP_MIN_RNR_TIMER | IBV_QP_AV)) {
        perror("Failed to modify QP to RTR.\n");
        return 1;
    }

    qp_attr.qp_state	    = IBV_QPS_RTS;
    qp_attr.timeout	    = 14;
    qp_attr.retry_cnt	    = 7;
    qp_attr.rnr_retry	    = 7;
    qp_attr.sq_psn	        = local_dest.psn;
    qp_attr.max_rd_atomic  = 1;
    if (ibv_modify_qp(ib_res.qp, &qp_attr, IBV_QP_STATE | IBV_QP_TIMEOUT | IBV_QP_RETRY_CNT |
                                           IBV_QP_RNR_RETRY | IBV_QP_SQ_PSN | IBV_QP_MAX_QP_RD_ATOMIC))
    {
        perror("Failed to modify QP to RTS.\n");
        return 1;
    }

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
leaq -0x98(%rbp), %rdi
xorl %esi, %esi
movl $0x90, %edx
callq 0x2110
movl $0x2, -0x98(%rbp)
movl $0x5, -0x90(%rbp)
movl 0x382c(%rip), %eax      # 0x61a4
movl %eax, -0x84(%rbp)
movl 0x381c(%rip), %eax      # 0x61a0
movl %eax, -0x7c(%rbp)
movl 0x380f(%rip), %eax      # 0x619c
movw %ax, -0x48(%rbp)
movb $0x1, -0x42(%rbp)
movb $0x1, -0x19(%rbp)
movb $0xc, -0x18(%rbp)
movq 0x3824(%rip), %rdi      # 0x61c8
leaq -0x98(%rbp), %rsi
movl $0x129181, %edx         # imm = 0x129181
callq 0x2050
cmpl $0x0, %eax
je 0x29cf
leaq 0x1761(%rip), %rdi      # 0x4122
callq 0x2210
movl $0x1, -0x4(%rbp)
jmp 0x2a2b
movl $0x3, -0x98(%rbp)
movb $0xe, -0x16(%rbp)
movb $0x7, -0x15(%rbp)
movb $0x7, -0x14(%rbp)
movl 0x37ad(%rip), %eax      # 0x6198
movl %eax, -0x80(%rbp)
movb $0x1, -0x1a(%rbp)
movq 0x37cf(%rip), %rdi      # 0x61c8
leaq -0x98(%rbp), %rsi
movl $0x12e01, %edx          # imm = 0x12E01
callq 0x2050
cmpl $0x0, %eax
je 0x2a24
leaq 0x1729(%rip), %rdi      # 0x413f
callq 0x2210
movl $0x1, -0x4(%rbp)
jmp 0x2a2b
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xa0, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Arlu[P]RDMA-Hello-World/helper.c
// Function: post_recv
int post_recv(int size)
{
    struct ibv_sge list = {
            .addr	= (uint64_t)ib_res.buf,
            .length = size,
            .lkey	= ib_res.mr->lkey
    };

    struct ibv_recv_wr *bad_wr, wr = {
            .wr_id	    = RECV_WRID,
            .sg_list    = &list,
            .num_sge    = 1,
            .next       = NULL
    };

    ibv_post_recv(ib_res.qp, &wr, &bad_wr);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movl %edi, -0x8(%rbp)
leaq 0x30d6(%rip), %rax      # 0x61a8
movq 0x60(%rax), %rax
movq %rax, -0x18(%rbp)
movl -0x8(%rbp), %eax
movl %eax, -0x10(%rbp)
leaq 0x30c1(%rip), %rax      # 0x61a8
movq 0x10(%rax), %rax
movl 0x24(%rax), %eax
movl %eax, -0xc(%rbp)
movq $0x1, -0x40(%rbp)
movq $0x0, -0x38(%rbp)
leaq -0x18(%rbp), %rax
movq %rax, -0x30(%rbp)
movl $0x1, -0x28(%rbp)
leaq 0x3091(%rip), %rax      # 0x61a8
movq 0x20(%rax), %rdi
leaq -0x40(%rbp), %rsi
leaq -0x20(%rbp), %rdx
callq 0x3140
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Arlu[P]RDMA-Hello-World/helper.c
// Function: post_send
int post_send(int size)
{
    struct ibv_sge list = {
            .addr	= (uint64_t)ib_res.buf,
            .length = size,
            .lkey	= ib_res.mr->lkey
    };

    struct ibv_send_wr *bad_wr, wr = {
            .wr_id	    = SEND_WRID,
            .sg_list    = &list,
            .num_sge    = 1,
            .opcode     = IBV_WR_SEND,
            .send_flags = IBV_SEND_SIGNALED,
            .next       = NULL
    };

    return ibv_post_send(ib_res.qp, &wr, &bad_wr);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movl %edi, -0x4(%rbp)
leaq 0x3013(%rip), %rax      # 0x61a8
movq 0x60(%rax), %rax
movq %rax, -0x18(%rbp)
movl -0x4(%rbp), %eax
movl %eax, -0x10(%rbp)
leaq 0x2ffe(%rip), %rax      # 0x61a8
movq 0x10(%rax), %rax
movl 0x24(%rax), %eax
movl %eax, -0xc(%rbp)
leaq -0xa0(%rbp), %rdi
xorl %esi, %esi
movl $0x80, %edx
callq 0x2110
movq $0x2, -0xa0(%rbp)
leaq -0x18(%rbp), %rax
movq %rax, -0x90(%rbp)
movl $0x1, -0x88(%rbp)
movl $0x2, -0x84(%rbp)
movl $0x2, -0x80(%rbp)
leaq 0x2fa9(%rip), %rax      # 0x61a8
movq 0x20(%rax), %rdi
leaq -0xa0(%rbp), %rsi
leaq -0x20(%rbp), %rdx
callq 0x3220
addq $0xa0, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/Arlu[P]RDMA-Hello-World/helper.c
// Function: post_send_read
int post_send_read(struct RemoteMR remote_mr, int size)
{
    struct ibv_sge list = {
            .addr	= (uint64_t)ib_res.buf,
            .length = size,
            .lkey	= ib_res.mr->lkey
    };

    struct ibv_send_wr *bad_wr, wr = {
            .wr_id	    = READ_WRID,
            .sg_list    = &list,
            .num_sge    = 1,
            .opcode     = IBV_WR_RDMA_READ,
            .send_flags = IBV_SEND_SIGNALED,
            .wr.rdma.remote_addr = remote_mr.remote_addr,
            .wr.rdma.rkey = remote_mr.rkey,
            .next       = NULL
    };

    ibv_post_send(ib_res.qp, &wr, &bad_wr);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movq %rdi, -0x18(%rbp)
movl %esi, -0x10(%rbp)
movl %edx, -0x1c(%rbp)
leaq 0x2f2c(%rip), %rax      # 0x61a8
movq 0x60(%rax), %rax
movq %rax, -0x30(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, -0x28(%rbp)
leaq 0x2f17(%rip), %rax      # 0x61a8
movq 0x10(%rax), %rax
movl 0x24(%rax), %eax
movl %eax, -0x24(%rbp)
movq $0x4, -0xb8(%rbp)
movq $0x0, -0xb0(%rbp)
leaq -0x30(%rbp), %rax
movq %rax, -0xa8(%rbp)
movl $0x1, -0xa0(%rbp)
movl $0x4, -0x9c(%rbp)
movl $0x2, -0x98(%rbp)
leaq -0xb8(%rbp), %rdi
addq $0x24, %rdi
xorl %esi, %esi
movl $0x4, %edx
callq 0x2110
movq -0x18(%rbp), %rax
movq %rax, -0x90(%rbp)
movl -0x10(%rbp), %eax
movl %eax, -0x88(%rbp)
leaq -0xb8(%rbp), %rdi
addq $0x48, %rdi
xorl %esi, %esi
movl $0x4, %edx
callq 0x2110
leaq -0xb8(%rbp), %rdi
addq $0x50, %rdi
xorl %esi, %esi
movl $0x30, %edx
callq 0x2110
leaq 0x2e6e(%rip), %rax      # 0x61a8
movq 0x20(%rax), %rdi
leaq -0xb8(%rbp), %rsi
leaq -0x38(%rbp), %rdx
callq 0x3220
movl -0x4(%rbp), %eax
addq $0xc0, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Arlu[P]RDMA-Hello-World/helper.c
// Function: post_send_write
int post_send_write(struct RemoteMR remote_mr, int size)
{
    struct ibv_sge list = {
            .addr	= (uint64_t)ib_res.buf,
            .length = size,
            .lkey	= ib_res.mr->lkey
    };

    struct ibv_send_wr *bad_wr, wr = {
            .wr_id	    = WRITE_WRID,
            .sg_list    = &list,
            .num_sge    = 1,
            .opcode     = IBV_WR_RDMA_WRITE,
            .send_flags = IBV_SEND_SIGNALED,
            .wr.rdma.remote_addr = remote_mr.remote_addr,
            .wr.rdma.rkey = remote_mr.rkey,
            .next       = NULL
    };

    ibv_post_send(ib_res.qp, &wr, &bad_wr);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movq %rdi, -0x18(%rbp)
movl %esi, -0x10(%rbp)
movl %edx, -0x1c(%rbp)
leaq 0x2e2c(%rip), %rax      # 0x61a8
movq 0x60(%rax), %rax
movq %rax, -0x30(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, -0x28(%rbp)
leaq 0x2e17(%rip), %rax      # 0x61a8
movq 0x10(%rax), %rax
movl 0x24(%rax), %eax
movl %eax, -0x24(%rbp)
movq $0x8, -0xb8(%rbp)
movq $0x0, -0xb0(%rbp)
leaq -0x30(%rbp), %rax
movq %rax, -0xa8(%rbp)
movl $0x1, -0xa0(%rbp)
movl $0x0, -0x9c(%rbp)
movl $0x2, -0x98(%rbp)
leaq -0xb8(%rbp), %rdi
addq $0x24, %rdi
xorl %esi, %esi
movl $0x4, %edx
callq 0x2110
movq -0x18(%rbp), %rax
movq %rax, -0x90(%rbp)
movl -0x10(%rbp), %eax
movl %eax, -0x88(%rbp)
leaq -0xb8(%rbp), %rdi
addq $0x48, %rdi
xorl %esi, %esi
movl $0x4, %edx
callq 0x2110
leaq -0xb8(%rbp), %rdi
addq $0x50, %rdi
xorl %esi, %esi
movl $0x30, %edx
callq 0x2110
leaq 0x2d6e(%rip), %rax      # 0x61a8
movq 0x20(%rax), %rdi
leaq -0xb8(%rbp), %rsi
leaq -0x38(%rbp), %rdx
callq 0x3220
movl -0x4(%rbp), %eax
addq $0xc0, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Arlu[P]RDMA-Hello-World/helper.c
// Function: wait_completions
int wait_completions(int wr_id)
{
    int finished = 0, count = 1;

    while (finished < count)
    {
        struct ibv_wc wc[WC_BATCH];
        int n;
        do {
            n = ibv_poll_cq(ib_res.cq, WC_BATCH, wc);

            if (n < 0)
            {
                fprintf(stderr, "Poll CQ failed %d\n", n);
                return 1;
            }
        } while (n < 1);

        for (int i = 0; i < n; i++)
        {
            if (wc[i].status != IBV_WC_SUCCESS)
            {
                fprintf(stderr, "Failed status %s (%d) for wr_id %d\n",
                        ibv_wc_status_str(wc[i].status), wc[i].status, (int)wc[i].wr_id);
                return 1;
            }

            if (wc[i].wr_id == wr_id)
                finished++;
        }
    }

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x12e0, %rsp           # imm = 0x12E0
movl %edi, -0x8(%rbp)
movl $0x0, -0xc(%rbp)
movl $0x1, -0x10(%rbp)
movl -0xc(%rbp), %eax
cmpl -0x10(%rbp), %eax
jge 0x35ec
jmp 0x348a
leaq 0x2d17(%rip), %rax      # 0x61a8
movq 0x18(%rax), %rdi
leaq -0x12d0(%rbp), %rdx
movl $0x64, %esi
callq 0x3600
movl %eax, -0x12d4(%rbp)
cmpl $0x0, -0x12d4(%rbp)
jge 0x34df
movq 0x2b3c(%rip), %rax      # 0x5ff8
movq (%rax), %rdi
movl -0x12d4(%rbp), %edx
leaq 0xe4e(%rip), %rsi       # 0x431a
movb $0x0, %al
callq 0x2150
movl $0x1, -0x4(%rbp)
jmp 0x35f3
jmp 0x34e1
cmpl $0x1, -0x12d4(%rbp)
jl 0x348a
movl $0x0, -0x12d8(%rbp)
movl -0x12d8(%rbp), %eax
cmpl -0x12d4(%rbp), %eax
jge 0x35e7
movslq -0x12d8(%rbp), %rcx
leaq -0x12d0(%rbp), %rax
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
cmpl $0x0, 0x8(%rax)
je 0x35a7
movq 0x2acc(%rip), %rax      # 0x5ff8
movq (%rax), %rax
movq %rax, -0x12e0(%rbp)
movslq -0x12d8(%rbp), %rcx
leaq -0x12d0(%rbp), %rax
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %edi
callq 0x21d0
movq -0x12e0(%rbp), %rdi
movq %rax, %rdx
movslq -0x12d8(%rbp), %rcx
leaq -0x12d0(%rbp), %rax
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %ecx
movslq -0x12d8(%rbp), %rsi
leaq -0x12d0(%rbp), %rax
imulq $0x30, %rsi, %rsi
addq %rsi, %rax
movq (%rax), %rax
movl %eax, %r8d
leaq 0xd96(%rip), %rsi       # 0x432d
movb $0x0, %al
callq 0x2150
movl $0x1, -0x4(%rbp)
jmp 0x35f3
movslq -0x12d8(%rbp), %rcx
leaq -0x12d0(%rbp), %rax
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movslq -0x8(%rbp), %rcx
cmpq %rcx, %rax
jne 0x35d1
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x35d3
movl -0x12d8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x12d8(%rbp)
jmp 0x34f4
jmp 0x347c
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x12e0, %rsp           # imm = 0x12E0
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/0xADE1A1DE[P]MeasureSuite/lib/src/measuresuite.c
// Function: ms_initialize
int ms_initialize(measuresuite_t *dest_ms, int arg_width, int num_arg_in,
                  int num_arg_out) {

  measuresuite_t ms = create_default_ms();
  *dest_ms = ms;

  if (ms == NULL                     // alloc ok?
      || set_argwidth(ms, arg_width) // set arg width
      || set_argin(ms, num_arg_in)   // set arg in
      || set_argout(ms, num_arg_out) // set arg out
      || validate_num_args(ms)       // validate arg counts
      || init_random(ms)             // initialize randomness structures
      || init_json(ms)               // initialize measure structs
      || init_timer(ms)              // initialize timer structures
  ) {
    return 1;
  }

  ms->errorno = E_SUCCESS;
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movb $0x0, %al
callq 0x3530
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
cmpq $0x0, -0x28(%rbp)
je 0x2a3d
movq -0x28(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x3400
cmpl $0x0, %eax
jne 0x2a3d
movq -0x28(%rbp), %rdi
movl -0x18(%rbp), %esi
callq 0x3440
cmpl $0x0, %eax
jne 0x2a3d
movq -0x28(%rbp), %rdi
movl -0x1c(%rbp), %esi
callq 0x3490
cmpl $0x0, %eax
jne 0x2a3d
movq -0x28(%rbp), %rdi
callq 0x34e0
cmpl $0x0, %eax
jne 0x2a3d
movq -0x28(%rbp), %rdi
callq 0x2fc0
cmpl $0x0, %eax
jne 0x2a3d
movq -0x28(%rbp), %rdi
callq 0x3be0
cmpl $0x0, %eax
jne 0x2a3d
movq -0x28(%rbp), %rdi
callq 0x3d10
cmpl $0x0, %eax
je 0x2a46
movl $0x1, -0x4(%rbp)
jmp 0x2a5b
movq -0x28(%rbp), %rax
movl $0x0, 0x88(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/0xADE1A1DE[P]MeasureSuite/lib/src/measuresuite.c
// Function: ms_unload_all
int ms_unload_all(measuresuite_t ms) {
  for (size_t i = ms->num_functions; i > 0; i--) {
    if (ms_unload_last(ms)) {
      return 1;
    }
  }
  ms->errorno = E_SUCCESS;
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x80(%rax), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jbe 0x2be9
movq -0x10(%rbp), %rdi
callq 0x2c10
cmpl $0x0, %eax
je 0x2bd9
movl $0x1, -0x4(%rbp)
jmp 0x2bfe
jmp 0x2bdb
movq -0x18(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x2bbb
movq -0x10(%rbp), %rax
movl $0x0, 0x88(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/0xADE1A1DE[P]MeasureSuite/lib/src/measuresuite.c
// Function: ms_unload_last
int ms_unload_last(measuresuite_t ms) {
  if (ms->num_functions == 0) {
    ms->errorno = E_INTERNAL_FUNCTIONS__NOTHING_TO_UNLOAD;
    return 1;
  }

  if (unload(ms, ms->num_functions - 1)) {
    return 1;
  }

  ms->errorno = E_SUCCESS;
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x80(%rax)
jne 0x2c41
movq -0x10(%rbp), %rax
movl $0x18, 0x88(%rax)
movl $0x1, -0x4(%rbp)
jmp 0x2c7c
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x80(%rax), %rsi
subq $0x1, %rsi
callq 0x4640
cmpl $0x0, %eax
je 0x2c67
movl $0x1, -0x4(%rbp)
jmp 0x2c7c
movq -0x10(%rbp), %rax
movl $0x0, 0x88(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/0xADE1A1DE[P]MeasureSuite/lib/src/measuresuite.c
// Function: ms_measure
int ms_measure(measuresuite_t ms, int batch_size, int num_batches) {

  if (set_num_batches(ms, num_batches)  // set number of batches
      || set_batch_size(ms, batch_size) // set batch size
      || run_measurement(ms)            // measure
  ) {
    return 1;
  }

  ms->errorno = E_SUCCESS;
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movl -0x18(%rbp), %esi
callq 0x3750
cmpl $0x0, %eax
jne 0x2cd2
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x37a0
cmpl $0x0, %eax
jne 0x2cd2
movq -0x10(%rbp), %rdi
callq 0x41a0
cmpl $0x0, %eax
je 0x2cdb
movl $0x1, -0x4(%rbp)
jmp 0x2cf0
movq -0x10(%rbp), %rax
movl $0x0, 0x88(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/0xADE1A1DE[P]MeasureSuite/lib/src/measuresuite.c
// Function: ms_get_cycles
int ms_get_cycles(measuresuite_t ms, size_t **dest, size_t idx) {
  if (idx >= ms->num_functions) {
    ms->errorno = E_INVALID_INPUT__NUM_IDX_OOB;
    return 1;
  }
  *dest = ms->functions[idx].cycle_results;
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x80(%rcx), %rax
jb 0x2d78
movq -0x10(%rbp), %rax
movl $0x8, 0x88(%rax)
movl $0x1, -0x4(%rbp)
jmp 0x2d9a
movq -0x10(%rbp), %rax
movq 0x70(%rax), %rax
imulq $0x28, -0x20(%rbp), %rcx
addq %rcx, %rax
movq 0x20(%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/0xADE1A1DE[P]MeasureSuite/lib/src/measuresuite.c
// Function: ms_terminate
int ms_terminate(measuresuite_t ms) {
  if (ms == NULL) {
    return 0;
  }
  if (ms_unload_all(ms) // unload all the loaded functions
      || end_random(ms) // free random data spot
      || end_timer(ms)  // free all timer related data
  ) {
    return 1;
  }

  free(ms->json);
  free(ms->functions);
  free(ms->bounds);
  free(ms);
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x2dec
movl $0x0, -0x4(%rbp)
jmp 0x2e56
movq -0x10(%rbp), %rdi
callq 0x2ba0
cmpl $0x0, %eax
jne 0x2e16
movq -0x10(%rbp), %rdi
callq 0x3250
cmpl $0x0, %eax
jne 0x2e16
movq -0x10(%rbp), %rdi
callq 0x3f20
cmpl $0x0, %eax
je 0x2e1f
movl $0x1, -0x4(%rbp)
jmp 0x2e56
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rdi
callq 0x2040
movq -0x10(%rbp), %rax
movq 0x70(%rax), %rdi
callq 0x2040
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x2040
movq -0x10(%rbp), %rdi
callq 0x2040
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/0xADE1A1DE[P]MeasureSuite/lib/src/randomizer.c
// Function: init_random
int init_random(struct measuresuite *ms) {

  size_t count_uint64s = ms->arg_width * ms->num_arg_in;
  // for the measurement / get_one_random_qword
  ms->random_data_len = count_uint64s + 1;

  // sanity check size
  const size_t size_of_random_bin = 102400;
  if (ms->random_data_len > size_of_random_bin) {
    ms->errorno = E_INVALID_INPUT__IN_TOO_LARGE;
    return 1;
  }

  ms->random_data_fd = -1;
  ms->random_data_fd = open(randomfile_name, O_RDONLY);

  if (ms->random_data_fd == -1) {
    ms->errorno = E_INTERNAL_RANDOMNESS__AI__OPEN_FILE;
    ms->additional_info = strerror(errno);
    return 1;
  }

  // allocate data
  ms->random_data = malloc(ms->random_data_len * sizeof(uint64_t));
  if (ms->random_data == NULL) {
    ms->errorno = E_INTERNAL_RANDOMNESS__AI__MALLOC;
    ms->additional_info = strerror(errno);
    return 1;
  }

  // fill
  if (randomize(ms)) {
    return 1;
  }
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq -0x10(%rbp), %rcx
imulq 0x8(%rcx), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rcx
addq $0x1, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x50(%rax)
movq $0x19000, -0x20(%rbp)   # imm = 0x19000
movq -0x10(%rbp), %rax
cmpq $0x19000, 0x50(%rax)    # imm = 0x19000
jbe 0x3020
movq -0x10(%rbp), %rax
movl $0x9, 0x88(%rax)
movl $0x1, -0x4(%rbp)
jmp 0x30f5
movq -0x10(%rbp), %rax
movl $0xffffffff, 0x58(%rax) # imm = 0xFFFFFFFF
leaq 0x4745(%rip), %rdi      # 0x7777
xorl %esi, %esi
movb $0x0, %al
callq 0x21e0
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x58(%rax)
movq -0x10(%rbp), %rax
cmpl $-0x1, 0x58(%rax)
jne 0x307f
movq -0x10(%rbp), %rax
movl $0xd, 0x88(%rax)
callq 0x2050
movl (%rax), %edi
callq 0x2240
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x90(%rax)
movl $0x1, -0x4(%rbp)
jmp 0x30f5
movq -0x10(%rbp), %rax
movq 0x50(%rax), %rdi
shlq $0x3, %rdi
callq 0x21b0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x48(%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x48(%rax)
jne 0x30d7
movq -0x10(%rbp), %rax
movl $0xc, 0x88(%rax)
callq 0x2050
movl (%rax), %edi
callq 0x2240
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x90(%rax)
movl $0x1, -0x4(%rbp)
jmp 0x30f5
movq -0x10(%rbp), %rdi
callq 0x3100
cmpl $0x0, %eax
je 0x30ee
movl $0x1, -0x4(%rbp)
jmp 0x30f5
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/0xADE1A1DE[P]MeasureSuite/lib/src/randomizer.c
// Function: randomize
int randomize(struct measuresuite *ms) {
  if (ms->random_data_fd == -1) {
    ms->errorno = E_INTERNAL_RANDOMNESS__UNINITIALIZED;
    return 1;
  }

  size_t len = ms->random_data_len * sizeof(uint64_t);
  size_t bytes_read = read(ms->random_data_fd, ms->random_data, len);
  if (len != bytes_read) {
    // don't care if its EOF (bytes_read == 0) or fail (bytes_read == -1)
    ms->errorno = E_INTERNAL_RANDOMNESS__AI__READ;
    ms->additional_info = strerror(errno);
    return 1;
  }

  if (ms->bounds != NULL) {
    // only set the bound for the data required. otherwise, It will overwrite
    // data somewhere...
    for (size_t i_na = 0; i_na < ms->num_arg_in; i_na++) {
      for (size_t i_w = 0; i_w < ms->arg_width; i_w++) {
        uint64_t *data = ms->random_data + (i_na * ms->arg_width) + i_w;
        *data &= ms->bounds[i_w];
      }
    }
  }
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpl $-0x1, 0x58(%rax)
jne 0x3130
movq -0x10(%rbp), %rax
movl $0x10, 0x88(%rax)
movl $0x1, -0x4(%rbp)
jmp 0x3242
movq -0x10(%rbp), %rax
movq 0x50(%rax), %rax
shlq $0x3, %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movl 0x58(%rax), %edi
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rsi
movq -0x18(%rbp), %rdx
callq 0x2140
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
cmpq -0x20(%rbp), %rax
je 0x319a
movq -0x10(%rbp), %rax
movl $0xe, 0x88(%rax)
callq 0x2050
movl (%rax), %edi
callq 0x2240
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x90(%rax)
movl $0x1, -0x4(%rbp)
jmp 0x3242
movq -0x10(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x323b
movq $0x0, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jae 0x3239
movq $0x0, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x3226
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
movq -0x28(%rbp), %rcx
movq -0x10(%rbp), %rdx
imulq (%rdx), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq -0x30(%rbp), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x30(%rbp), %rcx
movq (%rax,%rcx,8), %rcx
movq -0x38(%rbp), %rax
andq (%rax), %rcx
movq %rcx, (%rax)
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x31c7
jmp 0x3228
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x31b1
jmp 0x323b
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/0xADE1A1DE[P]MeasureSuite/lib/src/randomizer.c
// Function: end_random
int end_random(struct measuresuite *ms) {
  // free field
  free(ms->random_data);
  ms->random_data = NULL;

  // sanity check
  if (ms->random_data_fd != -1) {
    if (close(ms->random_data_fd)) {
      ms->errorno = E_INTERNAL_RANDOMNESS__AI__CLOSE_FILE;
      ms->additional_info = strerror(errno);
      return 1;
    }
  }
  ms->random_data_fd = -1;
  ms->random_data_len = 0;
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rdi
callq 0x2040
movq -0x10(%rbp), %rax
movq $0x0, 0x48(%rax)
movq -0x10(%rbp), %rax
cmpl $-0x1, 0x58(%rax)
je 0x32c3
movq -0x10(%rbp), %rax
movl 0x58(%rax), %edi
callq 0x2130
cmpl $0x0, %eax
je 0x32c1
movq -0x10(%rbp), %rax
movl $0xf, 0x88(%rax)
callq 0x2050
movl (%rax), %edi
callq 0x2240
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x90(%rax)
movl $0x1, -0x4(%rbp)
jmp 0x32e1
jmp 0x32c3
movq -0x10(%rbp), %rax
movl $0xffffffff, 0x58(%rax) # imm = 0xFFFFFFFF
movq -0x10(%rbp), %rax
movq $0x0, 0x50(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/0xADE1A1DE[P]MeasureSuite/lib/src/randomizer.c
// Function: get_random_qword
int get_random_qword(struct measuresuite *ms, uint64_t *dest) {
  if (ms->random_data == NULL ||
      ms->random_data_len < 1 // because it would be more than 0 if it would
                              // have been initialized correctly
  ) {
    ms->errorno = E_INTERNAL_RANDOMNESS__UNINITIALIZED;
    return 1;
  }

  *dest = ms->random_data[ms->random_data_len - 1];
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x48(%rax)
je 0x3312
movq -0x10(%rbp), %rax
cmpq $0x1, 0x50(%rax)
jae 0x3329
movq -0x10(%rbp), %rax
movl $0x10, 0x88(%rax)
movl $0x1, -0x4(%rbp)
jmp 0x334f
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x50(%rcx), %rcx
subq $0x1, %rcx
movq (%rax,%rcx,8), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)