#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 *);
int /*<<< orphan*/ strcpy_my_3(int, char *);
void f1(int step) {
  int i = 0;
  char a = ' ';
  char line[10];
  extern char *arr2[10];
  extern int arr2_ptr;
  printf("getted string:'%s';\n", arr2[step]);
  printf("a = '%c' and %d;\n", a, a);
  strcpy_my_3(step, line);
  printf("line before = '%s';\n", line);
  while (i < 10) {
    line[i] = 32;
    i++;
  }
  line[i] = '\0';
  printf("line after :'%s';\n", line);
  printf("arr2 [ %d ] before :'%s';\n", step, arr2[step]);
  strcpy_my(arr2[step], line);
  printf("arr2 [ %d ] after  :'%s';\n", step, arr2[step]);
  printf("\n----------\n");
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movb   $0x20,-0x9(%rbp)
movslq -0x4(%rbp),%rcx
mov    0x2e97(%rip),%rax
mov    (%rax,%rcx,8),%rsi
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsbl -0x9(%rbp),%esi
movsbl -0x9(%rbp),%edx
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
lea    -0x13(%rbp),%rsi
call   1050 <strcpy_my_3@plt>
lea    -0x13(%rbp),%rsi
lea    0xe97(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0xa,-0x8(%rbp)
jge    11b8 <f1+0x88>
movslq -0x8(%rbp),%rax
movb   $0x20,-0x13(%rbp,%rax,1)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1197 <f1+0x67>
movslq -0x8(%rbp),%rax
movb   $0x0,-0x13(%rbp,%rax,1)
lea    -0x13(%rbp),%rsi
lea    0xe70(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
movslq -0x4(%rbp),%rcx
mov    0x2e07(%rip),%rax
mov    (%rax,%rcx,8),%rdx
lea    0xe63(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movslq -0x4(%rbp),%rcx
mov    0x2dea(%rip),%rax
mov    (%rax,%rcx,8),%rdi
lea    -0x13(%rbp),%rsi
call   1040 <strcpy_my@plt>
mov    -0x4(%rbp),%esi
movslq -0x4(%rbp),%rcx
mov    0x2dcf(%rip),%rax
mov    (%rax,%rcx,8),%rdx
lea    0xe46(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe53(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
movslq %edi,%rbx
mov    0x2e95(%rip),%r15
mov    (%r15,%rbx,8),%rsi
lea    0xea2(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xea9(%rip),%rdi
mov    $0x20,%esi
mov    $0x20,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rsp,%r14
mov    %ebx,%edi
mov    %r14,%rsi
call   1060 <strcpy_my_3@plt>
lea    0xe96(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
movabs $0x2020202020202020,%rax
20 20 20
mov    %rax,(%rsp)
movw   $0x2020,0x8(%rsp)
movb   $0x0,0xa(%rsp)
lea    0xe80(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%r15,%rbx,8),%rdx
lea    0xe7e(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%r15,%rbx,8),%rdi
mov    %r14,%rsi
call   1050 <strcpy_my@plt>
mov    (%r15,%rbx,8),%rdx
lea    0xe79(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe84(%rip),%rdi
call   1030 <puts@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [21 x i8] c"getted string:'%s';\0A\00"
@arr2 = external global [10 x i8*]
@.str.1 = [18 x i8] c"a = '%c' and %d;\0A\00"
@.str.2 = [21 x i8] c"line before = '%s';\0A\00"
@.str.3 = [19 x i8] c"line after :'%s';\0A\00"
@.str.4 = [27 x i8] c"arr2 [ %d ] before :'%s';\0A\00"
@.str.5 = [27 x i8] c"arr2 [ %d ] after :'%s';\0A\00"
@.str.6 = [13 x i8] c"\0A----------\0A\00"
define void @f1(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8
%5 = alloca [10 x i8]
store i32 %0, i32* %2
store i32 0, i32* %3
store i8 32, i8* %4
%6 = load i32, i32* %2
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds [10 x i8*], [10 x i8*]* @arr2, i64 0, i64 %7
%9 = load i8*, i8** %8
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = load i8, i8* %4
%12 = sext i8 %11 to i32
%13 = load i8, i8* %4
%14 = sext i8 %13 to i32
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %12, i32 %14)
%16 = load i32, i32* %2
%17 = getelementptr inbounds [10 x i8], [10 x i8]* %5, i64 0, i64 0
%18 = call i32 @strcpy_my_3(i32 %16, i8* %17)
%19 = getelementptr inbounds [10 x i8], [10 x i8]* %5, i64 0, i64 0
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i8* %19)
br label %21
21: ; preds = %24, %1
%22 = load i32, i32* %3
%23 = icmp slt i32 %22, 10
br i1 %23, label %24, label %30
24: ; preds = %21
%25 = load i32, i32* %3
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds [10 x i8], [10 x i8]* %5, i64 0, i64 %26
store i8 32, i8* %27
%28 = load i32, i32* %3
%29 = add nsw i32 %28, 1
store i32 %29, i32* %3
br label %21
30: ; preds = %21
%31 = load i32, i32* %3
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds [10 x i8], [10 x i8]* %5, i64 0, i64 %32
store i8 0, i8* %33
%34 = getelementptr inbounds [10 x i8], [10 x i8]* %5, i64 0, i64 0
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i8* %34)
%36 = load i32, i32* %2
%37 = load i32, i32* %2
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds [10 x i8*], [10 x i8*]* @arr2, i64 0, i64 %38
%40 = load i8*, i8** %39
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0), i32 %36, i8* %40)
%42 = load i32, i32* %2
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds [10 x i8*], [10 x i8*]* @arr2, i64 0, i64 %43
%45 = load i8*, i8** %44
%46 = getelementptr inbounds [10 x i8], [10 x i8]* %5, i64 0, i64 0
%47 = call i32 @strcpy_my(i8* %45, i8* %46)
%48 = load i32, i32* %2
%49 = load i32, i32* %2
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds [10 x i8*], [10 x i8*]* @arr2, i64 0, i64 %50
%52 = load i8*, i8** %51
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0), i32 %48, i8* %52)
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"getted string:'%s';\0A\00"
@arr2 = external global [10 x i8*]
@.str.1 = [18 x i8] c"a = '%c' and %d;\0A\00"
@.str.2 = [21 x i8] c"line before = '%s';\0A\00"
@.str.3 = [19 x i8] c"line after :'%s';\0A\00"
@.str.4 = [27 x i8] c"arr2 [ %d ] before :'%s';\0A\00"
@.str.5 = [27 x i8] c"arr2 [ %d ] after :'%s';\0A\00"
@str = [12 x i8] c"\0A----------\00"
define void @f1(i32 %0) {
%2 = alloca [10 x i8]
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%5 = sext i32 %0 to i64
%6 = getelementptr inbounds [10 x i8*], [10 x i8*]* @arr2, i64 0, i64 %5
%7 = load i8*, i8** %6
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 32, i32 32)
%10 = call i32 @strcpy_my_3(i32 %0, i8* %4)
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i8* %4)
%12 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 10
store i8 0, i8* %12
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i8* %4)
%14 = load i8*, i8** %6
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0), i32 %0, i8* %14)
%16 = load i8*, i8** %6
%17 = call i32 @strcpy_my(i8* %16, i8* %4)
%18 = load i8*, i8** %6
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0), i32 %0, i8* %18)
%20 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret void
}