#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*/ my_free_wordtab(char **);
scalar_t__ my_str_isalnum(char *);
int my_tablen(char **);
char **str_to_wordtab_delim(char *, char *);
int is_var(char *s) {
  int ret;
  char **w1;
  char **w2;
  ret = 0;
  w1 = str_to_wordtab_delim(s, "=");
  w2 = NULL;
  if (my_tablen(w1) >= 2 && my_str_isalnum(w1[0])) {
    w2 = str_to_wordtab_delim(w1[1], " \t");
    if (my_tablen(w2) >= 1)
      ret = 1;
  }
  my_free_wordtab(w1);
  my_free_wordtab(w2);
  return (ret);
}


x86 assembly (clang, -O0):
<is_var>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xea2(%rip),%rsi
call   1050 <str_to_wordtab_delim@plt>
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <my_tablen@plt>
cmp    $0x2,%eax
jl     11cd <is_var+0x8d>
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
call   1040 <my_str_isalnum@plt>
cmp    $0x0,%rax
je     11cd <is_var+0x8d>
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe5c(%rip),%rsi
call   1050 <str_to_wordtab_delim@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <my_tablen@plt>
cmp    $0x1,%eax
jl     11c8 <is_var+0x88>
movl   $0x1,-0xc(%rbp)
jmp    11cd <is_var+0x8d>
mov    -0x18(%rbp),%rdi
call   1060 <my_free_wordtab@plt>
mov    -0x20(%rbp),%rdi
call   1060 <my_free_wordtab@plt>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_var>:
push   %r15
push   %r14
push   %rbx
lea    0xeb4(%rip),%rsi
call   1050 <str_to_wordtab_delim@plt>
mov    %rax,%r14
mov    %rax,%rdi
call   1030 <my_tablen@plt>
cmp    $0x2,%eax
jl     1192 <is_var+0x52>
mov    (%r14),%rdi
call   1040 <my_str_isalnum@plt>
test   %rax,%rax
je     1192 <is_var+0x52>
mov    0x8(%r14),%rdi
lea    0xe89(%rip),%rsi
call   1050 <str_to_wordtab_delim@plt>
mov    %rax,%r15
mov    %rax,%rdi
call   1030 <my_tablen@plt>
xor    %ebx,%ebx
test   %eax,%eax
setg   %bl
jmp    1197 <is_var+0x57>
xor    %ebx,%ebx
xor    %r15d,%r15d
mov    %r14,%rdi
call   1060 <my_free_wordtab@plt>
mov    %r15,%rdi
call   1060 <my_free_wordtab@plt>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [2 x i8] c"=\00"
@.str.1 = [3 x i8] c" \09\00"
define i32 @is_var(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i8**
store i8* %0, i8** %2
store i32 0, i32* %3
%6 = load i8*, i8** %2
%7 = call i8** @str_to_wordtab_delim(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8** %7, i8*** %4
store i8** null, i8*** %5
%8 = load i8**, i8*** %4
%9 = call i32 @my_tablen(i8** %8)
%10 = icmp sge i32 %9, 2
br i1 %10, label %11, label %27
11: ; preds = %1
%12 = load i8**, i8*** %4
%13 = getelementptr inbounds i8*, i8** %12, i64 0
%14 = load i8*, i8** %13
%15 = call i64 @my_str_isalnum(i8* %14)
%16 = icmp ne i64 %15, 0
br i1 %16, label %17, label %27
17: ; preds = %11
%18 = load i8**, i8*** %4
%19 = getelementptr inbounds i8*, i8** %18, i64 1
%20 = load i8*, i8** %19
%21 = call i8** @str_to_wordtab_delim(i8* %20, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i8** %21, i8*** %5
%22 = load i8**, i8*** %5
%23 = call i32 @my_tablen(i8** %22)
%24 = icmp sge i32 %23, 1
br i1 %24, label %25, label %26
25: ; preds = %17
store i32 1, i32* %3
br label %26
26: ; preds = %25, %17
br label %27
27: ; preds = %26, %11, %1
%28 = load i8**, i8*** %4
%29 = call i32 @my_free_wordtab(i8** %28)
%30 = load i8**, i8*** %5
%31 = call i32 @my_free_wordtab(i8** %30)
%32 = load i32, i32* %3
ret i32 %32
}

LLVM IR (-O2):
@.str = [2 x i8] c"=\00"
@.str.1 = [3 x i8] c" \09\00"
define i32 @is_var(i8* %0) {
%2 = tail call i8** @str_to_wordtab_delim(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @my_tablen(i8** %2)
%4 = icmp sgt i32 %3, 1
br i1 %4, label %5, label %16
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = tail call i64 @my_str_isalnum(i8* %6)
%8 = icmp eq i64 %7, 0
br i1 %8, label %16, label %9
9: ; preds = %5
%10 = getelementptr inbounds i8*, i8** %2, i64 1
%11 = load i8*, i8** %10
%12 = tail call i8** @str_to_wordtab_delim(i8* %11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%13 = tail call i32 @my_tablen(i8** %12)
%14 = icmp sgt i32 %13, 0
%15 = zext i1 %14 to i32
br label %16
16: ; preds = %9, %5, %1
%17 = phi i32 [ 0, %5 ], [ 0, %1 ], [ %15, %9 ]
%18 = phi i8** [ null, %5 ], [ null, %1 ], [ %12, %9 ]
%19 = tail call i32 @my_free_wordtab(i8** %2)
%20 = tail call i32 @my_free_wordtab(i8** %18)
ret i32 %17
}