#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__ EXIT_FAILURE;
int /*<<< orphan*/ exit(scalar_t__);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
void charCheck(int (*classComp)(int c), char *j, size_t cur_ln) {
  if (!classComp(*j)) {
    fprintf(stderr,
            "Error: line %d: Lines can only contain digits and spaces!\n",
            (int)cur_ln + 1);
    exit(EXIT_FAILURE + 2);
  }
}


x86 assembly (clang, -O0):
<charCheck>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%edi
call   *%rax
cmp    $0x0,%eax
jne    117b <charCheck+0x5b>
mov    0x2e8f(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rax
mov    %eax,%edx
add    $0x1,%edx
lea    0xe9d(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e69(%rip),%rax
mov    (%rax),%rdi
add    $0x2,%rdi
call   1040 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<charCheck>:
push   %rbx
mov    %rdx,%rbx
mov    %rdi,%rax
movsbl (%rsi),%edi
call   *%rax
test   %eax,%eax
je     1132 <charCheck+0x12>
pop    %rbx
ret
mov    0x2ea7(%rip),%rax
mov    (%rax),%edi
add    $0x1,%ebx
lea    0xebb(%rip),%rsi
mov    %ebx,%edx
call   1030 <fprintf@plt>
mov    0x2e85(%rip),%rax
mov    (%rax),%rdi
add    $0x2,%rdi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [59 x i8] c"Error: line %d: Lines can only contain digits and spaces!\0A\00"
@EXIT_FAILURE = global i64 0
define void @charCheck(i32 (i32)* %0, i8* %1, i64 %2) {
%4 = alloca i32 (i32)*
%5 = alloca i8*
%6 = alloca i64
store i32 (i32)* %0, i32 (i32)** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i32 (i32)*, i32 (i32)** %4
%8 = load i8*, i8** %5
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = call i32 %7(i32 %10)
%12 = icmp ne i32 %11, 0
br i1 %12, label %22, label %13
13: ; preds = %3
%14 = load i32, i32* @stderr
%15 = load i64, i64* %6
%16 = trunc i64 %15 to i32
%17 = add nsw i32 %16, 1
%18 = call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i32 %17)
%19 = load i64, i64* @EXIT_FAILURE
%20 = add nsw i64 %19, 2
%21 = call i32 @exit(i64 %20)
unreachable
22: ; preds = %3
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [59 x i8] c"Error: line %d: Lines can only contain digits and spaces!\0A\00"
@EXIT_FAILURE = global i64 0
define void @charCheck(i32 (i32)* nocapture %0, i8* nocapture %1, i64 %2) {
%4 = load i8, i8* %1
%5 = sext i8 %4 to i32
%6 = tail call i32 %0(i32 %5)
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %16
8: ; preds = %3
%9 = load i32, i32* @stderr
%10 = trunc i64 %2 to i32
%11 = add nsw i32 %10, 1
%12 = tail call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = load i64, i64* @EXIT_FAILURE
%14 = add nsw i64 %13, 2
%15 = tail call i32 @exit(i64 %14)
unreachable
16: ; preds = %3
ret void
}