#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 */
typedef struct TYPE_8__ TYPE_4__;
typedef struct TYPE_7__ TYPE_3__;
typedef struct TYPE_6__ TYPE_2__;
typedef struct TYPE_5__ TYPE_1__;

/* Type definitions */
struct TYPE_8__ {
  char member_0;
  char member_1;
  char member_2;
  char member_3;
};
struct TYPE_7__ {
  char member_0;
  char member_1;
  char member_2;
  char member_3;
};
struct TYPE_6__ {
  char member_0;
  char member_1;
  char member_2;
  char member_3;
};
struct TYPE_5__ {
  char member_0;
  char member_1;
  char member_3;
  int /*<<< orphan*/ member_2;
};

/* Variables and functions */
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void corpo_peca(char **corpo) {
  srand(time(NULL));
  int x, y, escolha = 0;
  char pecas[][4][4] = {{{'0', '0', '0', '0'},
                         {'\0', '\0', '\0', '\0'},
                         {'\0', '\0', '\0', '\0'},
                         {'\0', '\0', '\0', '\0'}},
                        {{'\0', '0', '0', '\0'},
                         {'\0', '0', '0', '\0'},
                         {'\0', '\0', '\0', '\0'},
                         {'\0', '\0', '\0', '\0'}},
                        {{'\0', '\0', '0', '0'},
                         {'\0', '0', '0', '\0'},
                         {'\0', '\0', '\0', '\0'},
                         {'\0', '\0', '\0', '\0'}},
                        {{'\0', '0', '0', '0'},
                         {'\0', '\0', '0', '\0'},
                         {'\0', '\0', '\0', '\0'},
                         {'\0', '\0', '\0', '\0'}}};
  for (x = 0; x < 4; x++)
    for (y = 0; y < 4; y++) {
      corpo[x][y] = pecas[escolha][x][y];
    }
}


