#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 main(void) {
  int string_length(const char string[]);
  const char word1[] = "random";
  const char word2[] = "Tyler";
  const char word3[] = {'t', 'y', '\0'};
  printf("%i %i %i\n", string_length(word1), string_length(word2),
         string_length(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,-0xb(%rbp)
mov    0xec5(%rip),%ax
mov    %ax,-0x7(%rbp)
mov    0xebd(%rip),%al
mov    %al,-0x5(%rbp)
mov    0xeb5(%rip),%eax
mov    %eax,-0x11(%rbp)
mov    0xeaf(%rip),%ax
mov    %ax,-0xd(%rbp)
mov    0xea6(%rip),%ax
mov    %ax,-0x14(%rbp)
mov    0xe9e(%rip),%al
mov    %al,-0x12(%rbp)
lea    -0xb(%rbp),%rdi
call   1040 <string_length@plt>
mov    %eax,-0x1c(%rbp)
lea    -0x11(%rbp),%rdi
call   1040 <string_length@plt>
mov    %eax,-0x18(%rbp)
lea    -0x14(%rbp),%rdi
call   1040 <string_length@plt>
mov    -0x1c(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    %eax,%ecx
lea    0xe6c(%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
movl   $0x6d6f64,0x13(%rsp)
movl   $0x646e6172,0x10(%rsp)
64
movw   $0x72,0xc(%rsp)
movl   $0x656c7954,0x8(%rsp)
65
movb   $0x0,0x6(%rsp)
movw   $0x7974,0x4(%rsp)
lea    0x10(%rsp),%rdi
call   1040 <string_length@plt>
mov    %eax,%ebx
lea    0x8(%rsp),%rdi
call   1040 <string_length@plt>
mov    %eax,%ebp
lea    0x4(%rsp),%rdi
call   1040 <string_length@plt>
lea    0xe96(%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 = [7 x i8] c"random\00"
@__const.main.word2 = [6 x i8] c"Tyler\00"
@__const.main.word3 = [3 x i8] c"ty\00"
@.str = [10 x i8] c"%i %i %i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [7 x i8]
%3 = alloca [6 x i8]
%4 = alloca [3 x i8]
store i32 0, i32* %1
%5 = bitcast [7 x i8]* %2 to i8*
%6 = bitcast [6 x i8]* %3 to i8*
%7 = bitcast [3 x i8]* %4 to i8*
%8 = getelementptr inbounds [7 x i8], [7 x i8]* %2, i64 0, i64 0
%9 = call i32 @string_length(i8* %8)
%10 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 0
%11 = call i32 @string_length(i8* %10)
%12 = getelementptr inbounds [3 x i8], [3 x i8]* %4, i64 0, i64 0
%13 = call i32 @string_length(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 = [7 x i8] c"random\00"
@__const.main.word2 = [6 x i8] c"Tyler\00"
@__const.main.word3 = [3 x i8] c"ty\00"
@.str = [10 x i8] c"%i %i %i\0A\00"
define i32 @main() {
%1 = alloca [7 x i8]
%2 = alloca [6 x i8]
%3 = alloca [3 x i8]
%4 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 0
%5 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 0
%7 = call i32 @string_length(i8* %4)
%8 = call i32 @string_length(i8* %5)
%9 = call i32 @string_length(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
}