#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 main(void) {
  char *football_team[] = {
      "Juventus", "Manchester United", "Chelsea",   "Manchester City",
      "Milan",    "Real Madrid",       "Barcellona"};
  char *ptr = football_team[0];
  char **ptr_to_ptr = &ptr;
  short int offset_second_elem = football_team[1] - football_team[0];
  printf("       address of:\n");
  printf("              ptr: %p\n", ptr);
  printf(" football_team[0]: %p\n", (void *)football_team[0]);
  printf("       ptr_to_ptr: %p\n", (void *)*ptr_to_ptr);
  printf("      Indirection:\n");
  printf("              ptr: %s\n", ptr);
  printf("       ptr_to_ptr: %s\n", *ptr_to_ptr);
  printf(" football_team[1]: %s\n", (ptr + offset_second_elem));
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x40(%rbp),%rdi
lea    0x2ca6(%rip),%rsi
mov    $0x38,%edx
call   1040 <memcpy@plt>
mov    -0x40(%rbp),%rax
mov    %rax,-0x48(%rbp)
lea    -0x48(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x38(%rbp),%rax
mov    -0x40(%rbp),%rcx
sub    %rcx,%rax
mov    %ax,-0x52(%rbp)
lea    0xee6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x48(%rbp),%rsi
lea    0xee8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x40(%rbp),%rsi
lea    0xeed(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x50(%rbp),%rax
mov    (%rax),%rsi
lea    0xeef(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x48(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x50(%rbp),%rax
mov    (%rax),%rsi
lea    0xefc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x48(%rbp),%rsi
movswl -0x52(%rbp),%eax
cltq
add    %rax,%rsi
lea    0xef8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2ddf(%rip),%rax
mov    (%rax),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xf7d(%rip),%rdi
call   1030 <puts@plt>
lea    0xee7(%rip),%rdi
lea    0xec5(%rip),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xee6(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeec(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf4a(%rip),%rdi
call   1030 <puts@plt>
lea    0xee6(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeec(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe6d(%rip),%rax
sub    %ebx,%eax
movswq %ax,%rsi
add    %rbx,%rsi
lea    0xee2(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x2e26(%rip),%rax
mov    (%rax),%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"Juventus\00"
@.str.1 = [18 x i8] c"Manchester United\00"
@.str.2 = [8 x i8] c"Chelsea\00"
@.str.3 = [16 x i8] c"Manchester City\00"
@.str.4 = [6 x i8] c"Milan\00"
@.str.5 = [12 x i8] c"Real Madrid\00"
@.str.6 = [11 x i8] c"Barcellona\00"
@__const.main.football_team = [7 x i8*] [i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i32 0, i32 0)]
@.str.7 = [20 x i8] c" address of:\0A\00"
@.str.8 = [23 x i8] c" ptr: %p\0A\00"
@.str.9 = [23 x i8] c" football_team[0]: %p\0A\00"
@.str.10 = [23 x i8] c" ptr_to_ptr: %p\0A\00"
@.str.11 = [20 x i8] c" Indirection:\0A\00"
@.str.12 = [23 x i8] c" ptr: %s\0A\00"
@.str.13 = [23 x i8] c" ptr_to_ptr: %s\0A\00"
@.str.14 = [23 x i8] c" football_team[1]: %s\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca [7 x i8*]
%3 = alloca i8*
%4 = alloca i8**
%5 = alloca i16
store i32 0, i32* %1
%6 = bitcast [7 x i8*]* %2 to i8*
%7 = getelementptr inbounds [7 x i8*], [7 x i8*]* %2, i64 0, i64 0
%8 = load i8*, i8** %7
store i8* %8, i8** %3
store i8** %3, i8*** %4
%9 = getelementptr inbounds [7 x i8*], [7 x i8*]* %2, i64 0, i64 1
%10 = load i8*, i8** %9
%11 = getelementptr inbounds [7 x i8*], [7 x i8*]* %2, i64 0, i64 0
%12 = load i8*, i8** %11
%13 = ptrtoint i8* %10 to i64
%14 = ptrtoint i8* %12 to i64
%15 = sub i64 %13, %14
%16 = trunc i64 %15 to i16
store i16 %16, i16* %5
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.7, i64 0, i64 0))
%18 = load i8*, i8** %3
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.8, i64 0, i64 0), i8* %18)
%20 = getelementptr inbounds [7 x i8*], [7 x i8*]* %2, i64 0, i64 0
%21 = load i8*, i8** %20
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.9, i64 0, i64 0), i8* %21)
%23 = load i8**, i8*** %4
%24 = load i8*, i8** %23
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.10, i64 0, i64 0), i8* %24)
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.11, i64 0, i64 0))
%27 = load i8*, i8** %3
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.12, i64 0, i64 0), i8* %27)
%29 = load i8**, i8*** %4
%30 = load i8*, i8** %29
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.13, i64 0, i64 0), i8* %30)
%32 = load i8*, i8** %3
%33 = load i16, i16* %5
%34 = sext i16 %33 to i32
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds i8, i8* %32, i64 %35
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.14, i64 0, i64 0), i8* %36)
%38 = load i32, i32* @EXIT_SUCCESS
ret i32 %38
}

LLVM IR (-O2):
@.str = [9 x i8] c"Juventus\00"
@.str.1 = [18 x i8] c"Manchester United\00"
@.str.8 = [23 x i8] c" ptr: %p\0A\00"
@.str.9 = [23 x i8] c" football_team[0]: %p\0A\00"
@.str.10 = [23 x i8] c" ptr_to_ptr: %p\0A\00"
@.str.12 = [23 x i8] c" ptr: %s\0A\00"
@.str.13 = [23 x i8] c" ptr_to_ptr: %s\0A\00"
@.str.14 = [23 x i8] c" football_team[1]: %s\0A\00"
@EXIT_SUCCESS = global i32 0
@str = [19 x i8] c" address of:\00"
@str.15 = [19 x i8] c" Indirection:\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.15, i64 0, i64 0))
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds (i8, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i64 sext (i16 trunc (i64 sub (i64 ptrtoint ([18 x i8]* @.str.1 to i64), i64 ptrtoint ([9 x i8]* @.str to i64)) to i16) to i64)))
%9 = load i32, i32* @EXIT_SUCCESS
ret i32 %9
}