int main() {
  show_intro();
  double number1 = 7.3, number2;
  char s1[100], s2[100];
  double *dPtr;
  dPtr = &number1;
  printf("[4]\t[dPtr(number1):\t%lf\t]\n", *dPtr);
  number2 = *dPtr;
  printf("[6]\t[number2:\t%lf\t]\n", number2);
  printf("[7]\t[addr(number1):\t%p\t]\n", &number1);
  printf("[8]\t[addr(dPtr):\t%p\t]\n", &dPtr);
  printf("[9]\t[Nao. dPtr tem HEX-8 acrescido\t]\n");
  printf("\t[ao valor do end. de number1.\t]\n");
  scanf("%s", s1);
  strcpy(s2, s1);
  printf("[10]\t[strcmp(s1,s2):\t%d\t\t]\n", strcmp(s1, s2));
  printf("[11]\t[strcat(s1,s2):\t%s\t]\n", strcat(s1, s2));
  printf("[12]\t[Aparentemente, nao. Casos de\t]\n");
  printf("\t[teste mostram que mesmo que\t]\n");
  printf("\t[o buffer seja ultrapassado,\t]\n");
  printf("\t[concatenar nao provocara erro.\t]\n");
  printf("[13]\t[strlen(s1):\t%zd\t\t]\n", strlen(s1));
  show_end_program();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <show_intro@plt>
movsd  0xe5f(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0xf8(%rbp)
mov    -0xf8(%rbp),%rax
movsd  (%rax),%xmm0
lea    0xe45(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    -0xf8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
lea    0xe3d(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
lea    0xe44(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe4c(%rip),%rdi
lea    -0xf8(%rbp),%rsi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe4e(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe66(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x80(%rbp),%rsi
lea    0xe76(%rip),%rdi
mov    $0x0,%al
call   1080 <scanf@plt>
lea    -0xf0(%rbp),%rdi
lea    -0x80(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x80(%rbp),%rdi
lea    -0xf0(%rbp),%rsi
call   1070 <strcmp@plt>
mov    %eax,%esi
lea    0xe49(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x80(%rbp),%rdi
lea    -0xf0(%rbp),%rsi
call   1090 <strcat@plt>
mov    %rax,%rsi
lea    0xe44(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe51(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe69(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe7c(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe8f(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x80(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rsi
lea    0xe99(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x0,%al
call   10a0 <show_end_program@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0xe8,%rsp
xor    %eax,%eax
call   1070 <show_intro@plt>
movabs $0x401d333333333333,%rax
33 1d 40
mov    %rax,(%rsp)
mov    %rsp,%rbx
mov    %rbx,0x8(%rsp)
lea    0xe4a(%rip),%rdi
movsd  0xe3a(%rip),%xmm0
mov    $0x1,%al
call   1060 <printf@plt>
movsd  (%rsp),%xmm0
lea    0xe4a(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
lea    0xe51(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xe5a(%rip),%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xeb2(%rip),%rdi
call   1040 <puts@plt>
lea    0xecb(%rip),%rdi
call   1040 <puts@plt>
lea    0xe46(%rip),%rdi
lea    0x80(%rsp),%r14
mov    %r14,%rsi
xor    %eax,%eax
call   1090 <scanf@plt>
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1080 <strcmp@plt>
lea    0xe15(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   10a0 <strcat@plt>
lea    0xe16(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xe80(%rip),%rdi
call   1040 <puts@plt>
lea    0xe99(%rip),%rdi
call   1040 <puts@plt>
lea    0xead(%rip),%rdi
call   1040 <puts@plt>
lea    0xec1(%rip),%rdi
call   1040 <puts@plt>
mov    %r14,%rdi
call   1050 <strlen@plt>
lea    0xde8(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
xor    %eax,%eax
call   10b0 <show_end_program@plt>
xor    %eax,%eax
add    $0xe8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [27 x i8] c"[4]\09[dPtr(number1):\09%lf\09]\0A\00"
@.str.1 = [21 x i8] c"[6]\09[number2:\09%lf\09]\0A\00"
@.str.2 = [26 x i8] c"[7]\09[addr(number1):\09%p\09]\0A\00"
@.str.3 = [23 x i8] c"[8]\09[addr(dPtr):\09%p\09]\0A\00"
@.str.4 = [38 x i8] c"[9]\09[Nao. dPtr tem HEX-8 acrescido\09]\0A\00"
@.str.5 = [34 x i8] c"\09[ao valor do end. de number1.\09]\0A\00"
@.str.6 = [3 x i8] c"%s\00"
@.str.7 = [28 x i8] c"[10]\09[strcmp(s1,s2):\09%d\09\09]\0A\00"
@.str.8 = [27 x i8] c"[11]\09[strcat(s1,s2):\09%s\09]\0A\00"
@.str.9 = [38 x i8] c"[12]\09[Aparentemente, nao. Casos de\09]\0A\00"
@.str.10 = [33 x i8] c"\09[teste mostram que mesmo que\09]\0A\00"
@.str.11 = [33 x i8] c"\09[o buffer seja ultrapassado,\09]\0A\00"
@.str.12 = [36 x i8] c"\09[concatenar nao provocara erro.\09]\0A\00"
@.str.13 = [26 x i8] c"[13]\09[strlen(s1):\09%zd\09\09]\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca [100 x i8]
%5 = alloca [100 x i8]
%6 = alloca double*
store i32 0, i32* %1
%7 = call i32 (...) @show_intro()
store double 7.300000e+00, double* %2
store double* %2, double** %6
%8 = load double*, double** %6
%9 = load double, double* %8
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), double %9)
%11 = load double*, double** %6
%12 = load double, double* %11
store double %12, double* %3
%13 = load double, double* %3
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), double %13)
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), double* %2)
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), double** %6)
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.4, i64 0, i64 0))
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.5, i64 0, i64 0))
%19 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%20 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8* %19)
%21 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%22 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%23 = call i8* @strcpy(i8* %21, i8* %22)
%24 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%25 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%26 = call i32 @strcmp(i8* %24, i8* %25)
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.7, i64 0, i64 0), i32 %26)
%28 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%29 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%30 = call i8* @strcat(i8* %28, i8* %29)
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.8, i64 0, i64 0), i8* %30)
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.9, i64 0, i64 0))
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.10, i64 0, i64 0))
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.11, i64 0, i64 0))
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.12, i64 0, i64 0))
%36 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%37 = call i64 @strlen(i8* %36)
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.13, i64 0, i64 0), i64 %37)
%39 = call i32 (...) @show_end_program()
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"[4]\09[dPtr(number1):\09%lf\09]\0A\00"
@.str.1 = [21 x i8] c"[6]\09[number2:\09%lf\09]\0A\00"
@.str.2 = [26 x i8] c"[7]\09[addr(number1):\09%p\09]\0A\00"
@.str.3 = [23 x i8] c"[8]\09[addr(dPtr):\09%p\09]\0A\00"
@.str.6 = [3 x i8] c"%s\00"
@.str.7 = [28 x i8] c"[10]\09[strcmp(s1,s2):\09%d\09\09]\0A\00"
@.str.8 = [27 x i8] c"[11]\09[strcat(s1,s2):\09%s\09]\0A\00"
@.str.13 = [26 x i8] c"[13]\09[strlen(s1):\09%zd\09\09]\0A\00"
@str = [37 x i8] c"[9]\09[Nao. dPtr tem HEX-8 acrescido\09]\00"
@str.14 = [33 x i8] c"\09[ao valor do end. de number1.\09]\00"
@str.15 = [37 x i8] c"[12]\09[Aparentemente, nao. Casos de\09]\00"
@str.16 = [32 x i8] c"\09[teste mostram que mesmo que\09]\00"
@str.17 = [32 x i8] c"\09[o buffer seja ultrapassado,\09]\00"
@str.18 = [35 x i8] c"\09[concatenar nao provocara erro.\09]\00"
define i32 @main() {
%1 = alloca double
%2 = alloca [100 x i8]
%3 = alloca [100 x i8]
%4 = alloca double*
%5 = tail call i32 (...) @show_intro()
%6 = bitcast double* %1 to i8*
store double 7.300000e+00, double* %1
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%9 = bitcast double** %4 to i8*
store double* %1, double** %4
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), double 7.300000e+00)
%11 = load double, double* %1
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), double %11)
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), double* %1)
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), double** %4)
%15 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
%16 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.14, i64 0, i64 0))
%17 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8* %7)
%18 = call i8* @strcpy(i8* %8, i8* %7)
%19 = call i32 @strcmp(i8* %7, i8* %8)
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.7, i64 0, i64 0), i32 %19)
%21 = call i8* @strcat(i8* %7, i8* %8)
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.8, i64 0, i64 0), i8* %7)
%23 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.15, i64 0, i64 0))
%24 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.16, i64 0, i64 0))
%25 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.17, i64 0, i64 0))
%26 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.18, i64 0, i64 0))
%27 = call i64 @strlen(i8* %7)
%28 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.13, i64 0, i64 0), i64 %27)
%29 = call i32 (...) @show_end_program()
ret i32 0
}