int main(int argc, char *argv[]) {
  char s1[12];
  char s2[3] = "ld";
  char r[] = "Good morning";
  char s3[3] = "01";
  printf("%s\n", r);
  strcpy(s1, "Hello Wor");
  printf("%s\n", s1);
  printf("%s\n", strcat(s1, s2));
  printf("%i\n", strlen(s1));
  char *p = strstr(s1, "ello");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xe93(%rip),%ax
mov    %ax,-0x1f(%rbp)
mov    0xe8b(%rip),%al
mov    %al,-0x1d(%rbp)
mov    0xe82(%rip),%rax
mov    %rax,-0x2c(%rbp)
mov    0xe80(%rip),%eax
mov    %eax,-0x24(%rbp)
mov    0xe7b(%rip),%al
mov    %al,-0x20(%rbp)
mov    0xe72(%rip),%ax
mov    %ax,-0x2f(%rbp)
mov    0xe6a(%rip),%al
mov    %al,-0x2d(%rbp)
lea    -0x2c(%rbp),%rsi
lea    0xe5d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x1c(%rbp),%rdi
lea    0xe4f(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x1c(%rbp),%rsi
lea    0xe3b(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x1c(%rbp),%rdi
lea    -0x1f(%rbp),%rsi
call   1060 <strcat@plt>
mov    %rax,%rsi
lea    0xe1d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x1c(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rsi
lea    0xe11(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x1c(%rbp),%rdi
lea    0xe03(%rip),%rsi
call   1070 <strstr@plt>
mov    %rax,-0x38(%rbp)
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
movb   $0x0,0xe(%rsp)
movw   $0x646c,0xc(%rsp)
movabs $0x676e696e726f6d,%rax
mov    %rax,0x25(%rsp)
movabs $0x726f6d20646f6f47,%rax
6d 6f 72
mov    %rax,0x20(%rsp)
lea    0x20(%rsp),%rdi
call   1030 <puts@plt>
movabs $0x6f57206f6c6c6548,%rax
20 57 6f
mov    %rax,0x10(%rsp)
movw   $0x72,0x18(%rsp)
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <strcat@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
lea    0xe5a(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.s2 = [3 x i8] c"ld\00"
@__const.main.r = [13 x i8] c"Good morning\00"
@__const.main.s3 = [3 x i8] c"01\00"
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [10 x i8] c"Hello Wor\00"
@.str.2 = [4 x i8] c"%i\0A\00"
@.str.3 = [5 x i8] c"ello\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [12 x i8]
%7 = alloca [3 x i8]
%8 = alloca [13 x i8]
%9 = alloca [3 x i8]
%10 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%11 = bitcast [3 x i8]* %7 to i8*
%12 = bitcast [13 x i8]* %8 to i8*
%13 = bitcast [3 x i8]* %9 to i8*
%14 = getelementptr inbounds [13 x i8], [13 x i8]* %8, i64 0, i64 0
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %14)
%16 = getelementptr inbounds [12 x i8], [12 x i8]* %6, i64 0, i64 0
%17 = call i8* @strcpy(i8* %16, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%18 = getelementptr inbounds [12 x i8], [12 x i8]* %6, i64 0, i64 0
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %18)
%20 = getelementptr inbounds [12 x i8], [12 x i8]* %6, i64 0, i64 0
%21 = getelementptr inbounds [3 x i8], [3 x i8]* %7, i64 0, i64 0
%22 = call i8* @strcat(i8* %20, i8* %21)
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %22)
%24 = getelementptr inbounds [12 x i8], [12 x i8]* %6, i64 0, i64 0
%25 = call i64 @strlen(i8* %24)
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i64 %25)
%27 = getelementptr inbounds [12 x i8], [12 x i8]* %6, i64 0, i64 0
%28 = call i8* @strstr(i8* %27, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
store i8* %28, i8** %10
ret i32 0
}

LLVM IR (-O2):
@__const.main.s2 = [3 x i8] c"ld\00"
@__const.main.r = [13 x i8] c"Good morning\00"
@.str.1 = [10 x i8] c"Hello Wor\00"
@.str.2 = [4 x i8] c"%i\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [12 x i8]
%4 = alloca [3 x i8]
%5 = alloca [13 x i8]
%6 = getelementptr inbounds [12 x i8], [12 x i8]* %3, i64 0, i64 0
%7 = getelementptr inbounds [3 x i8], [3 x i8]* %4, i64 0, i64 0
%8 = getelementptr inbounds [13 x i8], [13 x i8]* %5, i64 0, i64 0
%9 = call i32 @puts(i8* %8)
%10 = call i32 @puts(i8* %6)
%11 = call i8* @strcat(i8* %6, i8* %7)
%12 = call i32 @puts(i8* %6)
%13 = call i64 @strlen(i8* %6)
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i64 %13)
ret i32 0
}