#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*/ encoded_number_basefmt(int);
int /*<<< orphan*/ strcpy(char *, int /*<<< orphan*/);
char *encoded_number_xfmt(int number) {
  static char buf[4];
  if (number >= -46 && number <= 46) {
    buf[0] = '!' + number + 46;
    buf[1] = 0;
    return (buf);
  }
  if (number >= -92 && number <= 92) {
    buf[0] = number < 0 ? '!' : '}';
    buf[1] = '!' + (number < 0 ? number + 92 : number);
    buf[2] = 0;
    return (buf);
  }
  buf[0] = '~';
  strcpy(buf + 1, encoded_number_basefmt(number));
  return (buf);
}


x86 assembly (clang, -O0):
<encoded_number_xfmt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0xc(%rbp)
cmpl   $0xffffffd2,-0xc(%rbp)
jl     1165 <encoded_number_xfmt+0x45>
cmpl   $0x2e,-0xc(%rbp)
jg     1165 <encoded_number_xfmt+0x45>
mov    -0xc(%rbp),%eax
add    $0x21,%eax
add    $0x2e,%eax
mov    %al,0x2ee3(%rip)
movb   $0x0,0x2edd(%rip)
lea    0x2ed5(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11fb <encoded_number_xfmt+0xdb>
cmpl   $0xffffffa4,-0xc(%rbp)
jl     11d3 <encoded_number_xfmt+0xb3>
cmpl   $0x5c,-0xc(%rbp)
jg     11d3 <encoded_number_xfmt+0xb3>
mov    -0xc(%rbp),%edx
mov    $0x7d,%eax
mov    $0x21,%ecx
cmp    $0x0,%edx
cmovl  %ecx,%eax
mov    %al,0x2e9f(%rip)
cmpl   $0x0,-0xc(%rbp)
jge    11aa <encoded_number_xfmt+0x8a>
mov    -0xc(%rbp),%eax
add    $0x5c,%eax
mov    %eax,-0x10(%rbp)
jmp    11b0 <encoded_number_xfmt+0x90>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x21,%eax
mov    %al,0x2e76(%rip)
movb   $0x0,0x2e70(%rip)
lea    0x2e67(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11fb <encoded_number_xfmt+0xdb>
movb   $0x7e,0x2e57(%rip)
mov    -0xc(%rbp),%edi
call   1040 <encoded_number_basefmt@plt>
mov    %eax,%esi
lea    0x2e47(%rip),%rdi
call   1030 <strcpy@plt>
lea    0x2e3a(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<encoded_number_xfmt>:
push   %rax
lea    0x2e(%rdi),%eax
cmp    $0x5c,%eax
ja     113d <encoded_number_xfmt+0x1d>
add    $0x4f,%dil
mov    %dil,0x2efd(%rip)
movb   $0x0,0x2ef7(%rip)
jmp    118a <encoded_number_xfmt+0x6a>
lea    0x5c(%rdi),%eax
cmp    $0xb8,%eax
ja     1170 <encoded_number_xfmt+0x50>
test   %edi,%edi
mov    $0x21,%ecx
mov    $0x7d,%edx
cmovs  %ecx,%edx
cmovns %edi,%eax
mov    %dl,0x2ed2(%rip)
add    $0x21,%al
mov    %al,0x2ecb(%rip)
movb   $0x0,0x2ec5(%rip)
jmp    118a <encoded_number_xfmt+0x6a>
movb   $0x7e,0x2eba(%rip)
call   1040 <encoded_number_basefmt@plt>
lea    0x2eaf(%rip),%rdi
mov    %eax,%esi
call   1030 <strcpy@plt>
lea    0x2ea0(%rip),%rax
pop    %rcx
ret

LLVM IR (-O0):
@encoded_number_xfmt.buf = internal global [4 x i8] zeroinitializer
define i8* @encoded_number_xfmt(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, -46
br i1 %5, label %6, label %14
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 46
br i1 %8, label %9, label %14
9: ; preds = %6
%10 = load i32, i32* %3
%11 = add nsw i32 33, %10
%12 = add nsw i32 %11, 46
%13 = trunc i32 %12 to i8
store i8 %13, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @encoded_number_xfmt.buf, i64 0, i64 0)
store i8 0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @encoded_number_xfmt.buf, i64 0, i64 1)
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @encoded_number_xfmt.buf, i64 0, i64 0), i8** %2
br label %41
14: ; preds = %6, %1
%15 = load i32, i32* %3
%16 = icmp sge i32 %15, -92
br i1 %16, label %17, label %37
17: ; preds = %14
%18 = load i32, i32* %3
%19 = icmp sle i32 %18, 92
br i1 %19, label %20, label %37
20: ; preds = %17
%21 = load i32, i32* %3
%22 = icmp slt i32 %21, 0
%23 = zext i1 %22 to i64
%24 = select i1 %22, i32 33, i32 125
%25 = trunc i32 %24 to i8
store i8 %25, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @encoded_number_xfmt.buf, i64 0, i64 0)
%26 = load i32, i32* %3
%27 = icmp slt i32 %26, 0
br i1 %27, label %28, label %31
28: ; preds = %20
%29 = load i32, i32* %3
%30 = add nsw i32 %29, 92
br label %33
31: ; preds = %20
%32 = load i32, i32* %3
br label %33
33: ; preds = %31, %28
%34 = phi i32 [ %30, %28 ], [ %32, %31 ]
%35 = add nsw i32 33, %34
%36 = trunc i32 %35 to i8
store i8 %36, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @encoded_number_xfmt.buf, i64 0, i64 1)
store i8 0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @encoded_number_xfmt.buf, i64 0, i64 2)
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @encoded_number_xfmt.buf, i64 0, i64 0), i8** %2
br label %41
37: ; preds = %17, %14
store i8 126, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @encoded_number_xfmt.buf, i64 0, i64 0)
%38 = load i32, i32* %3
%39 = call i32 @encoded_number_basefmt(i32 %38)
%40 = call i32 @strcpy(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @encoded_number_xfmt.buf, i64 0, i64 1), i32 %39)
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @encoded_number_xfmt.buf, i64 0, i64 0), i8** %2
br label %41
41: ; preds = %37, %33, %9
%42 = load i8*, i8** %2
ret i8* %42
}

