#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*/ outchar(int);
void DISPLAY_INT(int n) {
  int i;
  int temp;
  for (i = 7; i >= 0; i--) {
    temp = (n >> 4 * i) & 0x0f;
    outchar(temp >= 10 ? (temp + 55) : (temp + 48));
  }
  return;
}


x86 assembly (clang, -O0):
<DISPLAY_INT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x7,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1174 <DISPLAY_INT+0x64>
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x2,%ecx
sar    %cl,%eax
and    $0xf,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jl     1155 <DISPLAY_INT+0x45>
mov    -0xc(%rbp),%eax
add    $0x37,%eax
mov    %eax,-0x10(%rbp)
jmp    115e <DISPLAY_INT+0x4e>
mov    -0xc(%rbp),%eax
add    $0x30,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
call   1030 <outchar@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <DISPLAY_INT+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DISPLAY_INT>:
push   %rbx
mov    %edi,%ebx
shr    $0x1c,%edi
lea    0x37(%rdi),%eax
or     $0x30,%edi
cmp    $0xa0000000,%ebx
cmovae %eax,%edi
call   1030 <outchar@plt>
mov    %ebx,%eax
shr    $0x18,%eax
and    $0xf,%eax
lea    0x37(%rax),%ecx
lea    0x30(%rax),%edi
cmp    $0xa,%eax
cmovae %ecx,%edi
call   1030 <outchar@plt>
mov    %ebx,%eax
shr    $0x14,%eax
and    $0xf,%eax
lea    0x37(%rax),%ecx
lea    0x30(%rax),%edi
cmp    $0xa,%eax
cmovae %ecx,%edi
call   1030 <outchar@plt>
mov    %ebx,%eax
shr    $0x10,%eax
and    $0xf,%eax
lea    0x37(%rax),%ecx
lea    0x30(%rax),%edi
cmp    $0xa,%eax
cmovae %ecx,%edi
call   1030 <outchar@plt>
mov    %ebx,%eax
shr    $0xc,%eax
and    $0xf,%eax
lea    0x37(%rax),%ecx
lea    0x30(%rax),%edi
cmp    $0xa,%eax
cmovae %ecx,%edi
call   1030 <outchar@plt>
mov    %ebx,%eax
shr    $0x8,%eax
and    $0xf,%eax
lea    0x37(%rax),%ecx
lea    0x30(%rax),%edi
cmp    $0xa,%eax
cmovae %ecx,%edi
call   1030 <outchar@plt>
mov    %ebx,%eax
shr    $0x4,%eax
and    $0xf,%eax
lea    0x37(%rax),%ecx
lea    0x30(%rax),%edi
cmp    $0xa,%eax
cmovae %ecx,%edi
call   1030 <outchar@plt>
and    $0xf,%ebx
lea    0x37(%rbx),%eax
lea    0x30(%rbx),%edi
cmp    $0xa,%ebx
cmovae %eax,%edi
pop    %rbx
jmp    1030 <outchar@plt>

LLVM IR (-O0):
define void @DISPLAY_INT(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 7, i32* %3
br label %5
5: ; preds = %25, %1
%6 = load i32, i32* %3
%7 = icmp sge i32 %6, 0
br i1 %7, label %8, label %28
8: ; preds = %5
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = mul nsw i32 4, %10
%12 = ashr i32 %9, %11
%13 = and i32 %12, 15
store i32 %13, i32* %4
%14 = load i32, i32* %4
%15 = icmp sge i32 %14, 10
br i1 %15, label %16, label %19
16: ; preds = %8
%17 = load i32, i32* %4
%18 = add nsw i32 %17, 55
br label %22
19: ; preds = %8
%20 = load i32, i32* %4
%21 = add nsw i32 %20, 48
br label %22
22: ; preds = %19, %16
%23 = phi i32 [ %18, %16 ], [ %21, %19 ]
%24 = call i32 @outchar(i32 %23)
br label %25
25: ; preds = %22
%26 = load i32, i32* %3
%27 = add nsw i32 %26, -1
store i32 %27, i32* %3
br label %5
28: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @DISPLAY_INT(i32 %0) {
%2 = lshr i32 %0, 28
%3 = icmp ugt i32 %0, -1610612737
%4 = add nuw nsw i32 %2, 55
%5 = or i32 %2, 48
%6 = select i1 %3, i32 %4, i32 %5
%7 = tail call i32 @outchar(i32 %6)
%8 = lshr i32 %0, 24
%9 = and i32 %8, 15
%10 = icmp ugt i32 %9, 9
%11 = add nuw nsw i32 %9, 55
%12 = or i32 %9, 48
%13 = select i1 %10, i32 %11, i32 %12
%14 = tail call i32 @outchar(i32 %13)
%15 = lshr i32 %0, 20
%16 = and i32 %15, 15
%17 = icmp ugt i32 %16, 9
%18 = add nuw nsw i32 %16, 55
%19 = or i32 %16, 48
%20 = select i1 %17, i32 %18, i32 %19
%21 = tail call i32 @outchar(i32 %20)
%22 = lshr i32 %0, 16
%23 = and i32 %22, 15
%24 = icmp ugt i32 %23, 9
%25 = add nuw nsw i32 %23, 55
%26 = or i32 %23, 48
%27 = select i1 %24, i32 %25, i32 %26
%28 = tail call i32 @outchar(i32 %27)
%29 = lshr i32 %0, 12
%30 = and i32 %29, 15
%31 = icmp ugt i32 %30, 9
%32 = add nuw nsw i32 %30, 55
%33 = or i32 %30, 48
%34 = select i1 %31, i32 %32, i32 %33
%35 = tail call i32 @outchar(i32 %34)
%36 = lshr i32 %0, 8
%37 = and i32 %36, 15
%38 = icmp ugt i32 %37, 9
%39 = add nuw nsw i32 %37, 55
%40 = or i32 %37, 48
%41 = select i1 %38, i32 %39, i32 %40
%42 = tail call i32 @outchar(i32 %41)
%43 = lshr i32 %0, 4
%44 = and i32 %43, 15
%45 = icmp ugt i32 %44, 9
%46 = add nuw nsw i32 %44, 55
%47 = or i32 %44, 48
%48 = select i1 %45, i32 %46, i32 %47
%49 = tail call i32 @outchar(i32 %48)
%50 = and i32 %0, 15
%51 = icmp ugt i32 %50, 9
%52 = add nuw nsw i32 %50, 55
%53 = or i32 %50, 48
%54 = select i1 %51, i32 %52, i32 %53
%55 = tail call i32 @outchar(i32 %54)
ret void
}