#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*/ LC_CTYPE;
int /*<<< orphan*/ check_local();
int /*<<< orphan*/ check_writeable();
int /*<<< orphan*/ end_msgs();
int /*<<< orphan*/ get_names(int, char **);
int /*<<< orphan*/ init_display();
int /*<<< orphan*/ invite_remote();
int /*<<< orphan*/ open_ctl();
int /*<<< orphan*/ open_sockt();
int /*<<< orphan*/ set_edit_chars();
int /*<<< orphan*/ setlocale(int /*<<< orphan*/, char *);
int /*<<< orphan*/ setproctitle(char *);
int /*<<< orphan*/ start_msgs();
int /*<<< orphan*/ talk();
int main(int argc, char **argv) {
  (void)setlocale(LC_CTYPE, "");
  get_names(argc, argv);
  setproctitle(" ");
  check_writeable();
  init_display();
  open_ctl();
  open_sockt();
  start_msgs();
  if (!check_local())
    invite_remote();
  end_msgs();
  set_edit_chars();
  talk();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2dfb(%rip),%rax
mov    (%rax),%edi
lea    0xe0b(%rip),%rsi
call   10a0 <setlocale@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   10b0 <get_names@plt>
lea    0xdf2(%rip),%rdi
call   1030 <setproctitle@plt>
mov    $0x0,%al
call   1090 <check_writeable@plt>
mov    $0x0,%al
call   1080 <init_display@plt>
mov    $0x0,%al
call   10d0 <open_ctl@plt>
mov    $0x0,%al
call   1070 <open_sockt@plt>
mov    $0x0,%al
call   10c0 <start_msgs@plt>
mov    $0x0,%al
call   10e0 <check_local@plt>
cmp    $0x0,%eax
jne    124d <main+0x7d>
mov    $0x0,%al
call   1040 <invite_remote@plt>
mov    $0x0,%al
call   1060 <end_msgs@plt>
mov    $0x0,%al
call   1050 <set_edit_chars@plt>
mov    $0x0,%al
call   10f0 <talk@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x2e09(%rip),%rax
mov    (%rax),%edi
lea    0xe19(%rip),%rsi
call   10a0 <setlocale@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   10b0 <get_names@plt>
lea    0xe02(%rip),%rdi
call   1030 <setproctitle@plt>
xor    %eax,%eax
call   1090 <check_writeable@plt>
xor    %eax,%eax
call   1080 <init_display@plt>
xor    %eax,%eax
call   10d0 <open_ctl@plt>
xor    %eax,%eax
call   1070 <open_sockt@plt>
xor    %eax,%eax
call   10c0 <start_msgs@plt>
xor    %eax,%eax
call   10e0 <check_local@plt>
test   %eax,%eax
jne    1238 <main+0x68>
xor    %eax,%eax
call   1040 <invite_remote@plt>
xor    %eax,%eax
call   1060 <end_msgs@plt>
xor    %eax,%eax
call   1050 <set_edit_chars@plt>
xor    %eax,%eax
call   10f0 <talk@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@LC_CTYPE = global i32 0
@.str = [1 x i8] zeroinitializer
@.str.1 = [2 x i8] c" \00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* @LC_CTYPE
%7 = call i32 @setlocale(i32 %6, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* %4
%9 = load i8**, i8*** %5
%10 = call i32 @get_names(i32 %8, i8** %9)
%11 = call i32 @setproctitle(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%12 = call i32 (...) @check_writeable()
%13 = call i32 (...) @init_display()
%14 = call i32 (...) @open_ctl()
%15 = call i32 (...) @open_sockt()
%16 = call i32 (...) @start_msgs()
%17 = call i32 (...) @check_local()
%18 = icmp ne i32 %17, 0
br i1 %18, label %21, label %19
19: ; preds = %2
%20 = call i32 (...) @invite_remote()
br label %21
21: ; preds = %19, %2
%22 = call i32 (...) @end_msgs()
%23 = call i32 (...) @set_edit_chars()
%24 = call i32 (...) @talk()
ret i32 0
}

LLVM IR (-O2):
@LC_CTYPE = global i32 0
@.str = [1 x i8] zeroinitializer
@.str.1 = [2 x i8] c" \00"
define i32 @main(i32 %0, i8** %1) {
%3 = load i32, i32* @LC_CTYPE
%4 = tail call i32 @setlocale(i32 %3, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @get_names(i32 %0, i8** %1)
%6 = tail call i32 @setproctitle(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%7 = tail call i32 (...) @check_writeable()
%8 = tail call i32 (...) @init_display()
%9 = tail call i32 (...) @open_ctl()
%10 = tail call i32 (...) @open_sockt()
%11 = tail call i32 (...) @start_msgs()
%12 = tail call i32 (...) @check_local()
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %2
%15 = tail call i32 (...) @invite_remote()
br label %16
16: ; preds = %14, %2
%17 = tail call i32 (...) @end_msgs()
%18 = tail call i32 (...) @set_edit_chars()
%19 = tail call i32 (...) @talk()
ret i32 0
}