#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 */
char toupper(int);
int isxdigit(int c) {
  if ((toupper(c) <= 'F') && (toupper(c) >= 'A'))
    return 1;
  if ((toupper(c) <= '9') && (toupper(c) >= '0'))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isxdigit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <toupper@plt>
movsbl %al,%eax
cmp    $0x46,%eax
jg     114f <isxdigit+0x3f>
mov    -0x8(%rbp),%edi
call   1030 <toupper@plt>
movsbl %al,%eax
cmp    $0x41,%eax
jl     114f <isxdigit+0x3f>
movl   $0x1,-0x4(%rbp)
jmp    118a <isxdigit+0x7a>
mov    -0x8(%rbp),%edi
call   1030 <toupper@plt>
movsbl %al,%eax
cmp    $0x39,%eax
jg     1183 <isxdigit+0x73>
mov    -0x8(%rbp),%edi
call   1030 <toupper@plt>
movsbl %al,%eax
cmp    $0x30,%eax
jl     1183 <isxdigit+0x73>
movl   $0x1,-0x4(%rbp)
jmp    118a <isxdigit+0x7a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isxdigit>:
push   %rbx
mov    %edi,%ebx
call   1030 <toupper@plt>
cmp    $0x46,%al
jg     112f <isxdigit+0x1f>
mov    %ebx,%edi
call   1030 <toupper@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    $0x40,%cl
jg     114f <isxdigit+0x3f>
mov    %ebx,%edi
call   1030 <toupper@plt>
cmp    $0x39,%al
jg     114d <isxdigit+0x3d>
mov    %ebx,%edi
call   1030 <toupper@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    $0x2f,%cl
jg     114f <isxdigit+0x3f>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @isxdigit(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call signext i8 @toupper(i32 %4)
%6 = sext i8 %5 to i32
%7 = icmp sle i32 %6, 70
br i1 %7, label %8, label %14
8: ; preds = %1
%9 = load i32, i32* %3
%10 = call signext i8 @toupper(i32 %9)
%11 = sext i8 %10 to i32
%12 = icmp sge i32 %11, 65
br i1 %12, label %13, label %14
13: ; preds = %8
store i32 1, i32* %2
br label %26
14: ; preds = %8, %1
%15 = load i32, i32* %3
%16 = call signext i8 @toupper(i32 %15)
%17 = sext i8 %16 to i32
%18 = icmp sle i32 %17, 57
br i1 %18, label %19, label %25
19: ; preds = %14
%20 = load i32, i32* %3
%21 = call signext i8 @toupper(i32 %20)
%22 = sext i8 %21 to i32
%23 = icmp sge i32 %22, 48
br i1 %23, label %24, label %25
24: ; preds = %19
store i32 1, i32* %2
br label %26
25: ; preds = %19, %14
store i32 0, i32* %2
br label %26
26: ; preds = %25, %24, %13
%27 = load i32, i32* %2
ret i32 %27
}

LLVM IR (-O2):
define i32 @isxdigit(i32 %0) {
%2 = tail call signext i8 @toupper(i32 %0)
%3 = icmp slt i8 %2, 71
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call signext i8 @toupper(i32 %0)
%6 = icmp sgt i8 %5, 64
br i1 %6, label %14, label %7
7: ; preds = %4, %1
%8 = tail call signext i8 @toupper(i32 %0)
%9 = icmp slt i8 %8, 58
br i1 %9, label %10, label %13
10: ; preds = %7
%11 = tail call signext i8 @toupper(i32 %0)
%12 = icmp sgt i8 %11, 47
br i1 %12, label %14, label %13
13: ; preds = %10, %7
br label %14
14: ; preds = %10, %4, %13
%15 = phi i32 [ 0, %13 ], [ 1, %4 ], [ 1, %10 ]
ret i32 %15
}