#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*/ lucas_sequence(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ space();
int /*<<< orphan*/ twin_primes();
int main() {
  int choice;
  do {
    printf("\n\n\n\tM\tE\tN\tU\n\t_\t_\t_\t_ \t\n\tType in [1] for |Lucas "
           "Numbers|\n\tType in [2] for |Twin Primes|\n\tType in [0] for "
           "|EXIT|\t\n\n\n");
    printf("\tEnter your choice: ");
    scanf("%d", &choice);
    space();
    switch (choice) {
    case 1:
      lucas_sequence(100);
      break;
    case 2:
      twin_primes();
      break;
    case 0:
      break;
    default:
      return 1;
    }
  } while (choice != 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe9a(%rip),%rdi
call   1050 <printf@plt>
lea    0xf01(%rip),%rdi
call   1050 <printf@plt>
lea    0xf0a(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1060 <scanf@plt>
xor    %eax,%eax
call   1030 <space@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
test   %eax,%eax
je     11de <main+0x8e>
jmp    11a1 <main+0x51>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
je     11c3 <main+0x73>
jmp    11b2 <main+0x62>
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
je     11d2 <main+0x82>
jmp    11e3 <main+0x93>
mov    $0x64,%edi
call   1070 <lucas_sequence@plt>
jmp    11ef <main+0x9f>
mov    $0x0,%al
call   1040 <twin_primes@plt>
jmp    11ef <main+0x9f>
jmp    11ef <main+0x9f>
movl   $0x1,-0x4(%rbp)
jmp    1205 <main+0xb5>
jmp    11f4 <main+0xa4>
cmpl   $0x0,-0x8(%rbp)
jne    115f <main+0xf>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
lea    0xea9(%rip),%r14
lea    0xe8a(%rip),%r15
lea    0xe98(%rip),%r12
lea    0x4(%rsp),%rbx
jmp    11a1 <main+0x41>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x64,%edi
call   1080 <lucas_sequence@plt>
cmpl   $0x0,0x4(%rsp)
je     11ea <main+0x8a>
mov    %r14,%rdi
call   1050 <puts@plt>
mov    %r15,%rdi
call   1060 <printf@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
call   1070 <scanf@plt>
xor    %eax,%eax
call   1030 <space@plt>
mov    0x4(%rsp),%ecx
cmp    $0x1,%ecx
je     1190 <main+0x30>
cmp    $0x2,%ecx
jne    11e1 <main+0x81>
xor    %eax,%eax
call   1040 <twin_primes@plt>
cmpl   $0x0,0x4(%rsp)
jne    11a1 <main+0x41>
jmp    11ea <main+0x8a>
mov    $0x1,%eax
test   %ecx,%ecx
jne    11ec <main+0x8c>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [115 x i8] c"\0A\0A\0A\09M\09E\09N\09U\0A\09_\09_\09_\09_ \09\0A\09Type in [1] for |Lucas Numbers|\0A\09Type in [2] for |Twin Primes|\0A\09Type in [0] for |EXIT|\09\0A\0A\0A\00"
@.str.1 = [21 x i8] c"\09Enter your choice: \00"
@.str.2 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %16, %0
%4 = call i32 @printf(i8* getelementptr inbounds ([115 x i8], [115 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%7 = call i32 (...) @space()
%8 = load i32, i32* %2
switch i32 %8, label %14 [
i32 1, label %9
i32 2, label %11
i32 0, label %13
]
9: ; preds = %3
%10 = call i32 @lucas_sequence(i32 100)
br label %15
11: ; preds = %3
%12 = call i32 (...) @twin_primes()
br label %15
13: ; preds = %3
br label %15
14: ; preds = %3
store i32 1, i32* %1
br label %20
15: ; preds = %13, %11, %9
br label %16
16: ; preds = %15
%17 = load i32, i32* %2
%18 = icmp ne i32 %17, 0
br i1 %18, label %3, label %19
19: ; preds = %16
store i32 0, i32* %1
br label %20
20: ; preds = %19, %14
%21 = load i32, i32* %1
ret i32 %21
}

LLVM IR (-O2):
@.str.1 = [21 x i8] c"\09Enter your choice: \00"
@.str.2 = [3 x i8] c"%d\00"
@str = [114 x i8] c"\0A\0A\0A\09M\09E\09N\09U\0A\09_\09_\09_\09_ \09\0A\09Type in [1] for |Lucas Numbers|\0A\09Type in [2] for |Twin Primes|\0A\09Type in [0] for |EXIT|\09\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
br label %3
3: ; preds = %13, %0
%4 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([114 x i8], [114 x i8]* @str, i64 0, i64 0))
%5 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%7 = call i32 (...) @space()
%8 = load i32, i32* %1
switch i32 %8, label %16 [
i32 1, label %9
i32 2, label %11
i32 0, label %18
]
9: ; preds = %3
%10 = call i32 @lucas_sequence(i32 100)
br label %13
11: ; preds = %3
%12 = call i32 (...) @twin_primes()
br label %13
13: ; preds = %9, %11
%14 = load i32, i32* %1
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %3
16: ; preds = %3, %13
%17 = phi i32 [ 0, %13 ], [ 1, %3 ]
br label %18
18: ; preds = %3, %16
%19 = phi i32 [ %17, %16 ], [ 0, %3 ]
ret i32 %19
}