LLVM IR (-O2):
@encoded_number_xfmt.buf = internal global [4 x i8] zeroinitializer
define i8* @encoded_number_xfmt(i32 %0) {
%2 = add i32 %0, 46
%3 = icmp ult i32 %2, 93
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = trunc i32 %0 to i8
%6 = add nsw i8 %5, 79
store i8 %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @encoded_number_xfmt.buf, i64 0, i64 0)
store i8 0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @encoded_number_xfmt.buf, i64 0, i64 1)
br label %19
7: ; preds = %1
%8 = add i32 %0, 92
%9 = icmp ult i32 %8, 185
br i1 %9, label %10, label %16
10: ; preds = %7
%11 = icmp slt i32 %0, 0
%12 = select i1 %11, i8 33, i8 125
store i8 %12, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @encoded_number_xfmt.buf, i64 0, i64 0)
%13 = select i1 %11, i32 %8, i32 %0
%14 = trunc i32 %13 to i8
%15 = add nuw nsw i8 %14, 33
store i8 %15, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @encoded_number_xfmt.buf, i64 0, i64 1)
store i8 0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @encoded_number_xfmt.buf, i64 0, i64 2)
br label %19
16: ; preds = %7
store i8 126, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @encoded_number_xfmt.buf, i64 0, i64 0)
%17 = tail call i32 @encoded_number_basefmt(i32 %0)
%18 = tail call i32 @strcpy(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @encoded_number_xfmt.buf, i64 0, i64 1), i32 %17)
br label %19
19: ; preds = %16, %10, %4
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @encoded_number_xfmt.buf, i64 0, i64 0)
}