#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 Int2base(int);
int /*<<< orphan*/ printf(char *, ...);
int printSeqNum(int seqnum[]) {
  int i;
  for (i = 0; seqnum[i] > 0 && seqnum[i] < 6; i++)
    printf("%c", Int2base(seqnum[i]));
  printf("\n");
  return -1;
}


x86 assembly (clang, -O0):
<printSeqNum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rcx
movslq -0xc(%rbp),%rdx
xor    %eax,%eax
cmpl   $0x0,(%rcx,%rdx,4)
mov    %al,-0xd(%rbp)
jle    115c <printSeqNum+0x3c>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpl   $0x6,(%rax,%rcx,4)
setl   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    116c <printSeqNum+0x4c>
jmp    119a <printSeqNum+0x7a>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
call   1040 <Int2base@plt>
mov    %eax,%esi
lea    0xe7b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <printSeqNum+0x13>
lea    0xe62(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printSeqNum>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%edi
lea    -0x1(%rdi),%eax
cmp    $0x4,%eax
ja     115a <printSeqNum+0x3a>
add    $0x4,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
call   1040 <Int2base@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
mov    (%rbx),%edi
lea    -0x1(%rdi),%eax
add    $0x4,%rbx
cmp    $0x5,%eax
jb     1140 <printSeqNum+0x20>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xffffffff,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @printSeqNum(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = add i32 %2, -1
%4 = icmp ult i32 %3, 5
br i1 %4, label %5, label %15
5: ; preds = %1, %5
%6 = phi i64 [ %10, %5 ], [ 0, %1 ]
%7 = phi i32 [ %12, %5 ], [ %2, %1 ]
%8 = tail call i32 @Int2base(i32 %7)
%9 = tail call i32 @putchar(i32 %8)
%10 = add nuw i64 %6, 1
%11 = getelementptr inbounds i32, i32* %0, i64 %10
%12 = load i32, i32* %11
%13 = add i32 %12, -1
%14 = icmp ult i32 %13, 5
br i1 %14, label %5, label %15
15: ; preds = %5, %1
%16 = tail call i32 @putchar(i32 10)
ret i32 -1
}