#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 */
scalar_t__ isdigit(unsigned char);
scalar_t__ isupper(unsigned char);
int is_isi_tag(const char *buf) {
  if (!isupper((unsigned char)buf[0]))
    return 0;
  if (!(isupper((unsigned char)buf[1]) || isdigit((unsigned char)buf[1])))
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<is_isi_tag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%edi
call   1040 <isupper@plt>
cmp    $0x0,%rax
jne    114e <is_isi_tag+0x2e>
movl   $0x0,-0x4(%rbp)
jmp    118f <is_isi_tag+0x6f>
mov    -0x10(%rbp),%rax
movzbl 0x1(%rax),%edi
call   1040 <isupper@plt>
cmp    $0x0,%rax
jne    1188 <is_isi_tag+0x68>
mov    -0x10(%rbp),%rax
movzbl 0x1(%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
jne    1188 <is_isi_tag+0x68>
movl   $0x0,-0x4(%rbp)
jmp    118f <is_isi_tag+0x6f>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_isi_tag>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
movzbl (%rdi),%edi
call   1040 <isupper@plt>
xor    %ebp,%ebp
test   %rax,%rax
je     1156 <is_isi_tag+0x36>
movzbl 0x1(%rbx),%edi
call   1040 <isupper@plt>
test   %rax,%rax
jne    1151 <is_isi_tag+0x31>
movzbl 0x1(%rbx),%edi
call   1030 <isdigit@plt>
test   %rax,%rax
je     1156 <is_isi_tag+0x36>
mov    $0x1,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @is_isi_tag(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 = call i64 @isupper(i8 zeroext %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %10, label %9
9: ; preds = %1
store i32 0, i32* %2
br label %24
10: ; preds = %1
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i64 1
%13 = load i8, i8* %12
%14 = call i64 @isupper(i8 zeroext %13)
%15 = icmp ne i64 %14, 0
br i1 %15, label %23, label %16
16: ; preds = %10
%17 = load i8*, i8** %3
%18 = getelementptr inbounds i8, i8* %17, i64 1
%19 = load i8, i8* %18
%20 = call i64 @isdigit(i8 zeroext %19)
%21 = icmp ne i64 %20, 0
br i1 %21, label %23, label %22
22: ; preds = %16
store i32 0, i32* %2
br label %24
23: ; preds = %16, %10
store i32 1, i32* %2
br label %24
24: ; preds = %23, %22, %9
%25 = load i32, i32* %2
ret i32 %25
}

LLVM IR (-O2):
define i32 @is_isi_tag(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = tail call i64 @isupper(i8 zeroext %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %1
%6 = getelementptr inbounds i8, i8* %0, i64 1
%7 = load i8, i8* %6
%8 = tail call i64 @isupper(i8 zeroext %7)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %5
%11 = load i8, i8* %6
%12 = tail call i64 @isdigit(i8 zeroext %11)
%13 = icmp eq i64 %12, 0
br i1 %13, label %15, label %14
14: ; preds = %10, %5
br label %15
15: ; preds = %10, %1, %14
%16 = phi i32 [ 1, %14 ], [ 0, %1 ], [ 0, %10 ]
ret i32 %16
}