#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*/ getchar();
int /*<<< orphan*/ printf(char *, int, int, int, int, int);
int strlen(char *);
main() {
  char name1[] = "Sharon";
  char name2[10] = "Mark";
  char *name = "Patrick";
  int len = strlen(name1);
  printf("1: %d\n2: %d\n3: %d\n4: %d\n5: %d\n", strlen(name1), strlen(name2),
         strlen(name), strlen("Rob"), len);
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xec2(%rip),%eax
mov    %eax,-0x7(%rbp)
mov    0xebc(%rip),%ax
mov    %ax,-0x3(%rbp)
mov    0xeb4(%rip),%al
mov    %al,-0x1(%rbp)
mov    0xed6(%rip),%rax
mov    %rax,-0x11(%rbp)
mov    0xed3(%rip),%ax
mov    %ax,-0x9(%rbp)
lea    0xe95(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    -0x7(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x24(%rbp)
lea    -0x7(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x30(%rbp)
lea    -0x11(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x28(%rbp)
lea    0xe81(%rip),%rdi
call   1030 <strlen@plt>
mov    -0x30(%rbp),%esi
mov    -0x2c(%rbp),%edx
mov    -0x28(%rbp),%ecx
mov    %eax,%r8d
mov    -0x24(%rbp),%r9d
lea    0xe46(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x18,%rsp
movl   $0x6e6f72,0x3(%rsp)
movl   $0x72616853,(%rsp)
movw   $0x0,0x10(%rsp)
movq   $0x6b72614d,0x8(%rsp)
72 6b
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %eax,%r14d
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %eax,%r15d
lea    0x8(%rsp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ebp
lea    0xe82(%rip),%rdi
call   1030 <strlen@plt>
mov    %eax,%ebx
lea    0xe9b(%rip),%rdi
call   1030 <strlen@plt>
lea    0xe70(%rip),%rdi
mov    %r15d,%esi
mov    %ebp,%edx
mov    %ebx,%ecx
mov    %eax,%r8d
mov    %r14d,%r9d
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.main.name1 = [7 x i8] c"Sharon\00"
@__const.main.name2 = [10 x i8] c"Mark\00\00\00\00\00\00"
@.str = [8 x i8] c"Patrick\00"
@.str.1 = [31 x i8] c"1: %d\0A2: %d\0A3: %d\0A4: %d\0A5: %d\0A\00"
@.str.2 = [4 x i8] c"Rob\00"
define i32 @main() {
%1 = alloca [7 x i8]
%2 = alloca [10 x i8]
%3 = alloca i8*
%4 = alloca i32
%5 = bitcast [7 x i8]* %1 to i8*
%6 = bitcast [10 x i8]* %2 to i8*
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8** %3
%7 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 0
%8 = call i32 @strlen(i8* %7)
store i32 %8, i32* %4
%9 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 0
%10 = call i32 @strlen(i8* %9)
%11 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%12 = call i32 @strlen(i8* %11)
%13 = load i8*, i8** %3
%14 = call i32 @strlen(i8* %13)
%15 = call i32 @strlen(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%16 = load i32, i32* %4
%17 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i32 %10, i32 %12, i32 %14, i32 %15, i32 %16)
%18 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@__const.main.name1 = [7 x i8] c"Sharon\00"
@__const.main.name2 = [10 x i8] c"Mark\00\00\00\00\00\00"
@.str = [8 x i8] c"Patrick\00"
@.str.1 = [31 x i8] c"1: %d\0A2: %d\0A3: %d\0A4: %d\0A5: %d\0A\00"
@.str.2 = [4 x i8] c"Rob\00"
define i32 @main() {
%1 = alloca [7 x i8]
%2 = alloca [10 x i8]
%3 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%5 = call i32 @strlen(i8* %3)
%6 = call i32 @strlen(i8* %3)
%7 = call i32 @strlen(i8* %4)
%8 = call i32 @strlen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @strlen(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i32 %6, i32 %7, i32 %8, i32 %9, i32 %5)
%11 = call i32 (...) @getchar()
ret i32 0
}