#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*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stdout;
int strlen(char *);
int main() {
  int i;
  char s1[10] = "Rayko!!";
  fprintf(stdout, "%d\n", strlen(s1));
  fprintf(stdout, "%s\n", s1);
  for (i = 7; i >= 0; i--) {
    fprintf(stdout, "%c ", s1[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x12(%rbp)
mov    0xec7(%rip),%ax
mov    %ax,-0xa(%rbp)
mov    0x2e94(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
lea    -0x12(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x18(%rbp),%edi
mov    %eax,%edx
lea    0xea4(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    0x2e6c(%rip),%rax
mov    (%rax),%edi
lea    -0x12(%rbp),%rdx
lea    0xe8d(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
movl   $0x7,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     11c7 <main+0xa7>
mov    0x2e40(%rip),%rax
mov    (%rax),%edi
movslq -0x8(%rbp),%rax
movsbl -0x12(%rbp,%rax,1),%edx
lea    0xe60(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    118f <main+0x6f>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
movabs $0x21216f6b796152,%rax
mov    %rax,(%rsp)
movw   $0x0,0x8(%rsp)
mov    0x2e9b(%rip),%r15
mov    (%r15),%ebx
mov    %rsp,%r14
mov    %r14,%rdi
call   1030 <strlen@plt>
lea    0xeb0(%rip),%rsi
mov    %ebx,%edi
mov    %eax,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    (%r15),%edi
lea    0xe9f(%rip),%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    (%r15),%edi
movsbl 0x7(%rsp),%edx
lea    0xe8a(%rip),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    (%r15),%edi
movsbl 0x6(%rsp),%edx
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    (%r15),%edi
movsbl 0x5(%rsp),%edx
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    (%r15),%edi
movsbl 0x4(%rsp),%edx
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    (%r15),%edi
movsbl 0x3(%rsp),%edx
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    (%r15),%edi
movsbl 0x2(%rsp),%edx
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    (%r15),%edi
movsbl 0x1(%rsp),%edx
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    (%r15),%edi
movsbl (%rsp),%edx
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.main.s1 = [10 x i8] c"Rayko!!\00\00\00"
@stdout = global i32 0
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
@.str.2 = [4 x i8] c"%c \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [10 x i8]
store i32 0, i32* %1
%4 = bitcast [10 x i8]* %3 to i8*
%5 = load i32, i32* @stdout
%6 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%7 = call i32 @strlen(i8* %6)
%8 = call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32, i32* @stdout
%10 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%11 = call i32 (i32, i8*, ...) @fprintf(i32 %9, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %10)
store i32 7, i32* %2
br label %12
12: ; preds = %23, %0
%13 = load i32, i32* %2
%14 = icmp sge i32 %13, 0
br i1 %14, label %15, label %26
15: ; preds = %12
%16 = load i32, i32* @stdout
%17 = load i32, i32* %2
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 %18
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = call i32 (i32, i8*, ...) @fprintf(i32 %16, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %21)
br label %23
23: ; preds = %15
%24 = load i32, i32* %2
%25 = add nsw i32 %24, -1
store i32 %25, i32* %2
br label %12
26: ; preds = %12
ret i32 0
}

LLVM IR (-O2):
@__const.main.s1 = [10 x i8] c"Rayko!!\00\00\00"
@stdout = global i32 0
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
@.str.2 = [4 x i8] c"%c \00"
define i32 @main() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @stdout
%4 = call i32 @strlen(i8* %2)
%5 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* @stdout
%7 = call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%8 = load i32, i32* @stdout
%9 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 7
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = call i32 (i32, i8*, ...) @fprintf(i32 %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %11)
%13 = load i32, i32* @stdout
%14 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 6
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = call i32 (i32, i8*, ...) @fprintf(i32 %13, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %16)
%18 = load i32, i32* @stdout
%19 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 5
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = call i32 (i32, i8*, ...) @fprintf(i32 %18, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %21)
%23 = load i32, i32* @stdout
%24 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 4
%25 = load i8, i8* %24
%26 = sext i8 %25 to i32
%27 = call i32 (i32, i8*, ...) @fprintf(i32 %23, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %26)
%28 = load i32, i32* @stdout
%29 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 3
%30 = load i8, i8* %29
%31 = sext i8 %30 to i32
%32 = call i32 (i32, i8*, ...) @fprintf(i32 %28, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %31)
%33 = load i32, i32* @stdout
%34 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 2
%35 = load i8, i8* %34
%36 = sext i8 %35 to i32
%37 = call i32 (i32, i8*, ...) @fprintf(i32 %33, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %36)
%38 = load i32, i32* @stdout
%39 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 1
%40 = load i8, i8* %39
%41 = sext i8 %40 to i32
%42 = call i32 (i32, i8*, ...) @fprintf(i32 %38, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %41)
%43 = load i32, i32* @stdout
%44 = load i8, i8* %2
%45 = sext i8 %44 to i32
%46 = call i32 (i32, i8*, ...) @fprintf(i32 %43, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %45)
ret i32 0
}