#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ icon_print(int /*<<< orphan*/ *, char *, char *, char *);
void folderview_print_structure(FILE *out, const char *navstr) {
  int c;
  while ((c = *navstr++) != 0)
    switch (c) {
    case ' ':
      icon_print(out, " ", "space", "");
      break;
    case '+':
      icon_print(out, "+", "plus", "Open Folder");
      break;
    case 'x':
      icon_print(out, "+", "pluslast", "Open Folder");
      break;
    case '-':
      icon_print(out, "x", "minus", "Close Folder");
      break;
    case '/':
      icon_print(out, "x", "minuslast", "Close Folder");
      break;
    case '>':
      icon_print(out, "-", "empty", "");
      break;
    case '\\':
      icon_print(out, "-", "emptylast", "");
      break;
    case '|':
      icon_print(out, "|", "vertical", "");
      break;
    }
}


x86 assembly (clang, -O0):
<folderview_print_structure>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     12e1 <folderview_print_structure+0x1d1>
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
sub    $0x20,%eax
je     11c9 <folderview_print_structure+0xb9>
jmp    1152 <folderview_print_structure+0x42>
mov    -0x18(%rbp),%eax
sub    $0x2b,%eax
je     11ec <folderview_print_structure+0xdc>
jmp    1163 <folderview_print_structure+0x53>
mov    -0x18(%rbp),%eax
sub    $0x2d,%eax
je     1232 <folderview_print_structure+0x122>
jmp    1174 <folderview_print_structure+0x64>
mov    -0x18(%rbp),%eax
sub    $0x2f,%eax
je     1255 <folderview_print_structure+0x145>
jmp    1185 <folderview_print_structure+0x75>
mov    -0x18(%rbp),%eax
sub    $0x3e,%eax
je     1278 <folderview_print_structure+0x168>
jmp    1196 <folderview_print_structure+0x86>
mov    -0x18(%rbp),%eax
sub    $0x5c,%eax
je     129b <folderview_print_structure+0x18b>
jmp    11a7 <folderview_print_structure+0x97>
mov    -0x18(%rbp),%eax
sub    $0x78,%eax
je     120f <folderview_print_structure+0xff>
jmp    11b8 <folderview_print_structure+0xa8>
mov    -0x18(%rbp),%eax
sub    $0x7c,%eax
je     12be <folderview_print_structure+0x1ae>
jmp    12dc <folderview_print_structure+0x1cc>
mov    -0x8(%rbp),%rdi
lea    0xe2c(%rip),%rsi
lea    0xe27(%rip),%rdx
lea    0xe1f(%rip),%rcx
call   1030 <icon_print@plt>
jmp    12dc <folderview_print_structure+0x1cc>
mov    -0x8(%rbp),%rdi
lea    0xe11(%rip),%rsi
lea    0xe0c(%rip),%rdx
lea    0xe0a(%rip),%rcx
call   1030 <icon_print@plt>
jmp    12dc <folderview_print_structure+0x1cc>
mov    -0x8(%rbp),%rdi
lea    0xdee(%rip),%rsi
lea    0xdfa(%rip),%rdx
lea    0xde7(%rip),%rcx
call   1030 <icon_print@plt>
jmp    12dc <folderview_print_structure+0x1cc>
mov    -0x8(%rbp),%rdi
lea    0xde7(%rip),%rsi
lea    0xde2(%rip),%rdx
lea    0xde1(%rip),%rcx
call   1030 <icon_print@plt>
jmp    12dc <folderview_print_structure+0x1cc>
mov    -0x8(%rbp),%rdi
lea    0xdc4(%rip),%rsi
lea    0xdd2(%rip),%rdx
lea    0xdbe(%rip),%rcx
call   1030 <icon_print@plt>
jmp    12dc <folderview_print_structure+0x1cc>
mov    -0x8(%rbp),%rdi
lea    0xdc0(%rip),%rsi
lea    0xdbb(%rip),%rdx
lea    0xd70(%rip),%rcx
call   1030 <icon_print@plt>
jmp    12dc <folderview_print_structure+0x1cc>
mov    -0x8(%rbp),%rdi
lea    0xd9d(%rip),%rsi
lea    0xd9e(%rip),%rdx
lea    0xd4d(%rip),%rcx
call   1030 <icon_print@plt>
jmp    12dc <folderview_print_structure+0x1cc>
mov    -0x8(%rbp),%rdi
lea    0xd8c(%rip),%rsi
lea    0xd87(%rip),%rdx
lea    0xd2a(%rip),%rcx
call   1030 <icon_print@plt>
jmp    1120 <folderview_print_structure+0x10>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<folderview_print_structure>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    (%rsi),%al
test   %al,%al
je     1249 <folderview_print_structure+0x139>
mov    %rsi,%rbx
mov    %rdi,%r14
add    $0x1,%rbx
lea    0xf93(%rip),%r13
lea    0xec3(%rip),%r15
lea    0xfb0(%rip),%rbp
lea    0xfc0(%rip),%r12
jmp    1171 <folderview_print_structure+0x61>
mov    %r14,%rdi
mov    %r12,%rsi
lea    0xfb9(%rip),%rdx
mov    %r13,%rcx
call   1030 <icon_print@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
je     1249 <folderview_print_structure+0x139>
movsbl %al,%eax
cmp    $0x77,%eax
jg     11b0 <folderview_print_structure+0xa0>
lea    -0x2b(%rax),%ecx
cmp    $0x31,%ecx
ja     11cd <folderview_print_structure+0xbd>
movslq (%r15,%rcx,4),%rax
add    %r15,%rax
jmp    *%rax
mov    %r14,%rdi
lea    0xf3c(%rip),%rsi
lea    0xf37(%rip),%rdx
lea    0xf35(%rip),%rcx
jmp    115d <folderview_print_structure+0x4d>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
cmp    $0x78,%eax
je     122c <folderview_print_structure+0x11c>
cmp    $0x7c,%eax
jne    1162 <folderview_print_structure+0x52>
mov    %r14,%rdi
lea    0xf59(%rip),%rsi
lea    0xf54(%rip),%rdx
jmp    115a <folderview_print_structure+0x4a>
cmp    $0x20,%eax
jne    1162 <folderview_print_structure+0x52>
mov    %r14,%rdi
lea    0xeec(%rip),%rsi
lea    0xee7(%rip),%rdx
jmp    115a <folderview_print_structure+0x4a>
mov    %r14,%rdi
lea    0xefa(%rip),%rsi
lea    0xef5(%rip),%rdx
mov    %rbp,%rcx
jmp    115d <folderview_print_structure+0x4d>
mov    %r14,%rdi
lea    0xee1(%rip),%rsi
lea    0xeef(%rip),%rdx
mov    %rbp,%rcx
jmp    115d <folderview_print_structure+0x4d>
mov    %r14,%rdi
mov    %r12,%rsi
lea    0xee6(%rip),%rdx
jmp    115a <folderview_print_structure+0x4a>
mov    %r14,%rdi
lea    0xe9a(%rip),%rsi
lea    0xea6(%rip),%rdx
lea    0xe93(%rip),%rcx
jmp    115d <folderview_print_structure+0x4d>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
@.str.1 = [6 x i8] c"space\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [2 x i8] c"+\00"
@.str.4 = [5 x i8] c"plus\00"
@.str.5 = [12 x i8] c"Open Folder\00"
@.str.6 = [9 x i8] c"pluslast\00"
@.str.7 = [2 x i8] c"x\00"
@.str.8 = [6 x i8] c"minus\00"
@.str.9 = [13 x i8] c"Close Folder\00"
@.str.10 = [10 x i8] c"minuslast\00"
@.str.11 = [2 x i8] c"-\00"
@.str.12 = [6 x i8] c"empty\00"
@.str.13 = [10 x i8] c"emptylast\00"
@.str.14 = [2 x i8] c"|\00"
@.str.15 = [9 x i8] c"vertical\00"
define void @folderview_print_structure(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
%5 = alloca i32
store i32* %0, i32** %3
store i8* %1, i8** %4
br label %6
6: ; preds = %38, %2
%7 = load i8*, i8** %4
%8 = getelementptr inbounds i8, i8* %7, i32 1
store i8* %8, i8** %4
%9 = load i8, i8* %7
%10 = sext i8 %9 to i32
store i32 %10, i32* %5
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %39
12: ; preds = %6
%13 = load i32, i32* %5
switch i32 %13, label %38 [
i32 32, label %14
i32 43, label %17
i32 120, label %20
i32 45, label %23
i32 47, label %26
i32 62, label %29
i32 92, label %32
i32 124, label %35
]
14: ; preds = %12
%15 = load i32*, i32** %3
%16 = call i32 @icon_print(i32* %15, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
br label %38
17: ; preds = %12
%18 = load i32*, i32** %3
%19 = call i32 @icon_print(i32* %18, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0))
br label %38
20: ; preds = %12
%21 = load i32*, i32** %3
%22 = call i32 @icon_print(i32* %21, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0))
br label %38
23: ; preds = %12
%24 = load i32*, i32** %3
%25 = call i32 @icon_print(i32* %24, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0))
br label %38
26: ; preds = %12
%27 = load i32*, i32** %3
%28 = call i32 @icon_print(i32* %27, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0))
br label %38
29: ; preds = %12
%30 = load i32*, i32** %3
%31 = call i32 @icon_print(i32* %30, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
br label %38
32: ; preds = %12
%33 = load i32*, i32** %3
%34 = call i32 @icon_print(i32* %33, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
br label %38
35: ; preds = %12
%36 = load i32*, i32** %3
%37 = call i32 @icon_print(i32* %36, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
br label %38
38: ; preds = %12, %35, %32, %29, %26, %23, %20, %17, %14
br label %6
39: ; preds = %6
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
@.str.1 = [6 x i8] c"space\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [2 x i8] c"+\00"
@.str.4 = [5 x i8] c"plus\00"
@.str.5 = [12 x i8] c"Open Folder\00"
@.str.6 = [9 x i8] c"pluslast\00"
@.str.7 = [2 x i8] c"x\00"
@.str.8 = [6 x i8] c"minus\00"
@.str.9 = [13 x i8] c"Close Folder\00"
@.str.10 = [10 x i8] c"minuslast\00"
@.str.11 = [2 x i8] c"-\00"
@.str.12 = [6 x i8] c"empty\00"
@.str.13 = [10 x i8] c"emptylast\00"
@.str.14 = [2 x i8] c"|\00"
@.str.15 = [9 x i8] c"vertical\00"
define void @folderview_print_structure(i32* %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %29, label %5
5: ; preds = %2, %26
%6 = phi i8 [ %27, %26 ], [ %3, %2 ]
%7 = phi i8* [ %8, %26 ], [ %1, %2 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = sext i8 %6 to i32
switch i32 %9, label %26 [
i32 32, label %10
i32 43, label %12
i32 120, label %14
i32 45, label %16
i32 47, label %18
i32 62, label %20
i32 92, label %22
i32 124, label %24
]
10: ; preds = %5
%11 = tail call i32 @icon_print(i32* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
br label %26
12: ; preds = %5
%13 = tail call i32 @icon_print(i32* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0))
br label %26
14: ; preds = %5
%15 = tail call i32 @icon_print(i32* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0))
br label %26
16: ; preds = %5
%17 = tail call i32 @icon_print(i32* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0))
br label %26
18: ; preds = %5
%19 = tail call i32 @icon_print(i32* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0))
br label %26
20: ; preds = %5
%21 = tail call i32 @icon_print(i32* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
br label %26
22: ; preds = %5
%23 = tail call i32 @icon_print(i32* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
br label %26
24: ; preds = %5
%25 = tail call i32 @icon_print(i32* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
br label %26
26: ; preds = %5, %24, %22, %20, %18, %16, %14, %12, %10
%27 = load i8, i8* %8
%28 = icmp eq i8 %27, 0
br i1 %28, label %29, label %5
29: ; preds = %26, %2
ret void
}