#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*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int getChoice() {
  printf("\n\rPlease select an option:\n\r");
  printf(" 0) Exit\n\r 1) Create a new task\n\r 2) Execute a task\n\r");
  printf(" 3) insert ID task and execute\n\r 4) Delete a task\n\r 5) Modify "
         "the PRIORITY of a task\n\r");
  printf(" 6) Switch policy (default : PRIORITY)\n\r 7) Modify the REMAINING "
         "EXECUTIONS of a task");
  int res = 0;
  printf("\n\r> ");
  scanf("%i", &res);
  return res;
}


x86 assembly (clang, -O0):
<getChoice>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
lea    0xee2(%rip),%rdi
call   1030 <printf@plt>
lea    0xf0c(%rip),%rdi
call   1030 <printf@plt>
lea    0xf57(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
lea    0xf9a(%rip),%rdi
call   1030 <printf@plt>
lea    0xf93(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getChoice>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
lea    0xee9(%rip),%rdi
call   1030 <printf@plt>
lea    0xf13(%rip),%rdi
call   1030 <printf@plt>
lea    0xf5e(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,0x4(%rsp)
lea    0xfa0(%rip),%rdi
call   1030 <printf@plt>
lea    0xf99(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"\0A\0DPlease select an option:\0A\0D\00"
@.str.1 = [54 x i8] c" 0) Exit\0A\0D 1) Create a new task\0A\0D 2) Execute a task\0A\0D\00"
@.str.2 = [87 x i8] c" 3) insert ID task and execute\0A\0D 4) Delete a task\0A\0D 5) Modify the PRIORITY of a task\0A\0D\00"
@.str.3 = [86 x i8] c" 6) Switch policy (default : PRIORITY)\0A\0D 7) Modify the REMAINING EXECUTIONS of a task\00"
@.str.4 = [5 x i8] c"\0A\0D> \00"
@.str.5 = [3 x i8] c"%i\00"
define i32 @getChoice() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([87 x i8], [87 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %1
%6 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %1)
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
@.str = [29 x i8] c"\0A\0DPlease select an option:\0A\0D\00"
@.str.1 = [54 x i8] c" 0) Exit\0A\0D 1) Create a new task\0A\0D 2) Execute a task\0A\0D\00"
@.str.2 = [87 x i8] c" 3) insert ID task and execute\0A\0D 4) Delete a task\0A\0D 5) Modify the PRIORITY of a task\0A\0D\00"
@.str.3 = [86 x i8] c" 6) Switch policy (default : PRIORITY)\0A\0D 7) Modify the REMAINING EXECUTIONS of a task\00"
@.str.4 = [5 x i8] c"\0A\0D> \00"
@.str.5 = [3 x i8] c"%i\00"
define i32 @getChoice() {
%1 = alloca i32
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([87 x i8], [87 x i8]* @.str.2, i64 0, i64 0))
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([86 x i8], [86 x i8]* @.str.3, i64 0, i64 0))
%6 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%7 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %1)
%9 = load i32, i32* %1
ret i32 %9
}