#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 /*<<< orphan*/ point(int, int, int, int);
void poke(int n, int x, int y) {
  int i;
  for (i = 0; i < 8; i++) {
    point(x, y, i, (n >> i) & 1);
  }
}


x86 assembly (clang, -O0):
<poke>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x8,-0x10(%rbp)
jge    115b <poke+0x4b>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x4(%rbp),%eax
mov    -0x10(%rbp),%ecx
sar    %cl,%eax
mov    %eax,%ecx
and    $0x1,%ecx
call   1030 <point@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1128 <poke+0x18>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<poke>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebx
mov    %edi,%ebp
mov    %edi,%ecx
and    $0x1,%ecx
mov    %esi,%edi
mov    %edx,%esi
xor    %edx,%edx
call   1030 <point@plt>
mov    %ebp,%ecx
shr    %ecx
and    $0x1,%ecx
mov    %ebx,%edi
mov    %r14d,%esi
mov    $0x1,%edx
call   1030 <point@plt>
mov    %ebp,%ecx
shr    $0x2,%ecx
and    $0x1,%ecx
mov    %ebx,%edi
mov    %r14d,%esi
mov    $0x2,%edx
call   1030 <point@plt>
mov    %ebp,%ecx
shr    $0x3,%ecx
and    $0x1,%ecx
mov    %ebx,%edi
mov    %r14d,%esi
mov    $0x3,%edx
call   1030 <point@plt>
mov    %ebp,%ecx
shr    $0x4,%ecx
and    $0x1,%ecx
mov    %ebx,%edi
mov    %r14d,%esi
mov    $0x4,%edx
call   1030 <point@plt>
mov    %ebp,%ecx
shr    $0x5,%ecx
and    $0x1,%ecx
mov    %ebx,%edi
mov    %r14d,%esi
mov    $0x5,%edx
call   1030 <point@plt>
mov    %ebp,%ecx
shr    $0x6,%ecx
and    $0x1,%ecx
mov    %ebx,%edi
mov    %r14d,%esi
mov    $0x6,%edx
call   1030 <point@plt>
shr    $0x7,%ebp
and    $0x1,%ebp
mov    %ebx,%edi
mov    %r14d,%esi
mov    $0x7,%edx
mov    %ebp,%ecx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <point@plt>

LLVM IR (-O0):
define void @poke(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i32 0, i32* %7
br label %8
8: ; preds = %20, %3
%9 = load i32, i32* %7
%10 = icmp slt i32 %9, 8
br i1 %10, label %11, label %23
11: ; preds = %8
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = load i32, i32* %7
%15 = load i32, i32* %4
%16 = load i32, i32* %7
%17 = ashr i32 %15, %16
%18 = and i32 %17, 1
%19 = call i32 @point(i32 %12, i32 %13, i32 %14, i32 %18)
br label %20
20: ; preds = %11
%21 = load i32, i32* %7
%22 = add nsw i32 %21, 1
store i32 %22, i32* %7
br label %8
23: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @poke(i32 %0, i32 %1, i32 %2) {
%4 = and i32 %0, 1
%5 = tail call i32 @point(i32 %1, i32 %2, i32 0, i32 %4)
%6 = lshr i32 %0, 1
%7 = and i32 %6, 1
%8 = tail call i32 @point(i32 %1, i32 %2, i32 1, i32 %7)
%9 = lshr i32 %0, 2
%10 = and i32 %9, 1
%11 = tail call i32 @point(i32 %1, i32 %2, i32 2, i32 %10)
%12 = lshr i32 %0, 3
%13 = and i32 %12, 1
%14 = tail call i32 @point(i32 %1, i32 %2, i32 3, i32 %13)
%15 = lshr i32 %0, 4
%16 = and i32 %15, 1
%17 = tail call i32 @point(i32 %1, i32 %2, i32 4, i32 %16)
%18 = lshr i32 %0, 5
%19 = and i32 %18, 1
%20 = tail call i32 @point(i32 %1, i32 %2, i32 5, i32 %19)
%21 = lshr i32 %0, 6
%22 = and i32 %21, 1
%23 = tail call i32 @point(i32 %1, i32 %2, i32 6, i32 %22)
%24 = lshr i32 %0, 7
%25 = and i32 %24, 1
%26 = tail call i32 @point(i32 %1, i32 %2, i32 7, i32 %25)
ret void
}