#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 uint8_t;

/* Variables and functions */
void dropCounter(uint8_t board[42], char token, uint8_t col) {
  while ((col < 35) && (board[col + 7] == '.')) {
    col += 7;
  }
  board[col] = token;
}


x86 assembly (clang, -O0):
<dropCounter>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %edx,-0x10(%rbp)
xor    %eax,%eax
cmpl   $0x23,-0x10(%rbp)
mov    %al,-0x11(%rbp)
jge    1137 <dropCounter+0x37>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
add    $0x7,%ecx
movslq %ecx,%rcx
cmpl   $0x2e,(%rax,%rcx,4)
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1147 <dropCounter+0x47>
jmp    1155 <dropCounter+0x55>
mov    -0x10(%rbp),%eax
add    $0x7,%eax
mov    %eax,-0x10(%rbp)
jmp    1111 <dropCounter+0x11>
movsbl -0x9(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<dropCounter>:
movslq %edx,%rax
mov    %rax,%rdx
shl    $0x20,%rdx
movabs $0x700000000,%r8
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rdx,%rcx
cmp    $0x22,%rax
jg     1138 <dropCounter+0x38>
cmpl   $0x2e,0x1c(%rdi,%rax,4)
lea    0x7(%rax),%rax
lea    (%rcx,%r8,1),%rdx
je     1120 <dropCounter+0x20>
movsbl %sil,%eax
sar    $0x1e,%rcx
mov    %eax,(%rdi,%rcx,1)
ret

LLVM IR (-O0):
define void @dropCounter(i32* %0, i8 signext %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i8
%6 = alloca i32
store i32* %0, i32** %4
store i8 %1, i8* %5
store i32 %2, i32* %6
br label %7
7: ; preds = %20, %3
%8 = load i32, i32* %6
%9 = icmp slt i32 %8, 35
br i1 %9, label %10, label %18
10: ; preds = %7
%11 = load i32*, i32** %4
%12 = load i32, i32* %6
%13 = add nsw i32 %12, 7
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %11, i64 %14
%16 = load i32, i32* %15
%17 = icmp eq i32 %16, 46
br label %18
18: ; preds = %10, %7
%19 = phi i1 [ false, %7 ], [ %17, %10 ]
br i1 %19, label %20, label %23
20: ; preds = %18
%21 = load i32, i32* %6
%22 = add nsw i32 %21, 7
store i32 %22, i32* %6
br label %7
23: ; preds = %18
%24 = load i8, i8* %5
%25 = sext i8 %24 to i32
%26 = load i32*, i32** %4
%27 = load i32, i32* %6
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds i32, i32* %26, i64 %28
store i32 %25, i32* %29
ret void
}

LLVM IR (-O2):
define void @dropCounter(i32* nocapture %0, i8 signext %1, i32 %2) {
%4 = sext i32 %2 to i64
br label %5
5: ; preds = %8, %3
%6 = phi i64 [ %9, %8 ], [ %4, %3 ]
%7 = icmp slt i64 %6, 35
br i1 %7, label %8, label %13
8: ; preds = %5
%9 = add nsw i64 %6, 7
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
%12 = icmp eq i32 %11, 46
br i1 %12, label %5, label %13
13: ; preds = %5, %8
%14 = sext i8 %1 to i32
%15 = shl i64 %6, 32
%16 = ashr exact i64 %15, 32
%17 = getelementptr inbounds i32, i32* %0, i64 %16
store i32 %14, i32* %17
ret void
}