#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*/ printf(char *, char *);
void printfU32String(uint32_t array) {
  char text[5];
  text[0] = (array >> 24) & 0xFF;
  text[1] = (array >> 16) & 0xFF;
  text[2] = (array >> 8) & 0xFF;
  text[3] = array & 0xFF;
  text[4] = 0;
  printf(" %s.\n", text);
}


x86 assembly (clang, -O0):
<printfU32String>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x18,%eax
and    $0xff,%eax
mov    %al,-0x9(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
and    $0xff,%eax
mov    %al,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,-0x7(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    %al,-0x6(%rbp)
movb   $0x0,-0x5(%rbp)
lea    -0x9(%rbp),%rsi
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printfU32String>:
push   %rax
mov    %edi,%eax
mov    %edi,%ecx
shr    $0x18,%ecx
mov    %cl,0x3(%rsp)
mov    %edi,%ecx
shr    $0x10,%ecx
mov    %cl,0x4(%rsp)
mov    %ah,0x5(%rsp)
mov    %al,0x6(%rsp)
movb   $0x0,0x7(%rsp)
lea    0xec7(%rip),%rdi
lea    0x3(%rsp),%rsi
call   1030 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [6 x i8] c" %s.\0A\00"
define void @printfU32String(i32 %0) {
%2 = alloca i32
%3 = alloca [5 x i8]
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = ashr i32 %4, 24
%6 = and i32 %5, 255
%7 = trunc i32 %6 to i8
%8 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 0
store i8 %7, i8* %8
%9 = load i32, i32* %2
%10 = ashr i32 %9, 16
%11 = and i32 %10, 255
%12 = trunc i32 %11 to i8
%13 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 1
store i8 %12, i8* %13
%14 = load i32, i32* %2
%15 = ashr i32 %14, 8
%16 = and i32 %15, 255
%17 = trunc i32 %16 to i8
%18 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 2
store i8 %17, i8* %18
%19 = load i32, i32* %2
%20 = and i32 %19, 255
%21 = trunc i32 %20 to i8
%22 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 3
store i8 %21, i8* %22
%23 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 4
store i8 0, i8* %23
%24 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 0
%25 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %24)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c" %s.\0A\00"
define void @printfU32String(i32 %0) {
%2 = alloca [5 x i8]
%3 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%4 = lshr i32 %0, 24
%5 = trunc i32 %4 to i8
store i8 %5, i8* %3
%6 = lshr i32 %0, 16
%7 = trunc i32 %6 to i8
%8 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 1
store i8 %7, i8* %8
%9 = lshr i32 %0, 8
%10 = trunc i32 %9 to i8
%11 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 2
store i8 %10, i8* %11
%12 = trunc i32 %0 to i8
%13 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 3
store i8 %12, i8* %13
%14 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 4
store i8 0, i8* %14
%15 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}