#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 *, char *, ...);
void write_header(FILE *sfp, char *mail_alias, char *delta, int pce,
                  int npieces) {
  fprintf(sfp, "From: owner-%s\n", mail_alias);
  fprintf(sfp, "To: %s\n", mail_alias);
  fprintf(sfp, "Subject: ctm-mail %s %d/%d\n\n", delta, pce, npieces);
  fprintf(sfp, "CTM_MAIL BEGIN %s %d %d\n", delta, pce, npieces);
}


x86 assembly (clang, -O0):
<write_header>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xec6(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xec0(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x20(%rbp),%r8d
lea    0xeab(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x20(%rbp),%r8d
lea    0xeab(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_header>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %r8d,%r14d
mov    %ecx,%r15d
mov    %rdx,%r12
mov    %rsi,%rbp
mov    %rdi,%rbx
lea    0xed2(%rip),%rsi
mov    %rbp,%rdx
xor    %eax,%eax
call   1030 <fprintf@plt>
lea    0xed1(%rip),%rsi
mov    %rbx,%rdi
mov    %rbp,%rdx
xor    %eax,%eax
call   1030 <fprintf@plt>
lea    0xec5(%rip),%rsi
mov    %rbx,%rdi
mov    %r12,%rdx
mov    %r15d,%ecx
mov    %r14d,%r8d
xor    %eax,%eax
call   1030 <fprintf@plt>
lea    0xec8(%rip),%rsi
mov    %rbx,%rdi
mov    %r12,%rdx
mov    %r15d,%ecx
mov    %r14d,%r8d
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"From: owner-%s\0A\00"
@.str.1 = [8 x i8] c"To: %s\0A\00"
@.str.2 = [29 x i8] c"Subject: ctm-mail %s %d/%d\0A\0A\00"
@.str.3 = [25 x i8] c"CTM_MAIL BEGIN %s %d %d\0A\00"
define void @write_header(i32* %0, i8* %1, i8* %2, i32 %3, i32 %4) {
%6 = alloca i32*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
store i32* %0, i32** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i32*, i32** %6
%12 = load i8*, i8** %7
%13 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %11, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %12)
%14 = load i32*, i32** %6
%15 = load i8*, i8** %7
%16 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %14, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %15)
%17 = load i32*, i32** %6
%18 = load i8*, i8** %8
%19 = load i32, i32* %9
%20 = load i32, i32* %10
%21 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %17, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i8* %18, i32 %19, i32 %20)
%22 = load i32*, i32** %6
%23 = load i8*, i8** %8
%24 = load i32, i32* %9
%25 = load i32, i32* %10
%26 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %22, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0), i8* %23, i32 %24, i32 %25)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"From: owner-%s\0A\00"
@.str.1 = [8 x i8] c"To: %s\0A\00"
@.str.2 = [29 x i8] c"Subject: ctm-mail %s %d/%d\0A\0A\00"
@.str.3 = [25 x i8] c"CTM_MAIL BEGIN %s %d %d\0A\00"
define void @write_header(i32* nocapture %0, i8* %1, i8* %2, i32 %3, i32 %4) {
%6 = tail call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %1)
%7 = tail call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%8 = tail call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i8* %2, i32 %3, i32 %4)
%9 = tail call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0), i8* %2, i32 %3, i32 %4)
ret void
}