#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 coninc(int /*<<< orphan*/);
int /*<<< orphan*/ conoc(int);
int /*<<< orphan*/ conol(char *);
int /*<<< orphan*/ conola(char **);
int /*<<< orphan*/ conoll(char *);
hconne() {
  int c;
  static char *hlpmsg[] = {
      "\r\nC to close the connection, or:",
      "\r\n  0 (zero) to send a null",
      "\r\n  B to send a BREAK",
      "\r\n  H to hangup and close connection",
      "\r\n  S for status",
      "\r\n  ? for help",
      "\r\n escape character twice to send the escape character.\r\n\r\n",
      ""};
  conola(hlpmsg);
  conol("Command>");
  c = coninc(0) & 0177;
  conoc(c);
  conoll("");
  return (c);
}


x86 assembly (clang, -O0):
<hconne>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0x2ef1(%rip),%rdi
call   1040 <conola@plt>
lea    0xf69(%rip),%rdi
call   1050 <conol@plt>
xor    %edi,%edi
call   1070 <coninc@plt>
and    $0x7f,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <conoc@plt>
lea    0xf47(%rip),%rdi
call   1060 <conoll@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hconne>:
push   %rbx
lea    0x2ef8(%rip),%rdi
call   1040 <conola@plt>
lea    0xf70(%rip),%rdi
call   1050 <conol@plt>
xor    %edi,%edi
call   1070 <coninc@plt>
mov    %eax,%ebx
and    $0x7f,%ebx
mov    %ebx,%edi
call   1030 <conoc@plt>
lea    0xf50(%rip),%rdi
call   1060 <conoll@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@hconne.hlpmsg = internal global [8 x i8*] [i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.7, i32 0, i32 0)]
@.str = [33 x i8] c"\0D\0AC to close the connection, or:\00"
@.str.1 = [28 x i8] c"\0D\0A 0 (zero) to send a null\00"
@.str.2 = [22 x i8] c"\0D\0A B to send a BREAK\00"
@.str.3 = [37 x i8] c"\0D\0A H to hangup and close connection\00"
@.str.4 = [17 x i8] c"\0D\0A S for status\00"
@.str.5 = [15 x i8] c"\0D\0A ? for help\00"
@.str.6 = [60 x i8] c"\0D\0A escape character twice to send the escape character.\0D\0A\0D\0A\00"
@.str.7 = [1 x i8] zeroinitializer
@.str.8 = [9 x i8] c"Command>\00"
define i32 @hconne() {
%1 = alloca i32
%2 = call i32 @conola(i8** getelementptr inbounds ([8 x i8*], [8 x i8*]* @hconne.hlpmsg, i64 0, i64 0))
%3 = call i32 @conol(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0))
%4 = call i32 @coninc(i32 0)
%5 = and i32 %4, 127
store i32 %5, i32* %1
%6 = load i32, i32* %1
%7 = call i32 @conoc(i32 %6)
%8 = call i32 @conoll(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.7, i64 0, i64 0))
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
@hconne.hlpmsg = internal global [8 x i8*] [i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.7, i32 0, i32 0)]
@.str = [33 x i8] c"\0D\0AC to close the connection, or:\00"
@.str.1 = [28 x i8] c"\0D\0A 0 (zero) to send a null\00"
@.str.2 = [22 x i8] c"\0D\0A B to send a BREAK\00"
@.str.3 = [37 x i8] c"\0D\0A H to hangup and close connection\00"
@.str.4 = [17 x i8] c"\0D\0A S for status\00"
@.str.5 = [15 x i8] c"\0D\0A ? for help\00"
@.str.6 = [60 x i8] c"\0D\0A escape character twice to send the escape character.\0D\0A\0D\0A\00"
@.str.7 = [1 x i8] zeroinitializer
@.str.8 = [9 x i8] c"Command>\00"
define i32 @hconne() {
%1 = tail call i32 @conola(i8** getelementptr inbounds ([8 x i8*], [8 x i8*]* @hconne.hlpmsg, i64 0, i64 0))
%2 = tail call i32 @conol(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0))
%3 = tail call i32 @coninc(i32 0)
%4 = and i32 %3, 127
%5 = tail call i32 @conoc(i32 %4)
%6 = tail call i32 @conoll(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.7, i64 0, i64 0))
ret i32 %4
}