#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*/ EnvPrintRouter(void *, char const *, char const *);
void PrintType(void *theEnv, const char *logicalName, int typeCount,
               int *typesPrinted, const char *typeName) {
  if (*typesPrinted == 0) {
    EnvPrintRouter(theEnv, logicalName, typeName);
    (*typesPrinted)++;
    return;
  }
  if (typeCount == 2) {
    EnvPrintRouter(theEnv, logicalName, " or ");
  } else if (((*typesPrinted) + 1) == typeCount) {
    EnvPrintRouter(theEnv, logicalName, ", or ");
  } else {
    EnvPrintRouter(theEnv, logicalName, ", ");
  }
  EnvPrintRouter(theEnv, logicalName, typeName);
  (*typesPrinted)++;
}


x86 assembly (clang, -O0):
<PrintType>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmpl   $0x0,(%rax)
jne    1159 <PrintType+0x49>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x28(%rbp),%rdx
call   1030 <EnvPrintRouter@plt>
mov    -0x20(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
jmp    11dc <PrintType+0xcc>
cmpl   $0x2,-0x14(%rbp)
jne    117c <PrintType+0x6c>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    0xe8f(%rip),%rdx
call   1030 <EnvPrintRouter@plt>
jmp    11c0 <PrintType+0xb0>
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
add    $0x1,%eax
cmp    -0x14(%rbp),%eax
jne    11a7 <PrintType+0x97>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    0xe63(%rip),%rdx
call   1030 <EnvPrintRouter@plt>
jmp    11bb <PrintType+0xab>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    0xe50(%rip),%rdx
call   1030 <EnvPrintRouter@plt>
jmp    11c0 <PrintType+0xb0>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x28(%rbp),%rdx
call   1030 <EnvPrintRouter@plt>
mov    -0x20(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrintType>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %r8,%r14
mov    %rcx,%r12
mov    %rsi,%r15
mov    %rdi,%rbx
mov    (%rcx),%eax
test   %eax,%eax
je     115a <PrintType+0x4a>
add    $0x1,%eax
cmp    %edx,%eax
lea    0xeca(%rip),%rax
lea    0xec9(%rip),%rcx
cmove  %rax,%rcx
cmp    $0x2,%edx
lea    0xeb6(%rip),%rdx
cmovne %rcx,%rdx
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <EnvPrintRouter@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <EnvPrintRouter@plt>
addl   $0x1,(%r12)
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c" or \00"
@.str.1 = [6 x i8] c", or \00"
@.str.2 = [3 x i8] c", \00"
define void @PrintType(i8* %0, i8* %1, i32 %2, i32* nocapture %3, i8* %4) {
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, 0
br i1 %7, label %15, label %8
8: ; preds = %5
%9 = icmp eq i32 %2, 2
%10 = add nsw i32 %6, 1
%11 = icmp eq i32 %10, %2
%12 = select i1 %11, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0)
%13 = select i1 %9, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %12
%14 = tail call i32 @EnvPrintRouter(i8* %0, i8* %1, i8* %13)
br label %15
15: ; preds = %5, %8
%16 = tail call i32 @EnvPrintRouter(i8* %0, i8* %1, i8* %4)
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 1
store i32 %18, i32* %3
ret void
}