#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 EXIT_SUCCESS;
int /*<<< orphan*/ strcpy(char *, char *);
int main(int argc, char *argv[]) {
  char str1[20];
  char str2[20];
  strcpy(str1, "First");
  strcpy(str2, "Second");
  const char *chptr1 = &str1[0];
  char *const chptr2 = &str1[0];
  const char *const chptr3 = &str1[0];
  *chptr2 = 'C';
  chptr1 = &str2[0];
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xecf(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x50(%rbp),%rdi
lea    0xec5(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x30(%rbp),%rax
mov    %rax,-0x58(%rbp)
lea    -0x30(%rbp),%rax
mov    %rax,-0x60(%rbp)
lea    -0x30(%rbp),%rax
mov    %rax,-0x68(%rbp)
mov    -0x60(%rbp),%rax
movb   $0x43,(%rax)
lea    -0x50(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    0x2e6c(%rip),%rax
mov    (%rax),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
lea    0xee5(%rip),%rsi
lea    0x20(%rsp),%rdi
call   1030 <strcpy@plt>
lea    0xeda(%rip),%rsi
mov    %rsp,%rdi
call   1030 <strcpy@plt>
mov    0x2ea5(%rip),%rax
mov    (%rax),%eax
add    $0x38,%rsp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"First\00"
@.str.1 = [7 x i8] c"Second\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [20 x i8]
%7 = alloca [20 x i8]
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%11 = getelementptr inbounds [20 x i8], [20 x i8]* %6, i64 0, i64 0
%12 = call i32 @strcpy(i8* %11, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%13 = getelementptr inbounds [20 x i8], [20 x i8]* %7, i64 0, i64 0
%14 = call i32 @strcpy(i8* %13, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%15 = getelementptr inbounds [20 x i8], [20 x i8]* %6, i64 0, i64 0
store i8* %15, i8** %8
%16 = getelementptr inbounds [20 x i8], [20 x i8]* %6, i64 0, i64 0
store i8* %16, i8** %9
%17 = getelementptr inbounds [20 x i8], [20 x i8]* %6, i64 0, i64 0
store i8* %17, i8** %10
%18 = load i8*, i8** %9
store i8 67, i8* %18
%19 = getelementptr inbounds [20 x i8], [20 x i8]* %7, i64 0, i64 0
store i8* %19, i8** %8
%20 = load i32, i32* @EXIT_SUCCESS
ret i32 %20
}

LLVM IR (-O2):
@.str = [6 x i8] c"First\00"
@.str.1 = [7 x i8] c"Second\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [20 x i8]
%4 = alloca [20 x i8]
%5 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [20 x i8], [20 x i8]* %4, i64 0, i64 0
%7 = call i32 @strcpy(i8* %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @strcpy(i8* %6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%9 = load i32, i32* @EXIT_SUCCESS
ret i32 %9
}