#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 rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void makeFalsesCharacters(int falsesCharacters[10][7][4],
                          int characters[10][7][4], int probability) {
  int i = 0, j = 0, k = 0;
  srand(time(NULL));
  for (i = 0; i < 10; i++) {
    for (j = 0; j < 7; j++) {
      for (k = 0; k < 4; k++) {
        falsesCharacters[i][j][k] = characters[i][j][k];
        if ((rand() % 100) < probability) {
          falsesCharacters[i][j][k] ^= 1;
        }
      }
    }
  }
}


x86 assembly (clang, -O0):
<makeFalsesCharacters>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
movl   $0x0,-0x18(%rbp)
cmpl   $0xa,-0x18(%rbp)
jge    1255 <makeFalsesCharacters+0x125>
movl   $0x0,-0x1c(%rbp)
cmpl   $0x7,-0x1c(%rbp)
jge    1242 <makeFalsesCharacters+0x112>
movl   $0x0,-0x20(%rbp)
cmpl   $0x4,-0x20(%rbp)
jge    122f <makeFalsesCharacters+0xff>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
imul   $0x70,%rcx,%rcx
add    %rcx,%rax
movslq -0x1c(%rbp),%rcx
shl    $0x4,%rcx
add    %rcx,%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
imul   $0x70,%rcx,%rcx
add    %rcx,%rax
movslq -0x1c(%rbp),%rcx
shl    $0x4,%rcx
add    %rcx,%rax
movslq -0x20(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    $0x0,%al
call   1050 <rand@plt>
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    -0x14(%rbp),%edx
jge    121c <makeFalsesCharacters+0xec>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
imul   $0x70,%rcx,%rcx
add    %rcx,%rax
movslq -0x1c(%rbp),%rcx
shl    $0x4,%rcx
add    %rcx,%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
xor    $0x1,%edx
mov    %edx,(%rax,%rcx,4)
jmp    1221 <makeFalsesCharacters+0xf1>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1191 <makeFalsesCharacters+0x61>
jmp    1234 <makeFalsesCharacters+0x104>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1180 <makeFalsesCharacters+0x50>
jmp    1247 <makeFalsesCharacters+0x117>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    116f <makeFalsesCharacters+0x3f>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<makeFalsesCharacters>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %edx,%r14d
mov    %rsi,%r12
mov    %rdi,%rbp
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
add    $0xc,%r12
add    $0xc,%rbp
xor    %r15d,%r15d
jmp    1176 <makeFalsesCharacters+0x46>
nopl   0x0(%rax)
add    $0x1,%r15
add    $0x70,%r12
add    $0x70,%rbp
cmp    $0xa,%r15
je     1266 <makeFalsesCharacters+0x136>
xor    %ebx,%ebx
jmp    118a <makeFalsesCharacters+0x5a>
nopw   0x0(%rax,%rax,1)
add    $0x10,%rbx
cmp    $0x70,%rbx
je     1160 <makeFalsesCharacters+0x30>
mov    -0xc(%r12,%rbx,1),%eax
mov    %eax,-0xc(%rbp,%rbx,1)
xor    %eax,%eax
call   1050 <rand@plt>
cltq
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rcx
add    %edx,%ecx
imul   $0x64,%ecx,%ecx
sub    %ecx,%eax
cmp    %r14d,%eax
jge    11bf <makeFalsesCharacters+0x8f>
xorb   $0x1,-0xc(%rbp,%rbx,1)
mov    -0x8(%r12,%rbx,1),%eax
mov    %eax,-0x8(%rbp,%rbx,1)
xor    %eax,%eax
call   1050 <rand@plt>
cltq
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rcx
add    %edx,%ecx
imul   $0x64,%ecx,%ecx
sub    %ecx,%eax
cmp    %r14d,%eax
jge    11f4 <makeFalsesCharacters+0xc4>
xorb   $0x1,-0x8(%rbp,%rbx,1)
mov    -0x4(%r12,%rbx,1),%eax
mov    %eax,-0x4(%rbp,%rbx,1)
xor    %eax,%eax
call   1050 <rand@plt>
cltq
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rcx
add    %edx,%ecx
imul   $0x64,%ecx,%ecx
sub    %ecx,%eax
cmp    %r14d,%eax
jge    1229 <makeFalsesCharacters+0xf9>
xorb   $0x1,-0x4(%rbp,%rbx,1)
mov    (%r12,%rbx,1),%eax
mov    %eax,0x0(%rbp,%rbx,1)
xor    %eax,%eax
call   1050 <rand@plt>
cltq
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rcx
add    %edx,%ecx
imul   $0x64,%ecx,%ecx
sub    %ecx,%eax
cmp    %r14d,%eax
jge    1180 <makeFalsesCharacters+0x50>
xorb   $0x1,0x0(%rbp,%rbx,1)
jmp    1180 <makeFalsesCharacters+0x50>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @makeFalsesCharacters([7 x [4 x i32]]* %0, [7 x [4 x i32]]* %1, i32 %2) {
%4 = alloca [7 x [4 x i32]]*
%5 = alloca [7 x [4 x i32]]*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store [7 x [4 x i32]]* %0, [7 x [4 x i32]]** %4
store [7 x [4 x i32]]* %1, [7 x [4 x i32]]** %5
store i32 %2, i32* %6
store i32 0, i32* %7
store i32 0, i32* %8
store i32 0, i32* %9
%10 = call i32 @time(i32* null)
%11 = call i32 @srand(i32 %10)
store i32 0, i32* %7
br label %12
12: ; preds = %71, %3
%13 = load i32, i32* %7
%14 = icmp slt i32 %13, 10
br i1 %14, label %15, label %74
15: ; preds = %12
store i32 0, i32* %8
br label %16
16: ; preds = %67, %15
%17 = load i32, i32* %8
%18 = icmp slt i32 %17, 7
br i1 %18, label %19, label %70
19: ; preds = %16
store i32 0, i32* %9
br label %20
20: ; preds = %63, %19
%21 = load i32, i32* %9
%22 = icmp slt i32 %21, 4
br i1 %22, label %23, label %66
23: ; preds = %20
%24 = load [7 x [4 x i32]]*, [7 x [4 x i32]]** %5
%25 = load i32, i32* %7
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds [7 x [4 x i32]], [7 x [4 x i32]]* %24, i64 %26
%28 = load i32, i32* %8
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds [7 x [4 x i32]], [7 x [4 x i32]]* %27, i64 0, i64 %29
%31 = load i32, i32* %9
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds [4 x i32], [4 x i32]* %30, i64 0, i64 %32
%34 = load i32, i32* %33
%35 = load [7 x [4 x i32]]*, [7 x [4 x i32]]** %4
%36 = load i32, i32* %7
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds [7 x [4 x i32]], [7 x [4 x i32]]* %35, i64 %37
%39 = load i32, i32* %8
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds [7 x [4 x i32]], [7 x [4 x i32]]* %38, i64 0, i64 %40
%42 = load i32, i32* %9
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds [4 x i32], [4 x i32]* %41, i64 0, i64 %43
store i32 %34, i32* %44
%45 = call i32 (...) @rand()
%46 = srem i32 %45, 100
%47 = load i32, i32* %6
%48 = icmp slt i32 %46, %47
br i1 %48, label %49, label %62
49: ; preds = %23
%50 = load [7 x [4 x i32]]*, [7 x [4 x i32]]** %4
%51 = load i32, i32* %7
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds [7 x [4 x i32]], [7 x [4 x i32]]* %50, i64 %52
%54 = load i32, i32* %8
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds [7 x [4 x i32]], [7 x [4 x i32]]* %53, i64 0, i64 %55
%57 = load i32, i32* %9
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds [4 x i32], [4 x i32]* %56, i64 0, i64 %58
%60 = load i32, i32* %59
%61 = xor i32 %60, 1
store i32 %61, i32* %59
br label %62
62: ; preds = %49, %23
br label %63
63: ; preds = %62
%64 = load i32, i32* %9
%65 = add nsw i32 %64, 1
store i32 %65, i32* %9
br label %20
66: ; preds = %20
br label %67
67: ; preds = %66
%68 = load i32, i32* %8
%69 = add nsw i32 %68, 1
store i32 %69, i32* %8
br label %16
70: ; preds = %16
br label %71
71: ; preds = %70
%72 = load i32, i32* %7
%73 = add nsw i32 %72, 1
store i32 %73, i32* %7
br label %12
74: ; preds = %12
ret void
}

LLVM IR (-O2):
define void @makeFalsesCharacters([7 x [4 x i32]]* nocapture %0, [7 x [4 x i32]]* nocapture %1, i32 %2) {
%4 = tail call i32 @time(i32* null)
%5 = tail call i32 @srand(i32 %4)
br label %6
6: ; preds = %3, %52
%7 = phi i64 [ 0, %3 ], [ %53, %52 ]
br label %8
8: ; preds = %6, %49
%9 = phi i64 [ 0, %6 ], [ %50, %49 ]
%10 = getelementptr inbounds [7 x [4 x i32]], [7 x [4 x i32]]* %1, i64 %7, i64 %9, i64 0
%11 = load i32, i32* %10
%12 = getelementptr inbounds [7 x [4 x i32]], [7 x [4 x i32]]* %0, i64 %7, i64 %9, i64 0
store i32 %11, i32* %12
%13 = tail call i32 (...) @rand()
%14 = srem i32 %13, 100
%15 = icmp slt i32 %14, %2
br i1 %15, label %16, label %19
16: ; preds = %8
%17 = load i32, i32* %12
%18 = xor i32 %17, 1
store i32 %18, i32* %12
br label %19
19: ; preds = %8, %16
%20 = getelementptr inbounds [7 x [4 x i32]], [7 x [4 x i32]]* %1, i64 %7, i64 %9, i64 1
%21 = load i32, i32* %20
%22 = getelementptr inbounds [7 x [4 x i32]], [7 x [4 x i32]]* %0, i64 %7, i64 %9, i64 1
store i32 %21, i32* %22
%23 = tail call i32 (...) @rand()
%24 = srem i32 %23, 100
%25 = icmp slt i32 %24, %2
br i1 %25, label %26, label %29
26: ; preds = %19
%27 = load i32, i32* %22
%28 = xor i32 %27, 1
store i32 %28, i32* %22
br label %29
29: ; preds = %26, %19
%30 = getelementptr inbounds [7 x [4 x i32]], [7 x [4 x i32]]* %1, i64 %7, i64 %9, i64 2
%31 = load i32, i32* %30
%32 = getelementptr inbounds [7 x [4 x i32]], [7 x [4 x i32]]* %0, i64 %7, i64 %9, i64 2
store i32 %31, i32* %32
%33 = tail call i32 (...) @rand()
%34 = srem i32 %33, 100
%35 = icmp slt i32 %34, %2
br i1 %35, label %36, label %39
36: ; preds = %29
%37 = load i32, i32* %32
%38 = xor i32 %37, 1
store i32 %38, i32* %32
br label %39
39: ; preds = %36, %29
%40 = getelementptr inbounds [7 x [4 x i32]], [7 x [4 x i32]]* %1, i64 %7, i64 %9, i64 3
%41 = load i32, i32* %40
%42 = getelementptr inbounds [7 x [4 x i32]], [7 x [4 x i32]]* %0, i64 %7, i64 %9, i64 3
store i32 %41, i32* %42
%43 = tail call i32 (...) @rand()
%44 = srem i32 %43, 100
%45 = icmp slt i32 %44, %2
br i1 %45, label %46, label %49
46: ; preds = %39
%47 = load i32, i32* %42
%48 = xor i32 %47, 1
store i32 %48, i32* %42
br label %49
49: ; preds = %46, %39
%50 = add nuw nsw i64 %9, 1
%51 = icmp eq i64 %50, 7
br i1 %51, label %52, label %8
52: ; preds = %49
%53 = add nuw nsw i64 %7, 1
%54 = icmp eq i64 %53, 10
br i1 %54, label %55, label %6
55: ; preds = %52
ret void
}