#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*/ sprintf(char *, char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int unpackcall(int ncall, char *call) {
  char c[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C',
              'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P',
              'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', ' '};
  int n;
  int i;
  char tmp[7];
  n = ncall;
  strcpy(call, "......");
  if (n < 262177560) {
    i = n % 27 + 10;
    tmp[5] = c[i];
    n = n / 27;
    i = n % 27 + 10;
    tmp[4] = c[i];
    n = n / 27;
    i = n % 27 + 10;
    tmp[3] = c[i];
    n = n / 27;
    i = n % 10;
    tmp[2] = c[i];
    n = n / 10;
    i = n % 36;
    tmp[1] = c[i];
    n = n / 36;
    i = n;
    tmp[0] = c[i];
    tmp[6] = '\0';
    for (i = 0; i < 5; i++) {
      if (tmp[i] != c[36])
        break;
    }
    sprintf(call, "%-6s", &tmp[i]);
    for (i = 0; i < 6; i++) {
      if (call[i] == c[36]) {
        call[i] = '\0';
      }
    }
  } else {
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<unpackcall>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x25,%edx
call   1040 <memcpy@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x44(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec0(%rip),%rsi
call   1030 <strcpy@plt>
cmpl   $0xfa08318,-0x44(%rbp)
jge    12fe <unpackcall+0x1ce>
mov    -0x44(%rbp),%eax
mov    $0x1b,%ecx
cltd
idiv   %ecx
add    $0xa,%edx
mov    %edx,-0x48(%rbp)
movslq -0x48(%rbp),%rax
mov    -0x40(%rbp,%rax,1),%al
mov    %al,-0x4a(%rbp)
mov    -0x44(%rbp),%eax
mov    $0x1b,%ecx
cltd
idiv   %ecx
mov    %eax,-0x44(%rbp)
mov    -0x44(%rbp),%eax
mov    $0x1b,%ecx
cltd
idiv   %ecx
add    $0xa,%edx
mov    %edx,-0x48(%rbp)
movslq -0x48(%rbp),%rax
mov    -0x40(%rbp,%rax,1),%al
mov    %al,-0x4b(%rbp)
mov    -0x44(%rbp),%eax
mov    $0x1b,%ecx
cltd
idiv   %ecx
mov    %eax,-0x44(%rbp)
mov    -0x44(%rbp),%eax
mov    $0x1b,%ecx
cltd
idiv   %ecx
add    $0xa,%edx
mov    %edx,-0x48(%rbp)
movslq -0x48(%rbp),%rax
mov    -0x40(%rbp,%rax,1),%al
mov    %al,-0x4c(%rbp)
mov    -0x44(%rbp),%eax
mov    $0x1b,%ecx
cltd
idiv   %ecx
mov    %eax,-0x44(%rbp)
mov    -0x44(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x48(%rbp)
movslq -0x48(%rbp),%rax
mov    -0x40(%rbp,%rax,1),%al
mov    %al,-0x4d(%rbp)
mov    -0x44(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x44(%rbp)
mov    -0x44(%rbp),%eax
mov    $0x24,%ecx
cltd
idiv   %ecx
mov    %edx,-0x48(%rbp)
movslq -0x48(%rbp),%rax
mov    -0x40(%rbp,%rax,1),%al
mov    %al,-0x4e(%rbp)
mov    -0x44(%rbp),%eax
mov    $0x24,%ecx
cltd
idiv   %ecx
mov    %eax,-0x44(%rbp)
mov    -0x44(%rbp),%eax
mov    %eax,-0x48(%rbp)
movslq -0x48(%rbp),%rax
mov    -0x40(%rbp,%rax,1),%al
mov    %al,-0x4f(%rbp)
movb   $0x0,-0x49(%rbp)
movl   $0x0,-0x48(%rbp)
cmpl   $0x5,-0x48(%rbp)
jge    1296 <unpackcall+0x166>
movslq -0x48(%rbp),%rax
movsbl -0x4f(%rbp,%rax,1),%eax
movsbl -0x1c(%rbp),%ecx
cmp    %ecx,%eax
je     1283 <unpackcall+0x153>
jmp    1296 <unpackcall+0x166>
jmp    1288 <unpackcall+0x158>
mov    -0x48(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x48(%rbp)
jmp    125f <unpackcall+0x12f>
mov    -0x10(%rbp),%rdi
movslq -0x48(%rbp),%rax
lea    -0x4f(%rbp),%rdx
add    %rax,%rdx
lea    0xd80(%rip),%rsi
call   1050 <sprintf@plt>
movl   $0x0,-0x48(%rbp)
cmpl   $0x6,-0x48(%rbp)
jge    12f9 <unpackcall+0x1c9>
mov    -0x10(%rbp),%rax
movslq -0x48(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0x1c(%rbp),%ecx
cmp    %ecx,%eax
jne    12e6 <unpackcall+0x1b6>
mov    -0x10(%rbp),%rax
movslq -0x48(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
jmp    12eb <unpackcall+0x1bb>
mov    -0x48(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x48(%rbp)
jmp    12b8 <unpackcall+0x188>
jmp    130a <unpackcall+0x1da>
movl   $0x0,-0x4(%rbp)
jmp    1311 <unpackcall+0x1e1>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unpackcall>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xef6(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
xor    %eax,%eax
cmp    $0xfa08317,%ebp
jg     12cc <unpackcall+0x1ac>
movslq %ebp,%rax
imul   $0x4bda12f7,%rax,%rdx
mov    %rdx,%rcx
shr    $0x3f,%rcx
sar    $0x23,%rdx
add    %ecx,%edx
lea    (%rdx,%rdx,8),%ecx
lea    (%rcx,%rcx,2),%ecx
mov    %ebp,%esi
sub    %ecx,%esi
movslq %esi,%rsi
lea    0xe90(%rip),%rdi
mov    0xa(%rsi,%rdi,1),%cl
mov    %cl,0x6(%rsp)
movslq %edx,%rcx
imul   $0x4bda12f7,%rcx,%rdx
mov    %rdx,%rsi
shr    $0x3f,%rsi
sar    $0x23,%rdx
add    %esi,%edx
lea    (%rdx,%rdx,8),%edx
lea    (%rdx,%rdx,2),%edx
sub    %edx,%ecx
movslq %ecx,%rcx
mov    0xa(%rcx,%rdi,1),%cl
mov    %cl,0x5(%rsp)
imul   $0x59e60383,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x28,%rcx
add    %edx,%ecx
movslq %ecx,%rcx
imul   $0x4bda12f7,%rcx,%rdx
mov    %rdx,%rsi
shr    $0x3f,%rsi
sar    $0x23,%rdx
add    %esi,%edx
lea    (%rdx,%rdx,8),%edx
lea    (%rdx,%rdx,2),%edx
sub    %edx,%ecx
movslq %ecx,%rcx
mov    0xa(%rcx,%rdi,1),%cl
mov    %cl,0x4(%rsp)
imul   $0x6a8bde3d,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x2d,%rcx
add    %edx,%ecx
movslq %ecx,%rcx
imul   $0x66666667,%rcx,%rdx
mov    %rdx,%rsi
shr    $0x3f,%rsi
sar    $0x22,%rdx
add    %esi,%edx
add    %edx,%edx
lea    (%rdx,%rdx,4),%edx
sub    %edx,%ecx
movslq %ecx,%rcx
mov    (%rcx,%rdi,1),%cl
mov    %cl,0x3(%rsp)
imul   $0x2a9e58e5,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x2f,%rcx
add    %edx,%ecx
movswl %cx,%edx
imul   $0xe39,%edx,%edx
mov    %edx,%esi
shr    $0x1f,%esi
sar    $0x11,%edx
add    %esi,%edx
shl    $0x2,%edx
lea    (%rdx,%rdx,8),%edx
sub    %edx,%ecx
movswq %cx,%rcx
mov    (%rcx,%rdi,1),%cl
mov    %cl,0x2(%rsp)
imul   $0x25e21621,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x34,%rax
add    %ecx,%eax
cltq
mov    (%rax,%rdi,1),%al
mov    %al,0x1(%rsp)
movb   $0x0,0x7(%rsp)
add    $0xf0cb9c20,%ebp
cmp    $0x6c1f38,%ebp
lea    0x1(%rsp),%rdx
adc    $0x0,%rdx
lea    0xd98(%rip),%rsi
mov    %rbx,%rdi
call   1040 <sprintf@plt>
cmpb   $0x20,(%rbx)
je     12d3 <unpackcall+0x1b3>
cmpb   $0x20,0x1(%rbx)
je     12dc <unpackcall+0x1bc>
cmpb   $0x20,0x2(%rbx)
je     12e6 <unpackcall+0x1c6>
cmpb   $0x20,0x3(%rbx)
je     12f0 <unpackcall+0x1d0>
cmpb   $0x20,0x4(%rbx)
jne    12bd <unpackcall+0x19d>
movb   $0x0,0x4(%rbx)
mov    $0x1,%eax
cmpb   $0x20,0x5(%rbx)
jne    12cc <unpackcall+0x1ac>
movb   $0x0,0x5(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
movb   $0x0,(%rbx)
cmpb   $0x20,0x1(%rbx)
jne    12a7 <unpackcall+0x187>
movb   $0x0,0x1(%rbx)
cmpb   $0x20,0x2(%rbx)
jne    12ad <unpackcall+0x18d>
movb   $0x0,0x2(%rbx)
cmpb   $0x20,0x3(%rbx)
jne    12b3 <unpackcall+0x193>
movb   $0x0,0x3(%rbx)
cmpb   $0x20,0x4(%rbx)
je     12b9 <unpackcall+0x199>
jmp    12bd <unpackcall+0x19d>

LLVM IR (-O0):
@__const.unpackcall.c = [37 x i8] c"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ "
@.str = [7 x i8] c"......\00"
@.str.1 = [5 x i8] c"%-6s\00"
define i32 @unpackcall(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
%6 = alloca [37 x i8]
%7 = alloca i32
%8 = alloca i32
%9 = alloca [7 x i8]
store i32 %0, i32* %4
store i8* %1, i8** %5
%10 = bitcast [37 x i8]* %6 to i8*
%11 = load i32, i32* %4
store i32 %11, i32* %7
%12 = load i8*, i8** %5
%13 = call i32 @strcpy(i8* %12, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%14 = load i32, i32* %7
%15 = icmp slt i32 %14, 262177560
br i1 %15, label %16, label %120
16: ; preds = %2
%17 = load i32, i32* %7
%18 = srem i32 %17, 27
%19 = add nsw i32 %18, 10
store i32 %19, i32* %8
%20 = load i32, i32* %8
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [37 x i8], [37 x i8]* %6, i64 0, i64 %21
%23 = load i8, i8* %22
%24 = getelementptr inbounds [7 x i8], [7 x i8]* %9, i64 0, i64 5
store i8 %23, i8* %24
%25 = load i32, i32* %7
%26 = sdiv i32 %25, 27
store i32 %26, i32* %7
%27 = load i32, i32* %7
%28 = srem i32 %27, 27
%29 = add nsw i32 %28, 10
store i32 %29, i32* %8
%30 = load i32, i32* %8
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [37 x i8], [37 x i8]* %6, i64 0, i64 %31
%33 = load i8, i8* %32
%34 = getelementptr inbounds [7 x i8], [7 x i8]* %9, i64 0, i64 4
store i8 %33, i8* %34
%35 = load i32, i32* %7
%36 = sdiv i32 %35, 27
store i32 %36, i32* %7
%37 = load i32, i32* %7
%38 = srem i32 %37, 27
%39 = add nsw i32 %38, 10
store i32 %39, i32* %8
%40 = load i32, i32* %8
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds [37 x i8], [37 x i8]* %6, i64 0, i64 %41
%43 = load i8, i8* %42
%44 = getelementptr inbounds [7 x i8], [7 x i8]* %9, i64 0, i64 3
store i8 %43, i8* %44
%45 = load i32, i32* %7
%46 = sdiv i32 %45, 27
store i32 %46, i32* %7
%47 = load i32, i32* %7
%48 = srem i32 %47, 10
store i32 %48, i32* %8
%49 = load i32, i32* %8
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds [37 x i8], [37 x i8]* %6, i64 0, i64 %50
%52 = load i8, i8* %51
%53 = getelementptr inbounds [7 x i8], [7 x i8]* %9, i64 0, i64 2
store i8 %52, i8* %53
%54 = load i32, i32* %7
%55 = sdiv i32 %54, 10
store i32 %55, i32* %7
%56 = load i32, i32* %7
%57 = srem i32 %56, 36
store i32 %57, i32* %8
%58 = load i32, i32* %8
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds [37 x i8], [37 x i8]* %6, i64 0, i64 %59
%61 = load i8, i8* %60
%62 = getelementptr inbounds [7 x i8], [7 x i8]* %9, i64 0, i64 1
store i8 %61, i8* %62
%63 = load i32, i32* %7
%64 = sdiv i32 %63, 36
store i32 %64, i32* %7
%65 = load i32, i32* %7
store i32 %65, i32* %8
%66 = load i32, i32* %8
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds [37 x i8], [37 x i8]* %6, i64 0, i64 %67
%69 = load i8, i8* %68
%70 = getelementptr inbounds [7 x i8], [7 x i8]* %9, i64 0, i64 0
store i8 %69, i8* %70
%71 = getelementptr inbounds [7 x i8], [7 x i8]* %9, i64 0, i64 6
store i8 0, i8* %71
store i32 0, i32* %8
br label %72
72: ; preds = %87, %16
%73 = load i32, i32* %8
%74 = icmp slt i32 %73, 5
br i1 %74, label %75, label %90
75: ; preds = %72
%76 = load i32, i32* %8
%77 = sext i32 %76 to i64
%78 = getelementptr inbounds [7 x i8], [7 x i8]* %9, i64 0, i64 %77
%79 = load i8, i8* %78
%80 = sext i8 %79 to i32
%81 = getelementptr inbounds [37 x i8], [37 x i8]* %6, i64 0, i64 36
%82 = load i8, i8* %81
%83 = sext i8 %82 to i32
%84 = icmp ne i32 %80, %83
br i1 %84, label %85, label %86
85: ; preds = %75
br label %90
86: ; preds = %75
br label %87
87: ; preds = %86
%88 = load i32, i32* %8
%89 = add nsw i32 %88, 1
store i32 %89, i32* %8
br label %72
90: ; preds = %85, %72
%91 = load i8*, i8** %5
%92 = load i32, i32* %8
%93 = sext i32 %92 to i64
%94 = getelementptr inbounds [7 x i8], [7 x i8]* %9, i64 0, i64 %93
%95 = call i32 @sprintf(i8* %91, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %94)
store i32 0, i32* %8
br label %96
96: ; preds = %116, %90
%97 = load i32, i32* %8
%98 = icmp slt i32 %97, 6
br i1 %98, label %99, label %119
99: ; preds = %96
%100 = load i8*, i8** %5
%101 = load i32, i32* %8
%102 = sext i32 %101 to i64
%103 = getelementptr inbounds i8, i8* %100, i64 %102
%104 = load i8, i8* %103
%105 = sext i8 %104 to i32
%106 = getelementptr inbounds [37 x i8], [37 x i8]* %6, i64 0, i64 36
%107 = load i8, i8* %106
%108 = sext i8 %107 to i32
%109 = icmp eq i32 %105, %108
br i1 %109, label %110, label %115
110: ; preds = %99
%111 = load i8*, i8** %5
%112 = load i32, i32* %8
%113 = sext i32 %112 to i64
%114 = getelementptr inbounds i8, i8* %111, i64 %113
store i8 0, i8* %114
br label %115
115: ; preds = %110, %99
br label %116
116: ; preds = %115
%117 = load i32, i32* %8
%118 = add nsw i32 %117, 1
store i32 %118, i32* %8
br label %96
119: ; preds = %96
br label %121
120: ; preds = %2
store i32 0, i32* %3
br label %122
121: ; preds = %119
store i32 1, i32* %3
br label %122
122: ; preds = %121, %120
%123 = load i32, i32* %3
ret i32 %123
}

LLVM IR (-O2):
@__const.unpackcall.c = [37 x i8] c"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ "
@.str = [7 x i8] c"......\00"
@.str.1 = [5 x i8] c"%-6s\00"
define i32 @unpackcall(i32 %0, i8* %1) {
%3 = alloca [7 x i8]
%4 = getelementptr inbounds [7 x i8], [7 x i8]* %3, i64 0, i64 0
%5 = tail call i32 @strcpy(i8* %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%6 = icmp slt i32 %0, 262177560
br i1 %6, label %7, label %79
7: ; preds = %2
%8 = srem i32 %0, 27
%9 = add nsw i32 %8, 10
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [37 x i8], [37 x i8]* @__const.unpackcall.c, i64 0, i64 %10
%12 = load i8, i8* %11
%13 = getelementptr inbounds [7 x i8], [7 x i8]* %3, i64 0, i64 5
store i8 %12, i8* %13
%14 = sdiv i32 %0, 27
%15 = srem i32 %14, 27
%16 = add nsw i32 %15, 10
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [37 x i8], [37 x i8]* @__const.unpackcall.c, i64 0, i64 %17
%19 = load i8, i8* %18
%20 = getelementptr inbounds [7 x i8], [7 x i8]* %3, i64 0, i64 4
store i8 %19, i8* %20
%21 = sdiv i32 %0, 729
%22 = srem i32 %21, 27
%23 = add nsw i32 %22, 10
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [37 x i8], [37 x i8]* @__const.unpackcall.c, i64 0, i64 %24
%26 = load i8, i8* %25
%27 = getelementptr inbounds [7 x i8], [7 x i8]* %3, i64 0, i64 3
store i8 %26, i8* %27
%28 = sdiv i32 %0, 19683
%29 = srem i32 %28, 10
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds [37 x i8], [37 x i8]* @__const.unpackcall.c, i64 0, i64 %30
%32 = load i8, i8* %31
%33 = getelementptr inbounds [7 x i8], [7 x i8]* %3, i64 0, i64 2
store i8 %32, i8* %33
%34 = sdiv i32 %0, 196830
%35 = trunc i32 %34 to i16
%36 = srem i16 %35, 36
%37 = sext i16 %36 to i64
%38 = getelementptr inbounds [37 x i8], [37 x i8]* @__const.unpackcall.c, i64 0, i64 %37
%39 = load i8, i8* %38
%40 = getelementptr inbounds [7 x i8], [7 x i8]* %3, i64 0, i64 1
store i8 %39, i8* %40
%41 = sdiv i32 %0, 7085880
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds [37 x i8], [37 x i8]* @__const.unpackcall.c, i64 0, i64 %42
%44 = load i8, i8* %43
store i8 %44, i8* %4
%45 = getelementptr inbounds [7 x i8], [7 x i8]* %3, i64 0, i64 6
store i8 0, i8* %45
%46 = add i32 %0, -255091680
%47 = icmp ult i32 %46, 7085880
%48 = zext i1 %47 to i64
%49 = getelementptr inbounds [7 x i8], [7 x i8]* %3, i64 0, i64 %48
%50 = call i32 @sprintf(i8* dereferenceable(1) %1, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %49)
%51 = load i8, i8* %1
%52 = icmp eq i8 %51, 32
br i1 %52, label %53, label %54
53: ; preds = %7
store i8 0, i8* %1
br label %54
54: ; preds = %7, %53
%55 = getelementptr inbounds i8, i8* %1, i64 1
%56 = load i8, i8* %55
%57 = icmp eq i8 %56, 32
br i1 %57, label %58, label %59
58: ; preds = %54
store i8 0, i8* %55
br label %59
59: ; preds = %58, %54
%60 = getelementptr inbounds i8, i8* %1, i64 2
%61 = load i8, i8* %60
%62 = icmp eq i8 %61, 32
br i1 %62, label %63, label %64
63: ; preds = %59
store i8 0, i8* %60
br label %64
64: ; preds = %63, %59
%65 = getelementptr inbounds i8, i8* %1, i64 3
%66 = load i8, i8* %65
%67 = icmp eq i8 %66, 32
br i1 %67, label %68, label %69
68: ; preds = %64
store i8 0, i8* %65
br label %69
69: ; preds = %68, %64
%70 = getelementptr inbounds i8, i8* %1, i64 4
%71 = load i8, i8* %70
%72 = icmp eq i8 %71, 32
br i1 %72, label %73, label %74
73: ; preds = %69
store i8 0, i8* %70
br label %74
74: ; preds = %73, %69
%75 = getelementptr inbounds i8, i8* %1, i64 5
%76 = load i8, i8* %75
%77 = icmp eq i8 %76, 32
br i1 %77, label %78, label %79
78: ; preds = %74
store i8 0, i8* %75
br label %79
79: ; preds = %74, %78, %2
%80 = phi i32 [ 0, %2 ], [ 1, %78 ], [ 1, %74 ]
ret i32 %80
}