#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__ isalnum(char const);
scalar_t__ isspace(char const);
int hcfg_is_cmd(const char *buf) {
  while (isspace(*buf))
    ++buf;
  while (isalnum(*buf) || *buf == '_')
    ++buf;
  while (isspace(*buf))
    ++buf;
  return (*buf == '=');
}


x86 assembly (clang, -O0):
<hcfg_is_cmd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1040 <isspace@plt>
cmp    $0x0,%rax
je     1153 <hcfg_is_cmd+0x33>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    112c <hcfg_is_cmd+0xc>
jmp    1158 <hcfg_is_cmd+0x38>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isalnum@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
jne    1186 <hcfg_is_cmd+0x66>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5f,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1196 <hcfg_is_cmd+0x76>
jmp    11a7 <hcfg_is_cmd+0x87>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1158 <hcfg_is_cmd+0x38>
jmp    11ac <hcfg_is_cmd+0x8c>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1040 <isspace@plt>
cmp    $0x0,%rax
je     11d3 <hcfg_is_cmd+0xb3>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    11ac <hcfg_is_cmd+0x8c>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3d,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hcfg_is_cmd>:
push   %rbx
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
nopl   0x0(%rax,%rax,1)
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1040 <isspace@plt>
test   %rax,%rax
jne    1130 <hcfg_is_cmd+0x10>
jmp    1154 <hcfg_is_cmd+0x34>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%rbx
movsbl (%rbx),%edi
call   1030 <isalnum@plt>
test   %rax,%rax
jne    1150 <hcfg_is_cmd+0x30>
movzbl (%rbx),%eax
cmp    $0x5f,%al
je     1150 <hcfg_is_cmd+0x30>
movsbl %al,%edi
nopl   0x0(%rax,%rax,1)
call   1040 <isspace@plt>
test   %rax,%rax
je     1184 <hcfg_is_cmd+0x64>
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
jmp    1170 <hcfg_is_cmd+0x50>
xor    %eax,%eax
cmpb   $0x3d,(%rbx)
sete   %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @hcfg_is_cmd(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %8, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = call i64 @isspace(i8 signext %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %2
br label %3
11: ; preds = %3
br label %12
12: ; preds = %24, %11
%13 = load i8*, i8** %2
%14 = load i8, i8* %13
%15 = call i64 @isalnum(i8 signext %14)
%16 = icmp ne i64 %15, 0
br i1 %16, label %22, label %17
17: ; preds = %12
%18 = load i8*, i8** %2
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 95
br label %22
22: ; preds = %17, %12
%23 = phi i1 [ true, %12 ], [ %21, %17 ]
br i1 %23, label %24, label %27
24: ; preds = %22
%25 = load i8*, i8** %2
%26 = getelementptr inbounds i8, i8* %25, i32 1
store i8* %26, i8** %2
br label %12
27: ; preds = %22
br label %28
28: ; preds = %33, %27
%29 = load i8*, i8** %2
%30 = load i8, i8* %29
%31 = call i64 @isspace(i8 signext %30)
%32 = icmp ne i64 %31, 0
br i1 %32, label %33, label %36
33: ; preds = %28
%34 = load i8*, i8** %2
%35 = getelementptr inbounds i8, i8* %34, i32 1
store i8* %35, i8** %2
br label %28
36: ; preds = %28
%37 = load i8*, i8** %2
%38 = load i8, i8* %37
%39 = sext i8 %38 to i32
%40 = icmp eq i32 %39, 61
%41 = zext i1 %40 to i32
ret i32 %41
}

LLVM IR (-O2):
define i32 @hcfg_is_cmd(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = load i8, i8* %3
%5 = tail call i64 @isspace(i8 signext %4)
%6 = icmp eq i64 %5, 0
%7 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %6, label %8, label %2
8: ; preds = %2, %19
%9 = phi i8* [ %20, %19 ], [ %3, %2 ]
%10 = load i8, i8* %9
%11 = tail call i64 @isalnum(i8 signext %10)
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %19
13: ; preds = %8
%14 = load i8, i8* %9
%15 = icmp eq i8 %14, 95
br i1 %15, label %19, label %16
16: ; preds = %13
%17 = tail call i64 @isspace(i8 signext %14)
%18 = icmp eq i64 %17, 0
br i1 %18, label %27, label %21
19: ; preds = %8, %13
%20 = getelementptr inbounds i8, i8* %9, i64 1
br label %8
21: ; preds = %16, %21
%22 = phi i8* [ %23, %21 ], [ %9, %16 ]
%23 = getelementptr inbounds i8, i8* %22, i64 1
%24 = load i8, i8* %23
%25 = tail call i64 @isspace(i8 signext %24)
%26 = icmp eq i64 %25, 0
br i1 %26, label %27, label %21
27: ; preds = %21, %16
%28 = phi i8* [ %9, %16 ], [ %23, %21 ]
%29 = load i8, i8* %28
%30 = icmp eq i8 %29, 61
%31 = zext i1 %30 to i32
ret i32 %31
}