#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*/ GLT_AddToList(char *);
int /*<<< orphan*/ GLT_ClearList();
int /*<<< orphan*/ GLT_DeSelectList();
char *GLT_FindItem(char);
scalar_t__ strchr(char *, char);
void GLT_TagsToList(char *tags) {
  char *pc = tags;
  GLT_ClearList();
  while (*pc) {
    GLT_AddToList(GLT_FindItem(*pc));
    pc++;
  }
  GLT_AddToList("     --- Hidden tags ---     ");
  pc = "esdoprwbtvac";
  while (*pc) {
    if (strchr(tags, *pc) == 0) {
      GLT_AddToList(GLT_FindItem(*pc));
    }
    pc++;
  }
  GLT_DeSelectList();
}


x86 assembly (clang, -O0):
<GLT_TagsToList>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1040 <GLT_ClearList@plt>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     119d <GLT_TagsToList+0x4d>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1060 <GLT_FindItem@plt>
mov    %rax,%rdi
call   1030 <GLT_AddToList@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    116b <GLT_TagsToList+0x1b>
lea    0xe5c(%rip),%rdi
call   1030 <GLT_AddToList@plt>
lea    0xe6e(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1200 <GLT_TagsToList+0xb0>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
movsbl (%rax),%esi
call   1050 <strchr@plt>
cmp    $0x0,%rax
jne    11ef <GLT_TagsToList+0x9f>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1060 <GLT_FindItem@plt>
mov    %rax,%rdi
call   1030 <GLT_AddToList@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    11b4 <GLT_TagsToList+0x64>
mov    $0x0,%al
call   1070 <GLT_DeSelectList@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GLT_TagsToList>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %eax,%eax
call   1040 <GLT_ClearList@plt>
mov    (%r14),%al
test   %al,%al
je     118b <GLT_TagsToList+0x3b>
lea    0x1(%r14),%rbx
nopl   0x0(%rax)
movsbl %al,%edi
call   1060 <GLT_FindItem@plt>
mov    %rax,%rdi
call   1030 <GLT_AddToList@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1170 <GLT_TagsToList+0x20>
lea    0xe6e(%rip),%rdi
call   1030 <GLT_AddToList@plt>
mov    %r14,%rdi
mov    $0x65,%esi
call   1050 <strchr@plt>
test   %rax,%rax
jne    11bb <GLT_TagsToList+0x6b>
mov    $0x65,%edi
call   1060 <GLT_FindItem@plt>
mov    %rax,%rdi
call   1030 <GLT_AddToList@plt>
mov    %r14,%rdi
mov    $0x73,%esi
call   1050 <strchr@plt>
test   %rax,%rax
jne    11df <GLT_TagsToList+0x8f>
mov    $0x73,%edi
call   1060 <GLT_FindItem@plt>
mov    %rax,%rdi
call   1030 <GLT_AddToList@plt>
mov    %r14,%rdi
mov    $0x64,%esi
call   1050 <strchr@plt>
test   %rax,%rax
jne    1203 <GLT_TagsToList+0xb3>
mov    $0x64,%edi
call   1060 <GLT_FindItem@plt>
mov    %rax,%rdi
call   1030 <GLT_AddToList@plt>
mov    %r14,%rdi
mov    $0x6f,%esi
call   1050 <strchr@plt>
test   %rax,%rax
jne    1227 <GLT_TagsToList+0xd7>
mov    $0x6f,%edi
call   1060 <GLT_FindItem@plt>
mov    %rax,%rdi
call   1030 <GLT_AddToList@plt>
mov    %r14,%rdi
mov    $0x70,%esi
call   1050 <strchr@plt>
test   %rax,%rax
jne    124b <GLT_TagsToList+0xfb>
mov    $0x70,%edi
call   1060 <GLT_FindItem@plt>
mov    %rax,%rdi
call   1030 <GLT_AddToList@plt>
mov    %r14,%rdi
mov    $0x72,%esi
call   1050 <strchr@plt>
test   %rax,%rax
jne    126f <GLT_TagsToList+0x11f>
mov    $0x72,%edi
call   1060 <GLT_FindItem@plt>
mov    %rax,%rdi
call   1030 <GLT_AddToList@plt>
mov    %r14,%rdi
mov    $0x77,%esi
call   1050 <strchr@plt>
test   %rax,%rax
jne    1293 <GLT_TagsToList+0x143>
mov    $0x77,%edi
call   1060 <GLT_FindItem@plt>
mov    %rax,%rdi
call   1030 <GLT_AddToList@plt>
mov    %r14,%rdi
mov    $0x62,%esi
call   1050 <strchr@plt>
test   %rax,%rax
jne    12b7 <GLT_TagsToList+0x167>
mov    $0x62,%edi
call   1060 <GLT_FindItem@plt>
mov    %rax,%rdi
call   1030 <GLT_AddToList@plt>
mov    %r14,%rdi
mov    $0x74,%esi
call   1050 <strchr@plt>
test   %rax,%rax
jne    12db <GLT_TagsToList+0x18b>
mov    $0x74,%edi
call   1060 <GLT_FindItem@plt>
mov    %rax,%rdi
call   1030 <GLT_AddToList@plt>
mov    %r14,%rdi
mov    $0x76,%esi
call   1050 <strchr@plt>
test   %rax,%rax
jne    12ff <GLT_TagsToList+0x1af>
mov    $0x76,%edi
call   1060 <GLT_FindItem@plt>
mov    %rax,%rdi
call   1030 <GLT_AddToList@plt>
mov    %r14,%rdi
mov    $0x61,%esi
call   1050 <strchr@plt>
test   %rax,%rax
jne    1323 <GLT_TagsToList+0x1d3>
mov    $0x61,%edi
call   1060 <GLT_FindItem@plt>
mov    %rax,%rdi
call   1030 <GLT_AddToList@plt>
mov    %r14,%rdi
mov    $0x63,%esi
call   1050 <strchr@plt>
test   %rax,%rax
jne    1347 <GLT_TagsToList+0x1f7>
mov    $0x63,%edi
call   1060 <GLT_FindItem@plt>
mov    %rax,%rdi
call   1030 <GLT_AddToList@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1070 <GLT_DeSelectList@plt>

LLVM IR (-O0):
@.str = [30 x i8] c" --- Hidden tags --- \00"
@.str.1 = [13 x i8] c"esdoprwbtvac\00"
define void @GLT_TagsToList(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
%5 = call i32 (...) @GLT_ClearList()
br label %6
6: ; preds = %10, %1
%7 = load i8*, i8** %3
%8 = load i8, i8* %7
%9 = icmp ne i8 %8, 0
br i1 %9, label %10, label %17
10: ; preds = %6
%11 = load i8*, i8** %3
%12 = load i8, i8* %11
%13 = call i8* @GLT_FindItem(i8 signext %12)
%14 = call i32 @GLT_AddToList(i8* %13)
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i32 1
store i8* %16, i8** %3
br label %6
17: ; preds = %6
%18 = call i32 @GLT_AddToList(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8** %3
br label %19
19: ; preds = %34, %17
%20 = load i8*, i8** %3
%21 = load i8, i8* %20
%22 = icmp ne i8 %21, 0
br i1 %22, label %23, label %37
23: ; preds = %19
%24 = load i8*, i8** %2
%25 = load i8*, i8** %3
%26 = load i8, i8* %25
%27 = call i64 @strchr(i8* %24, i8 signext %26)
%28 = icmp eq i64 %27, 0
br i1 %28, label %29, label %34
29: ; preds = %23
%30 = load i8*, i8** %3
%31 = load i8, i8* %30
%32 = call i8* @GLT_FindItem(i8 signext %31)
%33 = call i32 @GLT_AddToList(i8* %32)
br label %34
34: ; preds = %29, %23
%35 = load i8*, i8** %3
%36 = getelementptr inbounds i8, i8* %35, i32 1
store i8* %36, i8** %3
br label %19
37: ; preds = %19
%38 = call i32 (...) @GLT_DeSelectList()
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c" --- Hidden tags --- \00"
define void @GLT_TagsToList(i8* %0) {
%2 = tail call i32 (...) @GLT_ClearList()
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %1, %5
%6 = phi i8 [ %11, %5 ], [ %3, %1 ]
%7 = phi i8* [ %10, %5 ], [ %0, %1 ]
%8 = tail call i8* @GLT_FindItem(i8 signext %6)
%9 = tail call i32 @GLT_AddToList(i8* %8)
%10 = getelementptr inbounds i8, i8* %7, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %1
%14 = tail call i32 @GLT_AddToList(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%15 = tail call i64 @strchr(i8* %0, i8 signext 101)
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %20
17: ; preds = %13
%18 = tail call i8* @GLT_FindItem(i8 signext 101)
%19 = tail call i32 @GLT_AddToList(i8* %18)
br label %20
20: ; preds = %17, %13
%21 = tail call i64 @strchr(i8* %0, i8 signext 115)
%22 = icmp eq i64 %21, 0
br i1 %22, label %23, label %26
23: ; preds = %20
%24 = tail call i8* @GLT_FindItem(i8 signext 115)
%25 = tail call i32 @GLT_AddToList(i8* %24)
br label %26
26: ; preds = %23, %20
%27 = tail call i64 @strchr(i8* %0, i8 signext 100)
%28 = icmp eq i64 %27, 0
br i1 %28, label %29, label %32
29: ; preds = %26
%30 = tail call i8* @GLT_FindItem(i8 signext 100)
%31 = tail call i32 @GLT_AddToList(i8* %30)
br label %32
32: ; preds = %29, %26
%33 = tail call i64 @strchr(i8* %0, i8 signext 111)
%34 = icmp eq i64 %33, 0
br i1 %34, label %35, label %38
35: ; preds = %32
%36 = tail call i8* @GLT_FindItem(i8 signext 111)
%37 = tail call i32 @GLT_AddToList(i8* %36)
br label %38
38: ; preds = %35, %32
%39 = tail call i64 @strchr(i8* %0, i8 signext 112)
%40 = icmp eq i64 %39, 0
br i1 %40, label %41, label %44
41: ; preds = %38
%42 = tail call i8* @GLT_FindItem(i8 signext 112)
%43 = tail call i32 @GLT_AddToList(i8* %42)
br label %44
44: ; preds = %41, %38
%45 = tail call i64 @strchr(i8* %0, i8 signext 114)
%46 = icmp eq i64 %45, 0
br i1 %46, label %47, label %50
47: ; preds = %44
%48 = tail call i8* @GLT_FindItem(i8 signext 114)
%49 = tail call i32 @GLT_AddToList(i8* %48)
br label %50
50: ; preds = %47, %44
%51 = tail call i64 @strchr(i8* %0, i8 signext 119)
%52 = icmp eq i64 %51, 0
br i1 %52, label %53, label %56
53: ; preds = %50
%54 = tail call i8* @GLT_FindItem(i8 signext 119)
%55 = tail call i32 @GLT_AddToList(i8* %54)
br label %56
56: ; preds = %53, %50
%57 = tail call i64 @strchr(i8* %0, i8 signext 98)
%58 = icmp eq i64 %57, 0
br i1 %58, label %59, label %62
59: ; preds = %56
%60 = tail call i8* @GLT_FindItem(i8 signext 98)
%61 = tail call i32 @GLT_AddToList(i8* %60)
br label %62
62: ; preds = %59, %56
%63 = tail call i64 @strchr(i8* %0, i8 signext 116)
%64 = icmp eq i64 %63, 0
br i1 %64, label %65, label %68
65: ; preds = %62
%66 = tail call i8* @GLT_FindItem(i8 signext 116)
%67 = tail call i32 @GLT_AddToList(i8* %66)
br label %68
68: ; preds = %65, %62
%69 = tail call i64 @strchr(i8* %0, i8 signext 118)
%70 = icmp eq i64 %69, 0
br i1 %70, label %71, label %74
71: ; preds = %68
%72 = tail call i8* @GLT_FindItem(i8 signext 118)
%73 = tail call i32 @GLT_AddToList(i8* %72)
br label %74
74: ; preds = %71, %68
%75 = tail call i64 @strchr(i8* %0, i8 signext 97)
%76 = icmp eq i64 %75, 0
br i1 %76, label %77, label %80
77: ; preds = %74
%78 = tail call i8* @GLT_FindItem(i8 signext 97)
%79 = tail call i32 @GLT_AddToList(i8* %78)
br label %80
80: ; preds = %77, %74
%81 = tail call i64 @strchr(i8* %0, i8 signext 99)
%82 = icmp eq i64 %81, 0
br i1 %82, label %83, label %86
83: ; preds = %80
%84 = tail call i8* @GLT_FindItem(i8 signext 99)
%85 = tail call i32 @GLT_AddToList(i8* %84)
br label %86
86: ; preds = %83, %80
%87 = tail call i32 (...) @GLT_DeSelectList()
ret void
}