#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 */
char getchar();
int /*<<< orphan*/ printf(char *, ...);
void i_j(unsigned char j[]) {
  int i;
  char w;
  printf("Fase de incicializacion.\n\nPara indicar que el espacio de jugador "
         "será usado, presionar 'S' o 's'.\n");
  printf("En caso contrario, presionar 'N' o 'n'.\n\n");
  for (i = 0; i < 5; i++) {
    printf("Jugador %d: ", i + 1);
    if ((w = getchar()) == 'S' || w == 's')
      j[i] = 1;
    getchar();
  }
}


x86 assembly (clang, -O0):
<i_j>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf23(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x5,-0xc(%rbp)
jge    11b1 <i_j+0x91>
mov    -0xc(%rbp),%esi
add    $0x1,%esi
lea    0xf28(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0xd(%rbp)
movsbl %al,%eax
cmp    $0x53,%eax
je     1190 <i_j+0x70>
movsbl -0xd(%rbp),%eax
cmp    $0x73,%eax
jne    119c <i_j+0x7c>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x1,(%rax,%rcx,1)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    114f <i_j+0x2f>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i_j>:
push   %rbx
mov    %rdi,%rbx
lea    0xed2(%rip),%rdi
call   1030 <puts@plt>
lea    0xf29(%rip),%rdi
call   1030 <puts@plt>
lea    0xead(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
and    $0xdf,%al
cmp    $0x53,%al
jne    116f <i_j+0x3f>
movb   $0x1,(%rbx)
xor    %eax,%eax
call   1050 <getchar@plt>
lea    0xe83(%rip),%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
and    $0xdf,%al
cmp    $0x53,%al
jne    119a <i_j+0x6a>
movb   $0x1,0x1(%rbx)
xor    %eax,%eax
call   1050 <getchar@plt>
lea    0xe58(%rip),%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
and    $0xdf,%al
cmp    $0x53,%al
jne    11c5 <i_j+0x95>
movb   $0x1,0x2(%rbx)
xor    %eax,%eax
call   1050 <getchar@plt>
lea    0xe2d(%rip),%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
and    $0xdf,%al
cmp    $0x53,%al
jne    11f0 <i_j+0xc0>
movb   $0x1,0x3(%rbx)
xor    %eax,%eax
call   1050 <getchar@plt>
lea    0xe02(%rip),%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
and    $0xdf,%al
cmp    $0x53,%al
jne    121b <i_j+0xeb>
movb   $0x1,0x4(%rbx)
xor    %eax,%eax
pop    %rbx
jmp    1050 <getchar@plt>

LLVM IR (-O0):
@.str = [100 x i8] c"Fase de incicializacion.\0A\0APara indicar que el espacio de jugador ser\C3\A1 usado, presionar 'S' o 's'.\0A\00"
@.str.1 = [42 x i8] c"En caso contrario, presionar 'N' o 'n'.\0A\0A\00"
@.str.2 = [13 x i8] c"Jugador %d: \00"
define void @i_j(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8
store i8* %0, i8** %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([100 x i8], [100 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %3
br label %7
7: ; preds = %28, %1
%8 = load i32, i32* %3
%9 = icmp slt i32 %8, 5
br i1 %9, label %10, label %31
10: ; preds = %7
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 %12)
%14 = call signext i8 (...) @getchar()
store i8 %14, i8* %4
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 83
br i1 %16, label %21, label %17
17: ; preds = %10
%18 = load i8, i8* %4
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %19, 115
br i1 %20, label %21, label %26
21: ; preds = %17, %10
%22 = load i8*, i8** %2
%23 = load i32, i32* %3
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i8, i8* %22, i64 %24
store i8 1, i8* %25
br label %26
26: ; preds = %21, %17
%27 = call signext i8 (...) @getchar()
br label %28
28: ; preds = %26
%29 = load i32, i32* %3
%30 = add nsw i32 %29, 1
store i32 %30, i32* %3
br label %7
31: ; preds = %7
ret void
}

LLVM IR (-O2):
@.str.2 = [13 x i8] c"Jugador %d: \00"
@str = [99 x i8] c"Fase de incicializacion.\0A\0APara indicar que el espacio de jugador ser\C3\A1 usado, presionar 'S' o 's'.\00"
@str.3 = [41 x i8] c"En caso contrario, presionar 'N' o 'n'.\0A\00"
define void @i_j(i8* nocapture writeonly %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([99 x i8], [99 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str.3, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 1)
%5 = tail call signext i8 (...) @getchar()
%6 = and i8 %5, -33
%7 = icmp eq i8 %6, 83
br i1 %7, label %8, label %9
8: ; preds = %1
store i8 1, i8* %0
br label %9
9: ; preds = %1, %8
%10 = tail call signext i8 (...) @getchar()
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 2)
%12 = tail call signext i8 (...) @getchar()
%13 = and i8 %12, -33
%14 = icmp eq i8 %13, 83
br i1 %14, label %15, label %17
15: ; preds = %9
%16 = getelementptr inbounds i8, i8* %0, i64 1
store i8 1, i8* %16
br label %17
17: ; preds = %15, %9
%18 = tail call signext i8 (...) @getchar()
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 3)
%20 = tail call signext i8 (...) @getchar()
%21 = and i8 %20, -33
%22 = icmp eq i8 %21, 83
br i1 %22, label %23, label %25
23: ; preds = %17
%24 = getelementptr inbounds i8, i8* %0, i64 2
store i8 1, i8* %24
br label %25
25: ; preds = %23, %17
%26 = tail call signext i8 (...) @getchar()
%27 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 4)
%28 = tail call signext i8 (...) @getchar()
%29 = and i8 %28, -33
%30 = icmp eq i8 %29, 83
br i1 %30, label %31, label %33
31: ; preds = %25
%32 = getelementptr inbounds i8, i8* %0, i64 3
store i8 1, i8* %32
br label %33
33: ; preds = %31, %25
%34 = tail call signext i8 (...) @getchar()
%35 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 5)
%36 = tail call signext i8 (...) @getchar()
%37 = and i8 %36, -33
%38 = icmp eq i8 %37, 83
br i1 %38, label %39, label %41
39: ; preds = %33
%40 = getelementptr inbounds i8, i8* %0, i64 4
store i8 1, i8* %40
br label %41
41: ; preds = %39, %33
%42 = tail call signext i8 (...) @getchar()
ret void
}