#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*/ Gcat(char const *, char *);
int /*<<< orphan*/ acollect(char const *);
int /*<<< orphan*/ sort();
scalar_t__ strcmp(char const *, char *);
void collect(const char *as) {
  if ((strcmp(as, "{") == 0) || (strcmp(as, "{}") == 0)) {
    Gcat(as, "");
    sort();
  } else {
    acollect(as);
  }
}


x86 assembly (clang, -O0):
<collect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xea9(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
je     1180 <collect+0x40>
mov    -0x8(%rbp),%rdi
lea    0xe91(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    119c <collect+0x5c>
mov    -0x8(%rbp),%rdi
lea    0xe76(%rip),%rsi
call   1030 <Gcat@plt>
mov    $0x0,%al
call   1050 <sort@plt>
jmp    11a5 <collect+0x65>
mov    -0x8(%rbp),%rdi
call   1040 <acollect@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<collect>:
push   %rbx
mov    %rdi,%rbx
lea    0xeb5(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     1172 <collect+0x32>
lea    0xea6(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strcmp@plt>
test   %rax,%rax
je     1172 <collect+0x32>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <acollect@plt>
lea    0xe88(%rip),%rsi
mov    %rbx,%rdi
call   1030 <Gcat@plt>
xor    %eax,%eax
pop    %rbx
jmp    1050 <sort@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"{\00"
@.str.1 = [3 x i8] c"{}\00"
@.str.2 = [1 x i8] zeroinitializer
define void @collect(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i64 @strcmp(i8* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %6, %1
%11 = load i8*, i8** %2
%12 = call i32 @Gcat(i8* %11, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
%13 = call i32 (...) @sort()
br label %17
14: ; preds = %6
%15 = load i8*, i8** %2
%16 = call i32 @acollect(i8* %15)
br label %17
17: ; preds = %14, %10
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"{\00"
@.str.1 = [3 x i8] c"{}\00"
@.str.2 = [1 x i8] zeroinitializer
define void @collect(i8* %0) {
%2 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %4, %1
%8 = tail call i32 @Gcat(i8* %0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
%9 = tail call i32 (...) @sort()
br label %12
10: ; preds = %4
%11 = tail call i32 @acollect(i8* %0)
br label %12
12: ; preds = %10, %7
ret void
}