#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*/ assert(int);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
int main() {
  char a[100], b[100], *p;
  strcpy(a, "asdasd\000");
  assert(strlen(a + 1) == 5);
  p = a + 1;
  assert(strlen(p) == 5);
  a[10] = 0;
  assert(strlen(a) == 6);
  a[3] = 0;
  assert(strlen(a) == 3);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%rsp
lea    -0x70(%rbp),%rdi
lea    0xeba(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x70(%rbp),%rdi
add    $0x1,%rdi
call   1040 <strlen@plt>
cmp    $0x5,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
lea    -0x70(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0xe8(%rbp)
mov    -0xe8(%rbp),%rdi
call   1040 <strlen@plt>
cmp    $0x5,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
movb   $0x0,-0x66(%rbp)
lea    -0x70(%rbp),%rdi
call   1040 <strlen@plt>
cmp    $0x6,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
movb   $0x0,-0x6d(%rbp)
lea    -0x70(%rbp),%rdi
call   1040 <strlen@plt>
cmp    $0x3,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
xor    %eax,%eax
add    $0xf0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x68,%rsp
lea    0xec2(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
call   1030 <strcpy@plt>
lea    0x1(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
xor    %edi,%edi
cmp    $0x5,%eax
sete   %dil
call   1050 <assert@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
xor    %edi,%edi
cmp    $0x5,%eax
sete   %dil
call   1050 <assert@plt>
movb   $0x0,0xa(%rsp)
mov    %r14,%rdi
call   1040 <strlen@plt>
xor    %edi,%edi
cmp    $0x6,%eax
sete   %dil
call   1050 <assert@plt>
movb   $0x0,0x3(%rsp)
mov    %r14,%rdi
call   1040 <strlen@plt>
xor    %edi,%edi
cmp    $0x3,%eax
sete   %dil
call   1050 <assert@plt>
xor    %eax,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [8 x i8] c"asdasd\00\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = alloca [100 x i8]
%3 = alloca i8*
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%5 = call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = call i32 @strlen(i8* %7)
%9 = icmp eq i32 %8, 5
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%13 = getelementptr inbounds i8, i8* %12, i64 1
store i8* %13, i8** %3
%14 = load i8*, i8** %3
%15 = call i32 @strlen(i8* %14)
%16 = icmp eq i32 %15, 5
%17 = zext i1 %16 to i32
%18 = call i32 @assert(i32 %17)
%19 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 10
store i8 0, i8* %19
%20 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%21 = call i32 @strlen(i8* %20)
%22 = icmp eq i32 %21, 6
%23 = zext i1 %22 to i32
%24 = call i32 @assert(i32 %23)
%25 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 3
store i8 0, i8* %25
%26 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%27 = call i32 @strlen(i8* %26)
%28 = icmp eq i32 %27, 3
%29 = zext i1 %28 to i32
%30 = call i32 @assert(i32 %29)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"asdasd\00\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 1
%5 = call i32 @strlen(i8* %4)
%6 = icmp eq i32 %5, 5
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = call i32 @strlen(i8* %4)
%10 = icmp eq i32 %9, 5
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 10
store i8 0, i8* %13
%14 = call i32 @strlen(i8* %2)
%15 = icmp eq i32 %14, 6
%16 = zext i1 %15 to i32
%17 = call i32 @assert(i32 %16)
%18 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 3
store i8 0, i8* %18
%19 = call i32 @strlen(i8* %2)
%20 = icmp eq i32 %19, 3
%21 = zext i1 %20 to i32
%22 = call i32 @assert(i32 %21)
ret i32 0
}