#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 /*<<< orphan*/ strcpy_my(char *, char *);
void arr_ops(char **arr, int argc, char **argv) {
  int i = 0;
  int j = 0;
  char tmp[100];
  for (i = 0; i < argc; i++) {
    printf("* ( argv + ( i = %d ) ) = '%s' _whole string_;\n\n", i,
           *(argv + i));
    j = 0;
    while (*(*(argv + i) + j) != '\0') {
      printf("* ( * ( argv + i ) + j ) = '%c';\n", *(*(argv + i) + j));
      j++;
    }
    strcpy_my(tmp, *(argv + i));
    printf("getted string tmp:'%s'\n", tmp);
    strcpy_my(*(arr + i), tmp);
    printf("-------------------\n");
  }
}


x86 assembly (clang, -O0):
<arr_ops>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1229 <arr_ops+0x109>
mov    -0x1c(%rbp),%esi
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xe93(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x20(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     11c8 <arr_ops+0xa8>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x20(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
lea    0xe7e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    117b <arr_ops+0x5b>
lea    -0x90(%rbp),%rdi
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
call   1040 <strcpy_my@plt>
lea    -0x90(%rbp),%rsi
lea    0xe65(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    -0x90(%rbp),%rsi
call   1040 <strcpy_my@plt>
lea    0xe57(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    114b <arr_ops+0x2b>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arr_ops>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
mov    %rdi,0x8(%rsp)
test   %esi,%esi
jle    1203 <arr_ops+0xd3>
mov    %rdx,%rbx
mov    %esi,%ebp
lea    0x10(%rsp),%r12
lea    0xed5(%rip),%r15
xor    %r13d,%r13d
jmp    11af <arr_ops+0x7f>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r12,%rdi
call   1050 <strcpy_my@plt>
lea    0xed4(%rip),%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rsp),%rax
mov    (%rax,%r13,8),%rdi
mov    %r12,%rsi
call   1050 <strcpy_my@plt>
lea    0xeca(%rip),%rdi
call   1030 <puts@plt>
add    $0x1,%r13
cmp    %rbp,%r13
je     1203 <arr_ops+0xd3>
mov    (%rbx,%r13,8),%rdx
lea    0xe46(%rip),%rdi
mov    %r13d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%rbx,%r13,8),%rsi
mov    (%rsi),%al
test   %al,%al
je     1170 <arr_ops+0x40>
mov    $0x1,%r14d
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl %al,%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%rbx,%r13,8),%rsi
movzbl (%rsi,%r14,1),%eax
add    $0x1,%r14
test   %al,%al
jne    11e0 <arr_ops+0xb0>
jmp    1170 <arr_ops+0x40>
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [49 x i8] c"* ( argv + ( i = %d ) ) = '%s' _whole string_;\0A\0A\00"
@.str.1 = [34 x i8] c"* ( * ( argv + i ) + j ) = '%c';\0A\00"
@.str.2 = [24 x i8] c"getted string tmp:'%s'\0A\00"
@.str.3 = [21 x i8] c"-------------------\0A\00"
define void @arr_ops(i8** %0, i32 %1, i8** %2) {
%4 = alloca i8**
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i32
%8 = alloca i32
%9 = alloca [100 x i8]
store i8** %0, i8*** %4
store i32 %1, i32* %5
store i8** %2, i8*** %6
store i32 0, i32* %7
store i32 0, i32* %8
store i32 0, i32* %7
br label %10
10: ; preds = %66, %3
%11 = load i32, i32* %7
%12 = load i32, i32* %5
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %69
14: ; preds = %10
%15 = load i32, i32* %7
%16 = load i8**, i8*** %6
%17 = load i32, i32* %7
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8*, i8** %16, i64 %18
%20 = load i8*, i8** %19
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i32 %15, i8* %20)
store i32 0, i32* %8
br label %22
22: ; preds = %34, %14
%23 = load i8**, i8*** %6
%24 = load i32, i32* %7
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i8*, i8** %23, i64 %25
%27 = load i8*, i8** %26
%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 = sext i8 %31 to i32
%33 = icmp ne i32 %32, 0
br i1 %33, label %34, label %48
34: ; preds = %22
%35 = load i8**, i8*** %6
%36 = load i32, i32* %7
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds i8*, i8** %35, i64 %37
%39 = load i8*, i8** %38
%40 = load i32, i32* %8
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds i8, i8* %39, i64 %41
%43 = load i8, i8* %42
%44 = sext i8 %43 to i32
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i32 %44)
%46 = load i32, i32* %8
%47 = add nsw i32 %46, 1
store i32 %47, i32* %8
br label %22
48: ; preds = %22
%49 = getelementptr inbounds [100 x i8], [100 x i8]* %9, i64 0, i64 0
%50 = load i8**, i8*** %6
%51 = load i32, i32* %7
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds i8*, i8** %50, i64 %52
%54 = load i8*, i8** %53
%55 = call i32 @strcpy_my(i8* %49, i8* %54)
%56 = getelementptr inbounds [100 x i8], [100 x i8]* %9, i64 0, i64 0
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i8* %56)
%58 = load i8**, i8*** %4
%59 = load i32, i32* %7
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds i8*, i8** %58, i64 %60
%62 = load i8*, i8** %61
%63 = getelementptr inbounds [100 x i8], [100 x i8]* %9, i64 0, i64 0
%64 = call i32 @strcpy_my(i8* %62, i8* %63)
%65 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
br label %66
66: ; preds = %48
%67 = load i32, i32* %7
%68 = add nsw i32 %67, 1
store i32 %68, i32* %7
br label %10
69: ; preds = %10
ret void
}

