#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 *, char *, char const *, char *, char *, char *,
                          char const *, char *, char *, char *, char const *,
                          char *, char *);
char *strlen(char const *);
void fig08_35() {
  const char *string1 = "abcdefghijklmnopqrstuvwxyz";
  const char *string2 = "four";
  const char *string3 = "Boston";
  printf("%s\"%s\"%s%u\n%s\"%s\"%s%u\n%s\"%s\"%s%u\n", "The length of ",
         string1, " is ", strlen(string1), "The length of ", string2, " is ",
         strlen(string2), "The length of ", string3, " is ", strlen(string3));
}


x86 assembly (clang, -O0):
<fig08_35>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %rbx
sub    $0x68,%rsp
lea    0xecc(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    0xedc(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    0xed6(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x40(%rbp)
mov    -0x28(%rbp),%r15
mov    -0x28(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%r14
mov    -0x30(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x30(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x48(%rbp),%rdx
mov    -0x40(%rbp),%r8
mov    -0x38(%rbp),%r11
lea    0xe90(%rip),%rdi
lea    0xeab(%rip),%rbx
lea    0xeb3(%rip),%r10
mov    %rbx,%rsi
mov    %r10,%rcx
mov    %rbx,%r9
mov    %r15,(%rsp)
mov    %r10,0x8(%rsp)
mov    %r14,0x10(%rsp)
mov    %rbx,0x18(%rsp)
mov    %r11,0x20(%rsp)
mov    %r10,0x28(%rsp)
mov    %rax,0x30(%rsp)
call   1040 <printf@plt>
add    $0x68,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<fig08_35>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
lea    0xed0(%rip),%r15
mov    %r15,%rdi
call   1030 <strlen@plt>
mov    %rax,%rbx
lea    0xed9(%rip),%r14
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %rax,%r12
lea    0xecc(%rip),%r13
mov    %r13,%rdi
call   1030 <strlen@plt>
sub    $0x8,%rsp
lea    0xef1(%rip),%rcx
lea    0xedb(%rip),%rsi
lea    0xeb2(%rip),%rdi
mov    %r15,%rdx
mov    %rbx,%r8
mov    %rsi,%r9
push   %rax
push   %rcx
push   %r13
push   %rsi
push   %r12
push   %rcx
push   %r14
call   1040 <printf@plt>
add    $0x40,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [27 x i8] c"abcdefghijklmnopqrstuvwxyz\00"
@.str.1 = [5 x i8] c"four\00"
@.str.2 = [7 x i8] c"Boston\00"
@.str.3 = [34 x i8] c"%s\22%s\22%s%u\0A%s\22%s\22%s%u\0A%s\22%s\22%s%u\0A\00"
@.str.4 = [15 x i8] c"The length of \00"
@.str.5 = [5 x i8] c" is \00"
define void @fig08_35() {
%1 = alloca i8*
%2 = alloca i8*
%3 = alloca i8*
store i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8** %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8** %2
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8** %3
%4 = load i8*, i8** %1
%5 = load i8*, i8** %1
%6 = call i8* @strlen(i8* %5)
%7 = load i8*, i8** %2
%8 = load i8*, i8** %2
%9 = call i8* @strlen(i8* %8)
%10 = load i8*, i8** %3
%11 = load i8*, i8** %3
%12 = call i8* @strlen(i8* %11)
%13 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i8* %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i8* %6, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i8* %7, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i8* %9, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i8* %10, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i8* %12)
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"abcdefghijklmnopqrstuvwxyz\00"
@.str.1 = [5 x i8] c"four\00"
@.str.2 = [7 x i8] c"Boston\00"
@.str.3 = [34 x i8] c"%s\22%s\22%s%u\0A%s\22%s\22%s%u\0A%s\22%s\22%s%u\0A\00"
@.str.4 = [15 x i8] c"The length of \00"
@.str.5 = [5 x i8] c" is \00"
define void @fig08_35() {
%1 = tail call i8* @strlen(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%2 = tail call i8* @strlen(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i8* @strlen(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i8* %1, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i8* %2, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i8* %3)
ret void
}