#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*/ I3_write_buffer(char *);
void I3_write_header(char *identifier, char *originator_mudname,
                     char *originator_username, char *target_mudname,
                     char *target_username) {
  I3_write_buffer("({\"");
  I3_write_buffer(identifier);
  I3_write_buffer("\",5,");
  if (originator_mudname) {
    I3_write_buffer("\"");
    I3_write_buffer(originator_mudname);
    I3_write_buffer("\",");
  } else
    I3_write_buffer("0,");
  if (originator_username) {
    I3_write_buffer("\"");
    I3_write_buffer(originator_username);
    I3_write_buffer("\",");
  } else
    I3_write_buffer("0,");
  if (target_mudname) {
    I3_write_buffer("\"");
    I3_write_buffer(target_mudname);
    I3_write_buffer("\",");
  } else
    I3_write_buffer("0,");
  if (target_username) {
    I3_write_buffer("\"");
    I3_write_buffer(target_username);
    I3_write_buffer("\",");
  } else
    I3_write_buffer("0,");
}


x86 assembly (clang, -O0):
<I3_write_header>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <I3_write_buffer@plt>
mov    -0x8(%rbp),%rdi
call   1030 <I3_write_buffer@plt>
lea    0xebc(%rip),%rdi
call   1030 <I3_write_buffer@plt>
cmpq   $0x0,-0x10(%rbp)
je     117e <I3_write_header+0x6e>
lea    0xea3(%rip),%rdi
call   1030 <I3_write_buffer@plt>
mov    -0x10(%rbp),%rdi
call   1030 <I3_write_buffer@plt>
lea    0xe95(%rip),%rdi
call   1030 <I3_write_buffer@plt>
jmp    118a <I3_write_header+0x7a>
lea    0xe87(%rip),%rdi
call   1030 <I3_write_buffer@plt>
cmpq   $0x0,-0x18(%rbp)
je     11bb <I3_write_header+0xab>
lea    0xe66(%rip),%rdi
call   1030 <I3_write_buffer@plt>
mov    -0x18(%rbp),%rdi
call   1030 <I3_write_buffer@plt>
lea    0xe58(%rip),%rdi
call   1030 <I3_write_buffer@plt>
jmp    11c7 <I3_write_header+0xb7>
lea    0xe4a(%rip),%rdi
call   1030 <I3_write_buffer@plt>
cmpq   $0x0,-0x20(%rbp)
je     11f8 <I3_write_header+0xe8>
lea    0xe29(%rip),%rdi
call   1030 <I3_write_buffer@plt>
mov    -0x20(%rbp),%rdi
call   1030 <I3_write_buffer@plt>
lea    0xe1b(%rip),%rdi
call   1030 <I3_write_buffer@plt>
jmp    1204 <I3_write_header+0xf4>
lea    0xe0d(%rip),%rdi
call   1030 <I3_write_buffer@plt>
cmpq   $0x0,-0x28(%rbp)
je     1235 <I3_write_header+0x125>
lea    0xdec(%rip),%rdi
call   1030 <I3_write_buffer@plt>
mov    -0x28(%rbp),%rdi
call   1030 <I3_write_buffer@plt>
lea    0xdde(%rip),%rdi
call   1030 <I3_write_buffer@plt>
jmp    1241 <I3_write_header+0x131>
lea    0xdd0(%rip),%rdi
call   1030 <I3_write_buffer@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<I3_write_header>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %r8,%r14
mov    %rcx,%r15
mov    %rdx,%r12
mov    %rsi,%r13
mov    %rdi,%rbx
lea    0xed1(%rip),%rdi
call   1030 <I3_write_buffer@plt>
mov    %rbx,%rdi
call   1030 <I3_write_buffer@plt>
lea    0xec1(%rip),%rdi
call   1030 <I3_write_buffer@plt>
lea    0xebd(%rip),%rbx
mov    %rbx,%rdi
test   %r13,%r13
je     1172 <I3_write_header+0x62>
lea    0xea4(%rip),%rdi
call   1030 <I3_write_buffer@plt>
mov    %r13,%rdi
call   1030 <I3_write_buffer@plt>
lea    0xe97(%rip),%rdi
call   1030 <I3_write_buffer@plt>
mov    %rbx,%rdi
test   %r12,%r12
je     119a <I3_write_header+0x8a>
lea    0xe7c(%rip),%rdi
call   1030 <I3_write_buffer@plt>
mov    %r12,%rdi
call   1030 <I3_write_buffer@plt>
lea    0xe6f(%rip),%rdi
call   1030 <I3_write_buffer@plt>
mov    %rbx,%rdi
test   %r15,%r15
je     11c2 <I3_write_header+0xb2>
lea    0xe54(%rip),%rdi
call   1030 <I3_write_buffer@plt>
mov    %r15,%rdi
call   1030 <I3_write_buffer@plt>
lea    0xe47(%rip),%rdi
call   1030 <I3_write_buffer@plt>
test   %r14,%r14
je     11e7 <I3_write_header+0xd7>
lea    0xe2f(%rip),%rdi
call   1030 <I3_write_buffer@plt>
mov    %r14,%rdi
call   1030 <I3_write_buffer@plt>
lea    0xe22(%rip),%rbx
mov    %rbx,%rdi
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
jmp    1030 <I3_write_buffer@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"({\22\00"
@.str.1 = [5 x i8] c"\22,5,\00"
@.str.2 = [2 x i8] c"\22\00"
@.str.3 = [3 x i8] c"\22,\00"
@.str.4 = [3 x i8] c"0,\00"
define void @I3_write_header(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
store i8* %0, i8** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store i8* %4, i8** %10
%11 = call i32 @I3_write_buffer(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%12 = load i8*, i8** %6
%13 = call i32 @I3_write_buffer(i8* %12)
%14 = call i32 @I3_write_buffer(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%15 = load i8*, i8** %7
%16 = icmp ne i8* %15, null
br i1 %16, label %17, label %22
17: ; preds = %5
%18 = call i32 @I3_write_buffer(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%19 = load i8*, i8** %7
%20 = call i32 @I3_write_buffer(i8* %19)
%21 = call i32 @I3_write_buffer(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
br label %24
22: ; preds = %5
%23 = call i32 @I3_write_buffer(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
br label %24
24: ; preds = %22, %17
%25 = load i8*, i8** %8
%26 = icmp ne i8* %25, null
br i1 %26, label %27, label %32
27: ; preds = %24
%28 = call i32 @I3_write_buffer(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%29 = load i8*, i8** %8
%30 = call i32 @I3_write_buffer(i8* %29)
%31 = call i32 @I3_write_buffer(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
br label %34
32: ; preds = %24
%33 = call i32 @I3_write_buffer(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
br label %34
34: ; preds = %32, %27
%35 = load i8*, i8** %9
%36 = icmp ne i8* %35, null
br i1 %36, label %37, label %42
37: ; preds = %34
%38 = call i32 @I3_write_buffer(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%39 = load i8*, i8** %9
%40 = call i32 @I3_write_buffer(i8* %39)
%41 = call i32 @I3_write_buffer(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
br label %44
42: ; preds = %34
%43 = call i32 @I3_write_buffer(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
br label %44
44: ; preds = %42, %37
%45 = load i8*, i8** %10
%46 = icmp ne i8* %45, null
br i1 %46, label %47, label %52
47: ; preds = %44
%48 = call i32 @I3_write_buffer(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%49 = load i8*, i8** %10
%50 = call i32 @I3_write_buffer(i8* %49)
%51 = call i32 @I3_write_buffer(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
br label %54
52: ; preds = %44
%53 = call i32 @I3_write_buffer(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
br label %54
54: ; preds = %52, %47
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"({\22\00"
@.str.1 = [5 x i8] c"\22,5,\00"
@.str.2 = [2 x i8] c"\22\00"
@.str.3 = [3 x i8] c"\22,\00"
@.str.4 = [3 x i8] c"0,\00"
define void @I3_write_header(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4) {
%6 = tail call i32 @I3_write_buffer(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @I3_write_buffer(i8* %0)
%8 = tail call i32 @I3_write_buffer(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%9 = icmp eq i8* %1, null
br i1 %9, label %13, label %10
10: ; preds = %5
%11 = tail call i32 @I3_write_buffer(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%12 = tail call i32 @I3_write_buffer(i8* %1)
br label %13
13: ; preds = %5, %10
%14 = phi i8* [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), %10 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), %5 ]
%15 = tail call i32 @I3_write_buffer(i8* %14)
%16 = icmp eq i8* %2, null
br i1 %16, label %20, label %17
17: ; preds = %13
%18 = tail call i32 @I3_write_buffer(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%19 = tail call i32 @I3_write_buffer(i8* %2)
br label %20
20: ; preds = %13, %17
%21 = phi i8* [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), %17 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), %13 ]
%22 = tail call i32 @I3_write_buffer(i8* %21)
%23 = icmp eq i8* %3, null
br i1 %23, label %27, label %24
24: ; preds = %20
%25 = tail call i32 @I3_write_buffer(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%26 = tail call i32 @I3_write_buffer(i8* %3)
br label %27
27: ; preds = %20, %24
%28 = phi i8* [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), %24 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), %20 ]
%29 = tail call i32 @I3_write_buffer(i8* %28)
%30 = icmp eq i8* %4, null
br i1 %30, label %34, label %31
31: ; preds = %27
%32 = tail call i32 @I3_write_buffer(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%33 = tail call i32 @I3_write_buffer(i8* %4)
br label %34
34: ; preds = %27, %31
%35 = phi i8* [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), %31 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), %27 ]
%36 = tail call i32 @I3_write_buffer(i8* %35)
ret void
}