char *gfmode(binary, upcase)
int binary, upcase;
{
  char *s;
  switch (binary) {
  case 0:
    s = upcase ? "TEXT" : "text";
    break;
  case 1:
    s = upcase ? "BINARY" : "binary";
    break;
  case 6:
    s = upcase ? "TENEX" : "tenex";
    break;
  default:
    s = "";
  }
  return (s);
}


x86 assembly (clang, -O0):
<gfmode>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
test   %eax,%eax
je     113f <gfmode+0x3f>
jmp    111d <gfmode+0x1d>
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
je     1160 <gfmode+0x60>
jmp    112e <gfmode+0x2e>
mov    -0x14(%rbp),%eax
sub    $0x6,%eax
je     1181 <gfmode+0x81>
jmp    11a2 <gfmode+0xa2>
mov    -0x8(%rbp),%edx
lea    0xebc(%rip),%rax
lea    0xeb0(%rip),%rcx
cmp    $0x0,%edx
cmovne %rcx,%rax
mov    %rax,-0x10(%rbp)
jmp    11ad <gfmode+0xad>
mov    -0x8(%rbp),%edx
lea    0xea7(%rip),%rax
lea    0xe99(%rip),%rcx
cmp    $0x0,%edx
cmovne %rcx,%rax
mov    %rax,-0x10(%rbp)
jmp    11ad <gfmode+0xad>
mov    -0x8(%rbp),%edx
lea    0xe93(%rip),%rax
lea    0xe86(%rip),%rcx
cmp    $0x0,%edx
cmovne %rcx,%rax
mov    %rax,-0x10(%rbp)
jmp    11ad <gfmode+0xad>
lea    0xe5b(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gfmode>:
cmp    $0x6,%edi
je     1123 <gfmode+0x23>
cmp    $0x1,%edi
je     1138 <gfmode+0x38>
test   %edi,%edi
jne    114d <gfmode+0x4d>
test   %esi,%esi
lea    0xeee(%rip),%rcx
lea    0xee2(%rip),%rax
cmove  %rcx,%rax
ret
test   %esi,%esi
lea    0xef2(%rip),%rcx
lea    0xee5(%rip),%rax
cmove  %rcx,%rax
ret
test   %esi,%esi
lea    0xed0(%rip),%rcx
lea    0xec2(%rip),%rax
cmove  %rcx,%rax
ret
lea    0xeb0(%rip),%rax
ret

LLVM IR (-O0):
@.str = [5 x i8] c"TEXT\00"
@.str.1 = [5 x i8] c"text\00"
@.str.2 = [7 x i8] c"BINARY\00"
@.str.3 = [7 x i8] c"binary\00"
@.str.4 = [6 x i8] c"TENEX\00"
@.str.5 = [6 x i8] c"tenex\00"
@.str.6 = [1 x i8] zeroinitializer
define i8* @gfmode(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
switch i32 %6, label %22 [
i32 0, label %7
i32 1, label %12
i32 6, label %17
]
7: ; preds = %2
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 0
%10 = zext i1 %9 to i64
%11 = select i1 %9, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0)
store i8* %11, i8** %5
br label %23
12: ; preds = %2
%13 = load i32, i32* %4
%14 = icmp ne i32 %13, 0
%15 = zext i1 %14 to i64
%16 = select i1 %14, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0)
store i8* %16, i8** %5
br label %23
17: ; preds = %2
%18 = load i32, i32* %4
%19 = icmp ne i32 %18, 0
%20 = zext i1 %19 to i64
%21 = select i1 %19, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0)
store i8* %21, i8** %5
br label %23
22: ; preds = %2
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.6, i64 0, i64 0), i8** %5
br label %23
23: ; preds = %22, %17, %12, %7
%24 = load i8*, i8** %5
ret i8* %24
}

LLVM IR (-O2):
@.str = [5 x i8] c"TEXT\00"
@.str.1 = [5 x i8] c"text\00"
@.str.2 = [7 x i8] c"BINARY\00"
@.str.3 = [7 x i8] c"binary\00"
@.str.4 = [6 x i8] c"TENEX\00"
@.str.5 = [6 x i8] c"tenex\00"
@.str.6 = [1 x i8] zeroinitializer
define i8* @gfmode(i32 %0, i32 %1) {
switch i32 %0, label %12 [
i32 0, label %3
i32 1, label %6
i32 6, label %9
]
3: ; preds = %2
%4 = icmp eq i32 %1, 0
%5 = select i1 %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
br label %12
6: ; preds = %2
%7 = icmp eq i32 %1, 0
%8 = select i1 %7, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0)
br label %12
9: ; preds = %2
%10 = icmp eq i32 %1, 0
%11 = select i1 %10, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0)
br label %12
12: ; preds = %2, %9, %6, %3
%13 = phi i8* [ %11, %9 ], [ %8, %6 ], [ %5, %3 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.6, i64 0, i64 0), %2 ]
ret i8* %13
}