#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*/ orgfx_set_pixel(unsigned int, unsigned int, int);
void orgfx_print_reg(unsigned int xOffset, unsigned int yOffset,
                     unsigned int reg32) {
  unsigned int bit, x, y;
  for (bit = 0; bit < 32; ++bit) {
    int color = 0xffffffff;
    if (reg32 & (1 << (31 - bit)))
      color = 0xf800f800;
    for (y = 0; y < 10; ++y)
      for (x = 0; x < 10; x += 2)
        orgfx_set_pixel(x + xOffset, y + yOffset, color);
    xOffset += 12;
  }
}


x86 assembly (clang, -O0):
<orgfx_print_reg>:
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   $0x20,-0x10(%rbp)
jae    11cd <orgfx_print_reg+0xbd>
movl   $0xffffffff,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x1f,%ecx
sub    -0x10(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     115f <orgfx_print_reg+0x4f>
movl   $0xf800f800,-0x1c(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0xa,-0x18(%rbp)
jae    11b6 <orgfx_print_reg+0xa6>
movl   $0x0,-0x14(%rbp)
cmpl   $0xa,-0x14(%rbp)
jae    11a3 <orgfx_print_reg+0x93>
mov    -0x14(%rbp),%edi
add    -0x4(%rbp),%edi
mov    -0x18(%rbp),%esi
add    -0x8(%rbp),%esi
mov    -0x1c(%rbp),%edx
call   1030 <orgfx_set_pixel@plt>
mov    -0x14(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x14(%rbp)
jmp    1177 <orgfx_print_reg+0x67>
jmp    11a8 <orgfx_print_reg+0x98>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1166 <orgfx_print_reg+0x56>
mov    -0x4(%rbp),%eax
add    $0xc,%eax
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1128 <orgfx_print_reg+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<orgfx_print_reg>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %edx,0x8(%rsp)
mov    %esi,%r14d
mov    %rdi,(%rsp)
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
mov    0x8(%rsp),%eax
mov    %ecx,0xc(%rsp)
shl    %cl,%eax
and    $0x80000000,%eax
cmp    $0x1,%eax
sbb    %ebx,%ebx
or     $0xf800f800,%ebx
mov    (%rsp),%rax
lea    0x2(%rax),%ecx
mov    %ecx,0x14(%rsp)
lea    0x4(%rax),%ecx
mov    %ecx,0x10(%rsp)
lea    0x6(%rax),%r15d
lea    0x8(%rax),%r12d
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
lea    (%r14,%rbp,1),%r13d
mov    (%rsp),%rdi
mov    %r13d,%esi
mov    %ebx,%edx
call   1030 <orgfx_set_pixel@plt>
mov    0x14(%rsp),%edi
mov    %r13d,%esi
mov    %ebx,%edx
call   1030 <orgfx_set_pixel@plt>
mov    0x10(%rsp),%edi
mov    %r13d,%esi
mov    %ebx,%edx
call   1030 <orgfx_set_pixel@plt>
mov    %r15d,%edi
mov    %r13d,%esi
mov    %ebx,%edx
call   1030 <orgfx_set_pixel@plt>
mov    %r12d,%edi
mov    %r13d,%esi
mov    %ebx,%edx
call   1030 <orgfx_set_pixel@plt>
add    $0x1,%ebp
cmp    $0xa,%ebp
jne    1170 <orgfx_print_reg+0x60>
mov    (%rsp),%rax
add    $0xc,%eax
mov    %rax,(%rsp)
mov    0xc(%rsp),%ecx
add    $0x1,%ecx
cmp    $0x20,%ecx
jne    1130 <orgfx_print_reg+0x20>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @orgfx_print_reg(i32 %0, i32 %1, i32 %2) {
br label %4
4: ; preds = %3, %25
%5 = phi i32 [ 0, %3 ], [ %27, %25 ]
%6 = phi i32 [ %0, %3 ], [ %26, %25 ]
%7 = lshr i32 -2147483648, %5
%8 = and i32 %7, %2
%9 = icmp eq i32 %8, 0
%10 = select i1 %9, i32 -1, i32 -134154240
%11 = add i32 %6, 2
%12 = add i32 %6, 4
%13 = add i32 %6, 6
%14 = add i32 %6, 8
br label %15
15: ; preds = %4, %15
%16 = phi i32 [ 0, %4 ], [ %23, %15 ]
%17 = add i32 %16, %1
%18 = tail call i32 @orgfx_set_pixel(i32 %6, i32 %17, i32 %10)
%19 = tail call i32 @orgfx_set_pixel(i32 %11, i32 %17, i32 %10)
%20 = tail call i32 @orgfx_set_pixel(i32 %12, i32 %17, i32 %10)
%21 = tail call i32 @orgfx_set_pixel(i32 %13, i32 %17, i32 %10)
%22 = tail call i32 @orgfx_set_pixel(i32 %14, i32 %17, i32 %10)
%23 = add nuw nsw i32 %16, 1
%24 = icmp eq i32 %23, 10
br i1 %24, label %25, label %15
25: ; preds = %15
%26 = add i32 %6, 12
%27 = add nuw nsw i32 %5, 1
%28 = icmp eq i32 %27, 32
br i1 %28, label %29, label %4
29: ; preds = %25
ret void
}