#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*/ isupport_set(char *, char *);
int /*<<< orphan*/ isupport_unset(char *);
char *strchr(char *, char);
void isupport_token(char *tok) {
  char *param = tok, *value = NULL, *equals;
  bool set;
  set = tok[0] != '-';
  if (tok[0] == '-')
    tok++;
  equals = strchr(param, '=');
  if (equals) {
    *equals = '\0';
    value = equals + 1;
  }
  if (value && *value == '\0')
    value = NULL;
  if (set)
    isupport_set(param, value);
  else
    isupport_unset(param);
}


x86 assembly (clang, -O0):
<isupport_token>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    117d <isupport_token+0x4d>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x3d,%esi
call   1040 <strchr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     11ad <isupport_token+0x7d>
mov    -0x20(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     11d0 <isupport_token+0xa0>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    11d0 <isupport_token+0xa0>
movq   $0x0,-0x18(%rbp)
cmpl   $0x0,-0x24(%rbp)
je     11ec <isupport_token+0xbc>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <isupport_set@plt>
jmp    11f5 <isupport_token+0xc5>
mov    -0x10(%rbp),%rdi
call   1050 <isupport_unset@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isupport_token>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    (%rdi),%bpl
mov    $0x3d,%esi
call   1040 <strchr@plt>
test   %rax,%rax
je     115e <isupport_token+0x2e>
movb   $0x0,(%rax)
mov    %rax,%rcx
add    $0x1,%rcx
xor    %esi,%esi
cmpb   $0x0,0x1(%rax)
cmovne %rcx,%rsi
jmp    1160 <isupport_token+0x30>
xor    %esi,%esi
mov    %rbx,%rdi
add    $0x8,%rsp
cmp    $0x2d,%bpl
jne    1174 <isupport_token+0x44>
pop    %rbx
pop    %rbp
jmp    1050 <isupport_unset@plt>
pop    %rbx
pop    %rbp
jmp    1030 <isupport_set@plt>

LLVM IR (-O0):
define void @isupport_token(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %2
%7 = load i8*, i8** %2
store i8* %7, i8** %3
store i8* null, i8** %4
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 0
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 45
%13 = zext i1 %12 to i32
store i32 %13, i32* %6
%14 = load i8*, i8** %2
%15 = getelementptr inbounds i8, i8* %14, i64 0
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 45
br i1 %18, label %19, label %22
19: ; preds = %1
%20 = load i8*, i8** %2
%21 = getelementptr inbounds i8, i8* %20, i32 1
store i8* %21, i8** %2
br label %22
22: ; preds = %19, %1
%23 = load i8*, i8** %3
%24 = call i8* @strchr(i8* %23, i8 signext 61)
store i8* %24, i8** %5
%25 = load i8*, i8** %5
%26 = icmp ne i8* %25, null
br i1 %26, label %27, label %31
27: ; preds = %22
%28 = load i8*, i8** %5
store i8 0, i8* %28
%29 = load i8*, i8** %5
%30 = getelementptr inbounds i8, i8* %29, i64 1
store i8* %30, i8** %4
br label %31
31: ; preds = %27, %22
%32 = load i8*, i8** %4
%33 = icmp ne i8* %32, null
br i1 %33, label %34, label %40
34: ; preds = %31
%35 = load i8*, i8** %4
%36 = load i8, i8* %35
%37 = sext i8 %36 to i32
%38 = icmp eq i32 %37, 0
br i1 %38, label %39, label %40
39: ; preds = %34
store i8* null, i8** %4
br label %40
40: ; preds = %39, %34, %31
%41 = load i32, i32* %6
%42 = icmp ne i32 %41, 0
br i1 %42, label %43, label %47
43: ; preds = %40
%44 = load i8*, i8** %3
%45 = load i8*, i8** %4
%46 = call i32 @isupport_set(i8* %44, i8* %45)
br label %50
47: ; preds = %40
%48 = load i8*, i8** %3
%49 = call i32 @isupport_unset(i8* %48)
br label %50
50: ; preds = %47, %43
ret void
}

LLVM IR (-O2):
define void @isupport_token(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 45
%4 = tail call i8* @strchr(i8* %0, i8 signext 61)
%5 = icmp eq i8* %4, null
br i1 %5, label %11, label %6
6: ; preds = %1
store i8 0, i8* %4
%7 = getelementptr inbounds i8, i8* %4, i64 1
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 0
%10 = select i1 %9, i8* null, i8* %7
br label %11
11: ; preds = %1, %6
%12 = phi i8* [ %10, %6 ], [ null, %1 ]
br i1 %3, label %15, label %13
13: ; preds = %11
%14 = tail call i32 @isupport_set(i8* %0, i8* %12)
br label %17
15: ; preds = %11
%16 = tail call i32 @isupport_unset(i8* %0)
br label %17
17: ; preds = %15, %13
ret void
}