#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 *, ...);
scalar_t__ strcmp(char *, char *);
int main(int argc, char **argv, char **env) {
  int i;
  int enable_newline = 1;
  for (i = 1; i < argc; i++) {
    if (strcmp(argv[i], "-n") == 0)
      enable_newline = 0;
    else if (i == 1 && strcmp(argv[i], "-h") == 0) {
      printf("this is help!\n");
      return 0;
    } else {
      printf("%s", argv[i]);
      if (enable_newline)
        printf("\n");
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x1,-0x20(%rbp)
movl   $0x1,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1217 <main+0xf7>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xe99(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1182 <main+0x62>
movl   $0x0,-0x20(%rbp)
jmp    1204 <main+0xe4>
cmpl   $0x1,-0x1c(%rbp)
jne    11c8 <main+0xa8>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xe64(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11c8 <main+0xa8>
lea    0xe51(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    121e <main+0xfe>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xe3a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x0,-0x20(%rbp)
je     11fa <main+0xda>
lea    0xe20(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11ff <main+0xdf>
jmp    1204 <main+0xe4>
jmp    1209 <main+0xe9>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1148 <main+0x28>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
cmp    $0x2,%edi
jl     11e8 <main+0xa8>
mov    %rsi,%rbx
mov    %edi,%r13d
add    $0xffffffffffffffff,%r13
mov    $0x1,%r12d
xor    %ebp,%ebp
lea    0xe93(%rip),%r14
jmp    117c <main+0x3c>
nop
add    $0x1,%rbp
mov    %r15d,%r12d
cmp    %rbp,%r13
je     11e8 <main+0xa8>
mov    0x8(%rbx,%rbp,8),%rdi
mov    %r14,%rsi
call   1060 <strcmp@plt>
mov    $0x0,%r15d
test   %rax,%rax
je     1170 <main+0x30>
test   %rbp,%rbp
jne    11af <main+0x6f>
mov    0x8(%rbx,%rbp,8),%rdi
lea    0xe5e(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     11dc <main+0x9c>
mov    0x8(%rbx,%rbp,8),%rsi
xor    %r15d,%r15d
lea    0xe48(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
test   %r12d,%r12d
je     1170 <main+0x30>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x1,%r15d
jmp    1170 <main+0x30>
lea    0xe26(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"-n\00"
@.str.1 = [3 x i8] c"-h\00"
@.str.3 = [3 x i8] c"%s\00"
@str = [14 x i8] c"this is help!\00"
define i32 @main(i32 %0, i8** nocapture %1, i8** nocapture readnone %2) {
%4 = icmp sgt i32 %0, 1
br i1 %4, label %5, label %32
5: ; preds = %3
%6 = zext i32 %0 to i64
br label %7
7: ; preds = %5, %28
%8 = phi i64 [ 1, %5 ], [ %30, %28 ]
%9 = phi i32 [ 1, %5 ], [ %29, %28 ]
%10 = getelementptr inbounds i8*, i8** %1, i64 %8
%11 = load i8*, i8** %10
%12 = tail call i64 @strcmp(i8* %11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%13 = icmp eq i64 %12, 0
br i1 %13, label %28, label %14
14: ; preds = %7
%15 = icmp eq i64 %8, 1
br i1 %15, label %16, label %22
16: ; preds = %14
%17 = load i8*, i8** %10
%18 = tail call i64 @strcmp(i8* %17, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%19 = icmp eq i64 %18, 0
br i1 %19, label %20, label %22
20: ; preds = %16
%21 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
br label %32
22: ; preds = %16, %14
%23 = load i8*, i8** %10
%24 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %23)
%25 = icmp eq i32 %9, 0
br i1 %25, label %28, label %26
26: ; preds = %22
%27 = tail call i32 @putchar(i32 10)
br label %28
28: ; preds = %7, %22, %26
%29 = phi i32 [ 1, %26 ], [ 0, %22 ], [ 0, %7 ]
%30 = add nuw nsw i64 %8, 1
%31 = icmp eq i64 %30, %6
br i1 %31, label %32, label %7
32: ; preds = %28, %3, %20
ret i32 0
}