#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*/ printf(char *, ...);
int rtv_route_logs(char *);
scalar_t__ strncmp(char *, char *, int);
int ciRouteLogs(int argc, char **argv) {
  int rc;
  {
    if ((argc == 2) && (strncmp(argv[1], "-h", 2) == 0)) {
      printf("Usage:  %-10s ", argv[0]);
      printf("%s\n", "<logFile>\n");
      return (0);
    }
  };
  if (argc != 2) {
    printf("Parm Error: single 'logFile' parameter required\n");
    return (0);
  }
  rc = rtv_route_logs(argv[1]);
  return (rc);
}


x86 assembly (clang, -O0):
<ciRouteLogs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jne    11a2 <ciRouteLogs+0x72>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xea8(%rip),%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    11a2 <ciRouteLogs+0x72>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe89(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe8a(%rip),%rdi
lea    0xe87(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    11dc <ciRouteLogs+0xac>
cmpl   $0x2,-0x8(%rbp)
je     11c6 <ciRouteLogs+0x96>
lea    0xe6e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    11dc <ciRouteLogs+0xac>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <rtv_route_logs@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ciRouteLogs>:
push   %rbx
cmp    $0x2,%edi
jne    116d <ciRouteLogs+0x2d>
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
lea    0xeac(%rip),%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     1176 <ciRouteLogs+0x36>
mov    0x8(%rbx),%rdi
pop    %rbx
jmp    1060 <rtv_route_logs@plt>
lea    0xea9(%rip),%rdi
jmp    118e <ciRouteLogs+0x4e>
mov    (%rbx),%rsi
lea    0xe83(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe84(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"-h\00"
@.str.1 = [15 x i8] c"Usage: %-10s \00"
@.str.2 = [4 x i8] c"%s\0A\00"
@.str.3 = [11 x i8] c"<logFile>\0A\00"
@.str.4 = [49 x i8] c"Parm Error: single 'logFile' parameter required\0A\00"
define i32 @ciRouteLogs(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 2
br i1 %8, label %9, label %21
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = call i64 @strncmp(i8* %12, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %21
15: ; preds = %9
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 0
%18 = load i8*, i8** %17
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* %18)
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %3
br label %32
21: ; preds = %9, %2
%22 = load i32, i32* %4
%23 = icmp ne i32 %22, 2
br i1 %23, label %24, label %26
24: ; preds = %21
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.4, i64 0, i64 0))
store i32 0, i32* %3
br label %32
26: ; preds = %21
%27 = load i8**, i8*** %5
%28 = getelementptr inbounds i8*, i8** %27, i64 1
%29 = load i8*, i8** %28
%30 = call i32 @rtv_route_logs(i8* %29)
store i32 %30, i32* %6
%31 = load i32, i32* %6
store i32 %31, i32* %3
br label %32
32: ; preds = %26, %24, %15
%33 = load i32, i32* %3
ret i32 %33
}

LLVM IR (-O2):
@.str = [3 x i8] c"-h\00"
@.str.1 = [15 x i8] c"Usage: %-10s \00"
@.str.3 = [11 x i8] c"<logFile>\0A\00"
@str = [48 x i8] c"Parm Error: single 'logFile' parameter required\00"
define i32 @ciRouteLogs(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i64 @strncmp(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %15
9: ; preds = %4
%10 = load i8*, i8** %1
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* %10)
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
br label %18
13: ; preds = %2
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str, i64 0, i64 0))
br label %18
15: ; preds = %4
%16 = load i8*, i8** %5
%17 = tail call i32 @rtv_route_logs(i8* %16)
br label %18
18: ; preds = %15, %13, %9
%19 = phi i32 [ 0, %9 ], [ 0, %13 ], [ %17, %15 ]
ret i32 %19
}