#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 */
typedef int /*<<< orphan*/ pa;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void fa(void) {
  int i;
  char a[5] = {'a', 'b', 'c', 'd', 'e'};
  char *pa = a;
  printf("size: *pa=%d, pa=%d\n", sizeof(*pa), sizeof(pa));
  for (i = 0; i < 5; i++) {
    printf("a: addr=%p, data=%c\n", pa, *pa);
    pa++;
  }
}


x86 assembly (clang, -O0):
<fa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xee2(%rip),%eax
mov    %eax,-0x9(%rbp)
mov    0xedd(%rip),%al
mov    %al,-0x5(%rbp)
lea    -0x9(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    0xecc(%rip),%rdi
mov    $0x1,%esi
mov    $0x8,%edx
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
cmpl   $0x5,-0x4(%rbp)
jge    118e <fa+0x7e>
mov    -0x18(%rbp),%rsi
mov    -0x18(%rbp),%rax
movsbl (%rax),%edx
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1151 <fa+0x41>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fa>:
push   %r14
push   %rbx
push   %rax
movb   $0x65,0x4(%rsp)
movl   $0x64636261,(%rsp)
lea    0x4(%rsp),%r14
lea    0xed9(%rip),%rdi
mov    $0x1,%esi
mov    $0x8,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed6(%rip),%rbx
mov    %rsp,%rsi
mov    %rbx,%rdi
mov    $0x61,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x1(%rsp),%rsi
movsbl 0x1(%rsp),%edx
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x2(%rsp),%rsi
movsbl 0x2(%rsp),%edx
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x3(%rsp),%rsi
movsbl 0x3(%rsp),%edx
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movsbl 0x4(%rsp),%edx
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.fa.a = [5 x i8] c"abcde"
@.str = [21 x i8] c"size: *pa=%d, pa=%d\0A\00"
@.str.1 = [21 x i8] c"a: addr=%p, data=%c\0A\00"
define void @fa() {
%1 = alloca i32
%2 = alloca [5 x i8]
%3 = alloca i8*
%4 = bitcast [5 x i8]* %2 to i8*
%5 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
store i8* %5, i8** %3
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i64 1, i64 8)
store i32 0, i32* %1
br label %7
7: ; preds = %18, %0
%8 = load i32, i32* %1
%9 = icmp slt i32 %8, 5
br i1 %9, label %10, label %21
10: ; preds = %7
%11 = load i8*, i8** %3
%12 = load i8*, i8** %3
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* %11, i32 %14)
%16 = load i8*, i8** %3
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %3
br label %18
18: ; preds = %10
%19 = load i32, i32* %1
%20 = add nsw i32 %19, 1
store i32 %20, i32* %1
br label %7
21: ; preds = %7
ret void
}

LLVM IR (-O2):
@__const.fa.a = [5 x i8] c"abcde"
@.str = [21 x i8] c"size: *pa=%d, pa=%d\0A\00"
@.str.1 = [21 x i8] c"a: addr=%p, data=%c\0A\00"
define void @fa() {
%1 = alloca [5 x i8]
%2 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i64 1, i64 8)
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* %2, i32 97)
%5 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 1
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* %5, i32 %7)
%9 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 2
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* %9, i32 %11)
%13 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 3
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* %13, i32 %15)
%17 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 4
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* %17, i32 %19)
ret void
}