#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 */
bool is_integer(char *a) {
  if (('0' <= a[0]) && ('9' >= a[0])) {
    return true;
  }
  if ('-' == a[0]) {
    if (('0' <= a[1]) && ('9' >= a[1])) {
      return true;
    }
  }
  return false;
}


x86 assembly (clang, -O0):
<is_integer>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x30,%eax
cmp    %ecx,%eax
jg     113c <is_integer+0x3c>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x39,%eax
cmp    %ecx,%eax
jl     113c <is_integer+0x3c>
movl   $0x1,-0x4(%rbp)
jmp    1192 <is_integer+0x92>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x2d,%eax
cmp    %ecx,%eax
jne    118b <is_integer+0x8b>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%ecx
mov    $0x30,%eax
cmp    %ecx,%eax
jg     1186 <is_integer+0x86>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%ecx
mov    $0x39,%eax
cmp    %ecx,%eax
jl     1186 <is_integer+0x86>
movl   $0x1,-0x4(%rbp)
jmp    1192 <is_integer+0x92>
jmp    118b <is_integer+0x8b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_integer>:
mov    (%rdi),%cl
lea    -0x30(%rcx),%edx
mov    $0x1,%eax
cmp    $0xa,%dl
jb     1121 <is_integer+0x21>
cmp    $0x2d,%cl
jne    111f <is_integer+0x1f>
mov    0x1(%rdi),%cl
add    $0xd0,%cl
cmp    $0xa,%cl
jb     1121 <is_integer+0x21>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @is_integer(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 sle i32 48, %7
br i1 %8, label %9, label %16
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 0
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp sge i32 57, %13
br i1 %14, label %15, label %16
15: ; preds = %9
store i32 1, i32* %2
br label %37
16: ; preds = %9, %1
%17 = load i8*, i8** %3
%18 = getelementptr inbounds i8, i8* %17, i64 0
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = icmp eq i32 45, %20
br i1 %21, label %22, label %36
22: ; preds = %16
%23 = load i8*, i8** %3
%24 = getelementptr inbounds i8, i8* %23, i64 1
%25 = load i8, i8* %24
%26 = sext i8 %25 to i32
%27 = icmp sle i32 48, %26
br i1 %27, label %28, label %35
28: ; preds = %22
%29 = load i8*, i8** %3
%30 = getelementptr inbounds i8, i8* %29, i64 1
%31 = load i8, i8* %30
%32 = sext i8 %31 to i32
%33 = icmp sge i32 57, %32
br i1 %33, label %34, label %35
34: ; preds = %28
store i32 1, i32* %2
br label %37
35: ; preds = %28, %22
br label %36
36: ; preds = %35, %16
store i32 0, i32* %2
br label %37
37: ; preds = %36, %34, %15
%38 = load i32, i32* %2
ret i32 %38
}

LLVM IR (-O2):
define i32 @is_integer(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = add i8 %2, -48
%4 = icmp ult i8 %3, 10
br i1 %4, label %13, label %5
5: ; preds = %1
%6 = icmp eq i8 %2, 45
br i1 %6, label %7, label %12
7: ; preds = %5
%8 = getelementptr inbounds i8, i8* %0, i64 1
%9 = load i8, i8* %8
%10 = add i8 %9, -48
%11 = icmp ult i8 %10, 10
br i1 %11, label %13, label %12
12: ; preds = %7, %5
br label %13
13: ; preds = %7, %1, %12
%14 = phi i32 [ 0, %12 ], [ 1, %1 ], [ 1, %7 ]
ret i32 %14
}