#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 */

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int prefix(char *ISBN13) {
  if (ISBN13[0] == '9' && ISBN13[1] == '7' &&
      (ISBN13[2] == '8' || ISBN13[2] == '9'))
    return 1;
  else {
    printf("0\n");
    return 0;
  }
  return -1;
}


x86 assembly (clang, -O0):
<prefix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x39,%eax
jne    116b <prefix+0x5b>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x37,%eax
jne    116b <prefix+0x5b>
mov    -0x10(%rbp),%rax
movsbl 0x2(%rax),%eax
cmp    $0x38,%eax
je     115f <prefix+0x4f>
mov    -0x10(%rbp),%rax
movsbl 0x2(%rax),%eax
cmp    $0x39,%eax
jne    116b <prefix+0x5b>
movl   $0x1,-0x4(%rbp)
jmp    117e <prefix+0x6e>
lea    0xe8e(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prefix>:
push   %rax
cmpb   $0x39,(%rdi)
jne    112c <prefix+0x1c>
cmpb   $0x37,0x1(%rdi)
jne    112c <prefix+0x1c>
mov    0x2(%rdi),%cl
and    $0xfe,%cl
mov    $0x1,%eax
cmp    $0x38,%cl
je     113a <prefix+0x2a>
lea    0xecd(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"0\0A\00"
define i32 @prefix(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 57
br i1 %8, label %9, label %28
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 55
br i1 %14, label %15, label %28
15: ; preds = %9
%16 = load i8*, i8** %3
%17 = getelementptr inbounds i8, i8* %16, i64 2
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %19, 56
br i1 %20, label %27, label %21
21: ; preds = %15
%22 = load i8*, i8** %3
%23 = getelementptr inbounds i8, i8* %22, i64 2
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = icmp eq i32 %25, 57
br i1 %26, label %27, label %28
27: ; preds = %21, %15
store i32 1, i32* %2
br label %30
28: ; preds = %21, %9, %1
%29 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %2
br label %30
30: ; preds = %28, %27
%31 = load i32, i32* %2
ret i32 %31
}

LLVM IR (-O2):
@str = [2 x i8] c"0\00"
define i32 @prefix(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 57
br i1 %3, label %4, label %13
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 55
br i1 %7, label %8, label %13
8: ; preds = %4
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = and i8 %10, -2
%12 = icmp eq i8 %11, 56
br i1 %12, label %15, label %13
13: ; preds = %8, %4, %1
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
br label %15
15: ; preds = %8, %13
%16 = phi i32 [ 0, %13 ], [ 1, %8 ]
ret i32 %16
}