#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 decodeState(char);
int /*<<< orphan*/ sprintf(char *, char *, int, int, int, int);
char *decodedGameVersion(char version[]) {
  static char str[100];
  sprintf(str, "%d.%d%s%d", (int)version[3], (int)version[2],
          decodeState(version[0]), (int)version[1]);
  return str;
}


x86 assembly (clang, -O0):
<decodedGameVersion>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl 0x3(%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl 0x2(%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <decodeState@plt>
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    %eax,%r8d
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%r9d
lea    0x2ed9(%rip),%rdi
lea    0xe92(%rip),%rsi
call   1040 <sprintf@plt>
lea    0x2ec6(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decodedGameVersion>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
movsbl 0x3(%rdi),%ebp
movsbl 0x2(%rdi),%r14d
movsbl (%rdi),%edi
call   1030 <decodeState@plt>
movsbl 0x1(%rbx),%r9d
lea    0x2efc(%rip),%rbx
lea    0xeb5(%rip),%rsi
mov    %rbx,%rdi
mov    %ebp,%edx
mov    %r14d,%ecx
mov    %eax,%r8d
call   1040 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@decodedGameVersion.str = internal global [100 x i8] zeroinitializer
@.str = [10 x i8] c"%d.%d%s%d\00"
define i8* @decodedGameVersion(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 3
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 2
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = load i8*, i8** %2
%12 = getelementptr inbounds i8, i8* %11, i64 0
%13 = load i8, i8* %12
%14 = call i32 @decodeState(i8 signext %13)
%15 = load i8*, i8** %2
%16 = getelementptr inbounds i8, i8* %15, i64 1
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = call i32 @sprintf(i8* getelementptr inbounds ([100 x i8], [100 x i8]* @decodedGameVersion.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %10, i32 %14, i32 %18)
ret i8* getelementptr inbounds ([100 x i8], [100 x i8]* @decodedGameVersion.str, i64 0, i64 0)
}

LLVM IR (-O2):
@decodedGameVersion.str = internal global [100 x i8] zeroinitializer
@.str = [10 x i8] c"%d.%d%s%d\00"
define i8* @decodedGameVersion(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 3
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = getelementptr inbounds i8, i8* %0, i64 2
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = load i8, i8* %0
%9 = tail call i32 @decodeState(i8 signext %8)
%10 = getelementptr inbounds i8, i8* %0, i64 1
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([100 x i8], [100 x i8]* @decodedGameVersion.str, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %7, i32 %9, i32 %12)
ret i8* getelementptr inbounds ([100 x i8], [100 x i8]* @decodedGameVersion.str, i64 0, i64 0)
}