#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 */
struct session {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ socket_printf(struct session *, int, char *, int, int, int,
                                 int, int);
int /*<<< orphan*/ telopt_debug(struct session *, char *);
int send_ip(struct session *ses, int cplen, unsigned char *cpsrc) {
  socket_printf(ses, 5, "%c%c%c%c%c", 255, 244, 255, 253, 6);
  telopt_debug(ses, "SENT IAC IP");
  telopt_debug(ses, "SENT IAC DO TIMING MARK");
  return 3;
}


x86 assembly (clang, -O0):
<send_ip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x5,%esi
lea    0xebd(%rip),%rdx
mov    $0xff,%r9d
mov    $0xf4,%r8d
mov    %r9d,%ecx
movl   $0xfd,(%rsp)
movl   $0x6,0x8(%rsp)
call   1040 <socket_printf@plt>
mov    -0x8(%rbp),%rdi
lea    0xe9a(%rip),%rsi
call   1030 <telopt_debug@plt>
mov    -0x8(%rbp),%rdi
lea    0xe96(%rip),%rsi
call   1030 <telopt_debug@plt>
mov    $0x3,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_ip>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdx
mov    $0x5,%esi
mov    $0xff,%ecx
mov    $0xf4,%r8d
mov    $0xff,%r9d
push   $0x6
push   $0xfd
call   1040 <socket_printf@plt>
add    $0x10,%rsp
lea    0xeb3(%rip),%rsi
mov    %rbx,%rdi
call   1030 <telopt_debug@plt>
lea    0xeb0(%rip),%rsi
mov    %rbx,%rdi
call   1030 <telopt_debug@plt>
mov    $0x3,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.session = type { i32 }
@.str = [11 x i8] c"%c%c%c%c%c\00"
@.str.1 = [12 x i8] c"SENT IAC IP\00"
@.str.2 = [24 x i8] c"SENT IAC DO TIMING MARK\00"
define i32 @send_ip(%struct.session* %0, i32 %1, i8* %2) {
%4 = alloca %struct.session*
%5 = alloca i32
%6 = alloca i8*
store %struct.session* %0, %struct.session** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load %struct.session*, %struct.session** %4
%8 = call i32 @socket_printf(%struct.session* %7, i32 5, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 255, i32 244, i32 255, i32 253, i32 6)
%9 = load %struct.session*, %struct.session** %4
%10 = call i32 @telopt_debug(%struct.session* %9, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%11 = load %struct.session*, %struct.session** %4
%12 = call i32 @telopt_debug(%struct.session* %11, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
ret i32 3
}

LLVM IR (-O2):
%struct.session = type { i32 }
@.str = [11 x i8] c"%c%c%c%c%c\00"
@.str.1 = [12 x i8] c"SENT IAC IP\00"
@.str.2 = [24 x i8] c"SENT IAC DO TIMING MARK\00"
define i32 @send_ip(%struct.session* %0, i32 %1, i8* nocapture readnone %2) {
%4 = tail call i32 @socket_printf(%struct.session* %0, i32 5, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 255, i32 244, i32 255, i32 253, i32 6)
%5 = tail call i32 @telopt_debug(%struct.session* %0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @telopt_debug(%struct.session* %0, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
ret i32 3
}