#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*/ Call(int /*<<< orphan*/);
int /*<<< orphan*/ clock_extern_setPixel(unsigned int, int, unsigned int);
int clock_displayBinaryNumber(unsigned int number, unsigned int width,
                              unsigned int pos) {
  for (unsigned int y = 0; y < 8; ++y) {
    for (unsigned int x = pos, xLast = pos + width; x < xLast; ++x) {
      Call(clock_extern_setPixel(x, 8 - y - 1, number & 1U << y));
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<clock_displayBinaryNumber>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x8,-0x10(%rbp)
jae    11a7 <clock_displayBinaryNumber+0x87>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jae    1194 <clock_displayBinaryNumber+0x74>
mov    -0x14(%rbp),%edi
mov    $0x8,%esi
sub    -0x10(%rbp),%esi
sub    $0x1,%esi
mov    -0x4(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
and    %eax,%edx
call   1030 <clock_extern_setPixel@plt>
mov    %eax,%edi
call   1040 <Call@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1151 <clock_displayBinaryNumber+0x31>
jmp    1199 <clock_displayBinaryNumber+0x79>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1138 <clock_displayBinaryNumber+0x18>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clock_displayBinaryNumber>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %edx,%r12d
mov    %esi,%r14d
lea    (%r12,%r14,1),%r13d
cmp    %edx,%r13d
jbe    131a <clock_displayBinaryNumber+0x1fa>
mov    %edi,0x4(%rsp)
mov    %edi,%ebp
and    $0x1,%ebp
mov    %r14d,%r15d
mov    %r12d,%ebx
nopl   (%rax)
mov    %ebx,%edi
mov    $0x7,%esi
mov    %ebp,%edx
call   1030 <clock_extern_setPixel@plt>
mov    %eax,%edi
call   1040 <Call@plt>
add    $0x1,%ebx
add    $0xffffffff,%r15d
jne    1150 <clock_displayBinaryNumber+0x30>
cmp    %r12d,%r13d
mov    0x4(%rsp),%r15d
jbe    131a <clock_displayBinaryNumber+0x1fa>
and    $0x2,%r15d
mov    %r14d,%ebp
mov    %r12d,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    %ebx,%edi
mov    $0x6,%esi
mov    %r15d,%edx
call   1030 <clock_extern_setPixel@plt>
mov    %eax,%edi
call   1040 <Call@plt>
add    $0x1,%ebx
add    $0xffffffff,%ebp
jne    1190 <clock_displayBinaryNumber+0x70>
cmp    %r12d,%r13d
mov    0x4(%rsp),%r15d
jbe    131a <clock_displayBinaryNumber+0x1fa>
and    $0x4,%r15d
mov    %r14d,%ebp
mov    %r12d,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    %ebx,%edi
mov    $0x5,%esi
mov    %r15d,%edx
call   1030 <clock_extern_setPixel@plt>
mov    %eax,%edi
call   1040 <Call@plt>
add    $0x1,%ebx
add    $0xffffffff,%ebp
jne    11d0 <clock_displayBinaryNumber+0xb0>
cmp    %r12d,%r13d
mov    0x4(%rsp),%r15d
jbe    131a <clock_displayBinaryNumber+0x1fa>
and    $0x8,%r15d
mov    %r14d,%ebp
mov    %r12d,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    %ebx,%edi
mov    $0x4,%esi
mov    %r15d,%edx
call   1030 <clock_extern_setPixel@plt>
mov    %eax,%edi
call   1040 <Call@plt>
add    $0x1,%ebx
add    $0xffffffff,%ebp
jne    1210 <clock_displayBinaryNumber+0xf0>
cmp    %r12d,%r13d
mov    0x4(%rsp),%r15d
jbe    131a <clock_displayBinaryNumber+0x1fa>
and    $0x10,%r15d
mov    %r14d,%ebp
mov    %r12d,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    %ebx,%edi
mov    $0x3,%esi
mov    %r15d,%edx
call   1030 <clock_extern_setPixel@plt>
mov    %eax,%edi
call   1040 <Call@plt>
add    $0x1,%ebx
add    $0xffffffff,%ebp
jne    1250 <clock_displayBinaryNumber+0x130>
cmp    %r12d,%r13d
mov    0x4(%rsp),%r15d
jbe    131a <clock_displayBinaryNumber+0x1fa>
and    $0x20,%r15d
mov    %r14d,%ebp
mov    %r12d,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    %ebx,%edi
mov    $0x2,%esi
mov    %r15d,%edx
call   1030 <clock_extern_setPixel@plt>
mov    %eax,%edi
call   1040 <Call@plt>
add    $0x1,%ebx
add    $0xffffffff,%ebp
jne    1290 <clock_displayBinaryNumber+0x170>
cmp    %r12d,%r13d
mov    0x4(%rsp),%r15d
jbe    131a <clock_displayBinaryNumber+0x1fa>
and    $0x40,%r15d
mov    %r14d,%ebp
mov    %r12d,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %ebx,%edi
mov    $0x1,%esi
mov    %r15d,%edx
call   1030 <clock_extern_setPixel@plt>
mov    %eax,%edi
call   1040 <Call@plt>
add    $0x1,%ebx
add    $0xffffffff,%ebp
jne    12d0 <clock_displayBinaryNumber+0x1b0>
cmp    %r12d,%r13d
mov    0x4(%rsp),%ebx
jbe    131a <clock_displayBinaryNumber+0x1fa>
and    $0x80,%ebx
mov    %r12d,%edi
xor    %esi,%esi
mov    %ebx,%edx
call   1030 <clock_extern_setPixel@plt>
mov    %eax,%edi
call   1040 <Call@plt>
add    $0x1,%r12d
add    $0xffffffff,%r14d
jne    12fd <clock_displayBinaryNumber+0x1dd>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @clock_displayBinaryNumber(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
store i32 0, i32* %7
br label %10
10: ; preds = %37, %3
%11 = load i32, i32* %7
%12 = icmp ult i32 %11, 8
br i1 %12, label %13, label %40
13: ; preds = %10
%14 = load i32, i32* %6
store i32 %14, i32* %8
%15 = load i32, i32* %6
%16 = load i32, i32* %5
%17 = add i32 %15, %16
store i32 %17, i32* %9
br label %18
18: ; preds = %33, %13
%19 = load i32, i32* %8
%20 = load i32, i32* %9
%21 = icmp ult i32 %19, %20
br i1 %21, label %22, label %36
22: ; preds = %18
%23 = load i32, i32* %8
%24 = load i32, i32* %7
%25 = sub i32 8, %24
%26 = sub i32 %25, 1
%27 = load i32, i32* %4
%28 = load i32, i32* %7
%29 = shl i32 1, %28
%30 = and i32 %27, %29
%31 = call i32 @clock_extern_setPixel(i32 %23, i32 %26, i32 %30)
%32 = call i32 @Call(i32 %31)
br label %33
33: ; preds = %22
%34 = load i32, i32* %8
%35 = add i32 %34, 1
store i32 %35, i32* %8
br label %18
36: ; preds = %18
br label %37
37: ; preds = %36
%38 = load i32, i32* %7
%39 = add i32 %38, 1
store i32 %39, i32* %7
br label %10
40: ; preds = %10
ret i32 0
}

LLVM IR (-O2):
define i32 @clock_displayBinaryNumber(i32 %0, i32 %1, i32 %2) {
%4 = add i32 %2, %1
%5 = icmp ugt i32 %4, %2
br i1 %5, label %6, label %71
6: ; preds = %3
%7 = and i32 %0, 1
br label %72
8: ; preds = %72
br i1 %5, label %9, label %71
9: ; preds = %8
%10 = and i32 %0, 2
br label %11
11: ; preds = %11, %9
%12 = phi i32 [ %2, %9 ], [ %15, %11 ]
%13 = tail call i32 @clock_extern_setPixel(i32 %12, i32 6, i32 %10)
%14 = tail call i32 @Call(i32 %13)
%15 = add i32 %12, 1
%16 = icmp eq i32 %15, %4
br i1 %16, label %17, label %11
17: ; preds = %11
br i1 %5, label %18, label %71
18: ; preds = %17
%19 = and i32 %0, 4
br label %20
20: ; preds = %20, %18
%21 = phi i32 [ %2, %18 ], [ %24, %20 ]
%22 = tail call i32 @clock_extern_setPixel(i32 %21, i32 5, i32 %19)
%23 = tail call i32 @Call(i32 %22)
%24 = add i32 %21, 1
%25 = icmp eq i32 %24, %4
br i1 %25, label %26, label %20
26: ; preds = %20
br i1 %5, label %27, label %71
27: ; preds = %26
%28 = and i32 %0, 8
br label %29
29: ; preds = %29, %27
%30 = phi i32 [ %2, %27 ], [ %33, %29 ]
%31 = tail call i32 @clock_extern_setPixel(i32 %30, i32 4, i32 %28)
%32 = tail call i32 @Call(i32 %31)
%33 = add i32 %30, 1
%34 = icmp eq i32 %33, %4
br i1 %34, label %35, label %29
35: ; preds = %29
br i1 %5, label %36, label %71
36: ; preds = %35
%37 = and i32 %0, 16
br label %38
38: ; preds = %38, %36
%39 = phi i32 [ %2, %36 ], [ %42, %38 ]
%40 = tail call i32 @clock_extern_setPixel(i32 %39, i32 3, i32 %37)
%41 = tail call i32 @Call(i32 %40)
%42 = add i32 %39, 1
%43 = icmp eq i32 %42, %4
br i1 %43, label %44, label %38
44: ; preds = %38
br i1 %5, label %45, label %71
45: ; preds = %44
%46 = and i32 %0, 32
br label %47
47: ; preds = %47, %45
%48 = phi i32 [ %2, %45 ], [ %51, %47 ]
%49 = tail call i32 @clock_extern_setPixel(i32 %48, i32 2, i32 %46)
%50 = tail call i32 @Call(i32 %49)
%51 = add i32 %48, 1
%52 = icmp eq i32 %51, %4
br i1 %52, label %53, label %47
53: ; preds = %47
br i1 %5, label %54, label %71
54: ; preds = %53
%55 = and i32 %0, 64
br label %56
56: ; preds = %56, %54
%57 = phi i32 [ %2, %54 ], [ %60, %56 ]
%58 = tail call i32 @clock_extern_setPixel(i32 %57, i32 1, i32 %55)
%59 = tail call i32 @Call(i32 %58)
%60 = add i32 %57, 1
%61 = icmp eq i32 %60, %4
br i1 %61, label %62, label %56
62: ; preds = %56
br i1 %5, label %63, label %71
63: ; preds = %62
%64 = and i32 %0, 128
br label %65
65: ; preds = %65, %63
%66 = phi i32 [ %2, %63 ], [ %69, %65 ]
%67 = tail call i32 @clock_extern_setPixel(i32 %66, i32 0, i32 %64)
%68 = tail call i32 @Call(i32 %67)
%69 = add i32 %66, 1
%70 = icmp eq i32 %69, %4
br i1 %70, label %71, label %65
71: ; preds = %65, %3, %8, %17, %26, %35, %44, %53, %62
ret i32 0
72: ; preds = %6, %72
%73 = phi i32 [ %2, %6 ], [ %76, %72 ]
%74 = tail call i32 @clock_extern_setPixel(i32 %73, i32 7, i32 %7)
%75 = tail call i32 @Call(i32 %74)
%76 = add i32 %73, 1
%77 = icmp eq i32 %76, %4
br i1 %77, label %8, label %72
}