LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/sbp[P]tweetnacl-tools/tweetnacl.c
// Function: modL
sv modL(u8 *r,i64 x[64])
{
  i64 carry,i,j;
  for (i = 63;i >= 32;--i) {
    carry = 0;
    for (j = i - 32;j < i - 12;++j) {
      x[j] += carry - 16 * x[i] * L[j - (i - 32)];
      carry = (x[j] + 128) >> 8;
      x[j] -= carry << 8;
    }
    x[j] += carry;
    x[i] = 0;
  }
  carry = 0;
  FOR(j,32) {
    x[j] += carry - (x[31] >> 4) * L[j];
    carry = x[j] >> 8;
    x[j] &= 255;
  }
  FOR(j,32) x[j] -= carry * L[j];
  FOR(i,32) {
    x[i+1] += x[i] >> 8;
    r[i] = x[i] & 255;
  }
}

// Assembly:
pushq %rbx
leaq 0xf8(%rsi), %rcx
movl $0x3f, %r8d
movl $0x33, %edx
leaq 0x171b(%rip), %rax      # 0x4620
xorl %r9d, %r9d
xorl %r10d, %r10d
movq (%rsi,%r8,8), %r11
imulq (%r9,%rax), %r11
shlq $0x4, %r11
subq %r11, %r10
movq (%rcx,%r9), %r11
leaq (%r10,%r11), %rbx
addq %r10, %r11
addq $0x80, %r11
movq %r11, %r10
sarq $0x8, %r10
andq $-0x100, %r11
subq %r11, %rbx
movq %rbx, (%rcx,%r9)
addq $0x8, %r9
cmpq $0xa0, %r9
jne 0x2f0b
addq %r10, (%rsi,%rdx,8)
movq $0x0, (%rsi,%r8,8)
leaq -0x1(%r8), %r9
decq %rdx
addq $-0x8, %rcx
cmpq $0x20, %r8
movq %r9, %r8
ja 0x2f05
xorl %ecx, %ecx
xorl %edx, %edx
movq 0xf8(%rsi), %r8
sarq $0x4, %r8
imulq (%rcx,%rax), %r8
subq %r8, %rdx
addq (%rsi,%rcx), %rdx
movzbl %dl, %r8d
sarq $0x8, %rdx
movq %r8, (%rsi,%rcx)
addq $0x8, %rcx
cmpq $0x100, %rcx            # imm = 0x100
jne 0x2f73
movq %rdx, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
xorl %ecx, %ecx
movdqa %xmm0, %xmm1
psrlq $0x20, %xmm1
movdqa (%rcx,%rax), %xmm2
movdqa %xmm2, %xmm3
pmuludq %xmm1, %xmm3
movdqa %xmm2, %xmm4
psrlq $0x20, %xmm4
pmuludq %xmm0, %xmm4
paddq %xmm3, %xmm4
psllq $0x20, %xmm4
pmuludq %xmm0, %xmm2
paddq %xmm4, %xmm2
movdqu (%rsi,%rcx), %xmm3
psubq %xmm2, %xmm3
movdqu %xmm3, (%rsi,%rcx)
addq $0x10, %rcx
cmpq $0x100, %rcx            # imm = 0x100
jne 0x2fb8
xorl %eax, %eax
movq (%rsi,%rax,8), %rcx
movq %rcx, %rdx
sarq $0x8, %rdx
addq %rdx, 0x8(%rsi,%rax,8)
movb %cl, (%rdi,%rax)
leaq 0x1(%rax), %rcx
movq %rcx, %rax
cmpq $0x20, %rcx
jne 0x3000
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/sbp[P]tweetnacl-tools/tweetnacl.c
// Function: scalarmult
sv scalarmult(gf p[4],gf q[4],const u8 *s)
{
  int i;
  set25519(p[0],gf0);
  set25519(p[1],gf1);
  set25519(p[2],gf1);
  set25519(p[3],gf0);
  for (i = 255;i >= 0;--i) {
    u8 b = (s[i/8]>>(i&7))&1;
    cswap(p,q,b);
    add(q,p);
    add(p,p);
    cswap(p,q,b);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
xorps %xmm0, %xmm0
movups %xmm0, 0x70(%rdi)
movups %xmm0, 0x60(%rdi)
movups %xmm0, 0x50(%rdi)
movups %xmm0, 0x40(%rdi)
movups %xmm0, 0x30(%rdi)
movups %xmm0, 0x20(%rdi)
movups %xmm0, 0x10(%rdi)
movups %xmm0, (%rdi)
xorl %ecx, %ecx
leaq 0x1074(%rip), %rax      # 0x45a0
movaps (%rcx,%rax), %xmm0
movups %xmm0, 0x80(%r15,%rcx)
addq $0x10, %rcx
cmpq $0x80, %rcx
jne 0x352c
xorl %ecx, %ecx
movaps (%rcx,%rax), %xmm0
movups %xmm0, 0x100(%r15,%rcx)
addq $0x10, %rcx
cmpq $0x80, %rcx
jne 0x3548
xorps %xmm0, %xmm0
movups %xmm0, 0x1f0(%r15)
movups %xmm0, 0x1e0(%r15)
movups %xmm0, 0x1d0(%r15)
movups %xmm0, 0x1c0(%r15)
movups %xmm0, 0x1b0(%r15)
movups %xmm0, 0x1a0(%r15)
movups %xmm0, 0x190(%r15)
movups %xmm0, 0x180(%r15)
movl $0xff, %r12d
movl %r12d, %eax
shrl $0x3, %eax
movzbl (%rbx,%rax), %eax
movl %r12d, %ecx
andl $0x7, %ecx
xorl %ebp, %ebp
btl %ecx, %eax
setb %bpl
movq %r15, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x3934
movq %r14, %rdi
movq %r15, %rsi
callq 0x3603
movq %r15, %rdi
movq %r15, %rsi
callq 0x3603
movq %r15, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x3934
addl $-0x1, %r12d
jb 0x35ab
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/sbp[P]tweetnacl-tools/tweetnacl.c
// Function: add
sv add(gf p[4],gf q[4])
{
  gf a,b,c,d,t,e,f,g,h;
  
  Z(a, p[1], p[0]);
  Z(t, q[1], q[0]);
  M(a, a, t);
  A(b, p[0], p[1]);
  A(t, q[0], q[1]);
  M(b, b, t);
  M(c, p[3], q[3]);
  M(c, c, D2);
  M(d, p[2], q[2]);
  A(d, d, d);
  Z(e, b, a);
  Z(f, d, c);
  A(g, d, c);
  A(h, b, a);

  M(p[0], e, f);
  M(p[1], h, g);
  M(p[2], g, f);
  M(p[3], e, h);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x498, %rsp            # imm = 0x498
movq %rsi, %r12
movq %rdi, %r14
leaq 0x80(%rdi), %rax
movq %rax, 0x8(%rsp)
xorl %eax, %eax
movdqu (%r14,%rax,8), %xmm0
movdqu 0x80(%r14,%rax,8), %xmm1
psubq %xmm0, %xmm1
movdqa %xmm1, 0x190(%rsp,%rax,8)
addq $0x2, %rax
cmpq $0x10, %rax
jne 0x3628
xorl %eax, %eax
movdqu (%r12,%rax,8), %xmm0
movdqu 0x80(%r12,%rax,8), %xmm1
psubq %xmm0, %xmm1
movdqa %xmm1, 0x90(%rsp,%rax,8)
addq $0x2, %rax
cmpq $0x10, %rax
jne 0x3651
leaq 0x190(%rsp), %rdi
leaq 0x90(%rsp), %rdx
movq %rdi, %rsi
callq 0x2393
xorl %eax, %eax
movdqu (%r14,%rax,8), %xmm0
movdqu 0x80(%r14,%rax,8), %xmm1
paddq %xmm0, %xmm1
movdqa %xmm1, 0x110(%rsp,%rax,8)
addq $0x2, %rax
cmpq $0x10, %rax
jne 0x3692
xorl %eax, %eax
movdqu (%r12,%rax,8), %xmm0
movdqu 0x80(%r12,%rax,8), %xmm1
paddq %xmm0, %xmm1
movdqa %xmm1, 0x90(%rsp,%rax,8)
addq $0x2, %rax
cmpq $0x10, %rax
jne 0x36bb
leaq 0x110(%rsp), %rdi
leaq 0x90(%rsp), %rdx
movq %rdi, %rsi
callq 0x2393
movl $0x180, %edx            # imm = 0x180
leaq (%r14,%rdx), %r15
addq %r12, %rdx
leaq 0x210(%rsp), %r13
movq %r13, %rdi
movq %r15, %rsi
callq 0x2393
leaq 0x1100(%rip), %rdx      # 0x4820
movq %r13, %rdi
movq %r13, %rsi
callq 0x2393
movl $0x100, %eax            # imm = 0x100
leaq (%r14,%rax), %r13
addq %rax, %r12
leaq 0x10(%rsp), %rdi
movq %r13, %rsi
movq %r12, %rdx
callq 0x2393
xorl %eax, %eax
movdqa 0x10(%rsp,%rax,8), %xmm0
paddq %xmm0, %xmm0
movdqa %xmm0, 0x10(%rsp,%rax,8)
addq $0x2, %rax
cmpq $0x10, %rax
jne 0x3749
xorl %eax, %eax
movdqa 0x110(%rsp,%rax,8), %xmm0
psubq 0x190(%rsp,%rax,8), %xmm0
movdqa %xmm0, 0x410(%rsp,%rax,8)
addq $0x2, %rax
cmpq $0x10, %rax
jne 0x3765
xorl %eax, %eax
movdqa 0x10(%rsp,%rax,8), %xmm0
psubq 0x210(%rsp,%rax,8), %xmm0
movdqa %xmm0, 0x390(%rsp,%rax,8)
addq $0x2, %rax
cmpq $0x10, %rax
jne 0x378c
xorl %eax, %eax
movdqa 0x210(%rsp,%rax,8), %xmm0
paddq 0x10(%rsp,%rax,8), %xmm0
movdqa %xmm0, 0x310(%rsp,%rax,8)
addq $0x2, %rax
cmpq $0x10, %rax
jne 0x37b0
xorl %eax, %eax
movdqa 0x190(%rsp,%rax,8), %xmm0
paddq 0x110(%rsp,%rax,8), %xmm0
movdqa %xmm0, 0x290(%rsp,%rax,8)
addq $0x2, %rax
cmpq $0x10, %rax
jne 0x37d4
leaq 0x410(%rsp), %r12
leaq 0x390(%rsp), %rbp
movq %r14, %rdi
movq %r12, %rsi
movq %rbp, %rdx
callq 0x2393
leaq 0x290(%rsp), %r14
leaq 0x310(%rsp), %rbx
movq 0x8(%rsp), %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x2393
movq %r13, %rdi
movq %rbx, %rsi
movq %rbp, %rdx
callq 0x2393
movq %r15, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x2393
addq $0x498, %rsp            # imm = 0x498
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/sbp[P]tweetnacl-tools/tweetnacl.c
// Function: neq25519
static int neq25519(const gf a, const gf b)
{
  u8 c[32],d[32];
  pack25519(c,a);
  pack25519(d,b);
  return crypto_verify_32(c,d);
}

// Assembly:
pushq %rbx
subq $0x40, %rsp
movq %rsi, %rbx
movq %rdi, %rsi
leaq 0x20(%rsp), %rdi
callq 0x24dd
movq %rsp, %rdi
movq %rbx, %rsi
callq 0x24dd
pxor %xmm0, %xmm0
xorl %eax, %eax
pxor %xmm1, %xmm1
movl (%rsp,%rax), %ecx
xorl 0x20(%rsp,%rax), %ecx
movd %ecx, %xmm2
punpcklbw %xmm0, %xmm2    # xmm2 = xmm2[0],xmm0[0],xmm2[1],xmm0[1],xmm2[2],xmm0[2],xmm2[3],xmm0[3],xmm2[4],xmm0[4],xmm2[5],xmm0[5],xmm2[6],xmm0[6],xmm2[7],xmm0[7]
punpcklwd %xmm0, %xmm2    # xmm2 = xmm2[0],xmm0[0],xmm2[1],xmm0[1],xmm2[2],xmm0[2],xmm2[3],xmm0[3]
por %xmm2, %xmm1
addq $0x4, %rax
cmpq $0x20, %rax
jne 0x38ec
pshufd $0xee, %xmm1, %xmm0     # xmm0 = xmm1[2,3,2,3]
por %xmm1, %xmm0
pshufd $0x55, %xmm0, %xmm1     # xmm1 = xmm0[1,1,1,1]
por %xmm0, %xmm1
movd %xmm1, %ecx
decl %ecx
xorl %eax, %eax
btl $0x8, %ecx
adcl $-0x1, %eax
addq $0x40, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/sbp[P]tweetnacl-tools/tweetnacl-sigpair.c
// Function: output_key
void output_key(char filename[], unsigned char key[], int key_size) {
    // http://stackoverflow.com/a/8004250
    if (strcmp(filename, "-") != 0) {
        FILE *out = create_file(filename);
        fwrite(key, key_size, 1, out);
        fclose(out);
    } else {
        fwrite(bytes_to_hex(key, key_size), key_size * 2, 1, stdout);
        fputs("\n", stdout);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %edx, %ebx
movq %rsi, %r14
cmpb $0x2d, (%rdi)
jne 0x398d
cmpb $0x0, 0x1(%rdi)
je 0x39b5
callq 0x1420
movq %rax, %r15
movslq %ebx, %rsi
movl $0x1, %edx
movq %r14, %rdi
movq %rax, %rcx
callq 0x1140
movq %r15, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x1040
movq %r14, %rdi
movl %ebx, %esi
callq 0x13a3
addl %ebx, %ebx
movslq %ebx, %rsi
movq 0x360d(%rip), %rbx      # 0x6fd8
movq (%rbx), %rcx
movl $0x1, %edx
movq %rax, %rdi
callq 0x1140
movq (%rbx), %rsi
leaq 0xebb(%rip), %rdi       # 0x48a0
popq %rbx
popq %r14
popq %r15
jmp 0x1050
// File: /workspace/github_c_makefile_star2_O3/sbp[P]tweetnacl-tools/tweetnacl-sigpair.c
// Function: main
int main(int argc, char *argv[]) {
    if (argc != 3) error(2, "Expected 2 filenames as arguments");

    unsigned char public_key[crypto_sign_PUBLICKEYBYTES];
    unsigned char secret_key[crypto_sign_SECRETKEYBYTES];
    crypto_sign_keypair(public_key, secret_key);

    if (file_exists(argv[1])) errorf(1, "File <%s> exists", argv[1]);
    if (file_exists(argv[2])) errorf(1, "File <%s> exists", argv[2]);

    output_key(argv[1], public_key, crypto_sign_PUBLICKEYBYTES);
    output_key(argv[2], secret_key, crypto_sign_SECRETKEYBYTES);

    return 0;
}

// Assembly:
pushq %rbx
subq $0x60, %rsp
movq %rsi, %rbx
cmpl $0x3, %edi
je 0x3a0d
leaq 0xe9f(%rip), %rsi       # 0x48a2
movl $0x2, %edi
callq 0x1308
movq %rsp, %rdi
leaq 0x20(%rsp), %rsi
callq 0x2af6
movq 0x8(%rbx), %rdi
callq 0x145c
testl %eax, %eax
je 0x3a3c
movq 0x8(%rbx), %rdx
leaq 0xe92(%rip), %rsi       # 0x48c4
movl $0x1, %edi
callq 0x1350
movq 0x10(%rbx), %rdi
callq 0x145c
testl %eax, %eax
je 0x3a5e
movq 0x10(%rbx), %rdx
leaq 0xe70(%rip), %rsi       # 0x48c4
movl $0x1, %edi
callq 0x1350
movq 0x8(%rbx), %rdi
movq %rsp, %rsi
movl $0x20, %edx
callq 0x3978
movq 0x10(%rbx), %rdi
leaq 0x20(%rsp), %rsi
movl $0x40, %edx
callq 0x3978
xorl %eax, %eax
addq $0x60, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/carlitosmarin[P]Sistema-Ficheros-SOII/./src/ficheros_basico.c
// Function: initAI
int initAI (unsigned int inodos) { 
	struct superbloque sb;
	if(bread(posSB,&sb) < 0) return -1; //Leemos el superbloque para localizar el mapa de bits Error BREAD
	
	struct inodo in[tamBloque/tamInodo];
	unsigned int x, i, j;
	x = 1;
	for(i = sb.posPrimerBloqueAI; i <= sb.posUltimoBloqueAI; i++) {
		for(j = 0; j < tamBloque/tamInodo; j++) {
			in[j].tipo = 'l';
			if(x < inodos) {
				in[j].punterosDirectos[0] = x;
				x++;
			} else {
				in[j].punterosDirectos[0] = UINT_MAX;
				j = tamBloque/tamInodo;
			}
		}
		if(bwrite(i,&in) < 0) return -2; //Escribimos el array de inodos Error BWRITE
	}
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x808, %rsp            # imm = 0x808
movl %edi, %ebp
xorl %ebx, %ebx
movq %rsp, %rsi
xorl %edi, %edi
callq 0x131d
testl %eax, %eax
js 0x15f5
movl 0x8(%rsp), %r14d
cmpl 0xc(%rsp), %r14d
ja 0x1601
movl $0x1, %r12d
leaq 0x42c(%rsp), %r13
leaq 0x400(%rsp), %r15
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movq %r13, %rcx
leal (%r12,%rax), %edx
incl %edx
movb $0x6c, -0x2c(%rcx)
cmpl %ebp, %edx
jae 0x15ce
movl %edx, (%rcx)
incl %eax
subq $-0x80, %rcx
cmpl $0x7, %eax
jb 0x15b1
jmp 0x15d4
movl $0xffffffff, (%rcx)     # imm = 0xFFFFFFFF
addl %eax, %r12d
incl %r12d
movl %r14d, %edi
movq %r15, %rsi
callq 0x12e5
testl %eax, %eax
js 0x15fc
incl %r14d
cmpl 0xc(%rsp), %r14d
jbe 0x15a9
jmp 0x1601
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
jmp 0x1601
movl $0xfffffffe, %ebx       # imm = 0xFFFFFFFE
movl %ebx, %eax
addq $0x808, %rsp            # imm = 0x808
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/carlitosmarin[P]Sistema-Ficheros-SOII/./src/ficheros_basico.c
// Function: leerSB
int leerSB (){
	struct superbloque sb;
	if(bread(posSB,&sb) < 0) return -1; //Leemos el superbloque para localizar el mapa de bits Error BREAD
	printf("--------Información SUPERBLOQUE---------\n");
	printf("Primer Bloque MB: %d\n", sb.posPrimerBloqueMB);
	printf("Ultimo Bloque MB: %d\n", sb.posUltimoBloqueMB);
	printf("Primer Bloque AI: %d\n", sb.posPrimerBloqueAI);
	printf("Ultimo Bloque AI: %d\n", sb.posUltimoBloqueAI);
	printf("Primer Bloque Datos: %d\n", sb.posPrimerBloqueDatos);
	printf("Ultimo Bloque Datos: %d\n", sb.posUltimoBloqueDatos);
	printf("Posición Inodo Raiz: %d\n", sb.posInodoRaiz);
	printf("Primer Inodo Libre: %d\n", sb.posPrimerInodoLibre);
	printf("Cantidad Bloques Libres: %d\n", sb.cantBloquesLibres);
	printf("Cantidad Inodos Libres: %d\n", sb.cantInodosLibres);
	printf("Cantidad Bloques Totales: %d\n", sb.totBloques);
	printf("Cantidad Inodos Totales: %d\n", sb.totInodos);
	return 0;
}

// Assembly:
pushq %rbx
subq $0x400, %rsp            # imm = 0x400
xorl %ebx, %ebx
movq %rsp, %rsi
xorl %edi, %edi
callq 0x131d
testl %eax, %eax
js 0x1716
leaq 0x2bd3(%rip), %rdi      # 0x420b
callq 0x1060
movl (%rsp), %esi
leaq 0x2a05(%rip), %rdi      # 0x404c
xorl %eax, %eax
callq 0x1090
movl 0x4(%rsp), %esi
leaq 0x2a09(%rip), %rdi      # 0x4062
xorl %eax, %eax
callq 0x1090
movl 0x8(%rsp), %esi
leaq 0x2a0d(%rip), %rdi      # 0x4078
xorl %eax, %eax
callq 0x1090
movl 0xc(%rsp), %esi
leaq 0x2a11(%rip), %rdi      # 0x408e
xorl %eax, %eax
callq 0x1090
movl 0x10(%rsp), %esi
leaq 0x2a15(%rip), %rdi      # 0x40a4
xorl %eax, %eax
callq 0x1090
movl 0x14(%rsp), %esi
leaq 0x2a1c(%rip), %rdi      # 0x40bd
xorl %eax, %eax
callq 0x1090
movl 0x18(%rsp), %esi
leaq 0x2a23(%rip), %rdi      # 0x40d6
xorl %eax, %eax
callq 0x1090
movl 0x1c(%rsp), %esi
leaq 0x2a2b(%rip), %rdi      # 0x40f0
xorl %eax, %eax
callq 0x1090
movl 0x20(%rsp), %esi
leaq 0x2a31(%rip), %rdi      # 0x4108
xorl %eax, %eax
callq 0x1090
movl 0x24(%rsp), %esi
leaq 0x2a3c(%rip), %rdi      # 0x4125
xorl %eax, %eax
callq 0x1090
movl 0x28(%rsp), %esi
leaq 0x2a46(%rip), %rdi      # 0x4141
xorl %eax, %eax
callq 0x1090
movl 0x2c(%rsp), %esi
leaq 0x2a52(%rip), %rdi      # 0x415f
xorl %eax, %eax
callq 0x1090
jmp 0x171b
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
addq $0x400, %rsp            # imm = 0x400
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/carlitosmarin[P]Sistema-Ficheros-SOII/./src/ficheros_basico.c
// Function: leer_bit
unsigned char leer_bit (unsigned int bloque) {
	struct superbloque sb; 
	if(bread(posSB,&sb) < 0) return -1; //Leemos el superbloque para localizar el mapa de bits Error BREADS
	
	int posbyte = bloque/8, posbit = bloque%8;
	int MB = (posbyte/tamBloque) + sb.posPrimerBloqueMB; //Bloque cuyo bit actualizaremos
	posbyte %= tamBloque; //Para que se ajuste a un bloque
		
	unsigned char mapaBits[tamBloque];
	if(bread(MB,mapaBits) < 0) return -2; // Error BREADMB
	
	unsigned char mascara = 128; //10000000
	mascara >>= posbit; //Desplazamiento de bits a la derecha
	mascara &= mapaBits[posbyte]; //Operador AND para bits
	mascara >>= (7-posbit); //Desplazamiento de bits a la derecha
	return mascara; //0 o 1
}

// Assembly:
pushq %rbx
subq $0x800, %rsp            # imm = 0x800
movl %edi, %ebx
leaq 0x400(%rsp), %rsi
xorl %edi, %edi
callq 0x131d
testl %eax, %eax
js 0x1780
movl %ebx, %edi
shrl $0xd, %edi
addl 0x400(%rsp), %edi
movq %rsp, %rsi
callq 0x131d
testl %eax, %eax
js 0x1784
movl %ebx, %eax
shrl $0x3, %eax
andb $0x7, %bl
movl $0x80, %edx
movl %ebx, %ecx
shrl %cl, %edx
andl $0x3ff, %eax            # imm = 0x3FF
movzbl (%rsp,%rax), %eax
andl %edx, %eax
xorb $0x7, %bl
movl %ebx, %ecx
shrl %cl, %eax
jmp 0x1786
movb $-0x1, %al
jmp 0x1786
movb $-0x2, %al
addq $0x800, %rsp            # imm = 0x800
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/carlitosmarin[P]Sistema-Ficheros-SOII/./src/ficheros_basico.c
// Function: reservar_bloque
int reservar_bloque () { 
	struct superbloque sb; 
	if(bread(posSB,&sb) < 0) return -1; //Error BREADS
	if(sb.cantBloquesLibres <= 0) return -2; //Error NO_BLOQUES_LIBRES
	unsigned char bufferAux[tamBloque];
	memset(bufferAux,255,tamBloque);
	unsigned char mapaBits[tamBloque];
	int nMB = sb.posPrimerBloqueMB;
	
	if(bread(nMB, mapaBits) < 0) return -3; //Error BREADMB
	
	while(memcmp(bufferAux,mapaBits,tamBloque) == 0){   					
		nMB++;
		if(bread(nMB, mapaBits) < 0) return -3; //Error BREADMB    
	}
	
	unsigned char byte = 255;
	unsigned char mascara = 128;
	int posbyte = 0, posbit = 0, fin = 0;
	while(posbyte < tamBloque && !fin){ 
		byte = mapaBits[posbyte];
		if (byte < 255) { // hay bits a 0 en el byte
			while (byte & mascara) { // operador AND para bits
				byte <<= 1;	// desplazamiento de bits a la izquierda
				posbit++;
			}
            fin = 1;
		} else posbyte++; // si el byte no contiene 0s vamos al siguiente
	}
	int numbloque = ((nMB-sb.posPrimerBloqueMB)*tamBloque+posbyte)*8+posbit;
	if(escribir_bit(numbloque, 1) < 0) return -4; //Error ESCRIBIR_BIT
	sb.cantBloquesLibres--;
	if (bwrite(posSB, &sb) < 0) return -5; //Error BWRITE
		
	return numbloque; 
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xc00, %rsp            # imm = 0xC00
movq %rsp, %rsi
xorl %edi, %edi
callq 0x131d
testl %eax, %eax
js 0x1837
cmpl $0x0, 0x20(%rsp)
je 0x183e
leaq 0x800(%rsp), %rdi
movl $0x400, %edx            # imm = 0x400
movl $0xff, %esi
callq 0x10b0
movl (%rsp), %ebp
leaq 0x400(%rsp), %rsi
movl %ebp, %edi
callq 0x131d
movl $0xfffffffd, %ebx       # imm = 0xFFFFFFFD
testl %eax, %eax
js 0x18b5
movl %ebp, %r12d
shll $0xd, %r12d
incl %ebp
leaq 0x800(%rsp), %r14
leaq 0x400(%rsp), %r15
movl $0x400, %edx            # imm = 0x400
movq %r14, %rdi
movq %r15, %rsi
callq 0x1130
testl %eax, %eax
jne 0x1845
movl %ebp, %edi
movq %r15, %rsi
callq 0x131d
addl $0x2000, %r12d          # imm = 0x2000
incl %ebp
testl %eax, %eax
jns 0x180a
jmp 0x18b5
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
jmp 0x18b5
movl $0xfffffffe, %ebx       # imm = 0xFFFFFFFE
jmp 0x18b5
xorl %eax, %eax
xorl %ecx, %ecx
movslq %ecx, %rdx
movb 0x400(%rsp,%rdx), %dl
cmpb $-0x1, %dl
je 0x186a
testb %dl, %dl
jns 0x1879
movl %edx, %esi
addb %sil, %sil
incl %eax
testb %sil, %sil
js 0x185e
jmp 0x186c
incl %ecx
cmpl $0x3ff, %ecx            # imm = 0x3FF
jg 0x1879
cmpb $-0x1, %dl
je 0x1849
movl (%rsp), %edx
leal (%rax,%rcx,8), %ebx
shll $0xd, %edx
subl %edx, %ebx
addl %r12d, %ebx
movl %ebx, %edi
movl $0x1, %esi
callq 0x14c3
testl %eax, %eax
js 0x18b0
movq %rsp, %rsi
decl 0x20(%rsi)
xorl %edi, %edi
callq 0x12e5
testl %eax, %eax
movl $0xfffffffb, %eax       # imm = 0xFFFFFFFB
cmovsl %eax, %ebx
jmp 0x18b5
movl $0xfffffffc, %ebx       # imm = 0xFFFFFFFC
movl %ebx, %eax
addq $0xc00, %rsp            # imm = 0xC00
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/carlitosmarin[P]Sistema-Ficheros-SOII/./src/ficheros_basico.c
// Function: liberar_bloque
int liberar_bloque (unsigned int bloque) { 
	struct superbloque sb; 
	if(bread(posSB,&sb) < 0) return -1; //Error BREAD
	if(escribir_bit(bloque,0) < 0) return -2; //Error ESCRIBIR_BIT
	sb.cantBloquesLibres++;
	if(bwrite(posSB,&sb) < 0) return -3; //Error BWRITE
	return bloque;
}

// Assembly:
pushq %rbx
subq $0x400, %rsp            # imm = 0x400
movl %edi, %ebx
movq %rsp, %rsi
xorl %edi, %edi
callq 0x131d
testl %eax, %eax
js 0x1905
movl %ebx, %edi
xorl %esi, %esi
callq 0x14c3
testl %eax, %eax
js 0x190c
movq %rsp, %rsi
incl 0x20(%rsi)
xorl %edi, %edi
callq 0x12e5
testl %eax, %eax
movl $0xfffffffd, %eax       # imm = 0xFFFFFFFD
cmovsl %eax, %ebx
jmp 0x1911
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
jmp 0x1911
movl $0xfffffffe, %ebx       # imm = 0xFFFFFFFE
movl %ebx, %eax
addq $0x400, %rsp            # imm = 0x400
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/carlitosmarin[P]Sistema-Ficheros-SOII/./src/ficheros_basico.c
// Function: escribir_inodo
int escribir_inodo(struct inodo inodo, unsigned int ninodo) {
	struct superbloque sb; 
	if(bread(posSB,&sb) < 0) return -1; //Error BREAD
	int posIN = ((ninodo*tamInodo)/tamBloque)+sb.posPrimerBloqueAI;
	struct inodo inodos[tamBloque/tamInodo];
	if(bread(posIN,&inodos) < 0) return -1; //Leemos el array de inodos Error BREAD
	int final = ninodo%(tamBloque/tamInodo);
	inodos[final] = inodo; 
	if(bwrite(posIN,&inodos) < 0) return -2; //Error BWRITE
	return 0;
}

// Assembly:
pushq %rbp
pushq %rbx
subq $0x808, %rsp            # imm = 0x808
movl %edi, %ebx
leaq 0x408(%rsp), %rsi
xorl %edi, %edi
callq 0x131d
testl %eax, %eax
js 0x1986
movl %ebx, %ebp
shrl $0x3, %ebp
andl $0x3fffff, %ebp         # imm = 0x3FFFFF
addl 0x410(%rsp), %ebp
movq %rsp, %rsi
movl %ebp, %edi
callq 0x131d
testl %eax, %eax
js 0x1986
leaq 0x820(%rsp), %rsi
andl $0x7, %ebx
shll $0x7, %ebx
leaq (%rsp,%rbx), %rdi
movl $0x10, %ecx
rep  movsq (%rsi), %es:(%rdi)
movq %rsp, %rsi
movl %ebp, %edi
callq 0x12e5
sarl $0x1f, %eax
andl $-0x2, %eax
jmp 0x198b
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x808, %rsp            # imm = 0x808
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/carlitosmarin[P]Sistema-Ficheros-SOII/./src/ficheros_basico.c
// Function: reservar_inodo
int reservar_inodo (unsigned char tipo, unsigned char permisos) {
	struct superbloque sb; 
	if(bread(posSB,&sb) < 0) {
		puts("Error a la hora de leer el superbloque");
		return -1; //Error BREAD
	} 
	if(sb.cantInodosLibres == 0) {
		puts("No hay inodos libres");
		return -2; //Error NO_INODOS_LIBRES
	} 
	int posPIL = sb.posPrimerInodoLibre;
	
	struct inodo inodoR = leer_inodo(posPIL);
	
	//Modificamos el SuperBloque
	sb.posPrimerInodoLibre = inodoR.punterosDirectos[0];
	sb.cantInodosLibres--; //Al reservar un inodo, un inodo libre menos
	if(bwrite(posSB,&sb) < 0) {
		puts("Error a la hora de escribir en el superbloque");
		return -3; //Error BWRITE	
	}
	
	//Inicializamos el inodo
	inodoR.tipo = tipo;
	inodoR.permisos = permisos;
	inodoR.atime = time(NULL);
	inodoR.mtime = time(NULL);
	inodoR.ctime = time(NULL);
	inodoR.cantLinks = 1;
	inodoR.tamBytesLogicos = 0;
	inodoR.cantBloquesOcupados = 0;
	
	//Inicializamos los punteros
	int bucle;
	for(bucle = 0; bucle < puntD; bucle++) inodoR.punterosDirectos[bucle] = 0;
	for(bucle = 0; bucle < puntI; bucle++) inodoR.punterosIndirectos[bucle] = 0;
	if(escribir_inodo(inodoR,posPIL) < 0) {
		puts("Error a la hora de escribir el inodo");	
		return -4; //Escribimos el nuevo inodo Error ESCRIBIR_INODO
	}
	return posPIL; //Devolvemos le numero de inodo reservado
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x500, %rsp            # imm = 0x500
movl %esi, %ebp
movl %edi, %r14d
leaq 0x100(%rsp), %rsi
xorl %edi, %edi
callq 0x131d
testl %eax, %eax
js 0x1ae8
cmpl $0x0, 0x124(%rsp)
je 0x1afb
leaq 0x100(%rsp), %r15
movl 0x1c(%r15), %ebx
leaq 0x80(%rsp), %r12
movq %r12, %rdi
movl %ebx, %esi
callq 0x1995
movl 0x2c(%r12), %eax
movl %eax, 0x1c(%r15)
decl 0x24(%r15)
xorl %edi, %edi
movq %r15, %rsi
callq 0x12e5
testl %eax, %eax
js 0x1b0e
leaq 0x80(%rsp), %r15
movb %r14b, (%r15)
movb %bpl, 0x1(%r15)
xorl %edi, %edi
callq 0x1120
movq %rax, 0x8(%r15)
xorl %edi, %edi
callq 0x1120
movq %rax, 0x10(%r15)
xorl %edi, %edi
callq 0x1120
movq %rax, 0x18(%r15)
movl $0x1, 0x20(%r15)
xorps %xmm0, %xmm0
movups %xmm0, 0x24(%r15)
movups %xmm0, 0x34(%r15)
movups %xmm0, 0x44(%r15)
movups %xmm0, 0x54(%r15)
movl $0x0, 0x64(%r15)
movl $0x10, %ecx
movq %rsp, %rdi
movq %r15, %rsi
rep  movsq (%rsi), %es:(%rdi)
movl %ebx, %edi
callq 0x191c
testl %eax, %eax
jns 0x1b1f
movl $0xfffffffc, %ebx       # imm = 0xFFFFFFFC
leaq 0x2700(%rip), %rdi      # 0x41e6
jmp 0x1b1a
leaq 0x268d(%rip), %rdi      # 0x417c
callq 0x1060
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
jmp 0x1b1f
leaq 0x26a1(%rip), %rdi      # 0x41a3
callq 0x1060
movl $0xfffffffe, %ebx       # imm = 0xFFFFFFFE
jmp 0x1b1f
movl $0xfffffffd, %ebx       # imm = 0xFFFFFFFD
leaq 0x269e(%rip), %rdi      # 0x41b8
callq 0x1060
movl %ebx, %eax
addq $0x500, %rsp            # imm = 0x500
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/carlitosmarin[P]Sistema-Ficheros-SOII/./src/ficheros_basico.c
// Function: liberar_inodo
int liberar_inodo (unsigned int inodo) {
	if(liberar_bloques_inodo(inodo,0) < 0) return -2;	//Llamar a la funcion auxiliar para liberar los bloques Error LBI
	struct inodo in;
	struct superbloque sb;
	
	if(bread(posSB,&sb) < 0) return -1; //Leer el superbloque Error BREAD
	in = leer_inodo(inodo);
	in.tipo = 'l'; //Marcar el inodo como tipo libre
	in.punterosDirectos[0] = sb.posPrimerInodoLibre; //Incluirlo en la lista de inodos libres
	sb.posPrimerInodoLibre = inodo; //Actualizar el superbloque
	sb.cantInodosLibres++; //Incrementar la cantidad de inodos libres
	if(bwrite(posSB,&sb) < 0) return -4; //Escribir el superbloque Error BWRITE
	if(escribir_inodo(in, inodo) < 0) return -5; //Escribir el inodo Error ESCRIBIR_INODO
	return inodo; //Devolver el num del inodo liberado	
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x508, %rsp            # imm = 0x508
movl %edi, %ebx
xorl %esi, %esi
callq 0x1bd5
testl %eax, %eax
js 0x1bb7
leaq 0x108(%rsp), %rsi
xorl %edi, %edi
callq 0x131d
testl %eax, %eax
js 0x1bbe
leaq 0x88(%rsp), %r14
movq %r14, %rdi
movl %ebx, %esi
callq 0x1995
movb $0x6c, (%r14)
leaq 0x108(%rsp), %rsi
movl 0x1c(%rsi), %eax
movl %eax, 0x2c(%r14)
movl %ebx, 0x1c(%rsi)
incl 0x24(%rsi)
xorl %edi, %edi
callq 0x12e5
testl %eax, %eax
js 0x1bc5
leaq 0x88(%rsp), %rsi
movl $0x10, %ecx
movq %rsp, %rdi
rep  movsq (%rsi), %es:(%rdi)
movl %ebx, %edi
callq 0x191c
testl %eax, %eax
movl $0xfffffffb, %eax       # imm = 0xFFFFFFFB
cmovnsl %ebx, %eax
jmp 0x1bca
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
jmp 0x1bca
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x1bca
movl $0xfffffffc, %eax       # imm = 0xFFFFFFFC
addq $0x508, %rsp            # imm = 0x508
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x1995
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
cmpb $0x7, %bpl
ja 0x2c4c
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 0x191c
sarl $0x1f, %eax
andl $-0x3, %eax
addq $0x100, %rsp            # imm = 0x100
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x1995
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
testb $0x2, 0x1(%r14)
je 0x2d14
testl %ebp, %ebp
je 0x2ca3
movl %ebp, %eax
andl $0x3ff, %eax            # imm = 0x3FF
movl %ebp, %esi
shrl $0xa, %esi
cmpl $0x1, %eax
sbbl $-0x1, %esi
jmp 0x2ca5
xorl %esi, %esi
movl %ebx, %edi
callq 0x1bd5
testl %eax, %eax
js 0x2d0f
leaq 0x108(%rsp), %r14
movq %r14, %rdi
movl %ebx, %esi
callq 0x1995
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 0x191c
sarl $0x1f, %eax
andl $-0x4, %eax
jmp 0x2d14
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_O3/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 0x1995
movzwl (%r14), %eax
movups 0x18(%r14), %xmm0
movl 0x28(%r14), %ecx
movups 0x8(%r14), %xmm1
movw %ax, (%rbx)
movups %xmm1, 0x8(%rbx)
movups %xmm0, 0x18(%rbx)
movl %ecx, 0x28(%rbx)
xorl %eax, %eax
addq $0x88, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_c_makefile_star2_O3/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 %rbx
pushq %rax
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpb $0x2f, (%rdi)
jne 0x2dd6
movq %rdx, %rbx
movq %rdi, %r14
movl $0x1, %r15d
movzbl (%r14,%r15), %eax
testl %eax, %eax
je 0x2da1
cmpl $0x2f, %eax
je 0x2da1
movb %al, -0x1(%rsi,%r15)
incq %r15
jmp 0x2d89
movq %r14, %rdi
callq 0x1080
movl $0x1, %ebp
cmpq %r15, %rax
je 0x2dd6
movl %r15d, %ecx
xorl %ebp, %ebp
cmpq %rcx, %rax
jbe 0x2dd6
movb (%r14,%r15), %al
movb %al, (%rbx)
incq %r15
movq %r14, %rdi
callq 0x1080
incq %rbx
cmpq %r15, %rax
ja 0x2dbd
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 %rbx
subq $0x18, %rsp
movl %esi, %r14d
movq %rdi, %rbx
leaq 0x14(%rsp), %r15
movl $0x0, (%r15)
xorl %ebp, %ebp
xorl %eax, %eax
callq 0x1355
leaq 0x10(%rsp), %rdx
leaq 0xc(%rsp), %rcx
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %r8d
movl %r14d, %r9d
callq 0x2de3
testl %eax, %eax
jns 0x31d0
addl $0x9, %eax
leaq 0x10e7(%rip), %rcx      # 0x4238
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x130f(%rip), %rdi      # 0x4470
jmp 0x31b5
leaq 0x126c(%rip), %rdi      # 0x43d6
jmp 0x3173
leaq 0x12af(%rip), %rdi      # 0x4422
xorl %eax, %eax
callq 0x1090
jmp 0x31bf
leaq 0x1278(%rip), %rdi      # 0x43fb
jmp 0x31b5
leaq 0x1375(%rip), %rdi      # 0x4501
callq 0x1060
jmp 0x31bf
leaq 0x12ac(%rip), %rdi      # 0x4446
jmp 0x31b5
leaq 0x1218(%rip), %rdi      # 0x43bb
jmp 0x31b5
leaq 0x11e7(%rip), %rdi      # 0x4393
jmp 0x31b5
leaq 0x11c7(%rip), %rdi      # 0x437c
movq %rbx, %rsi
xorl %eax, %eax
callq 0x1090
leaq 0x12c5(%rip), %rdi      # 0x448b
callq 0x1060
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
xorl %eax, %eax
callq 0x1361
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x2de3
testl %eax, %eax
js 0x393d
movl 0xc(%rsp), %edi
movzbl %bpl, %esi
callq 0x2bf1
sarl $0x1f, %eax
andl $-0x2, %eax
jmp 0x39ba
addl $0x9, %eax
leaq 0x9a5(%rip), %rcx       # 0x42ec
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0xb19(%rip), %rdi       # 0x4470
jmp 0x39ab
leaq 0xa76(%rip), %rdi       # 0x43d6
jmp 0x3969
leaq 0xab9(%rip), %rdi       # 0x4422
xorl %eax, %eax
callq 0x1090
jmp 0x39b5
leaq 0xa82(%rip), %rdi       # 0x43fb
jmp 0x39ab
leaq 0xb7f(%rip), %rdi       # 0x4501
callq 0x1060
jmp 0x39b5
leaq 0xab6(%rip), %rdi       # 0x4446
jmp 0x39ab
leaq 0xa22(%rip), %rdi       # 0x43bb
jmp 0x39ab
leaq 0x9f1(%rip), %rdi       # 0x4393
jmp 0x39ab
leaq 0x9d1(%rip), %rdi       # 0x437c
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_O3/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
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x2de3
testl %eax, %eax
js 0x3a06
movl 0xc(%rsp), %edi
movq %r14, %rsi
callq 0x2d22
sarl $0x1f, %eax
andl $-0x2, %eax
jmp 0x3a83
addl $0x9, %eax
leaq 0x900(%rip), %rcx       # 0x4310
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0xa50(%rip), %rdi       # 0x4470
jmp 0x3a74
leaq 0x9ad(%rip), %rdi       # 0x43d6
jmp 0x3a32
leaq 0x9f0(%rip), %rdi       # 0x4422
xorl %eax, %eax
callq 0x1090
jmp 0x3a7e
leaq 0x9b9(%rip), %rdi       # 0x43fb
jmp 0x3a74
leaq 0xab6(%rip), %rdi       # 0x4501
callq 0x1060
jmp 0x3a7e
leaq 0x9ed(%rip), %rdi       # 0x4446
jmp 0x3a74
leaq 0x959(%rip), %rdi       # 0x43bb
jmp 0x3a74
leaq 0x928(%rip), %rdi       # 0x4393
jmp 0x3a74
leaq 0x908(%rip), %rdi       # 0x437c
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_O3/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
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x2de3
testl %eax, %eax
js 0x3ae6
movl 0xc(%rsp), %edi
movq %r15, %rsi
movl %r14d, %edx
movl %ebp, %ecx
callq 0x2881
movl %eax, %ecx
testl %eax, %eax
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
cmovnsl %ecx, %eax
jmp 0x3b6f
addl $0x9, %eax
leaq 0x844(%rip), %rcx       # 0x4334
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x970(%rip), %rdi       # 0x4470
jmp 0x3b54
leaq 0x8cd(%rip), %rdi       # 0x43d6
jmp 0x3b12
leaq 0x910(%rip), %rdi       # 0x4422
xorl %eax, %eax
callq 0x1090
jmp 0x3b5e
leaq 0x8d9(%rip), %rdi       # 0x43fb
jmp 0x3b54
leaq 0x9d6(%rip), %rdi       # 0x4501
callq 0x1060
jmp 0x3b5e
leaq 0x90d(%rip), %rdi       # 0x4446
jmp 0x3b54
leaq 0x879(%rip), %rdi       # 0x43bb
jmp 0x3b54
leaq 0x848(%rip), %rdi       # 0x4393
jmp 0x3b54
leaq 0x828(%rip), %rdi       # 0x437c
movq %rbx, %rsi
xorl %eax, %eax
callq 0x1090
leaq 0x95f(%rip), %rdi       # 0x44c4
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_O3/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, %ebp
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)
xorl %eax, %eax
callq 0x1355
leaq 0x10(%rsp), %rcx
movq %rbx, %rdi
movq %r12, %rsi
movq %r13, %rdx
xorl %r8d, %r8d
movl $0x6, %r9d
callq 0x2de3
testl %eax, %eax
js 0x3c0a
movl 0xc(%rsp), %ebx
leaq 0x18(%rsp), %r12
movq %r12, %rdi
movl %ebx, %esi
callq 0x1995
cmpb $0x66, (%r12)
jne 0x3c26
movl %ebx, %edi
movq %r15, %rsi
movl %r14d, %edx
movl %ebp, %ecx
callq 0x2524
movl %eax, %ebx
testl %eax, %eax
jns 0x3c37
movl $0xfffffffe, %ebx       # imm = 0xFFFFFFFE
jmp 0x3cb4
addl $0x9, %eax
leaq 0x744(%rip), %rcx       # 0x4358
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x84c(%rip), %rdi       # 0x4470
jmp 0x3c92
leaq 0x8b4(%rip), %rdi       # 0x44e1
callq 0x1060
movl $0xfffffffd, %ebx       # imm = 0xFFFFFFFD
xorl %eax, %eax
callq 0x1361
jmp 0x3cb4
leaq 0x78f(%rip), %rdi       # 0x43d6
jmp 0x3c50
leaq 0x7d2(%rip), %rdi       # 0x4422
xorl %eax, %eax
callq 0x1090
jmp 0x3c9c
leaq 0x79b(%rip), %rdi       # 0x43fb
jmp 0x3c92
leaq 0x898(%rip), %rdi       # 0x4501
callq 0x1060
jmp 0x3c9c
leaq 0x7cf(%rip), %rdi       # 0x4446
jmp 0x3c92
leaq 0x73b(%rip), %rdi       # 0x43bb
jmp 0x3c92
leaq 0x70a(%rip), %rdi       # 0x4393
jmp 0x3c92
leaq 0x6ea(%rip), %rdi       # 0x437c
movq %rbx, %rsi
xorl %eax, %eax
callq 0x1090
xorl %eax, %eax
callq 0x1361
leaq 0x828(%rip), %rdi       # 0x44d2
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
// File: /workspace/github_c_makefile_star2_O3/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 0x3d43
movq %rsi, %rbx
movq 0x8(%rsi), %rdi
callq 0x127c
movq 0x10(%rbx), %rdi
movq %rsp, %rsi
callq 0x39c1
testl %eax, %eax
js 0x3d6e
cmpb $0x64, (%rsp)
movq 0x10(%rbx), %rsi
jne 0x3d56
cmpl $0x0, 0x24(%rsp)
je 0x3d56
leaq 0x7ee(%rip), %rdi       # 0x4528
xorl %eax, %eax
callq 0x1090
jmp 0x3d6e
leaq 0x832(%rip), %rdi       # 0x457c
callq 0x1060
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
jmp 0x3d77
movq %rsi, %rdi
callq 0x36e6
testl %eax, %eax
jne 0x3d6e
leaq 0x7f6(%rip), %rdi       # 0x455f
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_O3/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 0xcd1b(%rip), %rsi      # 0xe004
callq 0x1100
testl %eax, %eax
je 0x135c
cmpb $0x69, (%rbx)
jne 0x130f
cmpb $0x31, 0x1(%rbx)
jne 0x1303
cmpb $0x0, 0x2(%rbx)
je 0x1367
cmpb $0x38, 0x1(%rbx)
jne 0x130f
cmpb $0x0, 0x2(%rbx)
je 0x136e
leaq 0xccf3(%rip), %rsi      # 0xe009
movq %rbx, %rdi
callq 0x1100
testl %eax, %eax
je 0x1360
leaq 0xdf28(%rip), %rsi      # 0xf251
movq %rbx, %rdi
callq 0x1100
movl $0x20, %ebp
testl %eax, %eax
je 0x1373
movq %rbx, %rdi
callq 0x1090
cmpb $0x2a, -0x1(%rbx,%rax)
je 0x1373
leaq 0xccbd(%rip), %rdi      # 0xe00d
movq %rbx, %rsi
xorl %eax, %eax
callq 0x10b0
jmp 0x1373
xorl %ebp, %ebp
jmp 0x1373
movl $0x10, %ebp
jmp 0x1373
movl $0x1, %ebp
jmp 0x1373
movl $0x8, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x13b3
cmpl $0x25, %eax
jne 0x13eb
movq %rbx, %rdi
callq 0x1090
cmpq $0x1, %rax
jne 0x13c5
xorl %eax, %eax
jmp 0x13e5
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 0x13c7
movb $0x0, (%rbx,%rax)
movb (%rbx), %al
testb %al, %al
je 0x140e
xorl %r14d, %r14d
cmpb $0x2e, (%rbx,%r14)
jne 0x13fe
movb $0x5f, (%rbx,%r14)
incq %r14
movq %rbx, %rdi
callq 0x1090
cmpq %r14, %rax
ja 0x13f2
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x12cce(%rip), %r14     # 0x14110
movl $0x6c58, %edi           # imm = 0x6C58
callq 0x1130
testq %r14, %r14
je 0x1470
movq 0x12cc0(%rip), %rcx     # 0x14118
movq %rax, 0x8(%rcx)
movq %rcx, 0x12cbd(%rip)     # 0x14120
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
jmp 0x1477
movq %rax, 0x12c99(%rip)     # 0x14110
movq %rax, 0x12c9a(%rip)     # 0x14118
movq %rbx, %rdi
callq 0x137c
movq 0x12c8b(%rip), %rcx     # 0x14118
movq %rax, 0x18(%rcx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq