#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 */
struct terminal_session {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ strcmp(char *, char *);
int terminal_stark_hierarchical_assembler_test_and_merge_groups_alias(
    struct terminal_session *, int, char **);
int terminal_stark_hierarchical_assembler_test_and_merge_groups(
    struct terminal_session *session, int argc, char **argv) {
  if (argc >= 1 && !strcmp(*argv, "groups")) {
    return terminal_stark_hierarchical_assembler_test_and_merge_groups_alias(
        session, argc - 1, argv + 1);
  } else {
    printf("Unknown command\nUse help merge\n");
    return -1;
  }
}


x86 assembly (clang, -O0):
<terminal_stark_hierarchical_assembler_test_and_merge_groups>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
cmpl   $0x1,-0x14(%rbp)
jl     1188 <terminal_stark_hierarchical_assembler_test_and_merge_groups+0x58>
mov    -0x20(%rbp),%rax
mov    (%rax),%rdi
lea    0xea5(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    1188 <terminal_stark_hierarchical_assembler_test_and_merge_groups+0x58>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
sub    $0x1,%esi
mov    -0x20(%rbp),%rdx
add    $0x8,%rdx
call   1050 <terminal_stark_hierarchical_assembler_test_and_merge_groups_alias@plt>
mov    %eax,-0x4(%rbp)
jmp    119b <terminal_stark_hierarchical_assembler_test_and_merge_groups+0x6b>
lea    0xe78(%rip),%rdi
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<terminal_stark_hierarchical_assembler_test_and_merge_groups>:
push   %rbp
push   %r14
push   %rbx
test   %esi,%esi
jle    1153 <terminal_stark_hierarchical_assembler_test_and_merge_groups+0x23>
mov    %rdx,%rbx
mov    %esi,%ebp
mov    %rdi,%r14
mov    (%rdx),%rdi
lea    0xeb6(%rip),%rsi
call   1040 <strcmp@plt>
test   %eax,%eax
je     1169 <terminal_stark_hierarchical_assembler_test_and_merge_groups+0x39>
lea    0xead(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret
add    $0xffffffff,%ebp
add    $0x8,%rbx
mov    %r14,%rdi
mov    %ebp,%esi
mov    %rbx,%rdx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <terminal_stark_hierarchical_assembler_test_and_merge_groups_alias@plt>

LLVM IR (-O0):
%struct.terminal_session = type { i32 }
@.str = [7 x i8] c"groups\00"
@.str.1 = [32 x i8] c"Unknown command\0AUse help merge\0A\00"
define i32 @terminal_stark_hierarchical_assembler_test_and_merge_groups(%struct.terminal_session* %0, i32 %1, i8** %2) {
%4 = alloca i32
%5 = alloca %struct.terminal_session*
%6 = alloca i32
%7 = alloca i8**
store %struct.terminal_session* %0, %struct.terminal_session** %5
store i32 %1, i32* %6
store i8** %2, i8*** %7
%8 = load i32, i32* %6
%9 = icmp sge i32 %8, 1
br i1 %9, label %10, label %22
10: ; preds = %3
%11 = load i8**, i8*** %7
%12 = load i8*, i8** %11
%13 = call i32 @strcmp(i8* %12, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%14 = icmp ne i32 %13, 0
br i1 %14, label %22, label %15
15: ; preds = %10
%16 = load %struct.terminal_session*, %struct.terminal_session** %5
%17 = load i32, i32* %6
%18 = sub nsw i32 %17, 1
%19 = load i8**, i8*** %7
%20 = getelementptr inbounds i8*, i8** %19, i64 1
%21 = call i32 @terminal_stark_hierarchical_assembler_test_and_merge_groups_alias(%struct.terminal_session* %16, i32 %18, i8** %20)
store i32 %21, i32* %4
br label %24
22: ; preds = %10, %3
%23 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %4
br label %24
24: ; preds = %22, %15
%25 = load i32, i32* %4
ret i32 %25
}

LLVM IR (-O2):
%struct.terminal_session = type { i32 }
@.str = [7 x i8] c"groups\00"
@str = [31 x i8] c"Unknown command\0AUse help merge\00"
define i32 @terminal_stark_hierarchical_assembler_test_and_merge_groups(%struct.terminal_session* %0, i32 %1, i8** %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %13
5: ; preds = %3
%6 = load i8*, i8** %2
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %6, i8* dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %5
%10 = add nsw i32 %1, -1
%11 = getelementptr inbounds i8*, i8** %2, i64 1
%12 = tail call i32 @terminal_stark_hierarchical_assembler_test_and_merge_groups_alias(%struct.terminal_session* %0, i32 %10, i8** %11)
br label %15
13: ; preds = %5, %3
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
br label %15
15: ; preds = %13, %9
%16 = phi i32 [ -1, %13 ], [ %12, %9 ]
ret i32 %16
}