#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 *, ...);
main() {
  char s[] = "Bouquets and Brickbats";
  printf("\n%c ", *(&s[2]));
  printf("%s, ", s + 5);
  printf("\n%s", s);
  printf("\n%c", *(s + 2));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xedc(%rip),%eax
mov    %eax,-0x10(%rbp)
mov    0xed6(%rip),%ax
mov    %ax,-0xc(%rbp)
mov    0xece(%rip),%al
mov    %al,-0xa(%rbp)
movsbl -0x1e(%rbp),%esi
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x20(%rbp),%rsi
add    $0x5,%rsi
lea    0xeb0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x20(%rbp),%rsi
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsbl -0x1e(%rbp),%esi
lea    0xe95(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,(%rsp)
movabs $0x737461626b6369,%rax
mov    %rax,0xf(%rsp)
lea    0xee2(%rip),%rdi
mov    $0x75,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x5(%rsp),%rsi
lea    0xecf(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xec6(%rip),%rdi
mov    %rsp,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
movsbl 0x2(%rsp),%esi
lea    0xeb4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.s = [23 x i8] c"Bouquets and Brickbats\00"
@.str = [5 x i8] c"\0A%c \00"
@.str.1 = [5 x i8] c"%s, \00"
@.str.2 = [4 x i8] c"\0A%s\00"
@.str.3 = [4 x i8] c"\0A%c\00"
define i32 @main() {
%1 = alloca [23 x i8]
%2 = bitcast [23 x i8]* %1 to i8*
%3 = getelementptr inbounds [23 x i8], [23 x i8]* %1, i64 0, i64 2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = getelementptr inbounds [23 x i8], [23 x i8]* %1, i64 0, i64 0
%8 = getelementptr inbounds i8, i8* %7, i64 5
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %8)
%10 = getelementptr inbounds [23 x i8], [23 x i8]* %1, i64 0, i64 0
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %10)
%12 = getelementptr inbounds [23 x i8], [23 x i8]* %1, i64 0, i64 0
%13 = getelementptr inbounds i8, i8* %12, i64 2
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %15)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s = [23 x i8] c"Bouquets and Brickbats\00"
@.str = [5 x i8] c"\0A%c \00"
@.str.1 = [5 x i8] c"%s, \00"
@.str.2 = [4 x i8] c"\0A%s\00"
@.str.3 = [4 x i8] c"\0A%c\00"
define i32 @main() {
%1 = alloca [23 x i8]
%2 = getelementptr inbounds [23 x i8], [23 x i8]* %1, i64 0, i64 0
%3 = getelementptr inbounds [23 x i8], [23 x i8]* %1, i64 0, i64 2
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 117)
%5 = getelementptr inbounds [23 x i8], [23 x i8]* %1, i64 0, i64 5
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %2)
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %9)
ret i32 0
}