#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 */
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
int A_BOLD;
int COLOR_PAIR(int);
int /*<<< orphan*/ drawblock(int /*<<< orphan*/ **, int, int);
int randint(int /*<<< orphan*/, int);
int /*<<< orphan*/ wattrset(int /*<<< orphan*/ *, int);
void newdot(WINDOW **w, bool grid[((80 - 2) >> 1)][(25 - 4)], int *x, int *y) {
  do {
    *x = randint(0, ((80 - 2) >> 1) - 1);
    *y = randint(0, (25 - 4) - 1);
  } while (grid[*x][*y]);
  wattrset(w[1], COLOR_PAIR(4) | A_BOLD);
  drawblock(w, *x, *y);
  wattrset(w[1], COLOR_PAIR(1) | A_BOLD);
}


x86 assembly (clang, -O0):
<newdot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
xor    %edi,%edi
mov    $0x26,%esi
call   1060 <randint@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
xor    %edi,%edi
mov    $0x14,%esi
call   1060 <randint@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
movslq (%rcx),%rcx
imul   $0x54,%rcx,%rcx
add    %rcx,%rax
mov    -0x20(%rbp),%rcx
movslq (%rcx),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jne    1158 <newdot+0x18>
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x30(%rbp)
mov    $0x4,%edi
call   1050 <COLOR_PAIR@plt>
mov    -0x30(%rbp),%rdi
mov    %eax,%esi
mov    0x2e1a(%rip),%rax
or     (%rax),%esi
call   1030 <wattrset@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    (%rax),%esi
mov    -0x20(%rbp),%rax
mov    (%rax),%edx
call   1040 <drawblock@plt>
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x28(%rbp)
mov    $0x1,%edi
call   1050 <COLOR_PAIR@plt>
mov    -0x28(%rbp),%rdi
mov    %eax,%esi
mov    0x2ddb(%rip),%rax
or     (%rax),%esi
call   1030 <wattrset@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<newdot>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %rcx,%r15
mov    %rdx,%rbx
mov    %rsi,%r12
mov    %rdi,%r14
cs nopw 0x0(%rax,%rax,1)
nop
xor    %edi,%edi
mov    $0x26,%esi
call   1060 <randint@plt>
mov    %eax,(%rbx)
xor    %edi,%edi
mov    $0x14,%esi
call   1060 <randint@plt>
mov    %eax,(%r15)
movslq (%rbx),%rcx
cltq
imul   $0x54,%rcx,%rcx
add    %r12,%rcx
cmpl   $0x0,(%rcx,%rax,4)
jne    1160 <newdot+0x20>
mov    0x8(%r14),%r12
mov    $0x4,%edi
call   1050 <COLOR_PAIR@plt>
mov    0x2e3c(%rip),%r13
or     0x0(%r13),%eax
mov    %r12,%rdi
mov    %eax,%esi
call   1030 <wattrset@plt>
mov    (%rbx),%esi
mov    (%r15),%edx
mov    %r14,%rdi
call   1040 <drawblock@plt>
mov    0x8(%r14),%rbx
mov    $0x1,%edi
call   1050 <COLOR_PAIR@plt>
or     0x0(%r13),%eax
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
jmp    1030 <wattrset@plt>

LLVM IR (-O0):
@A_BOLD = global i32 0
define void @newdot(i32** %0, [21 x i32]* %1, i32* %2, i32* %3) {
%5 = alloca i32**
%6 = alloca [21 x i32]*
%7 = alloca i32*
%8 = alloca i32*
store i32** %0, i32*** %5
store [21 x i32]* %1, [21 x i32]** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
br label %9
9: ; preds = %14, %4
%10 = call i32 @randint(i32 0, i32 38)
%11 = load i32*, i32** %7
store i32 %10, i32* %11
%12 = call i32 @randint(i32 0, i32 20)
%13 = load i32*, i32** %8
store i32 %12, i32* %13
br label %14
14: ; preds = %9
%15 = load [21 x i32]*, [21 x i32]** %6
%16 = load i32*, i32** %7
%17 = load i32, i32* %16
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [21 x i32], [21 x i32]* %15, i64 %18
%20 = load i32*, i32** %8
%21 = load i32, i32* %20
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [21 x i32], [21 x i32]* %19, i64 0, i64 %22
%24 = load i32, i32* %23
%25 = icmp ne i32 %24, 0
br i1 %25, label %9, label %26
26: ; preds = %14
%27 = load i32**, i32*** %5
%28 = getelementptr inbounds i32*, i32** %27, i64 1
%29 = load i32*, i32** %28
%30 = call i32 @COLOR_PAIR(i32 4)
%31 = load i32, i32* @A_BOLD
%32 = or i32 %30, %31
%33 = call i32 @wattrset(i32* %29, i32 %32)
%34 = load i32**, i32*** %5
%35 = load i32*, i32** %7
%36 = load i32, i32* %35
%37 = load i32*, i32** %8
%38 = load i32, i32* %37
%39 = call i32 @drawblock(i32** %34, i32 %36, i32 %38)
%40 = load i32**, i32*** %5
%41 = getelementptr inbounds i32*, i32** %40, i64 1
%42 = load i32*, i32** %41
%43 = call i32 @COLOR_PAIR(i32 1)
%44 = load i32, i32* @A_BOLD
%45 = or i32 %43, %44
%46 = call i32 @wattrset(i32* %42, i32 %45)
ret void
}

LLVM IR (-O2):
@A_BOLD = global i32 0
define void @newdot(i32** %0, [21 x i32]* nocapture %1, i32* nocapture %2, i32* nocapture %3) {
br label %5
5: ; preds = %5, %4
%6 = tail call i32 @randint(i32 0, i32 38)
store i32 %6, i32* %2
%7 = tail call i32 @randint(i32 0, i32 20)
store i32 %7, i32* %3
%8 = load i32, i32* %2
%9 = sext i32 %8 to i64
%10 = sext i32 %7 to i64
%11 = getelementptr inbounds [21 x i32], [21 x i32]* %1, i64 %9, i64 %10
%12 = load i32, i32* %11
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %5
%15 = getelementptr inbounds i32*, i32** %0, i64 1
%16 = load i32*, i32** %15
%17 = tail call i32 @COLOR_PAIR(i32 4)
%18 = load i32, i32* @A_BOLD
%19 = or i32 %18, %17
%20 = tail call i32 @wattrset(i32* %16, i32 %19)
%21 = load i32, i32* %2
%22 = load i32, i32* %3
%23 = tail call i32 @drawblock(i32** %0, i32 %21, i32 %22)
%24 = load i32*, i32** %15
%25 = tail call i32 @COLOR_PAIR(i32 1)
%26 = load i32, i32* @A_BOLD
%27 = or i32 %26, %25
%28 = tail call i32 @wattrset(i32* %24, i32 %27)
ret void
}