#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 */
char ***groupAnagrams(char **, int, int *, int **);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char **argv) {
  int *col_sizes, count = 0, i, j;
  char ***lists = groupAnagrams(argv + 1, argc - 1, &count, &col_sizes);
  for (i = 0; i < count; i++) {
    for (j = 0; j < col_sizes[i]; j++) {
      printf("%s ", lists[i][j]);
    }
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x8,%rdi
mov    -0x8(%rbp),%esi
sub    $0x1,%esi
lea    -0x1c(%rbp),%rdx
lea    -0x18(%rbp),%rcx
call   1040 <groupAnagrams@plt>
mov    %rax,-0x30(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    11d6 <main+0xb6>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    -0x18(%rbp),%rcx
movslq -0x20(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
jge    11ba <main+0x9a>
mov    -0x30(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xe5b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1176 <main+0x56>
lea    0xe43(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1163 <main+0x43>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
movl   $0x0,0xc(%rsp)
lea    0x8(%rsi),%rax
lea    -0x1(%rdi),%esi
lea    0xc(%rsp),%rdx
lea    0x10(%rsp),%rcx
mov    %rax,%rdi
call   1050 <groupAnagrams@plt>
cmpl   $0x0,0xc(%rsp)
jle    11d6 <main+0xa6>
mov    %rax,%r15
lea    0xe93(%rip),%r14
xor    %r12d,%r12d
jmp    1198 <main+0x68>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r12
movslq 0xc(%rsp),%rax
cmp    %rax,%r12
jge    11d6 <main+0xa6>
mov    0x10(%rsp),%rax
cmpl   $0x0,(%rax,%r12,4)
jle    1180 <main+0x50>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    (%r15,%r12,8),%rax
mov    (%rax,%rbx,8),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
mov    0x10(%rsp),%rax
movslq (%rax,%r12,4),%rax
cmp    %rax,%rbx
jl     11b0 <main+0x80>
jmp    1180 <main+0x50>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s \00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = bitcast i32** %3 to i8*
%6 = bitcast i32* %4 to i8*
store i32 0, i32* %4
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = add nsw i32 %0, -1
%9 = call i8*** @groupAnagrams(i8** %7, i32 %8, i32* %4, i32** %3)
%10 = load i32, i32* %4
%11 = icmp sgt i32 %10, 0
br i1 %11, label %12, label %38
12: ; preds = %2, %32
%13 = phi i64 [ %34, %32 ], [ 0, %2 ]
%14 = load i32*, i32** %3
%15 = getelementptr inbounds i32, i32* %14, i64 %13
%16 = load i32, i32* %15
%17 = icmp sgt i32 %16, 0
br i1 %17, label %18, label %32
18: ; preds = %12
%19 = getelementptr inbounds i8**, i8*** %9, i64 %13
br label %20
20: ; preds = %18, %20
%21 = phi i64 [ 0, %18 ], [ %26, %20 ]
%22 = load i8**, i8*** %19
%23 = getelementptr inbounds i8*, i8** %22, i64 %21
%24 = load i8*, i8** %23
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %24)
%26 = add nuw nsw i64 %21, 1
%27 = load i32*, i32** %3
%28 = getelementptr inbounds i32, i32* %27, i64 %13
%29 = load i32, i32* %28
%30 = sext i32 %29 to i64
%31 = icmp slt i64 %26, %30
br i1 %31, label %20, label %32
32: ; preds = %20, %12
%33 = call i32 @putchar(i32 10)
%34 = add nuw nsw i64 %13, 1
%35 = load i32, i32* %4
%36 = sext i32 %35 to i64
%37 = icmp slt i64 %34, %36
br i1 %37, label %12, label %38
38: ; preds = %32, %2
ret i32 0
}