// File: /workspace/github_c_makefile_star2_O0/xtanitfy[P]Murphy/src/log.c
// Function: LOG_compBinFile
int LOG_compBinFile(char *binFile1,char *binFile2,int size)
{
	int f1 = open(binFile1,O_RDONLY,0666);
	CHECK_EXPR_RET(f1 < 0,-1);
	
	int f2 = open(binFile2,O_RDONLY,0666);
	CHECK_EXPR_RET(f1 < 0,-1);

	double *buffer1 = (double *)malloc(sizeof(double)*size);
	CHECK_EXPR_RET(buffer1 == NULL,-1);

	double *buffer2 = (double *)malloc(sizeof(double)*size);
	CHECK_EXPR_RET(buffer2 == NULL,-1);
	
	int nreadFile1 = read(f1,buffer1,size);
	CHECK_EXPR_RET(nreadFile1 != size,-1);

	int nreadFile2 = read(f2,buffer2,size);
	CHECK_EXPR_RET(nreadFile2 != size,-1);

	BOOL flag = TRUE;
	int i = 0;
	for ( i = 0;i < size;i++) {
		if (fabsf(buffer1[i] - buffer2[i]) > 0.00000001) {
			printf("NotEquale:[%s %.10lf] != [%s %.10lf] offset:%d diff:%lf\n",
						binFile1,buffer1[i],binFile2,buffer2[i],i,buffer1[i]-buffer2[i]);
			flag = FALSE;
			return -1;
		}
	}

	if (flag == TRUE) {
		printf("Equale %s == %s\n",binFile1,binFile2);
	}
	free(buffer2);
	free(buffer1);

	close(f2);
	close(f1);

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq -0x10(%rbp), %rdi
xorl %esi, %esi
movl $0x1b6, %edx            # imm = 0x1B6
movb $0x0, %al
callq 0x1080
movl %eax, -0x20(%rbp)
cmpl $0x0, -0x20(%rbp)
jge 0x19fb
leaq 0x1673(%rip), %rdi      # 0x3048
leaq 0x1682(%rip), %rsi      # 0x305e
leaq 0x16c8(%rip), %rdx      # 0x30ab
movl $0x67, %ecx
movb $0x0, %al
callq 0x1030
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x1c68
movq -0x18(%rbp), %rdi
xorl %esi, %esi
movl $0x1b6, %edx            # imm = 0x1B6
movb $0x0, %al
callq 0x1080
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x20(%rbp)
jge 0x1a43
leaq 0x162b(%rip), %rdi      # 0x3048
leaq 0x163a(%rip), %rsi      # 0x305e
leaq 0x1680(%rip), %rdx      # 0x30ab
movl $0x6a, %ecx
movb $0x0, %al
callq 0x1030
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x1c68
movslq -0x1c(%rbp), %rdi
shlq $0x3, %rdi
callq 0x10b0
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x1a88
leaq 0x15e6(%rip), %rdi      # 0x3048
leaq 0x15f5(%rip), %rsi      # 0x305e
leaq 0x163b(%rip), %rdx      # 0x30ab
movl $0x6d, %ecx
movb $0x0, %al
callq 0x1030
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x1c68
movslq -0x1c(%rbp), %rdi
shlq $0x3, %rdi
callq 0x10b0
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0x1acd
leaq 0x15a1(%rip), %rdi      # 0x3048
leaq 0x15b0(%rip), %rsi      # 0x305e
leaq 0x15f6(%rip), %rdx      # 0x30ab
movl $0x70, %ecx
movb $0x0, %al
callq 0x1030
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x1c68
movl -0x20(%rbp), %edi
movq -0x30(%rbp), %rsi
movslq -0x1c(%rbp), %rdx
callq 0x10c0
movl %eax, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
cmpl -0x1c(%rbp), %eax
je 0x1b15
leaq 0x1559(%rip), %rdi      # 0x3048
leaq 0x1568(%rip), %rsi      # 0x305e
leaq 0x15ae(%rip), %rdx      # 0x30ab
movl $0x73, %ecx
movb $0x0, %al
callq 0x1030
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x1c68
movl -0x24(%rbp), %edi
movq -0x38(%rbp), %rsi
movslq -0x1c(%rbp), %rdx
callq 0x10c0
movl %eax, -0x40(%rbp)
movl -0x40(%rbp), %eax
cmpl -0x1c(%rbp), %eax
je 0x1b5d
leaq 0x1511(%rip), %rdi      # 0x3048
leaq 0x1520(%rip), %rsi      # 0x305e
leaq 0x1566(%rip), %rdx      # 0x30ab
movl $0x76, %ecx
movb $0x0, %al
callq 0x1030
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x1c68
movb $0x1, -0x41(%rbp)
movl $0x0, -0x48(%rbp)
movl $0x0, -0x48(%rbp)
movl -0x48(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0x1c20
movq -0x30(%rbp), %rax
movslq -0x48(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x38(%rbp), %rax
movslq -0x48(%rbp), %rcx
subsd (%rax,%rcx,8), %xmm0
cvtsd2ss %xmm0, %xmm0
movaps 0x1490(%rip), %xmm1     # 0x3030
pand %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0x1478(%rip), %xmm1     # 0x3028
ucomisd %xmm1, %xmm0
jbe 0x1c10
movq -0x10(%rbp), %rsi
movq -0x30(%rbp), %rax
movslq -0x48(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x18(%rbp), %rdx
movq -0x38(%rbp), %rax
movslq -0x48(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm1
movl -0x48(%rbp), %ecx
movq -0x30(%rbp), %rax
movslq -0x48(%rbp), %rdi
movsd (%rax,%rdi,8), %xmm2
movq -0x38(%rbp), %rax
movslq -0x48(%rbp), %rdi
subsd (%rax,%rdi,8), %xmm2
leaq 0x14bf(%rip), %rdi      # 0x30bb
movb $0x3, %al
callq 0x1030
movb $0x0, -0x41(%rbp)
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x1c68
jmp 0x1c12
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0x1b6f
movsbl -0x41(%rbp), %eax
cmpl $0x1, %eax
jne 0x1c3f
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
leaq 0x14bc(%rip), %rdi      # 0x30f4
movb $0x0, %al
callq 0x1030
movq -0x38(%rbp), %rdi
callq 0x10a0
movq -0x30(%rbp), %rdi
callq 0x10a0
movl -0x24(%rbp), %edi
callq 0x10d0
movl -0x20(%rbp), %edi
callq 0x10d0
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)