#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*/ printf(char *, int, char *);
int /*<<< orphan*/ strcpy(char *, char *);
void testajogo(char *movinito, int numero) {
  char *jogo1 = "g1f3 g8f6 c2c4 b7b6 g2g3 c8b7 f1g2 d7d5 e1g1 d5c4 d1a4 c7c6 "
                "a4c4 b7a6 c4d4 a6e2 f1e1";
  char move[5];
  int i;
  move[0] = '\0';
  for (i = 0; i < 4; i++)
    move[i] = jogo1[numero * 5 + i];
  strcpy(movinito, move);
  printf("%d:%s\n", (numero + 2) / 2, move);
}


x86 assembly (clang, -O0):
<testajogo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x18(%rbp)
movb   $0x0,-0x1d(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0x4,-0x24(%rbp)
jge    1176 <testajogo+0x56>
mov    -0x18(%rbp),%rax
imul   $0x5,-0xc(%rbp),%ecx
add    -0x24(%rbp),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%cl
movslq -0x24(%rbp),%rax
mov    %cl,-0x1d(%rbp,%rax,1)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1145 <testajogo+0x25>
mov    -0x8(%rbp),%rdi
lea    -0x1d(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0xc(%rbp),%eax
add    $0x2,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
lea    -0x1d(%rbp),%rdx
lea    0xeb7(%rip),%rdi
call   1040 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testajogo>:
push   %r14
push   %rbx
push   %rax
movslq %esi,%rbx
lea    (%rbx,%rbx,4),%rax
lea    0xece(%rip),%rcx
mov    (%rcx,%rax,1),%eax
mov    %eax,(%rsp)
mov    %rsp,%r14
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %ebx,%eax
add    $0x2,%eax
shr    $0x1f,%eax
lea    (%rbx,%rax,1),%esi
add    $0x2,%esi
sar    %esi
lea    0xefb(%rip),%rdi
mov    %r14,%rdx
call   1040 <printf@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [85 x i8] c"g1f3 g8f6 c2c4 b7b6 g2g3 c8b7 f1g2 d7d5 e1g1 d5c4 d1a4 c7c6 a4c4 b7a6 c4d4 a6e2 f1e1\00"
@.str.1 = [7 x i8] c"%d:%s\0A\00"
define void @testajogo(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
%6 = alloca [5 x i8]
%7 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
store i8* getelementptr inbounds ([85 x i8], [85 x i8]* @.str, i64 0, i64 0), i8** %5
%8 = getelementptr inbounds [5 x i8], [5 x i8]* %6, i64 0, i64 0
store i8 0, i8* %8
store i32 0, i32* %7
br label %9
9: ; preds = %24, %2
%10 = load i32, i32* %7
%11 = icmp slt i32 %10, 4
br i1 %11, label %12, label %27
12: ; preds = %9
%13 = load i8*, i8** %5
%14 = load i32, i32* %4
%15 = mul nsw i32 %14, 5
%16 = load i32, i32* %7
%17 = add nsw i32 %15, %16
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %13, i64 %18
%20 = load i8, i8* %19
%21 = load i32, i32* %7
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [5 x i8], [5 x i8]* %6, i64 0, i64 %22
store i8 %20, i8* %23
br label %24
24: ; preds = %12
%25 = load i32, i32* %7
%26 = add nsw i32 %25, 1
store i32 %26, i32* %7
br label %9
27: ; preds = %9
%28 = load i8*, i8** %3
%29 = getelementptr inbounds [5 x i8], [5 x i8]* %6, i64 0, i64 0
%30 = call i32 @strcpy(i8* %28, i8* %29)
%31 = load i32, i32* %4
%32 = add nsw i32 %31, 2
%33 = sdiv i32 %32, 2
%34 = getelementptr inbounds [5 x i8], [5 x i8]* %6, i64 0, i64 0
%35 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %33, i8* %34)
ret void
}

LLVM IR (-O2):
@.str = [85 x i8] c"g1f3 g8f6 c2c4 b7b6 g2g3 c8b7 f1g2 d7d5 e1g1 d5c4 d1a4 c7c6 a4c4 b7a6 c4d4 a6e2 f1e1\00"
@.str.1 = [7 x i8] c"%d:%s\0A\00"
define void @testajogo(i8* %0, i32 %1) {
%3 = alloca [5 x i8]
%4 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 0
%5 = mul nsw i32 %1, 5
%6 = sext i32 %5 to i64
%7 = getelementptr [85 x i8], [85 x i8]* @.str, i64 0, i64 %6
%8 = bitcast i8* %7 to i32*
%9 = bitcast [5 x i8]* %3 to i32*
%10 = load i32, i32* %8
store i32 %10, i32* %9
%11 = call i32 @strcpy(i8* %0, i8* %4)
%12 = add nsw i32 %1, 2
%13 = sdiv i32 %12, 2
%14 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %13, i8* %4)
ret void
}