#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*/ puts(char *);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char party;
  printf("Which is your political party?\n");
  printf("D, I, R or something else: ");
  scanf("%c", &party);
  switch (party) {
  case 'd':
  case 'D':
    puts("Democratic");
    break;
  case 'i':
  case 'I':
    puts("Independent");
    break;
  case 'r':
  case 'R':
    puts("Republican.");
    break;
  default:
    puts("Something else");
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1040 <printf@plt>
lea    0xece(%rip),%rdi
call   1040 <printf@plt>
lea    0xede(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1050 <scanf@plt>
movsbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x44,%eax
je     11d1 <main+0xa1>
jmp    117c <main+0x4c>
mov    -0xc(%rbp),%eax
sub    $0x49,%eax
je     11e2 <main+0xb2>
jmp    118d <main+0x5d>
mov    -0xc(%rbp),%eax
sub    $0x52,%eax
je     11f3 <main+0xc3>
jmp    119e <main+0x6e>
mov    -0xc(%rbp),%eax
sub    $0x64,%eax
je     11d1 <main+0xa1>
jmp    11af <main+0x7f>
mov    -0xc(%rbp),%eax
sub    $0x69,%eax
je     11e2 <main+0xb2>
jmp    11c0 <main+0x90>
mov    -0xc(%rbp),%eax
sub    $0x72,%eax
je     11f3 <main+0xc3>
jmp    1204 <main+0xd4>
lea    0xe67(%rip),%rdi
call   1030 <puts@plt>
jmp    1210 <main+0xe0>
lea    0xe61(%rip),%rdi
call   1030 <puts@plt>
jmp    1210 <main+0xe0>
lea    0xe5c(%rip),%rdi
call   1030 <puts@plt>
jmp    1210 <main+0xe0>
lea    0xe57(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf19(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
call   1040 <printf@plt>
lea    0xecc(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1050 <scanf@plt>
movsbl 0x7(%rsp),%eax
add    $0xffffffbc,%eax
cmp    $0x2e,%eax
ja     11b2 <main+0x82>
movabs $0x100000001,%rcx
bt     %rax,%rcx
jb     11a9 <main+0x79>
movabs $0x2000000020,%rcx
bt     %rax,%rcx
jb     11a0 <main+0x70>
movabs $0x400000004000,%rcx
bt     %rax,%rcx
jae    11b2 <main+0x82>
lea    0xe98(%rip),%rdi
jmp    11b9 <main+0x89>
lea    0xe83(%rip),%rdi
jmp    11b9 <main+0x89>
lea    0xe6f(%rip),%rdi
jmp    11b9 <main+0x89>
lea    0xe89(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [32 x i8] c"Which is your political party?\0A\00"
@.str.1 = [28 x i8] c"D, I, R or something else: \00"
@.str.2 = [3 x i8] c"%c\00"
@.str.3 = [11 x i8] c"Democratic\00"
@.str.4 = [12 x i8] c"Independent\00"
@.str.5 = [12 x i8] c"Republican.\00"
@.str.6 = [15 x i8] c"Something else\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %2)
%6 = load i8, i8* %2
%7 = sext i8 %6 to i32
switch i32 %7, label %14 [
i32 100, label %8
i32 68, label %8
i32 105, label %10
i32 73, label %10
i32 114, label %12
i32 82, label %12
]
8: ; preds = %0, %0
%9 = call i32 @puts(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
br label %16
10: ; preds = %0, %0
%11 = call i32 @puts(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0))
br label %16
12: ; preds = %0, %0
%13 = call i32 @puts(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0))
br label %16
14: ; preds = %0
%15 = call i32 @puts(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0))
br label %16
16: ; preds = %14, %12, %10, %8
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [28 x i8] c"D, I, R or something else: \00"
@.str.2 = [3 x i8] c"%c\00"
@.str.3 = [11 x i8] c"Democratic\00"
@.str.4 = [12 x i8] c"Independent\00"
@.str.5 = [12 x i8] c"Republican.\00"
@.str.6 = [15 x i8] c"Something else\00"
@str = [31 x i8] c"Which is your political party?\00"
define i32 @main() {
%1 = alloca i8
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %1)
%5 = load i8, i8* %1
%6 = sext i8 %5 to i32
switch i32 %6, label %9 [
i32 100, label %10
i32 68, label %10
i32 105, label %7
i32 73, label %7
i32 114, label %8
i32 82, label %8
]
7: ; preds = %0, %0
br label %10
8: ; preds = %0, %0
br label %10
9: ; preds = %0
br label %10
10: ; preds = %0, %0, %9, %8, %7
%11 = phi i8* [ getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0), %9 ], [ getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), %8 ], [ getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), %7 ], [ getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), %0 ], [ getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), %0 ]
%12 = call i32 @puts(i8* dereferenceable(1) %11)
ret i32 0
}