#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*/ arr_ops(char **, int, char **);
int /*<<< orphan*/ pr_argv(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ strcpy_my(char *, int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  int i = 0;
  int j = argc;
  char *f;
  char **arr;
  while (j-- > 0) {
    printf("* argv = '%s';\n", *argv);
    pr_argv(*argv++);
  }
  printf("end of first cycle.\n");
  printf("\nafter ending of first cycle argc = %d, and * argv = '%s';\n", argc,
         *argv);
  for (i = 0; i < argc; i++, *argv--) {
  }
  printf("before begining of second cycle argc = %d, and * argv = '%s';\n",
         argc, *argv);
  for (i = 0; i < argc; i++) {
    strcpy_my(f, *argv++);
    printf("result string = '%s';\n", f);
  }
  printf("end of second cycle.\n\n");
  for (i = 0; i < argc; i++, *argv--) {
  }
  arr_ops(arr, argc, argv);
  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)
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x18(%rbp)
cmp    $0x0,%eax
jle    11aa <main+0x6a>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xefb(%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),%rax
mov    %eax,%edi
call   1050 <pr_argv@plt>
jmp    1163 <main+0x23>
lea    0xe4f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe4c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1202 <main+0xc2>
jmp    11e8 <main+0xa8>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
add    $0xfffffffffffffff8,%rax
mov    %rax,-0x10(%rbp)
jmp    11d7 <main+0x97>
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe3e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    126a <main+0x12a>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%rax
mov    %eax,%esi
call   1060 <strcpy_my@plt>
mov    -0x20(%rbp),%rsi
lea    0xe3b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1221 <main+0xe1>
lea    0xe36(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    12aa <main+0x16a>
jmp    1290 <main+0x150>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
add    $0xfffffffffffffff8,%rax
mov    %rax,-0x10(%rbp)
jmp    127f <main+0x13f>
mov    -0x28(%rbp),%rdi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1040 <arr_ops@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%rbx
mov    %edi,%r14d
test   %edi,%edi
jle    11a0 <main+0x50>
lea    0x1(%r14),%ebp
lea    0xef8(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    (%rbx),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%rbx),%edi
add    $0x8,%rbx
call   1060 <pr_argv@plt>
add    $0xffffffff,%ebp
cmp    $0x1,%ebp
ja     1180 <main+0x30>
lea    0xeeb(%rip),%rdi
call   1030 <puts@plt>
mov    (%rbx),%rdx
lea    0xe4a(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
test   %r14d,%r14d
jle    125c <main+0x10c>
lea    -0x1(%r14),%eax
mov    %rax,0x8(%rsp)
not    %rax
lea    (%rbx,%rax,8),%r13
mov    (%rbx,%rax,8),%rdx
lea    0xe58(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r14,0x10(%rsp)
mov    %r14d,%r12d
lea    0xe7e(%rip),%r15
xor    %r14d,%r14d
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    0x0(%r13,%r14,8),%esi
call   1070 <strcpy_my@plt>
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0xfffffffffffffff8,%rbp
add    $0x1,%r14
cmp    %r14d,%r12d
jne    1210 <main+0xc0>
lea    0xe6e(%rip),%rdi
call   1030 <puts@plt>
mov    0x10(%rsp),%r14
test   %r14d,%r14d
jle    127e <main+0x12e>
mov    0x8(%rsp),%rax
add    %rax,%rax
xor    $0xfffffffffffffffe,%rax
lea    (%rbx,%rax,8),%rbx
sub    %rbp,%rbx
jmp    1284 <main+0x134>
mov    (%rbx),%rdx
lea    0xdd6(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe2f(%rip),%rdi
call   1030 <puts@plt>
jmp    1284 <main+0x134>
sub    %rbp,%r13
mov    %r13,%rbx
mov    %r14d,%esi
mov    %rbx,%rdx
call   1050 <arr_ops@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [16 x i8] c"* argv = '%s';\0A\00"
@.str.1 = [21 x i8] c"end of first cycle.\0A\00"
@.str.2 = [60 x i8] c"\0Aafter ending of first cycle argc = %d, and * argv = '%s';\0A\00"
@.str.3 = [63 x i8] c"before begining of second cycle argc = %d, and * argv = '%s';\0A\00"
@.str.4 = [23 x i8] c"result string = '%s';\0A\00"
@.str.5 = [23 x i8] c"end of second cycle.\0A\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 i8*
%9 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%10 = load i32, i32* %4
store i32 %10, i32* %7
br label %11
11: ; preds = %15, %2
%12 = load i32, i32* %7
%13 = add nsw i32 %12, -1
store i32 %13, i32* %7
%14 = icmp sgt i32 %12, 0
br i1 %14, label %15, label %24
15: ; preds = %11
%16 = load i8**, i8*** %5
%17 = load i8*, i8** %16
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %17)
%19 = load i8**, i8*** %5
%20 = getelementptr inbounds i8*, i8** %19, i32 1
store i8** %20, i8*** %5
%21 = load i8*, i8** %19
%22 = ptrtoint i8* %21 to i32
%23 = call i32 @pr_argv(i32 %22)
br label %11
24: ; preds = %11
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%26 = load i32, i32* %4
%27 = load i8**, i8*** %5
%28 = load i8*, i8** %27
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.2, i64 0, i64 0), i32 %26, i8* %28)
store i32 0, i32* %6
br label %30
30: ; preds = %35, %24
%31 = load i32, i32* %6
%32 = load i32, i32* %4
%33 = icmp slt i32 %31, %32
br i1 %33, label %34, label %41
34: ; preds = %30
br label %35
35: ; preds = %34
%36 = load i32, i32* %6
%37 = add nsw i32 %36, 1
store i32 %37, i32* %6
%38 = load i8**, i8*** %5
%39 = getelementptr inbounds i8*, i8** %38, i32 -1
store i8** %39, i8*** %5
%40 = load i8*, i8** %38
br label %30
41: ; preds = %30
%42 = load i32, i32* %4
%43 = load i8**, i8*** %5
%44 = load i8*, i8** %43
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.3, i64 0, i64 0), i32 %42, i8* %44)
store i32 0, i32* %6
br label %46
46: ; preds = %59, %41
%47 = load i32, i32* %6
%48 = load i32, i32* %4
%49 = icmp slt i32 %47, %48
br i1 %49, label %50, label %62
50: ; preds = %46
%51 = load i8*, i8** %8
%52 = load i8**, i8*** %5
%53 = getelementptr inbounds i8*, i8** %52, i32 1
store i8** %53, i8*** %5
%54 = load i8*, i8** %52
%55 = ptrtoint i8* %54 to i32
%56 = call i32 @strcpy_my(i8* %51, i32 %55)
%57 = load i8*, i8** %8
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0), i8* %57)
br label %59
59: ; preds = %50
%60 = load i32, i32* %6
%61 = add nsw i32 %60, 1
store i32 %61, i32* %6
br label %46
62: ; preds = %46
%63 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0))
store i32 0, i32* %6
br label %64
64: ; preds = %69, %62
%65 = load i32, i32* %6
%66 = load i32, i32* %4
%67 = icmp slt i32 %65, %66
br i1 %67, label %68, label %75
68: ; preds = %64
br label %69
69: ; preds = %68
%70 = load i32, i32* %6
%71 = add nsw i32 %70, 1
store i32 %71, i32* %6
%72 = load i8**, i8*** %5
%73 = getelementptr inbounds i8*, i8** %72, i32 -1
store i8** %73, i8*** %5
%74 = load i8*, i8** %72
br label %64
75: ; preds = %64
%76 = load i8**, i8*** %9
%77 = load i32, i32* %4
%78 = load i8**, i8*** %5
%79 = call i32 @arr_ops(i8** %76, i32 %77, i8** %78)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"* argv = '%s';\0A\00"
@.str.2 = [60 x i8] c"\0Aafter ending of first cycle argc = %d, and * argv = '%s';\0A\00"
@.str.3 = [63 x i8] c"before begining of second cycle argc = %d, and * argv = '%s';\0A\00"
@.str.4 = [23 x i8] c"result string = '%s';\0A\00"
@str = [20 x i8] c"end of first cycle.\00"
@str.6 = [22 x i8] c"end of second cycle.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %16
4: ; preds = %2, %4
%5 = phi i8** [ %10, %4 ], [ %1, %2 ]
%6 = phi i32 [ %7, %4 ], [ %0, %2 ]
%7 = add nsw i32 %6, -1
%8 = load i8*, i8** %5
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = getelementptr inbounds i8*, i8** %5, i64 1
%11 = load i8*, i8** %5
%12 = ptrtoint i8* %11 to i64
%13 = trunc i64 %12 to i32
%14 = tail call i32 @pr_argv(i32 %13)
%15 = icmp ugt i32 %6, 1
br i1 %15, label %4, label %16
16: ; preds = %4, %2
%17 = phi i8** [ %1, %2 ], [ %10, %4 ]
%18 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%19 = load i8*, i8** %17
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @.str.2, i64 0, i64 0), i32 %0, i8* %19)
br i1 %3, label %25, label %21
21: ; preds = %16
%22 = load i8*, i8** %17
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @.str.3, i64 0, i64 0), i32 %0, i8* %22)
%24 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.6, i64 0, i64 0))
br label %50
25: ; preds = %16
%26 = add nsw i32 %0, -1
%27 = zext i32 %26 to i64
%28 = xor i64 %27, -1
%29 = getelementptr i8*, i8** %17, i64 %28
%30 = load i8*, i8** %29
%31 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @.str.3, i64 0, i64 0), i32 %0, i8* %30)
br label %32
32: ; preds = %25, %32
%33 = phi i8** [ %35, %32 ], [ %29, %25 ]
%34 = phi i32 [ %41, %32 ], [ 0, %25 ]
%35 = getelementptr inbounds i8*, i8** %33, i64 1
%36 = load i8*, i8** %33
%37 = ptrtoint i8* %36 to i64
%38 = trunc i64 %37 to i32
%39 = tail call i32 @strcpy_my(i8* undef, i32 %38)
%40 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0), i8* undef)
%41 = add nuw nsw i32 %34, 1
%42 = icmp eq i32 %41, %0
br i1 %42, label %43, label %32
43: ; preds = %32
%44 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.6, i64 0, i64 0))
br i1 %3, label %45, label %50
45: ; preds = %43
%46 = add nsw i32 %0, -1
%47 = zext i32 %46 to i64
%48 = xor i64 %47, -1
%49 = getelementptr i8*, i8** %35, i64 %48
br label %50
50: ; preds = %21, %45, %43
%51 = phi i8** [ %35, %43 ], [ %49, %45 ], [ %17, %21 ]
%52 = tail call i32 @arr_ops(i8** undef, i32 %0, i8** %51)
ret i32 0
}