#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;
size_t get_strlen(char const *);
int /*<<< orphan*/ printf(char *, char const *, size_t);
int main(int argc, char *argv[]) {
  const char basket_team[20] = "Los Angeles Lakers";
  const char football_team[] = "Juventus";
  const char *song = "No Woman No cry";
  size_t len_bteam = get_strlen(basket_team);
  size_t len_fteam = get_strlen(football_team);
  size_t len_song = get_strlen(song);
  printf("%20s (%2d byte)\n", basket_team, len_bteam);
  printf("%20s (%2d byte)\n", football_team, len_fteam);
  printf("%20s (%2d byte)\n", song, len_song);
  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    0xec3(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xec0(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xebe(%rip),%eax
mov    %eax,-0x20(%rbp)
mov    0xeb8(%rip),%rax
mov    %rax,-0x39(%rbp)
mov    0xeb6(%rip),%al
mov    %al,-0x31(%rbp)
lea    0xead(%rip),%rax
mov    %rax,-0x48(%rbp)
lea    -0x30(%rbp),%rdi
call   1040 <get_strlen@plt>
mov    %rax,-0x50(%rbp)
lea    -0x39(%rbp),%rdi
call   1040 <get_strlen@plt>
mov    %rax,-0x58(%rbp)
mov    -0x48(%rbp),%rdi
call   1040 <get_strlen@plt>
mov    %rax,-0x60(%rbp)
lea    -0x30(%rbp),%rsi
mov    -0x50(%rbp),%rdx
lea    0xe83(%rip),%rdi
call   1030 <printf@plt>
lea    -0x39(%rbp),%rsi
mov    -0x58(%rbp),%rdx
lea    0xe6f(%rip),%rdi
call   1030 <printf@plt>
mov    -0x48(%rbp),%rsi
mov    -0x60(%rbp),%rdx
lea    0xe5b(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e02(%rip),%rax
mov    (%rax),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
movaps 0xecb(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movl   $0x7372,0x20(%rsp)
movabs $0x7375746e6576754a,%rax
74 75 73
mov    %rax,(%rsp)
movb   $0x0,0x8(%rsp)
lea    0x10(%rsp),%rdi
call   1040 <get_strlen@plt>
mov    %rax,%rbx
mov    %rsp,%r15
mov    %r15,%rdi
call   1040 <get_strlen@plt>
mov    %rax,%r12
lea    0xea6(%rip),%r13
mov    %r13,%rdi
call   1040 <get_strlen@plt>
mov    %rax,%rbp
lea    0xea4(%rip),%r14
mov    %r14,%rdi
lea    0x10(%rsp),%rsi
mov    %rbx,%rdx
call   1030 <printf@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
call   1030 <printf@plt>
mov    %r14,%rdi
mov    %r13,%rsi
mov    %rbp,%rdx
call   1030 <printf@plt>
mov    0x2e24(%rip),%rax
mov    (%rax),%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.main.basket_team = [20 x i8] c"Los Angeles Lakers\00\00"
@__const.main.football_team = [9 x i8] c"Juventus\00"
@.str = [16 x i8] c"No Woman No cry\00"
@.str.1 = [17 x i8] c"%20s (%2d byte)\0A\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 [9 x i8]
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%12 = bitcast [20 x i8]* %6 to i8*
%13 = bitcast [9 x i8]* %7 to i8*
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8** %8
%14 = getelementptr inbounds [20 x i8], [20 x i8]* %6, i64 0, i64 0
%15 = call i64 @get_strlen(i8* %14)
store i64 %15, i64* %9
%16 = getelementptr inbounds [9 x i8], [9 x i8]* %7, i64 0, i64 0
%17 = call i64 @get_strlen(i8* %16)
store i64 %17, i64* %10
%18 = load i8*, i8** %8
%19 = call i64 @get_strlen(i8* %18)
store i64 %19, i64* %11
%20 = getelementptr inbounds [20 x i8], [20 x i8]* %6, i64 0, i64 0
%21 = load i64, i64* %9
%22 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %20, i64 %21)
%23 = getelementptr inbounds [9 x i8], [9 x i8]* %7, i64 0, i64 0
%24 = load i64, i64* %10
%25 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %23, i64 %24)
%26 = load i8*, i8** %8
%27 = load i64, i64* %11
%28 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %26, i64 %27)
%29 = load i32, i32* @EXIT_SUCCESS
ret i32 %29
}

LLVM IR (-O2):
@__const.main.basket_team = [20 x i8] c"Los Angeles Lakers\00\00"
@__const.main.football_team = [9 x i8] c"Juventus\00"
@.str = [16 x i8] c"No Woman No cry\00"
@.str.1 = [17 x i8] c"%20s (%2d byte)\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [20 x i8]
%4 = alloca [9 x i8]
%5 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [9 x i8], [9 x i8]* %4, i64 0, i64 0
%7 = call i64 @get_strlen(i8* %5)
%8 = call i64 @get_strlen(i8* %6)
%9 = call i64 @get_strlen(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %5, i64 %7)
%11 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %6, i64 %8)
%12 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i64 %9)
%13 = load i32, i32* @EXIT_SUCCESS
ret i32 %13
}