#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(char *, char *);
int /*<<< orphan*/ strings(char *, int, int);
int main(int argc, const char *argv[]) {
  char str[] = "abcdefghijklm", str1[50];
  int i, j;
  i = 2;
  j = 6;
  printf("Mudando a copia do vetor de origem\n");
  strcpy(str1, str);
  strings(str1, i, j);
  printf("%s\n", str1);
  printf("O valor do vetor de origem sem a mudança : %s\n", str);
  printf("Mudando o vetor de origem\n");
  strings(str, i, j);
  printf("Vetor de origem depois da mudança : %s\n", str);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xeb3(%rip),%rax
mov    %rax,-0x1e(%rbp)
mov    0xeb1(%rip),%eax
mov    %eax,-0x16(%rbp)
mov    0xeab(%rip),%ax
mov    %ax,-0x12(%rbp)
movl   $0x2,-0x54(%rbp)
movl   $0x6,-0x58(%rbp)
lea    0xe94(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x50(%rbp),%rdi
lea    -0x1e(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x50(%rbp),%rdi
mov    -0x54(%rbp),%esi
mov    -0x58(%rbp),%edx
call   1040 <strings@plt>
lea    -0x50(%rbp),%rsi
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x1e(%rbp),%rsi
lea    0xe78(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x1e(%rbp),%rdi
mov    -0x54(%rbp),%esi
mov    -0x58(%rbp),%edx
call   1040 <strings@plt>
lea    -0x1e(%rbp),%rsi
lea    0xe94(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x48,%rsp
movabs $0x6d6c6b6a696867,%rax
mov    %rax,0x6(%rsp)
movabs $0x6867666564636261,%rax
66 67 68
mov    %rax,(%rsp)
lea    0xefc(%rip),%rdi
call   1040 <puts@plt>
lea    0x10(%rsp),%rbx
mov    %rsp,%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x6,%edx
call   1050 <strings@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
lea    0xe6a(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xed5(%rip),%rdi
call   1040 <puts@plt>
mov    %r14,%rdi
mov    $0x2,%esi
mov    $0x6,%edx
call   1050 <strings@plt>
lea    0xe6b(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
xor    %eax,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.str = [14 x i8] c"abcdefghijklm\00"
@.str = [36 x i8] c"Mudando a copia do vetor de origem\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
@.str.2 = [48 x i8] c"O valor do vetor de origem sem a mudan\C3\A7a : %s\0A\00"
@.str.3 = [27 x i8] c"Mudando o vetor de origem\0A\00"
@.str.4 = [41 x i8] c"Vetor de origem depois da mudan\C3\A7a : %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [14 x i8]
%7 = alloca [50 x i8]
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = bitcast [14 x i8]* %6 to i8*
store i32 2, i32* %8
store i32 6, i32* %9
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%12 = getelementptr inbounds [50 x i8], [50 x i8]* %7, i64 0, i64 0
%13 = getelementptr inbounds [14 x i8], [14 x i8]* %6, i64 0, i64 0
%14 = call i32 @strcpy(i8* %12, i8* %13)
%15 = getelementptr inbounds [50 x i8], [50 x i8]* %7, i64 0, i64 0
%16 = load i32, i32* %8
%17 = load i32, i32* %9
%18 = call i32 @strings(i8* %15, i32 %16, i32 %17)
%19 = getelementptr inbounds [50 x i8], [50 x i8]* %7, i64 0, i64 0
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %19)
%21 = getelementptr inbounds [14 x i8], [14 x i8]* %6, i64 0, i64 0
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.2, i64 0, i64 0), i8* %21)
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0))
%24 = getelementptr inbounds [14 x i8], [14 x i8]* %6, i64 0, i64 0
%25 = load i32, i32* %8
%26 = load i32, i32* %9
%27 = call i32 @strings(i8* %24, i32 %25, i32 %26)
%28 = getelementptr inbounds [14 x i8], [14 x i8]* %6, i64 0, i64 0
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.4, i64 0, i64 0), i8* %28)
ret i32 0
}

LLVM IR (-O2):
@__const.main.str = [14 x i8] c"abcdefghijklm\00"
@.str.2 = [48 x i8] c"O valor do vetor de origem sem a mudan\C3\A7a : %s\0A\00"
@.str.4 = [41 x i8] c"Vetor de origem depois da mudan\C3\A7a : %s\0A\00"
@str = [35 x i8] c"Mudando a copia do vetor de origem\00"
@str.5 = [26 x i8] c"Mudando o vetor de origem\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [14 x i8]
%4 = alloca [50 x i8]
%5 = getelementptr inbounds [14 x i8], [14 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [50 x i8], [50 x i8]* %4, i64 0, i64 0
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
%8 = call i32 @strcpy(i8* %6, i8* %5)
%9 = call i32 @strings(i8* %6, i32 2, i32 6)
%10 = call i32 @puts(i8* %6)
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str.2, i64 0, i64 0), i8* %5)
%12 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.5, i64 0, i64 0))
%13 = call i32 @strings(i8* %5, i32 2, i32 6)
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.4, i64 0, i64 0), i8* %5)
ret i32 0
}