LLVM IR (-O2):
@.str = [49 x i8] c"* ( argv + ( i = %d ) ) = '%s' _whole string_;\0A\0A\00"
@.str.1 = [34 x i8] c"* ( * ( argv + i ) + j ) = '%c';\0A\00"
@.str.2 = [24 x i8] c"getted string tmp:'%s'\0A\00"
@str = [20 x i8] c"-------------------\00"
define void @arr_ops(i8** nocapture %0, i32 %1, i8** nocapture %2) {
%4 = alloca [100 x i8]
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%6 = icmp sgt i32 %1, 0
br i1 %6, label %7, label %38
7: ; preds = %3
%8 = zext i32 %1 to i64
br label %9
9: ; preds = %7, %28
%10 = phi i64 [ 0, %7 ], [ %36, %28 ]
%11 = getelementptr inbounds i8*, i8** %2, i64 %10
%12 = load i8*, i8** %11
%13 = trunc i64 %10 to i32
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i32 %13, i8* %12)
%15 = load i8*, i8** %11
%16 = load i8, i8* %15
%17 = icmp eq i8 %16, 0
br i1 %17, label %28, label %18
18: ; preds = %9, %18
%19 = phi i64 [ %23, %18 ], [ 0, %9 ]
%20 = phi i8 [ %26, %18 ], [ %16, %9 ]
%21 = sext i8 %20 to i32
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i32 %21)
%23 = add nuw i64 %19, 1
%24 = load i8*, i8** %11
%25 = getelementptr inbounds i8, i8* %24, i64 %23
%26 = load i8, i8* %25
%27 = icmp eq i8 %26, 0
br i1 %27, label %28, label %18
28: ; preds = %18, %9
%29 = phi i8* [ %15, %9 ], [ %24, %18 ]
%30 = call i32 @strcpy_my(i8* %5, i8* %29)
%31 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i8* %5)
%32 = getelementptr inbounds i8*, i8** %0, i64 %10
%33 = load i8*, i8** %32
%34 = call i32 @strcpy_my(i8* %33, i8* %5)
%35 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%36 = add nuw nsw i64 %10, 1
%37 = icmp eq i64 %36, %8
br i1 %37, label %38, label %9
38: ; preds = %28, %3
ret void
}