#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ __builtin_fputc(char, int /*<<< orphan*/ *);
int /*<<< orphan*/ __builtin_fputs(char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ __builtin_fwrite(char *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fputs(char const *const, int /*<<< orphan*/ *);
int /*<<< orphan*/ *stdout;
int main() {
  FILE *s_array[] = {stdout, NULL}, **s_ptr = s_array;
  const char *const s1 = "hello world";
  fputs("", *s_ptr);
  fputs("\n", *s_ptr);
  fputs("bye", *s_ptr);
  fputs(s1, *s_ptr);
  fputs(s1 + 5, *s_ptr);
  fputs(s1 + 10, *s_ptr);
  fputs(s1 + 11, *s_ptr);
  fputs("", *s_ptr++);
  if (s_ptr != s_array + 1 || *s_ptr != 0)
    abort();
  s_ptr = s_array;
  fputs("\n", *s_ptr++);
  if (s_ptr != s_array + 1 || *s_ptr != 0)
    abort();
  s_ptr = s_array;
  fputs("hello\n", *s_ptr++);
  if (s_ptr != s_array + 1 || *s_ptr != 0)
    abort();
  s_ptr = s_array;
  __builtin_fputs("", *s_ptr);
  __builtin_fputc('\n', *s_ptr);
  __builtin_fwrite("hello\n", 1, 6, *s_ptr);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e7a(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
movq   $0x0,-0x18(%rbp)
lea    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
lea    0xe7c(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%rsi
lea    0xe80(%rip),%rdi
call   1050 <fputs@plt>
mov    -0x28(%rbp),%rax
mov    (%rax),%rsi
lea    0xe6c(%rip),%rdi
call   1050 <fputs@plt>
mov    -0x28(%rbp),%rax
mov    (%rax),%rsi
lea    0xe50(%rip),%rdi
call   1050 <fputs@plt>
mov    -0x28(%rbp),%rax
mov    (%rax),%rsi
lea    0xe31(%rip),%rdi
call   1050 <fputs@plt>
mov    -0x28(%rbp),%rax
mov    (%rax),%rsi
lea    0xe1e(%rip),%rdi
add    $0x5,%rdi
call   1050 <fputs@plt>
mov    -0x28(%rbp),%rax
mov    (%rax),%rsi
lea    0xe07(%rip),%rdi
add    $0xa,%rdi
call   1050 <fputs@plt>
mov    -0x28(%rbp),%rax
mov    (%rax),%rsi
lea    0xdf0(%rip),%rdi
add    $0xb,%rdi
call   1050 <fputs@plt>
mov    -0x28(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x28(%rbp)
mov    (%rax),%rsi
lea    0xde4(%rip),%rdi
call   1050 <fputs@plt>
mov    -0x28(%rbp),%rax
lea    -0x20(%rbp),%rcx
add    $0x8,%rcx
cmp    %rcx,%rax
jne    125a <main+0x10a>
mov    -0x28(%rbp),%rax
cmpq   $0x0,(%rax)
je     1261 <main+0x111>
mov    $0x0,%al
call   1030 <abort@plt>
lea    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x28(%rbp)
mov    (%rax),%rsi
lea    0xd93(%rip),%rdi
call   1050 <fputs@plt>
mov    -0x28(%rbp),%rax
lea    -0x20(%rbp),%rcx
add    $0x8,%rcx
cmp    %rcx,%rax
jne    12aa <main+0x15a>
mov    -0x28(%rbp),%rax
cmpq   $0x0,(%rax)
je     12b1 <main+0x161>
mov    $0x0,%al
call   1030 <abort@plt>
lea    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x28(%rbp)
mov    (%rax),%rsi
lea    0xd3e(%rip),%rdi
call   1050 <fputs@plt>
mov    -0x28(%rbp),%rax
lea    -0x20(%rbp),%rcx
add    $0x8,%rcx
cmp    %rcx,%rax
jne    12fa <main+0x1aa>
mov    -0x28(%rbp),%rax
cmpq   $0x0,(%rax)
je     1301 <main+0x1b1>
mov    $0x0,%al
call   1030 <abort@plt>
lea    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%rsi
lea    0xcff(%rip),%rdi
call   1040 <__builtin_fputs@plt>
mov    -0x28(%rbp),%rax
mov    (%rax),%rsi
mov    $0xa,%edi
call   1060 <__builtin_fputc@plt>
mov    -0x28(%rbp),%rax
mov    (%rax),%rcx
lea    0xcd5(%rip),%rdi
mov    $0x1,%esi
mov    $0x6,%edx
call   1070 <__builtin_fwrite@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    0x2e85(%rip),%rax
mov    (%rax),%rbx
mov    $0xa,%edi
mov    %rbx,%rsi
call   1050 <fputc@plt>
lea    0xe9a(%rip),%rdi
mov    $0x3,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1070 <fwrite@plt>
lea    0xe75(%rip),%rdi
mov    $0xb,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1070 <fwrite@plt>
lea    0xe61(%rip),%rdi
mov    $0x6,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1070 <fwrite@plt>
mov    $0x64,%edi
mov    %rbx,%rsi
call   1050 <fputc@plt>
mov    $0xa,%edi
mov    %rbx,%rsi
call   1050 <fputc@plt>
lea    0xe39(%rip),%r14
mov    $0x6,%esi
mov    $0x1,%edx
mov    %r14,%rdi
mov    %rbx,%rcx
call   1070 <fwrite@plt>
lea    0xe23(%rip),%rdi
mov    %rbx,%rsi
call   1030 <__builtin_fputs@plt>
mov    $0xa,%edi
mov    %rbx,%rsi
call   1040 <__builtin_fputc@plt>
mov    %r14,%rdi
mov    $0x1,%esi
mov    $0x6,%edx
mov    %rbx,%rcx
call   1060 <__builtin_fwrite@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stdout = global i32* null
@.str = [12 x i8] c"hello world\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [2 x i8] c"\0A\00"
@.str.3 = [4 x i8] c"bye\00"
@.str.4 = [7 x i8] c"hello\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [2 x i32*]
%3 = alloca i32**
%4 = alloca i8*
store i32 0, i32* %1
%5 = getelementptr inbounds [2 x i32*], [2 x i32*]* %2, i64 0, i64 0
%6 = load i32*, i32** @stdout
store i32* %6, i32** %5
%7 = getelementptr inbounds i32*, i32** %5, i64 1
store i32* null, i32** %7
%8 = getelementptr inbounds [2 x i32*], [2 x i32*]* %2, i64 0, i64 0
store i32** %8, i32*** %3
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8** %4
%9 = load i32**, i32*** %3
%10 = load i32*, i32** %9
%11 = call i32 @fputs(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i32* %10)
%12 = load i32**, i32*** %3
%13 = load i32*, i32** %12
%14 = call i32 @fputs(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i32* %13)
%15 = load i32**, i32*** %3
%16 = load i32*, i32** %15
%17 = call i32 @fputs(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32* %16)
%18 = load i32**, i32*** %3
%19 = load i32*, i32** %18
%20 = call i32 @fputs(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i32 0, i32 0), i32* %19)
%21 = load i32**, i32*** %3
%22 = load i32*, i32** %21
%23 = call i32 @fputs(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i32 0, i64 5), i32* %22)
%24 = load i32**, i32*** %3
%25 = load i32*, i32** %24
%26 = call i32 @fputs(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i32 0, i64 10), i32* %25)
%27 = load i32**, i32*** %3
%28 = load i32*, i32** %27
%29 = call i32 @fputs(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i32 0, i64 11), i32* %28)
%30 = load i32**, i32*** %3
%31 = getelementptr inbounds i32*, i32** %30, i32 1
store i32** %31, i32*** %3
%32 = load i32*, i32** %30
%33 = call i32 @fputs(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i32* %32)
%34 = load i32**, i32*** %3
%35 = getelementptr inbounds [2 x i32*], [2 x i32*]* %2, i64 0, i64 0
%36 = getelementptr inbounds i32*, i32** %35, i64 1
%37 = icmp ne i32** %34, %36
br i1 %37, label %42, label %38
38: ; preds = %0
%39 = load i32**, i32*** %3
%40 = load i32*, i32** %39
%41 = icmp ne i32* %40, null
br i1 %41, label %42, label %44
42: ; preds = %38, %0
%43 = call i32 (...) @abort()
unreachable
44: ; preds = %38
%45 = getelementptr inbounds [2 x i32*], [2 x i32*]* %2, i64 0, i64 0
store i32** %45, i32*** %3
%46 = load i32**, i32*** %3
%47 = getelementptr inbounds i32*, i32** %46, i32 1
store i32** %47, i32*** %3
%48 = load i32*, i32** %46
%49 = call i32 @fputs(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i32* %48)
%50 = load i32**, i32*** %3
%51 = getelementptr inbounds [2 x i32*], [2 x i32*]* %2, i64 0, i64 0
%52 = getelementptr inbounds i32*, i32** %51, i64 1
%53 = icmp ne i32** %50, %52
br i1 %53, label %58, label %54
54: ; preds = %44
%55 = load i32**, i32*** %3
%56 = load i32*, i32** %55
%57 = icmp ne i32* %56, null
br i1 %57, label %58, label %60
58: ; preds = %54, %44
%59 = call i32 (...) @abort()
unreachable
60: ; preds = %54
%61 = getelementptr inbounds [2 x i32*], [2 x i32*]* %2, i64 0, i64 0
store i32** %61, i32*** %3
%62 = load i32**, i32*** %3
%63 = getelementptr inbounds i32*, i32** %62, i32 1
store i32** %63, i32*** %3
%64 = load i32*, i32** %62
%65 = call i32 @fputs(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i32* %64)
%66 = load i32**, i32*** %3
%67 = getelementptr inbounds [2 x i32*], [2 x i32*]* %2, i64 0, i64 0
%68 = getelementptr inbounds i32*, i32** %67, i64 1
%69 = icmp ne i32** %66, %68
br i1 %69, label %74, label %70
70: ; preds = %60
%71 = load i32**, i32*** %3
%72 = load i32*, i32** %71
%73 = icmp ne i32* %72, null
br i1 %73, label %74, label %76
74: ; preds = %70, %60
%75 = call i32 (...) @abort()
unreachable
76: ; preds = %70
%77 = getelementptr inbounds [2 x i32*], [2 x i32*]* %2, i64 0, i64 0
store i32** %77, i32*** %3
%78 = load i32**, i32*** %3
%79 = load i32*, i32** %78
%80 = call i32 @__builtin_fputs(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i32* %79)
%81 = load i32**, i32*** %3
%82 = load i32*, i32** %81
%83 = call i32 @__builtin_fputc(i8 signext 10, i32* %82)
%84 = load i32**, i32*** %3
%85 = load i32*, i32** %84
%86 = call i32 @__builtin_fwrite(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i32 1, i32 6, i32* %85)
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32* null
@.str = [12 x i8] c"hello world\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.3 = [4 x i8] c"bye\00"
@.str.4 = [7 x i8] c"hello\0A\00"
define i32 @main() {
%1 = load i32*, i32** @stdout
%2 = tail call i32 @fputc(i32 10, i32* %1)
%3 = tail call i64 @fwrite(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i64 3, i64 1, i32* %1)
%4 = tail call i64 @fwrite(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i64 11, i64 1, i32* %1)
%5 = tail call i64 @fwrite(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 5), i64 6, i64 1, i32* %1)
%6 = tail call i32 @fputc(i32 100, i32* %1)
%7 = tail call i32 @fputc(i32 10, i32* %1)
%8 = tail call i64 @fwrite(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i64 6, i64 1, i32* %1)
%9 = tail call i32 @__builtin_fputs(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%10 = tail call i32 @__builtin_fputc(i8 signext 10, i32* %1)
%11 = tail call i32 @__builtin_fwrite(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i32 1, i32 6, i32* %1)
ret i32 0
}