#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*/ EXIT_FAILURE;
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *,
                           int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
void display_commands() {
  printf("-----------------LISTA COMANDI---------------\n\n");
  printf(">> Mostra la lista degli utenti connessi: ");
  printf("%s%s%s\n", "\x1B[32m", "list\n", "\x1B[0m");
  printf(">> Richiesta connessione verso un utente: ");
  printf("%s%sNOME_UTENTE%s\n\n", "\x1B[32m", "connect ", "\x1B[0m");
  printf(">> Disconnessione dal server ed uscita dal programma: ");
  printf("%s%s%s\n", "\x1B[32m", "quit\n", "\x1B[0m");
  printf(">> Pulisci schermo: ");
  printf("%s%s%s\n\n", "\x1B[32m", "clear", "\x1B[0m");
  printf(">> Mostra questa lista: ");
  printf("%s%s%s\n", "\x1B[32m", "help", "\x1B[0m");
  printf(">> ");
  do {
    if ((fflush(stdout) < 0)) {
      fprintf(stderr, "%s%s: %s\n", "\x1B[31m", "Errore fflush",
              strerror(errno));
      exit(EXIT_FAILURE);
    }
  } while (0);
}


x86 assembly (clang, -O0):
<display_commands>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xea1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee0(%rip),%rdi
lea    0xee1(%rip),%rsi
lea    0xee0(%rip),%rdx
lea    0xedf(%rip),%rcx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef3(%rip),%rdi
lea    0xeb0(%rip),%rsi
lea    0xef9(%rip),%rdx
lea    0xeae(%rip),%rcx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeed(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe7e(%rip),%rdi
lea    0xe7f(%rip),%rsi
lea    0xf08(%rip),%rdx
lea    0xe7d(%rip),%rcx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf00(%rip),%rdi
lea    0xe4e(%rip),%rsi
lea    0xefb(%rip),%rdx
lea    0xe4c(%rip),%rcx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeec(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe1c(%rip),%rdi
lea    0xe1d(%rip),%rsi
lea    0xee9(%rip),%rdx
lea    0xe1b(%rip),%rcx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2d58(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
cmp    $0x0,%rax
jge    12c9 <display_commands+0x179>
mov    0x2d58(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    0x2d44(%rip),%rax
mov    (%rax),%edi
call   1070 <strerror@plt>
mov    -0x4(%rbp),%edi
mov    %eax,%r8d
lea    0xe97(%rip),%rsi
lea    0xe9a(%rip),%rdx
lea    0xe99(%rip),%rcx
call   1040 <fprintf@plt>
mov    0x2d0e(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>
jmp    12ce <display_commands+0x17e>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<display_commands>:
push   %r15
push   %r14
push   %rbx
lea    0xfc1(%rip),%rdi
call   1030 <puts@plt>
lea    0xe88(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xea5(%rip),%r14
lea    0xea6(%rip),%rbx
lea    0xea5(%rip),%rdx
lea    0xea4(%rip),%r15
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %r15,%rcx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe92(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeaf(%rip),%rdi
lea    0xebc(%rip),%rdx
mov    %rbx,%rsi
mov    %r15,%rcx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeb1(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeda(%rip),%rdx
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %r15,%rcx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec9(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed0(%rip),%rdi
lea    0xed2(%rip),%rdx
mov    %rbx,%rsi
mov    %r15,%rcx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec4(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xecf(%rip),%rdx
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %r15,%rcx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xebd(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x2d6c(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
test   %rax,%rax
js     126e <display_commands+0x10e>
pop    %rbx
pop    %r14
pop    %r15
ret
mov    0x2d6b(%rip),%rax
mov    (%rax),%ebx
mov    0x2d5a(%rip),%rax
mov    (%rax),%edi
call   1080 <strerror@plt>
lea    0xe83(%rip),%rsi
lea    0xe86(%rip),%rdx
lea    0xe85(%rip),%rcx
mov    %ebx,%edi
mov    %eax,%r8d
call   1050 <fprintf@plt>
mov    0x2d25(%rip),%rax
mov    (%rax),%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [48 x i8] c"-----------------LISTA COMANDI---------------\0A\0A\00"
@.str.1 = [43 x i8] c">> Mostra la lista degli utenti connessi: \00"
@.str.2 = [8 x i8] c"%s%s%s\0A\00"
@.str.3 = [6 x i8] c"\1B[32m\00"
@.str.4 = [6 x i8] c"list\0A\00"
@.str.5 = [5 x i8] c"\1B[0m\00"
@.str.6 = [43 x i8] c">> Richiesta connessione verso un utente: \00"
@.str.7 = [20 x i8] c"%s%sNOME_UTENTE%s\0A\0A\00"
@.str.8 = [9 x i8] c"connect \00"
@.str.9 = [55 x i8] c">> Disconnessione dal server ed uscita dal programma: \00"
@.str.10 = [6 x i8] c"quit\0A\00"
@.str.11 = [21 x i8] c">> Pulisci schermo: \00"
@.str.12 = [9 x i8] c"%s%s%s\0A\0A\00"
@.str.13 = [6 x i8] c"clear\00"
@.str.14 = [25 x i8] c">> Mostra questa lista: \00"
@.str.15 = [5 x i8] c"help\00"
@.str.16 = [4 x i8] c">> \00"
@stdout = global i32 0
@stderr = global i32 0
@.str.17 = [10 x i8] c"%s%s: %s\0A\00"
@.str.18 = [6 x i8] c"\1B[31m\00"
@.str.19 = [14 x i8] c"Errore fflush\00"
@errno = global i32 0
@EXIT_FAILURE = global i32 0
define void @display_commands() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.6, i64 0, i64 0))
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.9, i64 0, i64 0))
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.11, i64 0, i64 0))
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.14, i64 0, i64 0))
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.16, i64 0, i64 0))
br label %13
13: ; preds = %0
%14 = load i32, i32* @stdout
%15 = call i64 @fflush(i32 %14)
%16 = icmp slt i64 %15, 0
br i1 %16, label %17, label %24
17: ; preds = %13
%18 = load i32, i32* @stderr
%19 = load i32, i32* @errno
%20 = call i32 @strerror(i32 %19)
%21 = call i32 @fprintf(i32 %18, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.18, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.19, i64 0, i64 0), i32 %20)
%22 = load i32, i32* @EXIT_FAILURE
%23 = call i32 @exit(i32 %22)
unreachable
24: ; preds = %13
br label %25
25: ; preds = %24
ret void
}

