#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*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
scalar_t__ strcmp(char *, char *);
int ttp_create(char **, int, int);
int ttp(char **args, int argc, int optind) {
  if (optind >= argc) {
    fprintf(stderr, "Insufficient parameters for command: ttp.\n");
    goto out_err;
  }
  if (strcmp(args[optind], "create") == 0) {
    optind++;
    return ttp_create(args, argc, optind);
  }
  fprintf(stderr, "Unknown command after ttp\n");
  goto out_err;
out_err:
  fprintf(stdout, "\nUsage: placonf [OPTIONS] ttp create\n");
  return -1;
}


x86 assembly (clang, -O0):
<ttp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jl     1168 <ttp+0x38>
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
lea    0xea2(%rip),%rsi
call   1050 <fprintf@plt>
jmp    11bf <ttp+0x8f>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xeb0(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11aa <ttp+0x7a>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1030 <ttp_create@plt>
mov    %eax,-0x4(%rbp)
jmp    11db <ttp+0xab>
mov    0x2e2f(%rip),%rax
mov    (%rax),%edi
lea    0xe78(%rip),%rsi
call   1050 <fprintf@plt>
mov    0x2e12(%rip),%rax
mov    (%rax),%edi
lea    0xe7e(%rip),%rsi
call   1050 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ttp>:
push   %rbp
push   %r14
push   %rbx
cmp    %esi,%edx
jge    1160 <ttp+0x30>
mov    %edx,%ebx
mov    %esi,%ebp
mov    %rdi,%r14
movslq %edx,%rax
mov    (%rdi,%rax,8),%rdi
lea    0xede(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1194 <ttp+0x64>
lea    0xed4(%rip),%rsi
jmp    1167 <ttp+0x37>
lea    0xe99(%rip),%rsi
mov    0x2e72(%rip),%rax
mov    (%rax),%edi
call   1050 <fprintf@plt>
mov    0x2e5c(%rip),%rax
mov    (%rax),%edi
lea    0xec8(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0xffffffff,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret
add    $0x1,%ebx
mov    %r14,%rdi
mov    %ebp,%esi
mov    %ebx,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <ttp_create@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [43 x i8] c"Insufficient parameters for command: ttp.\0A\00"
@.str.1 = [7 x i8] c"create\00"
@.str.2 = [27 x i8] c"Unknown command after ttp\0A\00"
@stdout = global i32 0
@.str.3 = [38 x i8] c"\0AUsage: placonf [OPTIONS] ttp create\0A\00"
define i32 @ttp(i8** %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i8** %0, i8*** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = load i32, i32* %7
%9 = load i32, i32* %6
%10 = icmp sge i32 %8, %9
br i1 %10, label %11, label %14
11: ; preds = %3
%12 = load i32, i32* @stderr
%13 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
br label %32
14: ; preds = %3
%15 = load i8**, i8*** %5
%16 = load i32, i32* %7
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8*, i8** %15, i64 %17
%19 = load i8*, i8** %18
%20 = call i64 @strcmp(i8* %19, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%21 = icmp eq i64 %20, 0
br i1 %21, label %22, label %29
22: ; preds = %14
%23 = load i32, i32* %7
%24 = add nsw i32 %23, 1
store i32 %24, i32* %7
%25 = load i8**, i8*** %5
%26 = load i32, i32* %6
%27 = load i32, i32* %7
%28 = call i32 @ttp_create(i8** %25, i32 %26, i32 %27)
store i32 %28, i32* %4
br label %35
29: ; preds = %14
%30 = load i32, i32* @stderr
%31 = call i32 @fprintf(i32 %30, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
br label %32
32: ; preds = %29, %11
%33 = load i32, i32* @stdout
%34 = call i32 @fprintf(i32 %33, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0))
store i32 -1, i32* %4
br label %35
35: ; preds = %32, %22
%36 = load i32, i32* %4
ret i32 %36
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [43 x i8] c"Insufficient parameters for command: ttp.\0A\00"
@.str.1 = [7 x i8] c"create\00"
@.str.2 = [27 x i8] c"Unknown command after ttp\0A\00"
@stdout = global i32 0
@.str.3 = [38 x i8] c"\0AUsage: placonf [OPTIONS] ttp create\0A\00"
define i32 @ttp(i8** %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %2, %1
br i1 %4, label %5, label %14
5: ; preds = %3
%6 = sext i32 %2 to i64
%7 = getelementptr inbounds i8*, i8** %0, i64 %6
%8 = load i8*, i8** %7
%9 = tail call i64 @strcmp(i8* %8, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %5
%12 = add nsw i32 %2, 1
%13 = tail call i32 @ttp_create(i8** %0, i32 %1, i32 %12)
br label %20
14: ; preds = %5, %3
%15 = phi i8* [ getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), %3 ], [ getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), %5 ]
%16 = load i32, i32* @stderr
%17 = tail call i32 @fprintf(i32 %16, i8* %15)
%18 = load i32, i32* @stdout
%19 = tail call i32 @fprintf(i32 %18, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0))
br label %20
20: ; preds = %14, %11
%21 = phi i32 [ -1, %14 ], [ %13, %11 ]
ret i32 %21
}