LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/carlitosmarin[P]Sistema-Ficheros-SOII/./src/ficheros.c
// Function: mi_chmod_f
int mi_chmod_f (unsigned int inodo, unsigned char permisos) {
	struct inodo in;
	in = leer_inodo(inodo);
	if(permisos < 0 || permisos > 7) return -2; // Error PERMISOS_INV
	in.permisos = permisos;
	in.ctime = time(NULL);
	if(escribir_inodo(in, inodo) < 0) return -3; //Escribimos el inodo modificado Error ESCRIBIR_INODO
	return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x100, %rsp            # imm = 0x100
movl %esi, %ebp
movl %edi, %ebx
leaq 0x80(%rsp), %rdi
movl %ebx, %esi
callq 0x1991
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
cmpb $0x7, %bpl
ja 0x2d45
leaq 0x80(%rsp), %r14
movb %bpl, 0x1(%r14)
xorl %edi, %edi
callq 0x1120
movq %rax, 0x18(%r14)
movl $0x10, %ecx
movq %rsp, %rdi
movq %r14, %rsi
rep  movsq (%rsi), %es:(%rdi)
movl %ebx, %edi
callq 0x1918
sarl $0x1f, %eax
andl $-0x3, %eax
addq $0x100, %rsp            # imm = 0x100
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/carlitosmarin[P]Sistema-Ficheros-SOII/./src/ficheros.c
// Function: mi_truncar_f
int mi_truncar_f (unsigned int inodo, unsigned int nbytes) {
	struct inodo in;
	in = leer_inodo(inodo);
	int bytesl;
	if((in.permisos & 2) != 2) return -2; //Error NO_PERMISOS_ESCRITURA
	if(nbytes == 0) bytesl = 0;
	else if(nbytes%tamBloque == 0) bytesl = nbytes/tamBloque;
	else bytesl = nbytes/tamBloque+1;
	if(liberar_bloques_inodo(inodo,bytesl) < 0) return -3; //Error LBI
	in = leer_inodo(inodo);
	in.mtime = time(NULL);
	in.ctime = time(NULL);
	in.tamBytesLogicos = nbytes;
	if(escribir_inodo(in, inodo) < 0) return -4; //Escribimos el inodo modificado Error ESCRIBIR_INODO
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x188, %rsp            # imm = 0x188
movl %esi, %ebp
movl %edi, %ebx
leaq 0x88(%rsp), %r14
movq %r14, %rdi
movl %ebx, %esi
callq 0x1991
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
testb $0x2, 0x1(%r14)
je 0x2e0d
testl %ebp, %ebp
je 0x2d9c
movl %ebp, %eax
andl $0x3ff, %eax            # imm = 0x3FF
movl %ebp, %esi
shrl $0xa, %esi
cmpl $0x1, %eax
sbbl $-0x1, %esi
jmp 0x2d9e
xorl %esi, %esi
movl %ebx, %edi
callq 0x1bd1
testl %eax, %eax
js 0x2e08
leaq 0x108(%rsp), %r14
movq %r14, %rdi
movl %ebx, %esi
callq 0x1991
leaq 0x88(%rsp), %r15
movl $0x10, %ecx
movq %r15, %rdi
movq %r14, %rsi
rep  movsq (%rsi), %es:(%rdi)
xorl %edi, %edi
callq 0x1120
movq %rax, 0x10(%r15)
xorl %edi, %edi
callq 0x1120
movq %rax, 0x18(%r15)
movl %ebp, 0x24(%r15)
movl $0x10, %ecx
movq %rsp, %rdi
movq %r15, %rsi
rep  movsq (%rsi), %es:(%rdi)
movl %ebx, %edi
callq 0x1918
sarl $0x1f, %eax
andl $-0x4, %eax
jmp 0x2e0d
movl $0xfffffffd, %eax       # imm = 0xFFFFFFFD
addq $0x188, %rsp            # imm = 0x188
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/carlitosmarin[P]Sistema-Ficheros-SOII/./src/ficheros.c
// Function: mi_stat_f
int mi_stat_f (unsigned int inodo, struct STAT *stat) {
	struct inodo in;
	in = leer_inodo(inodo);

	//Devolvemos la informacion
	stat->tipo = in.tipo;
	stat->permisos = in.permisos;
	stat->atime = in.atime;
	stat->mtime = in.mtime;
	stat->ctime = in.ctime;
	stat->cantLinks = in.cantLinks;
	stat->tamBytesLogicos = in.tamBytesLogicos;
	stat->cantBloquesOcupados = in.cantBloquesOcupados;

	return 0;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x88, %rsp
movq %rsi, %rbx
movl %edi, %esi
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x1991
movzwl (%r14), %eax
movups 0x8(%r14), %xmm0
movups 0x18(%r14), %xmm1
movl 0x28(%r14), %ecx
movw %ax, (%rbx)
movups %xmm0, 0x8(%rbx)
movups %xmm1, 0x18(%rbx)
movl %ecx, 0x28(%rbx)
xorl %eax, %eax
addq $0x88, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/carlitosmarin[P]Sistema-Ficheros-SOII/./src/directorios.c
// Function: extraer_camino
int extraer_camino (const char *camino, char *inicial, char *final) {
	int i = 1, f = 0;

	if (camino[0]!='/') return -1; //Error CAMINO_INV

	//Para obtener el directorio inicial
	while ((camino[i] != '/') && (camino[i] != '\0')){
		inicial[i-1] = camino[i];
		i++;
	}

	if (i == strlen(camino)) { //Se trata de un fichero
		final = "\0";
		return 1; // FICHERO
	}

	while (i < strlen(camino)) {
		final[f] = camino[i];
		i++; f++;
	}
	return 0; //DIRECTORIO
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpb $0x2f, (%rdi)
jne 0x2ed7
movq %rdx, %rbx
movq %rdi, %r14
movl $0x1, %r15d
movzbl (%r14,%r15), %eax
testl %eax, %eax
je 0x2e9a
cmpl $0x2f, %eax
je 0x2e9a
movb %al, -0x1(%rsi,%r15)
incq %r15
jmp 0x2e82
movq %r14, %rdi
callq 0x1080
movl $0x1, %ebp
cmpq %r15, %rax
je 0x2ed7
movl %r15d, %r12d
movq %r14, %rdi
callq 0x1080
xorl %ebp, %ebp
cmpq %r12, %rax
jbe 0x2ed7
movb (%r14,%r15), %al
movb %al, (%rbx)
incq %r15
movq %r14, %rdi
callq 0x1080
incq %rbx
cmpq %r15, %rax
ja 0x2ebe
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/carlitosmarin[P]Sistema-Ficheros-SOII/./src/directorios.c
// Function: mi_creat
int mi_creat (const char *camino, unsigned char permisos) {
	unsigned int pid = 0, pi = 0, pe = 0;
	mi_waitSem();
	int BE = buscar_entrada(camino, &pid, &pi, &pe, 1, permisos);
	if(BE < 0) { //Tratamiento de errores
		switch(BE){
		case -1: printf("\"%s\" Camino no valido\n", camino); break;
		case -2: printf("No tienes permisos de lectura\n"); break;
		case -3: printf("Error en la lectura de la entrada \"%s\"\n", camino); break;
		case -4: printf("No existe la entrada \"%s\"\n", camino); break;
		case -5: printf("Error a la hora de reservar un inodo"); break;
		case -6: printf("No existe directorio intermedio a \"%s\"", camino); break;
		case -7: printf("Error a la hora de liberar un inodo"); break;
		case -8: printf("Error en la escritura de la entrada \"%s\"\n", camino); break;
		case -9: printf("Ya existe la entrada \"%s\"\n", camino); break;
		}
		puts("Falla MI_CREAT");
		mi_signalSem();
		return -1; //Error BE
	}
	mi_signalSem();
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %esi, %r14d
movq %rdi, %rbx
xorl %ebp, %ebp
leaq 0x14(%rsp), %r15
movl %ebp, (%r15)
leaq 0x10(%rsp), %r12
movl %ebp, (%r12)
leaq 0xc(%rsp), %r13
movl %ebp, (%r13)
xorl %eax, %eax
callq 0x1355
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
movq %r13, %rcx
movl $0x1, %r8d
movl %r14d, %r9d
callq 0x2ee2
testl %eax, %eax
jns 0x32ca
addl $0x9, %eax
leaq 0xfed(%rip), %rcx       # 0x4238
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x1217(%rip), %rdi      # 0x4472
jmp 0x32af
leaq 0x1174(%rip), %rdi      # 0x43d8
jmp 0x326d
leaq 0x11b7(%rip), %rdi      # 0x4424
xorl %eax, %eax
callq 0x1090
jmp 0x32b9
leaq 0x1180(%rip), %rdi      # 0x43fd
jmp 0x32af
leaq 0x127d(%rip), %rdi      # 0x4503
callq 0x1060
jmp 0x32b9
leaq 0x11b4(%rip), %rdi      # 0x4448
jmp 0x32af
leaq 0x1120(%rip), %rdi      # 0x43bd
jmp 0x32af
leaq 0x10ef(%rip), %rdi      # 0x4395
jmp 0x32af
leaq 0x10cf(%rip), %rdi      # 0x437e
movq %rbx, %rsi
xorl %eax, %eax
callq 0x1090
leaq 0x11cd(%rip), %rdi      # 0x448d
callq 0x1060
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
xorl %eax, %eax
callq 0x1361
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/carlitosmarin[P]Sistema-Ficheros-SOII/./src/directorios.c
// Function: mi_chmod
int mi_chmod (const char *camino, unsigned char permisos) {
	int pid = 0, pi = 0, pe = 0;
	int BE = buscar_entrada(camino, &pid, &pi, &pe, 0, 0);

	if(BE < 0) { //Tratamiento de errores
		switch(BE){
		case -1: printf("\"%s\" Camino no valido\n", camino); break;
		case -2: printf("No tienes permisos de lectura\n"); break;
		case -3: printf("Error en la lectura de la entrada \"%s\"\n", camino); break;
		case -4: printf("No existe la entrada \"%s\"\n", camino); break;
		case -5: printf("Error a la hora de reservar un inodo"); break;
		case -6: printf("No existe directorio intermedio a \"%s\"", camino); break;
		case -7: printf("Error a la hora de liberar un inodo"); break;
		case -8: printf("Error en la escritura de la entrada \"%s\"\n", camino); break;
		case -9: printf("Ya existe la entrada \"%s\"\n", camino); break;
		}
		return -1; //Error BE
	} else {
		if(mi_chmod_f(pi,permisos) < 0) return -2; //Error CHMOD
	}
	return 0;
}

// Assembly:
pushq %rbp
pushq %rbx
subq $0x18, %rsp
movl %esi, %ebp
movq %rdi, %rbx
xorl %eax, %eax
leaq 0x14(%rsp), %rsi
movl %eax, (%rsi)
leaq 0xc(%rsp), %rdx
movl %eax, (%rdx)
leaq 0x10(%rsp), %rcx
movl %eax, (%rcx)
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x2ee2
testl %eax, %eax
js 0x3a41
movl 0xc(%rsp), %edi
movzbl %bpl, %esi
callq 0x2cea
sarl $0x1f, %eax
andl $-0x2, %eax
jmp 0x3abe
addl $0x9, %eax
leaq 0x8a1(%rip), %rcx       # 0x42ec
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0xa17(%rip), %rdi       # 0x4472
jmp 0x3aaf
leaq 0x974(%rip), %rdi       # 0x43d8
jmp 0x3a6d
leaq 0x9b7(%rip), %rdi       # 0x4424
xorl %eax, %eax
callq 0x1090
jmp 0x3ab9
leaq 0x980(%rip), %rdi       # 0x43fd
jmp 0x3aaf
leaq 0xa7d(%rip), %rdi       # 0x4503
callq 0x1060
jmp 0x3ab9
leaq 0x9b4(%rip), %rdi       # 0x4448
jmp 0x3aaf
leaq 0x920(%rip), %rdi       # 0x43bd
jmp 0x3aaf
leaq 0x8ef(%rip), %rdi       # 0x4395
jmp 0x3aaf
leaq 0x8cf(%rip), %rdi       # 0x437e
movq %rbx, %rsi
xorl %eax, %eax
callq 0x1090
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/carlitosmarin[P]Sistema-Ficheros-SOII/./src/directorios.c
// Function: mi_stat
int mi_stat (const char *camino, struct STAT *p_stat) {
	int pid = 0, pi = 0, pe = 0;
	int BE = buscar_entrada(camino, &pid, &pi, &pe, 0, 0);

	if(BE < 0) { //Tratamiento de errores
		switch(BE){
		case -1: printf("\"%s\" Camino no valido\n", camino); break;
		case -2: printf("No tienes permisos de lectura\n"); break;
		case -3: printf("Error en la lectura de la entrada \"%s\"\n", camino); break;
		case -4: printf("No existe la entrada \"%s\"\n", camino); break;
		case -5: printf("Error a la hora de reservar un inodo"); break;
		case -6: printf("No existe directorio intermedio a \"%s\"", camino); break;
		case -7: printf("Error a la hora de liberar un inodo"); break;
		case -8: printf("Error en la escritura de la entrada \"%s\"\n", camino); break;
		case -9: printf("Ya existe la entrada \"%s\"\n", camino); break;
		}
		return -1; //Error BE
	} else {
		if(mi_stat_f(pi,p_stat) < 0) return -2; //Error STAT
	}
	return 0;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %rbx
xorl %eax, %eax
leaq 0x14(%rsp), %rsi
movl %eax, (%rsi)
leaq 0xc(%rsp), %rdx
movl %eax, (%rdx)
leaq 0x10(%rsp), %rcx
movl %eax, (%rcx)
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x2ee2
testl %eax, %eax
js 0x3b0c
movl 0xc(%rsp), %edi
movq %r14, %rsi
callq 0x2e1b
sarl $0x1f, %eax
andl $-0x2, %eax
jmp 0x3b89
addl $0x9, %eax
leaq 0x7fa(%rip), %rcx       # 0x4310
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x94c(%rip), %rdi       # 0x4472
jmp 0x3b7a
leaq 0x8a9(%rip), %rdi       # 0x43d8
jmp 0x3b38
leaq 0x8ec(%rip), %rdi       # 0x4424
xorl %eax, %eax
callq 0x1090
jmp 0x3b84
leaq 0x8b5(%rip), %rdi       # 0x43fd
jmp 0x3b7a
leaq 0x9b2(%rip), %rdi       # 0x4503
callq 0x1060
jmp 0x3b84
leaq 0x8e9(%rip), %rdi       # 0x4448
jmp 0x3b7a
leaq 0x855(%rip), %rdi       # 0x43bd
jmp 0x3b7a
leaq 0x824(%rip), %rdi       # 0x4395
jmp 0x3b7a
leaq 0x804(%rip), %rdi       # 0x437e
movq %rbx, %rsi
xorl %eax, %eax
callq 0x1090
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/carlitosmarin[P]Sistema-Ficheros-SOII/./src/directorios.c
// Function: mi_read
int mi_read (const char *camino, void *buf, unsigned int offset, unsigned int nbytes) {
	int pid = 0, pi = 0, pe = 0, bytesLeidos;
	int BE = buscar_entrada(camino, &pid, &pi, &pe, 0, 0);

	if(BE < 0) { //Tratamiento de errores
		switch(BE){
		case -1: printf("\"%s\" Camino no valido\n", camino); break;
		case -2: printf("No tienes permisos de lectura\n"); break;
		case -3: printf("Error en la lectura de la entrada \"%s\"\n", camino); break;
		case -4: printf("No existe la entrada \"%s\"\n", camino); break;
		case -5: printf("Error a la hora de reservar un inodo"); break;
		case -6: printf("No existe directorio intermedio a \"%s\"", camino); break;
		case -7: printf("Error a la hora de liberar un inodo"); break;
		case -8: printf("Error en la escritura de la entrada \"%s\"\n", camino); break;
		case -9: printf("Ya existe la entrada \"%s\"\n", camino); break;
		}
		puts("Falla MI_READ");
		return -1; //Error READ
	} else {
		if((bytesLeidos = mi_read_f(pi,buf,offset,nbytes)) < 0) return -2; //Error READ
	}
	return bytesLeidos;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movl %ecx, %ebp
movl %edx, %r14d
movq %rsi, %r15
movq %rdi, %rbx
xorl %eax, %eax
leaq 0x14(%rsp), %rsi
movl %eax, (%rsi)
leaq 0xc(%rsp), %rdx
movl %eax, (%rdx)
leaq 0x10(%rsp), %rcx
movl %eax, (%rcx)
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x2ee2
testl %eax, %eax
js 0x3bee
movl 0xc(%rsp), %edi
movq %r15, %rsi
movl %r14d, %edx
movl %ebp, %ecx
callq 0x2963
movl %eax, %ecx
testl %eax, %eax
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
cmovnsl %ecx, %eax
jmp 0x3c77
addl $0x9, %eax
leaq 0x73c(%rip), %rcx       # 0x4334
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x86a(%rip), %rdi       # 0x4472
jmp 0x3c5c
leaq 0x7c7(%rip), %rdi       # 0x43d8
jmp 0x3c1a
leaq 0x80a(%rip), %rdi       # 0x4424
xorl %eax, %eax
callq 0x1090
jmp 0x3c66
leaq 0x7d3(%rip), %rdi       # 0x43fd
jmp 0x3c5c
leaq 0x8d0(%rip), %rdi       # 0x4503
callq 0x1060
jmp 0x3c66
leaq 0x807(%rip), %rdi       # 0x4448
jmp 0x3c5c
leaq 0x773(%rip), %rdi       # 0x43bd
jmp 0x3c5c
leaq 0x742(%rip), %rdi       # 0x4395
jmp 0x3c5c
leaq 0x722(%rip), %rdi       # 0x437e
movq %rbx, %rsi
xorl %eax, %eax
callq 0x1090
leaq 0x859(%rip), %rdi       # 0x44c6
callq 0x1060
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/carlitosmarin[P]Sistema-Ficheros-SOII/./src/directorios.c
// Function: mi_write
int mi_write (const char *camino, const void *buf, unsigned int offset, unsigned int nbytes) {
	int pid = 0, pi = 0, pe = 0, bytesLeidos;
	mi_waitSem();
	int BE = buscar_entrada(camino, &pid, &pi, &pe, 0, 6);
	if(BE < 0) { //Tratamiento de errores
		switch(BE){
		case -1: printf("\"%s\" Camino no valido\n", camino); break;
		case -2: printf("No tienes permisos de lectura\n"); break;
		case -3: printf("Error en la lectura de la entrada \"%s\"\n", camino); break;
		case -4: printf("No existe la entrada \"%s\"\n", camino); break;
		case -5: printf("Error a la hora de reservar un inodo"); break;
		case -6: printf("No existe directorio intermedio a \"%s\"", camino); break;
		case -7: printf("Error a la hora de liberar un inodo"); break;
		case -8: printf("Error en la escritura de la entrada \"%s\"\n", camino); break;
		case -9: printf("Ya existe la entrada \"%s\"\n", camino); break;
		}
		mi_signalSem();
		puts("Falla MI_WRITE");
		return -1; //Error READ
	}
	struct inodo in = leer_inodo(pi);
	if(in.tipo != 'f'){
		puts("No se puede leer un directorio."); //Error LECTURA_DIRECTORIO
		mi_signalSem();
		return -3;
	}

	if((bytesLeidos = mi_write_f(pi,buf,offset,nbytes)) < 0) return -2; //Error WRITE
	mi_signalSem();
	return bytesLeidos;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movl %ecx, 0x8(%rsp)
movl %edx, %r14d
movq %rsi, %r15
movq %rdi, %rbx
xorl %eax, %eax
leaq 0x14(%rsp), %r12
movl %eax, (%r12)
leaq 0xc(%rsp), %r13
movl %eax, (%r13)
leaq 0x10(%rsp), %rbp
movl %eax, (%rbp)
xorl %eax, %eax
callq 0x1355
movq %rbx, %rdi
movq %r12, %rsi
movq %r13, %rdx
movq %rbp, %rcx
xorl %r8d, %r8d
movl $0x6, %r9d
callq 0x2ee2
testl %eax, %eax
js 0x3d1c
movl 0xc(%rsp), %ebx
leaq 0x18(%rsp), %r12
movq %r12, %rdi
movl %ebx, %esi
callq 0x1991
cmpb $0x66, (%r12)
jne 0x3d38
movl %ebx, %edi
movq %r15, %rsi
movl %r14d, %edx
movl 0x8(%rsp), %ecx
callq 0x25fc
movl %eax, %ebx
testl %eax, %eax
jns 0x3d49
movl $0xfffffffe, %ebx       # imm = 0xFFFFFFFE
jmp 0x3dc6
addl $0x9, %eax
leaq 0x632(%rip), %rcx       # 0x4358
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x73c(%rip), %rdi       # 0x4472
jmp 0x3da4
leaq 0x7a4(%rip), %rdi       # 0x44e3
callq 0x1060
movl $0xfffffffd, %ebx       # imm = 0xFFFFFFFD
xorl %eax, %eax
callq 0x1361
jmp 0x3dc6
leaq 0x67f(%rip), %rdi       # 0x43d8
jmp 0x3d62
leaq 0x6c2(%rip), %rdi       # 0x4424
xorl %eax, %eax
callq 0x1090
jmp 0x3dae
leaq 0x68b(%rip), %rdi       # 0x43fd
jmp 0x3da4
leaq 0x788(%rip), %rdi       # 0x4503
callq 0x1060
jmp 0x3dae
leaq 0x6bf(%rip), %rdi       # 0x4448
jmp 0x3da4
leaq 0x62b(%rip), %rdi       # 0x43bd
jmp 0x3da4
leaq 0x5fa(%rip), %rdi       # 0x4395
jmp 0x3da4
leaq 0x5da(%rip), %rdi       # 0x437e
movq %rbx, %rsi
xorl %eax, %eax
callq 0x1090
xorl %eax, %eax
callq 0x1361
leaq 0x718(%rip), %rdi       # 0x44d4
callq 0x1060
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/carlitosmarin[P]Sistema-Ficheros-SOII/mi_rm.c
// Function: main
int main (int argc, char **argv) {
	if (argc != 3) {
		printf("Número de parametros incorrectos\n");
		return -1;
	}
	//Montamos el disco
	bmount(argv[1]);

	struct STAT stat;
	if(mi_stat(argv[2],&stat) < 0){
		bumount();
		return 0;
	}

	if(stat.tipo == 'd' && stat.tamBytesLogicos != 0){
		printf("El directorio %s no está vacio, no puede ser borrado\n", argv[2]);
		bumount();
		return 0;
	}
	if(mi_unlink(argv[2]) == 0){
		puts("Se ha borrado correctamente.");
	} else ("Error: No se ha podido eliminar el fichero con mi_rm\n");

	bumount();
	return 0;
}

// Assembly:
pushq %rbx
subq $0x30, %rsp
cmpl $0x3, %edi
jne 0x3e57
movq %rsi, %rbx
movq 0x8(%rsi), %rdi
callq 0x127c
movq 0x10(%rbx), %rdi
movq %rsp, %rsi
callq 0x3ac5
testl %eax, %eax
js 0x3e82
cmpb $0x64, (%rsp)
movq 0x10(%rbx), %rsi
jne 0x3e6a
cmpl $0x0, 0x24(%rsp)
je 0x3e6a
leaq 0x6dc(%rip), %rdi       # 0x452a
xorl %eax, %eax
callq 0x1090
jmp 0x3e82
leaq 0x720(%rip), %rdi       # 0x457e
callq 0x1060
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
jmp 0x3e8b
movq %rsi, %rdi
callq 0x37e8
testl %eax, %eax
jne 0x3e82
leaq 0x6e4(%rip), %rdi       # 0x4561
callq 0x1060
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x12ba
movl %ebx, %eax
addq $0x30, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/aquaxis[P]synverll/src/common.c
// Function: get_width
int get_width(char *buf)
{
	int size = 0;
	
	if(!strcmp(buf, "void")){
		size = 0;
	}else if(!strcmp(buf, "i1")){
		size = 1;
	}else if(!strcmp(buf, "i8")){
		size = 8;
	}else if(!strcmp(buf, "i16")){
		size = 16;
	}else if(!strcmp(buf, "i32")){
		size = 32;
	}else if(buf[strlen(buf)-1] == '*'){
		// �|�C���^�錾(�|�C���^�͍Ō���'*'���t��)
		// �|�C���^��i8*, i16*, i32*, %�\���̖�*, ARRAY�錾*, ���z��
		size = 32;
	}else{
		/*
		 * ToDo:
		 * �������Ə������邱�ƁB���܂̂Ƃ����b�肾���B
		 */
		size = 32;
		printf("[WRANING] get_width(): %s\n", buf);
	}

	return size;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0xcd0b(%rip), %rsi      # 0xe004
callq 0x1110
testl %eax, %eax
je 0x1375
leaq 0xcd00(%rip), %rsi      # 0xe009
movq %rbx, %rdi
callq 0x1110
testl %eax, %eax
je 0x1379
leaq 0xccf0(%rip), %rsi      # 0xe00c
movq %rbx, %rdi
callq 0x1110
testl %eax, %eax
je 0x1380
leaq 0xcce0(%rip), %rsi      # 0xe00f
movq %rbx, %rdi
callq 0x1110
testl %eax, %eax
je 0x1387
leaq 0xdf1b(%rip), %rsi      # 0xf25d
movq %rbx, %rdi
callq 0x1110
movl $0x20, %ebp
testl %eax, %eax
je 0x138c
movq %rbx, %rdi
callq 0x1090
cmpb $0x2a, -0x1(%rbx,%rax)
je 0x138c
leaq 0xccaa(%rip), %rdi      # 0xe013
movq %rbx, %rsi
xorl %eax, %eax
callq 0x10b0
jmp 0x138c
xorl %ebp, %ebp
jmp 0x138c
movl $0x1, %ebp
jmp 0x138c
movl $0x8, %ebp
jmp 0x138c
movl $0x10, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/aquaxis[P]synverll/src/common.c
// Function: convname
char *convname(char *buf)
{
	int i;
	if((buf[0] == '%') || (buf[0] == '@')){
		for(i=0;i<strlen(buf)-1;i++){
			buf[i] = buf[i+1];
		}
		buf[strlen(buf)-1] = 0;
	}
	
	for(i=0;i<strlen(buf);i++){
		if(buf[i] == '.') buf[i] = '_';
	}

	return buf;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movzbl (%rdi), %eax
cmpl $0x40, %eax
je 0x13cc
cmpl $0x25, %eax
jne 0x13fd
movq %rbx, %rdi
callq 0x1090
decq %rax
je 0x13f9
xorl %ecx, %ecx
leaq 0x1(%rcx), %r14
movb 0x1(%rbx,%rcx), %al
movb %al, (%rbx,%rcx)
movq %rbx, %rdi
callq 0x1090
decq %rax
movq %r14, %rcx
cmpq %r14, %rax
ja 0x13db
movb $0x0, (%rbx,%rax)
cmpb $0x0, (%rbx)
je 0x1421
xorl %r14d, %r14d
cmpb $0x2e, (%rbx,%r14)
jne 0x1411
movb $0x5f, (%rbx,%r14)
incq %r14
movq %rbx, %rdi
callq 0x1090
cmpq %r14, %rax
ja 0x1405
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/aquaxis[P]synverll/src/parser.c
// Function: insert_parser_tree
int insert_parser_tree(char *str)
{
    // パーサーツリーの新規登録
    if(parser_tree_top == NULL){
        parser_tree_top     = (PARSER_TREE *)malloc(sizeof(PARSER_TREE));
        parser_tree_current = parser_tree_top;
    }else{
        parser_tree_current->next_ptr   = (PARSER_TREE *)malloc(sizeof(PARSER_TREE));
        parser_tree_prev                = parser_tree_current;
        parser_tree_current             = parser_tree_current->next_ptr;
        parser_tree_current->prev_ptr   = parser_tree_prev;
        parser_tree_current->next_ptr   = NULL;
    }

    // パーサーツリーに文字列の登録
	parser_tree_current->str = charalloc(str);
    return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x12cca(%rip), %r14     # 0x14120
movl $0x6c58, %edi           # imm = 0x6C58
callq 0x1140
testq %r14, %r14
je 0x148b
movq 0x12cbc(%rip), %rcx     # 0x14128
movq %rax, 0x8(%rcx)
movq %rcx, 0x12cb9(%rip)     # 0x14130
movq %rax, 0x12caa(%rip)     # 0x14128
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
jmp 0x1499
movq %rax, 0x12c8e(%rip)     # 0x14120
movq %rax, 0x12c8f(%rip)     # 0x14128
movq %rbx, %rdi
callq 0x1395
movq 0x12c80(%rip), %rcx     # 0x14128
movq %rax, 0x18(%rcx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/aquaxis[P]synverll/src/parser.c
// Function: create_proc_source
int create_proc_source()
{
//    PARSER_TREE *now_parser_tree;
//    PARSER_TREE *parser_tree_process;
//    unsigned int now_level;
    char *token;
    char *line;
    int func_num = 0;
	char *filename;
	FILE *fp;
	int size;
	char *const_header = "#include \"__extern.h\"\n\n\0";

    printf(" -> Create Process Source\n");
	
	token = calloc(STR_MAX, 1);
	line = calloc(STR_MAX, 1);

	filename = (char *)malloc(128);
	memset(filename, 0, 128);

    parser_tree_current = parser_tree_top;
    while(parser_tree_current != NULL){
        if(parser_tree_current->flag == PARSER_FLAG_PROCESS){
			sprintf(filename, "__%03d.c", func_num);
			func_num++;
			fp = fopen(filename, "wb+");
			/*
			 * ToDo: fopenのエラー処理が必要
			 */
			size = strlen(parser_tree_current->line.body);
			fwrite(const_header, 1, strlen(const_header), fp);
			fwrite(parser_tree_current->line.body, 1, size, fp);
			fclose(fp);
        }
        parser_tree_current = parser_tree_current->next_ptr;
    }

	free(token);
	free(line);

	free(filename);

    return func_num;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0xcbd2(%rip), %rdi      # 0xe0b3
callq 0x1070
movl $0x80, %edi
callq 0x1140
movq %rax, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movups %xmm0, 0x10(%rax)
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x30(%rax)
movups %xmm0, 0x40(%rax)
movups %xmm0, 0x50(%rax)
movups %xmm0, 0x60(%rax)
movups %xmm0, 0x70(%rax)
movq 0x12c04(%rip), %rax     # 0x14120
movq %rax, 0x12c05(%rip)     # 0x14128
testq %rax, %rax
je 0x15d3
leaq 0xcb3f(%rip), %r15      # 0xe072
leaq 0xcaf4(%rip), %r12      # 0xe02e
xorl %ebp, %ebp
cmpl $0x19, 0x10(%rax)
jne 0x15b6
movq %rbx, %rdi
leaq 0xeb38(%rip), %rsi      # 0x10084
movl %ebp, %edx
xorl %eax, %eax
callq 0x11b0
incl %ebp
movq %rbx, %rdi
movq %r15, %rsi
callq 0x1170
movq %rax, %r13
movq 0x12bbc(%rip), %rax     # 0x14128
movq 0x6c50(%rax), %rdi
callq 0x1090
movq %rax, %r14
movl $0x1, %esi
movl $0x17, %edx
movq %r12, %rdi
movq %r13, %rcx
callq 0x11d0
movq 0x12b91(%rip), %rax     # 0x14128
movq 0x6c50(%rax), %rdi
movslq %r14d, %rdx
movl $0x1, %esi
movq %r13, %rcx
callq 0x11d0
movq %r13, %rdi
callq 0x1080
movq 0x12b6b(%rip), %rax     # 0x14128
movq 0x8(%rax), %rax
movq %rax, 0x12b60(%rip)     # 0x14128
testq %rax, %rax
jne 0x153c
jmp 0x15d5
xorl %ebp, %ebp
movq %rbx, %rdi
callq 0x1030
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/aquaxis[P]synverll/src/parser_ir.c
// Function: insert_parser_tree_ir
int insert_parser_tree_ir(char *str)
{
    // パーサーツリーの新規登録
    if(parser_tree_ir_top == NULL){
        parser_tree_ir_top     = (PARSER_TREE_IR *)malloc(sizeof(PARSER_TREE_IR));
        memset(parser_tree_ir_top, 0, sizeof(PARSER_TREE_IR));
        parser_tree_ir_current = parser_tree_ir_top;
    }else{
        parser_tree_ir_current->next_ptr   = (PARSER_TREE_IR *)malloc(sizeof(PARSER_TREE_IR));
        memset(parser_tree_ir_current->next_ptr, 0, sizeof(PARSER_TREE_IR));
        parser_tree_ir_prev                = parser_tree_ir_current;
        parser_tree_ir_current             = parser_tree_ir_current->next_ptr;
        parser_tree_ir_current->prev_ptr   = parser_tree_ir_prev;
        parser_tree_ir_current->next_ptr   = NULL;
    }

    // 原文の保存
    parser_tree_ir_current->str = calloc(strlen(str)+1,1);
    strcpy(parser_tree_ir_current->str, str);

    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x12245(%rip), %r15     # 0x14140
movl $0xb838, %edi           # imm = 0xB838
callq 0x1140
movq %rax, %r14
testq %r15, %r15
je 0x1f4d
movq 0x12234(%rip), %r15     # 0x14148
movq %r14, 0x8(%r15)
movl $0xb838, %edx           # imm = 0xB838
movq %r14, %rdi
xorl %esi, %esi
callq 0x10d0
movq %r15, 0x12222(%rip)     # 0x14150
movq 0x8(%r15), %rax
movq %rax, 0x1220f(%rip)     # 0x14148
movq %r15, (%rax)
movq 0x12205(%rip), %rax     # 0x14148
movq $0x0, 0x8(%rax)
jmp 0x1f6a
movq %r14, 0x121ec(%rip)     # 0x14140
movl $0xb838, %edx           # imm = 0xB838
movq %r14, %rdi
xorl %esi, %esi
callq 0x10d0
movq %r14, 0x121de(%rip)     # 0x14148
movq %rbx, %rdi
callq 0x1090
leaq 0x1(%rax), %rdi
movl $0x1, %esi
callq 0x1100
movq 0x121c1(%rip), %rcx     # 0x14148
movq %rax, 0x28(%rcx)
movq %rax, %rdi
movq %rbx, %rsi
callq 0x1060
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/aquaxis[P]synverll/src/parser_ir.c
// Function: clean_parser_tree_ir
int clean_parser_tree_ir()
{
	PARSER_TREE_IR *now_parser_tree_ir;
	PARSER_TREE_IR *new_parser_tree_ir;

    now_parser_tree_ir = parser_tree_ir_top;
    while(1){
        if(now_parser_tree_ir == NULL) break;
        new_parser_tree_ir = now_parser_tree_ir->next_ptr;
		if(now_parser_tree_ir->str != NULL) free(now_parser_tree_ir->str);
        free(now_parser_tree_ir);
        now_parser_tree_ir = new_parser_tree_ir;
    }
    parser_tree_ir_top = NULL;

	if(module_name != NULL){
		free(module_name);
		module_name = NULL;
	}

    return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq 0x12197(%rip), %rbx     # 0x14140
testq %rbx, %rbx
je 0x1fd0
movq 0x8(%rbx), %r14
movq 0x28(%rbx), %rdi
testq %rdi, %rdi
je 0x1fc0
callq 0x1030
movq %rbx, %rdi
callq 0x1030
movq %r14, %rbx
testq %r14, %r14
jne 0x1fae
movq $0x0, 0x12165(%rip) # 0x14140
movq 0x12176(%rip), %rdi     # 0x14158
testq %rdi, %rdi
je 0x1ff7
callq 0x1030
movq $0x0, 0x12161(%rip) # 0x14158
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/aquaxis[P]synverll/src/parser_ir.c
// Function: get_pointer_llvm
int get_pointer_llvm(char *line, char *token)
{
	char *result;
	char *line_org;

	result = calloc(STR_MAX,1 );

	line_org = charalloc(line);

	// getelementptr
	get_token_llvm(line_org, token);
	strcpy(result, "");

	// inbounds
	get_token_llvm(line_org, token);
	strcpy(result, "");

	if(!strcmp(token, "inbounds")){
		// inboundsは無視して良い
		// "("
		get_token_llvm(line_org, token);
	}else{
		/*
		 * %x,@xの場合
		 */
		strcpy(result, token);
		strcpy(token, result);

		free(line_org);
		return 0;
	}

	// Type
	get_irtype_llvm(line_org, token);
	// Name
	get_token_llvm(line_org, token);
	strcpy(result, token);
	strcpy(token, result);

	free(line_org);
	free(result);

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %r15
movl $0x400, %edi            # imm = 0x400
movl $0x1, %esi
callq 0x1100
movq %rax, %rbx
movq %r15, %rdi
callq 0x1395
movq %rax, %r15
movq %rax, %rdi
movq %r14, %rsi
callq 0xcc26
xorl %ebp, %ebp
movb %bpl, (%rbx)
movq %r15, %rdi
movq %r14, %rsi
callq 0xcc26
movb %bpl, (%rbx)
leaq 0xbcd9(%rip), %rsi      # 0xe1c6
movq %r14, %rdi
callq 0x1110
testl %eax, %eax
je 0x2514
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1060
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1060
movq %r15, %rbx
jmp 0x2553
movq %r15, %rdi
movq %r14, %rsi
callq 0xcc26
movq %r15, %rdi
movq %r14, %rsi
callq 0x201a
movq %r15, %rdi
movq %r14, %rsi
callq 0xcc26
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1060
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1060
movq %r15, %rdi
callq 0x1030
movq %rbx, %rdi
callq 0x1030
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/aquaxis[P]synverll/src/parser_ir.c
// Function: get_stage_label
int get_stage_label(char *label)
{
	PARSER_TREE_IR *now_parser_tree_ir;

    now_parser_tree_ir = parser_tree_ir_top;
    while(now_parser_tree_ir != NULL){
		/*
		 * 本当はフラグも一緒に判定しておかなかければいけないかもしれない
		 */
		if(now_parser_tree_ir->flag == PARSER_IR_FLAG_LABEL){
			if(!strcmp(now_parser_tree_ir->label, sep_p(label))){
				return now_parser_tree_ir->stage;
			}
		}
        now_parser_tree_ir = now_parser_tree_ir->next_ptr;
	}

	return -1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq 0x101f0(%rip), %r15     # 0x14140
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testq %r15, %r15
je 0x3f98
movq %rdi, %r14
leaq 0x1(%rdi), %r12
cmpl $0xe, 0x10(%r15)
jne 0x3f89
movzbl (%r14), %eax
cmpl $0x40, %eax
je 0x3f79
movq %r14, %rsi
cmpl $0x25, %eax
jne 0x3f7c
movq %r12, %rsi
leaq 0x30(%r15), %rdi
callq 0x1110
testl %eax, %eax
je 0x3f94
movq 0x8(%r15), %r15
testq %r15, %r15
jne 0x3f61
jmp 0x3f98
movl 0x1c(%r15), %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/aquaxis[P]synverll/src/parser_ir.c
// Function: search_module_llvm
int search_module_llvm(char *name, char *args)
{
	char *line;
	char *token;

	token = calloc(STR_MAX, 1);
	line = charalloc(args);

	while(strcmp(line, "")){
		get_token_llvm(line, token);

		if(!strcmp(token, name)){
			free(line);
			return 0;
		}
	}
	free(token);
	free(line);

	return -1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl $0x400, %edi            # imm = 0x400
movl $0x1, %esi
callq 0x1100
movq %rax, %r15
movq %rbx, %rdi
callq 0x1395
movq %rax, %rbx
cmpb $0x0, (%rbx)
je 0x48fc
movq %rbx, %rdi
movq %r15, %rsi
callq 0xcc26
movq %r15, %rdi
movq %r14, %rsi
callq 0x1110
testl %eax, %eax
jne 0x48d9
xorl %ebp, %ebp
jmp 0x4909
movq %r15, %rdi
callq 0x1030
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movq %rbx, %rdi
callq 0x1030
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/aquaxis[P]synverll/src/parser_ir.c
// Function: search_args_llvm
INST_STAGE search_args_llvm(PARSER_TREE_IR *now_parser_tree_ir, char *name, char *args)
{
	char *line;
	char *token;
	int max_parallel = 0;
	int max_stage = 0;
	INST_STAGE inst_stage;

	token = calloc(STR_MAX, 1);
	line = charalloc(args);

	// "("
	get_token_llvm(line, token);

	while(strlen(line) > 0){
		// タイプ
		get_irtype_llvm(line, token);
		if(!strcmp(token, "")) break;
		// 変数名
		get_token_llvm(line, token);
		if(!strcmp(token, "zeroext")) get_token_llvm (line, token);
		inst_stage = search_reg_llvm(now_parser_tree_ir, name ,token , "");
		if((inst_stage.parallel > max_parallel) || (inst_stage.stage > max_stage)){
			max_parallel = inst_stage.parallel;
			max_stage = inst_stage.stage;
		}
		// ","
		get_token_llvm(line, token);
	}

	free(line);

	inst_stage.stage = max_stage;
	inst_stage.parallel = max_parallel;

	return inst_stage;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rdi, (%rsp)
movl $0x400, %edi            # imm = 0x400
movl $0x1, %esi
callq 0x1100
movq %rax, %r15
movq %rbx, %rdi
callq 0x1395
movq %rax, %rbx
movq %rax, %rdi
movq %r15, %rsi
callq 0xcc26
xorl %r14d, %r14d
cmpb $0x0, (%rbx)
je 0x4b12
xorl %ebp, %ebp
movq %rbx, %rdi
movq %r15, %rsi
callq 0x201a
cmpb $0x0, (%r15)
je 0x4b02
movq %rbx, %rdi
movq %r15, %rsi
callq 0xcc26
movq %r15, %rdi
leaq 0x9ada(%rip), %rsi      # 0xe579
callq 0x1110
testl %eax, %eax
jne 0x4ab3
movq %rbx, %rdi
movq %r15, %rsi
callq 0xcc26
movq (%rsp), %rdi
movq %r15, %rdx
leaq 0xb50e(%rip), %rcx      # 0xffcf
callq 0x491e
movq %rax, %r13
movq %rax, %r12
shrq $0x20, %r12
cmpl %r13d, %ebp
setl %al
cmpl %r12d, %r14d
setl %cl
orb %al, %cl
jne 0x4ae6
movl %ebp, %r13d
movl %r14d, %r12d
movq %rbx, %rdi
movq %r15, %rsi
callq 0xcc26
cmpb $0x0, (%rbx)
movl %r12d, %r14d
movl %r13d, %ebp
jne 0x4a79
jmp 0x4b08
movl %ebp, %r13d
movl %r14d, %r12d
shlq $0x20, %r12
movl %r13d, %r14d
orq %r12, %r14
movq %rbx, %rdi
callq 0x1030
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/aquaxis[P]synverll/src/parser_ir.c
// Function: is_register_name
int is_register_name(char *name)
{
	int ret = 1;
	int i = 0;

	if(name[0] == '@'){
		ret = 0;
		return ret;
	}

	i = 1;

	while(name[i] != '\0'){
		if(isalpha(name[i])){
			ret = 0;
		}
		i++;
	}

	return ret;
}

// Assembly:
xorl %eax, %eax
cmpb $0x40, (%rdi)
je 0x50e5
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movb 0x1(%rdi), %bpl
testb %bpl, %bpl
je 0x50da
callq 0x11e0
movq (%rax), %rcx
addq $0x2, %rbx
movl $0x1, %eax
xorl %edx, %edx
movsbq %bpl, %rsi
testb $0x4, 0x1(%rcx,%rsi,2)
cmovnel %edx, %eax
movb (%rbx), %bpl
incq %rbx
testb %bpl, %bpl
jne 0x50c1
jmp 0x50df
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/aquaxis[P]synverll/src/parser_ir_call.c
// Function: clean_call_tree
int clean_call_tree()
{
	CALL_TREE *now_call_tree;
	CALL_TREE *new_call_tree;

    now_call_tree = call_tree_top;
    while(now_call_tree != NULL){
        new_call_tree = now_call_tree->next_ptr;
        if(now_call_tree->call_name != NULL)	free(now_call_tree->call_name);
        if(now_call_tree->verilog != NULL)	free(now_call_tree->verilog);
        free(now_call_tree);
        now_call_tree = new_call_tree;
    }
    call_tree_top = NULL;
    return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq 0xf46d(%rip), %rbx      # 0x14560
testq %rbx, %rbx
je 0x5128
movq 0x8(%rbx), %r14
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0x510a
callq 0x1030
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x5118
callq 0x1030
movq %rbx, %rdi
callq 0x1030
movq %r14, %rbx
testq %r14, %r14
jne 0x50f8
movq $0x0, 0xf42d(%rip) # 0x14560
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/aquaxis[P]synverll/src/parser_ir_call.c
// Function: register_call_tree
int register_call_tree(char *call_name)
{
	CALL_TREE *now_call_tree		= NULL;
	CALL_TREE *old_call_tree		= NULL;

	if(!is_call_tree(call_name)){
		now_call_tree = call_tree_top;
		while(now_call_tree != NULL){
			old_call_tree = now_call_tree;
			now_call_tree = now_call_tree->next_ptr;
		}

		now_call_tree				= (CALL_TREE *)calloc(sizeof(CALL_TREE),1);
		now_call_tree->prev_ptr	= old_call_tree;
		now_call_tree->next_ptr	= NULL;

		if(call_tree_top == NULL){
			call_tree_top				= now_call_tree;
		}else{
			old_call_tree->next_ptr	= now_call_tree;
		}
		now_call_tree->signal_top_ptr = NULL;

		now_call_tree->call_name = calloc(strlen(call_name)+1,1);
		strcpy(now_call_tree->call_name, call_name);
	}else{
		// 既に生成されている
		return -1;
	}

	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x513d
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
testl %eax, %eax
jne 0x5245
leaq 0xf38b(%rip), %rax      # 0x14560
xorl %ecx, %ecx
movq %rcx, %r12
movq (%rax), %rcx
leaq 0x8(%rcx), %rax
testq %rcx, %rcx
jne 0x51d7
movl $0x28, %edi
movl $0x1, %esi
callq 0x1100
movq %rax, %r15
movq %r12, (%rax)
xorl %r14d, %r14d
movq %r14, 0x8(%rax)
leaq 0xf357(%rip), %rax      # 0x14560
addq $0x8, %r12
cmpq %r14, 0xf34c(%rip)      # 0x14560
cmoveq %rax, %r12
movq %r15, (%r12)
movq %r14, 0x20(%r15)
movq %rbx, %rdi
callq 0x1090
leaq 0x1(%rax), %rdi
movl $0x1, %esi
callq 0x1100
movq %rax, 0x10(%r15)
movq %rax, %rdi
movq %rbx, %rsi
callq 0x1060
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/aquaxis[P]synverll/src/parser_ir_call.c
// Function: register_call_signal_tree
int register_call_signal_tree(char *call_name, char *signal_name, int num, int size, int inout)
{
	CALL_TREE *now_call_tree;
	CALL_SIGNAL_TREE *now_call_signal_tree = NULL;
	CALL_SIGNAL_TREE *old_call_signal_tree = NULL;

	now_call_tree = search_call_tree(call_name);
	
	now_call_signal_tree = now_call_tree->signal_top_ptr;
	while(now_call_signal_tree != NULL){
		old_call_signal_tree = now_call_signal_tree;
		now_call_signal_tree = now_call_signal_tree->next_ptr;
	}

	now_call_signal_tree				= (CALL_SIGNAL_TREE *)calloc(sizeof(CALL_SIGNAL_TREE),1);
	now_call_signal_tree->prev_ptr	= old_call_signal_tree;
	now_call_signal_tree->next_ptr	= NULL;

	if(now_call_tree->signal_top_ptr == NULL){
		now_call_tree->signal_top_ptr				= now_call_signal_tree;
	}else{
		old_call_signal_tree->next_ptr	= now_call_signal_tree;
	}

	now_call_signal_tree->signal_name = calloc(strlen(signal_name)+1,1);
	strcpy(now_call_signal_tree->signal_name, signal_name);

	now_call_signal_tree->inout	= inout;
	now_call_signal_tree->num	= num;
	now_call_signal_tree->size	= size;

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r8d, %ebp
movl %ecx, 0x4(%rsp)
movl %edx, %r14d
movq %rsi, %r15
callq 0x517b
movq %rax, %r12
addq $0x20, %r12
xorl %eax, %eax
movq %r12, %rcx
movq %rax, %rbx
movq (%rcx), %rax
leaq 0x8(%rax), %rcx
testq %rax, %rax
jne 0x527d
movl $0x30, %edi
movl $0x1, %esi
callq 0x1100
movq %rax, %r13
movq %rbx, (%rax)
movq $0x0, 0x8(%rax)
addq $0x8, %rbx
cmpq $0x0, (%r12)
cmoveq %r12, %rbx
movq %rax, (%rbx)
movq %r15, %rdi
callq 0x1090
leaq 0x1(%rax), %rdi
movl $0x1, %esi
callq 0x1100
movq %rax, 0x10(%r13)
movq %rax, %rdi
movq %r15, %rsi
callq 0x1060
movl %ebp, 0x20(%r13)
movl %r14d, 0x28(%r13)
movl 0x4(%rsp), %eax
movl %eax, 0x24(%r13)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/aquaxis[P]synverll/src/parser_ir_call.c
// Function: print_call_signal_tree
int print_call_signal_tree(CALL_SIGNAL_TREE *now_call_signal_tree, char *call_name)
{
	printf("    [CALL Signal Tree List]\n");

    while(now_call_signal_tree != NULL){
		if(
			!strcmp(now_call_signal_tree->signal_name, "req") ||
			!strcmp(now_call_signal_tree->signal_name, "ready") ||
			!strcmp(now_call_signal_tree->signal_name, "done")
		){
			printf("    __call_%s_%s\n", call_name, now_call_signal_tree->signal_name);
		}else{
			printf("    __call_%s_%s_%d\n", call_name, now_call_signal_tree->signal_name, now_call_signal_tree->num);
		}
        now_call_signal_tree = now_call_signal_tree->next_ptr;
    }
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x934b(%rip), %rdi      # 0xe662
callq 0x1070
testq %r14, %r14
je 0x539e
leaq 0xaa01(%rip), %r15      # 0xfd29
leaq 0x92e6(%rip), %r12      # 0xe615
leaq 0xa9c8(%rip), %r13      # 0xfcfe
movq 0x10(%r14), %rbp
movq %rbp, %rdi
movq %r15, %rsi
callq 0x1110
testl %eax, %eax
je 0x5385
movq %rbp, %rdi
movq %r13, %rsi
callq 0x1110
testl %eax, %eax
je 0x5385
movq %rbp, %rdi
leaq 0xa990(%rip), %rsi      # 0xfcf2
callq 0x1110
testl %eax, %eax
je 0x5385
movl 0x28(%r14), %ecx
leaq 0x92b1(%rip), %rdi      # 0xe627
movq %rbx, %rsi
movq %rbp, %rdx
xorl %eax, %eax
callq 0x10b0
jmp 0x5395
movq %r12, %rdi
movq %rbx, %rsi
movq %rbp, %rdx
xorl %eax, %eax
callq 0x10b0
movq 0x8(%r14), %r14
testq %r14, %r14
jne 0x5336
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/aquaxis[P]synverll/src/parser_ir_call.c
// Function: print_call_tree
int print_call_tree(CALL_TREE *now_call_tree)
{
	printf("  [CALL Tree List]\n");

    while(now_call_tree != NULL){
		printf("  %s\n", now_call_tree->call_name);
		print_call_signal_tree(now_call_tree->signal_top_ptr, now_call_tree->call_name);
        now_call_tree = now_call_tree->next_ptr;
    }
    return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x92c1(%rip), %rdi      # 0xe67e
callq 0x1070
testq %rbx, %rbx
je 0x53f2
leaq 0x9143(%rip), %r14      # 0xe511
movq 0x10(%rbx), %rsi
movq %r14, %rdi
xorl %eax, %eax
callq 0x10b0
movq 0x10(%rbx), %rsi
movq 0x20(%rbx), %rdi
callq 0x52ff
movq 0x8(%rbx), %rbx
testq %rbx, %rbx
jne 0x53ce
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/aquaxis[P]synverll/src/parser_ir_memmap.c
// Function: clean_memmap_tree
int clean_memmap_tree()
{
	MEMMAP_TREE *now_memmap_tree;
	MEMMAP_TREE *new_memmap_tree;

    now_memmap_tree = memmap_tree_top;
    while(now_memmap_tree != NULL){
        new_memmap_tree = now_memmap_tree->next_ptr;
        if(now_memmap_tree->label != NULL)	free(now_memmap_tree->label);
        if(now_memmap_tree->module != NULL)	free(now_memmap_tree->module);
        free(now_memmap_tree);
        now_memmap_tree = new_memmap_tree;
    }
    memmap_tree_top = NULL;
    return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq 0xefe5(%rip), %rbx      # 0x14570
testq %rbx, %rbx
je 0x55c0
movq 0x8(%rbx), %r14
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x55a2
callq 0x1030
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0x55b0
callq 0x1030
movq %rbx, %rdi
callq 0x1030
movq %r14, %rbx
testq %r14, %r14
jne 0x5590
movq $0x0, 0xefa5(%rip) # 0x14570
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/aquaxis[P]synverll/src/parser_ir_memmap.c
// Function: register_memmap_tree
int register_memmap_tree(char *module, char *label, int size)
{
	MEMMAP_TREE *now_memmap_tree		= NULL;
	MEMMAP_TREE *old_memmap_tree		= NULL;

	unsigned int new_adrs = 0;

	if(!is_memmap_tree(module, label)){
		// メモリマップに存在しなければ新規登録
		now_memmap_tree = memmap_tree_top;
		while(now_memmap_tree != NULL){
			old_memmap_tree = now_memmap_tree;
			now_memmap_tree = now_memmap_tree->next_ptr;
		}

		now_memmap_tree				= (MEMMAP_TREE *)calloc(sizeof(MEMMAP_TREE),1);
		now_memmap_tree->prev_ptr	= old_memmap_tree;
		now_memmap_tree->next_ptr	= NULL;

		if(memmap_tree_top == NULL){
			memmap_tree_top				= now_memmap_tree;
		}else{
			old_memmap_tree->next_ptr	= now_memmap_tree;
		}

		// 新しいアドレスの作成
		if(old_memmap_tree != NULL){
			// アドレスは4Byteアライメントに揃える
			new_adrs = (old_memmap_tree->adrs + old_memmap_tree->size + 3) & 0xFFFFFFC;
		}else{
			new_adrs = 0;
		}

		now_memmap_tree->label = calloc(strlen(label)+1,1);
		strcpy(now_memmap_tree->label, label);
		now_memmap_tree->module = calloc(strlen(module)+1,1);
		strcpy(now_memmap_tree->module, module);
		now_memmap_tree->adrs = new_adrs;		// アドレスの登録
		now_memmap_tree->size = size;			// サイズの登録
	}

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rsi, %r15
movq %rdi, %r14
callq 0x56c8
testl %eax, %eax
jne 0x56b7
leaq 0xef74(%rip), %rax      # 0x14570
xorl %ecx, %ecx
movq %rcx, %r13
movq (%rax), %rcx
leaq 0x8(%rcx), %rax
testq %rcx, %rcx
jne 0x55fe
movl $0x28, %edi
movl $0x1, %esi
callq 0x1100
movq %rax, %r12
movq %r13, (%rax)
movq $0x0, 0x8(%rax)
leaq 0xef3f(%rip), %rax      # 0x14570
leaq 0x8(%r13), %rcx
cmpq $0x0, 0xef33(%rip)      # 0x14570
cmoveq %rax, %rcx
movq %r12, (%rcx)
testq %r13, %r13
je 0x565f
movl 0x20(%r13), %eax
movl 0x24(%r13), %ecx
leal (%rax,%rcx), %ebp
addl $0x3, %ebp
andl $0xffffffc, %ebp        # imm = 0xFFFFFFC
jmp 0x5661
xorl %ebp, %ebp
movq %r15, %rdi
callq 0x1090
leaq 0x1(%rax), %rdi
movl $0x1, %esi
callq 0x1100
movq %rax, 0x18(%r12)
movq %rax, %rdi
movq %r15, %rsi
callq 0x1060
movq %r14, %rdi
callq 0x1090
leaq 0x1(%rax), %rdi
movl $0x1, %esi
callq 0x1100
movq %rax, 0x10(%r12)
movq %rax, %rdi
movq %r14, %rsi
callq 0x1060
movl %ebp, 0x20(%r12)
movl %ebx, 0x24(%r12)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/aquaxis[P]synverll/src/parser_ir_memmap.c
// Function: get_adrs_memmap
unsigned int get_adrs_memmap(char *module, char *label)
{
	MEMMAP_TREE *now_memmap_tree;

    now_memmap_tree = memmap_tree_top;
    while(now_memmap_tree != NULL){
		if(
			!strcmp(now_memmap_tree->module, module) &&
			!strcmp(now_memmap_tree->label, label) &&
			(now_memmap_tree->size > 0)
		){
			return now_memmap_tree->adrs;
		}
        now_memmap_tree = now_memmap_tree->next_ptr;
    }

    return -1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq 0xee3c(%rip), %r12      # 0x14570
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testq %r12, %r12
je 0x5778
movq %rsi, %r14
movq %rdi, %r15
movq 0x10(%r12), %rdi
movq %r15, %rsi
callq 0x1110
testl %eax, %eax
jne 0x576e
movq 0x18(%r12), %rdi
movq %r14, %rsi
callq 0x1110
testl %eax, %eax
jne 0x576e
cmpl $0x0, 0x24(%r12)
jne 0x5786
movq 0x8(%r12), %r12
testq %r12, %r12
jne 0x5744
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movl 0x20(%r12), %ebx
jmp 0x5778
// File: /workspace/github_c_makefile_star2_O1/aquaxis[P]synverll/src/parser_ir_memmap.c
// Function: get_size_memmap
unsigned int get_size_memmap(char *module, char *label)
{
	MEMMAP_TREE *now_memmap_tree;

    now_memmap_tree = memmap_tree_top;
    while(now_memmap_tree != NULL){
		if(!strcmp(now_memmap_tree->module, module) && !strcmp(now_memmap_tree->label, label)){
			return now_memmap_tree->size;
		}
        now_memmap_tree = now_memmap_tree->next_ptr;
    }

    return -1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq 0xedd4(%rip), %r12      # 0x14570
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testq %r12, %r12
je 0x57df
movq %rsi, %r14
movq %rdi, %r15
movq 0x10(%r12), %rdi
movq %r15, %rsi
callq 0x1110
testl %eax, %eax
jne 0x57ce
movq 0x18(%r12), %rdi
movq %r14, %rsi
callq 0x1110
testl %eax, %eax
je 0x57da
movq 0x8(%r12), %r12
testq %r12, %r12
jne 0x57ac
jmp 0x57df
movl 0x24(%r12), %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq