#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*/ sendemail(char *, char *, char *, char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, char *, char *, char *, char *,
                           char *);
int server(char *IP, char *from, char *passwd, char *to, char *title,
           char *body1) {
  char *email = to;
  char body[1000];
  sprintf(
      body,
      "From: \"RaspBerryPi\"<%s>\r\nTo: \"%s\"<%s>\r\nSubject: %s\r\n\r\n%s",
      from, to, to, title, body1);
  sendemail(email, body, from, passwd, IP);
  return 0;
}


x86 assembly (clang, -O0):
<server>:
push   %rbp
mov    %rsp,%rbp
sub    $0x430,%rsp
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    -0x20(%rbp),%rax
mov    %rax,-0x38(%rbp)
lea    -0x420(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9
mov    -0x30(%rbp),%rax
lea    0xe93(%rip),%rsi
mov    %rax,(%rsp)
call   1030 <sprintf@plt>
mov    -0x38(%rbp),%rdi
lea    -0x420(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%r8
call   1040 <sendemail@plt>
xor    %eax,%eax
add    $0x430,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<server>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x400,%rsp
mov    %r8,%rax
mov    %rcx,%rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%r12
mov    %r9,(%rsp)
lea    0xeb6(%rip),%rsi
lea    0x10(%rsp),%r13
mov    %r13,%rdi
mov    %r15,%rdx
mov    %rcx,%r8
mov    %rax,%r9
call   1030 <sprintf@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
mov    %r12,%r8
call   1040 <sendemail@plt>
xor    %eax,%eax
add    $0x400,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [57 x i8] c"From: \22RaspBerryPi\22<%s>\0D\0ATo: \22%s\22<%s>\0D\0ASubject: %s\0D\0A\0D\0A%s\00"
define i32 @server(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4, i8* %5) {
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca [1000 x i8]
store i8* %0, i8** %7
store i8* %1, i8** %8
store i8* %2, i8** %9
store i8* %3, i8** %10
store i8* %4, i8** %11
store i8* %5, i8** %12
%15 = load i8*, i8** %10
store i8* %15, i8** %13
%16 = getelementptr inbounds [1000 x i8], [1000 x i8]* %14, i64 0, i64 0
%17 = load i8*, i8** %8
%18 = load i8*, i8** %10
%19 = load i8*, i8** %10
%20 = load i8*, i8** %11
%21 = load i8*, i8** %12
%22 = call i32 @sprintf(i8* %16, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i8* %17, i8* %18, i8* %19, i8* %20, i8* %21)
%23 = load i8*, i8** %13
%24 = getelementptr inbounds [1000 x i8], [1000 x i8]* %14, i64 0, i64 0
%25 = load i8*, i8** %8
%26 = load i8*, i8** %9
%27 = load i8*, i8** %7
%28 = call i32 @sendemail(i8* %23, i8* %24, i8* %25, i8* %26, i8* %27)
ret i32 0
}

LLVM IR (-O2):
@.str = [57 x i8] c"From: \22RaspBerryPi\22<%s>\0D\0ATo: \22%s\22<%s>\0D\0ASubject: %s\0D\0A\0D\0A%s\00"
define i32 @server(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4, i8* %5) {
%7 = alloca [1000 x i8]
%8 = getelementptr inbounds [1000 x i8], [1000 x i8]* %7, i64 0, i64 0
%9 = call i32 @sprintf(i8* %8, i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %3, i8* %3, i8* %4, i8* %5)
%10 = call i32 @sendemail(i8* %3, i8* %8, i8* %1, i8* %2, i8* %0)
ret i32 0
}