#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*/ convert_log_file(char *, char *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strcmp(char *, char *);
int main(int argc, char **argv) {
  char *usage = "Usage: %s [-host <host>] files...\n";
  int i = 1;
  char *host = NULL;
  if (argc < 2) {
    printf(usage, argv[0]);
    return 5;
  }
  if (!strcmp(argv[1], "-host")) {
    if (argc > 3) {
      i = 3;
      host = argv[2];
    } else {
      printf(usage, argv[0]);
      return 5;
    }
  }
  for (; i < argc; i++) {
    convert_log_file(argv[i], host);
  }
  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)
lea    0xeb3(%rip),%rax
mov    %rax,-0x18(%rbp)
movl   $0x1,-0x1c(%rbp)
movq   $0x0,-0x28(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1186 <main+0x56>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
call   1040 <printf@plt>
movl   $0x5,-0x4(%rbp)
jmp    1221 <main+0xf1>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe8e(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    11e6 <main+0xb6>
cmpl   $0x3,-0x8(%rbp)
jle    11c5 <main+0x95>
movl   $0x3,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x28(%rbp)
jmp    11e1 <main+0xb1>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
call   1040 <printf@plt>
movl   $0x5,-0x4(%rbp)
jmp    1221 <main+0xf1>
jmp    11e6 <main+0xb6>
jmp    11eb <main+0xbb>
mov    -0x1c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    121a <main+0xea>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x28(%rbp),%rsi
call   1030 <convert_log_file@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11eb <main+0xbb>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r12
cmp    $0x2,%edi
jge    115b <main+0x2b>
mov    (%r12),%rsi
lea    0xeb2(%rip),%rdi
call   1040 <printf@plt>
mov    $0x5,%r14d
jmp    11b5 <main+0x85>
mov    %edi,%r15d
mov    0x8(%r12),%rdi
lea    0xeb9(%rip),%rsi
call   1050 <strcmp@plt>
xor    %r14d,%r14d
test   %eax,%eax
je     1185 <main+0x55>
mov    $0x1,%eax
xor    %r13d,%r13d
cmp    %r15d,%eax
jb     119a <main+0x6a>
jmp    11b5 <main+0x85>
cmp    $0x4,%r15d
jb     1143 <main+0x13>
mov    0x10(%r12),%r13
mov    $0x3,%eax
cmp    %r15d,%eax
jae    11b5 <main+0x85>
mov    %eax,%ebx
mov    %r15d,%ebp
nop
mov    (%r12,%rbx,8),%rdi
mov    %r13,%rsi
call   1030 <convert_log_file@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    11a0 <main+0x70>
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [35 x i8] c"Usage: %s [-host <host>] files...\0A\00"
@.str.1 = [6 x i8] c"-host\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %28, label %4
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %6, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %14
9: ; preds = %4
%10 = icmp ugt i32 %0, 3
br i1 %10, label %11, label %28
11: ; preds = %9
%12 = getelementptr inbounds i8*, i8** %1, i64 2
%13 = load i8*, i8** %12
br label %14
14: ; preds = %11, %4
%15 = phi i32 [ 1, %4 ], [ 3, %11 ]
%16 = phi i8* [ null, %4 ], [ %13, %11 ]
%17 = icmp ult i32 %15, %0
br i1 %17, label %18, label %31
18: ; preds = %14
%19 = zext i32 %15 to i64
%20 = zext i32 %0 to i64
br label %21
21: ; preds = %18, %21
%22 = phi i64 [ %19, %18 ], [ %26, %21 ]
%23 = getelementptr inbounds i8*, i8** %1, i64 %22
%24 = load i8*, i8** %23
%25 = tail call i32 @convert_log_file(i8* %24, i8* %16)
%26 = add nuw nsw i64 %22, 1
%27 = icmp eq i64 %26, %20
br i1 %27, label %31, label %21
28: ; preds = %9, %2
%29 = load i8*, i8** %1
%30 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %29)
br label %31
31: ; preds = %21, %28, %14
%32 = phi i32 [ 0, %14 ], [ 5, %28 ], [ 0, %21 ]
ret i32 %32
}