void main() {
  char *s1 = "Do you know?", *s2;
  s2 = "Ok!";
  printf("%s\n%s", s1, s2);
  printf("%s\n%c", s1 + 2, *s2);
  getchar();
  char *p, s[80];
  p = s[0];
  scanf("%s", s);
  printf("%s\n", p);
  scanf("%s", s);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
lea    0xec1(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    0xec3(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
add    $0x2,%rsi
mov    -0x10(%rbp),%rax
movsbl (%rax),%edx
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
movsbq -0x70(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0x70(%rbp),%rsi
lea    0xe78(%rip),%rdi
mov    $0x0,%al
call   1050 <scanf@plt>
mov    -0x18(%rbp),%rsi
lea    0xe6f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x70(%rbp),%rsi
lea    0xe54(%rip),%rdi
mov    $0x0,%al
call   1050 <scanf@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x58,%rsp
lea    0xec3(%rip),%rdi
lea    0xeab(%rip),%rsi
lea    0xeb1(%rip),%rdx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xead(%rip),%rdi
lea    0xe91(%rip),%rsi
mov    $0x4f,%edx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
lea    0xe89(%rip),%rbx
mov    %rsp,%r14
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
xor    %edi,%edi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
add    $0x58,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Do you know?\00"
@.str.1 = [4 x i8] c"Ok!\00"
@.str.2 = [6 x i8] c"%s\0A%s\00"
@.str.3 = [6 x i8] c"%s\0A%c\00"
@.str.4 = [3 x i8] c"%s\00"
@.str.5 = [4 x i8] c"%s\0A\00"
define void @main() {
%1 = alloca i8*
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca [80 x i8]
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8** %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8** %2
%5 = load i8*, i8** %1
%6 = load i8*, i8** %2
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* %5, i8* %6)
%8 = load i8*, i8** %1
%9 = getelementptr inbounds i8, i8* %8, i64 2
%10 = load i8*, i8** %2
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* %9, i32 %12)
%14 = call i32 (...) @getchar()
%15 = getelementptr inbounds [80 x i8], [80 x i8]* %4, i64 0, i64 0
%16 = load i8, i8* %15
%17 = sext i8 %16 to i64
%18 = inttoptr i64 %17 to i8*
store i8* %18, i8** %3
%19 = getelementptr inbounds [80 x i8], [80 x i8]* %4, i64 0, i64 0
%20 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %19)
%21 = load i8*, i8** %3
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* %21)
%23 = getelementptr inbounds [80 x i8], [80 x i8]* %4, i64 0, i64 0
%24 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %23)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"Do you know?\00"
@.str.1 = [4 x i8] c"Ok!\00"
@.str.2 = [6 x i8] c"%s\0A%s\00"
@.str.3 = [6 x i8] c"%s\0A%c\00"
@.str.4 = [3 x i8] c"%s\00"
define void @main() {
%1 = alloca [80 x i8]
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 2), i32 79)
%4 = tail call i32 (...) @getchar()
%5 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%6 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %5)
%7 = call i32 @puts(i8* dereferenceable(1) null)
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %5)
ret void
}