#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*/ adding_new_record();
int /*<<< orphan*/ cls();
int /*<<< orphan*/ deleting_record();
int /*<<< orphan*/ editing_record();
int /*<<< orphan*/ print_the_array_by_line_no();
int /*<<< orphan*/ print_the_array_by_record_no();
int /*<<< orphan*/ print_the_array_by_tram_type();
int /*<<< orphan*/ printf(char *);
void do_procedure(int choice) {
  switch (choice) {
  case 1: {
    cls();
    adding_new_record();
    break;
  }
  case 2: {
    cls();
    editing_record();
    break;
  }
  case 3: {
    cls();
    deleting_record();
    break;
  }
  case 4: {
    cls();
    print_the_array_by_record_no();
    break;
  }
  case 5: {
    cls();
    print_the_array_by_line_no();
    break;
  }
  case 6: {
    cls();
    print_the_array_by_tram_type();
    break;
  }
  default: {
    cls();
    printf("Pozycja menu o takim numerze nie istnieje!\n");
    break;
  }
  }
}


x86 assembly (clang, -O0):
<do_procedure>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x5,%eax
ja     1226 <do_procedure+0xa6>
mov    -0x10(%rbp),%rax
lea    0xe55(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x0,%al
call   1060 <cls@plt>
mov    $0x0,%al
call   1030 <adding_new_record@plt>
jmp    1239 <do_procedure+0xb9>
mov    $0x0,%al
call   1060 <cls@plt>
mov    $0x0,%al
call   1050 <editing_record@plt>
jmp    1239 <do_procedure+0xb9>
mov    $0x0,%al
call   1060 <cls@plt>
mov    $0x0,%al
call   1080 <deleting_record@plt>
jmp    1239 <do_procedure+0xb9>
mov    $0x0,%al
call   1060 <cls@plt>
mov    $0x0,%al
call   10a0 <print_the_array_by_record_no@plt>
jmp    1239 <do_procedure+0xb9>
mov    $0x0,%al
call   1060 <cls@plt>
mov    $0x0,%al
call   1070 <print_the_array_by_line_no@plt>
jmp    1239 <do_procedure+0xb9>
mov    $0x0,%al
call   1060 <cls@plt>
mov    $0x0,%al
call   1090 <print_the_array_by_tram_type@plt>
jmp    1239 <do_procedure+0xb9>
mov    $0x0,%al
call   1060 <cls@plt>
lea    0xde4(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_procedure>:
push   %rax
add    $0xffffffff,%edi
cmp    $0x5,%edi
ja     11a8 <do_procedure+0x28>
lea    0xe70(%rip),%rax
movslq (%rax,%rdi,4),%rcx
add    %rax,%rcx
jmp    *%rcx
xor    %eax,%eax
call   1060 <cls@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <adding_new_record@plt>
xor    %eax,%eax
call   1060 <cls@plt>
lea    0xe62(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>
xor    %eax,%eax
call   1060 <cls@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <editing_record@plt>
xor    %eax,%eax
call   1060 <cls@plt>
xor    %eax,%eax
pop    %rcx
jmp    1080 <deleting_record@plt>
xor    %eax,%eax
call   1060 <cls@plt>
xor    %eax,%eax
pop    %rcx
jmp    10a0 <print_the_array_by_record_no@plt>
xor    %eax,%eax
call   1060 <cls@plt>
xor    %eax,%eax
pop    %rcx
jmp    1070 <print_the_array_by_line_no@plt>
xor    %eax,%eax
call   1060 <cls@plt>
xor    %eax,%eax
pop    %rcx
jmp    1090 <print_the_array_by_tram_type@plt>

LLVM IR (-O0):
@.str = [44 x i8] c"Pozycja menu o takim numerze nie istnieje!\0A\00"
define void @do_procedure(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %22 [
i32 1, label %4
i32 2, label %7
i32 3, label %10
i32 4, label %13
i32 5, label %16
i32 6, label %19
]
4: ; preds = %1
%5 = call i32 (...) @cls()
%6 = call i32 (...) @adding_new_record()
br label %25
7: ; preds = %1
%8 = call i32 (...) @cls()
%9 = call i32 (...) @editing_record()
br label %25
10: ; preds = %1
%11 = call i32 (...) @cls()
%12 = call i32 (...) @deleting_record()
br label %25
13: ; preds = %1
%14 = call i32 (...) @cls()
%15 = call i32 (...) @print_the_array_by_record_no()
br label %25
16: ; preds = %1
%17 = call i32 (...) @cls()
%18 = call i32 (...) @print_the_array_by_line_no()
br label %25
19: ; preds = %1
%20 = call i32 (...) @cls()
%21 = call i32 (...) @print_the_array_by_tram_type()
br label %25
22: ; preds = %1
%23 = call i32 (...) @cls()
%24 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
br label %25
25: ; preds = %22, %19, %16, %13, %10, %7, %4
ret void
}

LLVM IR (-O2):
@str = [43 x i8] c"Pozycja menu o takim numerze nie istnieje!\00"
define void @do_procedure(i32 %0) {
switch i32 %0, label %20 [
i32 1, label %2
i32 2, label %5
i32 3, label %8
i32 4, label %11
i32 5, label %14
i32 6, label %17
]
2: ; preds = %1
%3 = tail call i32 (...) @cls()
%4 = tail call i32 (...) @adding_new_record()
br label %23
5: ; preds = %1
%6 = tail call i32 (...) @cls()
%7 = tail call i32 (...) @editing_record()
br label %23
8: ; preds = %1
%9 = tail call i32 (...) @cls()
%10 = tail call i32 (...) @deleting_record()
br label %23
11: ; preds = %1
%12 = tail call i32 (...) @cls()
%13 = tail call i32 (...) @print_the_array_by_record_no()
br label %23
14: ; preds = %1
%15 = tail call i32 (...) @cls()
%16 = tail call i32 (...) @print_the_array_by_line_no()
br label %23
17: ; preds = %1
%18 = tail call i32 (...) @cls()
%19 = tail call i32 (...) @print_the_array_by_tram_type()
br label %23
20: ; preds = %1
%21 = tail call i32 (...) @cls()
%22 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str, i64 0, i64 0))
br label %23
23: ; preds = %20, %17, %14, %11, %8, %5, %2
ret void
}