#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 main() {
  char string[] = "bella flate'";
  char *p = string;
  char s;
  while ((s = *p++) != '\0')
    printf("indirizzo: %p , carattere %c , stringa : %s\n", p - 1, s, string);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x11(%rbp)
mov    0xed8(%rip),%eax
mov    %eax,-0x9(%rbp)
mov    0xed3(%rip),%al
mov    %al,-0x5(%rbp)
lea    -0x11(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
mov    (%rax),%al
mov    %al,-0x21(%rbp)
movsbl %al,%eax
cmp    $0x0,%eax
je     1187 <main+0x77>
mov    -0x20(%rbp),%rsi
add    $0xffffffffffffffff,%rsi
mov    -0x21(%rbp),%al
lea    -0x11(%rbp),%rcx
lea    0xe93(%rip),%rdi
movsbl %al,%edx
call   1030 <printf@plt>
jmp    1144 <main+0x34>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0x8(%rsp),%r14
movabs $0x276574616c6620,%rax
mov    %rax,0xd(%rsp)
movabs $0x6c6620616c6c6562,%rax
20 66 6c
mov    %rax,0x8(%rsp)
mov    $0x62,%al
lea    0xec6(%rip),%r15
mov    %r14,%rbx
nopw   0x0(%rax,%rax,1)
lea    0x1(%rbx),%r12
movsbl %al,%edx
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %r14,%rcx
call   1030 <printf@plt>
movzbl 0x1(%rbx),%eax
mov    %r12,%rbx
test   %al,%al
jne    1150 <main+0x40>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.main.string = [13 x i8] c"bella flate'\00"
@.str = [45 x i8] c"indirizzo: %p , carattere %c , stringa : %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [13 x i8]
%3 = alloca i8*
%4 = alloca i8
store i32 0, i32* %1
%5 = bitcast [13 x i8]* %2 to i8*
%6 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 0
store i8* %6, i8** %3
br label %7
7: ; preds = %13, %0
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i32 1
store i8* %9, i8** %3
%10 = load i8, i8* %8
store i8 %10, i8* %4
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %19
13: ; preds = %7
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i64 -1
%16 = load i8, i8* %4
%17 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 0
%18 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* %15, i8 signext %16, i8* %17)
br label %7
19: ; preds = %7
%20 = load i32, i32* %1
ret i32 %20
}

LLVM IR (-O2):
@__const.main.string = [13 x i8] c"bella flate'\00"
@.str = [45 x i8] c"indirizzo: %p , carattere %c , stringa : %s\0A\00"
define i32 @main() {
%1 = alloca [13 x i8]
%2 = getelementptr inbounds [13 x i8], [13 x i8]* %1, i64 0, i64 0
br label %3
3: ; preds = %0, %3
%4 = phi i8 [ %8, %3 ], [ 98, %0 ]
%5 = phi i8* [ %6, %3 ], [ %2, %0 ]
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* %5, i8 signext %4, i8* %2)
%8 = load i8, i8* %6
%9 = icmp eq i8 %8, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i32 0
}