x86 assembly (clang, -O0):
<corpo_peca>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
movl   $0x0,-0x14(%rbp)
lea    -0x60(%rbp),%rdi
lea    0xea2(%rip),%rsi
mov    $0x40,%edx
call   1040 <memcpy@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
jge    11df <corpo_peca+0xaf>
movl   $0x0,-0x10(%rbp)
cmpl   $0x4,-0x10(%rbp)
jge    11cc <corpo_peca+0x9c>
movslq -0x14(%rbp),%rcx
lea    -0x60(%rbp),%rax
shl    $0x4,%rcx
add    %rcx,%rax
movslq -0xc(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1180 <corpo_peca+0x50>
jmp    11d1 <corpo_peca+0xa1>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    116f <corpo_peca+0x3f>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<corpo_peca>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
mov    (%rbx),%rax
movb   $0x30,(%rax)
mov    (%rbx),%rax
movb   $0x30,0x1(%rax)
mov    (%rbx),%rax
movb   $0x30,0x2(%rax)
mov    (%rbx),%rax
movb   $0x30,0x3(%rax)
mov    0x8(%rbx),%rax
movb   $0x0,(%rax)
mov    0x8(%rbx),%rax
movb   $0x0,0x1(%rax)
mov    0x8(%rbx),%rax
movb   $0x0,0x2(%rax)
mov    0x8(%rbx),%rax
movb   $0x0,0x3(%rax)
mov    0x10(%rbx),%rax
movb   $0x0,(%rax)
mov    0x10(%rbx),%rax
movb   $0x0,0x1(%rax)
mov    0x10(%rbx),%rax
movb   $0x0,0x2(%rax)
mov    0x10(%rbx),%rax
movb   $0x0,0x3(%rax)
mov    0x18(%rbx),%rax
movb   $0x0,(%rax)
mov    0x18(%rbx),%rax
movb   $0x0,0x1(%rax)
mov    0x18(%rbx),%rax
movb   $0x0,0x2(%rax)
mov    0x18(%rbx),%rax
movb   $0x0,0x3(%rax)
pop    %rbx
ret

LLVM IR (-O0):
@__const.corpo_peca.pecas = [4 x [4 x [4 x i8]]] [[4 x [4 x i8]] [[4 x i8] c"0000", [4 x i8] zeroinitializer, [4 x i8] zeroinitializer, [4 x i8] zeroinitializer], [4 x [4 x i8]] [[4 x i8] c"\0000\00", [4 x i8] c"\0000\00", [4 x i8] zeroinitializer, [4 x i8] zeroinitializer], [4 x [4 x i8]] [[4 x i8] c"\00\0000", [4 x i8] c"\0000\00", [4 x i8] zeroinitializer, [4 x i8] zeroinitializer], [4 x [4 x i8]] [[4 x i8] c"\00000", [4 x i8] c"\00\000\00", [4 x i8] zeroinitializer, [4 x i8] zeroinitializer]]
define void @corpo_peca(i8** %0) {
%2 = alloca i8**
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca [4 x [4 x [4 x i8]]]
store i8** %0, i8*** %2
%7 = call i32 @time(i32* null)
%8 = call i32 @srand(i32 %7)
store i32 0, i32* %5
%9 = bitcast [4 x [4 x [4 x i8]]]* %6 to i8*
store i32 0, i32* %3
br label %10
10: ; preds = %40, %1
%11 = load i32, i32* %3
%12 = icmp slt i32 %11, 4
br i1 %12, label %13, label %43
13: ; preds = %10
store i32 0, i32* %4
br label %14
14: ; preds = %36, %13
%15 = load i32, i32* %4
%16 = icmp slt i32 %15, 4
br i1 %16, label %17, label %39
17: ; preds = %14
%18 = load i32, i32* %5
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [4 x [4 x [4 x i8]]], [4 x [4 x [4 x i8]]]* %6, i64 0, i64 %19
%21 = load i32, i32* %3
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [4 x [4 x i8]], [4 x [4 x i8]]* %20, i64 0, i64 %22
%24 = load i32, i32* %4
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [4 x i8], [4 x i8]* %23, i64 0, i64 %25
%27 = load i8, i8* %26
%28 = load i8**, i8*** %2
%29 = load i32, i32* %3
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds i8*, i8** %28, i64 %30
%32 = load i8*, i8** %31
%33 = load i32, i32* %4
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds i8, i8* %32, i64 %34
store i8 %27, i8* %35
br label %36
36: ; preds = %17
%37 = load i32, i32* %4
%38 = add nsw i32 %37, 1
store i32 %38, i32* %4
br label %14
39: ; preds = %14
br label %40
40: ; preds = %39
%41 = load i32, i32* %3
%42 = add nsw i32 %41, 1
store i32 %42, i32* %3
br label %10
43: ; preds = %10
ret void
}

LLVM IR (-O2):
define void @corpo_peca(i8** nocapture %0) {
%2 = tail call i32 @time(i32* null)
%3 = tail call i32 @srand(i32 %2)
%4 = load i8*, i8** %0
store i8 48, i8* %4
%5 = load i8*, i8** %0
%6 = getelementptr inbounds i8, i8* %5, i64 1
store i8 48, i8* %6
%7 = load i8*, i8** %0
%8 = getelementptr inbounds i8, i8* %7, i64 2
store i8 48, i8* %8
%9 = load i8*, i8** %0
%10 = getelementptr inbounds i8, i8* %9, i64 3
store i8 48, i8* %10
%11 = getelementptr inbounds i8*, i8** %0, i64 1
%12 = load i8*, i8** %11
store i8 0, i8* %12
%13 = load i8*, i8** %11
%14 = getelementptr inbounds i8, i8* %13, i64 1
store i8 0, i8* %14
%15 = load i8*, i8** %11
%16 = getelementptr inbounds i8, i8* %15, i64 2
store i8 0, i8* %16
%17 = load i8*, i8** %11
%18 = getelementptr inbounds i8, i8* %17, i64 3
store i8 0, i8* %18
%19 = getelementptr inbounds i8*, i8** %0, i64 2
%20 = load i8*, i8** %19
store i8 0, i8* %20
%21 = load i8*, i8** %19
%22 = getelementptr inbounds i8, i8* %21, i64 1
store i8 0, i8* %22
%23 = load i8*, i8** %19
%24 = getelementptr inbounds i8, i8* %23, i64 2
store i8 0, i8* %24
%25 = load i8*, i8** %19
%26 = getelementptr inbounds i8, i8* %25, i64 3
store i8 0, i8* %26
%27 = getelementptr inbounds i8*, i8** %0, i64 3
%28 = load i8*, i8** %27
store i8 0, i8* %28
%29 = load i8*, i8** %27
%30 = getelementptr inbounds i8, i8* %29, i64 1
store i8 0, i8* %30
%31 = load i8*, i8** %27
%32 = getelementptr inbounds i8, i8* %31, i64 2
store i8 0, i8* %32
%33 = load i8*, i8** %27
%34 = getelementptr inbounds i8, i8* %33, i64 3
store i8 0, i8* %34
ret void
}