#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*/ fatal_error(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
scalar_t__ ricevi_opzione(int, char *);
int /*<<< orphan*/ stdout;
void compact_tabella(int id_connessione) {
  char risultato;
  if (ricevi_opzione(id_connessione, &risultato))
    fatal_error(id_connessione);
  if (risultato == 'i')
    fprintf(stdout, "Nessuna modifica necessaria alla tabella\n");
  else
    fprintf(stdout, "Tabella compattata con successo\n");
}


x86 assembly (clang, -O0):
<compact_tabella>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x5(%rbp),%rsi
call   1030 <ricevi_opzione@plt>
cmp    $0x0,%rax
je     1159 <compact_tabella+0x29>
mov    -0x4(%rbp),%edi
call   1050 <fatal_error@plt>
movsbl -0x5(%rbp),%eax
cmp    $0x69,%eax
jne    1180 <compact_tabella+0x50>
mov    0x2e73(%rip),%rax
mov    (%rax),%edi
lea    0xe8a(%rip),%rsi
call   1040 <fprintf@plt>
jmp    1195 <compact_tabella+0x65>
mov    0x2e59(%rip),%rax
mov    (%rax),%edi
lea    0xe9a(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compact_tabella>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
lea    0xf(%rsp),%rsi
call   1030 <ricevi_opzione@plt>
test   %rax,%rax
je     114d <compact_tabella+0x1d>
mov    %ebx,%edi
call   1050 <fatal_error@plt>
cmpb   $0x69,0xf(%rsp)
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
lea    0xe9e(%rip),%rax
lea    0xec1(%rip),%rsi
cmove  %rax,%rsi
call   1040 <fprintf@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [42 x i8] c"Nessuna modifica necessaria alla tabella\0A\00"
@.str.1 = [33 x i8] c"Tabella compattata con successo\0A\00"
define void @compact_tabella(i32 %0) {
%2 = alloca i32
%3 = alloca i8
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i64 @ricevi_opzione(i32 %4, i8* %3)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* %2
%9 = call i32 @fatal_error(i32 %8)
br label %10
10: ; preds = %7, %1
%11 = load i8, i8* %3
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 105
br i1 %13, label %14, label %17
14: ; preds = %10
%15 = load i32, i32* @stdout
%16 = call i32 @fprintf(i32 %15, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
br label %20
17: ; preds = %10
%18 = load i32, i32* @stdout
%19 = call i32 @fprintf(i32 %18, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
br label %20
20: ; preds = %17, %14
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [42 x i8] c"Nessuna modifica necessaria alla tabella\0A\00"
@.str.1 = [33 x i8] c"Tabella compattata con successo\0A\00"
define void @compact_tabella(i32 %0) {
%2 = alloca i8
%3 = call i64 @ricevi_opzione(i32 %0, i8* %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = call i32 @fatal_error(i32 %0)
br label %7
7: ; preds = %5, %1
%8 = load i8, i8* %2
%9 = icmp eq i8 %8, 105
%10 = load i32, i32* @stdout
%11 = select i1 %9, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0)
%12 = call i32 @fprintf(i32 %10, i8* %11)
ret void
}