#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*/ copys(char *);
int isalpha(char);
int isdigit(char);
scalar_t__ isspace(char);
int /*<<< orphan*/ setvar(char *, int /*<<< orphan*/, int);
int dynmacro(char *line) {
  char *s;
  char endc, *endp;
  if (!isalpha(line[0]))
    return 0;
  for (s = line + 1; *s && (isalpha(*s) | isdigit(*s)); ++s)
    ;
  endp = s;
  while (isspace(*s))
    ++s;
  if (s[0] != ':' || s[1] != '=')
    return 0;
  endc = *endp;
  *endp = '\0';
  setvar(line, copys(s + 2), 1);
  *endp = endc;
  return 1;
}


x86 assembly (clang, -O0):
<dynmacro>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1060 <isalpha@plt>
cmp    $0x0,%eax
jne    117d <dynmacro+0x2d>
movl   $0x0,-0x4(%rbp)
jmp    1290 <dynmacro+0x140>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x29(%rbp)
je     11c9 <dynmacro+0x79>
mov    -0x18(%rbp),%rax
movsbl (%rax),%edi
call   1060 <isalpha@plt>
mov    %eax,-0x30(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isdigit@plt>
mov    %eax,%ecx
mov    -0x30(%rbp),%eax
or     %ecx,%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x29(%rbp)
mov    -0x29(%rbp),%al
test   $0x1,%al
jne    11d9 <dynmacro+0x89>
jmp    11ef <dynmacro+0x9f>
jmp    11de <dynmacro+0x8e>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1189 <dynmacro+0x39>
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%edi
call   1040 <isspace@plt>
cmp    $0x0,%rax
je     121e <dynmacro+0xce>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    11f7 <dynmacro+0xa7>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3a,%eax
jne    123f <dynmacro+0xef>
mov    -0x18(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x3d,%eax
je     124b <dynmacro+0xfb>
movl   $0x0,-0x4(%rbp)
jmp    1290 <dynmacro+0x140>
mov    -0x28(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x19(%rbp)
mov    -0x28(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x18(%rbp),%rdi
add    $0x2,%rdi
call   1070 <copys@plt>
mov    -0x38(%rbp),%rdi
mov    %eax,%esi
mov    $0x1,%edx
call   1050 <setvar@plt>
mov    -0x19(%rbp),%cl
mov    -0x28(%rbp),%rax
mov    %cl,(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dynmacro>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rdi,%r15
movsbl (%rdi),%edi
call   1060 <isalpha@plt>
xor    %r14d,%r14d
test   %eax,%eax
je     11e7 <dynmacro+0x97>
lea    0x2(%r15),%rcx
xchg   %ax,%ax
mov    %rcx,%rbx
movzbl -0x1(%rcx),%eax
test   %al,%al
je     1196 <dynmacro+0x46>
movsbl %al,%edi
call   1060 <isalpha@plt>
mov    %eax,%ebp
movsbl -0x1(%rbx),%edi
call   1030 <isdigit@plt>
lea    0x1(%rbx),%rcx
or     %ebp,%eax
jne    1170 <dynmacro+0x20>
mov    %rbx,%rbp
nopl   0x0(%rax)
movsbl -0x1(%rbp),%edi
call   1040 <isspace@plt>
add    $0x1,%rbp
test   %rax,%rax
jne    11a0 <dynmacro+0x50>
cmpb   $0x3a,-0x2(%rbp)
jne    11e7 <dynmacro+0x97>
cmpb   $0x3d,-0x1(%rbp)
jne    11e7 <dynmacro+0x97>
mov    -0x1(%rbx),%r12b
movb   $0x0,-0x1(%rbx)
mov    %rbp,%rdi
call   1070 <copys@plt>
mov    $0x1,%r14d
mov    %r15,%rdi
mov    %eax,%esi
mov    $0x1,%edx
call   1050 <setvar@plt>
mov    %r12b,-0x1(%rbx)
mov    %r14d,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @dynmacro(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8*
store i8* %0, i8** %3
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8, i8* %7, i64 0
%9 = load i8, i8* %8
%10 = call i32 @isalpha(i8 signext %9)
%11 = icmp ne i32 %10, 0
br i1 %11, label %13, label %12
12: ; preds = %1
store i32 0, i32* %2
br label %70
13: ; preds = %1
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i64 1
store i8* %15, i8** %4
br label %16
16: ; preds = %33, %13
%17 = load i8*, i8** %4
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp ne i32 %19, 0
br i1 %20, label %21, label %30
21: ; preds = %16
%22 = load i8*, i8** %4
%23 = load i8, i8* %22
%24 = call i32 @isalpha(i8 signext %23)
%25 = load i8*, i8** %4
%26 = load i8, i8* %25
%27 = call i32 @isdigit(i8 signext %26)
%28 = or i32 %24, %27
%29 = icmp ne i32 %28, 0
br label %30
30: ; preds = %21, %16
%31 = phi i1 [ false, %16 ], [ %29, %21 ]
br i1 %31, label %32, label %36
32: ; preds = %30
br label %33
33: ; preds = %32
%34 = load i8*, i8** %4
%35 = getelementptr inbounds i8, i8* %34, i32 1
store i8* %35, i8** %4
br label %16
36: ; preds = %30
%37 = load i8*, i8** %4
store i8* %37, i8** %6
br label %38
38: ; preds = %43, %36
%39 = load i8*, i8** %4
%40 = load i8, i8* %39
%41 = call i64 @isspace(i8 signext %40)
%42 = icmp ne i64 %41, 0
br i1 %42, label %43, label %46
43: ; preds = %38
%44 = load i8*, i8** %4
%45 = getelementptr inbounds i8, i8* %44, i32 1
store i8* %45, i8** %4
br label %38
46: ; preds = %38
%47 = load i8*, i8** %4
%48 = getelementptr inbounds i8, i8* %47, i64 0
%49 = load i8, i8* %48
%50 = sext i8 %49 to i32
%51 = icmp ne i32 %50, 58
br i1 %51, label %58, label %52
52: ; preds = %46
%53 = load i8*, i8** %4
%54 = getelementptr inbounds i8, i8* %53, i64 1
%55 = load i8, i8* %54
%56 = sext i8 %55 to i32
%57 = icmp ne i32 %56, 61
br i1 %57, label %58, label %59
58: ; preds = %52, %46
store i32 0, i32* %2
br label %70
59: ; preds = %52
%60 = load i8*, i8** %6
%61 = load i8, i8* %60
store i8 %61, i8* %5
%62 = load i8*, i8** %6
store i8 0, i8* %62
%63 = load i8*, i8** %3
%64 = load i8*, i8** %4
%65 = getelementptr inbounds i8, i8* %64, i64 2
%66 = call i32 @copys(i8* %65)
%67 = call i32 @setvar(i8* %63, i32 %66, i32 1)
%68 = load i8, i8* %5
%69 = load i8*, i8** %6
store i8 %68, i8* %69
store i32 1, i32* %2
br label %70
70: ; preds = %59, %58, %12
%71 = load i32, i32* %2
ret i32 %71
}

LLVM IR (-O2):
define i32 @dynmacro(i8* %0) {
%2 = load i8, i8* %0
%3 = tail call i32 @isalpha(i8 signext %2)
%4 = icmp eq i32 %3, 0
br i1 %4, label %34, label %5
5: ; preds = %1, %10
%6 = phi i8* [ %7, %10 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 0
br i1 %9, label %16, label %10
10: ; preds = %5
%11 = tail call i32 @isalpha(i8 signext %8)
%12 = load i8, i8* %7
%13 = tail call i32 @isdigit(i8 signext %12)
%14 = or i32 %13, %11
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %5
16: ; preds = %5, %10
br label %17
17: ; preds = %16, %17
%18 = phi i8* [ %22, %17 ], [ %7, %16 ]
%19 = load i8, i8* %18
%20 = tail call i64 @isspace(i8 signext %19)
%21 = icmp eq i64 %20, 0
%22 = getelementptr inbounds i8, i8* %18, i64 1
br i1 %21, label %23, label %17
23: ; preds = %17
%24 = load i8, i8* %18
%25 = icmp eq i8 %24, 58
br i1 %25, label %26, label %34
26: ; preds = %23
%27 = load i8, i8* %22
%28 = icmp eq i8 %27, 61
br i1 %28, label %29, label %34
29: ; preds = %26
%30 = load i8, i8* %7
store i8 0, i8* %7
%31 = getelementptr inbounds i8, i8* %18, i64 2
%32 = tail call i32 @copys(i8* %31)
%33 = tail call i32 @setvar(i8* %0, i32 %32, i32 1)
store i8 %30, i8* %7
br label %34
34: ; preds = %23, %26, %1, %29
%35 = phi i32 [ 1, %29 ], [ 0, %1 ], [ 0, %26 ], [ 0, %23 ]
ret i32 %35
}