#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*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ option_one();
int /*<<< orphan*/ option_two();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int choice;
  while (1) {
    printf("\n\nHamming Code Checker:\n");
    printf("---------------------\n");
    printf("1) Enter parameters\n");
    printf("2) Check Hamming code\n");
    printf("3) Quit\n\n");
    printf("Enter selection: ");
    scanf("%d", &choice);
    switch (choice) {
    case 1:
      option_one();
      break;
    case 2:
      option_two();
      break;
    case 3:
      exit(0);
      break;
    default:
      printf("");
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x1,%eax
je     11ed <main+0x9d>
jmp    11cb <main+0x7b>
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
je     11f9 <main+0xa9>
jmp    11dc <main+0x8c>
mov    -0xc(%rbp),%eax
sub    $0x3,%eax
je     1205 <main+0xb5>
jmp    120c <main+0xbc>
mov    $0x0,%al
call   1070 <option_one@plt>
jmp    1218 <main+0xc8>
mov    $0x0,%al
call   1040 <option_two@plt>
jmp    1218 <main+0xc8>
xor    %edi,%edi
call   1060 <exit@plt>
lea    0xe52(%rip),%rdi
call   1030 <printf@plt>
jmp    115f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xed1(%rip),%r12
lea    0xede(%rip),%r13
lea    0xeed(%rip),%rbx
lea    0xe79(%rip),%rbp
lea    0xe84(%rip),%r14
lea    0x4(%rsp),%r15
jmp    11a7 <main+0x47>
cs nopw 0x0(%rax,%rax,1)
nop
xor    %eax,%eax
call   1050 <option_two@plt>
lea    0xe67(%rip),%rdi
call   1030 <puts@plt>
lea    0xe73(%rip),%rdi
call   1030 <puts@plt>
mov    %r12,%rdi
call   1030 <puts@plt>
mov    %r13,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbp,%rdi
call   1040 <printf@plt>
mov    %r14,%rdi
mov    %r15,%rsi
call   1060 <scanf@plt>
mov    0x4(%rsp),%eax
cmp    $0x1,%eax
je     1200 <main+0xa0>
cmp    $0x2,%eax
je     11a0 <main+0x40>
cmp    $0x3,%eax
jne    11a7 <main+0x47>
jmp    1209 <main+0xa9>
nop
xor    %eax,%eax
call   1080 <option_one@plt>
jmp    11a7 <main+0x47>
xor    %edi,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"\0A\0AHamming Code Checker:\0A\00"
@.str.1 = [23 x i8] c"---------------------\0A\00"
@.str.2 = [21 x i8] c"1) Enter parameters\0A\00"
@.str.3 = [23 x i8] c"2) Check Hamming code\0A\00"
@.str.4 = [10 x i8] c"3) Quit\0A\0A\00"
@.str.5 = [18 x i8] c"Enter selection: \00"
@.str.6 = [3 x i8] c"%d\00"
@.str.7 = [1 x i8] zeroinitializer
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %0, %20
%4 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0))
%9 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32* %2)
%11 = load i32, i32* %2
switch i32 %11, label %18 [
i32 1, label %12
i32 2, label %14
i32 3, label %16
]
12: ; preds = %3
%13 = call i32 (...) @option_one()
br label %20
14: ; preds = %3
%15 = call i32 (...) @option_two()
br label %20
16: ; preds = %3
%17 = call i32 @exit(i32 0)
unreachable
18: ; preds = %3
%19 = call i32 @printf(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.7, i64 0, i64 0))
br label %20
20: ; preds = %18, %14, %12
br label %3
}

LLVM IR (-O2):
@.str.5 = [18 x i8] c"Enter selection: \00"
@.str.6 = [3 x i8] c"%d\00"
@str = [24 x i8] c"\0A\0AHamming Code Checker:\00"
@str.8 = [22 x i8] c"---------------------\00"
@str.9 = [20 x i8] c"1) Enter parameters\00"
@str.10 = [22 x i8] c"2) Check Hamming code\00"
@str.11 = [9 x i8] c"3) Quit\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
br label %3
3: ; preds = %12, %0
%4 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%5 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.8, i64 0, i64 0))
%6 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.9, i64 0, i64 0))
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.10, i64 0, i64 0))
%8 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.11, i64 0, i64 0))
%9 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32* %1)
%11 = load i32, i32* %1
switch i32 %11, label %12 [
i32 1, label %13
i32 2, label %15
i32 3, label %17
]
12: ; preds = %3, %15, %13
br label %3
13: ; preds = %3
%14 = call i32 (...) @option_one()
br label %12
15: ; preds = %3
%16 = call i32 (...) @option_two()
br label %12
17: ; preds = %3
%18 = call i32 @exit(i32 0)
unreachable
}