#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*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
char inttochar(int num) {
  if (num == 0)
    return 'A';
  if (num == 1)
    return 'C';
  if (num == 2)
    return 'G';
  if (num == 3)
    return 'T';
  fprintf(stderr, "*WARNING*: inttochar() received unsupported number: %d\n",
          num);
  return '?';
}


x86 assembly (clang, -O0):
<inttochar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    112e <inttochar+0x1e>
movb   $0x41,-0x1(%rbp)
jmp    1183 <inttochar+0x73>
cmpl   $0x1,-0x8(%rbp)
jne    1141 <inttochar+0x31>
movb   $0x43,-0x1(%rbp)
jmp    1183 <inttochar+0x73>
cmpl   $0x2,-0x8(%rbp)
jne    1154 <inttochar+0x44>
movb   $0x47,-0x1(%rbp)
jmp    1183 <inttochar+0x73>
cmpl   $0x3,-0x8(%rbp)
jne    1167 <inttochar+0x57>
movb   $0x54,-0x1(%rbp)
jmp    1183 <inttochar+0x73>
mov    0x2e72(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%edx
lea    0xe86(%rip),%rsi
call   1030 <fprintf@plt>
movb   $0x3f,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inttochar>:
mov    %edi,%ecx
cmp    $0x4,%edi
jae    1122 <inttochar+0x12>
shl    $0x3,%ecx
mov    $0x54474341,%eax
shr    %cl,%eax
ret
push   %rax
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
lea    0xecd(%rip),%rsi
mov    %ecx,%edx
call   1030 <fprintf@plt>
mov    $0x3f,%al
add    $0x8,%rsp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [56 x i8] c"*WARNING*: inttochar() received unsupported number: %d\0A\00"
define signext i8 @inttochar(i32 %0) {
%2 = alloca i8
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i8 65, i8* %2
br label %23
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %11
10: ; preds = %7
store i8 67, i8* %2
br label %23
11: ; preds = %7
%12 = load i32, i32* %3
%13 = icmp eq i32 %12, 2
br i1 %13, label %14, label %15
14: ; preds = %11
store i8 71, i8* %2
br label %23
15: ; preds = %11
%16 = load i32, i32* %3
%17 = icmp eq i32 %16, 3
br i1 %17, label %18, label %19
18: ; preds = %15
store i8 84, i8* %2
br label %23
19: ; preds = %15
%20 = load i32, i32* @stderr
%21 = load i32, i32* %3
%22 = call i32 @fprintf(i32 %20, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i32 %21)
store i8 63, i8* %2
br label %23
23: ; preds = %19, %18, %14, %10, %6
%24 = load i8, i8* %2
ret i8 %24
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [56 x i8] c"*WARNING*: inttochar() received unsupported number: %d\0A\00"
define signext i8 @inttochar(i32 %0) {
%2 = icmp ult i32 %0, 4
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %10
6: ; preds = %1
%7 = shl i32 %0, 3
%8 = lshr i32 1413956417, %7
%9 = trunc i32 %8 to i8
br label %10
10: ; preds = %6, %3
%11 = phi i8 [ 63, %3 ], [ %9, %6 ]
ret i8 %11
}