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


x86 assembly (clang, -O0):
<cert>:
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 <cert+0x38>
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
lea    0xea2(%rip),%rsi
call   1050 <fprintf@plt>
jmp    11b7 <cert+0x87>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xeb1(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11a2 <cert+0x72>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <cert_verify@plt>
mov    %eax,-0x4(%rbp)
jmp    11d3 <cert+0xa3>
mov    0x2e37(%rip),%rax
mov    (%rax),%edi
lea    0xe81(%rip),%rsi
call   1050 <fprintf@plt>
mov    0x2e1a(%rip),%rax
mov    (%rax),%edi
lea    0xe89(%rip),%rsi
call   1050 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cert>:
push   %rax
cmp    %esi,%edx
jge    1156 <cert+0x26>
movslq %edx,%rax
mov    (%rdi,%rax,8),%rdi
lea    0xee9(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1187 <cert+0x57>
lea    0xedf(%rip),%rsi
jmp    115d <cert+0x2d>
lea    0xea3(%rip),%rsi
mov    0x2e7c(%rip),%rax
mov    (%rax),%edi
call   1050 <fprintf@plt>
mov    0x2e66(%rip),%rax
mov    (%rax),%edi
lea    0xed5(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
jmp    1030 <cert_verify@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [44 x i8] c"Insufficient parameters for command: cert.\0A\00"
@.str.1 = [7 x i8] c"verify\00"
@.str.2 = [29 x i8] c"Unknown command after cert.\0A\00"
@stdout = global i32 0
@.str.3 = [39 x i8] c"\0AUsage: placonf [OPTIONS] cert verify\0A\00"
define i32 @cert(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 ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
br label %29
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 %26
22: ; preds = %14
%23 = load i32, i32* %7
%24 = add nsw i32 %23, 1
store i32 %24, i32* %7
%25 = call i32 (...) @cert_verify()
store i32 %25, i32* %4
br label %32
26: ; preds = %14
%27 = load i32, i32* @stderr
%28 = call i32 @fprintf(i32 %27, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
br label %29
29: ; preds = %26, %11
%30 = load i32, i32* @stdout
%31 = call i32 @fprintf(i32 %30, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.3, i64 0, i64 0))
store i32 -1, i32* %4
br label %32
32: ; preds = %29, %22
%33 = load i32, i32* %4
ret i32 %33
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [44 x i8] c"Insufficient parameters for command: cert.\0A\00"
@.str.1 = [7 x i8] c"verify\00"
@.str.2 = [29 x i8] c"Unknown command after cert.\0A\00"
@stdout = global i32 0
@.str.3 = [39 x i8] c"\0AUsage: placonf [OPTIONS] cert verify\0A\00"
define i32 @cert(i8** nocapture %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %2, %1
br i1 %4, label %5, label %13
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 %13
11: ; preds = %5
%12 = tail call i32 (...) @cert_verify()
br label %19
13: ; preds = %5, %3
%14 = phi i8* [ getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), %3 ], [ getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), %5 ]
%15 = load i32, i32* @stderr
%16 = tail call i32 @fprintf(i32 %15, i8* %14)
%17 = load i32, i32* @stdout
%18 = tail call i32 @fprintf(i32 %17, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.3, i64 0, i64 0))
br label %19
19: ; preds = %13, %11
%20 = phi i32 [ -1, %13 ], [ %12, %11 ]
ret i32 %20
}