#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 *, char *, char, char, int);
int /*<<< orphan*/ strcpy(char *, char *);
int main() {
  const int dim = 50;
  int i = 0;
  char nome[dim];
  char *p;
  p = &nome[0];
  p = nome;
  strcpy(nome, "trovi un gatto nero morto crocifisso sul muro");
  for (i = 0; i < dim; ++i) {
    printf("indirizzo: %p, contenuto: %1c\t%4d,  i: %2d\n", p, *p, *p, i);
    ++p;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x32,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    %rsp,%rax
mov    %rax,-0x18(%rbp)
lea    -0x60(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    -0x60(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    0xea5(%rip),%rsi
lea    -0x60(%rbp),%rdi
call   1030 <strcpy@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x32,-0xc(%rbp)
jge    11b5 <main+0x95>
mov    -0x20(%rbp),%rsi
mov    -0x20(%rbp),%rax
mov    (%rax),%cl
mov    -0x20(%rbp),%rax
mov    (%rax),%al
mov    -0xc(%rbp),%r8d
lea    0xe9e(%rip),%rdi
movsbl %cl,%edx
movsbl %al,%ecx
call   1040 <printf@plt>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    116b <main+0x4b>
mov    -0x18(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x38,%rsp
lea    0xed2(%rip),%rsi
mov    %rsp,%rdi
call   1030 <strcpy@plt>
xor    %ebx,%ebx
lea    0xeef(%rip),%r14
nop
lea    (%rsp,%rbx,1),%rsi
movsbl (%rsp,%rbx,1),%ecx
mov    %r14,%rdi
mov    %ecx,%edx
mov    %ebx,%r8d
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    $0x32,%ebx
jne    1140 <main+0x20>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [46 x i8] c"trovi un gatto nero morto crocifisso sul muro\00"
@.str.1 = [44 x i8] c"indirizzo: %p, contenuto: %1c\09%4d, i: %2d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i32 0, i32* %1
store i32 50, i32* %2
store i32 0, i32* %3
%6 = call i8* @llvm.stacksave()
store i8* %6, i8** %4
%7 = alloca i8, i64 50
%8 = getelementptr inbounds i8, i8* %7, i64 0
store i8* %8, i8** %5
store i8* %7, i8** %5
%9 = call i32 @strcpy(i8* %7, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %10
10: ; preds = %23, %0
%11 = load i32, i32* %3
%12 = icmp slt i32 %11, 50
br i1 %12, label %13, label %26
13: ; preds = %10
%14 = load i8*, i8** %5
%15 = load i8*, i8** %5
%16 = load i8, i8* %15
%17 = load i8*, i8** %5
%18 = load i8, i8* %17
%19 = load i32, i32* %3
%20 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0), i8* %14, i8 signext %16, i8 signext %18, i32 %19)
%21 = load i8*, i8** %5
%22 = getelementptr inbounds i8, i8* %21, i32 1
store i8* %22, i8** %5
br label %23
23: ; preds = %13
%24 = load i32, i32* %3
%25 = add nsw i32 %24, 1
store i32 %25, i32* %3
br label %10
26: ; preds = %10
%27 = load i8*, i8** %4
%28 = load i32, i32* %1
ret i32 %28
}

LLVM IR (-O2):
@.str = [46 x i8] c"trovi un gatto nero morto crocifisso sul muro\00"
@.str.1 = [44 x i8] c"indirizzo: %p, contenuto: %1c\09%4d, i: %2d\0A\00"
define i32 @main() {
%1 = alloca [50 x i8]
%2 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%3 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
br label %4
4: ; preds = %0, %4
%5 = phi i8* [ %2, %0 ], [ %9, %4 ]
%6 = phi i32 [ 0, %0 ], [ %10, %4 ]
%7 = load i8, i8* %5
%8 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0), i8* %5, i8 signext %7, i8 signext %7, i32 %6)
%9 = getelementptr inbounds i8, i8* %5, i64 1
%10 = add nuw nsw i32 %6, 1
%11 = icmp eq i32 %10, 50
br i1 %11, label %12, label %4
12: ; preds = %4
ret i32 0
}