#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*/ printf(char *, ...);
int strlen(char *);
int main(int argc, char *argv[], char *envp[]) {
  int i;
  char first_string[11 + 1] = "Hello World";
  for (i = 0; i < 11; i++) {
    printf("%2d - %c\n", i, first_string[i]);
  }
  char date[8] = "June 14";
  char new_date[] = "March 31";
  printf("len date: %d\nlen new_date: %d\n", strlen(date), strlen(new_date));
  char vett[] = "Carl Mark";
  char *ptr = "Unknow";
  ptr = vett;
  vett[8] = 'x';
  printf("%s\n", vett);
  printf("%s\n", ptr);
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0xebf(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xebd(%rip),%eax
mov    %eax,-0x20(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0xb,-0x1c(%rbp)
jge    1187 <main+0x67>
mov    -0x1c(%rbp),%esi
movslq -0x1c(%rbp),%rax
movsbl -0x28(%rbp,%rax,1),%edx
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1155 <main+0x35>
mov    0xe88(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xe85(%rip),%rax
mov    %rax,-0x39(%rbp)
mov    0xe83(%rip),%al
mov    %al,-0x31(%rbp)
lea    -0x30(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x54(%rbp)
lea    -0x39(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x54(%rbp),%esi
mov    %eax,%edx
lea    0xe60(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    0xe71(%rip),%rax
mov    %rax,-0x43(%rbp)
mov    0xe6e(%rip),%ax
mov    %ax,-0x3b(%rbp)
lea    0xe65(%rip),%rax
mov    %rax,-0x50(%rbp)
lea    -0x43(%rbp),%rax
mov    %rax,-0x50(%rbp)
movb   $0x78,-0x3b(%rbp)
lea    -0x43(%rbp),%rsi
lea    0xe51(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x50(%rbp),%rsi
lea    0xe3f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    0x2dba(%rip),%rax
mov    (%rax),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
lea    0xec4(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x48,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x65,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x6c,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0x6c,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0x6f,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
mov    $0x20,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
mov    $0x57,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
mov    $0x6f,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
mov    $0x72,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x9,%esi
mov    $0x6c,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
mov    $0x64,%edx
xor    %eax,%eax
call   1050 <printf@plt>
movabs $0x343120656e754a,%rax
mov    %rax,0x28(%rsp)
movabs $0x313320686372614d,%rax
20 33 31
mov    %rax,0x18(%rsp)
movb   $0x0,0x20(%rsp)
lea    0x28(%rsp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ebx
lea    0x18(%rsp),%rdi
call   1040 <strlen@plt>
lea    0xdbe(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1050 <printf@plt>
movabs $0x72614d206c726143,%rax
4d 61 72
mov    %rax,0x8(%rsp)
movw   $0x6b,0x10(%rsp)
movb   $0x78,0x10(%rsp)
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    0x2d49(%rip),%rax
mov    (%rax),%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.first_string = [12 x i8] c"Hello World\00"
@.str = [10 x i8] c"%2d - %c\0A\00"
@__const.main.date = [8 x i8] c"June 14\00"
@__const.main.new_date = [9 x i8] c"March 31\00"
@.str.1 = [31 x i8] c"len date: %d\0Alen new_date: %d\0A\00"
@__const.main.vett = [10 x i8] c"Carl Mark\00"
@.str.2 = [7 x i8] c"Unknow\00"
@.str.3 = [4 x i8] c"%s\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8**
%8 = alloca i32
%9 = alloca [12 x i8]
%10 = alloca [8 x i8]
%11 = alloca [9 x i8]
%12 = alloca [10 x i8]
%13 = alloca i8*
store i32 0, i32* %4
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
%14 = bitcast [12 x i8]* %9 to i8*
store i32 0, i32* %8
br label %15
15: ; preds = %26, %3
%16 = load i32, i32* %8
%17 = icmp slt i32 %16, 11
br i1 %17, label %18, label %29
18: ; preds = %15
%19 = load i32, i32* %8
%20 = load i32, i32* %8
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [12 x i8], [12 x i8]* %9, i64 0, i64 %21
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %19, i32 %24)
br label %26
26: ; preds = %18
%27 = load i32, i32* %8
%28 = add nsw i32 %27, 1
store i32 %28, i32* %8
br label %15
29: ; preds = %15
%30 = bitcast [8 x i8]* %10 to i8*
%31 = bitcast [9 x i8]* %11 to i8*
%32 = getelementptr inbounds [8 x i8], [8 x i8]* %10, i64 0, i64 0
%33 = call i32 @strlen(i8* %32)
%34 = getelementptr inbounds [9 x i8], [9 x i8]* %11, i64 0, i64 0
%35 = call i32 @strlen(i8* %34)
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i32 %33, i32 %35)
%37 = bitcast [10 x i8]* %12 to i8*
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8** %13
%38 = getelementptr inbounds [10 x i8], [10 x i8]* %12, i64 0, i64 0
store i8* %38, i8** %13
%39 = getelementptr inbounds [10 x i8], [10 x i8]* %12, i64 0, i64 8
store i8 120, i8* %39
%40 = getelementptr inbounds [10 x i8], [10 x i8]* %12, i64 0, i64 0
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %40)
%42 = load i8*, i8** %13
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %42)
%44 = load i32, i32* @EXIT_SUCCESS
ret i32 %44
}

LLVM IR (-O2):
@.str = [10 x i8] c"%2d - %c\0A\00"
@__const.main.new_date = [9 x i8] c"March 31\00"
@.str.1 = [31 x i8] c"len date: %d\0Alen new_date: %d\0A\00"
@__const.main.vett = [10 x i8] c"Carl Mark\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1, i8** nocapture readnone %2) {
%4 = alloca i64
%5 = alloca [9 x i8]
%6 = alloca [10 x i8]
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 0, i32 72)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 1, i32 101)
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 2, i32 108)
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 3, i32 108)
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 4, i32 111)
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 5, i32 32)
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 6, i32 87)
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 7, i32 111)
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 8, i32 114)
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 9, i32 108)
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 10, i32 100)
%18 = bitcast i64* %4 to i8*
store i64 14690713999406410, i64* %4
%19 = getelementptr inbounds [9 x i8], [9 x i8]* %5, i64 0, i64 0
%20 = call i32 @strlen(i8* %18)
%21 = call i32 @strlen(i8* %19)
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i32 %20, i32 %21)
%23 = getelementptr inbounds [10 x i8], [10 x i8]* %6, i64 0, i64 0
%24 = getelementptr inbounds [10 x i8], [10 x i8]* %6, i64 0, i64 8
store i8 120, i8* %24
%25 = call i32 @puts(i8* %23)
%26 = call i32 @puts(i8* %23)
%27 = load i32, i32* @EXIT_SUCCESS
ret i32 %27
}