#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 /*<<< orphan*/ scanf(char *, char *, char *);
int main() {
  char a, b;
  printf("please input char a,b\n");
  scanf("%d,%d", &a, &b);
  if ((a > 47 && a < 78) || (b > 47 && b < 58))
    printf("YES,there is digit!");
  else
    printf("No,there is NO digit in a and b !");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
lea    0xed5(%rip),%rdi
lea    -0x5(%rbp),%rsi
lea    -0x6(%rbp),%rdx
call   1040 <scanf@plt>
movsbl -0x5(%rbp),%eax
cmp    $0x2f,%eax
jle    1169 <main+0x49>
movsbl -0x5(%rbp),%eax
cmp    $0x4e,%eax
jl     1183 <main+0x63>
movsbl -0x6(%rbp),%eax
cmp    $0x2f,%eax
jle    1194 <main+0x74>
movsbl -0x6(%rbp),%eax
cmp    $0x3a,%eax
jge    1194 <main+0x74>
lea    0xe93(%rip),%rdi
call   1030 <printf@plt>
jmp    11a0 <main+0x80>
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf04(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
lea    0x7(%rsp),%rsi
lea    0x6(%rsp),%rdx
call   1050 <scanf@plt>
mov    0x7(%rsp),%al
add    $0xd0,%al
mov    0x6(%rsp),%cl
add    $0xd0,%cl
cmp    $0xa,%cl
lea    0xe9c(%rip),%rcx
lea    0xea9(%rip),%rdi
cmovb  %rcx,%rdi
cmp    $0x1e,%al
cmovb  %rcx,%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"please input char a,b\0A\00"
@.str.1 = [6 x i8] c"%d,%d\00"
@.str.2 = [20 x i8] c"YES,there is digit!\00"
@.str.3 = [34 x i8] c"No,there is NO digit in a and b !\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8
store i32 0, i32* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %2, i8* %3)
%6 = load i8, i8* %2
%7 = sext i8 %6 to i32
%8 = icmp sgt i32 %7, 47
br i1 %8, label %9, label %13
9: ; preds = %0
%10 = load i8, i8* %2
%11 = sext i8 %10 to i32
%12 = icmp slt i32 %11, 78
br i1 %12, label %21, label %13
13: ; preds = %9, %0
%14 = load i8, i8* %3
%15 = sext i8 %14 to i32
%16 = icmp sgt i32 %15, 47
br i1 %16, label %17, label %23
17: ; preds = %13
%18 = load i8, i8* %3
%19 = sext i8 %18 to i32
%20 = icmp slt i32 %19, 58
br i1 %20, label %21, label %23
21: ; preds = %17, %9
%22 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
br label %25
23: ; preds = %17, %13
%24 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0))
br label %25
25: ; preds = %23, %21
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [6 x i8] c"%d,%d\00"
@.str.2 = [20 x i8] c"YES,there is digit!\00"
@.str.3 = [34 x i8] c"No,there is NO digit in a and b !\00"
@str = [22 x i8] c"please input char a,b\00"
define i32 @main() {
%1 = alloca i8
%2 = alloca i8
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %1, i8* %2)
%5 = load i8, i8* %1
%6 = add i8 %5, -48
%7 = icmp ult i8 %6, 30
%8 = load i8, i8* %2
%9 = add i8 %8, -48
%10 = icmp ult i8 %9, 10
%11 = select i1 %7, i1 true, i1 %10
%12 = select i1 %11, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0)
%13 = call i32 @printf(i8* dereferenceable(1) %12)
ret i32 0
}