#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 /*<<< orphan*/ printf(char *, int, int, int);
int stringLength(char *);
int main(void) {
  char word1[] = {'a', 's', 't', 'e', 'r', '\0'};
  char word2[] = {'a', 't', '\0'};
  char word3[] = {'a', 'w', 'e', '\0'};
  printf("%i %i %i\n", stringLength(word1), stringLength(word2),
         stringLength(word3));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xecb(%rip),%eax
mov    %eax,-0xa(%rbp)
mov    0xec5(%rip),%ax
mov    %ax,-0x6(%rbp)
mov    0xebc(%rip),%ax
mov    %ax,-0xd(%rbp)
mov    0xeb4(%rip),%al
mov    %al,-0xb(%rbp)
mov    0xeac(%rip),%eax
mov    %eax,-0x11(%rbp)
lea    -0xa(%rbp),%rdi
call   1040 <stringLength@plt>
mov    %eax,-0x1c(%rbp)
lea    -0xd(%rbp),%rdi
call   1040 <stringLength@plt>
mov    %eax,-0x18(%rbp)
lea    -0x11(%rbp),%rdi
call   1040 <stringLength@plt>
mov    -0x1c(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    %eax,%ecx
lea    0xe7d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
movw   $0x72,0x14(%rsp)
movl   $0x65747361,0x10(%rsp)
65
movb   $0x0,0xa(%rsp)
movw   $0x7461,0x8(%rsp)
movl   $0x657761,0xc(%rsp)
lea    0x10(%rsp),%rdi
call   1040 <stringLength@plt>
mov    %eax,%ebx
lea    0x8(%rsp),%rdi
call   1040 <stringLength@plt>
mov    %eax,%ebp
lea    0xc(%rsp),%rdi
call   1040 <stringLength@plt>
lea    0xe97(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
mov    %eax,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@__const.main.word1 = [6 x i8] c"aster\00"
@__const.main.word2 = [3 x i8] c"at\00"
@__const.main.word3 = [4 x i8] c"awe\00"
@.str = [10 x i8] c"%i %i %i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [6 x i8]
%3 = alloca [3 x i8]
%4 = alloca [4 x i8]
store i32 0, i32* %1
%5 = bitcast [6 x i8]* %2 to i8*
%6 = bitcast [3 x i8]* %3 to i8*
%7 = bitcast [4 x i8]* %4 to i8*
%8 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%9 = call i32 @stringLength(i8* %8)
%10 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 0
%11 = call i32 @stringLength(i8* %10)
%12 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 0
%13 = call i32 @stringLength(i8* %12)
%14 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %11, i32 %13)
ret i32 0
}

LLVM IR (-O2):
@__const.main.word1 = [6 x i8] c"aster\00"
@__const.main.word2 = [3 x i8] c"at\00"
@.str = [10 x i8] c"%i %i %i\0A\00"
define i32 @main() {
%1 = alloca [6 x i8]
%2 = alloca [3 x i8]
%3 = alloca i32
%4 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
%5 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
%6 = bitcast i32* %3 to i8*
store i32 6649697, i32* %3
%7 = call i32 @stringLength(i8* %4)
%8 = call i32 @stringLength(i8* %5)
%9 = call i32 @stringLength(i8* %6)
%10 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8, i32 %9)
ret i32 0
}