LLVM IR (-O2):
@.str.1 = [43 x i8] c">> Mostra la lista degli utenti connessi: \00"
@.str.2 = [8 x i8] c"%s%s%s\0A\00"
@.str.3 = [6 x i8] c"\1B[32m\00"
@.str.4 = [6 x i8] c"list\0A\00"
@.str.5 = [5 x i8] c"\1B[0m\00"
@.str.6 = [43 x i8] c">> Richiesta connessione verso un utente: \00"
@.str.7 = [20 x i8] c"%s%sNOME_UTENTE%s\0A\0A\00"
@.str.8 = [9 x i8] c"connect \00"
@.str.9 = [55 x i8] c">> Disconnessione dal server ed uscita dal programma: \00"
@.str.10 = [6 x i8] c"quit\0A\00"
@.str.11 = [21 x i8] c">> Pulisci schermo: \00"
@.str.12 = [9 x i8] c"%s%s%s\0A\0A\00"
@.str.13 = [6 x i8] c"clear\00"
@.str.14 = [25 x i8] c">> Mostra questa lista: \00"
@.str.15 = [5 x i8] c"help\00"
@.str.16 = [4 x i8] c">> \00"
@stdout = global i32 0
@stderr = global i32 0
@.str.17 = [10 x i8] c"%s%s: %s\0A\00"
@.str.18 = [6 x i8] c"\1B[31m\00"
@.str.19 = [14 x i8] c"Errore fflush\00"
@errno = global i32 0
@EXIT_FAILURE = global i32 0
@str = [47 x i8] c"-----------------LISTA COMANDI---------------\0A\00"
define void @display_commands() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.6, i64 0, i64 0))
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @.str.9, i64 0, i64 0))
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.11, i64 0, i64 0))
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.14, i64 0, i64 0))
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.16, i64 0, i64 0))
%13 = load i32, i32* @stdout
%14 = tail call i64 @fflush(i32 %13)
%15 = icmp slt i64 %14, 0
br i1 %15, label %16, label %23
16: ; preds = %0
%17 = load i32, i32* @stderr
%18 = load i32, i32* @errno
%19 = tail call i32 @strerror(i32 %18)
%20 = tail call i32 @fprintf(i32 %17, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.18, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.19, i64 0, i64 0), i32 %19)
%21 = load i32, i32* @EXIT_FAILURE
%22 = tail call i32 @exit(i32 %21)
unreachable
23: ; preds = %0
ret void
}