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

/* Variables and functions */
int /*<<< orphan*/ setPixelColour(int, int, int, int, int);
void dropDigit(uint32_t *dp, int xo, int yo) {
  int x, y;
  uint32_t bits;
  bits = *dp;
  for (y = 5; y >= 0; y--) {
    for (x = 4; x > 0; x--) {
      if (bits & 1)
        setPixelColour(x + xo, y + yo, 1, 1, 1);
      else
        setPixelColour(x + xo, y + yo, 0, 0, 0);
      bits >>= 1;
    }
  }
  return;
}


x86 assembly (clang, -O0):
<dropDigit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
movl   $0x5,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jl     11c2 <dropDigit+0xb2>
movl   $0x4,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    11af <dropDigit+0x9f>
mov    -0x1c(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     117e <dropDigit+0x6e>
mov    -0x14(%rbp),%edi
add    -0xc(%rbp),%edi
mov    -0x18(%rbp),%esi
add    -0x10(%rbp),%esi
mov    $0x1,%r8d
mov    %r8d,%edx
mov    %r8d,%ecx
call   1030 <setPixelColour@plt>
jmp    1198 <dropDigit+0x88>
mov    -0x14(%rbp),%edi
add    -0xc(%rbp),%edi
mov    -0x18(%rbp),%esi
add    -0x10(%rbp),%esi
xor    %r8d,%r8d
mov    %r8d,%edx
mov    %r8d,%ecx
call   1030 <setPixelColour@plt>
mov    -0x1c(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    1143 <dropDigit+0x33>
jmp    11b4 <dropDigit+0xa4>
mov    -0x18(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
jmp    1132 <dropDigit+0x22>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dropDigit>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rdx,0x10(%rsp)
mov    %esi,%ebx
mov    (%rdi),%r14d
lea    0x4(%rbx),%eax
mov    %eax,0xc(%rsp)
lea    0x3(%rbx),%r12d
lea    0x2(%rbx),%r13d
add    $0x1,%ebx
mov    $0x5,%r15d
jmp    116a <dropDigit+0x5a>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1030 <setPixelColour@plt>
sar    $0x4,%r14d
add    $0xffffffff,%r15d
jae    1228 <dropDigit+0x118>
mov    0x10(%rsp),%rax
lea    (%rax,%r15,1),%ebp
test   $0x1,%r14b
jne    1190 <dropDigit+0x80>
mov    0xc(%rsp),%edi
mov    %ebp,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
jmp    11a6 <dropDigit+0x96>
nopl   0x0(%rax,%rax,1)
mov    0xc(%rsp),%edi
mov    %ebp,%esi
mov    $0x1,%edx
mov    $0x1,%ecx
mov    $0x1,%r8d
call   1030 <setPixelColour@plt>
mov    %r12d,%edi
mov    %ebp,%esi
test   $0x2,%r14b
jne    11c0 <dropDigit+0xb0>
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
jmp    11d0 <dropDigit+0xc0>
nop
mov    $0x1,%edx
mov    $0x1,%ecx
mov    $0x1,%r8d
call   1030 <setPixelColour@plt>
mov    %r13d,%edi
mov    %ebp,%esi
test   $0x4,%r14b
jne    11f0 <dropDigit+0xe0>
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
jmp    1200 <dropDigit+0xf0>
nopl   0x0(%rax)
mov    $0x1,%edx
mov    $0x1,%ecx
mov    $0x1,%r8d
call   1030 <setPixelColour@plt>
mov    %ebx,%edi
mov    %ebp,%esi
test   $0x8,%r14b
je     1150 <dropDigit+0x40>
mov    $0x1,%edx
mov    $0x1,%ecx
mov    $0x1,%r8d
jmp    1157 <dropDigit+0x47>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @dropDigit(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%10 = load i32*, i32** %4
%11 = load i32, i32* %10
store i32 %11, i32* %9
store i32 5, i32* %8
br label %12
12: ; preds = %46, %3
%13 = load i32, i32* %8
%14 = icmp sge i32 %13, 0
br i1 %14, label %15, label %49
15: ; preds = %12
store i32 4, i32* %7
br label %16
16: ; preds = %42, %15
%17 = load i32, i32* %7
%18 = icmp sgt i32 %17, 0
br i1 %18, label %19, label %45
19: ; preds = %16
%20 = load i32, i32* %9
%21 = and i32 %20, 1
%22 = icmp ne i32 %21, 0
br i1 %22, label %23, label %31
23: ; preds = %19
%24 = load i32, i32* %7
%25 = load i32, i32* %5
%26 = add nsw i32 %24, %25
%27 = load i32, i32* %8
%28 = load i32, i32* %6
%29 = add nsw i32 %27, %28
%30 = call i32 @setPixelColour(i32 %26, i32 %29, i32 1, i32 1, i32 1)
br label %39
31: ; preds = %19
%32 = load i32, i32* %7
%33 = load i32, i32* %5
%34 = add nsw i32 %32, %33
%35 = load i32, i32* %8
%36 = load i32, i32* %6
%37 = add nsw i32 %35, %36
%38 = call i32 @setPixelColour(i32 %34, i32 %37, i32 0, i32 0, i32 0)
br label %39
39: ; preds = %31, %23
%40 = load i32, i32* %9
%41 = ashr i32 %40, 1
store i32 %41, i32* %9
br label %42
42: ; preds = %39
%43 = load i32, i32* %7
%44 = add nsw i32 %43, -1
store i32 %44, i32* %7
br label %16
45: ; preds = %16
br label %46
46: ; preds = %45
%47 = load i32, i32* %8
%48 = add nsw i32 %47, -1
store i32 %48, i32* %8
br label %12
49: ; preds = %12
ret void
}

LLVM IR (-O2):
define void @dropDigit(i32* nocapture %0, i32 %1, i32 %2) {
%4 = load i32, i32* %0
%5 = add nsw i32 %1, 4
%6 = add nsw i32 %1, 4
%7 = add nsw i32 %1, 3
%8 = add nsw i32 %1, 3
%9 = add nsw i32 %1, 2
%10 = add nsw i32 %1, 2
%11 = add nsw i32 %1, 1
%12 = add nsw i32 %1, 1
br label %13
13: ; preds = %3, %44
%14 = phi i32 [ %4, %3 ], [ %45, %44 ]
%15 = phi i32 [ 5, %3 ], [ %46, %44 ]
%16 = add nsw i32 %15, %2
%17 = and i32 %14, 1
%18 = icmp eq i32 %17, 0
br i1 %18, label %21, label %19
19: ; preds = %13
%20 = tail call i32 @setPixelColour(i32 %5, i32 %16, i32 1, i32 1, i32 1)
br label %23
21: ; preds = %13
%22 = tail call i32 @setPixelColour(i32 %6, i32 %16, i32 0, i32 0, i32 0)
br label %23
23: ; preds = %21, %19
%24 = and i32 %14, 2
%25 = icmp eq i32 %24, 0
br i1 %25, label %28, label %26
26: ; preds = %23
%27 = tail call i32 @setPixelColour(i32 %7, i32 %16, i32 1, i32 1, i32 1)
br label %30
28: ; preds = %23
%29 = tail call i32 @setPixelColour(i32 %8, i32 %16, i32 0, i32 0, i32 0)
br label %30
30: ; preds = %28, %26
%31 = and i32 %14, 4
%32 = icmp eq i32 %31, 0
br i1 %32, label %35, label %33
33: ; preds = %30
%34 = tail call i32 @setPixelColour(i32 %9, i32 %16, i32 1, i32 1, i32 1)
br label %37
35: ; preds = %30
%36 = tail call i32 @setPixelColour(i32 %10, i32 %16, i32 0, i32 0, i32 0)
br label %37
37: ; preds = %35, %33
%38 = and i32 %14, 8
%39 = icmp eq i32 %38, 0
br i1 %39, label %42, label %40
40: ; preds = %37
%41 = tail call i32 @setPixelColour(i32 %11, i32 %16, i32 1, i32 1, i32 1)
br label %44
42: ; preds = %37
%43 = tail call i32 @setPixelColour(i32 %12, i32 %16, i32 0, i32 0, i32 0)
br label %44
44: ; preds = %42, %40
%45 = ashr i32 %14, 4
%46 = add nsw i32 %15, -1
%47 = icmp eq i32 %15, 0
br i1 %47, label %48, label %13
48: ; preds = %44
ret void
}