#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*/ gemination(int *);
int /*<<< orphan*/ incbig(int *);
void decimal(int *x, int *y) {
  int i;
  y[0] = 1;
  y[1] = 0;
  for (i = x[0]; i >= 1; i--) {
    gemination(y);
    if (x[i])
      incbig(y);
  }
}


x86 assembly (clang, -O0):
<decimal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x0,0x4(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x1,-0x14(%rbp)
jl     118f <decimal+0x6f>
mov    -0x10(%rbp),%rdi
call   1040 <gemination@plt>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     117c <decimal+0x5c>
mov    -0x10(%rbp),%rdi
call   1030 <incbig@plt>
jmp    1181 <decimal+0x61>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    114e <decimal+0x2e>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decimal>:
push   %r15
push   %r14
push   %rbx
movq   $0x1,(%rsi)
mov    (%rdi),%ebx
test   %ebx,%ebx
jle    1164 <decimal+0x44>
mov    %rsi,%r15
mov    %rdi,%r14
add    $0x1,%rbx
jmp    114a <decimal+0x2a>
xchg   %ax,%ax
add    $0xffffffffffffffff,%rbx
cmp    $0x1,%rbx
jle    1164 <decimal+0x44>
mov    %r15,%rdi
call   1040 <gemination@plt>
cmpl   $0x0,-0x4(%r14,%rbx,4)
je     1140 <decimal+0x20>
mov    %r15,%rdi
call   1030 <incbig@plt>
jmp    1140 <decimal+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @decimal(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %4
%7 = getelementptr inbounds i32, i32* %6, i64 0
store i32 1, i32* %7
%8 = load i32*, i32** %4
%9 = getelementptr inbounds i32, i32* %8, i64 1
store i32 0, i32* %9
%10 = load i32*, i32** %3
%11 = getelementptr inbounds i32, i32* %10, i64 0
%12 = load i32, i32* %11
store i32 %12, i32* %5
br label %13
13: ; preds = %29, %2
%14 = load i32, i32* %5
%15 = icmp sge i32 %14, 1
br i1 %15, label %16, label %32
16: ; preds = %13
%17 = load i32*, i32** %4
%18 = call i32 @gemination(i32* %17)
%19 = load i32*, i32** %3
%20 = load i32, i32* %5
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i32, i32* %19, i64 %21
%23 = load i32, i32* %22
%24 = icmp ne i32 %23, 0
br i1 %24, label %25, label %28
25: ; preds = %16
%26 = load i32*, i32** %4
%27 = call i32 @incbig(i32* %26)
br label %28
28: ; preds = %25, %16
br label %29
29: ; preds = %28
%30 = load i32, i32* %5
%31 = add nsw i32 %30, -1
store i32 %31, i32* %5
br label %13
32: ; preds = %13
ret void
}

LLVM IR (-O2):
define void @decimal(i32* nocapture %0, i32* %1) {
store i32 1, i32* %1
%3 = getelementptr inbounds i32, i32* %1, i64 1
store i32 0, i32* %3
%4 = load i32, i32* %0
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %19
6: ; preds = %2
%7 = zext i32 %4 to i64
br label %8
8: ; preds = %6, %16
%9 = phi i64 [ %7, %6 ], [ %17, %16 ]
%10 = tail call i32 @gemination(i32* %1)
%11 = getelementptr inbounds i32, i32* %0, i64 %9
%12 = load i32, i32* %11
%13 = icmp eq i32 %12, 0
br i1 %13, label %16, label %14
14: ; preds = %8
%15 = tail call i32 @incbig(i32* %1)
br label %16
16: ; preds = %8, %14
%17 = add nsw i64 %9, -1
%18 = icmp sgt i64 %9, 1
br i1 %18, label %8, label %19
19: ; preds = %16, %2
ret void
}