void write_header(filename) char *filename;
{
  static int first_file = 1;
  if (first_file) {
    xwrite(1, "==> ", 4);
    first_file = 0;
  } else
    xwrite(1, "\n==> ", 5);
  xwrite(1, filename, strlen(filename));
  xwrite(1, " <==\n", 5);
}


x86 assembly (clang, -O0):
<write_header>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpl   $0x0,0x2efd(%rip)
je     1160 <write_header+0x40>
mov    $0x1,%edi
lea    0xebc(%rip),%rsi
mov    $0x4,%edx
mov    $0x0,%al
call   1030 <xwrite@plt>
movl   $0x0,0x2ed5(%rip)
jmp    1178 <write_header+0x58>
mov    $0x1,%edi
lea    0xe94(%rip),%rsi
mov    $0x5,%edx
mov    $0x0,%al
call   1030 <xwrite@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x10(%rbp),%rsi
mov    %rax,%rdx
mov    $0x1,%edi
mov    $0x0,%al
call   1030 <xwrite@plt>
mov    $0x1,%edi
lea    0xe5e(%rip),%rsi
mov    $0x5,%edx
mov    $0x0,%al
call   1030 <xwrite@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_header>:
push   %rbx
mov    %rdi,%rbx
cmpb   $0x0,0x2f09(%rip)
je     1147 <write_header+0x27>
lea    0xecc(%rip),%rsi
mov    $0x1,%edi
mov    $0x5,%edx
xor    %eax,%eax
call   1030 <xwrite@plt>
jmp    1166 <write_header+0x46>
lea    0xeb3(%rip),%rsi
mov    $0x1,%edi
mov    $0x4,%edx
xor    %eax,%eax
call   1030 <xwrite@plt>
movb   $0x1,0x2ece(%rip)
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %rax,%rdx
xor    %eax,%eax
call   1030 <xwrite@plt>
lea    0xe7f(%rip),%rsi
mov    $0x1,%edi
mov    $0x5,%edx
xor    %eax,%eax
pop    %rbx
jmp    1030 <xwrite@plt>

LLVM IR (-O0):
@write_header.first_file = internal global i32 1
@.str = [5 x i8] c"==> \00"
@.str.1 = [6 x i8] c"\0A==> \00"
@.str.2 = [6 x i8] c" <==\0A\00"
define void @write_header(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @write_header.first_file
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @xwrite to i32 (i32, i8*, i32, ...)*)(i32 1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
store i32 0, i32* @write_header.first_file
br label %9
7: ; preds = %1
%8 = call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @xwrite to i32 (i32, i8*, i32, ...)*)(i32 1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 5)
br label %9
9: ; preds = %7, %5
%10 = load i8*, i8** %2
%11 = load i8*, i8** %2
%12 = call i64 @strlen(i8* %11)
%13 = call i32 (i32, i8*, i64, ...) bitcast (i32 (...)* @xwrite to i32 (i32, i8*, i64, ...)*)(i32 1, i8* %10, i64 %12)
%14 = call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @xwrite to i32 (i32, i8*, i32, ...)*)(i32 1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 5)
ret void
}

LLVM IR (-O2):
@write_header.first_file = internal unnamed_addr global i1 false
@.str = [5 x i8] c"==> \00"
@.str.1 = [6 x i8] c"\0A==> \00"
@.str.2 = [6 x i8] c" <==\0A\00"
define void @write_header(i8* %0) {
%2 = load i1, i1* @write_header.first_file
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @xwrite to i32 (i32, i8*, i32, ...)*)(i32 1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
store i1 true, i1* @write_header.first_file
br label %7
5: ; preds = %1
%6 = tail call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @xwrite to i32 (i32, i8*, i32, ...)*)(i32 1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 5)
br label %7
7: ; preds = %5, %3
%8 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%9 = tail call i32 (i32, i8*, i64, ...) bitcast (i32 (...)* @xwrite to i32 (i32, i8*, i64, ...)*)(i32 1, i8* %0, i64 %8)
%10 = tail call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @xwrite to i32 (i32, i8*, i32, ...)*)(i32 1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 5)
ret void
}