#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*/ HError(int, char *, char, char);
void ChkType(char newtype, char *type) {
  if (*type == ' ' || (*type == 'a' && (newtype == 'v' || newtype == 'i' ||
                                        newtype == 'c' || newtype == 'x')))
    *type = newtype;
  else if (newtype != *type)
    HError(7231, "ChkType: Attempt to form list from different types %c and %c",
           newtype, *type);
}


x86 assembly (clang, -O0):
<ChkType>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
je     1176 <ChkType+0x66>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x61,%eax
jne    1184 <ChkType+0x74>
movsbl -0x1(%rbp),%eax
cmp    $0x76,%eax
je     1176 <ChkType+0x66>
movsbl -0x1(%rbp),%eax
cmp    $0x69,%eax
je     1176 <ChkType+0x66>
movsbl -0x1(%rbp),%eax
cmp    $0x63,%eax
je     1176 <ChkType+0x66>
movsbl -0x1(%rbp),%eax
cmp    $0x78,%eax
jne    1184 <ChkType+0x74>
mov    -0x1(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
jmp    11ba <ChkType+0xaa>
movsbl -0x1(%rbp),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     11b5 <ChkType+0xa5>
mov    -0x1(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    $0x1c3f,%edi
lea    0xe56(%rip),%rsi
movsbl %cl,%edx
movsbl (%rax),%ecx
call   1030 <HError@plt>
jmp    11ba <ChkType+0xaa>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ChkType>:
mov    (%rsi),%al
cmp    $0x20,%al
je     1130 <ChkType+0x20>
cmp    $0x61,%al
jne    1134 <ChkType+0x24>
lea    -0x63(%rdi),%ecx
cmp    $0x15,%cl
ja     1134 <ChkType+0x24>
movzbl %cl,%ecx
mov    $0x280041,%edx
bt     %rcx,%rdx
jae    1134 <ChkType+0x24>
mov    %dil,(%rsi)
ret
cmp    %dil,%al
jne    113a <ChkType+0x2a>
ret
movsbl %dil,%edx
movsbl %al,%ecx
lea    0xeb8(%rip),%rsi
mov    $0x1c3f,%edi
jmp    1030 <HError@plt>

LLVM IR (-O0):
@.str = [61 x i8] c"ChkType: Attempt to form list from different types %c and %c\00"
define void @ChkType(i8 signext %0, i8* %1) {
%3 = alloca i8
%4 = alloca i8*
store i8 %0, i8* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 32
br i1 %8, label %30, label %9
9: ; preds = %2
%10 = load i8*, i8** %4
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 97
br i1 %13, label %14, label %33
14: ; preds = %9
%15 = load i8, i8* %3
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 118
br i1 %17, label %30, label %18
18: ; preds = %14
%19 = load i8, i8* %3
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 105
br i1 %21, label %30, label %22
22: ; preds = %18
%23 = load i8, i8* %3
%24 = sext i8 %23 to i32
%25 = icmp eq i32 %24, 99
br i1 %25, label %30, label %26
26: ; preds = %22
%27 = load i8, i8* %3
%28 = sext i8 %27 to i32
%29 = icmp eq i32 %28, 120
br i1 %29, label %30, label %33
30: ; preds = %26, %22, %18, %14, %2
%31 = load i8, i8* %3
%32 = load i8*, i8** %4
store i8 %31, i8* %32
br label %46
33: ; preds = %26, %9
%34 = load i8, i8* %3
%35 = sext i8 %34 to i32
%36 = load i8*, i8** %4
%37 = load i8, i8* %36
%38 = sext i8 %37 to i32
%39 = icmp ne i32 %35, %38
br i1 %39, label %40, label %45
40: ; preds = %33
%41 = load i8, i8* %3
%42 = load i8*, i8** %4
%43 = load i8, i8* %42
%44 = call i32 @HError(i32 7231, i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0), i8 signext %41, i8 signext %43)
br label %45
45: ; preds = %40, %33
br label %46
46: ; preds = %45, %30
ret void
}

LLVM IR (-O2):
@.str = [61 x i8] c"ChkType: Attempt to form list from different types %c and %c\00"
define void @ChkType(i8 signext %0, i8* nocapture %1) {
%3 = load i8, i8* %1
switch i8 %3, label %6 [
i8 32, label %5
i8 97, label %4
]
4: ; preds = %2
switch i8 %0, label %6 [
i8 120, label %5
i8 118, label %5
i8 105, label %5
i8 99, label %5
]
5: ; preds = %4, %4, %4, %4, %2
store i8 %0, i8* %1
br label %10
6: ; preds = %4, %2
%7 = icmp eq i8 %3, %0
br i1 %7, label %10, label %8
8: ; preds = %6
%9 = tail call i32 @HError(i32 7231, i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0), i8 signext %0, i8 signext %3)
br label %10
10: ; preds = %6, %8, %5
ret void
}