#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*/ SIGABRT;
scalar_t__ isdigit(char);
scalar_t__ isspace(char);
int /*<<< orphan*/ raise(int /*<<< orphan*/);
void check_of_message(char *checkptr) {
  while (*checkptr != '\0') {
    if (isdigit(*checkptr) || isspace(*checkptr)) {
      checkptr++;
    } else {
      raise(SIGABRT);
    }
  }
}


x86 assembly (clang, -O0):
<check_of_message>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     119c <check_of_message+0x6c>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1040 <isdigit@plt>
cmp    $0x0,%rax
jne    1178 <check_of_message+0x48>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1050 <isspace@plt>
cmp    $0x0,%rax
je     1189 <check_of_message+0x59>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1197 <check_of_message+0x67>
mov    0x2e50(%rip),%rax
mov    (%rax),%edi
call   1030 <raise@plt>
jmp    113c <check_of_message+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_of_message>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     117f <check_of_message+0x4f>
mov    %rdi,%rbx
mov    0x2e9c(%rip),%r14
jmp    115b <check_of_message+0x2b>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%rbx
movzbl (%rbx),%eax
test   %al,%al
je     117f <check_of_message+0x4f>
movsbl %al,%edi
call   1040 <isdigit@plt>
test   %rax,%rax
jne    1150 <check_of_message+0x20>
movsbl (%rbx),%edi
call   1050 <isspace@plt>
test   %rax,%rax
jne    1150 <check_of_message+0x20>
mov    (%r14),%edi
call   1030 <raise@plt>
jmp    1154 <check_of_message+0x24>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@SIGABRT = global i32 0
define void @check_of_message(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %24, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %25
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = call i64 @isdigit(i8 signext %10)
%12 = icmp ne i64 %11, 0
br i1 %12, label %18, label %13
13: ; preds = %8
%14 = load i8*, i8** %2
%15 = load i8, i8* %14
%16 = call i64 @isspace(i8 signext %15)
%17 = icmp ne i64 %16, 0
br i1 %17, label %18, label %21
18: ; preds = %13, %8
%19 = load i8*, i8** %2
%20 = getelementptr inbounds i8, i8* %19, i32 1
store i8* %20, i8** %2
br label %24
21: ; preds = %13
%22 = load i32, i32* @SIGABRT
%23 = call i32 @raise(i32 %22)
br label %24
24: ; preds = %21, %18
br label %3
25: ; preds = %3
ret void
}

LLVM IR (-O2):
@SIGABRT = global i32 0
define void @check_of_message(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %22, label %4
4: ; preds = %1, %18
%5 = phi i8 [ %20, %18 ], [ %2, %1 ]
%6 = phi i8* [ %19, %18 ], [ %0, %1 ]
%7 = tail call i64 @isdigit(i8 signext %5)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %4
%10 = load i8, i8* %6
%11 = tail call i64 @isspace(i8 signext %10)
%12 = icmp eq i64 %11, 0
br i1 %12, label %15, label %13
13: ; preds = %9, %4
%14 = getelementptr inbounds i8, i8* %6, i64 1
br label %18
15: ; preds = %9
%16 = load i32, i32* @SIGABRT
%17 = tail call i32 @raise(i32 %16)
br label %18
18: ; preds = %15, %13
%19 = phi i8* [ %14, %13 ], [ %6, %15 ]
%20 = load i8, i8* %19
%21 = icmp eq i8 %20, 0
br i1 %21, label %22, label %4
22: ; preds = %18, %1
ret void
}