#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*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ stdin;
int choices(void) {
  int choice = 0;
  printf("1)----   Load the student list         ----\n"
         "2)----   Print a course enrollement    ----\n"
         "3)----   Load student List             ----\n"
         "4)----   Print student courses         ----\n"
         "5)----   Print global courses          ----\n"
         "6)----   Create conflict matrix        ----\n"
         "7)----   Print all students            ----\n"
         "8)----   Create genetic timetable      ----\n"
         "9)----   Export best timetable         ----\n"
         "0)----   Exit                          ----\n");
  scanf("%d", &choice);
  fflush(stdin);
  return choice;
}


x86 assembly (clang, -O0):
<choices>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
lea    0x1067(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<choices>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xec3(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb4(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [441 x i8] c"1)---- Load the student list ----\0A2)---- Print a course enrollement ----\0A3)---- Load student List ----\0A4)---- Print student courses ----\0A5)---- Print global courses ----\0A6)---- Create conflict matrix ----\0A7)---- Print all students ----\0A8)---- Create genetic timetable ----\0A9)---- Export best timetable ----\0A0)---- Exit ----\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@stdin = global i32 0
define i32 @choices() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([441 x i8], [441 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%4 = load i32, i32* @stdin
%5 = call i32 @fflush(i32 %4)
%6 = load i32, i32* %1
ret i32 %6
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@stdin = global i32 0
@str = [440 x i8] c"1)---- Load the student list ----\0A2)---- Print a course enrollement ----\0A3)---- Load student List ----\0A4)---- Print student courses ----\0A5)---- Print global courses ----\0A6)---- Create conflict matrix ----\0A7)---- Print all students ----\0A8)---- Create genetic timetable ----\0A9)---- Export best timetable ----\0A0)---- Exit ----\00"
define i32 @choices() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([440 x i8], [440 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* @stdin
%6 = call i32 @fflush(i32 %5)
%7 = load i32, i32* %1
ret i32 %7
}