#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*/ send(int, char *, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strlen(char *);
int do_ehlo(int fd, char *param) {
  char res[512] = {'\0'};
  strcat(res, "250-ch.com\r\n");
  strcat(res, "250-mail\r\n");
  strcat(res, "250-PIPELINING\r\n");
  strcat(res, "250-8BITMIME\r\n");
  strcat(res, "250-AUTH printfIN PLAIN\r\n");
  strcat(res, "250-AUTH=printfIN PLAIN\r\n");
  strcat(res, "250 STARTTLS cc35dfcd-7df9-48a2-afd2-c129da541a0f\r\n");
  send(fd, res, strlen(res), 0);
  return 0;
}


x86 assembly (clang, -O0):
<do_ehlo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x220,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x210(%rbp),%rdi
xor    %esi,%esi
mov    $0x200,%edx
call   1050 <memset@plt>
lea    -0x210(%rbp),%rdi
lea    0xe8d(%rip),%rsi
call   1060 <strcat@plt>
lea    -0x210(%rbp),%rdi
lea    0xe87(%rip),%rsi
call   1060 <strcat@plt>
lea    -0x210(%rbp),%rdi
lea    0xe7f(%rip),%rsi
call   1060 <strcat@plt>
lea    -0x210(%rbp),%rdi
lea    0xe7d(%rip),%rsi
call   1060 <strcat@plt>
lea    -0x210(%rbp),%rdi
lea    0xe79(%rip),%rsi
call   1060 <strcat@plt>
lea    -0x210(%rbp),%rdi
lea    0xe80(%rip),%rsi
call   1060 <strcat@plt>
lea    -0x210(%rbp),%rdi
lea    0xe87(%rip),%rsi
call   1060 <strcat@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x21c(%rbp)
lea    -0x210(%rbp),%rax
mov    %rax,-0x218(%rbp)
lea    -0x210(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x21c(%rbp),%edi
mov    -0x218(%rbp),%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1040 <send@plt>
xor    %eax,%eax
add    $0x220,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_ehlo>:
push   %rbp
push   %rbx
sub    $0x208,%rsp
mov    %edi,%ebp
mov    %rsp,%rbx
mov    $0x200,%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1050 <memset@plt>
lea    0xe9c(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strcat@plt>
lea    0xe9a(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strcat@plt>
lea    0xe96(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strcat@plt>
lea    0xe98(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strcat@plt>
lea    0xe98(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strcat@plt>
lea    0xea3(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strcat@plt>
lea    0xeae(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strcat@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1040 <send@plt>
xor    %eax,%eax
add    $0x208,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [13 x i8] c"250-ch.com\0D\0A\00"
@.str.1 = [11 x i8] c"250-mail\0D\0A\00"
@.str.2 = [17 x i8] c"250-PIPELINING\0D\0A\00"
@.str.3 = [15 x i8] c"250-8BITMIME\0D\0A\00"
@.str.4 = [26 x i8] c"250-AUTH printfIN PLAIN\0D\0A\00"
@.str.5 = [26 x i8] c"250-AUTH=printfIN PLAIN\0D\0A\00"
@.str.6 = [52 x i8] c"250 STARTTLS cc35dfcd-7df9-48a2-afd2-c129da541a0f\0D\0A\00"
define i32 @do_ehlo(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca [512 x i8]
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = bitcast [512 x i8]* %5 to i8*
%7 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%8 = call i32 @strcat(i8* %7, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%9 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%10 = call i32 @strcat(i8* %9, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%11 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%12 = call i32 @strcat(i8* %11, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
%13 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%14 = call i32 @strcat(i8* %13, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
%15 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%16 = call i32 @strcat(i8* %15, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0))
%17 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%18 = call i32 @strcat(i8* %17, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0))
%19 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%20 = call i32 @strcat(i8* %19, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.6, i64 0, i64 0))
%21 = load i32, i32* %3
%22 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%23 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%24 = call i32 @strlen(i8* %23)
%25 = call i32 @send(i32 %21, i8* %22, i32 %24, i32 0)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"250-ch.com\0D\0A\00"
@.str.1 = [11 x i8] c"250-mail\0D\0A\00"
@.str.2 = [17 x i8] c"250-PIPELINING\0D\0A\00"
@.str.3 = [15 x i8] c"250-8BITMIME\0D\0A\00"
@.str.4 = [26 x i8] c"250-AUTH printfIN PLAIN\0D\0A\00"
@.str.5 = [26 x i8] c"250-AUTH=printfIN PLAIN\0D\0A\00"
@.str.6 = [52 x i8] c"250 STARTTLS cc35dfcd-7df9-48a2-afd2-c129da541a0f\0D\0A\00"
define i32 @do_ehlo(i32 %0, i8* nocapture readnone %1) {
%3 = alloca [512 x i8]
%4 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%5 = call i32 @strcat(i8* %4, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @strcat(i8* %4, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @strcat(i8* %4, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @strcat(i8* %4, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
%9 = call i32 @strcat(i8* %4, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0))
%10 = call i32 @strcat(i8* %4, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0))
%11 = call i32 @strcat(i8* %4, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.6, i64 0, i64 0))
%12 = call i32 @strlen(i8* %4)
%13 = call i32 @send(i32 %0, i8* %4, i32 %12, i32 0)
ret i32 0
}