#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 *, ...);
int main() {
  char c, *p;
  char s[9] = "Hardware";
  c = 'A';
  p = &c;
  printf("c: %c\n", c);
  printf("&c: %p\n\n", &c);
  printf("p: %p\n", p);
  printf("*p: %c\n\n", *p);
  *p = 'B';
  printf("c: %c\n", c);
  printf("&c: %p\n\n", &c);
  printf("p: %p\n", p);
  printf("*p: %c\n\n", *p);
  printf("s: %s\n", s);
  printf("s[0]: %c\n", s[0]);
  printf("s[1]: %c\n", s[1]);
  printf("&s[0]: %p\n", &s[0]);
  printf("*s: %c\n", *s);
  printf("*(s+1): %c\n\n", *(s + 1));
  *(s + 3) = 'D';
  *(s + 4) = 'W';
  printf("s: %s\n", s);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x19(%rbp)
mov    0xedf(%rip),%al
mov    %al,-0x11(%rbp)
movb   $0x41,-0x1(%rbp)
lea    -0x1(%rbp),%rax
mov    %rax,-0x10(%rbp)
movsbl -0x1(%rbp),%esi
lea    0xec6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebf(%rip),%rdi
lea    -0x1(%rbp),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
movsbl (%rax),%esi
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
movb   $0x42,(%rax)
movsbl -0x1(%rbp),%esi
lea    0xe74(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe6d(%rip),%rdi
lea    -0x1(%rbp),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
lea    0xe60(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
movsbl (%rax),%esi
lea    0xe52(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x19(%rbp),%rsi
lea    0xe49(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsbl -0x19(%rbp),%esi
lea    0xe3e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsbl -0x18(%rbp),%esi
lea    0xe36(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x19(%rbp),%rsi
lea    0xe2e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsbl -0x19(%rbp),%esi
lea    0xe27(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsbl -0x18(%rbp),%esi
lea    0xe1d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movb   $0x44,-0x16(%rbp)
movb   $0x57,-0x15(%rbp)
lea    -0x19(%rbp),%rsi
lea    0xdd5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x20,%rsp
movabs $0x6572617764726148,%rax
61 72 65
mov    %rax,0x10(%rsp)
movb   $0x0,0x18(%rsp)
movb   $0x41,0xf(%rsp)
lea    0xecc(%rip),%r14
mov    %r14,%rdi
mov    $0x41,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xebd(%rip),%r15
lea    0xf(%rsp),%rbx
mov    %r15,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xead(%rip),%r12
mov    %r12,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
movsbl 0xf(%rsp),%esi
lea    0xe9b(%rip),%r13
mov    %r13,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movb   $0x42,0xf(%rsp)
mov    %r14,%rdi
mov    $0x42,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
movsbl 0xf(%rsp),%esi
mov    %r13,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe56(%rip),%r14
lea    0x10(%rsp),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
movsbl 0x10(%rsp),%esi
lea    0xe3f(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movsbl 0x11(%rsp),%esi
lea    0xe36(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe32(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
movsbl 0x10(%rsp),%esi
lea    0xe27(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movsbl 0x11(%rsp),%esi
lea    0xe1c(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movw   $0x5744,0x13(%rsp)
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.main.s = [9 x i8] c"Hardware\00"
@.str = [7 x i8] c"c: %c\0A\00"
@.str.1 = [9 x i8] c"&c: %p\0A\0A\00"
@.str.2 = [7 x i8] c"p: %p\0A\00"
@.str.3 = [9 x i8] c"*p: %c\0A\0A\00"
@.str.4 = [7 x i8] c"s: %s\0A\00"
@.str.5 = [10 x i8] c"s[0]: %c\0A\00"
@.str.6 = [10 x i8] c"s[1]: %c\0A\00"
@.str.7 = [11 x i8] c"&s[0]: %p\0A\00"
@.str.8 = [8 x i8] c"*s: %c\0A\00"
@.str.9 = [13 x i8] c"*(s+1): %c\0A\0A\00"
define i32 @main() {
%1 = alloca i8
%2 = alloca i8*
%3 = alloca [9 x i8]
%4 = bitcast [9 x i8]* %3 to i8*
store i8 65, i8* %1
store i8* %1, i8** %2
%5 = load i8, i8* %1
%6 = sext i8 %5 to i32
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%9 = load i8*, i8** %2
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* %9)
%11 = load i8*, i8** %2
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 %13)
%15 = load i8*, i8** %2
store i8 66, i8* %15
%16 = load i8, i8* %1
%17 = sext i8 %16 to i32
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %17)
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%20 = load i8*, i8** %2
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* %20)
%22 = load i8*, i8** %2
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 %24)
%26 = getelementptr inbounds [9 x i8], [9 x i8]* %3, i64 0, i64 0
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8* %26)
%28 = getelementptr inbounds [9 x i8], [9 x i8]* %3, i64 0, i64 0
%29 = load i8, i8* %28
%30 = sext i8 %29 to i32
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), i32 %30)
%32 = getelementptr inbounds [9 x i8], [9 x i8]* %3, i64 0, i64 1
%33 = load i8, i8* %32
%34 = sext i8 %33 to i32
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i32 %34)
%36 = getelementptr inbounds [9 x i8], [9 x i8]* %3, i64 0, i64 0
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0), i8* %36)
%38 = getelementptr inbounds [9 x i8], [9 x i8]* %3, i64 0, i64 0
%39 = load i8, i8* %38
%40 = sext i8 %39 to i32
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0), i32 %40)
%42 = getelementptr inbounds [9 x i8], [9 x i8]* %3, i64 0, i64 0
%43 = getelementptr inbounds i8, i8* %42, i64 1
%44 = load i8, i8* %43
%45 = sext i8 %44 to i32
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0), i32 %45)
%47 = getelementptr inbounds [9 x i8], [9 x i8]* %3, i64 0, i64 0
%48 = getelementptr inbounds i8, i8* %47, i64 3
store i8 68, i8* %48
%49 = getelementptr inbounds [9 x i8], [9 x i8]* %3, i64 0, i64 0
%50 = getelementptr inbounds i8, i8* %49, i64 4
store i8 87, i8* %50
%51 = getelementptr inbounds [9 x i8], [9 x i8]* %3, i64 0, i64 0
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8* %51)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s = [9 x i8] c"Hardware\00"
@.str = [7 x i8] c"c: %c\0A\00"
@.str.1 = [9 x i8] c"&c: %p\0A\0A\00"
@.str.2 = [7 x i8] c"p: %p\0A\00"
@.str.3 = [9 x i8] c"*p: %c\0A\0A\00"
@.str.4 = [7 x i8] c"s: %s\0A\00"
@.str.5 = [10 x i8] c"s[0]: %c\0A\00"
@.str.6 = [10 x i8] c"s[1]: %c\0A\00"
@.str.7 = [11 x i8] c"&s[0]: %p\0A\00"
@.str.8 = [8 x i8] c"*s: %c\0A\00"
@.str.9 = [13 x i8] c"*(s+1): %c\0A\0A\00"
define i32 @main() {
%1 = alloca i8
%2 = alloca [9 x i8]
%3 = getelementptr inbounds [9 x i8], [9 x i8]* %2, i64 0, i64 0
store i8 65, i8* %1
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 65)
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* %1)
%7 = load i8, i8* %1
%8 = sext i8 %7 to i32
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 %8)
store i8 66, i8* %1
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 66)
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* %1)
%13 = load i8, i8* %1
%14 = sext i8 %13 to i32
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 %14)
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8* %3)
%17 = load i8, i8* %3
%18 = sext i8 %17 to i32
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), i32 %18)
%20 = getelementptr inbounds [9 x i8], [9 x i8]* %2, i64 0, i64 1
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i32 %22)
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0), i8* %3)
%25 = load i8, i8* %3
%26 = sext i8 %25 to i32
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0), i32 %26)
%28 = load i8, i8* %20
%29 = sext i8 %28 to i32
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0), i32 %29)
%31 = getelementptr inbounds [9 x i8], [9 x i8]* %2, i64 0, i64 3
store i8 68, i8* %31
%32 = getelementptr inbounds [9 x i8], [9 x i8]* %2, i64 0, i64 4
store i8 87, i8* %32
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8* %3)
ret i32 0
}