#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 */
char *malloc(int);
char *realloc(char *, int);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
char *tabular(int N) {
  if (N < 1) {
    return "";
  } else {
    char *str = malloc(sizeof("\t"));
    strcpy(str, "\t");
    if (N > 1) {
      int i;
      for (i = 1; i < N; i++) {
        str = realloc(str, (sizeof('\t')));
        strcat(str, "\t");
      }
    }
    return str;
  }
}


x86 assembly (clang, -O0):
<tabular>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jge    1165 <tabular+0x25>
lea    0xea5(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11dd <tabular+0x9d>
mov    $0x2,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xe82(%rip),%rsi
call   1030 <strcpy@plt>
cmpl   $0x1,-0xc(%rbp)
jle    11d5 <tabular+0x95>
movl   $0x1,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11d0 <tabular+0x90>
mov    -0x18(%rbp),%rdi
mov    $0x4,%esi
call   1050 <realloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xe43(%rip),%rsi
call   1060 <strcat@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1194 <tabular+0x54>
jmp    11d5 <tabular+0x95>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tabular>:
push   %r15
push   %r14
push   %rbx
test   %edi,%edi
jle    11a2 <tabular+0x62>
mov    %edi,%ebx
mov    $0x2,%edi
call   1040 <malloc@plt>
mov    %rax,%r14
lea    0xea1(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
cmp    $0x1,%ebx
je     11a9 <tabular+0x69>
add    $0xffffffff,%ebx
lea    0xe8a(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    $0x4,%esi
call   1050 <realloc@plt>
mov    %rax,%r14
mov    %rax,%rdi
mov    %r15,%rsi
call   1060 <strcat@plt>
add    $0xffffffff,%ebx
jne    1180 <tabular+0x40>
jmp    11a9 <tabular+0x69>
lea    0xe58(%rip),%r14
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [2 x i8] c"\09\00"
define i8* @tabular(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %14, label %3
3: ; preds = %1
%4 = tail call dereferenceable_or_null(2) i8* @malloc(i32 2)
%5 = tail call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i32 %0, 1
br i1 %6, label %14, label %7
7: ; preds = %3, %7
%8 = phi i32 [ %12, %7 ], [ 1, %3 ]
%9 = phi i8* [ %10, %7 ], [ %4, %3 ]
%10 = tail call i8* @realloc(i8* %9, i32 4)
%11 = tail call i32 @strcat(i8* %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%12 = add nuw nsw i32 %8, 1
%13 = icmp eq i32 %12, %0
br i1 %13, label %14, label %7
14: ; preds = %7, %3, %1
%15 = phi i8* [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %1 ], [ %4, %3 ], [ %10, %7 ]
ret i8* %15
}