#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 Getc();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ skip(int);
extern void key_server_preferences(int len) {
  int c = Getc();
  printf("\t\tFlag - ");
  switch (c) {
  case 0x80:
    printf("No-modify");
    break;
  case 0x0:
    printf("Normal");
    break;
  default:
    printf("Unknown flag(%02x)", c);
    break;
  }
  printf("\n");
  skip(len - 1);
}


x86 assembly (clang, -O0):
<key_server_preferences>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
mov    %al,-0xd(%rbp)
call   1050 <Getc@plt>
mov    %eax,%ecx
mov    -0xd(%rbp),%al
mov    %ecx,-0x8(%rbp)
lea    0xeac(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
test   %eax,%eax
je     1192 <key_server_preferences+0x62>
jmp    116c <key_server_preferences+0x3c>
mov    -0xc(%rbp),%eax
sub    $0x80,%eax
jne    11a5 <key_server_preferences+0x75>
jmp    117f <key_server_preferences+0x4f>
lea    0xe84(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11b6 <key_server_preferences+0x86>
lea    0xe7b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11b6 <key_server_preferences+0x86>
mov    -0x8(%rbp),%esi
lea    0xe6c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe71(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
call   1030 <skip@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<key_server_preferences>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %eax,%eax
call   1060 <Getc@plt>
mov    %eax,%ebp
lea    0xeab(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
test   %ebp,%ebp
je     1171 <key_server_preferences+0x31>
cmp    $0x80,%ebp
jne    1181 <key_server_preferences+0x41>
lea    0xe9b(%rip),%rdi
jmp    1178 <key_server_preferences+0x38>
lea    0xe9c(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    1191 <key_server_preferences+0x51>
lea    0xe93(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
add    $0xffffffff,%ebx
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <skip@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"\09\09Flag - \00"
@.str.1 = [10 x i8] c"No-modify\00"
@.str.2 = [7 x i8] c"Normal\00"
@.str.3 = [19 x i8] c"Unknown flag(%02x)\00"
@.str.4 = [2 x i8] c"\0A\00"
define void @key_server_preferences(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 (...) @Getc()
store i32 %4, i32* %3
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* %3
switch i32 %6, label %11 [
i32 128, label %7
i32 0, label %9
]
7: ; preds = %1
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
br label %14
9: ; preds = %1
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
br label %14
11: ; preds = %1
%12 = load i32, i32* %3
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i32 %12)
br label %14
14: ; preds = %11, %9, %7
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%16 = load i32, i32* %2
%17 = sub nsw i32 %16, 1
%18 = call i32 @skip(i32 %17)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"\09\09Flag - \00"
@.str.1 = [10 x i8] c"No-modify\00"
@.str.2 = [7 x i8] c"Normal\00"
@.str.3 = [19 x i8] c"Unknown flag(%02x)\00"
define void @key_server_preferences(i32 %0) {
%2 = tail call i32 (...) @Getc()
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
switch i32 %2, label %8 [
i32 128, label %4
i32 0, label %6
]
4: ; preds = %1
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
br label %10
6: ; preds = %1
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
br label %10
8: ; preds = %1
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i32 %2)
br label %10
10: ; preds = %8, %6, %4
%11 = tail call i32 @putchar(i32 10)
%12 = add nsw i32 %0, -1
%13 = tail call i32 @skip(i32 %12)
ret void
}