#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*/ PrintIndent(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ strlen(char const *);
void OpenSubset(const char *SubName, const char *xml_name, const char *SubDesc,
                int *IndentLevel, int CommentLevel) {
  switch (CommentLevel) {
  case (1):
  case (2):
  case (3):
    printf("\n   ****  %s  ****\n\n", SubName);
    return;
    break;
  case (4):
    PrintIndent(*IndentLevel);
    printf("<subset>\n");
    *IndentLevel += 1;
    PrintIndent(*IndentLevel);
    if (strlen(xml_name) > 0) {
      printf("<subset_name>%s</subset_name>\n", xml_name);
    } else {
      printf("<subset_name>%s</subset_name>\n", SubName);
    }
    PrintIndent(*IndentLevel);
    printf("<subset_description>%s</subset_description>\n", SubDesc);
    break;
  }
}


x86 assembly (clang, -O0):
<OpenSubset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x28(%rbp)
add    $0xffffffff,%eax
sub    $0x3,%eax
jb     1174 <OpenSubset+0x44>
jmp    1163 <OpenSubset+0x33>
mov    -0x28(%rbp),%eax
sub    $0x4,%eax
je     118b <OpenSubset+0x5b>
jmp    1212 <OpenSubset+0xe2>
mov    -0x8(%rbp),%rsi
lea    0xe81(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1212 <OpenSubset+0xe2>
mov    -0x20(%rbp),%rax
mov    (%rax),%edi
call   1050 <PrintIndent@plt>
lea    0xe78(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x20(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x20(%rbp),%rax
mov    (%rax),%edi
call   1050 <PrintIndent@plt>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x0,%eax
jle    11e3 <OpenSubset+0xb3>
mov    -0x10(%rbp),%rsi
lea    0xe48(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11f5 <OpenSubset+0xc5>
mov    -0x8(%rbp),%rsi
lea    0xe31(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x20(%rbp),%rax
mov    (%rax),%edi
call   1050 <PrintIndent@plt>
mov    -0x18(%rbp),%rsi
lea    0xe33(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OpenSubset>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    -0x1(%r8),%eax
cmp    $0x3,%eax
jae    1160 <OpenSubset+0x20>
lea    0xea5(%rip),%rdi
mov    %rbx,%rsi
jmp    11c1 <OpenSubset+0x81>
cmp    $0x4,%r8d
jne    11d3 <OpenSubset+0x93>
mov    %rcx,%r15
mov    %rdx,%r14
mov    %rsi,%r12
mov    (%rcx),%edi
call   1060 <PrintIndent@plt>
lea    0xee4(%rip),%rdi
call   1030 <puts@plt>
mov    (%r15),%edi
add    $0x1,%edi
mov    %edi,(%r15)
call   1060 <PrintIndent@plt>
mov    %r12,%rdi
call   1040 <strlen@plt>
test   %eax,%eax
cmovg  %r12,%rbx
lea    0xe70(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    (%r15),%edi
call   1060 <PrintIndent@plt>
lea    0xe76(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1050 <printf@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [21 x i8] c"\0A **** %s ****\0A\0A\00"
@.str.1 = [10 x i8] c"<subset>\0A\00"
@.str.2 = [31 x i8] c"<subset_name>%s</subset_name>\0A\00"
@.str.3 = [45 x i8] c"<subset_description>%s</subset_description>\0A\00"
define void @OpenSubset(i8* %0, i8* %1, i8* %2, i32* %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32*
%10 = alloca i32
store i8* %0, i8** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i32* %3, i32** %9
store i32 %4, i32* %10
%11 = load i32, i32* %10
switch i32 %11, label %41 [
i32 1, label %12
i32 2, label %12
i32 3, label %12
i32 4, label %15
]
12: ; preds = %5, %5, %5
%13 = load i8*, i8** %6
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %13)
br label %41
15: ; preds = %5
%16 = load i32*, i32** %9
%17 = load i32, i32* %16
%18 = call i32 @PrintIndent(i32 %17)
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%20 = load i32*, i32** %9
%21 = load i32, i32* %20
%22 = add nsw i32 %21, 1
store i32 %22, i32* %20
%23 = load i32*, i32** %9
%24 = load i32, i32* %23
%25 = call i32 @PrintIndent(i32 %24)
%26 = load i8*, i8** %7
%27 = call i32 @strlen(i8* %26)
%28 = icmp sgt i32 %27, 0
br i1 %28, label %29, label %32
29: ; preds = %15
%30 = load i8*, i8** %7
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i8* %30)
br label %35
32: ; preds = %15
%33 = load i8*, i8** %6
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i8* %33)
br label %35
35: ; preds = %32, %29
%36 = load i32*, i32** %9
%37 = load i32, i32* %36
%38 = call i32 @PrintIndent(i32 %37)
%39 = load i8*, i8** %8
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.3, i64 0, i64 0), i8* %39)
br label %41
41: ; preds = %12, %5, %35
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"\0A **** %s ****\0A\0A\00"
@.str.2 = [31 x i8] c"<subset_name>%s</subset_name>\0A\00"
@.str.3 = [45 x i8] c"<subset_description>%s</subset_description>\0A\00"
@str = [9 x i8] c"<subset>\00"
define void @OpenSubset(i8* %0, i8* %1, i8* %2, i32* nocapture %3, i32 %4) {
switch i32 %4, label %22 [
i32 1, label %6
i32 2, label %6
i32 3, label %6
i32 4, label %8
]
6: ; preds = %5, %5, %5
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %22
8: ; preds = %5
%9 = load i32, i32* %3
%10 = tail call i32 @PrintIndent(i32 %9)
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 1
store i32 %13, i32* %3
%14 = tail call i32 @PrintIndent(i32 %13)
%15 = tail call i32 @strlen(i8* %1)
%16 = icmp sgt i32 %15, 0
%17 = select i1 %16, i8* %1, i8* %0
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i8* %17)
%19 = load i32, i32* %3
%20 = tail call i32 @PrintIndent(i32 %19)
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @.str.3, i64 0, i64 0), i8* %2)
br label %22
22: ; preds = %6, %5, %8
ret void
}