#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 */
char *decode_cc(unsigned short, int);
int /*<<< orphan*/ printf(char *, ...);
void cc_challenge(int cc) {
  switch (cc) {
  case 0x81:
    printf("GetSessChallenge: Invalid user name\n");
    break;
  case 0x82:
    printf("GetSessChallenge: Null user name not enabled\n");
    break;
  default:
    printf("GetSessChallenge: %s\n", decode_cc((unsigned short)0, cc));
    break;
  }
}


x86 assembly (clang, -O0):
<cc_challenge>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
sub    $0x81,%eax
je     1154 <cc_challenge+0x34>
jmp    1141 <cc_challenge+0x21>
mov    -0x8(%rbp),%eax
sub    $0x82,%eax
je     1167 <cc_challenge+0x47>
jmp    117a <cc_challenge+0x5a>
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1195 <cc_challenge+0x75>
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1195 <cc_challenge+0x75>
mov    -0x4(%rbp),%esi
xor    %edi,%edi
call   1040 <decode_cc@plt>
mov    %rax,%rsi
lea    0xec5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cc_challenge>:
cmp    $0x82,%edi
je     114e <cc_challenge+0x1e>
mov    %edi,%esi
cmp    $0x81,%edi
jne    115a <cc_challenge+0x2a>
lea    0xefa(%rip),%rdi
jmp    1030 <puts@plt>
lea    0xec1(%rip),%rdi
jmp    1030 <puts@plt>
push   %rax
xor    %edi,%edi
call   1050 <decode_cc@plt>
lea    0xe97(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
pop    %rcx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"GetSessChallenge: Invalid user name\0A\00"
@.str.1 = [46 x i8] c"GetSessChallenge: Null user name not enabled\0A\00"
@.str.2 = [22 x i8] c"GetSessChallenge: %s\0A\00"
define void @cc_challenge(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %8 [
i32 129, label %4
i32 130, label %6
]
4: ; preds = %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
br label %12
6: ; preds = %1
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0))
br label %12
8: ; preds = %1
%9 = load i32, i32* %2
%10 = call i8* @decode_cc(i16 zeroext 0, i32 %9)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i8* %10)
br label %12
12: ; preds = %8, %6, %4
ret void
}

LLVM IR (-O2):
@.str.2 = [22 x i8] c"GetSessChallenge: %s\0A\00"
@str = [45 x i8] c"GetSessChallenge: Null user name not enabled\00"
@str.3 = [36 x i8] c"GetSessChallenge: Invalid user name\00"
define void @cc_challenge(i32 %0) {
switch i32 %0, label %6 [
i32 129, label %2
i32 130, label %4
]
2: ; preds = %1
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.3, i64 0, i64 0))
br label %9
4: ; preds = %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str, i64 0, i64 0))
br label %9
6: ; preds = %1
%7 = tail call i8* @decode_cc(i16 zeroext 0, i32 %0)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i8* %7)
br label %9
9: ; preds = %6, %4, %2
ret void
}