#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 main(int argc, char *argv[]) {
  int num = 0;
  int rev = 0;
  int c = 0;
  if (argc > 1) {
    printf("* argv = '%s';\n", *argv);
    printf("* argv [ 0 ] = %c;\n", *argv[0]);
    printf("* ++ argv = '%s';\n", *++argv);
    printf("* argv [ 0 ] = %c;\n\n", *argv[0]);
    *--argv;
    printf("* argv = '%s';\n", *argv);
    printf("* argv ++ = '%s';\n", *argv++);
    printf("* argv = '%s';\n\n", *argv);
    printf("* argv [ 0 ] = %c;\n", *argv[0]);
    *++argv;
    printf("* argv [ 0 ] = %c;\n", *argv[0]);
    printf("* ++ argv [ 0 ] = %c;\n", *++argv[0]);
    *--argv;
    *--argv;
    while (--argc > 0 && (*++argv)[0] == '-') {
      while ((c = *++argv[0])) {
        switch (c) {
        case 'n':
          num = 1;
          printf("num = 1;\n");
          break;
        case 'r':
          rev = 1;
          printf("rev = 1;\n");
          break;
        default:
          printf("wrong parameter;\n");
          argc = 0;
          break;
        }
      }
    }
  }
  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)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1361 <main+0x251>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%esi
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    0x8(%rax),%rsi
lea    0xe98(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%esi
lea    0xe93(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
add    $0xfffffffffffffff8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe3b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%rsi
lea    0xe67(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe65(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%esi
lea    0xdfe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%esi
lea    0xdda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rcx
mov    (%rcx),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,(%rcx)
movsbl 0x1(%rax),%esi
lea    0xe17(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
add    $0xfffffffffffffff8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0xfffffffffffffff8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x1d(%rbp)
jle    12ae <main+0x19e>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    0x8(%rax),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
sete   %al
mov    %al,-0x1d(%rbp)
mov    -0x1d(%rbp),%al
test   $0x1,%al
jne    12be <main+0x1ae>
jmp    135c <main+0x24c>
jmp    12c3 <main+0x1b3>
mov    -0x10(%rbp),%rcx
mov    (%rcx),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,(%rcx)
movsbl 0x1(%rax),%eax
mov    %eax,-0x1c(%rbp)
cmp    $0x0,%eax
je     1357 <main+0x247>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x24(%rbp)
sub    $0x6e,%eax
je     1309 <main+0x1f9>
jmp    12f8 <main+0x1e8>
mov    -0x24(%rbp),%eax
sub    $0x72,%eax
je     1323 <main+0x213>
jmp    133d <main+0x22d>
movl   $0x1,-0x14(%rbp)
lea    0xd70(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1352 <main+0x242>
movl   $0x1,-0x18(%rbp)
lea    0xd60(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1352 <main+0x242>
lea    0xd57(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
jmp    12c3 <main+0x1b3>
jmp    1278 <main+0x168>
jmp    1361 <main+0x251>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
cmp    $0x2,%edi
jl     1265 <main+0x145>
mov    %rsi,%rbx
mov    %edi,%ebp
mov    (%rsi),%rsi
lea    0xec0(%rip),%r15
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%rbx),%rax
movsbl (%rax),%esi
lea    0xeb9(%rip),%r14
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rbx),%rsi
lea    0xeb8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rbx),%rax
movsbl (%rax),%esi
lea    0xeb6(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%rbx),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%rbx),%rsi
lea    0xead(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rbx),%rsi
lea    0xeae(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rbx),%rax
movsbl (%rax),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x10(%rbx),%rax
movsbl (%rax),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x10(%rbx),%rax
lea    0x1(%rax),%rcx
mov    %rcx,0x10(%rbx)
movsbl 0x1(%rax),%esi
lea    0xe7f(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe91(%rip),%r14
lea    0xe81(%rip),%r15
lea    0xe8c(%rip),%r12
jmp    1215 <main+0xf5>
nop
cmp    $0x2,%ebp
jl     1265 <main+0x145>
mov    0x8(%rbx),%rax
cmpb   $0x2d,(%rax)
jne    1265 <main+0x145>
add    $0xffffffff,%ebp
add    $0x8,%rbx
jmp    123d <main+0x11d>
nopw   0x0(%rax,%rax,1)
xor    %ebp,%ebp
mov    %r12,%rdi
call   1030 <puts@plt>
mov    (%rbx),%rax
lea    0x1(%rax),%rcx
mov    %rcx,(%rbx)
movzbl 0x1(%rax),%eax
test   %al,%al
je     1210 <main+0xf0>
movsbl %al,%eax
cmp    $0x6e,%eax
je     1260 <main+0x140>
cmp    $0x72,%eax
jne    1230 <main+0x110>
mov    %r15,%rdi
jmp    1235 <main+0x115>
xchg   %ax,%ax
mov    %r14,%rdi
jmp    1235 <main+0x115>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [16 x i8] c"* argv = '%s';\0A\00"
@.str.1 = [20 x i8] c"* argv [ 0 ] = %c;\0A\00"
@.str.2 = [19 x i8] c"* ++ argv = '%s';\0A\00"
@.str.3 = [21 x i8] c"* argv [ 0 ] = %c;\0A\0A\00"
@.str.4 = [19 x i8] c"* argv ++ = '%s';\0A\00"
@.str.5 = [17 x i8] c"* argv = '%s';\0A\0A\00"
@.str.6 = [23 x i8] c"* ++ argv [ 0 ] = %c;\0A\00"
@.str.7 = [10 x i8] c"num = 1;\0A\00"
@.str.8 = [10 x i8] c"rev = 1;\0A\00"
@.str.9 = [18 x i8] c"wrong parameter;\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i32 0, i32* %7
store i32 0, i32* %8
%9 = load i32, i32* %4
%10 = icmp sgt i32 %9, 1
br i1 %10, label %11, label %106
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = load i8*, i8** %12
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %13)
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 0
%17 = load i8*, i8** %16
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %19)
%21 = load i8**, i8*** %5
%22 = getelementptr inbounds i8*, i8** %21, i32 1
store i8** %22, i8*** %5
%23 = load i8*, i8** %22
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i8* %23)
%25 = load i8**, i8*** %5
%26 = getelementptr inbounds i8*, i8** %25, i64 0
%27 = load i8*, i8** %26
%28 = load i8, i8* %27
%29 = sext i8 %28 to i32
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i32 %29)
%31 = load i8**, i8*** %5
%32 = getelementptr inbounds i8*, i8** %31, i32 -1
store i8** %32, i8*** %5
%33 = load i8*, i8** %32
%34 = load i8**, i8*** %5
%35 = load i8*, i8** %34
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %35)
%37 = load i8**, i8*** %5
%38 = getelementptr inbounds i8*, i8** %37, i32 1
store i8** %38, i8*** %5
%39 = load i8*, i8** %37
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0), i8* %39)
%41 = load i8**, i8*** %5
%42 = load i8*, i8** %41
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0), i8* %42)
%44 = load i8**, i8*** %5
%45 = getelementptr inbounds i8*, i8** %44, i64 0
%46 = load i8*, i8** %45
%47 = load i8, i8* %46
%48 = sext i8 %47 to i32
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %48)
%50 = load i8**, i8*** %5
%51 = getelementptr inbounds i8*, i8** %50, i32 1
store i8** %51, i8*** %5
%52 = load i8*, i8** %51
%53 = load i8**, i8*** %5
%54 = getelementptr inbounds i8*, i8** %53, i64 0
%55 = load i8*, i8** %54
%56 = load i8, i8* %55
%57 = sext i8 %56 to i32
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %57)
%59 = load i8**, i8*** %5
%60 = getelementptr inbounds i8*, i8** %59, i64 0
%61 = load i8*, i8** %60
%62 = getelementptr inbounds i8, i8* %61, i32 1
store i8* %62, i8** %60
%63 = load i8, i8* %62
%64 = sext i8 %63 to i32
%65 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.6, i64 0, i64 0), i32 %64)
%66 = load i8**, i8*** %5
%67 = getelementptr inbounds i8*, i8** %66, i32 -1
store i8** %67, i8*** %5
%68 = load i8*, i8** %67
%69 = load i8**, i8*** %5
%70 = getelementptr inbounds i8*, i8** %69, i32 -1
store i8** %70, i8*** %5
%71 = load i8*, i8** %70
br label %72
72: ; preds = %104, %11
%73 = load i32, i32* %4
%74 = add nsw i32 %73, -1
store i32 %74, i32* %4
%75 = icmp sgt i32 %74, 0
br i1 %75, label %76, label %84
76: ; preds = %72
%77 = load i8**, i8*** %5
%78 = getelementptr inbounds i8*, i8** %77, i32 1
store i8** %78, i8*** %5
%79 = load i8*, i8** %78
%80 = getelementptr inbounds i8, i8* %79, i64 0
%81 = load i8, i8* %80
%82 = sext i8 %81 to i32
%83 = icmp eq i32 %82, 45
br label %84
84: ; preds = %76, %72
%85 = phi i1 [ false, %72 ], [ %83, %76 ]
br i1 %85, label %86, label %105
86: ; preds = %84
br label %87
87: ; preds = %103, %86
%88 = load i8**, i8*** %5
%89 = getelementptr inbounds i8*, i8** %88, i64 0
%90 = load i8*, i8** %89
%91 = getelementptr inbounds i8, i8* %90, i32 1
store i8* %91, i8** %89
%92 = load i8, i8* %91
%93 = sext i8 %92 to i32
store i32 %93, i32* %8
%94 = icmp ne i32 %93, 0
br i1 %94, label %95, label %104
95: ; preds = %87
%96 = load i32, i32* %8
switch i32 %96, label %101 [
i32 110, label %97
i32 114, label %99
]
97: ; preds = %95
store i32 1, i32* %6
%98 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0))
br label %103
99: ; preds = %95
store i32 1, i32* %7
%100 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0))
br label %103
101: ; preds = %95
%102 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.9, i64 0, i64 0))
store i32 0, i32* %4
br label %103
103: ; preds = %101, %99, %97
br label %87
104: ; preds = %87
br label %72
105: ; preds = %84
br label %106
106: ; preds = %105, %2
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"* argv = '%s';\0A\00"
@.str.1 = [20 x i8] c"* argv [ 0 ] = %c;\0A\00"
@.str.2 = [19 x i8] c"* ++ argv = '%s';\0A\00"
@.str.3 = [21 x i8] c"* argv [ 0 ] = %c;\0A\0A\00"
@.str.4 = [19 x i8] c"* argv ++ = '%s';\0A\00"
@.str.5 = [17 x i8] c"* argv = '%s';\0A\0A\00"
@.str.6 = [23 x i8] c"* ++ argv [ 0 ] = %c;\0A\00"
@str = [9 x i8] c"rev = 1;\00"
@str.10 = [9 x i8] c"num = 1;\00"
@str.11 = [17 x i8] c"wrong parameter;\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %67
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i8*, i8** %1
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %9)
%11 = getelementptr inbounds i8*, i8** %1, i64 1
%12 = load i8*, i8** %11
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i8* %12)
%14 = load i8*, i8** %11
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i32 %16)
%18 = load i8*, i8** %1
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %18)
%20 = load i8*, i8** %1
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0), i8* %20)
%22 = load i8*, i8** %11
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0), i8* %22)
%24 = load i8*, i8** %11
%25 = load i8, i8* %24
%26 = sext i8 %25 to i32
%27 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %26)
%28 = getelementptr inbounds i8*, i8** %1, i64 2
%29 = load i8*, i8** %28
%30 = load i8, i8* %29
%31 = sext i8 %30 to i32
%32 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %31)
%33 = load i8*, i8** %28
%34 = getelementptr inbounds i8, i8* %33, i64 1
store i8* %34, i8** %28
%35 = load i8, i8* %34
%36 = sext i8 %35 to i32
%37 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.6, i64 0, i64 0), i32 %36)
br label %41
38: ; preds = %59, %49
%39 = phi i32 [ %44, %49 ], [ %61, %59 ]
%40 = icmp sgt i32 %39, 1
br i1 %40, label %41, label %67
41: ; preds = %4, %38
%42 = phi i8** [ %1, %4 ], [ %45, %38 ]
%43 = phi i32 [ %0, %4 ], [ %39, %38 ]
%44 = add nsw i32 %43, -1
%45 = getelementptr inbounds i8*, i8** %42, i64 1
%46 = load i8*, i8** %45
%47 = load i8, i8* %46
%48 = icmp eq i8 %47, 45
br i1 %48, label %49, label %67
49: ; preds = %41
%50 = getelementptr inbounds i8, i8* %46, i64 1
store i8* %50, i8** %45
%51 = load i8, i8* %50
%52 = icmp eq i8 %51, 0
br i1 %52, label %38, label %53
53: ; preds = %49, %59
%54 = phi i8 [ %65, %59 ], [ %51, %49 ]
%55 = phi i32 [ %61, %59 ], [ %44, %49 ]
%56 = sext i8 %54 to i32
switch i32 %56, label %58 [
i32 110, label %59
i32 114, label %57
]
57: ; preds = %53
br label %59
58: ; preds = %53
br label %59
59: ; preds = %53, %58, %57
%60 = phi i8* [ getelementptr inbounds ([17 x i8], [17 x i8]* @str.11, i64 0, i64 0), %58 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0), %57 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @str.10, i64 0, i64 0), %53 ]
%61 = phi i32 [ 0, %58 ], [ %55, %57 ], [ %55, %53 ]
%62 = tail call i32 @puts(i8* dereferenceable(1) %60)
%63 = load i8*, i8** %45
%64 = getelementptr inbounds i8, i8* %63, i64 1
store i8* %64, i8** %45
%65 = load i8, i8* %64
%66 = icmp eq i8 %65, 0
br i1 %66, label %38, label %53
67: ; preds = %38, %41, %2
ret i32 0
}