#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*/ putchar(char);
void binary32(unsigned long value) {
  int i;
  for (i = 0; i < 32; i++, value <<= 1) {
    (void)putchar((1 << 31 & value) ? '1' : '0');
    if (i == 23 || i == 15 || i == 7)
      (void)putchar(' ');
  }
  (void)putchar('\n');
}


x86 assembly (clang, -O0):
<binary32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x20,-0xc(%rbp)
jge    1198 <binary32+0x88>
mov    -0x8(%rbp),%rdx
and    $0xffffffff80000000,%rdx
mov    $0x30,%eax
mov    $0x31,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
movsbl %al,%edi
call   1030 <putchar@plt>
cmpl   $0x17,-0xc(%rbp)
je     116f <binary32+0x5f>
cmpl   $0xf,-0xc(%rbp)
je     116f <binary32+0x5f>
cmpl   $0x7,-0xc(%rbp)
jne    1179 <binary32+0x69>
mov    $0x20,%edi
call   1030 <putchar@plt>
jmp    117e <binary32+0x6e>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1123 <binary32+0x13>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<binary32>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %ebp,%ebp
jmp    1135 <binary32+0x25>
nopw   0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0x1,%ebp
add    %rbx,%rbx
cmp    $0x20,%ebp
je     1162 <binary32+0x52>
mov    %rbx,%rax
and    $0xffffffff80000000,%rax
cmp    $0x1,%rax
mov    $0x31,%edi
sbb    $0x0,%edi
call   1030 <putchar@plt>
cmp    $0xf,%ebp
je     1120 <binary32+0x10>
mov    %ebp,%eax
and    $0x7fffffef,%eax
cmp    $0x7,%eax
jne    112a <binary32+0x1a>
jmp    1120 <binary32+0x10>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define void @binary32(i64 %0) {
%2 = alloca i64
%3 = alloca i32
store i64 %0, i64* %2
store i32 0, i32* %3
br label %4
4: ; preds = %26, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 32
br i1 %6, label %7, label %31
7: ; preds = %4
%8 = load i64, i64* %2
%9 = and i64 -2147483648, %8
%10 = icmp ne i64 %9, 0
%11 = zext i1 %10 to i64
%12 = select i1 %10, i32 49, i32 48
%13 = trunc i32 %12 to i8
%14 = call i32 @putchar(i8 signext %13)
%15 = load i32, i32* %3
%16 = icmp eq i32 %15, 23
br i1 %16, label %23, label %17
17: ; preds = %7
%18 = load i32, i32* %3
%19 = icmp eq i32 %18, 15
br i1 %19, label %23, label %20
20: ; preds = %17
%21 = load i32, i32* %3
%22 = icmp eq i32 %21, 7
br i1 %22, label %23, label %25
23: ; preds = %20, %17, %7
%24 = call i32 @putchar(i8 signext 32)
br label %25
25: ; preds = %23, %20
br label %26
26: ; preds = %25
%27 = load i32, i32* %3
%28 = add nsw i32 %27, 1
store i32 %28, i32* %3
%29 = load i64, i64* %2
%30 = shl i64 %29, 1
store i64 %30, i64* %2
br label %4
31: ; preds = %4
%32 = call i32 @putchar(i8 signext 10)
ret void
}

LLVM IR (-O2):
define void @binary32(i64 %0) {
br label %2
2: ; preds = %1, %14
%3 = phi i32 [ 0, %1 ], [ %15, %14 ]
%4 = phi i64 [ %0, %1 ], [ %16, %14 ]
%5 = icmp ult i64 %4, 2147483648
%6 = select i1 %5, i8 48, i8 49
%7 = tail call i32 @putchar(i8 signext %6)
%8 = icmp eq i32 %3, 15
%9 = and i32 %3, 2147483631
%10 = icmp eq i32 %9, 7
%11 = or i1 %8, %10
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = tail call i32 @putchar(i8 signext 32)
br label %14
14: ; preds = %12, %2
%15 = add nuw nsw i32 %3, 1
%16 = shl i64 %4, 1
%17 = icmp eq i32 %15, 32
br i1 %17, label %18, label %2
18: ; preds = %14
%19 = tail call i32 @putchar(i8 signext 10)
ret void
}