#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 /*<<< orphan*/, char *, int, int);
int /*<<< orphan*/ telopt_debug(struct session *, char *);
int send_sb_tspeed(struct session *ses, int cplen, unsigned char *cpsrc) {
  socket_printf(ses, 17, "%c%c%c%c%s%c%c", 255, 250, 32, 0, "38400,38400", 255,
                240);
  telopt_debug(ses, "SENT IAC SB TSPEED");
  return 6;
}


x86 assembly (clang, -O0):
<send_sb_tspeed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x11,%esi
lea    0xebd(%rip),%rdx
mov    $0xff,%ecx
mov    $0xfa,%r8d
mov    $0x20,%r9d
xor    %eax,%eax
lea    0xeb2(%rip),%rax
movl   $0x0,(%rsp)
mov    %rax,0x8(%rsp)
movl   $0xff,0x10(%rsp)
movl   $0xf0,0x18(%rsp)
call   1040 <socket_printf@plt>
mov    -0x8(%rbp),%rdi
lea    0xe92(%rip),%rsi
call   1030 <telopt_debug@plt>
mov    $0x6,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_sb_tspeed>:
push   %rbx
mov    %rdi,%rbx
lea    0xee4(%rip),%rax
lea    0xece(%rip),%rdx
mov    $0x11,%esi
mov    $0xff,%ecx
mov    $0xfa,%r8d
mov    $0x20,%r9d
push   $0xf0
push   $0xff
push   %rax
push   $0x0
call   1040 <socket_printf@plt>
add    $0x20,%rsp
lea    0xeb6(%rip),%rsi
mov    %rbx,%rdi
call   1030 <telopt_debug@plt>
mov    $0x6,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.session = type { i32 }
@.str = [15 x i8] c"%c%c%c%c%s%c%c\00"
@.str.1 = [12 x i8] c"38400,38400\00"
@.str.2 = [19 x i8] c"SENT IAC SB TSPEED\00"
define i32 @send_sb_tspeed(%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 17, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 255, i32 250, i32 32, i32 0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 255, i32 240)
%9 = load %struct.session*, %struct.session** %4
%10 = call i32 @telopt_debug(%struct.session* %9, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
ret i32 6
}

LLVM IR (-O2):
%struct.session = type { i32 }
@.str = [15 x i8] c"%c%c%c%c%s%c%c\00"
@.str.1 = [12 x i8] c"38400,38400\00"
@.str.2 = [19 x i8] c"SENT IAC SB TSPEED\00"
define i32 @send_sb_tspeed(%struct.session* %0, i32 %1, i8* nocapture readnone %2) {
%4 = tail call i32 @socket_printf(%struct.session* %0, i32 17, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 255, i32 250, i32 32, i32 0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 255, i32 240)
%5 = tail call i32 @telopt_debug(%struct.session* %0, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
ret i32 6
}