#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 */
struct inclist {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ define2(char *, char *, struct inclist *);
scalar_t__ isalnum(char);
void define(char *def, struct inclist *file) {
  char *val;
  val = def;
  while (isalnum(*val) || *val == '_')
    val++;
  if (*val)
    *val++ = '\0';
  while (*val == ' ' || *val == '\t')
    val++;
  if (!*val)
    define2(def, "1", file);
  else
    define2(def, val, file);
}


x86 assembly (clang, -O0):
<define>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isalnum@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x19(%rbp)
jne    1166 <define+0x46>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5f,%eax
sete   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1176 <define+0x56>
jmp    1187 <define+0x67>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1138 <define+0x18>
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     11a6 <define+0x86>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movb   $0x0,(%rax)
jmp    11ab <define+0x8b>
mov    -0x18(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x1a(%rbp)
je     11d0 <define+0xb0>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x1a(%rbp)
mov    -0x1a(%rbp),%al
test   $0x1,%al
jne    11e0 <define+0xc0>
jmp    11f1 <define+0xd1>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    11ab <define+0x8b>
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1217 <define+0xf7>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xdf3(%rip),%rsi
call   1040 <define2@plt>
jmp    1228 <define+0x108>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <define2@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<define>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rdi,%rbx
jmp    1134 <define+0x14>
add    $0x1,%rbx
movsbl (%rbx),%edi
call   1030 <isalnum@plt>
test   %rax,%rax
jne    1130 <define+0x10>
movzbl (%rbx),%eax
cmp    $0x5f,%al
je     1130 <define+0x10>
test   %al,%al
je     1153 <define+0x33>
movb   $0x0,(%rbx)
add    $0x1,%rbx
mov    (%rbx),%al
cmp    $0x9,%al
je     114f <define+0x2f>
cmp    $0x20,%al
je     114f <define+0x2f>
test   %al,%al
jne    116d <define+0x4d>
lea    0xe98(%rip),%rsi
mov    %r15,%rdi
jmp    1173 <define+0x53>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <define2@plt>

LLVM IR (-O0):
%struct.inclist = type { i32 }
@.str = [2 x i8] c"1\00"
define void @define(i8* %0, %struct.inclist* %1) {
%3 = alloca i8*
%4 = alloca %struct.inclist*
%5 = alloca i8*
store i8* %0, i8** %3
store %struct.inclist* %1, %struct.inclist** %4
%6 = load i8*, i8** %3
store i8* %6, i8** %5
br label %7
7: ; preds = %19, %2
%8 = load i8*, i8** %5
%9 = load i8, i8* %8
%10 = call i64 @isalnum(i8 signext %9)
%11 = icmp ne i64 %10, 0
br i1 %11, label %17, label %12
12: ; preds = %7
%13 = load i8*, i8** %5
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 95
br label %17
17: ; preds = %12, %7
%18 = phi i1 [ true, %7 ], [ %16, %12 ]
br i1 %18, label %19, label %22
19: ; preds = %17
%20 = load i8*, i8** %5
%21 = getelementptr inbounds i8, i8* %20, i32 1
store i8* %21, i8** %5
br label %7
22: ; preds = %17
%23 = load i8*, i8** %5
%24 = load i8, i8* %23
%25 = icmp ne i8 %24, 0
br i1 %25, label %26, label %29
26: ; preds = %22
%27 = load i8*, i8** %5
%28 = getelementptr inbounds i8, i8* %27, i32 1
store i8* %28, i8** %5
store i8 0, i8* %27
br label %29
29: ; preds = %26, %22
br label %30
30: ; preds = %42, %29
%31 = load i8*, i8** %5
%32 = load i8, i8* %31
%33 = sext i8 %32 to i32
%34 = icmp eq i32 %33, 32
br i1 %34, label %40, label %35
35: ; preds = %30
%36 = load i8*, i8** %5
%37 = load i8, i8* %36
%38 = sext i8 %37 to i32
%39 = icmp eq i32 %38, 9
br label %40
40: ; preds = %35, %30
%41 = phi i1 [ true, %30 ], [ %39, %35 ]
br i1 %41, label %42, label %45
42: ; preds = %40
%43 = load i8*, i8** %5
%44 = getelementptr inbounds i8, i8* %43, i32 1
store i8* %44, i8** %5
br label %30
45: ; preds = %40
%46 = load i8*, i8** %5
%47 = load i8, i8* %46
%48 = icmp ne i8 %47, 0
br i1 %48, label %53, label %49
49: ; preds = %45
%50 = load i8*, i8** %3
%51 = load %struct.inclist*, %struct.inclist** %4
%52 = call i32 @define2(i8* %50, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), %struct.inclist* %51)
br label %58
53: ; preds = %45
%54 = load i8*, i8** %3
%55 = load i8*, i8** %5
%56 = load %struct.inclist*, %struct.inclist** %4
%57 = call i32 @define2(i8* %54, i8* %55, %struct.inclist* %56)
br label %58
58: ; preds = %53, %49
ret void
}

LLVM IR (-O2):
%struct.inclist = type { i32 }
@.str = [2 x i8] c"1\00"
define void @define(i8* %0, %struct.inclist* %1) {
br label %3
3: ; preds = %10, %2
%4 = phi i8* [ %0, %2 ], [ %11, %10 ]
%5 = load i8, i8* %4
%6 = tail call i64 @isalnum(i8 signext %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %3
%9 = load i8, i8* %4
switch i8 %9, label %12 [
i8 95, label %10
i8 0, label %14
]
10: ; preds = %8, %3
%11 = getelementptr inbounds i8, i8* %4, i64 1
br label %3
12: ; preds = %8
%13 = getelementptr inbounds i8, i8* %4, i64 1
store i8 0, i8* %4
br label %14
14: ; preds = %8, %12
%15 = phi i8* [ %13, %12 ], [ %4, %8 ]
br label %16
16: ; preds = %14, %19
%17 = phi i8* [ %20, %19 ], [ %15, %14 ]
%18 = load i8, i8* %17
switch i8 %18, label %23 [
i8 32, label %19
i8 9, label %19
i8 0, label %21
]
19: ; preds = %16, %16
%20 = getelementptr inbounds i8, i8* %17, i64 1
br label %16
21: ; preds = %16
%22 = tail call i32 @define2(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), %struct.inclist* %1)
br label %25
23: ; preds = %16
%24 = tail call i32 @define2(i8* %0, i8* %17, %struct.inclist* %1)
br label %25
25: ; preds = %23, %21
ret void
}