#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 Degree(unsigned int *);
int /*<<< orphan*/ ToDecimal(unsigned int *, unsigned int *);
int /*<<< orphan*/ printf(char *, ...);
void Display(unsigned a[]) {
  int i;
  unsigned w[601];
  ToDecimal(a, w);
  i = Degree(w);
  printf("%4.1u ", w[i]);
  i--;
  while (i >= 0) {
    printf("%4.4u ", w[i]);
    i--;
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<Display>:
push   %rbp
mov    %rsp,%rbp
sub    $0x970,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x970(%rbp),%rsi
call   1040 <ToDecimal@plt>
lea    -0x970(%rbp),%rdi
call   1050 <Degree@plt>
mov    %eax,-0xc(%rbp)
movslq -0xc(%rbp),%rax
mov    -0x970(%rbp,%rax,4),%esi
lea    0xe90(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     11b1 <Display+0x81>
movslq -0xc(%rbp),%rax
mov    -0x970(%rbp,%rax,4),%esi
lea    0xe6b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1180 <Display+0x50>
lea    0xe56(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x970,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Display>:
push   %rbp
push   %r14
push   %rbx
sub    $0x970,%rsp
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1050 <ToDecimal@plt>
mov    %rbx,%rdi
call   1060 <Degree@plt>
mov    %eax,%ebp
movslq %eax,%rbx
mov    (%rsp,%rbx,4),%esi
lea    0xe93(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   %ebx,%ebx
jle    11aa <Display+0x6a>
mov    %ebp,%ebx
add    $0x1,%rbx
lea    0xe82(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nop
lea    -0x2(%rbx),%eax
mov    (%rsp,%rax,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0xffffffffffffffff,%rbx
cmp    $0x1,%rbx
ja     1190 <Display+0x50>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x970,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%4.1u \00"
@.str.1 = [7 x i8] c"%4.4u \00"
@.str.2 = [2 x i8] c"\0A\00"
define void @Display(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca [601 x i32]
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = getelementptr inbounds [601 x i32], [601 x i32]* %4, i64 0, i64 0
%7 = call i32 @ToDecimal(i32* %5, i32* %6)
%8 = getelementptr inbounds [601 x i32], [601 x i32]* %4, i64 0, i64 0
%9 = call i32 @Degree(i32* %8)
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [601 x i32], [601 x i32]* %4, i64 0, i64 %11
%13 = load i32, i32* %12
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %13)
%15 = load i32, i32* %3
%16 = add nsw i32 %15, -1
store i32 %16, i32* %3
br label %17
17: ; preds = %20, %1
%18 = load i32, i32* %3
%19 = icmp sge i32 %18, 0
br i1 %19, label %20, label %28
20: ; preds = %17
%21 = load i32, i32* %3
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [601 x i32], [601 x i32]* %4, i64 0, i64 %22
%24 = load i32, i32* %23
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %24)
%26 = load i32, i32* %3
%27 = add nsw i32 %26, -1
store i32 %27, i32* %3
br label %17
28: ; preds = %17
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%4.1u \00"
@.str.1 = [7 x i8] c"%4.4u \00"
define void @Display(i32* %0) {
%2 = alloca [601 x i32]
%3 = bitcast [601 x i32]* %2 to i8*
%4 = getelementptr inbounds [601 x i32], [601 x i32]* %2, i64 0, i64 0
%5 = call i32 @ToDecimal(i32* %0, i32* %4)
%6 = call i32 @Degree(i32* %4)
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds [601 x i32], [601 x i32]* %2, i64 0, i64 %7
%9 = load i32, i32* %8
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = icmp sgt i32 %6, 0
br i1 %11, label %12, label %22
12: ; preds = %1
%13 = zext i32 %6 to i64
br label %14
14: ; preds = %12, %14
%15 = phi i64 [ %13, %12 ], [ %16, %14 ]
%16 = add nsw i64 %15, -1
%17 = and i64 %16, 4294967295
%18 = getelementptr inbounds [601 x i32], [601 x i32]* %2, i64 0, i64 %17
%19 = load i32, i32* %18
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %19)
%21 = icmp ugt i64 %15, 1
br i1 %21, label %14, label %22
22: ; preds = %14, %1
%23 = call i32 @putchar(i32 10)
ret void
}