#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int int8_t;

/* Variables and functions */
scalar_t__ ecc_checkpq(int /*<<< orphan*/ const *, int /*<<< orphan*/ const *,
                       int, int, int, int, int /*<<< orphan*/ const *);
int8_t ecc_checksector(const uint8_t *address, const uint8_t *data,
                       const uint8_t *ecc) {
  return ecc_checkpq(address, data, 86, 24, 2, 86, ecc) &&
         ecc_checkpq(address, data, 52, 43, 86, 88, ecc + 0xAC);
}


x86 assembly (clang, -O0):
<ecc_checksector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rax
mov    $0x56,%r9d
mov    $0x18,%ecx
mov    $0x2,%r8d
mov    %r9d,%edx
mov    %rax,(%rsp)
call   1030 <ecc_checkpq@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x19(%rbp)
je     119a <ecc_checksector+0x8a>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rax
add    $0x2b0,%rax
mov    $0x34,%edx
mov    $0x2b,%ecx
mov    $0x56,%r8d
mov    $0x58,%r9d
mov    %rax,(%rsp)
call   1030 <ecc_checkpq@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ecc_checksector>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rdx,(%rsp)
mov    $0x56,%edx
mov    $0x18,%ecx
mov    $0x2,%r8d
mov    $0x56,%r9d
call   1030 <ecc_checkpq@plt>
test   %rax,%rax
je     117f <ecc_checksector+0x6f>
add    $0x2b0,%rbx
mov    %rbx,(%rsp)
mov    %r15,%rdi
mov    %r14,%rsi
mov    $0x34,%edx
mov    $0x2b,%ecx
mov    $0x56,%r8d
mov    $0x58,%r9d
call   1030 <ecc_checkpq@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
jmp    1181 <ecc_checksector+0x71>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @ecc_checksector(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load i32*, i32** %4
%8 = load i32*, i32** %5
%9 = load i32*, i32** %6
%10 = call i64 @ecc_checkpq(i32* %7, i32* %8, i32 86, i32 24, i32 2, i32 86, i32* %9)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %19
12: ; preds = %3
%13 = load i32*, i32** %4
%14 = load i32*, i32** %5
%15 = load i32*, i32** %6
%16 = getelementptr inbounds i32, i32* %15, i64 172
%17 = call i64 @ecc_checkpq(i32* %13, i32* %14, i32 52, i32 43, i32 86, i32 88, i32* %16)
%18 = icmp ne i64 %17, 0
br label %19
19: ; preds = %12, %3
%20 = phi i1 [ false, %3 ], [ %18, %12 ]
%21 = zext i1 %20 to i32
ret i32 %21
}

LLVM IR (-O2):
define i32 @ecc_checksector(i32* %0, i32* %1, i32* %2) {
%4 = tail call i64 @ecc_checkpq(i32* %0, i32* %1, i32 86, i32 24, i32 2, i32 86, i32* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %3
%7 = getelementptr inbounds i32, i32* %2, i64 172
%8 = tail call i64 @ecc_checkpq(i32* %0, i32* %1, i32 52, i32 43, i32 86, i32 88, i32* %7)
%9 = icmp ne i64 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %6, %3
%12 = phi i32 [ 0, %3 ], [ %10, %6 ]
ret i32 %12
}