#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 *, ...);
void full_arr(char *arr) {
  int i = 0;
  printf("\nin full_arr:\n");
  for (i = 0; i < 10; i++) {
    *(arr + i) = 0;
    printf("arr [ %d ] = '%c' and %d;\n", i, *(arr + i), *(arr + i));
  }
  printf("after full_arr.\n\n");
}


x86 assembly (clang, -O0):
<full_arr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
lea    0xed6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    1185 <full_arr+0x75>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
lea    0xe9f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1138 <full_arr+0x28>
lea    0xe9e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<full_arr>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xeed(%rip),%rdi
call   1030 <puts@plt>
movb   $0x0,(%rbx)
lea    0xec3(%rip),%r14
mov    %r14,%rdi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
movb   $0x0,0x1(%rbx)
mov    %r14,%rdi
mov    $0x1,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
movb   $0x0,0x2(%rbx)
mov    %r14,%rdi
mov    $0x2,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
movb   $0x0,0x3(%rbx)
mov    %r14,%rdi
mov    $0x3,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
movb   $0x0,0x4(%rbx)
mov    %r14,%rdi
mov    $0x4,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
movb   $0x0,0x5(%rbx)
mov    %r14,%rdi
mov    $0x5,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
movb   $0x0,0x6(%rbx)
mov    %r14,%rdi
mov    $0x6,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
movb   $0x0,0x7(%rbx)
mov    %r14,%rdi
mov    $0x7,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
movb   $0x0,0x8(%rbx)
mov    %r14,%rdi
mov    $0x8,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
movb   $0x0,0x9(%rbx)
mov    %r14,%rdi
mov    $0x9,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe06(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"\0Ain full_arr:\0A\00"
@.str.1 = [27 x i8] c"arr [ %d ] = '%c' and %d;\0A\00"
@.str.2 = [18 x i8] c"after full_arr.\0A\0A\00"
define void @full_arr(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %5
5: ; preds = %27, %1
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 10
br i1 %7, label %8, label %30
8: ; preds = %5
%9 = load i8*, i8** %2
%10 = load i32, i32* %3
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %9, i64 %11
store i8 0, i8* %12
%13 = load i32, i32* %3
%14 = load i8*, i8** %2
%15 = load i32, i32* %3
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %14, i64 %16
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = load i8*, i8** %2
%21 = load i32, i32* %3
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i8, i8* %20, i64 %22
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %13, i32 %19, i32 %25)
br label %27
27: ; preds = %8
%28 = load i32, i32* %3
%29 = add nsw i32 %28, 1
store i32 %29, i32* %3
br label %5
30: ; preds = %5
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [27 x i8] c"arr [ %d ] = '%c' and %d;\0A\00"
@str = [14 x i8] c"\0Ain full_arr:\00"
@str.3 = [17 x i8] c"after full_arr.\0A\00"
define void @full_arr(i8* nocapture writeonly %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
store i8 0, i8* %0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 0, i32 0, i32 0)
%4 = getelementptr inbounds i8, i8* %0, i64 1
store i8 0, i8* %4
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 1, i32 0, i32 0)
%6 = getelementptr inbounds i8, i8* %0, i64 2
store i8 0, i8* %6
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 2, i32 0, i32 0)
%8 = getelementptr inbounds i8, i8* %0, i64 3
store i8 0, i8* %8
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 3, i32 0, i32 0)
%10 = getelementptr inbounds i8, i8* %0, i64 4
store i8 0, i8* %10
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 4, i32 0, i32 0)
%12 = getelementptr inbounds i8, i8* %0, i64 5
store i8 0, i8* %12
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 5, i32 0, i32 0)
%14 = getelementptr inbounds i8, i8* %0, i64 6
store i8 0, i8* %14
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 6, i32 0, i32 0)
%16 = getelementptr inbounds i8, i8* %0, i64 7
store i8 0, i8* %16
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 7, i32 0, i32 0)
%18 = getelementptr inbounds i8, i8* %0, i64 8
store i8 0, i8* %18
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 8, i32 0, i32 0)
%20 = getelementptr inbounds i8, i8* %0, i64 9
store i8 0, i8* %20
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 9, i32 0, i32 0)
%22 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.3, i64 0, i64 0))
ret void
}