int main() {
  char s1[40 + 1], s2[40 + 1];
  char s3[] = "Teste...";
  printf("Tamanho de S3: %d\n", strlen(s3));
  printf("Digite uma frase:\n");
  scanf("%40[^\n]", s1);
  strcpy(s2, "dia de sol");
  printf("\ns2: %s\n\n", s2);
  strcat(s1, " ");
  strcat(s1, s2);
  printf("\ns1: %s\n\n", s1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xe9a(%rip),%rax
mov    %rax,-0x69(%rbp)
mov    0xe98(%rip),%al
mov    %al,-0x61(%rbp)
lea    -0x69(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rsi
lea    0xe83(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe88(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x30(%rbp),%rsi
lea    0xe89(%rip),%rdi
mov    $0x0,%al
call   1060 <scanf@plt>
lea    -0x60(%rbp),%rdi
lea    0xe7f(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x60(%rbp),%rsi
lea    0xe7a(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x30(%rbp),%rdi
lea    0xe72(%rip),%rsi
call   1070 <strcat@plt>
lea    -0x30(%rbp),%rdi
lea    -0x60(%rbp),%rsi
call   1070 <strcat@plt>
lea    -0x30(%rbp),%rsi
lea    0xe57(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x68,%rsp
lea    0xea2(%rip),%rdi
mov    $0x8,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xec9(%rip),%rdi
call   1030 <puts@plt>
lea    0xe96(%rip),%rdi
lea    0x30(%rsp),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
movabs $0x7320656420616964,%rax
65 20 73
mov    %rax,(%rsp)
movl   $0x6c6f73,0x7(%rsp)
lea    0xe7d(%rip),%rdi
mov    %rsp,%r14
mov    %r14,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
movw   $0x20,0x30(%rsp,%rax,1)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1070 <strcat@plt>
lea    0xe59(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.s3 = [9 x i8] c"Teste...\00"
@.str = [19 x i8] c"Tamanho de S3: %d\0A\00"
@.str.1 = [19 x i8] c"Digite uma frase:\0A\00"
@.str.2 = [8 x i8] c"%40[^\0A]\00"
@.str.3 = [11 x i8] c"dia de sol\00"
@.str.4 = [10 x i8] c"\0As2: %s\0A\0A\00"
@.str.5 = [2 x i8] c" \00"
@.str.6 = [10 x i8] c"\0As1: %s\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [41 x i8]
%3 = alloca [41 x i8]
%4 = alloca [9 x i8]
store i32 0, i32* %1
%5 = bitcast [9 x i8]* %4 to i8*
%6 = getelementptr inbounds [9 x i8], [9 x i8]* %4, i64 0, i64 0
%7 = call i64 @strlen(i8* %6)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i64 %7)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%10 = getelementptr inbounds [41 x i8], [41 x i8]* %2, i64 0, i64 0
%11 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* %10)
%12 = getelementptr inbounds [41 x i8], [41 x i8]* %3, i64 0, i64 0
%13 = call i8* @strcpy(i8* %12, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
%14 = getelementptr inbounds [41 x i8], [41 x i8]* %3, i64 0, i64 0
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i8* %14)
%16 = getelementptr inbounds [41 x i8], [41 x i8]* %2, i64 0, i64 0
%17 = call i8* @strcat(i8* %16, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%18 = getelementptr inbounds [41 x i8], [41 x i8]* %2, i64 0, i64 0
%19 = getelementptr inbounds [41 x i8], [41 x i8]* %3, i64 0, i64 0
%20 = call i8* @strcat(i8* %18, i8* %19)
%21 = getelementptr inbounds [41 x i8], [41 x i8]* %2, i64 0, i64 0
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i8* %21)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"Tamanho de S3: %d\0A\00"
@.str.2 = [8 x i8] c"%40[^\0A]\00"
@.str.3 = [11 x i8] c"dia de sol\00"
@.str.4 = [10 x i8] c"\0As2: %s\0A\0A\00"
@.str.6 = [10 x i8] c"\0As1: %s\0A\0A\00"
@str = [18 x i8] c"Digite uma frase:\00"
define i32 @main() {
%1 = alloca [41 x i8]
%2 = alloca [41 x i8]
%3 = getelementptr inbounds [41 x i8], [41 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [41 x i8], [41 x i8]* %2, i64 0, i64 0
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i64 8)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%7 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* %3)
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i8* %4)
%9 = call i64 @strlen(i8* %3)
%10 = getelementptr [41 x i8], [41 x i8]* %1, i64 0, i64 %9
%11 = bitcast i8* %10 to i16*
store i16 32, i16* %11
%12 = call i8* @strcat(i8* %3, i8* %4)
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i8* %3)
ret i32 0
}