#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_ALL;
int /*<<< orphan*/ check_local();
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*/ start_msgs();
int /*<<< orphan*/ talk();
int main(int argc, char *argv[]) {
  setlocale(LC_ALL, "");
  get_names(argc, argv);
  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    0x2e13(%rip),%rax
mov    (%rax),%edi
lea    0xe2a(%rip),%rsi
call   1080 <setlocale@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1090 <get_names@plt>
mov    $0x0,%al
call   1070 <init_display@plt>
mov    $0x0,%al
call   10b0 <open_ctl@plt>
mov    $0x0,%al
call   1060 <open_sockt@plt>
mov    $0x0,%al
call   10a0 <start_msgs@plt>
mov    $0x0,%al
call   10c0 <check_local@plt>
cmp    $0x0,%eax
jne    121a <main+0x6a>
mov    $0x0,%al
call   1030 <invite_remote@plt>
mov    $0x0,%al
call   1050 <end_msgs@plt>
mov    $0x0,%al
call   1040 <set_edit_chars@plt>
mov    $0x0,%al
call   10d0 <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    0x2e21(%rip),%rax
mov    (%rax),%edi
lea    0xe38(%rip),%rsi
call   1080 <setlocale@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1090 <get_names@plt>
xor    %eax,%eax
call   1070 <init_display@plt>
xor    %eax,%eax
call   10b0 <open_ctl@plt>
xor    %eax,%eax
call   1060 <open_sockt@plt>
xor    %eax,%eax
call   10a0 <start_msgs@plt>
xor    %eax,%eax
call   10c0 <check_local@plt>
test   %eax,%eax
jne    1205 <main+0x55>
xor    %eax,%eax
call   1030 <invite_remote@plt>
xor    %eax,%eax
call   1050 <end_msgs@plt>
xor    %eax,%eax
call   1040 <set_edit_chars@plt>
xor    %eax,%eax
call   10d0 <talk@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@LC_ALL = global i32 0
@.str = [1 x i8] zeroinitializer
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_ALL
%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 (...) @init_display()
%12 = call i32 (...) @open_ctl()
%13 = call i32 (...) @open_sockt()
%14 = call i32 (...) @start_msgs()
%15 = call i32 (...) @check_local()
%16 = icmp ne i32 %15, 0
br i1 %16, label %19, label %17
17: ; preds = %2
%18 = call i32 (...) @invite_remote()
br label %19
19: ; preds = %17, %2
%20 = call i32 (...) @end_msgs()
%21 = call i32 (...) @set_edit_chars()
%22 = call i32 (...) @talk()
ret i32 0
}

LLVM IR (-O2):
@LC_ALL = global i32 0
@.str = [1 x i8] zeroinitializer
define i32 @main(i32 %0, i8** %1) {
%3 = load i32, i32* @LC_ALL
%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 (...) @init_display()
%7 = tail call i32 (...) @open_ctl()
%8 = tail call i32 (...) @open_sockt()
%9 = tail call i32 (...) @start_msgs()
%10 = tail call i32 (...) @check_local()
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = tail call i32 (...) @invite_remote()
br label %14
14: ; preds = %12, %2
%15 = tail call i32 (...) @end_msgs()
%16 = tail call i32 (...) @set_edit_chars()
%17 = tail call i32 (...) @talk()
ret i32 0
}