#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 strlen(char *);
int main(int argc, char *argv[]) {
  char buf[32] = "helloworld";
  char buff[64];
  char *p = "";
  buff[0] = 0;
  assert(strlen(buf) == 10);
  assert(strlen(buff) == 0);
  assert(strlen(p) == 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xec0(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xebd(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xeba(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeb7(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    0xeb4(%rip),%rax
mov    %rax,-0x78(%rbp)
movb   $0x0,-0x70(%rbp)
lea    -0x30(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0xa,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    -0x70(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x78(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x68,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,(%rsp)
movb   $0x0,0x20(%rsp)
mov    %rsp,%rdi
call   1030 <strlen@plt>
xor    %edi,%edi
cmp    $0xa,%eax
sete   %dil
call   1040 <assert@plt>
lea    0x20(%rsp),%rdi
call   1030 <strlen@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1040 <assert@plt>
lea    0xeac(%rip),%rdi
call   1030 <strlen@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x68,%rsp
ret

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

LLVM IR (-O2):
@__const.main.buf = [32 x i8] c"helloworld\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [1 x i8] zeroinitializer
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [32 x i8]
%4 = alloca [64 x i8]
%5 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [64 x i8], [64 x i8]* %4, i64 0, i64 0
store i8 0, i8* %6
%7 = call i32 @strlen(i8* %5)
%8 = icmp eq i32 %7, 10
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = call i32 @strlen(i8* %6)
%12 = icmp eq i32 %11, 0
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
%15 = call i32 @strlen(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%16 = icmp eq i32 %15, 0
%17 = zext i1 %16 to i32
%18 = call i32 @assert(i32 %17)
ret i32 0
}