#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*/ putchar(char);
int /*<<< orphan*/ puts(char *);
int main() {
  char phrase[] = "sushi is mooshi";
  char ch;
  int x = 0;
  while (ch = phrase[x]) {
    putchar(ch);
    x++;
  }
  putchar('\n');
  phrase[9] = 'F';
  puts(phrase);
  phrase[5] = '-';
  phrase[8] = '-';
  puts(phrase);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x28(%rbp)
movslq -0x28(%rbp),%rax
mov    -0x20(%rbp,%rax,1),%al
mov    %al,-0x21(%rbp)
cmp    $0x0,%al
je     1176 <main+0x56>
movsbl -0x21(%rbp),%edi
call   1030 <putchar@plt>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    114c <main+0x2c>
mov    $0xa,%edi
call   1030 <putchar@plt>
movb   $0x46,-0x17(%rbp)
lea    -0x20(%rbp),%rdi
call   1040 <puts@plt>
movb   $0x2d,-0x1b(%rbp)
movb   $0x2d,-0x18(%rbp)
lea    -0x20(%rbp),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movaps 0xed4(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x1(%rsp),%rbx
mov    $0x73,%al
nopw   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <putchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1140 <main+0x20>
mov    $0xa,%edi
call   1030 <putchar@plt>
movb   $0x46,0x9(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <puts@plt>
movb   $0x2d,0x5(%rsp)
movb   $0x2d,0x8(%rsp)
mov    %rbx,%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.phrase = [16 x i8] c"sushi is mooshi\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [16 x i8]
%3 = alloca i8
%4 = alloca i32
store i32 0, i32* %1
%5 = bitcast [16 x i8]* %2 to i8*
store i32 0, i32* %4
br label %6
6: ; preds = %12, %0
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 %8
%10 = load i8, i8* %9
store i8 %10, i8* %3
%11 = icmp ne i8 %10, 0
br i1 %11, label %12, label %17
12: ; preds = %6
%13 = load i8, i8* %3
%14 = call i32 @putchar(i8 signext %13)
%15 = load i32, i32* %4
%16 = add nsw i32 %15, 1
store i32 %16, i32* %4
br label %6
17: ; preds = %6
%18 = call i32 @putchar(i8 signext 10)
%19 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 9
store i8 70, i8* %19
%20 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%21 = call i32 @puts(i8* %20)
%22 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 5
store i8 45, i8* %22
%23 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 8
store i8 45, i8* %23
%24 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%25 = call i32 @puts(i8* %24)
ret i32 0
}

LLVM IR (-O2):
@__const.main.phrase = [16 x i8] c"sushi is mooshi\00"
define i32 @main() {
%1 = alloca [16 x i8]
%2 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
br label %3
3: ; preds = %0, %3
%4 = phi i64 [ 0, %0 ], [ %7, %3 ]
%5 = phi i8 [ 115, %0 ], [ %9, %3 ]
%6 = tail call i32 @putchar(i8 signext %5)
%7 = add nuw i64 %4, 1
%8 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 %7
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %3
11: ; preds = %3
%12 = tail call i32 @putchar(i8 signext 10)
%13 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 9
store i8 70, i8* %13
%14 = call i32 @puts(i8* %2)
%15 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 5
store i8 45, i8* %15
%16 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 8
store i8 45, i8* %16
%17 = call i32 @puts(i8* %2)
ret i32 0
}