#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*/ elg_warning(char *, char *, char *);
scalar_t__ isspace(char);
void epk_check_syntax(char *val, char *epos, char *fname) {
  char *tmp = val;
  while (isspace(*val)) {
    val++;
  }
  if (val != epos) {
    elg_warning("Syntax error in %s::%s", fname, tmp);
  }
}


x86 assembly (clang, -O0):
<epk_check_syntax>:
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    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
je     1163 <epk_check_syntax+0x43>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    113c <epk_check_syntax+0x1c>
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
je     1185 <epk_check_syntax+0x65>
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
lea    0xe80(%rip),%rdi
call   1040 <elg_warning@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<epk_check_syntax>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%r12
lea    -0x1(%rdi),%rbx
cs nopw 0x0(%rax,%rax,1)
nop
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1030 <isspace@plt>
test   %rax,%rax
jne    1140 <epk_check_syntax+0x20>
cmp    %r15,%rbx
je     1174 <epk_check_syntax+0x54>
lea    0xea2(%rip),%rdi
mov    %r14,%rsi
mov    %r12,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1040 <elg_warning@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Syntax error in %s::%s\00"
define void @epk_check_syntax(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = load i8*, i8** %4
store i8* %8, i8** %7
br label %9
9: ; preds = %14, %3
%10 = load i8*, i8** %4
%11 = load i8, i8* %10
%12 = call i64 @isspace(i8 signext %11)
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %9
%15 = load i8*, i8** %4
%16 = getelementptr inbounds i8, i8* %15, i32 1
store i8* %16, i8** %4
br label %9
17: ; preds = %9
%18 = load i8*, i8** %4
%19 = load i8*, i8** %5
%20 = icmp ne i8* %18, %19
br i1 %20, label %21, label %25
21: ; preds = %17
%22 = load i8*, i8** %6
%23 = load i8*, i8** %7
%24 = call i32 @elg_warning(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %22, i8* %23)
br label %25
25: ; preds = %21, %17
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"Syntax error in %s::%s\00"
define void @epk_check_syntax(i8* %0, i8* readnone %1, i8* %2) {
br label %4
4: ; preds = %4, %3
%5 = phi i8* [ %0, %3 ], [ %9, %4 ]
%6 = load i8, i8* %5
%7 = tail call i64 @isspace(i8 signext %6)
%8 = icmp eq i64 %7, 0
%9 = getelementptr inbounds i8, i8* %5, i64 1
br i1 %8, label %10, label %4
10: ; preds = %4
%11 = icmp eq i8* %5, %1
br i1 %11, label %14, label %12
12: ; preds = %10
%13 = tail call i32 @elg_warning(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %2, i8* %0)
br label %14
14: ; preds = %12, %10
ret void
}