#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 */
char *email_sendmail_command(char *, char *, char *);
char *email_sendmail_string(char *, char *, char *, char *, char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, char *, char *);
scalar_t__ system(char *);
void email_sendmail(char *from_address, char *to_address, char *subject,
                    char *message, char *reply_to, char *self_full_name,
                    char *attachment_filename) {
  char sys_string[1024];
  char *sendmail_command;
  char *sendmail_string;
  sendmail_command =
      email_sendmail_command(to_address, subject, attachment_filename);
  sendmail_string = email_sendmail_string(from_address, to_address, subject,
                                          message, reply_to, self_full_name);
  sprintf(sys_string, "echo \"%s\" | %s", sendmail_string, sendmail_command);
  if (system(sys_string)) {
  };
}


x86 assembly (clang, -O0):
<email_sendmail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x440,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    0x10(%rbp),%rdx
call   1050 <email_sendmail_command@plt>
mov    %rax,-0x438(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
call   1040 <email_sendmail_string@plt>
mov    %rax,-0x440(%rbp)
lea    -0x430(%rbp),%rdi
mov    -0x440(%rbp),%rdx
mov    -0x438(%rbp),%rcx
lea    0xe41(%rip),%rsi
call   1060 <sprintf@plt>
lea    -0x430(%rbp),%rdi
call   1030 <system@plt>
cmp    $0x0,%rax
je     11df <email_sendmail+0x9f>
jmp    11df <email_sendmail+0x9f>
add    $0x440,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<email_sendmail>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x418,%rsp
mov    %r9,0x8(%rsp)
mov    %r8,%r15
mov    %rcx,%r12
mov    %rdx,%r13
mov    %rsi,%rbx
mov    %rdi,%rbp
mov    0x450(%rsp),%rdx
mov    %rsi,%rdi
mov    %r13,%rsi
call   1050 <email_sendmail_command@plt>
mov    %rax,%r14
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r13,%rdx
mov    %r12,%rcx
mov    %r15,%r8
mov    0x8(%rsp),%r9
call   1040 <email_sendmail_string@plt>
lea    0xe65(%rip),%rsi
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    %rax,%rdx
mov    %r14,%rcx
call   1060 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
add    $0x418,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [15 x i8] c"echo \22%s\22 | %s\00"
define void @email_sendmail(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4, i8* %5, i8* %6) {
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i8*
%15 = alloca [1024 x i8]
%16 = alloca i8*
%17 = alloca i8*
store i8* %0, i8** %8
store i8* %1, i8** %9
store i8* %2, i8** %10
store i8* %3, i8** %11
store i8* %4, i8** %12
store i8* %5, i8** %13
store i8* %6, i8** %14
%18 = load i8*, i8** %9
%19 = load i8*, i8** %10
%20 = load i8*, i8** %14
%21 = call i8* @email_sendmail_command(i8* %18, i8* %19, i8* %20)
store i8* %21, i8** %16
%22 = load i8*, i8** %8
%23 = load i8*, i8** %9
%24 = load i8*, i8** %10
%25 = load i8*, i8** %11
%26 = load i8*, i8** %12
%27 = load i8*, i8** %13
%28 = call i8* @email_sendmail_string(i8* %22, i8* %23, i8* %24, i8* %25, i8* %26, i8* %27)
store i8* %28, i8** %17
%29 = getelementptr inbounds [1024 x i8], [1024 x i8]* %15, i64 0, i64 0
%30 = load i8*, i8** %17
%31 = load i8*, i8** %16
%32 = call i32 @sprintf(i8* %29, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %30, i8* %31)
%33 = getelementptr inbounds [1024 x i8], [1024 x i8]* %15, i64 0, i64 0
%34 = call i64 @system(i8* %33)
%35 = icmp ne i64 %34, 0
br i1 %35, label %36, label %37
36: ; preds = %7
br label %37
37: ; preds = %36, %7
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"echo \22%s\22 | %s\00"
define void @email_sendmail(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4, i8* %5, i8* %6) {
%8 = alloca [1024 x i8]
%9 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%10 = tail call i8* @email_sendmail_command(i8* %1, i8* %2, i8* %6)
%11 = tail call i8* @email_sendmail_string(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4, i8* %5)
%12 = call i32 @sprintf(i8* %9, i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %11, i8* %10)
%13 = call i64 @system(i8* %9)
ret void
}