#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*/ Logit(char *, char const *, char const *, char const *);
int mail_spool(char *, char const *, char const *, void *, char const *);
int /*<<< orphan*/ safestring(char const *);
int mail_asn(const char *addr, const char *subj, const char *fname) {
  char nbuf[1024];
  int ret;
  ret = 0;
  Logit("Mail_asn(%s,%s,%s)", addr, subj, fname);
  if (!addr || !*addr || !safestring(addr))
    return -1;
  ret = mail_spool(nbuf, addr, subj, ((void *)0), fname);
  return ret;
}


x86 assembly (clang, -O0):
<mail_asn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x430,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
movl   $0x0,-0x424(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
lea    0xe9c(%rip),%rdi
call   1050 <Logit@plt>
cmpq   $0x0,-0x10(%rbp)
je     1193 <mail_asn+0x63>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1193 <mail_asn+0x63>
mov    -0x10(%rbp),%rdi
call   1040 <safestring@plt>
cmp    $0x0,%eax
jne    119f <mail_asn+0x6f>
movl   $0xffffffff,-0x4(%rbp)
jmp    11ca <mail_asn+0x9a>
lea    -0x420(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%r8
xor    %eax,%eax
mov    %eax,%ecx
call   1030 <mail_spool@plt>
mov    %eax,-0x424(%rbp)
mov    -0x424(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x430,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mail_asn>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x408,%rsp
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
lea    0xeb3(%rip),%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
call   1050 <Logit@plt>
mov    $0xffffffff,%ebp
test   %rbx,%rbx
je     118b <mail_asn+0x5b>
cmpb   $0x0,(%rbx)
je     118b <mail_asn+0x5b>
mov    %rbx,%rdi
call   1040 <safestring@plt>
test   %eax,%eax
je     118b <mail_asn+0x5b>
mov    %rsp,%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
xor    %ecx,%ecx
mov    %r14,%r8
call   1030 <mail_spool@plt>
mov    %eax,%ebp
mov    %ebp,%eax
add    $0x408,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [19 x i8] c"Mail_asn(%s,%s,%s)\00"
define i32 @mail_asn(i8* %0, i8* %1, i8* %2) {
%4 = alloca [1024 x i8]
%5 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%6 = tail call i32 @Logit(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i8* %2)
%7 = icmp eq i8* %0, null
br i1 %7, label %16, label %8
8: ; preds = %3
%9 = load i8, i8* %0
%10 = icmp eq i8 %9, 0
br i1 %10, label %16, label %11
11: ; preds = %8
%12 = tail call i32 @safestring(i8* %0)
%13 = icmp eq i32 %12, 0
br i1 %13, label %16, label %14
14: ; preds = %11
%15 = call i32 @mail_spool(i8* %5, i8* %0, i8* %1, i8* null, i8* %2)
br label %16
16: ; preds = %3, %8, %11, %14
%17 = phi i32 [ %15, %14 ], [ -1, %11 ], [ -1, %8 ], [ -1, %3 ]
ret i32 %17
}