#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*/ fprintf(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ writebom(int /*<<< orphan*/ *);
void wordout_writeheader(FILE *outptr, int format) {
  if (format & (4))
    writebom(outptr);
  fprintf(outptr, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
  fprintf(outptr, "<b:Sources SelectedStyle=\"\" "
                  "xmlns:b=\"http://schemas.openxmlformats.org/officeDocument/"
                  "2006/bibliography\" "
                  " xmlns=\"http://schemas.openxmlformats.org/officeDocument/"
                  "2006/bibliography\" >\n");
}


x86 assembly (clang, -O0):
<wordout_writeheader>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0x4,%eax
cmp    $0x0,%eax
je     1147 <wordout_writeheader+0x27>
mov    -0x8(%rbp),%rdi
call   1030 <writebom@plt>
mov    -0x8(%rbp),%rdi
lea    0xeae(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xec6(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wordout_writeheader>:
push   %rbx
mov    %rdi,%rbx
test   $0x4,%sil
je     1132 <wordout_writeheader+0x12>
mov    %rbx,%rdi
call   1030 <writebom@plt>
lea    0xec7(%rip),%rdi
mov    $0x27,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
lea    0xed6(%rip),%rdi
mov    $0xb7,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
pop    %rbx
jmp    1040 <fwrite@plt>

LLVM IR (-O0):
@.str = [40 x i8] c"<?xml version=\221.0\22 encoding=\22UTF-8\22?>\0A\00"
@.str.1 = [184 x i8] c"<b:Sources SelectedStyle=\22\22 xmlns:b=\22http://schemas.openxmlformats.org/officeDocument/2006/bibliography\22 xmlns=\22http://schemas.openxmlformats.org/officeDocument/2006/bibliography\22 >\0A\00"
define void @wordout_writeheader(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = and i32 %5, 4
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i32*, i32** %3
%10 = call i32 @writebom(i32* %9)
br label %11
11: ; preds = %8, %2
%12 = load i32*, i32** %3
%13 = call i32 @fprintf(i32* %12, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%14 = load i32*, i32** %3
%15 = call i32 @fprintf(i32* %14, i8* getelementptr inbounds ([184 x i8], [184 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [40 x i8] c"<?xml version=\221.0\22 encoding=\22UTF-8\22?>\0A\00"
@.str.1 = [184 x i8] c"<b:Sources SelectedStyle=\22\22 xmlns:b=\22http://schemas.openxmlformats.org/officeDocument/2006/bibliography\22 xmlns=\22http://schemas.openxmlformats.org/officeDocument/2006/bibliography\22 >\0A\00"
define void @wordout_writeheader(i32* %0, i32 %1) {
%3 = and i32 %1, 4
%4 = icmp eq i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @writebom(i32* %0)
br label %7
7: ; preds = %5, %2
%8 = tail call i64 @fwrite(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i64 39, i64 1, i32* %0)
%9 = tail call i64 @fwrite(i8* getelementptr inbounds ([184 x i8], [184 x i8]* @.str.1, i64 0, i64 0), i64 183, i64 1, i32* %0)
ret void
}