#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*/ printf(char *, int);
void converse(int N, int r) {
  int array[200], top;
  top = -1;
  while (N) {
    array[++top] = N % r;
    N = N / r;
  }
  while (top != -1) {
    printf("%d\t", array[top--]);
  }
}


x86 assembly (clang, -O0):
<converse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x340,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0xffffffff,-0x334(%rbp)
ff ff ff
cmpl   $0x0,-0x4(%rbp)
je     1163 <converse+0x53>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    -0x334(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x334(%rbp)
cltq
mov    %edx,-0x330(%rbp,%rax,4)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,-0x4(%rbp)
jmp    112b <converse+0x1b>
jmp    1168 <converse+0x58>
cmpl   $0xffffffff,-0x334(%rbp)
je     11a0 <converse+0x90>
mov    -0x334(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x334(%rbp)
cltq
mov    -0x330(%rbp,%rax,4),%esi
lea    0xe6a(%rip),%rdi
call   1030 <printf@plt>
jmp    1168 <converse+0x58>
add    $0x340,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<converse>:
push   %r14
push   %rbx
sub    $0x328,%rsp
test   %edi,%edi
je     1171 <converse+0x61>
mov    %edi,%eax
movabs $0xffffffff00000000,%rbx
ff ff ff
xor    %ecx,%ecx
movabs $0x100000000,%rdi
cs nopw 0x0(%rax,%rax,1)
cltd
idiv   %esi
mov    %edx,(%rsp,%rcx,4)
add    %rdi,%rbx
add    $0x1,%rcx
test   %eax,%eax
jne    1140 <converse+0x30>
test   %ecx,%ecx
je     1171 <converse+0x61>
sar    $0x20,%rbx
lea    0xea0(%rip),%r14
mov    (%rsp,%rbx,4),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0xffffffffffffffff,%rbx
jb     1160 <converse+0x50>
add    $0x328,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\09\00"
define void @converse(i32 %0, i32 %1) {
%3 = alloca [200 x i32]
%4 = bitcast [200 x i32]* %3 to i8*
%5 = icmp eq i32 %0, 0
br i1 %5, label %27, label %12
6: ; preds = %12
%7 = trunc i64 %16 to i32
%8 = icmp eq i32 %7, -1
br i1 %8, label %27, label %9
9: ; preds = %6
%10 = shl i64 %16, 32
%11 = ashr exact i64 %10, 32
br label %20
12: ; preds = %2, %12
%13 = phi i64 [ %16, %12 ], [ -1, %2 ]
%14 = phi i32 [ %18, %12 ], [ %0, %2 ]
%15 = srem i32 %14, %1
%16 = add nsw i64 %13, 1
%17 = getelementptr inbounds [200 x i32], [200 x i32]* %3, i64 0, i64 %16
store i32 %15, i32* %17
%18 = sdiv i32 %14, %1
%19 = icmp eq i32 %18, 0
br i1 %19, label %6, label %12
20: ; preds = %9, %20
%21 = phi i64 [ %11, %9 ], [ %22, %20 ]
%22 = add nsw i64 %21, -1
%23 = getelementptr inbounds [200 x i32], [200 x i32]* %3, i64 0, i64 %21
%24 = load i32, i32* %23
%25 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %24)
%26 = icmp eq i64 %21, 0
br i1 %26, label %27, label %20
27: ; preds = %20, %2, %6
ret void
}