#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*/ arr;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ strncpy(char *, char *, int);
int main(void) {
  char arr[] = "Blueberries";
  printf("%s (%zd != %zd)\n", arr, sizeof(arr), strlen(arr));
  strncpy(arr, "Rasp", 4);
  arr[8] = 'y';
  arr[9] = '\0';
  printf("%s (%zd != %zd)\n", arr, sizeof(arr), strlen(arr));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xec1(%rip),%rax
mov    %rax,-0xc(%rbp)
mov    0xebf(%rip),%eax
mov    %eax,-0x4(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    -0xc(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rsi
mov    %eax,%ecx
lea    0xea2(%rip),%rdi
mov    $0xc,%edx
call   1050 <printf@plt>
lea    -0xc(%rbp),%rdi
lea    0xe9e(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncpy@plt>
movb   $0x79,-0x4(%rbp)
movb   $0x0,-0x3(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0xc(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x18(%rbp),%rsi
mov    %eax,%ecx
lea    0xe5d(%rip),%rdi
mov    $0xc,%edx
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
movabs $0x7272656265756c42,%rax
65 72 72
mov    %rax,0x8(%rsp)
movl   $0x736569,0x10(%rsp)
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
lea    0xeaa(%rip),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0xc,%edx
mov    %eax,%ecx
call   1050 <printf@plt>
lea    0xea2(%rip),%rsi
mov    %rbx,%rdi
mov    $0x4,%edx
call   1030 <strncpy@plt>
movw   $0x79,0x10(%rsp)
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0xc,%edx
mov    %eax,%ecx
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.arr = [12 x i8] c"Blueberries\00"
@.str = [17 x i8] c"%s (%zd != %zd)\0A\00"
@.str.1 = [5 x i8] c"Rasp\00"
define i32 @main() {
%1 = alloca [12 x i8]
%2 = bitcast [12 x i8]* %1 to i8*
%3 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 0
%5 = call i32 @strlen(i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %3, i32 12, i32 %5)
%7 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 0
%8 = call i32 @strncpy(i8* %7, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 4)
%9 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 8
store i8 121, i8* %9
%10 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 9
store i8 0, i8* %10
%11 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 0
%12 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 0
%13 = call i32 @strlen(i8* %12)
%14 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %11, i32 12, i32 %13)
ret i32 0
}

LLVM IR (-O2):
@__const.main.arr = [12 x i8] c"Blueberries\00"
@.str = [17 x i8] c"%s (%zd != %zd)\0A\00"
@.str.1 = [5 x i8] c"Rasp\00"
define i32 @main() {
%1 = alloca [12 x i8]
%2 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 0
%3 = call i32 @strlen(i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %2, i32 12, i32 %3)
%5 = call i32 @strncpy(i8* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 4)
%6 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 8
store i8 121, i8* %6
%7 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 9
store i8 0, i8* %7
%8 = call i32 @strlen(i8* %2)
%9 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %2, i32 12, i32 %8)
ret i32 0
}